Fixed error in selecting backup directory in GUI backup
Also removed unused settings. fixes QubesOS/qubes-issues#5430
This commit is contained in:
parent
15a2e745d5
commit
afad888343
@ -65,7 +65,6 @@ class BackupVMsWindow(ui_backupdlg.Ui_Backup, QtWidgets.QWizard):
|
|||||||
|
|
||||||
self.qt_app = qt_app
|
self.qt_app = qt_app
|
||||||
self.qubes_app = qubes_app
|
self.qubes_app = qubes_app
|
||||||
self.backup_settings = QtCore.QSettings()
|
|
||||||
|
|
||||||
self.selected_vms = []
|
self.selected_vms = []
|
||||||
self.thread = None
|
self.thread = None
|
||||||
|
@ -81,15 +81,27 @@ def select_path_button_clicked(dialog, select_file=False, read_only=False):
|
|||||||
file_dialog_function = file_dialog.getOpenFileName
|
file_dialog_function = file_dialog.getOpenFileName
|
||||||
else:
|
else:
|
||||||
file_dialog_function = file_dialog.getExistingDirectory
|
file_dialog_function = file_dialog.getExistingDirectory
|
||||||
new_path, _ = file_dialog_function(
|
result = file_dialog_function(
|
||||||
dialog,
|
dialog,
|
||||||
dialog.tr("Select backup location."),
|
dialog.tr("Select backup location."),
|
||||||
backup_location if backup_location else '/')
|
backup_location if backup_location else '/')
|
||||||
|
if isinstance(result, tuple):
|
||||||
|
new_path = result[0]
|
||||||
else:
|
else:
|
||||||
|
new_path = result
|
||||||
|
else:
|
||||||
|
try:
|
||||||
new_path = utils.get_path_from_vm(
|
new_path = utils.get_path_from_vm(
|
||||||
vm,
|
vm,
|
||||||
"qubes.SelectFile" if select_file
|
"qubes.SelectFile" if select_file
|
||||||
else "qubes.SelectDirectory")
|
else "qubes.SelectDirectory")
|
||||||
|
except ValueError:
|
||||||
|
QtWidgets.QMessageBox.warning(
|
||||||
|
dialog,
|
||||||
|
dialog.tr("Unexpected characters in path!"),
|
||||||
|
dialog.tr("Backup path can only contain the following "
|
||||||
|
"special characters: /:.,_+=() -"))
|
||||||
|
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
if not read_only:
|
if not read_only:
|
||||||
QtWidgets.QMessageBox.warning(
|
QtWidgets.QMessageBox.warning(
|
||||||
|
Loading…
Reference in New Issue
Block a user