iter = self.get_selected_iter()
if iter == None:
return None
- row = self.__model.get(iter)
+ row = self.__model.get(iter, 0)
return row[0]
def prepend_engine(self, engine):
button = self.__xml.get_widget("button_engine_down")
button.connect("clicked", lambda *args:self.__treeview.move_down_engine())
+ button = self.__xml.get_widget("button_engine_help")
+ button.connect("clicked", self.__button_engine_help_cb)
+
+ def __button_engine_help_cb(self, button):
+ engine = self.__treeview.get_select_engine()
+ message = "Please select an input method!"
+ title = "Help"
+ if engine:
+ title = engine.get_longname()
+ message = engine.get_description()
+
+ dlg = gtk.MessageDialog(buttons=gtk.BUTTONS_CLOSE, message_format=message)
+ dlg.set_title(title)
+ dlg.run()
+ dlg.destroy()
+
def __treeview_changed_cb(self, treeview):
engines = self.__treeview.get_engines()
engine_names = map(lambda e: e.name, engines)
<property name="position">3</property>
</packing>
</child>
+ <child>
+ <widget class="GtkButton" id="button_engine_help">
+ <property name="label" translatable="yes">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
</widget>
</child>
</widget>