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
Thanks, but I can't connect to the repository since
yesterday.(git/https/ssh)
Once my network returns to normal, I'll push them.
Thanks,
- Chen
_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list