From 589f2e7eb7365ced3ce1188c6f67bb4f370f6aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 29 Dec 2013 04:59:59 +0100 Subject: [PATCH] backups: allow to enter custom backup location (restore) If "dom0" chosen, verify if the location exists. --- qubesmanager/restore.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qubesmanager/restore.py b/qubesmanager/restore.py index 0ca4e04..bad9ce9 100644 --- a/qubesmanager/restore.py +++ b/qubesmanager/restore.py @@ -86,6 +86,7 @@ class RestoreVMsWindow(Ui_Restore, QWizard): self.connect(self.dev_combobox, SIGNAL("activated(int)"), self.dev_combobox_activated) self.connect(self, SIGNAL("restore_progress(QString)"), self.commit_text_edit.append) self.connect(self, SIGNAL("backup_progress(int)"), self.progress_bar.setValue) + self.dir_line_edit.connect(self.dir_line_edit, SIGNAL("textChanged(QString)"), self.backup_location_changed) self.select_dir_page.isComplete = self.has_selected_dir self.select_vms_page.isComplete = self.has_selected_vms @@ -274,6 +275,14 @@ class RestoreVMsWindow(Ui_Restore, QWizard): def has_selected_vms(self): return self.select_vms_widget.selected_list.count() > 0 + def backup_location_changed(self, new_dir = None): + if self.appvm_combobox.currentText() != "dom0" or \ + os.path.isfile(str(self.dir_line_edit.text())) or \ + os.path.isfile(os.path.join(str(self.dir_line_edit.text()), 'qubes.xml')): + self.backup_location = str(self.dir_line_edit.text()) + else: + self.backup_location = None + self.select_dir_page.emit(SIGNAL("completeChanged()")) # Bases on the original code by: