Skip to content

Commit

Permalink
Option to show only user qubes in Qube Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
alimirjamali committed Oct 23, 2024
1 parent d291540 commit 5312346
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
15 changes: 14 additions & 1 deletion qubesmanager/qube_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,13 @@ def filterAcceptsRow(self, sourceRow, sourceParent):
# if hide internal is true, ignore all other filters
if not self.window.show_internal_action.isChecked() and vm.internal:
return False

if self.window.show_user.isChecked() \
and vm.klass in ['AppVM', 'StandaloneVM'] \
and not getattr(vm.vm, 'template_for_dispvms', False) \
and not vm.vm.features.get('servicevm', False):
return super().filterAcceptsRow(sourceRow, sourceParent)

if self.window.show_all.isChecked():
return super().filterAcceptsRow(sourceRow, sourceParent)

Expand Down Expand Up @@ -777,6 +784,7 @@ def __init__(self, qt_app, qubes_app, dispatcher, _parent=None):
self.show_network.stateChanged.connect(self.invalidate)
self.show_templates.stateChanged.connect(self.invalidate)
self.show_standalone.stateChanged.connect(self.invalidate)
self.show_user.stateChanged.connect(self.invalidate)
self.show_all.stateChanged.connect(self.invalidate)

# Create view menu
Expand Down Expand Up @@ -989,7 +997,10 @@ def save_showing(self):
self.show_standalone.isChecked())
self.manager_settings.setValue('show/internal',
self.show_internal_action.isChecked())
self.manager_settings.setValue('show/all', self.show_all.isChecked())
self.manager_settings.setValue('show/user',
self.show_user.isChecked())
self.manager_settings.setValue('show/all',
self.show_all.isChecked())

def save_sorting(self):
self.manager_settings.setValue('view/sort_column',
Expand Down Expand Up @@ -1204,6 +1215,8 @@ def load_manager_settings(self):
'show/templates', "true") == "true")
self.show_standalone.setChecked(self.manager_settings.value(
'show/standalone', "true") == "true")
self.show_user.setChecked(self.manager_settings.value(
'show/user', "true") == "true")
self.show_all.setChecked(self.manager_settings.value(
'show/all', "true") == "true")

Expand Down
13 changes: 13 additions & 0 deletions ui/qubemanager.ui
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,19 @@ template</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="show_user">
<property name="text">
<string>User qubes</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="toolTip">
<string>Show AppVMs and Standalone VMs, hide disposable and service VMs</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="show_all">
<property name="text">
Expand Down

0 comments on commit 5312346

Please sign in to comment.