Blame SOURCES/ibus-hangul-hangul-toggle.patch

553497
diff --git a/setup/main.py b/setup/main.py
553497
index ce33db7..eb6525c 100644
553497
--- a/setup/main.py
553497
+++ b/setup/main.py
553497
@@ -78,6 +78,29 @@ class Setup ():
553497
         auto_reorder = self.__read("AutoReorder", default).get_boolean()
553497
         self.__auto_reorder.set_active(auto_reorder)
553497
 
553497
+        button = self.__builder.get_object("HangulKeyListAddButton")
553497
+        button.connect("clicked", self.on_hangul_key_add, None)
553497
+
553497
+        button = self.__builder.get_object("HangulKeyListRemoveButton")
553497
+        button.connect("clicked", self.on_hangul_key_remove, None)
553497
+
553497
+        model = Gtk.ListStore(str)
553497
+
553497
+        default = GLib.Variant.new_string("Hangul,Shift+space")
553497
+        keylist_str = self.__read("HangulKeys", default).get_string()
553497
+        self.__hangul_key_list_str = keylist_str.split(',')
553497
+        for i in self.__hangul_key_list_str:
553497
+            model.append([i])
553497
+
553497
+        self.__hangul_key_list = self.__builder.get_object("HangulKeyList")
553497
+        self.__hangul_key_list.set_model(model)
553497
+        column = Gtk.TreeViewColumn()
553497
+        column.set_title("key")
553497
+        renderer = Gtk.CellRendererText()
553497
+        column.pack_start(renderer, True)
553497
+        column.add_attribute(renderer, "text", 0)
553497
+        self.__hangul_key_list.append_column(column)
553497
+
553497
         # hanja tab
553497
         button = self.__builder.get_object("HanjaKeyListAddButton")
553497
         button.connect("clicked", self.on_hanja_key_add, None)
553497
@@ -133,6 +156,18 @@ class Setup ():
553497
         auto_reorder = self.__auto_reorder.get_active()
553497
         self.__write("AutoReorder", GLib.Variant.new_boolean(auto_reorder))
553497
 
553497
+        model = self.__hangul_key_list.get_model()
553497
+        str = ""
553497
+        iter = model.get_iter_first()
553497
+        while iter:
553497
+            if len(str) > 0:
553497
+                str += ","
553497
+                str += model.get_value(iter, 0)
553497
+            else:
553497
+                str += model.get_value(iter, 0)
553497
+            iter = model.iter_next(iter)
553497
+        self.__write("HangulKeys", GLib.Variant.new_string(str))
553497
+
553497
         model = self.__hanja_key_list.get_model()
553497
         str = ""
553497
         iter = model.get_iter_first()
553497
@@ -155,6 +190,30 @@ class Setup ():
553497
     def on_ok(self):
553497
         self.apply()
553497
 
553497
+    def on_hangul_key_add(self, widget, data = None):
553497
+        dialog = KeyCaptureDialog(_("Select Hangul toggle key"), self.__window)
553497
+        res = dialog.run()
553497
+        if res == Gtk.ResponseType.OK:
553497
+            key_str = dialog.get_key_string()
553497
+            if len(key_str) > 0:
553497
+                model = self.__hangul_key_list.get_model()
553497
+                iter = model.get_iter_first()
553497
+                while iter:
553497
+                    str = model.get_value(iter, 0)
553497
+                    if str == key_str:
553497
+                        model.remove(iter)
553497
+                        break
553497
+                    iter = model.iter_next(iter)
553497
+
553497
+                model.append([key_str])
553497
+        dialog.destroy()
553497
+
553497
+    def on_hangul_key_remove(self, widget, data = None):
553497
+        selection = self.__hangul_key_list.get_selection()
553497
+        (model, iter) = selection.get_selected()
553497
+        if model and iter:
553497
+            model.remove(iter)
553497
+
553497
     def on_hanja_key_add(self, widget, data = None):
553497
         dialog = KeyCaptureDialog(_("Select Hanja key"), self.__window)
553497
         res = dialog.run()
553497
@@ -187,6 +246,8 @@ class Setup ():
553497
                     if i[1] == value:
553497
                         self.__hangul_keyboard.set_active(i[2])
553497
                         break
553497
+            elif name == "HangulKeys":
553497
+                self.__hangul_key_list_str = value.split(',')
553497
             elif name == "HanjaKeys":
553497
                 self.__hanja_key_list_str = value.split(',')
553497
 
553497
diff --git a/setup/setup.ui b/setup/setup.ui
553497
index 6f928b0..2fa8c49 100644
553497
--- a/setup/setup.ui
553497
+++ b/setup/setup.ui
553497
@@ -1,16 +1,18 @@
553497
-
553497
+
553497
+
553497
 <interface>
553497
-  
553497
-  
553497
+  <requires lib="gtk+" version="3.0"/>
553497
   <object class="GtkDialog" id="SetupDialog">
553497
+    <property name="can_focus">False</property>
553497
     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
     <property name="border_width">5</property>
