1919# You should have received a copy of the GNU General Public License along
2020# with this program; if not, write to the Free Software Foundation, Inc.,
2121# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22-
22+
2323import sys
2424import os
2525import gi
3434
3535class Setup :
3636 def __init__ (self , bus ):
37- self .__bus = bus
37+ self .__bus = bus
3838 self .__config = self .__bus .get_config ()
3939 self .__config .connect ("value-changed" , self .on_value_changed , None )
4040 self .__create_ui ()
@@ -55,14 +55,19 @@ def __create_ui(self):
5555 self .__window .vbox .pack_start (self .__special_notify_button , True , True , 10 )
5656 self .__special_only_button = Gtk .CheckButton (label = _ ("Special Code Only Mode" ))
5757 self .__window .vbox .pack_start (self .__special_only_button , True , True ,10 )
58+ self .__output_simplified_button = Gtk .CheckButton (label = _ ("Convert output to simplified Chinese" ))
59+ self .__window .vbox .pack_start (self .__output_simplified_button , True , True , 10 )
5860
5961 current_special_mode = self .__read ("SpecialOnly" , False )
6062 current_special_notify = self .__read ("SpecialNotify" , False )
63+ current_output_simplified = self .__read ("OutputSimplified" , False )
6164
6265 if current_special_notify :
6366 self .__special_notify_button .set_active (True )
6467 if current_special_mode :
6568 self .__special_only_button .set_active (True )
69+ if current_output_simplified :
70+ self .__output_simplified_button .set_active (True )
6671
6772 self .__window .show_all ()
6873
@@ -75,6 +80,7 @@ def run(self):
7580 def apply (self ):
7681 select_special_notify = self .__special_notify_button .get_active ()
7782 select_special_mode = self .__special_only_button .get_active ()
83+ select_output_simplified = self .__output_simplified_button .get_active ()
7884
7985 if select_special_notify :
8086 self .__write ("SpecialNotify" , GLib .Variant .new_boolean (True ))
@@ -86,6 +92,11 @@ def apply(self):
8692 else :
8793 self .__write ("SpecialOnly" , GLib .Variant .new_boolean (False ))
8894
95+ if select_output_simplified :
96+ self .__write ("OutputSimplified" , GLib .Variant .new_boolean (True ))
97+ else :
98+ self .__write ("OutputSimplified" , GLib .Variant .new_boolean (False ))
99+
89100 def on_value_changed (self , config , section , name , value , data ):
90101 if section == 'engine/Array' :
91102 if name == 'SpecialNotify' :
@@ -96,9 +107,15 @@ def on_value_changed(self, config, section, name, value, data):
96107
97108 elif name == 'SpecialOnly' :
98109 if value :
99- self .__special_notify_button .set_active (True )
110+ self .__special_only_button .set_active (True )
100111 else :
101- self .__special_notify_button .set_active (False )
112+ self .__special_only_button .set_active (False )
113+
114+ elif name == 'OutputSimplified' :
115+ if value :
116+ self .__output_simplified_button .set_active (True )
117+ else :
118+ self .__output_simplified_button .set_active (False )
102119
103120 def __read (self , name , v ):
104121 value = self .__config .get_value ("engine/Array" , name )
0 commit comments