Philipp Hörist pushed to branch master at gajim / gajim
Commits:
12c20823 by lovetox at 2022-01-25T22:59:16+01:00
Notifications: Add code comment
- - - - -
45585811 by lovetox at 2022-01-25T23:06:14+01:00
PlainWidget: Use open_uri() to open links
- - - - -
2 changed files:
- gajim/gtk/conversation/plain_widget.py
- gajim/gtk/notification.py
Changes:
=====================================
gajim/gtk/conversation/plain_widget.py
=====================================
@@ -86,6 +86,7 @@ def __init__(self, account: str, selectable: bool) -> None:
self.get_style_context().add_class('gajim-conversation-text')
self.connect('populate-popup', self._on_populate_popup)
+ self.connect('activate-link', self._on_activate_link)
def _on_populate_popup(self, label: Gtk.Label, menu: Gtk.Menu) -> None:
selected, start, end = label.get_selection_bounds()
@@ -118,6 +119,10 @@ def add_action_phrase(self, text: str) -> None:
def update_text_tags(self) -> None:
pass
+ def _on_activate_link(self, _label: Gtk.Label, uri: str) -> int:
+ open_uri(uri, self._account)
+ return Gdk.EVENT_STOP
+
class MessageTextview(Gtk.TextView):
def __init__(self, account: str) -> None:
=====================================
gajim/gtk/notification.py
=====================================
@@ -253,6 +253,11 @@ def __init__(self):
def _detect_dbus_caps(self) -> None:
if app.is_flatpak() or app.desktop_env == 'gnome':
+ # Gnome Desktop does not use org.freedesktop.Notifications.
+ # It has its own API at org.gtk.Notifications, which is not an
+ # implementation of the freedesktop spec. There is no documentation
+ # on what it currently supports, we can assume at least what the
+ # GLib.Notification API offers (icons, actions).
self._caps = ['actions']
self._dbus_available = True
return
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/58aaa25098197c1fcdac80ec523685b4f2f57052...45585811f2f1eaf77bd5f07946387087bc050501
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/58aaa25098197c1fcdac80ec523685b4f2f57052...45585811f2f1eaf77bd5f07946387087bc050501
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