553497
     <property name="title" translatable="yes">IBusHangul Setup</property>
553497
     <property name="window_position">center-on-parent</property>
553497
     <property name="type_hint">dialog</property>
553497
     <child internal-child="vbox">
553497
-      <object class="GtkVBox" id="dialog-vbox1">
553497
+      <object class="GtkBox" id="dialog-vbox1">
553497
         <property name="visible">True</property>
553497
+        <property name="can_focus">False</property>
553497
         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
         <property name="orientation">vertical</property>
553497
         <child>
553497
@@ -18,27 +20,28 @@
553497
             <property name="visible">True</property>
553497
             <property name="can_focus">True</property>
553497
             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
-            <property name="tab_hborder">4</property>
553497
             <child>
553497
               <object class="GtkVBox" id="vbox1">
553497
                 <property name="visible">True</property>
553497
+                <property name="can_focus">False</property>
553497
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
                 <property name="border_width">6</property>
553497
-                <property name="orientation">vertical</property>
553497
                 <property name="spacing">12</property>
553497
                 <child>
553497
                   <object class="GtkVBox" id="vbox2">
553497
                     <property name="visible">True</property>
553497
+                    <property name="can_focus">False</property>
553497
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
-                    <property name="orientation">vertical</property>
553497
                     <child>
553497
                       <object class="GtkHBox" id="hbox1">
553497
                         <property name="visible">True</property>
553497
+                        <property name="can_focus">False</property>
553497
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
                         <property name="spacing">6</property>
553497
                         <child>
553497
                           <object class="GtkLabel" id="label1">
553497
                             <property name="visible">True</property>
553497
+                            <property name="can_focus">False</property>
553497
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
                             <property name="label" translatable="yes"><b>Keyboard Layout</b></property>
553497
                             <property name="use_markup">True</property>
553497
@@ -46,6 +49,7 @@
553497
                           </object>
553497
                           <packing>
553497
                             <property name="expand">False</property>
553497
+                            <property name="fill">True</property>
553497
                             <property name="position">0</property>
553497
                           </packing>
553497
                         </child>
553497
@@ -55,16 +59,19 @@
553497
                       </object>
553497
                       <packing>
553497
                         <property name="expand">False</property>
553497
+                        <property name="fill">True</property>
553497
                         <property name="position">0</property>
553497
                       </packing>
553497
                     </child>
553497
                     <child>
553497
                       <object class="GtkHBox" id="hbox2">
553497
                         <property name="visible">True</property>
553497
+                        <property name="can_focus">False</property>
553497
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
                         <child>
553497
                           <object class="GtkLabel" id="label2">
553497
                             <property name="visible">True</property>
553497
+                            <property name="can_focus">False</property>
553497
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
                             <property name="label" translatable="yes">_Hangul keyboard:</property>
553497
                             <property name="use_underline">True</property>
553497
@@ -80,43 +87,51 @@
553497
                         <child>
553497
                           <object class="GtkComboBox" id="HangulKeyboard">
553497
                             <property name="visible">True</property>
553497
+                            <property name="can_focus">False</property>
553497
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
                           </object>
553497
                           <packing>
553497
+                            <property name="expand">True</property>
553497
+                            <property name="fill">True</property>
553497
                             <property name="position">1</property>
553497
                           </packing>
553497
                         </child>
553497
                       </object>
553497
                       <packing>
553497
                         <property name="expand">False</property>
553497
+                        <property name="fill">True</property>
553497
                         <property name="position">1</property>
553497
                       </packing>
553497
                     </child>
553497
                   </object>
553497
                   <packing>
553497
                     <property name="expand">False</property>
553497
+                    <property name="fill">True</property>
553497
                     <property name="position">0</property>
553497
                   </packing>
553497
                 </child>
553497
                 <child>
553497
                   <object class="GtkVBox" id="vbox5">
553497
                     <property name="visible">True</property>
553497
-                    <property name="orientation">vertical</property>
553497
+                    <property name="can_focus">False</property>
553497
                     <child>
553497
                       <object class="GtkVBox" id="vbox6">
553497
                         <property name="visible">True</property>
553497
-                        <property name="orientation">vertical</property>
553497
+                        <property name="can_focus">False</property>
553497
                         <child>
553497
                           <object class="GtkHBox" id="hbox5">
553497
                             <property name="visible">True</property>
553497
+                            <property name="can_focus">False</property>
553497
                             <child>
553497
                               <object class="GtkLabel" id="label3">
553497
                                 <property name="visible">True</property>
553497
+                                <property name="can_focus">False</property>
553497
                                 <property name="label" translatable="yes"><b>Etc</b></property>
553497
                                 <property name="use_markup">True</property>
553497
                               </object>
553497
                               <packing>
553497
                                 <property name="expand">False</property>
553497
+                                <property name="fill">True</property>
553497
                                 <property name="position">0</property>
553497
                               </packing>
553497
                             </child>
553497
@@ -125,12 +140,15 @@
553497
                             </child>
553497
                           </object>
553497
                           <packing>
