[et-mgmt-tools] [PATCH][virt-manager] fix Delete button visibility

Alan Pevec apevec at redhat.com
Tue Apr 8 11:32:23 UTC 2008


fix Delete button visibility

change Delete button visibility if selected vm is started/stopped, in the same way it's changed upon row selection

Signed-off-by: Alan Pevec <apevec at redhat.com>

--- a/src/virtManager/manager.py        Thu Apr 03 19:12:20 2008 -0400
+++ b/src/virtManager/manager.py        Tue Apr 08 13:11:13 2008 +0200
@@ -475,8 +475,16 @@ class vmmManager(gobject.GObject):
                     del self.rows[vm.get_uuid()]
                 break
 
-        if missing and wanted:
-            self._append_vm(model, vm, vm.get_connection())
+        if wanted:
+            if missing:
+                self._append_vm(model, vm, vm.get_connection())
+            elif vm.get_uuid() == self.current_vmuuid():
+                if vm.is_active():
+                    self.window.get_widget("vm-delete").set_sensitive(False)
+                else:
+                    self.window.get_widget("vm-delete").set_sensitive(True)
+
+
 
 
     def vm_resources_sampled(self, vm):




More information about the et-mgmt-tools mailing list