From b672df94e82032f265255ea756b459251cadfef1 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 17 Aug 2017 11:38:41 +0200 Subject: Use single process, accept xmpp:-URIs as program argument --- main/src/ui/application.vala | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'main') diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala index 33208786..6b0db782 100644 --- a/main/src/ui/application.vala +++ b/main/src/ui/application.vala @@ -14,6 +14,7 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application { public SearchPathGenerator? search_path_generator { get; set; } public Application() throws Error { + Object(application_id: "im.dino.Dino", flags: ApplicationFlags.HANDLES_OPEN); init(); Notify.init("dino"); Environment.set_application_name("Dino"); @@ -21,15 +22,25 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application { IconTheme.get_default().add_resource_path("/im/dino/icons"); activate.connect(() => { - create_set_app_menu(); - window = new UnifiedWindow(this, stream_interaction); - notifications = new Notifications(stream_interaction, window); - notifications.start(); - notifications.conversation_selected.connect(window.on_conversation_selected); + if (window == null) { + create_set_app_menu(); + window = new UnifiedWindow(this, stream_interaction); + notifications = new Notifications(stream_interaction, window); + notifications.start(); + notifications.conversation_selected.connect(window.on_conversation_selected); + } window.present(); }); } + public void handle_uri(string jid, string query, Gee.Map options) { + switch (query) { + case "message": + // TODO + break; + } + } + private void show_accounts_window() { ManageAccounts.Dialog dialog = new ManageAccounts.Dialog(stream_interaction, db); dialog.set_transient_for(window); -- cgit v1.2.3-70-g09d2