diff options
author | Huang Peng <shawn.p.huang@gmail.com> | 2008-09-15 02:56:52 +0800 |
---|---|---|
committer | Huang Peng <shawn.p.huang@gmail.com> | 2008-09-15 02:56:52 +0800 |
commit | 196168b440f8cf160e23fd05d0663886e6f0aac3 (patch) | |
tree | 60082440c5069fa0a3daf0115614b0bb680ccedf /setup | |
parent | e253a5d1a5cd03fa4d2bddb30d842122f2d1adcf (diff) | |
download | ibus-libpinyin-196168b440f8cf160e23fd05d0663886e6f0aac3.tar.gz ibus-libpinyin-196168b440f8cf160e23fd05d0663886e6f0aac3.tar.xz ibus-libpinyin-196168b440f8cf160e23fd05d0663886e6f0aac3.zip |
Add Half punctuations feature by Jiahua Huang <jhuangjiahua@gmail.com>.
Diffstat (limited to 'setup')
-rw-r--r-- | setup/main.py | 19 | ||||
-rw-r--r-- | setup/setup.glade | 26 |
2 files changed, 44 insertions, 1 deletions
diff --git a/setup/main.py b/setup/main.py index 6771b8c..f81c986 100644 --- a/setup/main.py +++ b/setup/main.py @@ -18,6 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +import sys from os import path import gobject import gtk @@ -73,6 +74,7 @@ class SetupUI (): [RGB (0xef, 0, 0), self.__colorbutton_op], "PageSize" : [5, self.__combobox_op, range(1, 10)], "ShuangPinSchema" : ["MSPY", self.__combobox_op, SHUANGPIN_SCHEMAS.keys()], + "HalfPunctuations" : ["+-*/=%", self.__entry_op], } def run(self): @@ -81,6 +83,23 @@ class SetupUI (): self.__load_config() gtk.main() + def __entry_op(self, name, opt, info): + widget = self.__xml.get_widget(name) + if widget == None: + print >> sys.stderr, "Can not find widget %s" % name + return "" + if opt == "read": + info[0] = self.__read(name, info[0]) + widget.set_text(info[0]) + return True + if opt == "write": + info[0] = widget.get_text() + self.__write(name, info[0]) + return True + if opt == "check": + return info[0] != widget.get_text() + return "" + def __combobox_op(self, name, opt, info): widget = self.__xml.get_widget(name) if widget == None: diff --git a/setup/setup.glade b/setup/setup.glade index 187a247..44ecca0 100644 --- a/setup/setup.glade +++ b/setup/setup.glade @@ -18,7 +18,7 @@ <child> <widget class="GtkTable" id="table1"> <property name="visible">True</property> - <property name="n_rows">11</property> + <property name="n_rows">12</property> <property name="n_columns">2</property> <property name="column_spacing">4</property> <property name="row_spacing">2</property> @@ -324,6 +324,30 @@ <property name="bottom_attach">7</property> </packing> </child> + <child> + <widget class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="xalign">0.89999997615814209</property> + <property name="label" translatable="yes">Half punctuations</property> + </widget> + <packing> + <property name="top_attach">11</property> + <property name="bottom_attach">12</property> + </packing> + </child> + <child> + <widget class="GtkEntry" id="HalfPunctuations"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <signal name="changed" handler="on_value_changed"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">11</property> + <property name="bottom_attach">12</property> + </packing> + </child> </widget> </child> <child> |