Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added "set as dvm template" to VM settings #151

Merged
merged 1 commit into from
Feb 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions qubesmanager/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,11 @@ def __init_advanced_tab__(self):
self.seamless_on_button.clicked.connect(self.enable_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):
self.vm.run_service_for_stdio("qubes.SetGuiMode", input=b'SEAMLESS')

Expand Down Expand Up @@ -759,6 +764,18 @@ def __apply_advanced_tab__(self):
except Exception as ex: # pylint: disable=broad-except
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

def include_in_balancing_changed(self, state):
Expand Down
18 changes: 14 additions & 4 deletions ui/settingsdlg.ui
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ border-width: 1px;</string>
<property name="topMargin">
<number>15</number>
</property>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QLabel" name="label_26">
<property name="text">
<string>Default DispVM:</string>
Expand All @@ -789,17 +789,17 @@ border-width: 1px;</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="2" column="1">
<widget class="QComboBox" name="default_dispvm"/>
</item>
<item row="2" column="0" colspan="2">
<item row="3" column="0" colspan="2">
<widget class="QPushButton" name="boot_from_device_button">
<property name="text">
<string>Boot qube from CDROM</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<item row="4" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QPushButton" name="seamless_on_button">
Expand All @@ -825,6 +825,16 @@ The qube must be running to disable seamless mode; this setting is not persisten
</item>
</layout>
</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>
</widget>
</item>
Expand Down