From 11d9855a3994bc24ff67f5c2c4933c1d9559f6c5 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Fri, 20 Nov 2020 15:21:34 +0100 Subject: Refactor Notifications, add freedesktop backend fixes #707 --- main/src/ui/application.vala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'main/src/ui/application.vala') diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala index d2b82969..17abddbc 100644 --- a/main/src/ui/application.vala +++ b/main/src/ui/application.vala @@ -5,7 +5,6 @@ using Dino.Ui; using Xmpp; public class Dino.Ui.Application : Gtk.Application, Dino.Application { - private Notifications notifications; private MainWindow window; public MainWindowController controller; @@ -29,8 +28,11 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application { create_actions(); startup.connect(() => { - notifications = new Notifications(stream_interactor); - notifications.start(); + stream_interactor.get_module(NotificationEvents.IDENTITY).register_notification_provider(new GNotificationsNotifier(stream_interactor)); + FreeDesktopNotifier free_desktop_notifier = FreeDesktopNotifier.try_create(stream_interactor); + if (free_desktop_notifier != null) { + stream_interactor.get_module(NotificationEvents.IDENTITY).register_notification_provider(free_desktop_notifier); + } }); activate.connect(() => { @@ -40,8 +42,6 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application { window = new MainWindow(this, stream_interactor, db, config); controller.set_window(window); if ((get_flags() & ApplicationFlags.IS_SERVICE) == ApplicationFlags.IS_SERVICE) window.delete_event.connect(window.hide_on_delete); - - notifications.conversation_selected.connect((conversation) => controller.select_conversation(conversation)); } window.present(); }); @@ -99,7 +99,7 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application { open_conversation_action.activate.connect((variant) => { Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation_by_id(variant.get_int32()); if (conversation != null) controller.select_conversation(conversation); - window.present(); + Util.present_window(window); }); add_action(open_conversation_action); -- cgit v1.2.3-70-g09d2