[ibus-anthy] Updated ibus-anthy-HEAD.patch

Takao Fujiwara fujiwara at fedoraproject.org
Mon Jul 14 08:55:00 UTC 2014


commit bf7fb8f542ff24e8c6f4cd20d77584979e1d1516
Author: Takao Fujiwara <tfujiwar at redhat.com>
Date:   Mon Jul 14 17:35:32 2014 +0900

    Updated ibus-anthy-HEAD.patch
    
    Fixed deprecated warnings with python3-gobject 3.13.3.
    Set max-width-chars in ibus-anthy-setup wrapped GtkLabel.
    Set 'IBUS_SETUP_XID' environment variable in setup.

 ibus-anthy-HEAD.patch |  368 +++++++++++++++++++++++++++++++++++++++++++++++++
 ibus-anthy.spec       |    8 +-
 2 files changed, 375 insertions(+), 1 deletions(-)
---
diff --git a/ibus-anthy-HEAD.patch b/ibus-anthy-HEAD.patch
index 4c6f72b..efd1d11 100644
--- a/ibus-anthy-HEAD.patch
+++ b/ibus-anthy-HEAD.patch
@@ -1576,6 +1576,374 @@ index d9ec626..dc5e7e1 100644
 -- 
 1.8.0
 
+From 8a79278d6fadecd4bdcebb32f33d19ee72e1e933 Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1 at gmail.com>
+Date: Thu, 10 Jul 2014 13:50:54 +0900
+Subject: [PATCH] Fixed deprecated warnings with python3-gobject 3.13.3.
+
+python3-gobject adds several warnings in gi/overrides/Gtk.py
+
+/usr/share/ibus-anthy/setup/main.py:1519: PyGTKDeprecationWarning:
+The "buttons" argument must be a Gtk.ButtonsType enum value. Please
+use the "add_buttons" method for adding buttons.
+See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
+
+/usr/lib64/python3.4/site-packages/gi/overrides/Gtk.py:537:
+PyGTKDeprecationWarning: The keyword(s) "parent" have been deprecated
+in favor of "transient_for" respectively.
+See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
+---
+ setup/python2/main.py | 30 +++++++++++++++++++-----------
+ setup/python3/main.py | 30 +++++++++++++++++++-----------
+ 2 files changed, 38 insertions(+), 22 deletions(-)
+
+diff --git a/setup/python2/main.py b/setup/python2/main.py
+index 7c403b8..5df1cdd 100644
+--- a/setup/python2/main.py
++++ b/setup/python2/main.py
+@@ -420,6 +420,7 @@ class AnthySetup(object):
+         for key, value in sorted(rule.items(), \
+             cmp = self.__japanese_tuple_sort):
+             ls.append(['romaji', key, value])
++        tv.set_model(None)
+         tv.append_column(Gtk.TreeViewColumn(_(_("Input Chars")),
+                                             Gtk.CellRendererText(), text=1))
+         tv.append_column(Gtk.TreeViewColumn(_(_("Output Chars")),
+@@ -455,6 +456,7 @@ class AnthySetup(object):
+         for key, value in sorted(rule.items(), \
+             cmp = self.__japanese_tuple_sort):
+             ls.append(['kana', key, value])
++        tv.set_model(None)
+         tv.append_column(Gtk.TreeViewColumn(_(_("Input Chars")),
+                                             Gtk.CellRendererText(), text=1))
+         tv.append_column(Gtk.TreeViewColumn(_(_("Output Chars")),
+@@ -502,6 +504,7 @@ class AnthySetup(object):
+         for key, value in sorted(rule.items(), \
+             cmp = self.__japanese_thumb_sort):
+             ls.append(['thumb', key, value[0], value[2], value[1]])
++        tv.set_model(None)
+         tv.append_column(Gtk.TreeViewColumn(_(_("Input")),
+                                             Gtk.CellRendererText(), text=1))
+         tv.append_column(Gtk.TreeViewColumn(_(_("Single")),
+@@ -585,6 +588,7 @@ class AnthySetup(object):
+     def __run_dialog_custom_key_table(self, mode):
+         prefs = self.prefs
+         dlg = self.__builder.get_object('dialog_custom_key_table')
++        dlg.set_transient_for(self.__builder.get_object('main'))
+         label = self.__builder.get_object('label_custom_key_table')
+         label_output = self.__builder.get_object('label_output_custom_key')
+         list_labels = []
+@@ -1225,6 +1229,7 @@ class AnthySetup(object):
+         for w in ['es:checkbutton_ctrl', 'es:checkbutton_alt', 'es:checkbutton_shift']:
+             self.__builder.get_object(w).set_active(False)
+         dlg = self.__builder.get_object('edit_shortcut')
++        dlg.set_transient_for(self.__builder.get_object('main'))
+         id = dlg.run()
+         dlg.hide()
+         if id == Gtk.ResponseType.OK:
+@@ -1380,6 +1385,7 @@ class AnthySetup(object):
+         for w in ['es:checkbutton_ctrl', 'es:checkbutton_alt', 'es:checkbutton_shift']:
+             self.__builder.get_object(w).set_active(False)
+         dlg = self.__builder.get_object('edit_shortcut')
++        dlg.set_transient_for(self.__builder.get_object('main'))
+         id = dlg.run()
+         dlg.hide()
+         self.__builder.get_object('es:button_add').show()
+@@ -1414,16 +1420,17 @@ class AnthySetup(object):
+ 
+         if Gtk.Buildable.get_name(widget) == 'dict:btn_add':
+             dlg = Gtk.FileChooserDialog(title=_("Open Dictionary File"),
+-                                        parent=self.__builder.get_object('main'),
+-                                        action=Gtk.FileChooserAction.OPEN,
+-                                        buttons=(_("_Cancel"), Gtk.ResponseType.CANCEL,
+-                                                 _("_Open"), Gtk.ResponseType.OK))
++                                        transient_for=self.__builder.get_object('main'),
++                                        action=Gtk.FileChooserAction.OPEN)
++            buttons=(_("_Cancel"), Gtk.ResponseType.CANCEL,
++                     _("_Open"), Gtk.ResponseType.OK)
++            dlg.add_buttons(*buttons)
+         if Gtk.Buildable.get_name(widget) == 'dict:btn_edit':
+             dlg = Gtk.Dialog(title=_("Edit Dictionary File"),
+-                             parent=self.__builder.get_object('main'),
+-                             flags=Gtk.DialogFlags.MODAL,
+-                             buttons=(_("_Cancel"), Gtk.ResponseType.CANCEL,
+-                                      _("_OK"), Gtk.ResponseType.OK))
++                             transient_for=self.__builder.get_object('main'))
++            buttons=(_("_Cancel"), Gtk.ResponseType.CANCEL,
++                     _("_OK"), Gtk.ResponseType.OK)
++            dlg.add_buttons(*buttons)
+ 
+         vbox = self.__builder.get_object('dict:add_extra_vbox')
+         if Gtk.Buildable.get_name(widget) == 'dict:btn_add':
+@@ -1516,9 +1523,9 @@ class AnthySetup(object):
+             lines = unicode(lines, encoding).encode('utf-8')
+ 
+         dlg = Gtk.Dialog(title=_("View Dictionary File"),
+-                         parent=self.__builder.get_object('main'),
+-                         flags=Gtk.DialogFlags.MODAL,
+-                         buttons=(_("_OK"), Gtk.ResponseType.OK))
++                         transient_for=self.__builder.get_object('main'))
++        buttons=(_("_OK"), Gtk.ResponseType.OK)
++        dlg.add_buttons(*buttons)
+         buffer = Gtk.TextBuffer()
+         buffer.set_text (lines)
+         text_view = Gtk.TextView.new_with_buffer(buffer)
+@@ -1666,6 +1673,7 @@ class AnthySetup(object):
+ 
+     def on_es_button_run_input_clicked(self, widget):
+         dlg = self.__builder.get_object('key_input_dialog')
++        dlg.set_transient_for(widget.get_toplevel())
+         dlg.set_markup('<big><b>%s</b></big>' % _("Please press a key (or a key combination)"))
+         dlg.format_secondary_text(_("The dialog will be closed when the key is released"))
+         id = dlg.run()
+diff --git a/setup/python3/main.py b/setup/python3/main.py
+index 2073f59..8921402 100644
+--- a/setup/python3/main.py
++++ b/setup/python3/main.py
+@@ -425,6 +425,7 @@ class AnthySetup(object):
+         for key, value in sorted(list(rule.items()), \
+             key = functools.cmp_to_key(self.__japanese_tuple_sort)):
+             ls.append(['romaji', key, value])
++        tv.set_model(None)
+         tv.append_column(Gtk.TreeViewColumn(_(_("Input Chars")),
+                                             Gtk.CellRendererText(), text=1))
+         tv.append_column(Gtk.TreeViewColumn(_(_("Output Chars")),
+@@ -460,6 +461,7 @@ class AnthySetup(object):
+         for key, value in sorted(list(rule.items()), \
+             key = functools.cmp_to_key(self.__japanese_tuple_sort)):
+             ls.append(['kana', key, value])
++        tv.set_model(None)
+         tv.append_column(Gtk.TreeViewColumn(_(_("Input Chars")),
+                                             Gtk.CellRendererText(), text=1))
+         tv.append_column(Gtk.TreeViewColumn(_(_("Output Chars")),
+@@ -507,6 +509,7 @@ class AnthySetup(object):
+         for key, value in sorted(list(rule.items()), \
+             key = functools.cmp_to_key(self.__japanese_thumb_sort)):
+             ls.append(['thumb', key, value[0], value[2], value[1]])
++        tv.set_model(None)
+         tv.append_column(Gtk.TreeViewColumn(_(_("Input")),
+                                             Gtk.CellRendererText(), text=1))
+         tv.append_column(Gtk.TreeViewColumn(_(_("Single")),
+@@ -590,6 +593,7 @@ class AnthySetup(object):
+     def __run_dialog_custom_key_table(self, mode):
+         prefs = self.prefs
+         dlg = self.__builder.get_object('dialog_custom_key_table')
++        dlg.set_transient_for(self.__builder.get_object('main'))
+         label = self.__builder.get_object('label_custom_key_table')
+         label_output = self.__builder.get_object('label_output_custom_key')
+         list_labels = []
+@@ -1219,6 +1223,7 @@ class AnthySetup(object):
+         for w in ['es:checkbutton_ctrl', 'es:checkbutton_alt', 'es:checkbutton_shift']:
+             self.__builder.get_object(w).set_active(False)
+         dlg = self.__builder.get_object('edit_shortcut')
++        dlg.set_transient_for(self.__builder.get_object('main'))
+         id = dlg.run()
+         dlg.hide()
+         if id == Gtk.ResponseType.OK:
+@@ -1374,6 +1379,7 @@ class AnthySetup(object):
+         for w in ['es:checkbutton_ctrl', 'es:checkbutton_alt', 'es:checkbutton_shift']:
+             self.__builder.get_object(w).set_active(False)
+         dlg = self.__builder.get_object('edit_shortcut')
++        dlg.set_transient_for(self.__builder.get_object('main'))
+         id = dlg.run()
+         dlg.hide()
+         self.__builder.get_object('es:button_add').show()
+@@ -1408,16 +1414,17 @@ class AnthySetup(object):
+ 
+         if Gtk.Buildable.get_name(widget) == 'dict:btn_add':
+             dlg = Gtk.FileChooserDialog(title=_("Open Dictionary File"),
+-                                        parent=self.__builder.get_object('main'),
+-                                        action=Gtk.FileChooserAction.OPEN,
+-                                        buttons=(_("_Cancel"), Gtk.ResponseType.CANCEL,
+-                                                 _("_Open"), Gtk.ResponseType.OK))
++                                        transient_for=self.__builder.get_object('main'),
++                                        action=Gtk.FileChooserAction.OPEN)
++            buttons=(_("_Cancel"), Gtk.ResponseType.CANCEL,
++                     _("_Open"), Gtk.ResponseType.OK)
++            dlg.add_buttons(*buttons)
+         if Gtk.Buildable.get_name(widget) == 'dict:btn_edit':
+             dlg = Gtk.Dialog(title=_("Edit Dictionary File"),
+-                             parent=self.__builder.get_object('main'),
+-                             flags=Gtk.DialogFlags.MODAL,
+-                             buttons=(_("_Cancel"), Gtk.ResponseType.CANCEL,
+-                                      _("_OK"), Gtk.ResponseType.OK))
++                             transient_for=self.__builder.get_object('main'))
++            buttons=(_("_Cancel"), Gtk.ResponseType.CANCEL,
++                     _("_OK"), Gtk.ResponseType.OK)
++            dlg.add_buttons(*buttons)
+ 
+         vbox = self.__builder.get_object('dict:add_extra_vbox')
+         if Gtk.Buildable.get_name(widget) == 'dict:btn_add':
+@@ -1510,9 +1517,9 @@ class AnthySetup(object):
+             lines = str(lines, encoding)
+ 
+         dlg = Gtk.Dialog(title=_("View Dictionary File"),
+-                         parent=self.__builder.get_object('main'),
+-                         flags=Gtk.DialogFlags.MODAL,
+-                         buttons=(_("_OK"), Gtk.ResponseType.OK))
++                         transient_for=self.__builder.get_object('main'))
++        buttons=(_("_OK"), Gtk.ResponseType.OK)
++        dlg.add_buttons(*buttons)
+         buffer = Gtk.TextBuffer()
+         buffer.set_text (lines)
+         text_view = Gtk.TextView.new_with_buffer(buffer)
+@@ -1660,6 +1667,7 @@ class AnthySetup(object):
+ 
+     def on_es_button_run_input_clicked(self, widget):
+         dlg = self.__builder.get_object('key_input_dialog')
++        dlg.set_transient_for(widget.get_toplevel())
+         dlg.set_markup('<big><b>%s</b></big>' % _("Please press a key (or a key combination)"))
+         dlg.format_secondary_text(_("The dialog will be closed when the key is released"))
+         id = dlg.run()
+-- 
+1.8.5.3
+
+From 981c40b4a8cf42ffde07dcf5925539f337461f61 Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1 at gmail.com>
+Date: Thu, 10 Jul 2014 17:13:49 +0900
+Subject: [PATCH] Set max-width-chars property in ibus-anthy-setup wrapped
+ GtkLabel.
+
+---
+ setup/python2/setup.ui | 1 +
+ setup/python3/setup.ui | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/setup/python2/setup.ui b/setup/python2/setup.ui
+index dc5e7e1..b6d8ef2 100644
+--- a/setup/python2/setup.ui
++++ b/setup/python2/setup.ui
+@@ -1469,6 +1469,7 @@
+                                     <property name="visible">True</property>
+                                     <property name="xalign">0</property>
+                                     <property name="wrap">True</property>
++                                    <property name="max_width_chars">74</property>
+                                     <property name="label" translatable="yes">You do not have to reconfigure the system keyboard layout for "Additional Key Arrangement" since this option changes input method layout only in case input method is turned on.</property>
+                                     <property name="tooltip_text" translatable="yes">You do not have to reconfigure XKB since this option changes IM layout only with IM on.</property>
+                                   </object>
+diff --git a/setup/python3/setup.ui b/setup/python3/setup.ui
+index dc5e7e1..b6d8ef2 100644
+--- a/setup/python3/setup.ui
++++ b/setup/python3/setup.ui
+@@ -1469,6 +1469,7 @@
+                                     <property name="visible">True</property>
+                                     <property name="xalign">0</property>
+                                     <property name="wrap">True</property>
++                                    <property name="max_width_chars">74</property>
+                                     <property name="label" translatable="yes">You do not have to reconfigure the system keyboard layout for "Additional Key Arrangement" since this option changes input method layout only in case input method is turned on.</property>
+                                     <property name="tooltip_text" translatable="yes">You do not have to reconfigure XKB since this option changes IM layout only with IM on.</property>
+                                   </object>
+-- 
+1.8.5.3
+
+From a1e5f1ce7b87a37cab7ba458ad2343fc20056f47 Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1 at gmail.com>
+Date: Fri, 11 Jul 2014 12:11:53 +0900
+Subject: [PATCH] Set a parent window from 'IBUS_SETUP_XID' environment
+ variable in setup.
+
+---
+ setup/python2/main.py | 25 ++++++++++++++++++++-----
+ setup/python3/main.py | 25 ++++++++++++++++++++-----
+ 2 files changed, 40 insertions(+), 10 deletions(-)
+
+diff --git a/setup/python2/main.py b/setup/python2/main.py
+index 5df1cdd..cdfdc4d 100644
+--- a/setup/python2/main.py
++++ b/setup/python2/main.py
+@@ -82,22 +82,37 @@ class AnthySetup(object):
+         builder.add_from_file(builder_file)
+ 
+         toplevel = builder.get_object('main')
++        parent_xid = 0
++        parent_wmname = None
++        parent_wmclass = None
+ 
+         try:
+-            gnome_control_center_xid = int(environ['GNOME_CONTROL_CENTER_XID'])
++            parent_xid = int(environ['IBUS_SETUP_XID'])
++            if parent_xid != 0:
++                parent_wmname = 'ibus-setup'
++                parent_wmclass = 'Ibus-setup'
+         except:
+-            gnome_control_center_xid = 0
++            pass
++
++        try:
++            if parent_xid == 0:
++                parent_xid = int(environ['GNOME_CONTROL_CENTER_XID'])
++                if parent_xid != 0:
++                    parent_wmname = 'gnome-conrol-center'
++                    parent_wmclass = 'Gnome-conrol-center'
++        except:
++            pass
+ 
+-        if gnome_control_center_xid != 0:
++        if parent_xid != 0:
+             def set_transient(obj, pspec):
+                 window = toplevel.get_window()
+                 if window == None:
+                     return
+                 parent_window = GdkX11.X11Window.foreign_new_for_display(Gdk.Display.get_default(),
+-                                                                         gnome_control_center_xid)
++                                                                         parent_xid)
+                 if parent_window != None:
+                     window.set_transient_for(parent_window)
+-            toplevel.set_wmclass('gnome-control-center', 'Gnome-control-center')
++            toplevel.set_wmclass(parent_wmname, parent_wmclass)
+             toplevel.set_modal(True)
+             toplevel.set_type_hint(Gdk.WindowTypeHint.DIALOG)
+             toplevel.connect('notify::window', set_transient)
+diff --git a/setup/python3/main.py b/setup/python3/main.py
+index 8921402..3141bb8 100644
+--- a/setup/python3/main.py
++++ b/setup/python3/main.py
+@@ -85,22 +85,37 @@ class AnthySetup(object):
+         builder.add_from_file(builder_file)
+ 
+         toplevel = builder.get_object('main')
++        parent_xid = 0
++        parent_wmname = None
++        parent_wmclass = None
+ 
+         try:
+-            gnome_control_center_xid = int(environ['GNOME_CONTROL_CENTER_XID'])
++            parent_xid = int(environ['IBUS_SETUP_XID'])
++            if parent_xid != 0:
++                parent_wmname = 'ibus-setup'
++                parent_wmclass = 'Ibus-setup'
+         except:
+-            gnome_control_center_xid = 0
++            pass
++
++        try:
++            if parent_xid == 0:
++                parent_xid = int(environ['GNOME_CONTROL_CENTER_XID'])
++                if parent_xid != 0:
++                    parent_wmname = 'gnome-conrol-center'
++                    parent_wmclass = 'Gnome-conrol-center'
++        except:
++            pass
+ 
+-        if gnome_control_center_xid != 0:
++        if parent_xid != 0:
+             def set_transient(obj, pspec):
+                 window = toplevel.get_window()
+                 if window == None:
+                     return
+                 parent_window = GdkX11.X11Window.foreign_new_for_display(Gdk.Display.get_default(),
+-                                                                         gnome_control_center_xid)
++                                                                         parent_xid)
+                 if parent_window != None:
+                     window.set_transient_for(parent_window)
+-            toplevel.set_wmclass('gnome-control-center', 'Gnome-control-center')
++            toplevel.set_wmclass(parent_wmname, parent_wmclass)
+             toplevel.set_modal(True)
+             toplevel.set_type_hint(Gdk.WindowTypeHint.DIALOG)
+             toplevel.connect('notify::window', set_transient)
+-- 
+1.8.5.3
+
 From 4d605b873bf4b0af2a337cd076175c8d0a703346 Mon Sep 17 00:00:00 2001
 From: fujiwarat <takao.fujiwara1 at gmail.com>
 Date: Thu, 27 Feb 2014 18:32:01 +0900
diff --git a/ibus-anthy.spec b/ibus-anthy.spec
index 6a78fe2..b1ea126 100644
--- a/ibus-anthy.spec
+++ b/ibus-anthy.spec
@@ -14,7 +14,7 @@
 
 Name:           ibus-anthy
 Version:        1.5.5
-Release:        5%{?dist}
+Release:        6%{?dist}
 Summary:        The Anthy engine for IBus input platform
 License:        GPLv2+
 Group:          System Environment/Libraries
@@ -157,6 +157,12 @@ touch --no-create %{_datadir}/icons/hicolor || :
 %{_libdir}/libanthygobject-%{sub_version}.so
 
 %changelog
+* Mon Jul 14 2014 Takao Fujiwara <tfujiwar at redhat.com> - 1.5.5-6
+- Updated ibus-anthy-HEAD.patch
+  Fixed deprecated warnings with python3-gobject 3.13.3.
+  Set max-width-chars in ibus-anthy-setup wrapped GtkLabel.
+  Set 'IBUS_SETUP_XID' environment variable in setup.
+
 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.5.5-5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 


More information about the scm-commits mailing list