| ... |
... |
@@ -47,7 +47,7 @@ def __init__(self): |
|
47
|
47
|
GLib.MINOR_VERSION,
|
|
48
|
48
|
GLib.MICRO_VERSION]))
|
|
49
|
49
|
|
|
50
|
|
- comments = []
|
|
|
50
|
+ comments: list[str] = []
|
|
51
|
51
|
comments.append(_('A GTK XMPP client'))
|
|
52
|
52
|
comments.append(_('GTK Version: %s') % gtk_ver)
|
|
53
|
53
|
comments.append(_('GLib Version: %s') % glib_ver)
|
| ... |
... |
@@ -69,29 +69,12 @@ def __init__(self): |
|
69
|
69
|
self.set_translator_credits(_('translator-credits'))
|
|
70
|
70
|
self.set_logo_icon_name('org.gajim.Gajim')
|
|
71
|
71
|
|
|
72
|
|
- self.connect(
|
|
73
|
|
- 'response', lambda dialog, *args: Gtk.AboutDialog.do_close(dialog))
|
|
74
|
|
-
|
|
75
|
|
- self.show()
|
|
76
|
72
|
self.connect('activate-link', self._on_activate_link)
|
|
77
|
|
- # See https://gitlab.gnome.org/GNOME/gtk/issues/1561
|
|
78
|
|
- self._connect_link_handler(self)
|
|
|
73
|
+ self.show()
|
|
79
|
74
|
|
|
80
|
75
|
@staticmethod
|
|
81
|
|
- def _on_activate_link(_label, uri):
|
|
|
76
|
+ def _on_activate_link(_label: Gtk.Label, uri: str) -> int:
|
|
82
|
77
|
# We have to use this, because the default GTK handler
|
|
83
|
78
|
# is not cross-platform compatible
|
|
84
|
79
|
open_uri(uri)
|
|
85
|
80
|
return Gdk.EVENT_STOP
|
|
86
|
|
-
|
|
87
|
|
- def _connect_link_handler(self, parent):
|
|
88
|
|
- def _find_child(parent_):
|
|
89
|
|
- if not hasattr(parent_, 'get_children'):
|
|
90
|
|
- return
|
|
91
|
|
-
|
|
92
|
|
- for child in parent_.get_children():
|
|
93
|
|
- if isinstance(child, Gtk.Label):
|
|
94
|
|
- if 'href' in child.get_label():
|
|
95
|
|
- child.connect('activate-link', self._on_activate_link)
|
|
96
|
|
- _find_child(child)
|
|
97
|
|
- _find_child(parent)
|