Skip to content

Commit

Permalink
Make Qube Manager remember its size from last time
Browse files Browse the repository at this point in the history
Qube Manager will now remember its size from last time it was run, and
also it will no longer force itself to appear at top left corner of
the screen.

fixes QubesOS/qubes-issues#4049
  • Loading branch information
marmarta committed Jul 16, 2018
1 parent 18d45e5 commit e5dee2d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions qubesmanager/qube_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,6 @@ def __init__(self, qt_app, qubes_app, parent=None):
self.frame_width = 0
self.frame_height = 0

self.move(self.x(), 0)

self.columns_actions = {
self.columns_indices["Type"]: self.action_vm_type,
self.columns_indices["Label"]: self.action_label,
Expand Down Expand Up @@ -405,6 +403,12 @@ def __init__(self, qt_app, qubes_app, parent=None):
timer.start(1000 * 30) # 30s
self.check_updates()

def closeEvent(self, event):
# pylint: disable=invalid-name
# save window size at close
self.manager_settings.setValue("window_size", self.size())
event.accept()

def check_updates(self):
for vm in self.qubes_app.domains:
if vm.klass in {'TemplateVM', 'StandaloneVM'}:
Expand Down Expand Up @@ -525,6 +529,11 @@ def load_manager_settings(self):
if not self.manager_settings.value("view/toolbar_visible",
defaultValue=True):
self.action_toolbar.setChecked(False)

# load last window size
self.resize(self.manager_settings.value("window_size",
QtCore.QSize(1100, 600)))

self.settings_loaded = True

def get_vms_list(self):
Expand Down

0 comments on commit e5dee2d

Please sign in to comment.