diff options
author | Adrien Plazas <kekun.plazas@laposte.net> | 2018-10-18 16:02:16 +0200 |
---|---|---|
committer | Niels De Graef <nielsdegraef@gmail.com> | 2019-01-16 23:00:04 +0100 |
commit | 1892f7072b82ab943425f2b05a46884f623191a4 (patch) | |
tree | 6638362306909641634b664b1870d1825c5a4876 | |
parent | 7cc15930b6a0401992f9c7e18ed4e76b2e5a4755 (diff) | |
download | gnome-contacts-Community/Purism/gnome-contacts-wip/aplazas/leaflet.tar.gz |
Window: Handle row activationCommunity/Purism/gnome-contacts-wip/aplazas/leaflet
-rw-r--r-- | src/contacts-list-pane.vala | 9 | ||||
-rw-r--r-- | src/contacts-window.vala | 5 |
2 files changed, 14 insertions, 0 deletions
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; |