[gnome-contacts/new-design] Track email button sensitivity
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts/new-design] Track email button sensitivity
- Date: Fri, 16 Dec 2011 13:09:29 +0000 (UTC)
commit 1a9388250d9893d991910ec8c8cb57cf809c8939
Author: Alexander Larsson <alexl redhat com>
Date: Fri Dec 16 11:31:16 2011 +0100
Track email button sensitivity
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) {
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]