[gnome-contacts/Community/Purism/gnome-contacts-wip/aplazas/leaflet: 4/4] Window: Handle row activation



commit 1892f7072b82ab943425f2b05a46884f623191a4
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu Oct 18 16:02:16 2018 +0200

    Window: Handle row activation

 src/contacts-list-pane.vala | 9 +++++++++
 src/contacts-window.vala    | 5 +++++
 2 files changed, 14 insertions(+)
---
diff --git a/src/contacts-list-pane.vala b/src/contacts-list-pane.vala
index 3aaf3d6..f0a269a 100644
--- a/src/contacts-list-pane.vala
+++ b/src/contacts-list-pane.vala
@@ -44,6 +44,7 @@ public class Contacts.ListPane : Frame {
   public UiState state { get; set; }
 
   public signal void selection_changed (Contact? contact);
+  public signal void contact_activated ();
   public signal void link_contacts (LinkedList<Contact> contacts);
   public signal void delete_contacts (LinkedList<Contact> contacts);
   public signal void contacts_marked (int contacts_marked);
@@ -68,6 +69,14 @@ public class Contacts.ListPane : Frame {
         selection_changed (contact);
       });
 
+    this.contacts_list.row_selected.connect( () => {
+        contact_activated ();
+      });
+
+    this.contacts_list.row_activated.connect( () => {
+        contact_activated ();
+      });
+
     this.contacts_list.contacts_marked.connect ((nr_contacts_marked) => {
         this.delete_button.sensitive = (nr_contacts_marked > 0);
         this.link_button.sensitive = (nr_contacts_marked > 1);
diff --git a/src/contacts-window.vala b/src/contacts-window.vala
index f3c6efa..9972e14 100644
--- a/src/contacts-window.vala
+++ b/src/contacts-window.vala
@@ -187,6 +187,7 @@ public class Contacts.Window : Gtk.ApplicationWindow {
     list_pane = new ListPane (this.settings, store);
     bind_property ("state", this.list_pane, "state", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE);
     list_pane.selection_changed.connect (list_pane_selection_changed_cb);
+    list_pane.contact_activated.connect (list_pane_contact_activated_cb);
     list_pane.link_contacts.connect (list_pane_link_contacts_cb);
     list_pane.delete_contacts.connect (delete_contacts);
 
@@ -411,6 +412,10 @@ public class Contacts.Window : Gtk.ApplicationWindow {
       show_contact_pane ();
   }
 
+  private void list_pane_contact_activated_cb () {
+    // show_contact_pane ();
+  }
+
   void list_pane_link_contacts_cb (LinkedList<Contact> contact_list) {
     set_shown_contact (null);
     this.state = UiState.NORMAL;


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