553497
+                            <property name="expand">True</property>
553497
+                            <property name="fill">True</property>
553497
                             <property name="position">0</property>
553497
                           </packing>
553497
                         </child>
553497
                         <child>
553497
                           <object class="GtkHBox" id="hbox6">
553497
                             <property name="visible">True</property>
553497
+                            <property name="can_focus">False</property>
553497
                             <child>
553497
                               <object class="GtkCheckButton" id="WordCommit">
553497
                                 <property name="label" translatable="yes">Commit in _word unit</property>
553497
@@ -138,21 +156,27 @@
553497
                                 <property name="can_focus">True</property>
553497
                                 <property name="receives_default">False</property>
553497
                                 <property name="use_underline">True</property>
553497
+                                <property name="xalign">0.5</property>
553497
                                 <property name="draw_indicator">True</property>
553497
                               </object>
553497
                               <packing>
553497
+                                <property name="expand">True</property>
553497
+                                <property name="fill">True</property>
553497
                                 <property name="padding">12</property>
553497
                                 <property name="position">0</property>
553497
                               </packing>
553497
                             </child>
553497
                           </object>
553497
                           <packing>
553497
+                            <property name="expand">True</property>
553497
+                            <property name="fill">True</property>
553497
                             <property name="position">1</property>
553497
                           </packing>
553497
                         </child>
553497
                         <child>
553497
                           <object class="GtkHBox" id="hbox7">
553497
                             <property name="visible">True</property>
553497
+                            <property name="can_focus">False</property>
553497
                             <child>
553497
                               <object class="GtkCheckButton" id="AutoReorder">
553497
                                 <property name="label" translatable="yes">Automatic _reordering</property>
553497
@@ -160,39 +184,165 @@
553497
                                 <property name="can_focus">True</property>
553497
                                 <property name="receives_default">False</property>
553497
                                 <property name="use_underline">True</property>
553497
+                                <property name="xalign">0.5</property>
553497
                                 <property name="active">True</property>
553497
                                 <property name="draw_indicator">True</property>
553497
                               </object>
553497
                               <packing>
553497
+                                <property name="expand">True</property>
553497
+                                <property name="fill">True</property>
553497
                                 <property name="padding">12</property>
553497
                                 <property name="position">0</property>
553497
                               </packing>
553497
                             </child>
553497
                           </object>
553497
                           <packing>
553497
+                            <property name="expand">True</property>
553497
+                            <property name="fill">True</property>
553497
                             <property name="position">2</property>
553497
                           </packing>
553497
                         </child>
553497
                       </object>
553497
                       <packing>
553497
                         <property name="expand">False</property>
553497
+                        <property name="fill">True</property>
553497
                         <property name="position">0</property>
553497
                       </packing>
553497
                     </child>
553497
                   </object>
553497
                   <packing>
553497
                     <property name="expand">False</property>
553497
+                    <property name="fill">True</property>
553497
                     <property name="position">1</property>
553497
                   </packing>
553497
                 </child>
553497
                 <child>
