From e1e60f692cfd225dcee59f0c382a79b643a4ee85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 29 Dec 2013 04:31:20 +0100 Subject: [PATCH] backups: allow to select backup in old format (directory instead of file) New backup is store in one file, but old one in a whole directory. While selecting old backup, the user need to point 'qubes.xml' file. --- qubesmanager/backup_utils.py | 7 +++++-- restoredlg.ui | 20 +++++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/qubesmanager/backup_utils.py b/qubesmanager/backup_utils.py index 2cfb235..2f48418 100644 --- a/qubesmanager/backup_utils.py +++ b/qubesmanager/backup_utils.py @@ -186,8 +186,11 @@ def select_path_button_clicked(dialog, select_file = False): new_path = file_dialog_function(dialog, "Select backup location.", "~") if new_path != None: - dialog.dir_line_edit.setText(new_path) - dialog.backup_location = new_path + if os.path.basename(new_path) == 'qubes.xml': + dialog.backup_location = os.path.dirname(str(new_path)) + else: + dialog.backup_location = str(new_path) + dialog.dir_line_edit.setText(dialog.backup_location) if (new_path or new_appvm) and len(dialog.backup_location) > 0: dialog.select_dir_page.emit(SIGNAL("completeChanged()")) diff --git a/restoredlg.ui b/restoredlg.ui index 8810bf4..5a0fc9f 100644 --- a/restoredlg.ui +++ b/restoredlg.ui @@ -78,6 +78,12 @@ + + + 0 + 132 + + 50 @@ -130,8 +136,20 @@ + + + 0 + 41 + + - Backup directory: + <html><head/><body><p>Backup directory:<br><span style=" font-size:8pt;">(for old backup format select qubes.xml file)</span></p></body></html> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true