Re: [virt-manager PATCH] details: force select list entry before showing popup menu

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

 




On 04/25/2014 08:42 PM, Cole Robinson wrote:
On 04/25/2014 02:53 AM, Chen Hanxiao wrote:
We show/hide remove device menu by the attribute
of config-remove button.
But on some desktop, it showing popup menu before
selection.
This patch will force select list entry before
showing popup menu.

Signed-off-by: Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx>
---
  virtManager/details.py | 8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/virtManager/details.py b/virtManager/details.py
index 38017d1..30a68c1 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -1080,6 +1080,14 @@ class vmmDetails(vmmGObjectUI):
          if not devobj:
              return
+ # force select the list entry before showing popup_menu
+        path_tuple = widget.get_path_at_pos(int(event.x), int(event.y))
+        if path_tuple is None:
+            return False
+        path = path_tuple[0]
+        _iter = widget.get_model().get_iter(path)
+        widget.get_selection().select_iter(_iter)
+
          rmdev = self._addhwmenuitems["remove"]
          rmdev.set_visible(self.widget("config-remove").get_visible())
          rmdev.set_sensitive(self.widget("config-remove").get_sensitive())

ACK

- Cole


Pushed, thanks.

- Chen


_______________________________________________
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