def cmp_engine(a, b):
if a.rank == b.rank:
return cmp(a.longname, b.longname)
- return int(-a.rank + b.rank)
+ return int(b.rank - a.rank)
lang[l].sort(cmp_engine)
for e in lang[l]:
iter2 = self.__model.append(iter1)
class EngineTreeView(gtk.TreeView):
__gtype_name__ = 'EngineTreeView'
- __gsignals__ = {
- 'changed' : (
- gobject.SIGNAL_RUN_LAST,
- gobject.TYPE_NONE,
- ())
- }
__gproperties__ = {
'active-engine' : (
gobject.TYPE_PYOBJECT,
self.__builder.get_object("button_engine_up").set_sensitive(engine not in engines[:1])
self.__builder.get_object("button_engine_down").set_sensitive(engine not in engines[-1:])
- if property.name == engines:
+ if property.name == "engines":
engine_names = map(lambda e: e.name, engines)
self.__config.set_list("general", "preload_engines", engine_names, "s")
self.__treeview.append_engine(engine)
def __button_engine_about_cb(self, button):
- engine = self.__treeview.get_select_engine()
+ engine = self.__treeview.get_active_engine()
if engine:
about = EngineAbout(engine)
about.run()