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.
Thanks, Cole commit 5212ab992e49faa4f8e9cdce0062d918f27e91e9 (HEAD -> master) Author: Cole Robinson <crobinso@xxxxxxxxxx> 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@xxxxxxxx> 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_sensitive(True) + self.widget("config-remove").set_tooltip_text(_remove_tooltip) self.widget("hw-panel").set_sensitive(True) self.widget("hw-panel").show() _______________________________________________ virt-tools-list mailing list virt-tools-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/virt-tools-list