diff options
author | Alexander Larsson <alexl@redhat.com> | 2011-12-16 11:31:16 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2011-12-16 11:31:16 +0100 |
commit | 1a9388250d9893d991910ec8c8cb57cf809c8939 (patch) | |
tree | e9057772ba578748c1a45dd09a4e3989f08eb800 | |
parent | a0955bae135b1987c34430035b0c5685f773b7cf (diff) | |
download | gnome-contacts-1a9388250d9893d991910ec8c8cb57cf809c8939.tar.gz |
Track email button sensitivity
-rw-r--r-- | src/contacts-contact-pane.vala | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala index dbd84b5..59bf3c7 100644 --- a/src/contacts-contact-pane.vala +++ b/src/contacts-contact-pane.vala @@ -1848,6 +1848,13 @@ public class Contacts.ContactPane : ScrolledWindow { card_grid.attach (box, 1, 2, 1, 1); card_grid.show_all (); + + update_buttons (); + } + + public void update_buttons () { + var emails = contact.individual.email_addresses; + email_button.set_sensitive (!emails.is_empty); } public void update_personas () { @@ -1869,22 +1876,30 @@ public class Contacts.ContactPane : ScrolledWindow { } public void show_contact (Contact? new_contact, bool edit=false) { - if (contact != null) + if (contact != null) { contact.personas_changed.disconnect (personas_changed_cb); + contact.changed.disconnect (contact_changed_cb); + } contact = new_contact; update_card (); update_personas (); - if (contact != null) + if (contact != null) { contact.personas_changed.connect (personas_changed_cb); + contact.changed.connect (contact_changed_cb); + } } private void personas_changed_cb (Contact contact) { update_personas (); } + private void contact_changed_cb (Contact contact) { + update_buttons (); + } + public void new_contact (ListPane list_pane) { } |