) = range(8)
CONFIG_PRELOAD_ENGINES = "/general/preload_engines"
+CONFIG_PANEL_LOOKUP_TABLE_ORIENTATION = "/panel/lookup_table_orientation"
class Setup(object):
def __flush_gtk_events(self):
self.__dialog = self.__xml.get_widget("dialog_setup")
+
+ # auto start ibus
self.__checkbutton_auto_start = self.__xml.get_widget("checkbutton_auto_start")
self.__checkbutton_auto_start.set_active(self.__is_auto_start())
self.__checkbutton_auto_start.connect("toggled", self.__checkbutton_auto_start_toggled_cb)
+
+ # lookup table orientation
+ self.__combobox_lookup_table_orientation = self.__xml.get_widget("combobox_lookup_table_orientation")
+ self.__combobox_lookup_table_orientation.set_active(
+ self.__bus.config_get_value(CONFIG_PANEL_LOOKUP_TABLE_ORIENTATION, 0))
+ self.__combobox_lookup_table_orientation.connect("changed",
+ self.__combobox_lookup_table_orientation_changed_cb)
+
+ # engines tree
self.__tree = self.__xml.get_widget("treeview_engines")
self.__preload_engines = set(self.__bus.config_get_value(CONFIG_PRELOAD_ENGINES, []))
model = self.__create_model()
self.__tree.set_model(model)
- # column for holiday names
+ # column for engine
column = gtk.TreeViewColumn()
column.set_title(_("Engine"))
self.__tree.append_column(column)
- # column for started names
+ # column for started
renderer = gtk.CellRendererToggle()
renderer.set_data('column', COLUMN_ENABLE)
renderer.set_property("xalign", 0.5)
column = gtk.TreeViewColumn(_("Started"), renderer, active = COLUMN_ENABLE, visible = COLUMN_VISIBLE)
self.__tree.append_column(column)
- # column for preload names
+ # column for preload
renderer = gtk.CellRendererToggle()
renderer.set_data('column', COLUMN_PRELOAD)
renderer.set_property("xalign", 0.5)
column = gtk.TreeViewColumn(_("Preload"), renderer, active = COLUMN_PRELOAD, visible = COLUMN_VISIBLE)
self.__tree.append_column(column)
-
renderer = gtk.CellRendererText()
column = gtk.TreeViewColumn("", renderer)
self.__tree.append_column(column)
-
def __item_started_column_toggled_cb(self, cell, path_str, model):
# get toggled iter
def __is_auto_start(self):
link_file = path.join(BaseDirectory.xdg_config_home, "autostart/ibus.desktop")
- ibus_desktop = path.join(os.getenv("IBUS_LIBEXECDIR"), "share/applications/ibus.desktop")
+ ibus_desktop = path.join(os.getenv("IBUS_PREFIX"), "share/applications/ibus.desktop")
if not path.exists(link_file):
return False
if self.__checkbutton_auto_start.get_active():
os.symlink(ibus_desktop, link_file)
+ def __combobox_lookup_table_orientation_changed_cb(self, combobox):
+ self.__bus.config_set_value(
+ CONFIG_PANEL_LOOKUP_TABLE_ORIENTATION,
+ self.__combobox_lookup_table_orientation.get_active())
+
def run(self):
return self.__dialog.run()
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.4 on Thu Aug 7 09:58:25 2008 -->
+<!--Generated with glade3 3.4.4 on Sun Aug 17 22:06:34 2008 -->
<glade-interface>
<widget class="GtkDialog" id="dialog_setup">
<property name="border_width">5</property>
<property name="tab_fill">False</property>
</packing>
</child>
+ <child>
+ <widget class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="n_rows">9</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="combobox_lookup_table_orientation">
+ <property name="visible">True</property>
+ <property name="active">0</property>
+ <property name="items" translatable="yes">Horizontal
+Vertical</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Lookup table orientation</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Panel</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
</widget>
</child>
</widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
</child>
</widget>
<packing>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
</widget>
<packing>
<property name="type">tab</property>
- <property name="position">1</property>
+ <property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
- <widget class="GtkVBox" id="vbox3">
+ <widget class="GtkLabel" id="label5">
<property name="visible">True</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
+ <property name="label" translatable="yes">IBus
+
+Homepage: http://code.google.com/p/ibus
+Author: Huang Peng <shawn.p.huang@gmail.com>
+
+
+
+</property>
+ <property name="justify">GTK_JUSTIFY_CENTER</property>
</widget>
<packing>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
</widget>
<packing>
<property name="type">tab</property>
- <property name="position">2</property>
+ <property name="position">3</property>
<property name="tab_fill">False</property>
</packing>
</child>