From 8218f5fde11c1c16005da9a5aab9ccdc0bf4d7bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Tue, 20 Feb 2018 20:32:00 +0100 Subject: [PATCH] Added 'Apply' button to VM Settings Simple "Apply" button. fixes QubesOS/qubes-issues#3321 --- qubesmanager/settings.py | 17 ++++++++++++----- ui/settingsdlg.ui | 6 +++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/qubesmanager/settings.py b/qubesmanager/settings.py index c441bc6..45b3473 100755 --- a/qubesmanager/settings.py +++ b/qubesmanager/settings.py @@ -76,10 +76,12 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog): assert idx in range(self.tabWidget.count()) self.tabWidget.setCurrentIndex(idx) - self.connect(self.buttonBox, - QtCore.SIGNAL("accepted()"), - self.save_and_apply) - self.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), self.reject) + self.buttonBox.button(QtGui.QDialogButtonBox.Ok).clicked.connect( + self.save_and_apply) + self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).clicked.connect( + self.reject) + self.buttonBox.button(QtGui.QDialogButtonBox.Apply).clicked.connect( + self.apply) self.tabWidget.currentChanged.connect(self.current_tab_changed) @@ -152,7 +154,7 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog): def accept(self): pass - def save_and_apply(self): + def save_changes(self): t_monitor = thread_monitor.ThreadMonitor() thread = threading.Thread(target=self.__save_changes__, args=(t_monitor,)) @@ -179,6 +181,11 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog): ).format(self.vm.name), self.tr("ERROR: {0}").format(t_monitor.error_msg)) + def apply(self): + self.save_changes() + + def save_and_apply(self): + self.save_changes() self.done(0) def __save_changes__(self, t_monitor): diff --git a/ui/settingsdlg.ui b/ui/settingsdlg.ui index a5602f8..f5859fe 100644 --- a/ui/settingsdlg.ui +++ b/ui/settingsdlg.ui @@ -6,8 +6,8 @@ 0 0 - 917 - 573 + 1587 + 861 @@ -1331,7 +1331,7 @@ border-width: 1px; Qt::Horizontal - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok