From c8a8a56c73591813018fb416d24e52b8d57f1e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 28 Oct 2014 04:55:14 +0100 Subject: [PATCH] settings: prevent changing VM name and label while the VM is running Those changes will take effect after VM restart (at least for VM windows borders), so to not confuse the user with partly updated colors, simply block the change while the VM is running. The same applies to VM name. --- qubesmanager/settings.py | 2 ++ settingsdlg.ui | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/qubesmanager/settings.py b/qubesmanager/settings.py index eb20ac5..48e5011 100755 --- a/qubesmanager/settings.py +++ b/qubesmanager/settings.py @@ -212,6 +212,7 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): def __init_basic_tab__(self): self.vmname.setText(self.vm.name) self.vmname.setValidator(QRegExpValidator(QRegExp("[a-zA-Z0-9-]*", Qt.CaseInsensitive), None)) + self.vmname.setEnabled(not self.vm.is_running()) #self.qvm_collection.lock_db_for_reading() #self.qvm_collection.load() @@ -230,6 +231,7 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): self.vmlabel.insertItem(i, label.name) self.vmlabel.setItemIcon (i, QIcon(label.icon_path)) self.vmlabel.setCurrentIndex(self.label_idx) + self.vmlabel.setEnabled(not self.vm.is_running()) if not self.vm.is_template() and self.vm.template is not None: template_vm_list = [vm for vm in self.qvm_collection.values() if not vm.internal and vm.is_template()] diff --git a/settingsdlg.ui b/settingsdlg.ui index b4c1318..cc1d7ca 100644 --- a/settingsdlg.ui +++ b/settingsdlg.ui @@ -48,7 +48,7 @@ - Name && label: + <html><head/><body><p>Name &amp;&amp; label<span style=" color:#ff0000;">*</span>:</p></body></html> vmname @@ -271,7 +271,7 @@ - + Qt::Vertical @@ -356,6 +356,13 @@ + + + + <html><head/><body><p><span style=" color:#ff0000;">* </span><span style=" color:#000000;">Cannot be changed while the VM is running</span></p></body></html> + + +