553497
-                  <placeholder/>
553497
+                  <object class="GtkBox" id="box1">
553497
+                    <property name="visible">True</property>
553497
+                    <property name="can_focus">False</property>
553497
+                    <property name="orientation">vertical</property>
553497
+                    <child>
553497
+                      <object class="GtkLabel" id="label7">
553497
+                        <property name="visible">True</property>
553497
+                        <property name="can_focus">False</property>
553497
+                        <property name="halign">start</property>
553497
+                        <property name="label" translatable="yes"><b>Hangul toggle key</b></property>
553497
+                        <property name="use_markup">True</property>
553497
+                      </object>
553497
+                      <packing>
553497
+                        <property name="expand">False</property>
553497
+                        <property name="fill">True</property>
553497
+                        <property name="position">0</property>
553497
+                      </packing>
553497
+                    </child>
553497
+                    <child>
553497
+                      <object class="GtkHBox" id="hbox8">
553497
+                        <property name="visible">True</property>
553497
+                        <property name="can_focus">False</property>
553497
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
+                        <child>
553497
+                          <object class="GtkLabel" id="label8">
553497
+                            <property name="visible">True</property>
553497
+                            <property name="can_focus">False</property>
553497
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
+                            <property name="label">    </property>
553497
+                          </object>
553497
+                          <packing>
553497
+                            <property name="expand">False</property>
553497
+                            <property name="fill">False</property>
553497
+                            <property name="position">0</property>
553497
+                          </packing>
553497
+                        </child>
553497
+                        <child>
553497
+                          <object class="GtkScrolledWindow" id="scrolledwindow2">
553497
+                            <property name="visible">True</property>
553497
+                            <property name="can_focus">True</property>
553497
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
+                            <property name="shadow_type">in</property>
553497
+                            <child>
553497
+                              <object class="GtkTreeView" id="HangulKeyList">
553497
+                                <property name="visible">True</property>
553497
+                                <property name="can_focus">True</property>
553497
+                                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
+                                <property name="headers_visible">False</property>
553497
+                                <property name="show_expanders">False</property>
553497
+                                <child internal-child="selection">
553497
+                                  <object class="GtkTreeSelection" id="treeview-selection3"/>
553497
+                                </child>
553497
+                              </object>
553497
+                            </child>
553497
+                          </object>
553497
+                          <packing>
553497
+                            <property name="expand">True</property>
553497
+                            <property name="fill">True</property>
553497
+                            <property name="position">1</property>
553497
+                          </packing>
553497
+                        </child>
553497
+                        <child>
553497
+                          <object class="GtkVButtonBox" id="vbuttonbox2">
553497
+                            <property name="visible">True</property>
553497
+                            <property name="can_focus">False</property>
553497
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
+                            <property name="border_width">6</property>
553497
+                            <property name="spacing">6</property>
553497
+                            <property name="layout_style">start</property>
553497
+                            <child>
553497
+                              <object class="GtkButton" id="HangulKeyListAddButton">
553497
+                                <property name="label">gtk-add</property>
553497
+                                <property name="visible">True</property>
553497
+                                <property name="can_focus">True</property>
553497
+                                <property name="receives_default">True</property>
553497
+                                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
+                                <property name="use_stock">True</property>
553497
+                              </object>
553497
+                              <packing>
553497
+                                <property name="expand">False</property>
553497
+                                <property name="fill">False</property>
553497
+                                <property name="position">0</property>
553497
+                              </packing>
553497
+                            </child>
553497
+                            <child>
553497
+                              <object class="GtkButton" id="HangulKeyListRemoveButton">
553497
+                                <property name="label">gtk-remove</property>
553497
+                                <property name="visible">True</property>
553497
+                                <property name="can_focus">True</property>
553497
+                                <property name="receives_default">True</property>
553497
+                                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
+                                <property name="use_stock">True</property>
553497
+                              </object>
553497
+                              <packing>
553497
+                                <property name="expand">False</property>
553497
+                                <property name="fill">False</property>
553497
+                                <property name="position">1</property>
553497
+                              </packing>
553497
+                            </child>
553497
+                          </object>
553497
+                          <packing>
553497
+                            <property name="expand">False</property>
553497
+                            <property name="fill">True</property>
553497
+                            <property name="position">2</property>
553497
+                          </packing>
553497
+                        </child>
553497
+                      </object>
553497
+                      <packing>
553497
+                        <property name="expand">True</property>
553497
+                        <property name="fill">True</property>
553497
+                        <property name="position">1</property>
553497
+                      </packing>
553497
+                    </child>
553497
+                  </object>
553497
+                  <packing>
553497
+                    <property name="expand">True</property>
553497
+                    <property name="fill">True</property>
553497
+                    <property name="position">2</property>
553497
+                  </packing>
553497
                 </child>
553497
               </object>
553497
             </child>
553497
             <child type="tab">
553497
               <object class="GtkLabel" id="NotebookLabel1">
553497
                 <property name="visible">True</property>
553497
+                <property name="can_focus">False</property>
553497
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
                 <property name="label" translatable="yes">Hangul</property>
553497
               </object>
553497
@@ -203,22 +353,24 @@
553497
             <child>
553497
               <object class="GtkVBox" id="vbox3">
553497
                 <property name="visible">True</property>
553497
+                <property name="can_focus">False</property>
553497
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
                 <property name="border_width">6</property>
553497
-                <property name="orientation">vertical</property>
553497
                 <child>
553497
                   <object class="GtkVBox" id="vbox4">
553497
                     <property name="visible">True</property>
553497
+                    <property name="can_focus">False</property>
553497
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
-                    <property name="orientation">vertical</property>
553497
                     <child>
553497
                       <object class="GtkHBox" id="hbox3">
553497
                         <property name="visible">True</property>
553497
+                        <property name="can_focus">False</property>
553497
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
                         <property name="spacing">6</property>
553497
                         <child>
553497
                           <object class="GtkLabel" id="label4">
553497
                             <property name="visible">True</property>
553497
+                            <property name="can_focus">False</property>
553497
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
                             <property name="label" translatable="yes"><b>Hanja key</b></property>
553497
                             <property name="use_markup">True</property>
553497
@@ -226,6 +378,7 @@
553497
                           </object>
553497
                           <packing>
553497
                             <property name="expand">False</property>
553497
+                            <property name="fill">True</property>
553497
                             <property name="position">0</property>
553497
                           </packing>
553497
                         </child>
553497
@@ -235,16 +388,19 @@
553497
                       </object>
553497
                       <packing>
553497
                         <property name="expand">False</property>
553497
+                        <property name="fill">True</property>
553497
                         <property name="position">0</property>
553497
                       </packing>
553497
                     </child>
553497
                     <child>
553497
                       <object class="GtkHBox" id="hbox4">
553497
                         <property name="visible">True</property>
553497
+                        <property name="can_focus">False</property>
553497
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
                         <child>
553497
                           <object class="GtkLabel" id="label5">
553497
                             <property name="visible">True</property>
553497
+                            <property name="can_focus">False</property>
553497
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
                             <property name="label">    </property>
