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.
This commit is contained in:
parent
5a4c1f2382
commit
c8a8a56c73
@ -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()]
|
||||
|
@ -48,7 +48,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Name && label:</string>
|
||||
<string><html><head/><body><p>Name &amp;&amp; label<span style=" color:#ff0000;">*</span>:</p></body></html></string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>vmname</cstring>
|
||||
@ -271,7 +271,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="5" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@ -356,6 +356,13 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string><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></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="advanced_tab">
|
||||
|
Loading…
Reference in New Issue
Block a user