From f2501c91a51eb66ff6cadaf62830b4c49b540a06 Mon Sep 17 00:00:00 2001 From: donoban Date: Wed, 4 Nov 2020 23:37:21 +0100 Subject: [PATCH 1/2] Added 'Compact View' Action --- qubesmanager/qube_manager.py | 9 +++++++++ ui/qubemanager.ui | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/qubesmanager/qube_manager.py b/qubesmanager/qube_manager.py index 91023d1..63733c6 100644 --- a/qubesmanager/qube_manager.py +++ b/qubesmanager/qube_manager.py @@ -702,6 +702,7 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QMainWindow): lambda pos: self.open_tools_context_menu(self.toolbar, pos)) self.action_menubar.toggled.connect(self.showhide_menubar) self.action_toolbar.toggled.connect(self.showhide_toolbar) + self.action_compact_view.toggled.connect(self.set_compactview) self.logs_menu.triggered.connect(self.show_log) self.table.resizeColumnsToContents() @@ -742,6 +743,8 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QMainWindow): self.menu_view.addSeparator() self.menu_view.addAction(self.action_toolbar) self.menu_view.addAction(self.action_menubar) + self.menu_view.addSeparator() + self.menu_view.addAction(self.action_compact_view) try: self.load_manager_settings() @@ -1390,6 +1393,12 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QMainWindow): def action_exit_triggered(self): self.close() + def set_compactview(self, checked): + if checked: + self.toolbar.setToolButtonStyle(Qt.ToolButtonIconOnly) + else: + self.toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) + def showhide_menubar(self, checked): self.menubar.setVisible(checked) if not checked: diff --git a/ui/qubemanager.ui b/ui/qubemanager.ui index 47fd249..b0257d9 100644 --- a/ui/qubemanager.ui +++ b/ui/qubemanager.ui @@ -869,6 +869,14 @@ Template Open a secure Xen console in the qube. Useful chiefly for debugging purposes: for normal operation, use "Run Terminal" from the Domains widget. + + + true + + + Compact View + + From 1c7494e29ee23402d36eb46973cb02e2c4e092ce Mon Sep 17 00:00:00 2001 From: donoban Date: Wed, 4 Nov 2020 23:51:31 +0100 Subject: [PATCH 2/2] Save 'compactview' state --- qubesmanager/qube_manager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qubesmanager/qube_manager.py b/qubesmanager/qube_manager.py index 63733c6..2426a59 100644 --- a/qubesmanager/qube_manager.py +++ b/qubesmanager/qube_manager.py @@ -950,6 +950,9 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QMainWindow): if not self.manager_settings.value("view/toolbar_visible", defaultValue=True): self.action_toolbar.setChecked(False) + if self.manager_settings.value("view/compactview", + defaultValue="false") != "false": + self.action_compact_view.setChecked(True) # load last window size self.resize(self.manager_settings.value("window_size", @@ -1398,6 +1401,8 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QMainWindow): self.toolbar.setToolButtonStyle(Qt.ToolButtonIconOnly) else: self.toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) + if self.settings_loaded: + self.manager_settings.setValue('view/compactview', checked) def showhide_menubar(self, checked): self.menubar.setVisible(checked)