diff options
author | Peng Huang <shawn.p.huang@gmail.com> | 2009-09-23 13:30:02 +0800 |
---|---|---|
committer | Peng Huang <shawn.p.huang@gmail.com> | 2009-09-23 13:30:02 +0800 |
commit | 998c9299f04a4756ff8a08ab3448b3f7860b9fe0 (patch) | |
tree | 89a3ccd529632944e1659d7b2b01a1d5595d30c2 /setup | |
parent | 9911013dd7e4edc7c295dad24121309b1fda5718 (diff) | |
download | ibus-libpinyin-998c9299f04a4756ff8a08ab3448b3f7860b9fe0.tar.gz ibus-libpinyin-998c9299f04a4756ff8a08ab3448b3f7860b9fe0.tar.xz ibus-libpinyin-998c9299f04a4756ff8a08ab3448b3f7860b9fe0.zip |
Import c version pinyin engine
Diffstat (limited to 'setup')
-rw-r--r-- | setup/Makefile.am | 3 | ||||
-rw-r--r-- | setup/ibus-pinyin-preferences.glade | 1239 | ||||
-rw-r--r-- | setup/ibus-setup-pinyin.in | 3 | ||||
-rw-r--r-- | setup/main.py | 483 | ||||
l--------- | setup/pydict.py | 1 | ||||
-rw-r--r-- | setup/setup.glade | 958 |
6 files changed, 1454 insertions, 1233 deletions
diff --git a/setup/Makefile.am b/setup/Makefile.am index 4a4b53a..a83dcb3 100644 --- a/setup/Makefile.am +++ b/setup/Makefile.am @@ -19,9 +19,8 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. setup_pinyin_PYTHON = \ - pydict.py \ main.py \ - setup.glade \ + ibus-pinyin-preferences.glade \ $(NULL) setup_pinyindir = $(datadir)/ibus-pinyin/setup diff --git a/setup/ibus-pinyin-preferences.glade b/setup/ibus-pinyin-preferences.glade new file mode 100644 index 0000000..95eefd9 --- /dev/null +++ b/setup/ibus-pinyin-preferences.glade @@ -0,0 +1,1239 @@ +<?xml version="1.0"?> +<interface> + <requires lib="gtk+" version="2.16"/> + <!-- interface-naming-policy project-wide --> + <object class="GtkDialog" id="dialog"> + <property name="border_width">5</property> + <property name="title" translatable="yes">Pinyin preferences</property> + <property name="icon_name">gtk-preferences</property> + <property name="type_hint">normal</property> + <property name="has_separator">False</property> + <child internal-child="vbox"> + <object class="GtkVBox" id="dialog-vbox1"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child> + <object class="GtkNotebook" id="notebook1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <child> + <object class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="top_padding">12</property> + <property name="bottom_padding">12</property> + <property name="left_padding">12</property> + <property name="right_padding">12</property> + <child> + <object class="GtkVBox" id="vbox4"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkFrame" id="frame3"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment6"> + <property name="visible">True</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkTable" id="table2"> + <property name="visible">True</property> + <property name="n_rows">2</property> + <property name="n_columns">2</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkRadioButton" id="FullPinyin"> + <property name="label" translatable="yes">Full pinyin</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">DoublePinyin</property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="DoublePinyin"> + <property name="label" translatable="yes">Double pinyin</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="SimplePinyin"> + <property name="label" translatable="yes">Simple pinyin</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="hbox1"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="labelDoublePinyinSchema"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Schema:</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="DoublePinyinSchema"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="model">liststoreDoublePinyin</property> + <property name="button_sensitivity">on</property> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <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> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Pinyin</b></property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame4"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment7"> + <property name="visible">True</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkTable" id="table4"> + <property name="visible">True</property> + <property name="n_rows">3</property> + <property name="n_columns">3</property> + <child> + <object class="GtkLabel" id="label9"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Language:</property> + </object> + </child> + <child> + <object class="GtkLabel" id="label10"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Half/full with:</property> + </object> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label11"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Half/full punctuation:</property> + </object> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="InitChinese"> + <property name="label" translatable="yes">Chinese</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">InitEnglish</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="InitEnglish"> + <property name="label" translatable="yes">English</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="InitFull"> + <property name="label" translatable="yes">Full</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">InitHalf</property> + </object> + <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> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="InitHalf"> + <property name="label" translatable="yes">Half</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <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> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="InitFullPunct"> + <property name="label" translatable="yes">Full</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + <property name="group">InitHalfPunct</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> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="InitHalfPunct"> + <property name="label" translatable="yes">Half</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <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> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label7"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Initial state</b></property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame5"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment8"> + <property name="visible">True</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkTable" id="table3"> + <property name="visible">True</property> + <property name="n_rows">6</property> + <property name="n_columns">2</property> + <property name="column_spacing">6</property> + <property name="row_spacing">6</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="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="LookupTablePageSize"> + <property name="visible">True</property> + <property name="model">liststorePageSize</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="ShiftSelectCandidate"> + <property name="label" translatable="yes">Press [Shift] key to select candidate</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <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> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="MinusEqualPage"> + <property name="label" translatable="yes">Press [-] [=] key to flip page</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="CommaPeriodPage"> + <property name="label" translatable="yes">Press [,] [.] key to flip page</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <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="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="right_attach">2</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label17"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Half width punctuations:</property> + </object> + <packing> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="HalfWidthPuncts"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="text" translatable="yes">+-*/=%</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label8"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Others</b></property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="tab"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes">General</property> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="top_padding">12</property> + <property name="bottom_padding">12</property> + <property name="left_padding">12</property> + <property name="right_padding">12</property> + <child> + <object class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkCheckButton" id="CorrectPinyin"> + <property name="label" translatable="yes">Correct pinyin</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame2"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkVBox" id="vbox3"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkCheckButton" id="CorrectPinyin_GN_NG"> + <property name="label">gn => ng</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="CorrectPinyin_MG_NG"> + <property name="label">mg => ng</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="CorrectPinyin_IOU_IU"> + <property name="label">iou => iu</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="CorrectPinyin_UEI_UI"> + <property name="label">uei => ui</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="CorrectPinyin_UEN_UN"> + <property name="label">uen => un</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="position">4</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="CorrectPinyin_VE_UE"> + <property name="label">ve => ue</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="position">5</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Correct pinyin</b></property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="label" translatable="yes">Correct pinyin</property> + </object> + <packing> + <property name="position">1</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="top_padding">12</property> + <property name="bottom_padding">12</property> + <property name="left_padding">12</property> + <property name="right_padding">12</property> + <child> + <object class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin"> + <property name="label" translatable="yes">Fuzzy pinyin</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkTable" id="table1"> + <property name="visible">True</property> + <property name="n_rows">12</property> + <property name="n_columns">2</property> + <property name="column_spacing">6</property> + <property name="row_spacing">6</property> + <property name="homogeneous">True</property> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_C_CH"> + <property name="label">c => ch</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_Z_ZH"> + <property name="label">z => zh</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_S_SH"> + <property name="label">s => sh</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_L_N"> + <property name="label">l => n</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_F_H"> + <property name="label">f => h</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_L_R"> + <property name="label">l => r</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_K_G"> + <property name="label">k => g</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_AN_ANG"> + <property name="label">an => ang</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="top_attach">7</property> + <property name="bottom_attach">8</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_EN_ENG"> + <property name="label">en => eng</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="top_attach">8</property> + <property name="bottom_attach">9</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_IN_ING"> + <property name="label">in => ing</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="top_attach">9</property> + <property name="bottom_attach">10</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_CH_C"> + <property name="label">ch => c</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_ZH_Z"> + <property name="label">zh => z</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <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> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_SH_S"> + <property name="label">sh => s</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <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> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_N_L"> + <property name="label">n => l</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <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="FuzzyPinyin_H_F"> + <property name="label">h => f</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <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> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_R_L"> + <property name="label">r => l</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_G_K"> + <property name="label">g => k</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_ANG_AN"> + <property name="label">ang => an</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">7</property> + <property name="bottom_attach">8</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_ENG_EN"> + <property name="label">eng => en</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">8</property> + <property name="bottom_attach">9</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_ING_IN"> + <property name="label">ing => in</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">9</property> + <property name="bottom_attach">10</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_UAN_UANG"> + <property name="label">uan => uang</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="top_attach">11</property> + <property name="bottom_attach">12</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_UANG_UAN"> + <property name="label">uang => uan</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <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> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_IAN_IANG"> + <property name="label">ian => iang</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="top_attach">10</property> + <property name="bottom_attach">11</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="FuzzyPinyin_IANG_IAN"> + <property name="label">iang => ian</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">10</property> + <property name="bottom_attach">11</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Fuzzy pinyin</b></property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + <packing> + <property name="position">2</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="label" translatable="yes">Fuzzy pinyin</property> + </object> + <packing> + <property name="position">2</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="alignment9"> + <property name="visible">True</property> + <property name="yscale">0.30000001192092896</property> + <property name="top_padding">12</property> + <property name="bottom_padding">12</property> + <property name="left_padding">12</property> + <property name="right_padding">12</property> + <child> + <object class="GtkVBox" id="vbox6"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkVBox" id="vbox7"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkImage" id="image1"> + <property name="visible">True</property> + <property name="pixel_size">48</property> + <property name="icon_name">gtk-about</property> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label13"> + <property name="visible">True</property> + <property name="label" translatable="yes"><big><b>IBus Pinyin 1.3.0</b></big></property> + <property name="use_markup">True</property> + <property name="selectable">True</property> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label14"> + <property name="visible">True</property> + <property name="label" translatable="yes">Pinyin input method for IBus</property> + <property name="selectable">True</property> + </object> + <packing> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label15"> + <property name="visible">True</property> + <property name="label" translatable="yes"><small>Copyright (c) 2009 Huang Peng &lt;shawn.p.huang@gmail.com&gt;</small></property> + <property name="use_markup">True</property> + <property name="selectable">True</property> + </object> + <packing> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkLinkButton" id="linkbutton1"> + <property name="label" translatable="yes">http://ibus.googlecode.com</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="has_tooltip">True</property> + <property name="relief">none</property> + <property name="uri">http://ibus.googlecode.com</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">4</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + </object> + <packing> + <property name="position">3</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="label" translatable="yes">About</property> + </object> + <packing> + <property name="position">3</property> + <property name="tab_fill">False</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child internal-child="action_area"> + <object class="GtkHButtonBox" id="dialog-action_area1"> + <property name="visible">True</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="buttonClose"> + <property name="label">gtk-close</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">buttonClose</action-widget> + </action-widgets> + </object> + <object class="GtkListStore" id="liststoreDoublePinyin"> + <columns> + <!-- column-name schema --> + <column type="gchararray"/> + </columns> + <data> + <row> + <col id="0" translatable="yes">MSPY</col> + </row> + <row> + <col id="0" translatable="yes">ZRM</col> + </row> + <row> + <col id="0" translatable="yes">ABC</col> + </row> + <row> + <col id="0" translatable="yes">ZGPY</col> + </row> + <row> + <col id="0" translatable="yes">PYJJ</col> + </row> + </data> + </object> + <object class="GtkListStore" id="liststorePageSize"> + <columns> + <!-- column-name pageSize --> + <column type="gchararray"/> + </columns> + <data> + <row> + <col id="0" translatable="yes">1</col> + </row> + <row> + <col id="0" translatable="yes">2</col> + </row> + <row> + <col id="0" translatable="yes">3</col> + </row> + <row> + <col id="0" translatable="yes">4</col> + </row> + <row> + <col id="0" translatable="yes">5</col> + </row> + <row> + <col id="0" translatable="yes">6</col> + </row> + <row> + <col id="0" translatable="yes">7</col> + </row> + <row> + <col id="0" translatable="yes">8</col> + </row> + <row> + <col id="0" translatable="yes">9</col> + </row> + <row> + <col id="0" translatable="yes">10</col> + </row> + </data> + </object> +</interface> diff --git a/setup/ibus-setup-pinyin.in b/setup/ibus-setup-pinyin.in index a7eb522..27c700c 100644 --- a/setup/ibus-setup-pinyin.in +++ b/setup/ibus-setup-pinyin.in @@ -25,5 +25,6 @@ datarootdir=@datarootdir@ export IBUS_PREFIX=@prefix@ export IBUS_DATAROOTDIR=@datarootdir@ export IBUS_LOCALEDIR=@localedir@ -exec python @prefix@/share/ibus-pinyin/setup/main.py $@ +cd @prefix@/share/ibus-pinyin/setup/ +exec python main.py $@ diff --git a/setup/main.py b/setup/main.py index 7f17f83..6396117 100644 --- a/setup/main.py +++ b/setup/main.py @@ -1,284 +1,225 @@ -# vim:set et sts=4 sw=4: -# -# ibus-pinyin - The PinYin engine for IBus -# -# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# 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 os -import signal -import gobject import gtk -import gtk.gdk as gdk -import gtk.glade as glade import ibus -import gettext import locale -from pydict import SHUANGPIN_SCHEMAS - -from gettext import dgettext -_ = lambda a : dgettext("ibus-pinyin", a) - -RGB_COLOR = lambda c : ((c.red & 0xff00) << 8) + (c.green & 0xff00) + ((c.blue & 0xff00) >> 8) -GDK_COLOR = lambda c : gdk.Color(((c >> 16) & 0xff) * 256, ((c >> 8) & 0xff) * 256, (c & 0xff) * 256) -RGB = lambda r, g, b : ((r & 0xff) << 16) + ((g & 0xff) << 8) + (b & 0xff) +import os +import gettext +class PreferencesDialog: + def __init__(self): + locale.setlocale(locale.LC_ALL, "") + localedir = os.getenv("IBUS_LOCALEDIR") + gettext.bindtextdomain("ibus-pinyin", localedir) + gettext.bind_textdomain_codeset("ibus-pinyin", "UTF-8") -class SetupUI (): - def __init__ (self): - self.__need_reload_config = False self.__bus = ibus.Bus() self.__config = self.__bus.get_config() - - self.__options = { - "SupportGBK" : [False, self.__checkbutton_op], - "ShuangPin" : [False, self.__checkbutton_op], - "AutoCorrect" : [True, self.__checkbutton_op], - - "FuzzyPinYin" : [False, self.__checkbutton_op], - "FuzzyS_Sh" : [False, self.__checkbutton_op], - "FuzzyC_Ch" : [False, self.__checkbutton_op], - "FuzzyZ_Zh" : [False, self.__checkbutton_op], - "FuzzyL_N" : [False, self.__checkbutton_op], - "FuzzyIn_Ing" : [False, self.__checkbutton_op], - "FuzzyEn_Eng" : [False, self.__checkbutton_op], - "FuzzyAn_Ang" : [False, self.__checkbutton_op], - - "SpellCheck" : [True, self.__checkbutton_op], - "UVToTemp" : [True, self.__checkbutton_op], - "ShiftSelectCandidates" : - [True, self.__checkbutton_op], - - "CommaPageDownUp" : [True, self.__checkbutton_op], - "EqualPageDownUp" : [True, self.__checkbutton_op], - "AutoCommit" : [False, self.__checkbutton_op], - - "PhraseColor" : [RGB (0, 0, 0), self.__colorbutton_op], - "NewPhraseColor" : [RGB (0xef, 0, 0), self.__colorbutton_op], - "UserPhraseColor" : [RGB (0, 0, 0xbf), self.__colorbutton_op], - "SpecialPhraseColor" : - [RGB (0, 0xbf, 0), self.__colorbutton_op], - "EnglishPhraseColor" : - [RGB (0, 0xbf, 0), self.__colorbutton_op], - "ErrorEnglishPhraseColor" : - [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], - } + self.__builder = gtk.Builder() + self.__builder.set_translation_domain("ibus-pinyin") + self.__builder.add_from_file("ibus-pinyin-preferences.glade") + self.__dialog = self.__builder.get_object("dialog") + + self.__init_pinyin() + self.__init_init_state() + self.__init_others() + self.__init_correct_pinyin() + self.__init_fuzzy_pinyin() + + def __init_pinyin(self): + # pinyin + self.__full_pinyin = self.__builder.get_object("FullPinyin") + self.__simple_pinyin = self.__builder.get_object("SimplePinyin") + self.__double_pinyin = self.__builder.get_object("DoublePinyin") + self.__double_pinyin_schema = self.__builder.get_object("DoublePinyinSchema") + self.__double_pinyin_schema_label = self.__builder.get_object("labelDoublePinyinSchema") + + renderer = gtk.CellRendererText() + self.__double_pinyin_schema.pack_start(renderer) + self.__double_pinyin_schema.set_attributes(renderer, text=0) + + # read value + self.__simple_pinyin.set_active(self.__get_value("SimplePinyin", True)) + self.__full_pinyin.set_active(not self.__get_value("DoublePinyin", False)) + self.__double_pinyin_schema.set_active(self.__get_value("DoublePinyinSchema", 0)) + if self.__full_pinyin.get_active(): + self.__simple_pinyin.set_sensitive(True) + self.__double_pinyin_schema.set_sensitive(False) + self.__double_pinyin_schema_label.set_sensitive(False) + else: + self.__simple_pinyin.set_sensitive(False) + self.__double_pinyin_schema.set_sensitive(True) + self.__double_pinyin_schema_label.set_sensitive(True) + + def __full_pinyin_toggled_cb(widget): + val = widget.get_active() + self.__set_value("DoublePinyin", not val) + self.__simple_pinyin.set_sensitive(val) + + def __double_pinyin_toggled_cb(widget): + val = widget.get_active() + self.__set_value("DoublePinyin", val) + self.__double_pinyin_schema.set_sensitive(val) + self.__double_pinyin_schema_label.set_sensitive(val) + + def __double_pinyin_schema_changed_cb(widget): + self.__set_value("DoublePinyinSchema", widget.get_active()) + + # connect signals + self.__full_pinyin.connect("toggled", __full_pinyin_toggled_cb) + self.__double_pinyin.connect("toggled", __double_pinyin_toggled_cb) + self.__simple_pinyin.connect("toggled", self.__toggled_cb, "SimplePinyin") + self.__double_pinyin_schema.connect("changed", __double_pinyin_schema_changed_cb) + + def __init_init_state(self): + # init state + self.__init_chinese = self.__builder.get_object("InitChinese") + self.__init_english = self.__builder.get_object("InitEnglish") + self.__init_full = self.__builder.get_object("InitFull") + self.__init_half = self.__builder.get_object("InitHalf") + self.__init_full_punct = self.__builder.get_object("InitFullPunct") + self.__init_half_punct = self.__builder.get_object("InitHalfPunct") + + # read values + self.__init_chinese.set_active(self.__get_value("InitChinese", True)) + self.__init_full.set_active(self.__get_value("InitFull", False)) + self.__init_full_punct.set_active(self.__get_value("InitFullPunct", True)) + + # connect signals + self.__init_chinese.connect("toggled", self.__toggled_cb, "InitChinese") + self.__init_full.connect("toggled", self.__toggled_cb, "InitFull") + self.__init_full_punct.connect("toggled", self.__toggled_cb, "InitFullPunct") + + def __init_others(self): + #others + self.__lookup_table_page_size = self.__builder.get_object("LookupTablePageSize") + renderer = gtk.CellRendererText() + self.__lookup_table_page_size.pack_start(renderer) + self.__lookup_table_page_size.set_attributes(renderer, text=0) + + self.__shift_select_candidate = self.__builder.get_object("ShiftSelectCandidate") + self.__minus_equal_page = self.__builder.get_object("MinusEqualPage") + self.__comma_period_page = self.__builder.get_object("CommaPeriodPage") + self.__auto_commit = self.__builder.get_object("AutoCommit") + self.__half_width_puncts = self.__builder.get_object("HalfWidthPuncts") + + # read values + self.__lookup_table_page_size.set_active(self.__get_value("LookupTablePageSize", 5) - 1) + self.__shift_select_candidate.set_active(self.__get_value("ShiftSelectCandidate", False)) + self.__minus_equal_page.set_active(self.__get_value("MinusEqualPage", True)) + self.__comma_period_page.set_active(self.__get_value("CommaPeriodPage", True)) + self.__half_width_puncts.set_text(self.__get_value("HalfWidthPuncts", "+-*/=%")) + + # connect signals + def __lookup_table_page_size_changed_cb(widget): + self.__set_value("LookupTablePageSize", widget.get_active() + 1) + + 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.__lookup_table_page_size.connect("changed", __lookup_table_page_size_changed_cb) + + def __entry_activate_cb(widget, name): + text = widget.get_text() + self.__set_value(name, text) + self.__half_width_puncts.connect("activate", __entry_activate_cb, "HalfWidthPuncts") + + def __init_correct_pinyin(self): + # auto correct + self.__correct_pinyin = self.__builder.get_object("CorrectPinyin") + self.__correct_pinyin_widgets = [ + ("CorrectPinyin_GN_NG", True), + ("CorrectPinyin_MG_NG", True), + ("CorrectPinyin_IOU_IU", True), + ("CorrectPinyin_UEI_UI", True), + ("CorrectPinyin_UEN_UN", True), + ("CorrectPinyin_VE_UE", True), + ] + + def __correct_pinyin_toggled_cb(widget): + val = widget.get_active() + map(lambda w: self.__builder.get_object(w[0]).set_sensitive(val), + self.__correct_pinyin_widgets) + self.__correct_pinyin.connect("toggled", __correct_pinyin_toggled_cb) + + # init value + self.__correct_pinyin.set_active(self.__get_value("CorrectPinyin", True)) + for name, defval in self.__correct_pinyin_widgets: + widget = self.__builder.get_object(name) + widget.set_active(self.__get_value(name, defval)) + + self.__correct_pinyin.connect("toggled", self.__toggled_cb, "CorrectPinyin") + for name, defval in self.__correct_pinyin_widgets: + widget = self.__builder.get_object(name) + widget.connect("toggled", self.__toggled_cb, name) + + def __init_fuzzy_pinyin(self): + # fuzzy pinyin + self.__fuzzy_pinyin = self.__builder.get_object("FuzzyPinyin") + self.__fuzzy_pinyin_widgets = [ + ("FuzzyPinyin_C_CH", True), + ("FuzzyPinyin_Z_ZH", True), + ("FuzzyPinyin_S_SH", True), + ("FuzzyPinyin_CH_C", False), + ("FuzzyPinyin_ZH_Z", False), + ("FuzzyPinyin_SH_S", False), + ("FuzzyPinyin_L_N", True), + ("FuzzyPinyin_F_H", True), + ("FuzzyPinyin_L_R", False), + ("FuzzyPinyin_K_G", True), + ("FuzzyPinyin_N_L", False), + ("FuzzyPinyin_H_F", False), + ("FuzzyPinyin_R_L", False), + ("FuzzyPinyin_G_K", False), + ("FuzzyPinyin_AN_ANG", True), + ("FuzzyPinyin_EN_ENG", True), + ("FuzzyPinyin_IN_ING", True), + ("FuzzyPinyin_ANG_AN", True), + ("FuzzyPinyin_ENG_EN", True), + ("FuzzyPinyin_ING_IN", True), + ("FuzzyPinyin_IAN_IANG", False), + ("FuzzyPinyin_UAN_UANG", False), + ("FuzzyPinyin_IANG_IAN", False), + ("FuzzyPinyin_UANG_UAN", False), + ] + + def __fuzzy_pinyin_toggled_cb(widget): + val = widget.get_active() + map(lambda w: self.__builder.get_object(w[0]).set_sensitive(val), + self.__fuzzy_pinyin_widgets) + self.__fuzzy_pinyin.connect("toggled", __fuzzy_pinyin_toggled_cb) + + # init value + self.__fuzzy_pinyin.set_active(self.__get_value("FuzzyPinyin", False)) + for name, defval in self.__fuzzy_pinyin_widgets: + widget = self.__builder.get_object(name) + widget.set_active(self.__get_value(name, defval)) + + self.__fuzzy_pinyin.connect("toggled", self.__toggled_cb, "FuzzyPinyin") + for name, defval in self.__fuzzy_pinyin_widgets: + widget = self.__builder.get_object(name) + widget.connect("toggled", self.__toggled_cb, name) + + def __changed_cb(self, widget, name): + self.__set_value(name, widget.get_active()) + + def __toggled_cb(self, widget, name): + self.__set_value(name, widget.get_active ()) + + def __get_value(self, name, defval): + value = self.__config.get_value("engine/Pinyin", name, "test_default_value_9898") + if value != "test_default_value_9898": + return value + self.__set_value(name, defval) + return defval + + def __set_value(self, name, val): + self.__config.set_value("engine/Pinyin", name, val) def run(self): - self.__init_ui() - self.__load_config() - signal.signal(signal.SIGUSR1, self.__sigusr1_cb) - gtk.main() - - def __sigusr1_cb(self, *arg): - window = self.__xml.get_widget("window_main") - window.present() - - 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: - print >> sys.stderr, "Can not find widget %s" % name - return False - if opt == "read": - info[0] = self.__read(name, info[0]) - widget.set_active(info[2].index(info[0])) - return True - if opt == "write": - info[0] = info[2][widget.get_active()] - self.__write(name, info[0]) - return True - if opt == "check": - return info[0] != info[2][widget.get_active()] - - if opt == "init": - model = gtk.ListStore(str) - for v in info[2]: - model.append([_(str(v))]) - widget.set_model(model) - return False - - def __colorbutton_op(self, name, opt, info): - widget = self.__xml.get_widget(name) - if widget == None: - print >> sys.stderr, "Can not find widget %s" % name - return False - if opt == "read": - info[0] = self.__read(name, info[0]) - widget.set_color(GDK_COLOR(info[0])) - return True - if opt == "write": - info[0] = RGB_COLOR (widget.get_color()) - self.__write(name, info[0]) - return True - if opt == "check": - return info[0] != RGB_COLOR(widget.get_color()) - return False - - def __checkbutton_op(self, name, opt, info): - widget = self.__xml.get_widget(name) - if widget == None: - print >> sys.stderr, "Can not find widget %s" % name - return False - - if opt == "read": - info[0] = self.__read(name, info[0]) - widget.set_active(info[0]) - return True - if opt == "write": - info[0] = widget.get_active() - self.__write(name, info[0]) - return True - if opt == "check": - return info[0] != widget.get_active() - return False - - def __read(self, name, v): - return self.__config.get_value("engine/PinYin", name, v) - - def __write(self, name, v): - return self.__config.set_value("engine/PinYin", name, v) - - def __init_ui(self): - - locale.setlocale(locale.LC_ALL, "") - localedir = os.getenv("IBUS_LOCALEDIR") + return self.__dialog.run() - gettext.bindtextdomain("ibus-pinyin", localedir) - gettext.bind_textdomain_codeset("ibus-pinyin", "UTF-8") - glade.bindtextdomain("ibus-pinyin", localedir) - glade.textdomain("ibus-pinyin") - - glade_file = path.join(path.dirname(__file__), "setup.glade") - self.__xml = glade.XML (glade_file) - self.__window = self.__xml.get_widget("window_main") - for name, info in self.__options.items(): - info[1] (name, "init", info) - info[1] (name, "read", info) - self.__xml.signal_autoconnect(self) - self.__window.show_all() - - def __load_config(self): - for name, info in self.__options.items(): - info[1] (name, "read", info) - - def __save_config(self): - self.__need_reload_config = True - for name, info in self.__options.items(): - info[1] (name, "write", info) - - def __query_changed(self): - for name, info in self.__options.items(): - if info[1] (name, "check", info): - return True - return False - - def __quit(self, need_confirm ): - if need_confirm == False: - gtk.main_quit() - return True - else: - dlg = gtk.MessageDialog(self.__window, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, - gtk.BUTTONS_YES_NO, _("Are you sure to close Python PinYin Setup without save configure?")) - id = dlg.run() - dlg.destroy() - if id == gtk.RESPONSE_YES: - gtk.main_quit() - return True - return False - - def __optimize_user_db(self): - import sqlite3 - dlg = gtk.MessageDialog(self.__window, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, - gtk.BUTTONS_OK, _("The user phrases database will be reorganized! Please don't use python PinYin now.")) - dlg.run() - dlg.destroy() - - try: - db = sqlite3.connect(path.expanduser("~/.ibus/pinyin/user.db")) - sqlstring = """ - BEGIN TRANSACTION; - CREATE TABLE tmp AS SELECT * FROM py_phrase; - DELETE FROM py_phrase; - INSERT INTO py_phrase SELECT * FROM tmp ORDER BY ylen, y0, y1, y2, y3, yx, phrase; - DROP TABLE tmp; - COMMIT; - """ - db.executescript(sqlstring) - db.executescript("VACUUM;") - except: - import traceback - traceback.print_exc() - - dlg.destroy() - dlg = gtk.MessageDialog(self.__window, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, - gtk.BUTTONS_OK, _("Reorganizing is over!")) - dlg.run() - dlg.destroy() - - # events handlers - def on_window_main_delete_event(self, widget, event): - changed = self.__query_changed() - self.__quit(changed) - - def on_button_ok_clicked(self, button): - changed = self.__query_changed() - if changed: - self.__save_config() - self.__quit(False) - - def on_button_apply_clicked(self, button): - self.__save_config() - - def on_button_cancel_clicked(self, button): - changed = self.__query_changed() - self.__quit(changed) - - def on_button_optimize_db_clicked(self, button): - self.__optimize_user_db() - - def on_value_changed(self, widget, data = None): - if self.__query_changed(): - self.__xml.get_widget("button_apply").set_sensitive(True) - else: - self.__xml.get_widget("button_apply").set_sensitive(False) +def main(): + PreferencesDialog().run() if __name__ == "__main__": - ui = SetupUI() - ui.run() - + main() diff --git a/setup/pydict.py b/setup/pydict.py deleted file mode 120000 index b106fef..0000000 --- a/setup/pydict.py +++ /dev/null @@ -1 +0,0 @@ -../engine/pydict.py
\ No newline at end of file diff --git a/setup/setup.glade b/setup/setup.glade deleted file mode 100644 index ad16a12..0000000 --- a/setup/setup.glade +++ /dev/null @@ -1,958 +0,0 @@ -<?xml version="1.0"?> -<glade-interface> - <!-- interface-requires gtk+ 2.16 --> - <!-- interface-naming-policy toplevel-contextual --> - <widget class="GtkWindow" id="window_main"> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="title" translatable="yes">Python PinYin Setup</property> - <property name="window_position">center</property> - <child> - <widget class="GtkVBox" id="vbox1"> - <property name="visible">True</property> - <child> - <widget class="GtkNotebook" id="notebook"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="scrollable">True</property> - <child> - <widget class="GtkTable" id="table1"> - <property name="visible">True</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> - <property name="homogeneous">True</property> - <child> - <widget class="GtkEntry" id="HalfPunctuations"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">●</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> - <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="GtkLabel" id="label21"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">Press [u] or [v] to temporary English mode</property> - </widget> - <packing> - <property name="top_attach">6</property> - <property name="bottom_attach">7</property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="UVToTemp"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_value_changed"/> - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">6</property> - <property name="bottom_attach">7</property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="SpellCheck"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_value_changed"/> - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="AutoCorrect"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_value_changed"/> - <child> - <placeholder/> - </child> - </widget> - <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> - </packing> - </child> - <child> - <widget class="GtkComboBox" id="PageSize"> - <property name="visible">True</property> - <property name="items" translatable="yes">1 -</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">3</property> - <property name="bottom_attach">4</property> - </packing> - </child> - <child> - <widget class="GtkComboBox" id="ShuangPinSchema"> - <property name="visible">True</property> - <property name="items" translatable="yes">1 -</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">2</property> - <property name="bottom_attach">3</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label14"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">English spelling check</property> - </widget> - <packing> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label13"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">Wrong PinYin auto correct</property> - </widget> - <packing> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label11"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">Lookup table page size</property> - </widget> - <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label10"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">ShuangPin Schema</property> - </widget> - <packing> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label16"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">ShuangPin</property> - </widget> - <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label17"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">Support GBK</property> - </widget> - </child> - <child> - <widget class="GtkCheckButton" id="ShuangPin"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_value_changed"/> - <child> - <placeholder/> - </child> - </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> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="SupportGBK"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_value_changed"/> - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label20"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">Press [shift] to select candidates</property> - </widget> - <packing> - <property name="top_attach">7</property> - <property name="bottom_attach">8</property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="ShiftSelectCandidates"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="draw_indicator">True</property> - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">7</property> - <property name="bottom_attach">8</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label22"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">Press [-] [=] to page down up.</property> - </widget> - <packing> - <property name="top_attach">8</property> - <property name="bottom_attach">9</property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="EqualPageDownUp"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="draw_indicator">True</property> - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">8</property> - <property name="bottom_attach">9</property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="CommaPageDownUp"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="draw_indicator">True</property> - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">9</property> - <property name="bottom_attach">10</property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="AutoCommit"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="draw_indicator">True</property> - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">10</property> - <property name="bottom_attach">11</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label23"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">Auto commit</property> - </widget> - <packing> - <property name="top_attach">10</property> - <property name="bottom_attach">11</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label24"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">Press [,] [.] to page down up.</property> - </widget> - <packing> - <property name="top_attach">9</property> - <property name="bottom_attach">10</property> - </packing> - </child> - </widget> - </child> - <child> - <widget class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="label" translatable="yes">General</property> - </widget> - <packing> - <property name="tab_fill">False</property> - <property name="type">tab</property> - </packing> - </child> - <child> - <widget class="GtkTable" id="table4"> - <property name="no_show_all">True</property> - <property name="n_rows">12</property> - <property name="n_columns">2</property> - <property name="column_spacing">2</property> - <property name="row_spacing">2</property> - <property name="homogeneous">True</property> - <child> - <widget class="GtkCheckButton" id="FuzzyPinYin"> - <property name="label" translatable="yes">Enable Fuzzy PinYin</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </widget> - </child> - <child> - <widget class="GtkCheckButton" id="FuzzyS_Sh"> - <property name="label" translatable="yes">s <=> sh</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options"></property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="FuzzyC_Ch"> - <property name="label" translatable="yes">c <=> ch</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options"></property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="FuzzyZ_Zh"> - <property name="label" translatable="yes">z <=> zh</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options"></property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="FuzzyL_N"> - <property name="label" translatable="yes">l <=> n</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options"></property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="FuzzyIn_Ing"> - <property name="label" translatable="yes">in <=> ing</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">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="x_options"></property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="FuzzyEn_Eng"> - <property name="label" translatable="yes">en <=> eng</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">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="x_options"></property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="FuzzyAn_Ang"> - <property name="label" translatable="yes">an <=> ang</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options"></property> - <property name="y_options"></property> - </packing> - </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> - <placeholder/> - </child> - </widget> - <packing> - <property name="position">1</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="Fuzzytab"> - <property name="label" translatable="yes">Fuzzy PinYin</property> - </widget> - <packing> - <property name="position">1</property> - <property name="tab_fill">False</property> - <property name="type">tab</property> - </packing> - </child> - <child> - <widget class="GtkTable" id="table2"> - <property name="visible">True</property> - <property name="n_rows">11</property> - <property name="n_columns">2</property> - <property name="column_spacing">2</property> - <property name="row_spacing">2</property> - <property name="homogeneous">True</property> - <child> - <widget class="GtkLabel" id="label9"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">Color of Spelling Error</property> - </widget> - <packing> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label8"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">Color of English Candidates</property> - </widget> - <packing> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label7"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">Color of Special Phrases</property> - </widget> - <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label6"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">Color of User Phrases</property> - </widget> - <packing> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label5"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">Color of New Phrases</property> - </widget> - <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label4"> - <property name="visible">True</property> - <property name="xalign">0.89999997615814209</property> - <property name="label" translatable="yes">Color of Normal Phrases</property> - </widget> - </child> - <child> - <widget class="GtkColorButton" id="ErrorEnglishPhraseColor"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <signal name="color_set" handler="on_value_changed"/> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - </packing> - </child> - <child> - <widget class="GtkColorButton" id="EnglishPhraseColor"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <signal name="color_set" handler="on_value_changed"/> - </widget> - <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> - </packing> - </child> - <child> - <widget class="GtkColorButton" id="SpecialPhraseColor"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <signal name="color_set" handler="on_value_changed"/> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - </packing> - </child> - <child> - <widget class="GtkColorButton" id="UserPhraseColor"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <signal name="color_set" handler="on_value_changed"/> - </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> - </packing> - </child> - <child> - <widget class="GtkColorButton" id="NewPhraseColor"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <signal name="color_set" handler="on_value_changed"/> - </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> - </packing> - </child> - <child> - <widget class="GtkColorButton" id="PhraseColor"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <signal name="color_set" handler="on_value_changed"/> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - </packing> - </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> - </widget> - <packing> - <property name="position">2</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="label" translatable="yes">Colors</property> - </widget> - <packing> - <property name="position">2</property> - <property name="tab_fill">False</property> - <property name="type">tab</property> - </packing> - </child> - <child> - <widget class="GtkTable" id="table3"> - <property name="no_show_all">True</property> - <property name="n_rows">6</property> - <property name="n_columns">3</property> - <property name="homogeneous">True</property> - <child> - <widget class="GtkButton" id="button_optimize_db"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <signal name="clicked" handler="on_button_optimize_db_clicked"/> - <child> - <widget class="GtkHBox" id="hbox1"> - <property name="visible">True</property> - <child> - <widget class="GtkImage" id="image1"> - <property name="visible">True</property> - <property name="xalign">0.80000001192092896</property> - <property name="stock">gtk-execute</property> - <property name="icon-size">4</property> - </widget> - <packing> - <property name="position">0</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label19"> - <property name="visible">True</property> - <property name="xalign">0.10000000149011612</property> - <property name="label" translatable="yes">Optimize User DB</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="top_attach">1</property> - <property name="bottom_attach">2</property> - </packing> - </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> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="position">3</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label3"> - <property name="label" translatable="yes">User DB</property> - </widget> - <packing> - <property name="position">3</property> - <property name="tab_fill">False</property> - <property name="type">tab</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label15"> - <property name="visible">True</property> - <property name="label" translatable="yes">Python PinYin - -provided by - -Huang Peng <shawn.p.huang@gmail.com> -</property> - <property name="justify">center</property> - </widget> - <packing> - <property name="position">4</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label18"> - <property name="label" translatable="yes">About</property> - </widget> - <packing> - <property name="position">4</property> - <property name="tab_fill">False</property> - <property name="type">tab</property> - </packing> - </child> - </widget> - <packing> - <property name="position">0</property> - </packing> - </child> - <child> - <widget class="GtkHButtonBox" id="hbuttonbox1"> - <property name="visible">True</property> - <property name="spacing">12</property> - <property name="layout_style">end</property> - <child> - <widget class="GtkButton" id="button_apply"> - <property name="label">gtk-apply</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_stock">True</property> - <signal name="clicked" handler="on_button_apply_clicked"/> - </widget> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <widget class="GtkButton" id="button_cancel"> - <property name="label">gtk-cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_stock">True</property> - <signal name="clicked" handler="on_button_cancel_clicked"/> - </widget> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - <child> - <widget class="GtkButton" id="button_ok"> - <property name="label">gtk-ok</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_stock">True</property> - <signal name="clicked" handler="on_button_ok_clicked"/> - <signal name="activate" handler="on_button_ok_activate"/> - </widget> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">2</property> - </packing> - </child> - </widget> - <packing> - <property name="expand">False</property> - <property name="padding">7</property> - <property name="position">1</property> - </packing> - </child> - </widget> - </child> - </widget> -</glade-interface> |