Skip to content

Commit

Permalink
Add "Start in hangul mode" option
Browse files Browse the repository at this point in the history
If this widget is checked, "initial_input_mode" config will be set
as "hangul".

This widget is not match to the config item "initial_input_mode".
But I think "Start in hangul mode" check box is easier to use
than "initial_input_mode" combo box.
  • Loading branch information
choehwanjin committed Aug 2, 2014
1 parent 7906483 commit fbd589a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
12 changes: 11 additions & 1 deletion setup/main.py
Expand Up @@ -67,8 +67,12 @@ def __init__ (self, bus):
self.__hangul_keyboard.set_active(i[2])
break

self.__word_commit = self.__builder.get_object("WordCommit")
self.__start_in_hangul_mode = self.__builder.get_object("StartInHangulMode")
default = GLib.Variant.new_string("latin")
initial_input_mode = self.__read("initial_input_mode", default).get_string()
self.__start_in_hangul_mode.set_active(initial_input_mode == "hangul")

self.__word_commit = self.__builder.get_object("WordCommit")
default = GLib.Variant.new_boolean(False)
word_commit = self.__read("WordCommit", default).get_boolean()
self.__word_commit.set_active(word_commit)
Expand Down Expand Up @@ -150,6 +154,12 @@ def apply(self):
i = self.__hangul_keyboard.get_active()
self.__write("HangulKeyboard", GLib.Variant.new_string(model[i][1]))

start_in_hangul_mode = self.__start_in_hangul_mode.get_active()
if start_in_hangul_mode:
self.__write("initial_input_mode", GLib.Variant.new_string("hangul"))
else:
self.__write("initial_input_mode", GLib.Variant.new_string("latin"))

word_commit = self.__word_commit.get_active()
self.__write("WordCommit", GLib.Variant.new_boolean(word_commit))

Expand Down
31 changes: 29 additions & 2 deletions setup/setup.ui
Expand Up @@ -149,6 +149,33 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCheckButton" id="StartInHangulMode">
<property name="label" translatable="yes">Start in hangul mode</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">12</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="hbox6">
<property name="visible">True</property>
Expand All @@ -174,7 +201,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -203,7 +230,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
</object>
Expand Down

0 comments on commit fbd589a

Please sign in to comment.