All collumns enabled to show/hide (# 541)
This commit is contained in:
parent
fb31ae041a
commit
6fd5de674f
@ -239,13 +239,16 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>View</string>
|
<string>View</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actionState"/>
|
<addaction name="action_vm_type"/>
|
||||||
<addaction name="actionTemplate"/>
|
<addaction name="action_label"/>
|
||||||
<addaction name="actionNetVM"/>
|
<addaction name="action_name"/>
|
||||||
<addaction name="actionCPU"/>
|
<addaction name="action_state"/>
|
||||||
<addaction name="actionCPU_Graph"/>
|
<addaction name="action_template"/>
|
||||||
<addaction name="actionMEM"/>
|
<addaction name="action_netvm"/>
|
||||||
<addaction name="actionMEM_Graph"/>
|
<addaction name="action_cpu"/>
|
||||||
|
<addaction name="action_cpu_graph"/>
|
||||||
|
<addaction name="action_mem"/>
|
||||||
|
<addaction name="action_mem_graph"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="menuOptions"/>
|
<addaction name="menuOptions"/>
|
||||||
<addaction name="menuView"/>
|
<addaction name="menuView"/>
|
||||||
@ -433,17 +436,17 @@
|
|||||||
<string>Show Graphs</string>
|
<string>Show Graphs</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionOptions">
|
<action name="action_options">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Options</string>
|
<string>Options</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionView">
|
<action name="action_view">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>View</string>
|
<string>View</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionCPU">
|
<action name="action_cpu">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -454,7 +457,7 @@
|
|||||||
<string>CPU</string>
|
<string>CPU</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionCPU_Graph">
|
<action name="action_cpu_graph">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -465,7 +468,7 @@
|
|||||||
<string>CPU Graph</string>
|
<string>CPU Graph</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionMEM">
|
<action name="action_mem">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -476,7 +479,7 @@
|
|||||||
<string>MEM</string>
|
<string>MEM</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionMEM_Graph">
|
<action name="action_mem_graph">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -487,7 +490,7 @@
|
|||||||
<string>MEM Graph</string>
|
<string>MEM Graph</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionTemplate">
|
<action name="action_template">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -498,7 +501,7 @@
|
|||||||
<string>Template</string>
|
<string>Template</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionNetVM">
|
<action name="action_netvm">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -548,7 +551,7 @@
|
|||||||
<string>Global settings</string>
|
<string>Global settings</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionState">
|
<action name="action_state">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -583,6 +586,42 @@
|
|||||||
<string>Set keyboard layout per VM</string>
|
<string>Set keyboard layout per VM</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="action_vm_type">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Type</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>VM Type</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="action_label">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Label</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="action_name">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Name</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="resources.qrc"/>
|
<include location="resources.qrc"/>
|
||||||
|
@ -645,12 +645,28 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
self.fill_table()
|
self.fill_table()
|
||||||
self.move(self.x(), 0)
|
self.move(self.x(), 0)
|
||||||
|
|
||||||
|
self.columns_actions = {}
|
||||||
|
self.columns_actions[ self.columns_indices["Type"] ] = self.action_vm_type
|
||||||
|
self.columns_actions[ self.columns_indices["Label"] ] = self.action_label
|
||||||
|
self.columns_actions[ self.columns_indices["Name"] ] = self.action_name
|
||||||
|
self.columns_actions[ self.columns_indices["State"] ] = self.action_state
|
||||||
|
self.columns_actions[ self.columns_indices["Template"] ] = self.action_template
|
||||||
|
self.columns_actions[ self.columns_indices["NetVM"] ] = self.action_netvm
|
||||||
|
self.columns_actions[ self.columns_indices["CPU"] ] = self.action_cpu
|
||||||
|
self.columns_actions[ self.columns_indices["CPU Graph"] ] = self.action_cpu_graph
|
||||||
|
self.columns_actions[ self.columns_indices["MEM"] ] = self.action_mem
|
||||||
|
self.columns_actions[ self.columns_indices["MEM Graph"] ] = self.action_mem_graph
|
||||||
|
|
||||||
|
|
||||||
|
self.visible_columns_count = len(self.columns_indices);
|
||||||
self.table.setColumnHidden( self.columns_indices["NetVM"], True)
|
self.table.setColumnHidden( self.columns_indices["NetVM"], True)
|
||||||
self.actionNetVM.setChecked(False)
|
self.action_netvm.setChecked(False)
|
||||||
self.table.setColumnHidden( self.columns_indices["CPU Graph"], True)
|
self.table.setColumnHidden( self.columns_indices["CPU Graph"], True)
|
||||||
self.actionCPU_Graph.setChecked(False)
|
self.action_cpu_graph.setChecked(False)
|
||||||
self.table.setColumnHidden( self.columns_indices["MEM Graph"], True)
|
self.table.setColumnHidden( self.columns_indices["MEM Graph"], True)
|
||||||
self.actionMEM_Graph.setChecked(False)
|
self.action_mem_graph.setChecked(False)
|
||||||
|
|
||||||
|
|
||||||
self.table.setColumnWidth(self.columns_indices["State"], 80)
|
self.table.setColumnWidth(self.columns_indices["State"], 80)
|
||||||
self.table.setColumnWidth(self.columns_indices["Name"], 150)
|
self.table.setColumnWidth(self.columns_indices["Name"], 150)
|
||||||
self.table.setColumnWidth(self.columns_indices["Label"], 40)
|
self.table.setColumnWidth(self.columns_indices["Label"], 40)
|
||||||
@ -736,11 +752,11 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
|
|
||||||
available_space = desktop_height
|
available_space = desktop_height
|
||||||
if self.menubar.isVisible():
|
if self.menubar.isVisible():
|
||||||
menubar_height = self.menubar.height() + self.menubar.contentsMargins().top() + self.menubar.contentsMargins().bottom()
|
menubar_height = self.menubar.sizeHint().height() + self.menubar.contentsMargins().top() + self.menubar.contentsMargins().bottom()
|
||||||
available_space -= menubar_height
|
available_space -= menubar_height
|
||||||
mainwindow_to_add += menubar_height
|
mainwindow_to_add += menubar_height
|
||||||
if self.toolbar.isVisible():
|
if self.toolbar.isVisible():
|
||||||
toolbar_height = self.toolbar.height() + self.toolbar.contentsMargins().top() + self.toolbar.contentsMargins().bottom()
|
toolbar_height = self.toolbar.sizeHint().height() + self.toolbar.contentsMargins().top() + self.toolbar.contentsMargins().bottom()
|
||||||
available_space -= toolbar_height
|
available_space -= toolbar_height
|
||||||
mainwindow_to_add += toolbar_height
|
mainwindow_to_add += toolbar_height
|
||||||
if W >= desktop_width:
|
if W >= desktop_width:
|
||||||
@ -1335,7 +1351,6 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
|
|
||||||
@pyqtSlot(name='on_action_set_keyboard_layout_triggered')
|
@pyqtSlot(name='on_action_set_keyboard_layout_triggered')
|
||||||
def action_set_keyboard_layout_triggered(self):
|
def action_set_keyboard_layout_triggered(self):
|
||||||
print "change layout!"
|
|
||||||
vm = self.get_selected_vm()
|
vm = self.get_selected_vm()
|
||||||
subprocess.Popen( ['qvm-run', vm.name, 'qubes-change-keyboard-layout'])
|
subprocess.Popen( ['qvm-run', vm.name, 'qubes-change-keyboard-layout'])
|
||||||
|
|
||||||
@ -1391,26 +1406,50 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
def showhide_column(self, col_num, show):
|
def showhide_column(self, col_num, show):
|
||||||
self.table.setColumnHidden( col_num, not show)
|
self.table.setColumnHidden( col_num, not show)
|
||||||
self.set_table_geom_size()
|
self.set_table_geom_size()
|
||||||
|
val = 1 if show else -1
|
||||||
|
self.visible_columns_count += val
|
||||||
|
|
||||||
def on_actionState_toggled(self, checked):
|
if self.visible_columns_count == 1:
|
||||||
|
#disable hiding the last one
|
||||||
|
for c in self.columns_actions:
|
||||||
|
if self.columns_actions[c].isChecked():
|
||||||
|
self.columns_actions[c].setEnabled(False)
|
||||||
|
break
|
||||||
|
elif self.visible_columns_count == 2 and val == 1:
|
||||||
|
#enable hiding previously disabled column
|
||||||
|
for c in self.columns_actions:
|
||||||
|
if not self.columns_actions[c].isEnabled():
|
||||||
|
self.columns_actions[c].setEnabled(True)
|
||||||
|
break;
|
||||||
|
|
||||||
|
def on_action_vm_type_toggled(self, checked):
|
||||||
|
self.showhide_column( self.columns_indices['Type'], checked)
|
||||||
|
|
||||||
|
def on_action_label_toggled(self, checked):
|
||||||
|
self.showhide_column( self.columns_indices['Label'], checked)
|
||||||
|
|
||||||
|
def on_action_name_toggled(self, checked):
|
||||||
|
self.showhide_column( self.columns_indices['Name'], checked)
|
||||||
|
|
||||||
|
def on_action_state_toggled(self, checked):
|
||||||
self.showhide_column( self.columns_indices['State'], checked)
|
self.showhide_column( self.columns_indices['State'], checked)
|
||||||
|
|
||||||
def on_actionTemplate_toggled(self, checked):
|
def on_action_template_toggled(self, checked):
|
||||||
self.showhide_column( self.columns_indices['Template'], checked)
|
self.showhide_column( self.columns_indices['Template'], checked)
|
||||||
|
|
||||||
def on_actionNetVM_toggled(self, checked):
|
def on_action_netvm_toggled(self, checked):
|
||||||
self.showhide_column( self.columns_indices['NetVM'], checked)
|
self.showhide_column( self.columns_indices['NetVM'], checked)
|
||||||
|
|
||||||
def on_actionCPU_toggled(self, checked):
|
def on_action_cpu_toggled(self, checked):
|
||||||
self.showhide_column( self.columns_indices['CPU'], checked)
|
self.showhide_column( self.columns_indices['CPU'], checked)
|
||||||
|
|
||||||
def on_actionCPU_Graph_toggled(self, checked):
|
def on_action_cpu_graph_toggled(self, checked):
|
||||||
self.showhide_column( self.columns_indices['CPU Graph'], checked)
|
self.showhide_column( self.columns_indices['CPU Graph'], checked)
|
||||||
|
|
||||||
def on_actionMEM_toggled(self, checked):
|
def on_action_mem_toggled(self, checked):
|
||||||
self.showhide_column( self.columns_indices['MEM'], checked)
|
self.showhide_column( self.columns_indices['MEM'], checked)
|
||||||
|
|
||||||
def on_actionMEM_Graph_toggled(self, checked):
|
def on_action_mem_graph_toggled(self, checked):
|
||||||
self.showhide_column( self.columns_indices['MEM Graph'], checked)
|
self.showhide_column( self.columns_indices['MEM Graph'], checked)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user