diff options
author | Bastien Nocera <hadess@hadess.net> | 2022-11-24 10:45:28 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2022-11-24 10:50:25 +0100 |
commit | 2a9c4e436fc9a6d4901c8f6aa51d2cf03a768d68 (patch) | |
tree | 2523f4aa490665f0364b3e0d9af28564b886659e /src/plugins | |
parent | f2ae04f3bbf8196d8bed3863ba5fff27127ab049 (diff) | |
download | totem-2a9c4e436fc9a6d4901c8f6aa51d2cf03a768d68.tar.gz |
opensubtitles: Re-fix blank dialogue (and traceback)
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/gi/overrides/Gtk.py", line 85, in _builder_connect_callback
handler, args = _extract_handler_and_args(obj_or_map, handler_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/site-packages/gi/_gtktemplate.py", line 34, in _extract_handler_and_args
raise AttributeError('Handler %s not found' % handler_name)
AttributeError: Handler Gtk.Widget.hide_on_delete not found
Fixes: f2ae04f ("opensubtitles: Fix blank dialogue when reopened")
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/opensubtitles/opensubtitles.py | 6 | ||||
-rw-r--r-- | src/plugins/opensubtitles/opensubtitles.ui | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/opensubtitles/opensubtitles.py b/src/plugins/opensubtitles/opensubtitles.py index 589ef10fb..32340500a 100644 --- a/src/plugins/opensubtitles/opensubtitles.py +++ b/src/plugins/opensubtitles/opensubtitles.py @@ -455,7 +455,7 @@ class OpenSubtitles (GObject.Object, # pylint: disable=R0902 def _build_dialog (self): ui_file_path = os.path.dirname (os.path.abspath (__file__)) + sep + 'opensubtitles.ui' builder = Gtk.Builder.new_from_file (ui_file_path) - builder.connect_signals(None) + builder.connect_signals(self) # Obtain all the widgets we need to initialize combobox = builder.get_object ('language_combobox') @@ -527,6 +527,10 @@ class OpenSubtitles (GObject.Object, # pylint: disable=R0902 self._tree_view.connect ('row-activated', self.__on_treeview__row_activate) + def _hide_on_delete(self, *_): + self._dialog.hide_on_delete() + return True + def _show_dialog (self, *_): if not self._dialog: self._build_dialog () diff --git a/src/plugins/opensubtitles/opensubtitles.ui b/src/plugins/opensubtitles/opensubtitles.ui index d0f8161b6..3b8929b3d 100644 --- a/src/plugins/opensubtitles/opensubtitles.ui +++ b/src/plugins/opensubtitles/opensubtitles.ui @@ -29,7 +29,7 @@ <property name="default_width">400</property> <property name="default_height">400</property> <property name="type_hint">dialog</property> - <signal name="delete-event" handler="gtk_widget_hide_on_delete" swapped="no"/> + <signal name="delete-event" handler="_hide_on_delete" swapped="no"/> <child> <object class="GtkBox" id="vbox1"> <property name="orientation">vertical</property> |