[virt-tools-list] [virt-manager PATCH 4/5] details: Fix the tooltip error on config-remove

Cole Robinson crobinso at redhat.com
Tue Jul 31 14:41:20 UTC 2018

On 07/18/2018 06:00 AM, Lin Ma wrote:
> The tooltip of config-remove will be changed after clicking the 'Keyboard'
> or 'Mouse' in details page, We need to restore it in the refresh_XXX_page
> functions.
> How to reproduce:
> 1. Click 'Keyboard' item in details page.
> 2. Observe the tooltip of the 'Remove' button. the tooltip is
>     "Hypervisor does not support to removing this device"
> 3. Click a nic item.
> 4. Observe the tooltip of the 'Remove' button.
> Expected:
> "Remove this device from the virtual machine"
> Actual:
> "Hypervisor does not support to removing this device"

Thanks for the bug report, but anytime you are duplicating the same line 
of code in 17 different places should be a hint that it can likely be 
centralized. I'm pushing this instead.


commit 5212ab992e49faa4f8e9cdce0062d918f27e91e9 (HEAD -> master)
Author: Cole Robinson <crobinso at redhat.com>
Date:   Tue Jul 31 10:37:50 2018 -0400

     details: Reset Remove tooltip on hardware selection

     Otherwise it can be out of date

     Reported-by: Lin Ma <lma at suse.com>

diff --git a/virtManager/details.py b/virtManager/details.py
index 4b145602..c5f231ed 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -998,9 +998,6 @@ class vmmDetails(vmmGObjectUI):
          for name in caps.get_cpu_values(self.vm.get_arch()):
              model.append([name, name, name, False])

-        # Remove button tooltip
-        self.widget("config-remove").set_tooltip_text(_remove_tooltip)
          # Disk cache combo
          disk_cache = self.widget("disk-cache")
          vmmAddHardware.build_disk_cache_combo(self.vm, disk_cache)
@@ -1196,6 +1193,7 @@ class vmmDetails(vmmGObjectUI):
          pagetype = self.force_get_hw_pagetype(page)

+        self.widget("config-remove").set_tooltip_text(_remove_tooltip)

More information about the virt-tools-list mailing list