From e904f5e41011b341f4f3fa294addcc1eaa688d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Thu, 6 Aug 2020 21:52:42 +0200 Subject: [PATCH] Modified warning shown when destination qube for backup is unavailable Instead of scary red warning, now a gentler information that only running qubes are available is shown. It is also shown just under the destination VM dropdown, making it easier to notice and interpret correctly. fixes QubesOS/qubes-issues#5427 --- qubesmanager/backup.py | 5 ++++- qubesmanager/tests/test_backup.py | 2 +- ui/backupdlg.ui | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/qubesmanager/backup.py b/qubesmanager/backup.py index 651a996..8c90364 100644 --- a/qubesmanager/backup.py +++ b/qubesmanager/backup.py @@ -170,7 +170,10 @@ class BackupVMsWindow(ui_backupdlg.Ui_Backup, QtWidgets.QWizard): if dest_vm_idx > -1: self.appvm_combobox.setCurrentIndex(dest_vm_idx) else: - self.unrecognized_config_label.setVisible(True) + self.warning_running_label.setText( + "NOTE: Only running qubes are listed. The profile " + "lists {} as the destination qube, but it is not " + "currently running.".format(dest_vm_name)) if 'destination_path' in profile_data: dest_path = profile_data['destination_path'] diff --git a/qubesmanager/tests/test_backup.py b/qubesmanager/tests/test_backup.py index 013033e..e6475c2 100644 --- a/qubesmanager/tests/test_backup.py +++ b/qubesmanager/tests/test_backup.py @@ -391,7 +391,7 @@ class BackupTest(unittest.TestCase): self.dialog.show() # check errors were detected - self.assertTrue(self.dialog.unrecognized_config_label.isVisible()) + self.assertIn('incorrect_vm', self.dialog.warning_running_label.text()) @unittest.mock.patch('qubesmanager.backup_utils.load_backup_profile') @unittest.mock.patch('PyQt5.QtWidgets.QMessageBox.information') diff --git a/ui/backupdlg.ui b/ui/backupdlg.ui index e786bb0..f1f7818 100644 --- a/ui/backupdlg.ui +++ b/ui/backupdlg.ui @@ -292,7 +292,7 @@ - + true