[gnome-contacts/wip/mjog/show-contact-action: 2/2] App: Add show-contact action



commit 15d6cce8198a70c311efcea35e731bcfd4299bba
Author: Michael Gratton <mike vee net>
Date:   Sun Mar 17 00:07:06 2019 +1100

    App: Add show-contact action
    
    Like the -i command line option, but DBus activatable.

 src/contacts-app.vala | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/src/contacts-app.vala b/src/contacts-app.vala
index aa0e17c..1100b0f 100644
--- a/src/contacts-app.vala
+++ b/src/contacts-app.vala
@@ -34,7 +34,8 @@ public class Contacts.App : Gtk.Application {
     { "about",           show_about          },
     { "change-book",     change_address_book },
     { "online-accounts", online_accounts     },
-    { "new-contact",     new_contact         }
+    { "new-contact",     new_contact         },
+    { "show-contact",    on_show_contact,   "s"     }
   };
 
   private const OptionEntry[] options = {
@@ -385,4 +386,13 @@ public class Contacts.App : Gtk.Application {
   public void new_contact () {
     window.new_contact ();
   }
+
+  private void on_show_contact(SimpleAction action, Variant? param) {
+    var individual = param as string;
+    if (window != null)
+      window.present ();
+    if (individual != null)
+      show_individual.begin (individual);
+  }
+
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]