Philipp Hörist pushed to branch master at gajim / gajim
Commits: 251439bf by lovetox at 2021-12-08T18:35:10+01:00 About: Remove Workaround https://gitlab.gnome.org/GNOME/gtk/issues/1561 is fixed and merged - - - - - eaeae1f4 by lovetox at 2021-12-08T20:00:49+01:00 About: Add type annotations - - - - - d2d217b6 by lovetox at 2021-12-08T20:01:40+01:00 About: Remove unnecessary code - - - - - 1 changed file: - gajim/gtk/about.py Changes: ===================================== gajim/gtk/about.py ===================================== @@ -47,7 +47,7 @@ def __init__(self): GLib.MINOR_VERSION, GLib.MICRO_VERSION])) - comments = [] + comments: list[str] = [] comments.append(_('A GTK XMPP client')) comments.append(_('GTK Version: %s') % gtk_ver) comments.append(_('GLib Version: %s') % glib_ver) @@ -69,29 +69,12 @@ def __init__(self): self.set_translator_credits(_('translator-credits')) self.set_logo_icon_name('org.gajim.Gajim') - self.connect( - 'response', lambda dialog, *args: Gtk.AboutDialog.do_close(dialog)) - - self.show() self.connect('activate-link', self._on_activate_link) - # See https://gitlab.gnome.org/GNOME/gtk/issues/1561 - self._connect_link_handler(self) + self.show() @staticmethod - def _on_activate_link(_label, uri): + def _on_activate_link(_label: Gtk.Label, uri: str) -> int: # We have to use this, because the default GTK handler # is not cross-platform compatible open_uri(uri) return Gdk.EVENT_STOP - - def _connect_link_handler(self, parent): - def _find_child(parent_): - if not hasattr(parent_, 'get_children'): - return - - for child in parent_.get_children(): - if isinstance(child, Gtk.Label): - if 'href' in child.get_label(): - child.connect('activate-link', self._on_activate_link) - _find_child(child) - _find_child(parent) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/4a60a9e3d42da52a6b3d6d99b642805c649fcf7a...d2d217b6932cbd3d7c1eaa60e800a47ff788d895 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/4a60a9e3d42da52a6b3d6d99b642805c649fcf7a...d2d217b6932cbd3d7c1eaa60e800a47ff788d895 You're receiving this email because of your account on dev.gajim.org.
_______________________________________________ Commits mailing list [email protected] https://lists.gajim.org/cgi-bin/listinfo/commits
