summaryrefslogtreecommitdiffstats
path: root/setup
diff options
context:
space:
mode:
authorPeng Huang <shawn.p.huang@gmail.com>2010-03-25 19:10:24 +0800
committerPeng Huang <shawn.p.huang@gmail.com>2010-03-25 19:12:46 +0800
commit1b3ffa8d9368078b9cc4a2c4515f3330f554f906 (patch)
tree65d25942b8969e39ef8f8aa7d4d09ec63094e20e /setup
parentcfcabb9b9483cb6a9d954a5e189c2a5212b315bd (diff)
downloadibus-libpinyin-1b3ffa8d9368078b9cc4a2c4515f3330f554f906.tar.gz
ibus-libpinyin-1b3ffa8d9368078b9cc4a2c4515f3330f554f906.tar.xz
ibus-libpinyin-1b3ffa8d9368078b9cc4a2c4515f3330f554f906.zip
Add option - orientation of candidates
Diffstat (limited to 'setup')
-rw-r--r--setup/ibus-pinyin-preferences.ui108
-rw-r--r--setup/main.py13
2 files changed, 79 insertions, 42 deletions
diff --git a/setup/ibus-pinyin-preferences.ui b/setup/ibus-pinyin-preferences.ui
index 6e4a01a..425ae9e 100644
--- a/setup/ibus-pinyin-preferences.ui
+++ b/setup/ibus-pinyin-preferences.ui
@@ -360,14 +360,14 @@
<child>
<object class="GtkTable" id="table3">
<property name="visible">True</property>
- <property name="n_rows">6</property>
+ <property name="n_rows">5</property>
<property name="n_columns">2</property>
<property name="column_spacing">12</property>
<property name="row_spacing">6</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkCheckButton" id="ShiftSelectCandidate">
- <property name="label" translatable="yes">Press [Shift] key to select candidate</property>
+ <property name="label" translatable="yes">[Shift] select candidate</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -375,14 +375,13 @@
<property name="draw_indicator">True</property>
</object>
<packing>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="MinusEqualPage">
- <property name="label" translatable="yes">Press [-] [=] key to flip page</property>
+ <property name="label" translatable="yes">[-] [=] flip page</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -391,6 +390,7 @@
<property name="draw_indicator">True</property>
</object>
<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>
@@ -398,7 +398,7 @@
</child>
<child>
<object class="GtkCheckButton" id="CommaPeriodPage">
- <property name="label" translatable="yes">Press [,] [.] key to flip page</property>
+ <property name="label" translatable="yes">[,] [.] flip page</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -407,14 +407,13 @@
<property name="draw_indicator">True</property>
</object>
<packing>
- <property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="AutoCommit">
- <property name="label" translatable="yes">Auto commit phrase</property>
+ <property name="label" translatable="yes">Auto commit</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -422,9 +421,10 @@
<property name="draw_indicator">True</property>
</object>
<packing>
+ <property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
</packing>
</child>
<child>
@@ -438,44 +438,56 @@
</object>
<packing>
<property name="right_attach">2</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox3">
+ <object class="GtkComboBox" id="LookupTableOrientation">
<property name="visible">True</property>
+ <property name="model">liststoreLookupTableOrientation</property>
+ <property name="button_sensitivity">on</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Orientation of candidates:</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkHScale" id="hscaleLookupTablePageSize">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Setup the number of candidates show in one page of lookup table.</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="label16">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Number of candidates:</property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHScale" id="hscaleLookupTablePageSize">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="update_policy">delayed</property>
- <property name="adjustment">LookupTablePageSize</property>
- <property name="digits">0</property>
- <property name="value_pos">left</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="update_policy">delayed</property>
+ <property name="adjustment">LookupTablePageSize</property>
+ <property name="digits">0</property>
+ <property name="value_pos">left</property>
</object>
<packing>
+ <property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="x_options">GTK_FILL</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label16">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Number of candidates:</property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
</packing>
</child>
</object>
@@ -1345,4 +1357,18 @@
<property name="page_increment">1</property>
<property name="page_size">1</property>
</object>
+ <object class="GtkListStore" id="liststoreLookupTableOrientation">
+ <columns>
+ <!-- column-name orientation -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">Horizontal</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Vertical</col>
+ </row>
+ </data>
+ </object>
</interface>
diff --git a/setup/main.py b/setup/main.py
index c0ed614..6ded867 100644
--- a/setup/main.py
+++ b/setup/main.py
@@ -100,6 +100,11 @@ class PreferencesDialog:
def __init_others(self):
#others
self.__lookup_table_page_size = self.__builder.get_object("LookupTablePageSize")
+ self.__lookup_table_orientation = self.__builder.get_object("LookupTableOrientation")
+
+ renderer = gtk.CellRendererText()
+ self.__lookup_table_orientation.pack_start(renderer)
+ self.__lookup_table_orientation.set_attributes(renderer, text=0)
self.__shift_select_candidate = self.__builder.get_object("ShiftSelectCandidate")
self.__minus_equal_page = self.__builder.get_object("MinusEqualPage")
@@ -109,6 +114,7 @@ class PreferencesDialog:
self.__half_width_puncts = self.__builder.get_object("HalfWidthPuncts")
# read values
+ self.__lookup_table_orientation.set_active(self.__get_value("LookupTableOrientation", 0))
self.__lookup_table_page_size.set_value(self.__get_value("LookupTablePageSize", 5))
self.__shift_select_candidate.set_active(self.__get_value("ShiftSelectCandidate", False))
self.__minus_equal_page.set_active(self.__get_value("MinusEqualPage", True))
@@ -121,12 +127,17 @@ class PreferencesDialog:
def __lookup_table_page_size_changed_cb(adjustment):
self.__set_value("LookupTablePageSize", int(adjustment.get_value()))
+ def __lookup_table_orientation_changed_cb(widget):
+ self.__set_value("LookupTableOrientation", widget.get_active())
+
+ self.__lookup_table_orientation.connect("changed", __lookup_table_orientation_changed_cb)
+ self.__lookup_table_page_size.connect("value-changed", __lookup_table_page_size_changed_cb)
+
self.__shift_select_candidate.connect("toggled", self.__toggled_cb, "ShiftSelectCandidate")
self.__minus_equal_page.connect("toggled", self.__toggled_cb, "MinusEqualPage")
self.__comma_period_page.connect("toggled", self.__toggled_cb, "CommaPeriodPage")
self.__auto_commit.connect("toggled", self.__toggled_cb, "AutoCommit")
self.__trad_candidate.connect("toggled", self.__toggled_cb, "TradCandidate")
- self.__lookup_table_page_size.connect("value-changed", __lookup_table_page_size_changed_cb)
def __entry_activate_cb(widget, name):
text = widget.get_text()