553497
                           </object>
553497
@@ -259,8 +415,6 @@
553497
                             <property name="visible">True</property>
553497
                             <property name="can_focus">True</property>
553497
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
-                            <property name="hscrollbar_policy">automatic</property>
553497
-                            <property name="vscrollbar_policy">automatic</property>
553497
                             <property name="shadow_type">in</property>
553497
                             <child>
553497
                               <object class="GtkTreeView" id="HanjaKeyList">
553497
@@ -270,19 +424,24 @@
553497
                                 <property name="headers_visible">False</property>
553497
                                 <property name="headers_clickable">False</property>
553497
                                 <property name="show_expanders">False</property>
553497
+                                <child internal-child="selection">
553497
+                                  <object class="GtkTreeSelection" id="treeview-selection1"/>
553497
+                                </child>
553497
                               </object>
553497
                             </child>
553497
                           </object>
553497
                           <packing>
553497
+                            <property name="expand">True</property>
553497
+                            <property name="fill">True</property>
553497
                             <property name="position">1</property>
553497
                           </packing>
553497
                         </child>
553497
                         <child>
553497
                           <object class="GtkVButtonBox" id="vbuttonbox1">
553497
                             <property name="visible">True</property>
553497
+                            <property name="can_focus">False</property>
553497
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
                             <property name="border_width">6</property>
553497
-                            <property name="orientation">vertical</property>
553497
                             <property name="spacing">6</property>
553497
                             <property name="layout_style">start</property>
553497
                             <child>
553497
@@ -318,16 +477,21 @@
553497
                           </object>
553497
                           <packing>
553497
                             <property name="expand">False</property>
553497
+                            <property name="fill">True</property>
553497
                             <property name="position">2</property>
553497
                           </packing>
553497
                         </child>
553497
                       </object>
553497
                       <packing>
553497
+                        <property name="expand">True</property>
553497
+                        <property name="fill">True</property>
553497
                         <property name="position">1</property>
553497
                       </packing>
553497
                     </child>
553497
                   </object>
553497
                   <packing>
553497
+                    <property name="expand">True</property>
553497
+                    <property name="fill">True</property>
553497
                     <property name="position">0</property>
553497
                   </packing>
553497
                 </child>
553497
@@ -339,6 +503,7 @@
553497
             <child type="tab">
553497
               <object class="GtkLabel" id="NotebookLabel2">
553497
                 <property name="visible">True</property>
553497
+                <property name="can_focus">False</property>
553497
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
                 <property name="label" translatable="yes">Hanja</property>
553497
               </object>
553497
@@ -350,6 +515,7 @@
553497
             <child>
553497
               <object class="GtkLabel" id="label6">
553497
                 <property name="visible">True</property>
553497
+                <property name="can_focus">False</property>
553497
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
                 <property name="label"><b>Not implemented</b></property>
553497
                 <property name="use_markup">True</property>
553497
@@ -361,6 +527,7 @@
553497
             <child type="tab">
553497
               <object class="GtkLabel" id="NotebookLabel3">
553497
                 <property name="visible">True</property>
553497
+                <property name="can_focus">False</property>
553497
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
                 <property name="label" translatable="yes">Advanced</property>
553497
               </object>
553497
@@ -371,12 +538,15 @@
553497
             </child>
553497
           </object>
553497
           <packing>
553497
+            <property name="expand">False</property>
553497
+            <property name="fill">True</property>
553497
             <property name="position">1</property>
553497
           </packing>
553497
         </child>
553497
         <child internal-child="action_area">
553497
-          <object class="GtkHButtonBox" id="dialog-action_area1">
553497
+          <object class="GtkButtonBox" id="dialog-action_area1">
553497
             <property name="visible">True</property>
553497
+            <property name="can_focus">False</property>
553497
             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
553497
             <property name="homogeneous">True</property>
553497
             <property name="layout_style">end</property>
553497
@@ -428,6 +598,7 @@
553497
           </object>
553497
           <packing>
553497
             <property name="expand">False</property>
553497
+            <property name="fill">True</property>
553497
             <property name="pack_type">end</property>
553497
             <property name="position">1</property>
553497
           </packing>
553497
diff --git a/src/engine.c b/src/engine.c
553497
index 602f073..161f041 100644
553497
--- a/src/engine.c
553497
+++ b/src/engine.c
553497
@@ -35,7 +35,7 @@
553497
 typedef struct _IBusHangulEngine IBusHangulEngine;
553497
 typedef struct _IBusHangulEngineClass IBusHangulEngineClass;
553497
 
553497
-typedef struct _HanjaKeyList HanjaKeyList;
553497
+typedef struct _HotkeyList HotkeyList;
553497
 
