aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/application.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-11-20 15:21:34 +0100
committerfiaxh <git@lightrise.org>2020-11-20 15:21:34 +0100
commit11d9855a3994bc24ff67f5c2c4933c1d9559f6c5 (patch)
tree29407df7d6cfb36f82580de5f39f0bbf9c28d372 /main/src/ui/application.vala
parent07917f1d841f449157aa3aaa2507b0547dd274e7 (diff)
downloaddino-11d9855a3994bc24ff67f5c2c4933c1d9559f6c5.tar.gz
dino-11d9855a3994bc24ff67f5c2c4933c1d9559f6c5.zip
Refactor Notifications, add freedesktop backend
fixes #707
Diffstat (limited to 'main/src/ui/application.vala')
-rw-r--r--main/src/ui/application.vala12
1 files changed, 6 insertions, 6 deletions
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);