[virt-manager PATCH 5/5] details: Set tooltip on config-remove while it's not available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It informs users that why the device can't be removed.

Signed-off-by: Lin Ma <lma@xxxxxxxx>
---
 virtManager/details.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/virtManager/details.py b/virtManager/details.py
index cb298f3f..7308cde3 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -3016,6 +3016,7 @@ class vmmDetails(vmmGObjectUI):
         can_remove = True
         if self.vm.xmlobj.devices.graphics:
             can_remove = False
+            tooltip = _("Please remove the Graphics/Display devices first.")
         self.widget("config-remove").set_sensitive(can_remove)
         self.widget("config-remove").set_tooltip_text(tooltip)
 
@@ -3043,8 +3044,10 @@ class vmmDetails(vmmGObjectUI):
         can_remove = True
         if self.vm.get_xmlobj().os.is_x86() and controller.type == "usb":
             can_remove = False
+            tooltip = _("Hypervisor does not support removing this device")
         if controller.type == "pci":
             can_remove = False
+            tooltip = _("Hypervisor does not support removing this device")
         elif controller.type in ["scsi", "sata", "ide", "fdc"]:
             model = self.widget("controller-device-list").get_model()
             model.clear()
@@ -3056,6 +3059,8 @@ class vmmDetails(vmmGObjectUI):
                     model.append([infoStr])
             uiutil.set_grid_row_visible(self.widget("device-list-label"), True)
             uiutil.set_grid_row_visible(self.widget("controller-device-box"), True)
+            if can_remove is False:
+                tooltip = _("Disks are attaching to it")
         elif controller.type == "virtio-serial":
             for dev in self.vm.xmlobj.devices.channel:
                 if dev.address.compare_controller(controller, dev.address.type):
@@ -3069,6 +3074,8 @@ class vmmDetails(vmmGObjectUI):
                 if controller.index == 0 and dev.target_type == "virtio":
                     can_remove = False
                     break
+            if can_remove is False:
+                tooltip = _("Channels or Consoles are attaching to it")
 
         self.widget("config-remove").set_sensitive(can_remove)
         self.widget("config-remove").set_tooltip_text(tooltip)
-- 
2.16.2

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux