From 0b0297f129156f8e4c7cc53343d81a78ccae3c18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 10 Jan 2014 03:37:28 +0100 Subject: [PATCH] backups: default file select state to previously selected directory --- qubesmanager/backup_utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qubesmanager/backup_utils.py b/qubesmanager/backup_utils.py index 2f48418..d783dbf 100644 --- a/qubesmanager/backup_utils.py +++ b/qubesmanager/backup_utils.py @@ -167,7 +167,7 @@ def dev_combobox_activated(dialog, idx): def select_path_button_clicked(dialog, select_file = False): - dialog.backup_location = dialog.dir_line_edit.text() + dialog.backup_location = str(dialog.dir_line_edit.text()) file_dialog = QFileDialog() file_dialog.setReadOnly(True) @@ -183,13 +183,14 @@ def select_path_button_clicked(dialog, select_file = False): elif dialog.dev_mount_path != None: new_path = file_dialog_function(dialog, "Select backup location.", dialog.dev_mount_path) else: - new_path = file_dialog_function(dialog, "Select backup location.", "~") + new_path = file_dialog_function(dialog, "Select backup location.", dialog.backup_location) if new_path != None: + new_path = str(new_path) if os.path.basename(new_path) == 'qubes.xml': - dialog.backup_location = os.path.dirname(str(new_path)) + dialog.backup_location = os.path.dirname(new_path) else: - dialog.backup_location = str(new_path) + dialog.backup_location = new_path dialog.dir_line_edit.setText(dialog.backup_location) if (new_path or new_appvm) and len(dialog.backup_location) > 0: