Added "set as dvm template" to VM settings
Added an 'Advanced' settings checkbox that allows the user to set a given VM as template fo dispvms. It sets both the template_for_dispvms property and the appmenus-dispvm feature - instead of delving into particulars of how and which should be set, the user can just turn off the whole setting if they want to make some changes in the vm and then turn it on again. fixes QubesOS/qubes-issues#4004
This commit is contained in:
parent
52188318b8
commit
ef6288f1ff
@ -704,6 +704,11 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
|
|||||||
self.seamless_on_button.clicked.connect(self.enable_seamless)
|
self.seamless_on_button.clicked.connect(self.enable_seamless)
|
||||||
self.seamless_off_button.clicked.connect(self.disable_seamless)
|
self.seamless_off_button.clicked.connect(self.disable_seamless)
|
||||||
|
|
||||||
|
if hasattr(self.vm, "template_for_dispvms"):
|
||||||
|
self.dvm_template_checkbox.setChecked(self.vm.template_for_dispvms)
|
||||||
|
else:
|
||||||
|
self.dvm_template_checkbox.setVisible(False)
|
||||||
|
|
||||||
def enable_seamless(self):
|
def enable_seamless(self):
|
||||||
self.vm.run_service_for_stdio("qubes.SetGuiMode", input=b'SEAMLESS')
|
self.vm.run_service_for_stdio("qubes.SetGuiMode", input=b'SEAMLESS')
|
||||||
|
|
||||||
@ -759,6 +764,18 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
|
|||||||
except Exception as ex: # pylint: disable=broad-except
|
except Exception as ex: # pylint: disable=broad-except
|
||||||
msg.append(str(ex))
|
msg.append(str(ex))
|
||||||
|
|
||||||
|
if getattr(self.vm, "template_for_dispvms", False) != \
|
||||||
|
self.dvm_template_checkbox.isChecked():
|
||||||
|
try:
|
||||||
|
self.vm.template_for_dispvms = \
|
||||||
|
self.dvm_template_checkbox.isChecked()
|
||||||
|
if self.dvm_template_checkbox.isChecked():
|
||||||
|
self.vm.features["appmenus-dispvm"] = True
|
||||||
|
else:
|
||||||
|
del self.vm.features["appmenus-dispvm"]
|
||||||
|
except Exception as ex: # pylint: disable=broad-except
|
||||||
|
msg.append(str(ex))
|
||||||
|
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def include_in_balancing_changed(self, state):
|
def include_in_balancing_changed(self, state):
|
||||||
|
@ -779,7 +779,7 @@ border-width: 1px;</string>
|
|||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>15</number>
|
<number>15</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="1" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="label_26">
|
<widget class="QLabel" name="label_26">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Default DispVM:</string>
|
<string>Default DispVM:</string>
|
||||||
@ -789,17 +789,17 @@ border-width: 1px;</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QComboBox" name="default_dispvm"/>
|
<widget class="QComboBox" name="default_dispvm"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" colspan="2">
|
<item row="3" column="0" colspan="2">
|
||||||
<widget class="QPushButton" name="boot_from_device_button">
|
<widget class="QPushButton" name="boot_from_device_button">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Boot qube from CDROM</string>
|
<string>Boot qube from CDROM</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" colspan="2">
|
<item row="4" column="0" colspan="2">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="seamless_on_button">
|
<widget class="QPushButton" name="seamless_on_button">
|
||||||
@ -825,6 +825,16 @@ The qube must be running to disable seamless mode; this setting is not persisten
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="dvm_template_checkbox">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Allow starting DisposableVMs from this qube</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user