diff options
-rw-r--r-- | setup/main.py | 50 | ||||
-rw-r--r-- | setup/setup.glade | 433 |
2 files changed, 241 insertions, 242 deletions
diff --git a/setup/main.py b/setup/main.py index 12e358f..9e7f4e2 100644 --- a/setup/main.py +++ b/setup/main.py @@ -67,6 +67,34 @@ class Setup(object): glade_file = path.join(path.dirname(__file__), "./setup.glade") self.__xml = glade.XML(glade_file) self.__bus = None + self.__init_bus() + self.__init_ui() + + def __init_ui(self): + # add icon search path + icon_theme = gtk.icon_theme_get_default() + dir = path.dirname(__file__) + icondir = path.join(dir, "..", "icons") + icon_theme.prepend_search_path(icondir) + + + 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) + + self.__init_engine_view() + + def __init_bus(self): try: self.__bus = ibus.Bus() self.__bus.connect("config-value-changed", self.__config_value_changed_cb) @@ -104,27 +132,7 @@ class Setup(object): dlg.destroy() self.__flush_gtk_events() - # add icon search path - icon_theme = gtk.icon_theme_get_default() - dir = path.dirname(__file__) - icondir = path.join(dir, "..", "icons") - icon_theme.prepend_search_path(icondir) - - - 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) - + def __init_engine_view(self): # engines tree self.__tree = self.__xml.get_widget("treeview_engines") self.__preload_engines = set(self.__bus.config_get_value(CONFIG_PRELOAD_ENGINES, [])) diff --git a/setup/setup.glade b/setup/setup.glade index cf18acb..1744a5d 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 Wed Aug 20 21:35:29 2008 --> +<!--Generated with glade3 3.4.4 on Thu Aug 21 07:12:36 2008 --> <glade-interface> <widget class="GtkDialog" id="dialog_setup"> <property name="border_width">5</property> @@ -31,161 +31,240 @@ <packing> <property name="expand">False</property> <property name="fill">False</property> + <property name="padding">4</property> </packing> </child> <child> - <widget class="GtkTable" id="table3"> + <widget class="GtkFrame" id="frame1"> <property name="visible">True</property> - <property name="n_rows">3</property> - <property name="n_columns">3</property> + <property name="label_xalign">0</property> + <property name="shadow_type">GTK_SHADOW_IN</property> <child> - <widget class="GtkButton" id="button3"> + <widget class="GtkAlignment" id="alignment1"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="label" translatable="yes">...</property> - <property name="response_id">0</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options">GTK_FILL</property> - <property name="x_padding">4</property> - <property name="y_padding">4</property> - </packing> - </child> - <child> - <widget class="GtkButton" id="button2"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="label" translatable="yes">...</property> - <property name="response_id">0</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options">GTK_FILL</property> - <property name="x_padding">4</property> - <property name="y_padding">4</property> - </packing> - </child> - <child> - <widget class="GtkEntry" id="entry3"> - <property name="visible">True</property> - <property name="can_focus">True</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options">GTK_FILL</property> - <property name="x_padding">4</property> - <property name="y_padding">4</property> - </packing> - </child> - <child> - <widget class="GtkEntry" id="entry2"> - <property name="visible">True</property> - <property name="can_focus">True</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options">GTK_FILL</property> - <property name="x_padding">4</property> - <property name="y_padding">4</property> - </packing> - </child> - <child> - <widget class="GtkButton" id="button1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="label" translatable="yes">...</property> - <property name="response_id">0</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options">GTK_FILL</property> - <property name="x_padding">4</property> - <property name="y_padding">4</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label9"> - <property name="visible">True</property> - <property name="xalign">1</property> - <property name="label" translatable="yes">Previous engine:</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> + <property name="left_padding">12</property> + <child> + <widget class="GtkTable" id="table3"> + <property name="visible">True</property> + <property name="n_rows">3</property> + <property name="n_columns">3</property> + <child> + <widget class="GtkLabel" id="label7"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Trigger:</property> + <property name="justify">GTK_JUSTIFY_RIGHT</property> + </widget> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options">GTK_FILL</property> + <property name="x_padding">4</property> + <property name="y_padding">4</property> + </packing> + </child> + <child> + <widget class="GtkEntry" id="entry_trigger"> + <property name="visible">True</property> + <property name="can_focus">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options">GTK_FILL</property> + <property name="x_padding">4</property> + <property name="y_padding">4</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label8"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Next engine:</property> + <property name="justify">GTK_JUSTIFY_RIGHT</property> + </widget> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options">GTK_FILL</property> + <property name="x_padding">4</property> + <property name="y_padding">4</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label9"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Previous engine:</property> + <property name="justify">GTK_JUSTIFY_RIGHT</property> + </widget> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options">GTK_FILL</property> + <property name="x_padding">4</property> + <property name="y_padding">4</property> + </packing> + </child> + <child> + <widget class="GtkButton" id="button_trigger"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="label" translatable="yes">...</property> + <property name="response_id">0</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options">GTK_FILL</property> + <property name="x_padding">4</property> + <property name="y_padding">4</property> + </packing> + </child> + <child> + <widget class="GtkEntry" id="entry_next_engine"> + <property name="visible">True</property> + <property name="can_focus">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options">GTK_FILL</property> + <property name="x_padding">4</property> + <property name="y_padding">4</property> + </packing> + </child> + <child> + <widget class="GtkEntry" id="entry_prev_engine"> + <property name="visible">True</property> + <property name="can_focus">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options">GTK_FILL</property> + <property name="x_padding">4</property> + <property name="y_padding">4</property> + </packing> + </child> + <child> + <widget class="GtkButton" id="button_next_engine"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="label" translatable="yes">...</property> + <property name="response_id">0</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options">GTK_FILL</property> + <property name="x_padding">4</property> + <property name="y_padding">4</property> + </packing> + </child> + <child> + <widget class="GtkButton" id="button_prev_engine"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="label" translatable="yes">...</property> + <property name="response_id">0</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options">GTK_FILL</property> + <property name="x_padding">4</property> + <property name="y_padding">4</property> + </packing> + </child> + </widget> + </child> </widget> - <packing> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options">GTK_FILL</property> - <property name="x_padding">4</property> - <property name="y_padding">4</property> - </packing> </child> <child> - <widget class="GtkLabel" id="label8"> + <widget class="GtkLabel" id="label10"> <property name="visible">True</property> - <property name="xalign">1</property> - <property name="label" translatable="yes">Next engine:</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> + <property name="label" translatable="yes">Keyboard shortcuts</property> + <property name="use_markup">True</property> </widget> <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options">GTK_FILL</property> - <property name="x_padding">4</property> - <property name="y_padding">4</property> + <property name="type">label_item</property> </packing> </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkFrame" id="frame2"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">GTK_SHADOW_IN</property> <child> - <widget class="GtkEntry" id="entry1"> + <widget class="GtkAlignment" id="alignment2"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="left_padding">12</property> + <child> + <widget class="GtkHBox" id="hbox1"> + <property name="visible">True</property> + <child> + <widget class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Lookup table orientation:</property> + <property name="justify">GTK_JUSTIFY_RIGHT</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="padding">4</property> + </packing> + </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="position">1</property> + </packing> + </child> + </widget> + </child> </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="y_options">GTK_FILL</property> - <property name="x_padding">4</property> - <property name="y_padding">4</property> - </packing> </child> <child> - <widget class="GtkLabel" id="label7"> + <widget class="GtkLabel" id="label11"> <property name="visible">True</property> - <property name="xalign">1</property> - <property name="label" translatable="yes">Trigger:</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> + <property name="label" translatable="yes">Panel</property> + <property name="use_markup">True</property> </widget> <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options">GTK_FILL</property> - <property name="x_padding">4</property> - <property name="y_padding">4</property> + <property name="type">label_item</property> </packing> </child> </widget> <packing> <property name="expand">False</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> <child> @@ -204,94 +283,6 @@ </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="GtkLabel" id="label6"> - <property name="visible">True</property> - <property name="label" translatable="yes">Lookup table orientation</property> - </widget> - </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> - </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> @@ -316,7 +307,7 @@ Vertical</property> </child> </widget> <packing> - <property name="position">2</property> + <property name="position">1</property> </packing> </child> <child> @@ -326,7 +317,7 @@ Vertical</property> </widget> <packing> <property name="type">tab</property> - <property name="position">2</property> + <property name="position">1</property> <property name="tab_fill">False</property> </packing> </child> @@ -344,7 +335,7 @@ Author: Huang Peng <shawn.p.huang@gmail.com> <property name="justify">GTK_JUSTIFY_CENTER</property> </widget> <packing> - <property name="position">3</property> + <property name="position">2</property> </packing> </child> <child> @@ -354,7 +345,7 @@ Author: Huang Peng <shawn.p.huang@gmail.com> </widget> <packing> <property name="type">tab</property> - <property name="position">3</property> + <property name="position">2</property> <property name="tab_fill">False</property> </packing> </child> |