From 1b9a10ec0e1b0fc411b88965ed517f46034f005c Mon Sep 17 00:00:00 2001 From: Takao Fujiwara Date: Wed, 16 Jul 2014 15:16:50 +0900 Subject: [PATCH] Updated ibus-anthy-HEAD.patch Fixed deprecated warnings with python3-gobject 3.13.3. --- ibus-anthy-HEAD.patch | 206 +++++++++++++++++++++++++++++++++++------- ibus-anthy.spec | 6 +- 2 files changed, 178 insertions(+), 34 deletions(-) diff --git a/ibus-anthy-HEAD.patch b/ibus-anthy-HEAD.patch index efd1d11..2b36e99 100644 --- a/ibus-anthy-HEAD.patch +++ b/ibus-anthy-HEAD.patch @@ -1576,9 +1576,9 @@ index d9ec626..dc5e7e1 100644 -- 1.8.0 -From 8a79278d6fadecd4bdcebb32f33d19ee72e1e933 Mon Sep 17 00:00:00 2001 +From c7caeaf8dc3aaaf5b1d546ffb418aae52b8905a4 Mon Sep 17 00:00:00 2001 From: fujiwarat -Date: Thu, 10 Jul 2014 13:50:54 +0900 +Date: Wed, 16 Jul 2014 14:57:07 +0900 Subject: [PATCH] Fixed deprecated warnings with python3-gobject 3.13.3. python3-gobject adds several warnings in gi/overrides/Gtk.py @@ -1593,14 +1593,31 @@ 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(-) + setup/python2/main.py | 52 +++++++++++++++++++++++++++++++-------------------- + setup/python3/main.py | 52 +++++++++++++++++++++++++++++++-------------------- + 2 files changed, 64 insertions(+), 40 deletions(-) diff --git a/setup/python2/main.py b/setup/python2/main.py -index 7c403b8..5df1cdd 100644 +index 7c403b8..424e703 100644 --- a/setup/python2/main.py +++ b/setup/python2/main.py +@@ -325,11 +325,11 @@ class AnthySetup(object): + return (section, key) + + def __run_message_dialog(self, message, type=Gtk.MessageType.INFO): +- dlg = Gtk.MessageDialog(parent=self.__builder.get_object('main'), +- flags=Gtk.DialogFlags.MODAL, +- message_type=type, +- buttons=Gtk.ButtonsType.OK, +- message_format=message) ++ dlg = Gtk.MessageDialog( ++ transient_for=self.__builder.get_object('main'), ++ message_type=type, ++ buttons=Gtk.ButtonsType.OK, ++ text=message) + dlg.run() + dlg.destroy() + @@ -420,6 +420,7 @@ class AnthySetup(object): for key, value in sorted(rule.items(), \ cmp = self.__japanese_tuple_sort): @@ -1625,31 +1642,68 @@ index 7c403b8..5df1cdd 100644 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): +@@ -582,9 +585,10 @@ class AnthySetup(object): + combobox.clear() + combobox.disconnect_by_func(self.on_cb_custom_key_table_changed) + +- def __run_dialog_custom_key_table(self, mode): ++ def __run_dialog_custom_key_table(self, widget, mode): prefs = self.prefs dlg = self.__builder.get_object('dialog_custom_key_table') -+ dlg.set_transient_for(self.__builder.get_object('main')) ++ dlg.set_transient_for(widget.get_toplevel()) 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): +@@ -1134,6 +1138,7 @@ class AnthySetup(object): + Gtk.main_quit() + return True + dlg = self.__builder.get_object('quit_check') ++ dlg.set_transient_for(widget.get_toplevel()) + dlg.set_markup('%s' % _("Confirmation")) + dlg.format_secondary_text( + _("You are about to close the setup dialog, is that OK?")) +@@ -1150,6 +1155,7 @@ class AnthySetup(object): + Gtk.main_quit() + return True + dlg = self.__builder.get_object('quit_check_without_save') ++ dlg.set_transient_for(widget.get_toplevel()) + dlg.set_markup('%s' % _("Notice!")) + dlg.format_secondary_text( + _("You are about to close the setup dialog without saving your changes, is that OK?")) +@@ -1225,6 +1231,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')) ++ dlg.set_transient_for(widget.get_toplevel()) id = dlg.run() dlg.hide() if id == Gtk.ResponseType.OK: -@@ -1380,6 +1385,7 @@ class AnthySetup(object): +@@ -1245,13 +1252,13 @@ class AnthySetup(object): + self.__builder.get_object('btn_apply').set_sensitive(True) + + def on_btn_romaji_custom_table_clicked(self, widget): +- self.__run_dialog_custom_key_table('romaji') ++ self.__run_dialog_custom_key_table(widget, 'romaji') + + def on_btn_kana_custom_table_clicked(self, widget): +- self.__run_dialog_custom_key_table('kana') ++ self.__run_dialog_custom_key_table(widget, 'kana') + + def on_btn_thumb_custom_table_clicked(self, widget): +- self.__run_dialog_custom_key_table('thumb') ++ self.__run_dialog_custom_key_table(widget, 'thumb') + + def on_btn_add_custom_key(self, widget, user_data): + prefs = self.prefs +@@ -1380,6 +1387,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')) ++ dlg.set_transient_for(widget.get_toplevel()) id = dlg.run() dlg.hide() self.__builder.get_object('es:button_add').show() -@@ -1414,16 +1420,17 @@ class AnthySetup(object): +@@ -1414,16 +1422,17 @@ class AnthySetup(object): if Gtk.Buildable.get_name(widget) == 'dict:btn_add': dlg = Gtk.FileChooserDialog(title=_("Open Dictionary File"), @@ -1657,7 +1711,7 @@ index 7c403b8..5df1cdd 100644 - action=Gtk.FileChooserAction.OPEN, - buttons=(_("_Cancel"), Gtk.ResponseType.CANCEL, - _("_Open"), Gtk.ResponseType.OK)) -+ transient_for=self.__builder.get_object('main'), ++ transient_for=widget.get_toplevel(), + action=Gtk.FileChooserAction.OPEN) + buttons=(_("_Cancel"), Gtk.ResponseType.CANCEL, + _("_Open"), Gtk.ResponseType.OK) @@ -1668,27 +1722,27 @@ index 7c403b8..5df1cdd 100644 - flags=Gtk.DialogFlags.MODAL, - buttons=(_("_Cancel"), Gtk.ResponseType.CANCEL, - _("_OK"), Gtk.ResponseType.OK)) -+ transient_for=self.__builder.get_object('main')) ++ transient_for=widget.get_toplevel()) + 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): +@@ -1516,9 +1525,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')) ++ transient_for=widget.get_toplevel()) + 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): +@@ -1666,6 +1675,7 @@ class AnthySetup(object): def on_es_button_run_input_clicked(self, widget): dlg = self.__builder.get_object('key_input_dialog') @@ -1696,10 +1750,43 @@ index 7c403b8..5df1cdd 100644 dlg.set_markup('%s' % _("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() +@@ -1686,6 +1696,7 @@ class AnthySetup(object): + s = self.__builder.get_object('es:entry').get_text() + if not s or not IBus.keyval_from_name(s): + dlg = self.__builder.get_object('invalid_keysym') ++ dlg.set_transient_for(widget.get_toplevel()) + dlg.set_markup('%s' % _("Invalid keysym")) + dlg.format_secondary_text(_("This keysym is not valid")) + dlg.run() +@@ -1706,6 +1717,7 @@ class AnthySetup(object): + s = self.__builder.get_object('es:entry').get_text() + if not s or not IBus.keyval_from_name(s): + dlg = self.__builder.get_object('invalid_keysym') ++ dlg.set_transient_for(widget.get_toplevel()) + dlg.set_markup('%s' % _("Invalid keysym")) + dlg.format_secondary_text(_("This keysym is not valid")) + dlg.run() diff --git a/setup/python3/main.py b/setup/python3/main.py -index 2073f59..8921402 100644 +index 2073f59..e1ca22e 100644 --- a/setup/python3/main.py +++ b/setup/python3/main.py +@@ -328,11 +328,11 @@ class AnthySetup(object): + return (section, key) + + def __run_message_dialog(self, message, type=Gtk.MessageType.INFO): +- dlg = Gtk.MessageDialog(parent=self.__builder.get_object('main'), +- flags=Gtk.DialogFlags.MODAL, +- message_type=type, +- buttons=Gtk.ButtonsType.OK, +- message_format=message) ++ dlg = Gtk.MessageDialog( ++ transient_for=self.__builder.get_object('main'), ++ message_type=type, ++ buttons=Gtk.ButtonsType.OK, ++ text=message) + dlg.run() + dlg.destroy() + @@ -425,6 +425,7 @@ class AnthySetup(object): for key, value in sorted(list(rule.items()), \ key = functools.cmp_to_key(self.__japanese_tuple_sort)): @@ -1724,31 +1811,68 @@ index 2073f59..8921402 100644 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): +@@ -587,9 +590,10 @@ class AnthySetup(object): + combobox.clear() + combobox.disconnect_by_func(self.on_cb_custom_key_table_changed) + +- def __run_dialog_custom_key_table(self, mode): ++ def __run_dialog_custom_key_table(self, widget, mode): prefs = self.prefs dlg = self.__builder.get_object('dialog_custom_key_table') -+ dlg.set_transient_for(self.__builder.get_object('main')) ++ dlg.set_transient_for(widget.get_toplevel()) 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): +@@ -1128,6 +1132,7 @@ class AnthySetup(object): + Gtk.main_quit() + return True + dlg = self.__builder.get_object('quit_check') ++ dlg.set_transient_for(widget.get_toplevel()) + dlg.set_markup('%s' % _("Confirmation")) + dlg.format_secondary_text( + _("You are about to close the setup dialog, is that OK?")) +@@ -1144,6 +1149,7 @@ class AnthySetup(object): + Gtk.main_quit() + return True + dlg = self.__builder.get_object('quit_check_without_save') ++ dlg.set_transient_for(widget.get_toplevel()) + dlg.set_markup('%s' % _("Notice!")) + dlg.format_secondary_text( + _("You are about to close the setup dialog without saving your changes, is that OK?")) +@@ -1219,6 +1225,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')) ++ dlg.set_transient_for(widget.get_toplevel()) id = dlg.run() dlg.hide() if id == Gtk.ResponseType.OK: -@@ -1374,6 +1379,7 @@ class AnthySetup(object): +@@ -1239,13 +1246,13 @@ class AnthySetup(object): + self.__builder.get_object('btn_apply').set_sensitive(True) + + def on_btn_romaji_custom_table_clicked(self, widget): +- self.__run_dialog_custom_key_table('romaji') ++ self.__run_dialog_custom_key_table(widget, 'romaji') + + def on_btn_kana_custom_table_clicked(self, widget): +- self.__run_dialog_custom_key_table('kana') ++ self.__run_dialog_custom_key_table(widget, 'kana') + + def on_btn_thumb_custom_table_clicked(self, widget): +- self.__run_dialog_custom_key_table('thumb') ++ self.__run_dialog_custom_key_table(widget, 'thumb') + + def on_btn_add_custom_key(self, widget, user_data): + prefs = self.prefs +@@ -1374,6 +1381,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')) ++ dlg.set_transient_for(widget.get_toplevel()) id = dlg.run() dlg.hide() self.__builder.get_object('es:button_add').show() -@@ -1408,16 +1414,17 @@ class AnthySetup(object): +@@ -1408,16 +1416,17 @@ class AnthySetup(object): if Gtk.Buildable.get_name(widget) == 'dict:btn_add': dlg = Gtk.FileChooserDialog(title=_("Open Dictionary File"), @@ -1756,7 +1880,7 @@ index 2073f59..8921402 100644 - action=Gtk.FileChooserAction.OPEN, - buttons=(_("_Cancel"), Gtk.ResponseType.CANCEL, - _("_Open"), Gtk.ResponseType.OK)) -+ transient_for=self.__builder.get_object('main'), ++ transient_for=widget.get_toplevel(), + action=Gtk.FileChooserAction.OPEN) + buttons=(_("_Cancel"), Gtk.ResponseType.CANCEL, + _("_Open"), Gtk.ResponseType.OK) @@ -1767,27 +1891,27 @@ index 2073f59..8921402 100644 - flags=Gtk.DialogFlags.MODAL, - buttons=(_("_Cancel"), Gtk.ResponseType.CANCEL, - _("_OK"), Gtk.ResponseType.OK)) -+ transient_for=self.__builder.get_object('main')) ++ transient_for=widget.get_toplevel()) + 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): +@@ -1510,9 +1519,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')) ++ transient_for=widget.get_toplevel()) + 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): +@@ -1660,6 +1669,7 @@ class AnthySetup(object): def on_es_button_run_input_clicked(self, widget): dlg = self.__builder.get_object('key_input_dialog') @@ -1795,6 +1919,22 @@ index 2073f59..8921402 100644 dlg.set_markup('%s' % _("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() +@@ -1680,6 +1690,7 @@ class AnthySetup(object): + s = self.__builder.get_object('es:entry').get_text() + if not s or not IBus.keyval_from_name(s): + dlg = self.__builder.get_object('invalid_keysym') ++ dlg.set_transient_for(widget.get_toplevel()) + dlg.set_markup('%s' % _("Invalid keysym")) + dlg.format_secondary_text(_("This keysym is not valid")) + dlg.run() +@@ -1700,6 +1711,7 @@ class AnthySetup(object): + s = self.__builder.get_object('es:entry').get_text() + if not s or not IBus.keyval_from_name(s): + dlg = self.__builder.get_object('invalid_keysym') ++ dlg.set_transient_for(widget.get_toplevel()) + dlg.set_markup('%s' % _("Invalid keysym")) + dlg.format_secondary_text(_("This keysym is not valid")) + dlg.run() -- 1.8.5.3 diff --git a/ibus-anthy.spec b/ibus-anthy.spec index b1ea126..ce19083 100644 --- a/ibus-anthy.spec +++ b/ibus-anthy.spec @@ -14,7 +14,7 @@ Name: ibus-anthy Version: 1.5.5 -Release: 6%{?dist} +Release: 7%{?dist} Summary: The Anthy engine for IBus input platform License: GPLv2+ Group: System Environment/Libraries @@ -157,6 +157,10 @@ touch --no-create %{_datadir}/icons/hicolor || : %{_libdir}/libanthygobject-%{sub_version}.so %changelog +* Mon Jul 14 2014 Takao Fujiwara - 1.5.5-7 +- Updated ibus-anthy-HEAD.patch + Fixed deprecated warnings with python3-gobject 3.13.3. + * Mon Jul 14 2014 Takao Fujiwara - 1.5.5-6 - Updated ibus-anthy-HEAD.patch Fixed deprecated warnings with python3-gobject 3.13.3.