553497
 struct _IBusHangulEngine {
553497
     IBusEngine parent;
553497
@@ -50,6 +50,7 @@ struct _IBusHangulEngine {
553497
 
553497
     IBusLookupTable *table;
553497
 
553497
+    IBusProperty    *prop_hangul_mode;
553497
     IBusProperty    *prop_hanja_mode;
553497
     IBusPropList    *prop_list;
553497
 };
553497
@@ -63,7 +64,7 @@ struct KeyEvent {
553497
     guint modifiers;
553497
 };
553497
 
553497
-struct _HanjaKeyList {
553497
+struct _HotkeyList {
553497
     guint   all_modifiers;
553497
     GArray *keys;
553497
 };
553497
@@ -159,17 +160,17 @@ static gboolean key_event_list_match        (GArray                 *list,
553497
                                              guint                   keyval,
553497
                                              guint                   modifiers);
553497
 
553497
-static void     hanja_key_list_init         (HanjaKeyList           *list);
553497
-static void     hanja_key_list_fini         (HanjaKeyList           *list);
553497
-static void     hanja_key_list_set_from_string(HanjaKeyList         *list,
553497
+static void     hotkey_list_init            (HotkeyList           *list);
553497
+static void     hotkey_list_fini            (HotkeyList           *list);
553497
+static void     hotkey_list_set_from_string (HotkeyList         *list,
553497
                                              const char             *str);
553497
-static void     hanja_key_list_append       (HanjaKeyList           *list,
553497
+static void     hotkey_list_append          (HotkeyList           *list,
553497
                                              guint                   keyval,
553497
                                              guint                   modifiers);
553497
-static gboolean hanja_key_list_match        (HanjaKeyList           *list,
553497
+static gboolean hotkey_list_match           (HotkeyList           *list,
553497
                                              guint                   keyval,
553497
                                              guint                   modifiers);
553497
-static gboolean hanja_key_list_has_modifier (HanjaKeyList           *list,
553497
+static gboolean hotkey_list_has_modifier    (HotkeyList           *list,
553497
                                              guint                   keyval);
553497
 
553497
 static glong ucschar_strlen (const ucschar* str);
553497
@@ -179,7 +180,8 @@ static HanjaTable *hanja_table = NULL;
553497
 static HanjaTable *symbol_table = NULL;
553497
 static IBusConfig *config = NULL;
553497
 static GString    *hangul_keyboard = NULL;
553497
-static HanjaKeyList hanja_keys;
553497
+static HotkeyList hangul_keys;
553497
+static HotkeyList hanja_keys;
553497
 static int lookup_table_orientation = 0;
553497
 static IBusKeymap *keymap = NULL;
553497
 static gboolean word_commit = FALSE;
553497
@@ -243,17 +245,30 @@ ibus_hangul_init (IBusBus *bus)
553497
         g_variant_unref(value);
553497
     }
553497
 
553497
-    hanja_key_list_init(&hanja_keys);
553497
+    hotkey_list_init(&hangul_keys);
553497
+
553497
+    value = ibus_config_get_value (config, "engine/Hangul",
553497
+                                         "HangulKeys");
553497
+    if (value != NULL) {
553497
+        const gchar* str = g_variant_get_string (value, NULL);
553497
+        hotkey_list_set_from_string(&hangul_keys, str);
553497
+        g_variant_unref(value);
553497
+    } else {
553497
+	hotkey_list_append(&hangul_keys, IBUS_Hangul, 0);
553497
+	hotkey_list_append(&hangul_keys, IBUS_space, IBUS_SHIFT_MASK);
553497
+    }
553497
+
553497
+    hotkey_list_init(&hanja_keys);
553497
 
553497
     value = ibus_config_get_value (config, "engine/Hangul",
553497
                                          "HanjaKeys");
553497
     if (value != NULL) {
553497
         const gchar* str = g_variant_get_string (value, NULL);
553497
-        hanja_key_list_set_from_string(&hanja_keys, str);
553497
+        hotkey_list_set_from_string(&hanja_keys, str);
553497
         g_variant_unref(value);
553497
     } else {
553497
-	hanja_key_list_append(&hanja_keys, IBUS_Hangul_Hanja, 0);
553497
-	hanja_key_list_append(&hanja_keys, IBUS_F9, 0);
553497
+	hotkey_list_append(&hanja_keys, IBUS_Hangul_Hanja, 0);
553497
+	hotkey_list_append(&hanja_keys, IBUS_F9, 0);
553497
     }
553497
 
553497
     value = ibus_config_get_value (config, "engine/Hangul",
553497
@@ -280,7 +295,8 @@ ibus_hangul_exit (void)
553497
 	keymap = NULL;
553497
     }
553497
 
553497
-    hanja_key_list_fini(&hanja_keys);
553497
+    hotkey_list_fini(&hangul_keys);
553497
+    hotkey_list_fini(&hanja_keys);
553497
 
553497
     hanja_table_delete (hanja_table);
553497
     hanja_table = NULL;
553497
@@ -347,6 +363,18 @@ ibus_hangul_engine_init (IBusHangulEngine *hangul)
553497
     hangul->prop_list = ibus_prop_list_new ();
553497
     g_object_ref_sink (hangul->prop_list);
553497
 
553497
+    label = ibus_text_new_from_string (_("Hangul mode"));
553497
+    tooltip = ibus_text_new_from_string (_("Enable/Disable Hangul mode"));
553497
+    prop = ibus_property_new ("hangul_mode",
553497
+                              PROP_TYPE_TOGGLE,
553497
+                              label,
553497
+                              NULL,
553497
+                              tooltip,
553497
+                              TRUE, TRUE, PROP_STATE_UNCHECKED, NULL);
553497
+    g_object_ref_sink (prop);
553497
+    ibus_prop_list_append (hangul->prop_list, prop);
553497
+    hangul->prop_hangul_mode = prop;
553497
+
553497
     label = ibus_text_new_from_string (_("Hanja lock"));
553497
     tooltip = ibus_text_new_from_string (_("Enable/Disable Hanja mode"));
553497
     prop = ibus_property_new ("hanja_mode",
553497
@@ -394,6 +422,11 @@ ibus_hangul_engine_constructor (GType                   type,
553497
 static void
553497
 ibus_hangul_engine_destroy (IBusHangulEngine *hangul)
553497
 {
553497
+    if (hangul->prop_hangul_mode) {
553497
+        g_object_unref (hangul->prop_hangul_mode);
553497
+        hangul->prop_hangul_mode = NULL;
553497
+    }
553497
+
553497
     if (hangul->prop_hanja_mode) {
553497
         g_object_unref (hangul->prop_hanja_mode);
553497
         hangul->prop_hanja_mode = NULL;
553497
@@ -929,17 +962,39 @@ ibus_hangul_engine_process_key_event (IBusEngine     *engine,
553497
     if (keyval == IBUS_Shift_L || keyval == IBUS_Shift_R)
553497
         return FALSE;
553497
 
553497
-    // If hanja key has any modifiers, we ignore that modifier keyval,
553497
-    // or we cannot make the hanja key work.
553497
+    // If a hotkey has any modifiers, we ignore that modifier
553497
+    // keyval, or we cannot make the hanja key work.
553497
     // Because when we get the modifier key alone, we commit the
553497
     // current preedit string. So after that, even if we get the
553497
     // right hanja key event, we don't have preedit string to be changed
553497
     // to hanja word.
553497
     // See this bug: http://code.google.com/p/ibus/issues/detail?id=1036
553497
-    if (hanja_key_list_has_modifier(&hanja_keys, keyval))
553497
+    if (hotkey_list_has_modifier(&hangul_keys, keyval))
553497
+        return FALSE;
553497
+
553497
+    if (hotkey_list_match(&hangul_keys, keyval, modifiers)) {
553497
+        if (hangul->hangul_mode)
553497
+            ibus_hangul_engine_flush (hangul);
553497
+
553497
+        hangul->hangul_mode = !hangul->hangul_mode;
553497
+        if (hangul->hangul_mode) {
553497
+            ibus_property_set_state (hangul->prop_hangul_mode,
553497
+                    PROP_STATE_CHECKED);
553497
+        } else {
553497
+            ibus_property_set_state (hangul->prop_hangul_mode,
553497
+                    PROP_STATE_UNCHECKED);
553497
+        }
553497
+        ibus_engine_update_property (engine, hangul->prop_hangul_mode);
553497
+        return TRUE;
553497
+    }
553497
+
553497
+    if (!hangul->hangul_mode)
553497
+        return FALSE;
553497
+
553497
+    if (hotkey_list_has_modifier(&hanja_keys, keyval))
553497
 	return FALSE; 
553497
 
553497
-    if (hanja_key_list_match(&hanja_keys, keyval, modifiers)) {
553497
+    if (hotkey_list_match(&hanja_keys, keyval, modifiers)) {
553497
         if (hangul->hanja_list == NULL) {
553497
             ibus_hangul_engine_update_lookup_table (hangul);
553497
         } else {
553497
@@ -1095,6 +1150,12 @@ ibus_hangul_engine_focus_in (IBusEngine *engine)
553497
 {
553497
     IBusHangulEngine *hangul = (IBusHangulEngine *) engine;
553497
 
553497
+    if (hangul->hangul_mode) {
553497
+        ibus_property_set_state (hangul->prop_hangul_mode, PROP_STATE_CHECKED);
553497
+    } else {
553497
+        ibus_property_set_state (hangul->prop_hangul_mode, PROP_STATE_UNCHECKED);
553497
+    }
553497
+
553497
     if (hangul->hanja_mode) {
553497
         ibus_property_set_state (hangul->prop_hanja_mode, PROP_STATE_CHECKED);
553497
     } else {
553497
@@ -1205,6 +1266,20 @@ ibus_hangul_engine_property_activate (IBusEngine    *engine,
553497
         argv[0] = "ibus-setup-hangul";
553497
         argv[1] = NULL;
553497
         g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error);
553497
+    } else if (strcmp(prop_name, "hangul_mode") == 0) {
553497
+        IBusHangulEngine *hangul = (IBusHangulEngine *) engine;
553497
+
553497
+        hangul->hangul_mode = !hangul->hangul_mode;
553497
+        if (hangul->hangul_mode) {
553497
+            ibus_property_set_state (hangul->prop_hangul_mode,
553497
+                    PROP_STATE_CHECKED);
553497
+        } else {
553497
+            ibus_property_set_state (hangul->prop_hangul_mode,
553497
+                    PROP_STATE_UNCHECKED);
553497
+        }
553497
+
553497
+        ibus_engine_update_property (engine, hangul->prop_hangul_mode);
553497
+        ibus_hangul_engine_flush (hangul);
553497
     } else if (strcmp(prop_name, "hanja_mode") == 0) {
553497
         IBusHangulEngine *hangul = (IBusHangulEngine *) engine;
553497
 
553497
@@ -1276,11 +1351,14 @@ ibus_config_value_changed (IBusConfig   *config,
553497
             hangul_ic_select_keyboard (hangul->context, hangul_keyboard->str);
553497
         } else if (strcmp(name, "HanjaKeys") == 0) {
553497
             const gchar* str = g_variant_get_string(value, NULL);
553497
-	    hanja_key_list_set_from_string(&hanja_keys, str);
553497
+	    hotkey_list_set_from_string(&hanja_keys, str);
553497
         } else if (strcmp(name, "WordCommit") == 0) {
553497
             word_commit = g_variant_get_boolean (value);
553497
         } else if (strcmp (name, "AutoReorder") == 0) {
553497
             auto_reorder = g_variant_get_boolean (value);
553497
+        } else if (strcmp (name, "HangulKeys") == 0) {
553497
+            const gchar* str = g_variant_get_string(value, NULL);
553497
+	    hotkey_list_set_from_string(&hangul_keys, str);
553497
         }
553497
     } else if (strcmp(section, "panel") == 0) {
553497
         if (strcmp(name, "lookup_table_orientation") == 0) {
553497
@@ -1358,20 +1436,20 @@ ibus_hangul_engine_candidate_clicked (IBusEngine     *engine,
553497
 }
553497
 
553497
 static void
553497
-hanja_key_list_init(HanjaKeyList* list)
553497
+hotkey_list_init(HotkeyList* list)
553497
 {
553497
     list->all_modifiers = 0;
553497
     list->keys = g_array_sized_new(FALSE, TRUE, sizeof(struct KeyEvent), 4);
553497
 }
553497
 
553497
 static void
553497
-hanja_key_list_fini(HanjaKeyList* list)
553497
+hotkey_list_fini(HotkeyList* list)
553497
 {
553497
     g_array_free(list->keys, TRUE);
553497
 }
553497
 
553497
 static void
553497
-hanja_key_list_append_from_string(HanjaKeyList *list, const char* str)
553497
+hotkey_list_append_from_string(HotkeyList *list, const char* str)
553497
 {
553497
     guint keyval = 0;
553497
     guint modifiers = 0;
553497
@@ -1379,19 +1457,19 @@ hanja_key_list_append_from_string(HanjaKeyList *list, const char* str)
553497
 
553497
     res = ibus_key_event_from_string(str, &keyval, &modifiers);
553497
     if (res) {
553497
-	hanja_key_list_append(list, keyval, modifiers);
553497
+	hotkey_list_append(list, keyval, modifiers);
553497
     }
553497
 }
553497
 
553497
 static void
553497
-hanja_key_list_append(HanjaKeyList *list, guint keyval, guint modifiers)
553497
+hotkey_list_append(HotkeyList *list, guint keyval, guint modifiers)
553497
 {
553497
     list->all_modifiers |= modifiers;
553497
     key_event_list_append(list->keys, keyval, modifiers);
553497
 }
553497
 
553497
 static void
553497
-hanja_key_list_set_from_string(HanjaKeyList *list, const char* str)
553497
+hotkey_list_set_from_string(HotkeyList *list, const char* str)
553497
 {
553497
     gchar** items = g_strsplit(str, ",", 0);
553497
 
553497
@@ -1401,20 +1479,20 @@ hanja_key_list_set_from_string(HanjaKeyList *list, const char* str)
553497
     if (items != NULL) {
553497
         int i;
553497
         for (i = 0; items[i] != NULL; ++i) {
553497
-	    hanja_key_list_append_from_string(list, items[i]);
553497
+	    hotkey_list_append_from_string(list, items[i]);
553497
         }
553497
         g_strfreev(items);
553497
     }
553497
 }
553497
 
553497
 static gboolean
553497
-hanja_key_list_match(HanjaKeyList* list, guint keyval, guint modifiers)
553497
+hotkey_list_match(HotkeyList* list, guint keyval, guint modifiers)
553497
 {
553497
     return key_event_list_match(list->keys, keyval, modifiers);
553497
 }
553497
 
553497
 static gboolean
553497
-hanja_key_list_has_modifier(HanjaKeyList* list, guint keyval)
553497
+hotkey_list_has_modifier(HotkeyList* list, guint keyval)
553497
 {
553497
     if (list->all_modifiers & IBUS_CONTROL_MASK) {
553497
 	if (keyval == IBUS_Control_L || keyval == IBUS_Control_R)