Update table only when manager is visible (safe on cpu)
This commit is contained in:
parent
3574867b81
commit
33c79d6de3
@ -532,20 +532,21 @@ class VmManagerWindow(QMainWindow):
|
||||
# When calling update_table() directly, always use out_of_schedule=True!
|
||||
def update_table(self, out_of_schedule=False):
|
||||
|
||||
some_vms_have_changed_power_state = False
|
||||
for vm in self.vms_list:
|
||||
state = vm.is_running();
|
||||
if vm.last_power_state != state:
|
||||
vm.last_power_state = state
|
||||
some_vms_have_changed_power_state = True
|
||||
if manager_window.isVisible():
|
||||
some_vms_have_changed_power_state = False
|
||||
for vm in self.vms_list:
|
||||
state = vm.is_running();
|
||||
if vm.last_power_state != state:
|
||||
vm.last_power_state = state
|
||||
some_vms_have_changed_power_state = True
|
||||
|
||||
if self.reload_table or ((not self.show_inactive_vms) and some_vms_have_changed_power_state):
|
||||
self.fill_table()
|
||||
if self.reload_table or ((not self.show_inactive_vms) and some_vms_have_changed_power_state):
|
||||
self.fill_table()
|
||||
|
||||
for vm_row in self.vms_in_table:
|
||||
vm_row.update(self.counter)
|
||||
for vm_row in self.vms_in_table:
|
||||
vm_row.update(self.counter)
|
||||
|
||||
self.table_selection_changed()
|
||||
self.table_selection_changed()
|
||||
|
||||
if not out_of_schedule:
|
||||
self.counter += 1
|
||||
|
Loading…
Reference in New Issue
Block a user