From 3574867b81b75e11276a86459ad9d4fd7d545695 Mon Sep 17 00:00:00 2001 From: Joanna Rutkowska Date: Sat, 2 Apr 2011 15:48:48 +0200 Subject: [PATCH] Auto-resize window to show all the VMs --- qubesmanager/main.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/qubesmanager/main.py b/qubesmanager/main.py index c7771db..b8228eb 100755 --- a/qubesmanager/main.py +++ b/qubesmanager/main.py @@ -426,10 +426,15 @@ class VmManagerWindow(QMainWindow): self.connect(self.table, SIGNAL("itemSelectionChanged()"), self.table_selection_changed) + self.setFixedWidth (self.get_minimum_table_width()) self.fill_table() - tbl_W = self.get_minimum_table_width() + self.counter = 0 + self.shutdown_monitor = {} + QTimer.singleShot (self.update_interval, self.update_table) + QTimer.singleShot (self.fw_rules_apply_check_interval, self.check_apply_fw_rules) + def set_table_geom_height(self): # TODO: '6' -- WTF?! tbl_H = self.toolbar.height() + 6 + \ self.table.horizontalHeader().height() + 6 @@ -440,12 +445,8 @@ class VmManagerWindow(QMainWindow): for i in range (0, n): tbl_H += self.table.rowHeight(i) - self.setGeometry(self.x(), self.y(), self.x() + tbl_W, self.y() + tbl_H) + self.setFixedHeight(tbl_H) - self.counter = 0 - self.shutdown_monitor = {} - QTimer.singleShot (self.update_interval, self.update_table) - QTimer.singleShot (self.fw_rules_apply_check_interval, self.check_apply_fw_rules) def addActions(self, target, actions): for action in actions: @@ -519,6 +520,7 @@ class VmManagerWindow(QMainWindow): row_no += 1 self.table.setRowCount(row_no) + self.set_table_geom_height() self.vms_list = vms_list self.vms_in_table = vms_in_table self.reload_table = False