Add lookup table orientation configure item.
authorHuang Peng <shawn.p.huang@gmail.com>
Sun, 17 Aug 2008 14:15:56 +0000 (22:15 +0800)
committerHuang Peng <shawn.p.huang@gmail.com>
Sun, 17 Aug 2008 14:15:56 +0000 (22:15 +0800)
setup/Makefile.am
setup/ibus-setup.in
setup/main.py
setup/setup.glade

index b8d54a6e6ac5109391ab35ea2ebc2f98e47f8e67..2c4946ea5bf2109bf30b4fbc1bfa9c71bd70b9fa 100644 (file)
@@ -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
index d08e8b6df0e186196f99c3965454250fee733304..1c05adb3e0799318bf549b960919c287b11701dd 100644 (file)
@@ -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 $@
 
index 5afa09efd9843af797816186422a94cd95726806..153de69d5748ef4f2714ee69c5fcb9d49bace3a8 100644 (file)
@@ -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()
 
index ef05f3d6c910e96c6e6d3112ff31b6b8d83d4901..fe5feb2087c9513c1234a5e6500760c9a006843e 100644 (file)
@@ -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>
                 <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 &lt;shawn.p.huang@gmail.com&gt;
+
+
+
+</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>