mainui: implemented show/hide internal VMs

This commit is contained in:
Olivier Medoc 2013-03-05 11:29:49 +01:00 committed by Marek Marczykowski
parent 70e0a2b97a
commit 268c9a9d94
2 changed files with 18 additions and 0 deletions

View File

@ -799,6 +799,9 @@
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/show-all-running.png</normaloff>:/show-all-running.png</iconset>

View File

@ -1002,6 +1002,21 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
self.table.setRowHidden(row_no, True)
row_no += 1
def showhide_internal_vms(self, show_internal):
if show_internal:
row_no = 0
while row_no < self.table.rowCount():
self.table.setRowHidden(row_no, False)
row_no += 1
else:
row_no = 0
while row_no < self.table.rowCount():
widget = self.table.cellWidget(row_no, self.columns_indices["State"])
internal = widget.vm.internal
if internal:
self.table.setRowHidden(row_no, True)
row_no += 1
def mark_table_for_update(self):
self.reload_table = True