Skip to content

Commit

Permalink
Disable "Disposable template" checkbox if not applicable
Browse files Browse the repository at this point in the history
fixes: QubesOS/qubes-issues#7217
(cherry picked from commit a07deea)
  • Loading branch information
alimirjamali authored and marmarek committed Sep 2, 2024
1 parent 01ad84f commit 18c20dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions qubesmanager/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,9 @@ def __init_advanced_tab__(self):
self.dvm_template_checkbox.setChecked(
getattr(self.vm, 'template_for_dispvms', False))

if not hasattr(self.vm, 'template_for_dispvms'):
self.dvm_template_checkbox.setEnabled(False)

self.provides_network_checkbox.setChecked(
getattr(self.vm, 'provides_network', False))
if self.provides_network_checkbox.isChecked():
Expand Down
2 changes: 1 addition & 1 deletion ui/settingsdlg.ui
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ border-width: 1px;</string>
<item row="3" column="0">
<widget class="QCheckBox" name="dvm_template_checkbox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Allows using this qube as a template for disposables. Disposables will inherit the qube's state (configuration, installed programs, etc.), but their state will not persist between restarts. &lt;/p&gt;&lt;p&gt;Setting this option will cause this qube to be listed as an option in the &amp;quot;Default disposable template&amp;quot; list for all other qubes. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Allows using this qube as a template for disposables. Disposables will inherit the qube's state (configuration, installed programs, etc.), but their state will not persist between restarts. &lt;/p&gt;&lt;p&gt;Setting this option will cause this qube to be listed as an option in the &amp;quot;Default disposable template&amp;quot; list for all other qubes.&lt;/p&gt;&lt;p&gt;Only AppVMs and StandaloneVMs could be turned in to Disposable Templates&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Disposable template</string>
Expand Down

0 comments on commit 18c20dd

Please sign in to comment.