]> git.pld-linux.org Git - packages/ibus-hangul.git/commitdiff
- updated patches from fedora to better work with ibus 1.4.99
authorJan Rękorajski <baggins@pld-linux.org>
Tue, 6 Nov 2012 07:25:42 +0000 (08:25 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Tue, 6 Nov 2012 07:25:42 +0000 (08:25 +0100)
ibus-hangul-add-hangul-hotkey.patch [new file with mode: 0644]
ibus-hangul-engine-name.patch [new file with mode: 0644]
ibus-hangul-setup-gi.patch [new file with mode: 0644]
ibus-hangul-xx-icon-symbol.patch [deleted file]
ibus-hangul.spec

diff --git a/ibus-hangul-add-hangul-hotkey.patch b/ibus-hangul-add-hangul-hotkey.patch
new file mode 100644 (file)
index 0000000..57934d4
--- /dev/null
@@ -0,0 +1,12 @@
+Index: ibus-hangul-1.4.0/src/hangul.xml.in.in
+===================================================================
+--- ibus-hangul-1.4.0.orig/src/hangul.xml.in.in
++++ ibus-hangul-1.4.0/src/hangul.xml.in.in
+@@ -22,6 +22,7 @@
+                       <description>Korean Input Method</description>
+                       <rank>99</rank>
+                       <symbol>&#xD55C;</symbol>
++                      <hotkeys>Control+space,Hangul</hotkeys>
+               </engine>
+       </engines>
diff --git a/ibus-hangul-engine-name.patch b/ibus-hangul-engine-name.patch
new file mode 100644 (file)
index 0000000..70d21b2
--- /dev/null
@@ -0,0 +1,23 @@
+From f1b2a97b428d8432604ec782505516b9ea1fe565 Mon Sep 17 00:00:00 2001
+From: Choe Hwanjin <choe.hwanjin@gmail.com>
+Date: Mon, 22 Oct 2012 01:39:51 +0900
+Subject: [PATCH] Rename this engine to "Hangul"
+
+"Hangul" means this engine is using libhangul.
+---
+ src/hangul.xml.in.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: ibus-hangul-1.4.1/src/hangul.xml.in.in
+===================================================================
+--- ibus-hangul-1.4.1.orig/src/hangul.xml.in.in
++++ ibus-hangul-1.4.1/src/hangul.xml.in.in
+@@ -18,7 +18,7 @@
+                       <author>Peng Huang &lt;shawn.p.huang@gmail.com&gt;</author>
+                       <icon>ibus-hangul</icon>
+                       <layout>us</layout>
+-                      <longname>Korean</longname>
++                      <longname>Hangul</longname>
+                       <description>Korean Input Method</description>
+                       <rank>99</rank>
+                       <symbol>&#xD55C;</symbol>
diff --git a/ibus-hangul-setup-gi.patch b/ibus-hangul-setup-gi.patch
new file mode 100644 (file)
index 0000000..b082e56
--- /dev/null
@@ -0,0 +1,232 @@
+From 010540d2a05fee1f8f4971db5ffa5885981aba29 Mon Sep 17 00:00:00 2001
+From: Daiki Ueno <ueno@unixuser.org>
+Date: Wed, 25 Jan 2012 11:46:33 +0900
+Subject: [PATCH] ibus-setup-hangul: use gobject-introspection instead ibus
+ python library.
+
+---
+ setup/keycapturedialog.py |   20 +++++++-------
+ setup/main.py             |   65 +++++++++++++++++++++++++--------------------
+ 2 files changed, 46 insertions(+), 39 deletions(-)
+
+Index: ibus-hangul-1.4.1/setup/keycapturedialog.py
+===================================================================
+--- ibus-hangul-1.4.1.orig/setup/keycapturedialog.py
++++ ibus-hangul-1.4.1/setup/keycapturedialog.py
+@@ -1,5 +1,5 @@
+-import gtk
+-import gtk.gdk as gdk
++from gi.repository import Gtk
++from gi.repository import Gdk
+ import gettext
+ _ = lambda a : gettext.dgettext("ibus-hangul", a)
+@@ -7,10 +7,10 @@ _ = lambda a : gettext.dgettext("ibus-ha
+ class KeyCaptureDialog ():
+     def __init__ (self, title, parent):
+       self.__key_str = ''
+-      self.__dialog = gtk.MessageDialog(parent,
+-                      gtk.DIALOG_MODAL,
+-                      gtk.MESSAGE_INFO,
+-                      gtk.BUTTONS_OK_CANCEL,
++      self.__dialog = Gtk.MessageDialog(parent,
++                      Gtk.DialogFlags.MODAL,
++                      Gtk.MessageType.INFO,
++                      Gtk.ButtonsType.OK_CANCEL,
+                       "")
+       self.__dialog.set_markup(_("Press any key which you want to use as hanja key. "
+                 "The key you pressed is displayed below.\n"
+@@ -30,13 +30,13 @@ class KeyCaptureDialog ():
+     def on_keypress(self, widget, event, data = None):
+       self.__key_str = ""
+-      if event.state & gdk.CONTROL_MASK :
++      if event.state & Gdk.ModifierType.CONTROL_MASK :
+           self.__key_str += "Control+"
+-      if event.state & gdk.MOD1_MASK :
++      if event.state & Gdk.ModifierType.MOD1_MASK :
+           self.__key_str += "Alt+"
+-      if event.state & gdk.SHIFT_MASK :
++      if event.state & Gdk.ModifierType.SHIFT_MASK :
+           self.__key_str += "Shift+"
+-      self.__key_str += gdk.keyval_name(event.keyval)
++      self.__key_str += Gdk.keyval_name(event.keyval)
+           
+       self.__dialog.format_secondary_markup('<span size="large" weight="bold">%s</span>' % self.__key_str)
+Index: ibus-hangul-1.4.1/setup/main.py
+===================================================================
+--- ibus-hangul-1.4.1.orig/setup/main.py
++++ ibus-hangul-1.4.1/setup/main.py
+@@ -20,9 +20,9 @@
+ import sys
+ import os
+-import gobject
+-import gtk
+-import ibus
++from gi.repository import GLib
++from gi.repository import Gtk
++from gi.repository import IBus
+ import locale
+ import gettext
+ import config
+@@ -38,7 +38,7 @@ class Setup ():
+       self.__config.connect("value-changed", self.on_value_changed, None)
+       ui_file = os.path.join(os.path.dirname(__file__), "setup.ui")
+-      self.__builder = gtk.Builder()
++      self.__builder = Gtk.Builder()
+       self.__builder.set_translation_domain(config.gettext_package)
+       self.__builder.add_from_file(ui_file)
+@@ -47,7 +47,7 @@ class Setup ():
+       list = pipe.communicate()[0].split('\n')
+       
+       self.__hangul_keyboard = self.__builder.get_object("HangulKeyboard")
+-      model = gtk.ListStore(str, str, int)
++      model = Gtk.ListStore(str, str, int)
+       i = 0
+       for line in list:
+           items = line.split('\t')
+@@ -56,11 +56,12 @@ class Setup ():
+               i+=1
+       self.__hangul_keyboard.set_model(model)
+-      renderer = gtk.CellRendererText()
+-      self.__hangul_keyboard.pack_start(renderer)
++      renderer = Gtk.CellRendererText()
++      self.__hangul_keyboard.pack_start(renderer, True)
+       self.__hangul_keyboard.add_attribute(renderer, "text", 0)
+-      current = self.__read("HangulKeyboard", "2")
++      default = GLib.Variant.new_string("2")
++      current = self.__read("HangulKeyboard", default).get_string()
+       for i in model:
+           if i[1] == current:
+               self.__hangul_keyboard.set_active(i[2])
+@@ -68,11 +69,13 @@ class Setup ():
+       self.__word_commit = self.__builder.get_object("WordCommit")
+-      word_commit = self.__read("WordCommit", False)
++      default = GLib.Variant.new_boolean(False)
++      word_commit = self.__read("WordCommit", default).get_boolean()
+         self.__word_commit.set_active(word_commit)
+       self.__auto_reorder = self.__builder.get_object("AutoReorder")
+-      auto_reorder = self.__read("AutoReorder", True)
++      default = GLib.Variant.new_boolean(True)
++      auto_reorder = self.__read("AutoReorder", default).get_boolean()
+         self.__auto_reorder.set_active(auto_reorder)
+       # hanja tab
+@@ -82,19 +85,20 @@ class Setup ():
+       button = self.__builder.get_object("HanjaKeyListRemoveButton")
+       button.connect("clicked", self.on_hanja_key_remove, None)
+-      model = gtk.ListStore(str)
++      model = Gtk.ListStore(str)
+-      keylist_str = self.__read("HanjaKeys", "Hangul_Hanja,F9")
++      default = GLib.Variant.new_string("Hangul_Hanja,F9")
++      keylist_str = self.__read("HanjaKeys", default).get_string()
+       self.__hanja_key_list_str = keylist_str.split(',')
+       for i in self.__hanja_key_list_str:
+           model.append([i])
+       self.__hanja_key_list = self.__builder.get_object("HanjaKeyList")
+       self.__hanja_key_list.set_model(model)
+-      column = gtk.TreeViewColumn()
++      column = Gtk.TreeViewColumn()
+       column.set_title("key")
+-      renderer = gtk.CellRendererText()
+-      column.pack_start(renderer)
++      renderer = Gtk.CellRendererText()
++      column.pack_start(renderer, True)
+       column.add_attribute(renderer, "text", 0)
+       self.__hanja_key_list.append_column(column)
+@@ -115,17 +119,20 @@ class Setup ():
+     def run(self):
+       res = self.__window.run()
+-      if (res == gtk.RESPONSE_OK):
++      if (res == Gtk.ResponseType.OK):
+           self.on_ok()
+       self.__window.destroy()
+     def apply(self):
+       model = self.__hangul_keyboard.get_model()
+       i = self.__hangul_keyboard.get_active()
+-      self.__write("HangulKeyboard", model[i][1])
++      self.__write("HangulKeyboard", GLib.Variant.new_string(model[i][1]))
+         word_commit = self.__word_commit.get_active()
+-        self.__write("WordCommit", word_commit)
++        self.__write("WordCommit", GLib.Variant.new_boolean(word_commit))
++
++        auto_reorder = self.__auto_reorder.get_active()
++        self.__write("AutoReorder", GLib.Variant.new_boolean(auto_reorder))
+       model = self.__hanja_key_list.get_model()
+       str = ""
+@@ -137,13 +144,13 @@ class Setup ():
+           else:
+               str += model.get_value(iter, 0)
+           iter = model.iter_next(iter)
+-      self.__write("HanjaKeys", str)
++      self.__write("HanjaKeys", GLib.Variant.new_string(str))
+     def on_response(self, widget, id, data = None):
+-      if id == gtk.RESPONSE_APPLY:
++      if id == Gtk.ResponseType.APPLY:
+           self.apply()
+           widget.emit_stop_by_name("response")
+-      if id == gtk.RESPONSE_NONE:
++      if id == Gtk.ResponseType.NONE:
+           widget.emit_stop_by_name("response")
+     def on_ok(self):
+@@ -152,7 +159,7 @@ class Setup ():
+     def on_hanja_key_add(self, widget, data = None):
+       dialog = KeyCaptureDialog(_("Select Hanja key"), self.__window)
+       res = dialog.run()
+-      if res == gtk.RESPONSE_OK:
++      if res == Gtk.ResponseType.OK:
+           key_str = dialog.get_key_string()
+           if len(key_str) > 0:
+               model = self.__hanja_key_list.get_model()
+@@ -185,7 +192,10 @@ class Setup ():
+               self.__hanja_key_list_str = value.split(',')
+     def __read(self, name, v):
+-        return self.__config.get_value("engine/Hangul", name, v)
++        value = self.__config.get_value("engine/Hangul", name)
++        if value is None:
++            return v
++        return value
+     def __write(self, name, v):
+         return self.__config.set_value("engine/Hangul", name, v)
+@@ -194,14 +204,13 @@ if __name__ == "__main__":
+     locale.bindtextdomain(config.gettext_package, config.localedir)
+     locale.bind_textdomain_codeset(config.gettext_package, "UTF-8")
+-    try:
+-        bus = ibus.Bus()
+-    except:
++    bus = IBus.Bus()
++    if bus.is_connected():
++        Setup(bus).run()
++    else:
+         message = _("IBus daemon is not running.\nHangul engine settings cannot be saved.")
+-        dialog = gtk.MessageDialog(type = gtk.MESSAGE_ERROR,
+-                                   buttons = gtk.BUTTONS_CLOSE,
++        dialog = Gtk.MessageDialog(type = Gtk.MessageType.ERROR,
++                                   buttons = Gtk.ButtonsType.CLOSE,
+                                    message_format = message)
+         dialog.run()
+         sys.exit(1)
+-
+-    Setup(bus).run()
diff --git a/ibus-hangul-xx-icon-symbol.patch b/ibus-hangul-xx-icon-symbol.patch
deleted file mode 100644 (file)
index 5d3391c..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-Patch to embed hotkeys property in component XML.
-Index: ibus-hangul-1.3.1/configure.ac
-===================================================================
---- ibus-hangul-1.3.1.orig/configure.ac
-+++ ibus-hangul-1.3.1/configure.ac
-@@ -75,6 +75,9 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GET
- AM_GNU_GETTEXT([external])
- AM_GNU_GETTEXT_VERSION([0.17])
-+# hotkeys and symbol properties in component xml
-+IBUS_WITH_HOTKEYS([Control+space,Hangul])
-+
- # OUTPUT files
- AC_CONFIG_FILES([ po/Makefile.in
-Index: ibus-hangul-1.3.1/m4/ibus.m4
-===================================================================
---- /dev/null
-+++ ibus-hangul-1.3.1/m4/ibus.m4
-@@ -0,0 +1,52 @@
-+# IBUS_WITH_HOTKEYS([DEFAULT])
-+AC_DEFUN([IBUS_WITH_HOTKEYS], [
-+  IBUS_HOTKEYS_DEFAULT=m4_default([$1], [Control+space,Zenkaku_Hankaku])
-+  AC_ARG_WITH(hotkeys,
-+    [AC_HELP_STRING([--with-hotkeys=HOTKEYS],
-+    [Use hotkeys for ibus bridge mode. (available value: yes/no/keys)])],
-+    [with_hotkeys="$withval"],
-+    [with_hotkeys="no"])
-+  if test x$with_hotkeys = xno; then
-+    IBUS_HOTKEYS_XML="<!-- <hotkeys>${IBUS_HOTKEYS_DEFAULT}</hotkeys> -->"
-+  elif test x$with_hotkeys = xyes -o x$with_hotkeys = x; then
-+    IBUS_HOTKEYS="$IBUS_HOTKEYS_DEFAULT"
-+    IBUS_HOTKEYS_XML="<hotkeys>${IBUS_HOTKEYS}</hotkeys>"
-+  else
-+    IBUS_HOTKEYS="$with_hotkeys"
-+    IBUS_HOTKEYS_XML="<hotkeys>${IBUS_HOTKEYS}</hotkeys>"
-+  fi
-+  if test x$IBUS_HOTKEYS != x; then
-+    AC_DEFINE_UNQUOTED(IBUS_IBUS_HOTKEYS, ["$IBUS_HOTKEYS"],
-+      [IME specific hotkeys for IBus])
-+    AC_SUBST(IBUS_HOTKEYS)
-+  fi
-+  AC_SUBST(IBUS_HOTKEYS_XML)
-+])
-+
-+# IBUS_SET_SYMBOL(SYMBOL)
-+AC_DEFUN([IBUS_SET_SYMBOL], [
-+  IBUS_SYMBOL="$1"
-+  if test x$PYTHON = x; then
-+    AM_PATH_PYTHON([2.5])
-+  fi
-+  AC_MSG_CHECKING([if ibus supports icon symbol])
-+  $PYTHON <<_IBUS_SYMBOL_TEST
-+import ibus
-+engine = ibus.EngineDesc('test')
-+exit(not hasattr(engine, 'symbol'))
-+_IBUS_SYMBOL_TEST
-+  if test $? -eq 0; then
-+    IBUS_SYMBOL_XML="<symbol>${IBUS_SYMBOL}</symbol>"
-+    AC_MSG_RESULT([yes])
-+  else
-+    IBUS_SYMBOL_XML="<!-- <symbol>${IBUS_SYMBOL}</symbol> -->"
-+    IBUS_SYMBOL=
-+    AC_MSG_RESULT([no])
-+  fi
-+  if test x$IBUS_SYMBOL != x; then
-+    AC_DEFINE_UNQUOTED([IBUS_SYMBOL], ["$IBUS_SYMBOL"],
-+      [Icon symbol string for IBus])
-+    AC_SUBST(IBUS_SYMBOL)
-+  fi
-+  AC_SUBST(IBUS_SYMBOL_XML)
-+])
---- ibus-hangul-1.4.1/src/hangul.xml.in.in.orig        2012-09-15 11:32:11.785250460 +0200
-+++ ibus-hangul-1.4.1/src/hangul.xml.in.in     2012-09-15 11:43:35.728569536 +0200
-@@ -22,6 +22,7 @@
-                       <description>Korean Input Method</description>
-                       <rank>99</rank>
-                       <symbol>&#xD55C;</symbol>
-+                      @IBUS_HOTKEYS_XML@
-               </engine>
-       </engines>
index fd1234d20d9f08ad8df130ef894a9c456b6e488d..df07ce0846801e65d612ac898febce38a20fa272 100644 (file)
@@ -12,7 +12,9 @@ Group:                Libraries
 #Source0Download: http://code.google.com/p/ibus/downloads/list
 Source0:       http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz
 # Source0-md5: c9615a9f704a4c29252028407329e1c3
-Patch0:                %{name}-xx-icon-symbol.patch
+Patch0:                ibus-hangul-setup-gi.patch
+Patch1:                ibus-hangul-add-hangul-hotkey.patch
+Patch2:                ibus-hangul-engine-name.patch
 URL:           http://code.google.com/p/ibus/
 BuildRequires: autoconf >= 2.50
 BuildRequires: automake >= 1:1.10
@@ -25,6 +27,7 @@ BuildRequires:        pkgconfig
 BuildRequires: python >= 1:2.5
 Requires:      ibus >= 1.4.0
 Requires:      libhangul >= 0.1.0
+Requires:      python-pygobject3
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                _libexecdir     %{_libdir}/ibus
@@ -40,6 +43,8 @@ metodę wprowadzania znaków koreańskich zaimplementowaną w libhangul.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 %build
 %{__libtoolize}
@@ -63,6 +68,12 @@ rm -rf $RPM_BUILD_ROOT
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+%update_icon_cache hicolor
+
+%postun
+%update_icon_cache hicolor
+
 %files -f %{name}.lang
 %defattr(644,root,root,755)
 %doc AUTHORS ChangeLog NEWS README
This page took 0.108336 seconds and 4 git commands to generate.