Fixed error in selecting backup directory in GUI backup

Also removed unused settings.

fixes QubesOS/qubes-issues#5430
This commit is contained in:
Marta Marczykowska-Górecka 2019-10-29 00:15:29 +01:00
parent 15a2e745d5
commit afad888343
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B
2 changed files with 17 additions and 6 deletions

View File

@ -65,7 +65,6 @@ class BackupVMsWindow(ui_backupdlg.Ui_Backup, QtWidgets.QWizard):
self.qt_app = qt_app
self.qubes_app = qubes_app
self.backup_settings = QtCore.QSettings()
self.selected_vms = []
self.thread = None

View File

@ -81,15 +81,27 @@ def select_path_button_clicked(dialog, select_file=False, read_only=False):
file_dialog_function = file_dialog.getOpenFileName
else:
file_dialog_function = file_dialog.getExistingDirectory
new_path, _ = file_dialog_function(
result = file_dialog_function(
dialog,
dialog.tr("Select backup location."),
backup_location if backup_location else '/')
if isinstance(result, tuple):
new_path = result[0]
else:
new_path = result
else:
new_path = utils.get_path_from_vm(
vm,
"qubes.SelectFile" if select_file
else "qubes.SelectDirectory")
try:
new_path = utils.get_path_from_vm(
vm,
"qubes.SelectFile" if select_file
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:
if not read_only:
QtWidgets.QMessageBox.warning(