Only install signal handler for NORMAL, RADIO and TOGGLE
authorPeng Huang <shawn.p.huang@gmail.com>
Thu, 7 Jan 2010 05:02:44 +0000 (13:02 +0800)
committerPeng Huang <shawn.p.huang@gmail.com>
Thu, 7 Jan 2010 05:02:44 +0000 (13:02 +0800)
ui/gtk/menu.py

index 3c789717121e0932b5e06f044c6707c9190c533c..f4a5b53df8ee0ed3067116da549677716287d9ed 100644 (file)
@@ -79,11 +79,14 @@ class Menu(gtk.Menu, PropItem):
                 item.set_no_show_all(True)
                 item.hide()
 
-            item.connect("property-activate", lambda w,n,s: self.emit("property-activate", n, s))
-
             self.append(item)
             self._sub_items.append(item)
 
+            if prop.type not in (ibus.PROP_TYPE_NORMAL, ibus.PROP_TYPE_TOGGLE, ibus.PROP_TYPE_RADIO):
+                continue
+            item.connect("property-activate",
+                lambda w,n,s: self.emit("property-activate", n, s))
+
     def popup(self, button, active_time, widget):
         gtk.Menu.popup(self, None, None, menu_position,
                             button, active_time, widget)