FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora/Linux Management Tools

 
 
LinkBack Thread Tools
 
Old 05-26-2008, 05:19 AM
Hiroyuki Kaguchi
 
Default Enable to send the mnemonic of the menu to the guest OS

We cannot send "Alt+M" and "Alt+V" and "Alt+H" to the guest OS because the
mnemonic of the menu of the graphical console is enabled.
So, I change the graphical console to be able to send these keys to the
guest OS.
This change is that the mnemonic of the menu is disabled when the graphical
console grabs the keyboard.

Moreover, the patch includes the bugfix of the following bugs.
1) Two times of _disable_modifiers() is called consecutively.
In that case, the value of self.gtk_settings_accel is always "None", and the
setting of the accelerator is not restored.
2) Because the information that self.accel_groups has is not updated in the
latest state, the assertion occurs when the topwin.remove_accel_group()
is called.

Thanks,
Signed-off-by: Hiroyuki Kaguchi <fj7025cf@aa.jp.fujitsu.com>
diff -r 31978f51485e src/virtManager/details.py
--- a/src/virtManager/details.py Wed May 21 13:34:02 2008 -0400
+++ b/src/virtManager/details.py Mon May 26 10:26:37 2008 +0900
@@ -164,8 +164,13 @@ class vmmDetails(gobject.GObject):
self.window.get_widget("graph-table").attach(self.network_traffic_graph, 1, 2, 3, 4)


- self.accel_groups = gtk.accel_groups_from_object(topwin)
+ self.accel_groups = []
self.gtk_settings_accel = None
+
+ self.menubar3_origin_labels = {}
+ for menuitem in self.window.get_widget("menubar3").get_children():
+ label = menuitem.get_children()[0]
+ self.menubar3_origin_labels[label] = label.get_label()

self.vncViewer = gtkvnc.Display()
self.window.get_widget("console-vnc-viewport").add(self.vncViewer)
@@ -314,21 +319,26 @@ class vmmDetails(gobject.GObject):

def _disable_modifiers(self, ignore=None):
topwin = self.window.get_widget("vmm-details")
+ self.accel_groups = gtk.accel_groups_from_object(topwin)
for g in self.accel_groups:
topwin.remove_accel_group(g)
- settings = gtk.settings_get_default()
- self.gtk_settings_accel = settings.get_property('gtk-menu-bar-accel')
- settings.set_property('gtk-menu-bar-accel', None)
+ if self.gtk_settings_accel is None:
+ settings = gtk.settings_get_default()
+ self.gtk_settings_accel = settings.get_property('gtk-menu-bar-accel')
+ settings.set_property('gtk-menu-bar-accel', None)
+ for label in self.menubar3_origin_labels.keys():
+ label.set_label(self.menubar3_origin_labels[label].replace('_', '))

def _enable_modifiers(self, ignore=None):
topwin = self.window.get_widget("vmm-details")
- if self.gtk_settings_accel is None:
- return
- settings = gtk.settings_get_default()
- settings.set_property('gtk-menu-bar-accel', self.gtk_settings_accel)
- self.gtk_settings_accel = None
for g in self.accel_groups:
topwin.add_accel_group(g)
+ if self.gtk_settings_accel is not None:
+ settings = gtk.settings_get_default()
+ settings.set_property('gtk-menu-bar-accel', self.gtk_settings_accel)
+ self.gtk_settings_accel = None
+ for label in self.menubar3_origin_labels.keys():
+ label.set_label(self.menubar3_origin_labels[label])

def notify_grabbed(self, src):
topwin = self.window.get_widget("vmm-details")
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 

Thread Tools




All times are GMT. The time now is 06:24 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org