diff options
author | Huang Peng <shawn.p.huang@gmail.com> | 2008-08-17 22:15:56 +0800 |
---|---|---|
committer | Huang Peng <shawn.p.huang@gmail.com> | 2008-08-17 22:15:56 +0800 |
commit | 7b47c05b0b9cae55eb818a765dcd3aaee57d16e8 (patch) | |
tree | 73eaa082f8c6ccce128fd4f38a8b51b910952aaa | |
parent | 95a6289bcd2c2e7ddba727d82da0fe992208c487 (diff) | |
download | ibus-7b47c05b0b9cae55eb818a765dcd3aaee57d16e8.tar.gz ibus-7b47c05b0b9cae55eb818a765dcd3aaee57d16e8.tar.xz ibus-7b47c05b0b9cae55eb818a765dcd3aaee57d16e8.zip |
Add lookup table orientation configure item.
-rw-r--r-- | setup/Makefile.am | 6 | ||||
-rw-r--r-- | setup/ibus-setup.in | 2 | ||||
-rw-r--r-- | setup/main.py | 27 | ||||
-rw-r--r-- | setup/setup.glade | 121 |
4 files changed, 133 insertions, 23 deletions
diff --git a/setup/Makefile.am b/setup/Makefile.am index b8d54a6..2c4946e 100644 --- a/setup/Makefile.am +++ b/setup/Makefile.am @@ -46,4 +46,8 @@ EXTRA_DIST = \ $(NULL) test: - $(ENV) PYTHONPATH=$(top_srcdir) $(PYTHON) $(srcdir)/main.py + $(ENV) \ + PYTHONPATH=$(top_srcdir) \ + IBUS_PREFIX="/usr" \ + $(PYTHON) \ + $(srcdir)/main.py diff --git a/setup/ibus-setup.in b/setup/ibus-setup.in index d08e8b6..1c05adb 100644 --- a/setup/ibus-setup.in +++ b/setup/ibus-setup.in @@ -22,6 +22,6 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ export IBUS_PREFIX=@prefix@ -export IBUS_LIBEXECDIR=@libexecdir@ +export IBUS_DATAROOTDIR=@datarootdir@ exec python @prefix@/share/ibus/setup/main.py $@ diff --git a/setup/main.py b/setup/main.py index 5afa09e..153de69 100644 --- a/setup/main.py +++ b/setup/main.py @@ -54,6 +54,7 @@ N_ = lambda a : a ) = 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): @@ -107,15 +108,26 @@ class Setup(object): 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")) @@ -134,7 +146,7 @@ class Setup(object): 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) @@ -144,7 +156,7 @@ class Setup(object): 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) @@ -153,13 +165,11 @@ class Setup(object): 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 @@ -290,7 +300,7 @@ class Setup(object): 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 @@ -311,6 +321,11 @@ class Setup(object): 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() diff --git a/setup/setup.glade b/setup/setup.glade index ef05f3d..fe5feb2 100644 --- a/setup/setup.glade +++ b/setup/setup.glade @@ -1,6 +1,6 @@ <?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> @@ -52,6 +52,94 @@ </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> <child> @@ -70,10 +158,13 @@ </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> @@ -83,25 +174,25 @@ </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> @@ -111,7 +202,7 @@ </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> |