Skip to content
Open
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
94 changes: 60 additions & 34 deletions qubes_config/global_config.glade
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@
<property name="can-focus">False</property>
<property name="vscroll-policy">natural</property>
<child>
<!-- n-columns=2 n-rows=27 -->
<!-- n-columns=2 n-rows=28 -->
<object class="GtkGrid" id="basics_contents">
<property name="visible">True</property>
<property name="can-focus">False</property>
Expand Down Expand Up @@ -1069,7 +1069,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">11</property>
<property name="top-attach">12</property>
<property name="width">2</property>
</packing>
</child>
Expand All @@ -1085,7 +1085,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">14</property>
<property name="top-attach">15</property>
</packing>
</child>
<child>
Expand All @@ -1101,7 +1101,7 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">14</property>
<property name="top-attach">15</property>
</packing>
</child>
<child>
Expand All @@ -1114,7 +1114,7 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">15</property>
<property name="top-attach">16</property>
</packing>
</child>
<child>
Expand All @@ -1127,7 +1127,7 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">16</property>
<property name="top-attach">17</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -1175,7 +1175,7 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
Expand All @@ -1199,7 +1199,7 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
Expand All @@ -1223,7 +1223,7 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
Expand All @@ -1238,7 +1238,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">18</property>
<property name="top-attach">19</property>
<property name="width">2</property>
</packing>
</child>
Expand All @@ -1255,7 +1255,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">19</property>
<property name="top-attach">20</property>
<property name="width">2</property>
</packing>
</child>
Expand All @@ -1271,7 +1271,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">23</property>
<property name="top-attach">24</property>
<property name="width">2</property>
</packing>
</child>
Expand All @@ -1283,7 +1283,7 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">25</property>
<property name="top-attach">26</property>
</packing>
</child>
<child>
Expand All @@ -1295,7 +1295,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">26</property>
<property name="top-attach">27</property>
<property name="width">2</property>
</packing>
</child>
Expand All @@ -1312,7 +1312,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">24</property>
<property name="top-attach">25</property>
<property name="width">2</property>
</packing>
</child>
Expand Down Expand Up @@ -1357,7 +1357,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -1401,7 +1401,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -1446,7 +1446,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
Expand All @@ -1462,7 +1462,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">12</property>
<property name="top-attach">13</property>
<property name="width">2</property>
</packing>
</child>
Expand Down Expand Up @@ -1509,7 +1509,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">13</property>
<property name="top-attach">14</property>
<property name="width">2</property>
</packing>
</child>
Expand Down Expand Up @@ -1554,7 +1554,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">15</property>
<property name="top-attach">16</property>
</packing>
</child>
<child>
Expand All @@ -1578,7 +1578,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">10</property>
<property name="top-attach">11</property>
</packing>
</child>
<child>
Expand All @@ -1590,7 +1590,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">17</property>
<property name="top-attach">18</property>
</packing>
</child>
<child>
Expand All @@ -1602,7 +1602,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">22</property>
<property name="top-attach">23</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -1633,7 +1633,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">16</property>
<property name="top-attach">17</property>
</packing>
</child>
<child>
Expand All @@ -1648,7 +1648,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">25</property>
<property name="top-attach">26</property>
</packing>
</child>
<child>
Expand All @@ -1663,7 +1663,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">20</property>
<property name="top-attach">21</property>
</packing>
</child>
<child>
Expand All @@ -1678,7 +1678,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">21</property>
<property name="top-attach">22</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -1718,7 +1718,7 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">20</property>
<property name="top-attach">21</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -1758,7 +1758,7 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">21</property>
<property name="top-attach">22</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -1815,7 +1815,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -1882,7 +1882,7 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -1925,7 +1925,7 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">9</property>
<property name="top-attach">10</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -1953,7 +1953,33 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">9</property>
<property name="top-attach">10</property>
</packing>
</child>
<child>
<object class="GtkBox" id="clockvm_warn_box">
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="clockvm_warn_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<style>
<class name="problem_box_to_previous"/>
</style>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
<property name="width">2</property>
</packing>
</child>
<child>
Expand Down
20 changes: 18 additions & 2 deletions qubes_config/global_config/basics_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
get_feature,
get_boolean_feature,
apply_feature_change,
inadvisable_selection,
)

import gi
Expand Down Expand Up @@ -130,9 +131,11 @@ def __init__(
self,
qapp: qubesadmin.Qubes,
trait_holder: Any,
trait_name: str,
widget: Gtk.ComboBox,
trait_name: str,
gtk_builder: Gtk.Builder = None,
vm_filter: Optional[Callable] = None,
vm_inadvisable: Optional[Callable] = None,
readable_name: Optional[str] = None,
additional_options: Dict[Any | str | None, str] | None = None,
show_internal: bool = False,
Expand All @@ -146,7 +149,10 @@ def __init__(
self.model = VMListModeler(
combobox=self.widget,
qapp=qapp,
gtk_builder=gtk_builder,
trait_name=trait_name,
filter_function=vm_filter,
vm_inadvisable=vm_inadvisable,
current_value=self.get_current_value(),
style_changes=True,
additional_options=additional_options,
Expand Down Expand Up @@ -644,7 +650,9 @@ def __init__(self, gtk_builder: Gtk.Builder, qapp: qubesadmin.Qubes):
trait_holder=self.qapp,
trait_name="clockvm",
widget=self.clockvm_combo,
gtk_builder=gtk_builder,
vm_filter=self._clock_vm_filter,
vm_inadvisable=self._clock_vm_inadvisable,
readable_name=_("Clock qube"),
additional_options=NONE_CATEGORY,
)
Expand Down Expand Up @@ -742,7 +750,15 @@ def __init__(self, gtk_builder: Gtk.Builder, qapp: qubesadmin.Qubes):

@staticmethod
def _clock_vm_filter(vm) -> bool:
return vm.klass != "TemplateVM"
return vm.klass != "TemplateVM" and (vm.klass == "AdminVM" or vm.is_networked())

@staticmethod
def _clock_vm_inadvisable(vm) -> str:
return (
inadvisable_selection(
readable_name="clock qube", vm=vm, warn_dispvm_template=True
),
)

@staticmethod
def _default_template_filter(vm) -> bool:
Expand Down
Loading