[gnome-contacts] Changed LinkDialog for LinkedAccountsDialog.
- From: Erick PÃrez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] Changed LinkDialog for LinkedAccountsDialog.
- Date: Thu, 10 Jan 2013 22:12:22 +0000 (UTC)
commit 6b342da5908f49d7f2023cffa3315c2523cb9071
Author: Erick PÃrez Castellanos <erick red gmail com>
Date: Thu Jan 10 15:20:07 2013 -0500
Changed LinkDialog for LinkedAccountsDialog.
The dialog doesn't unlink nor handles undo, yet.
It will, soon.
src/Makefile.am | 1 -
src/contacts-contact-pane.vala | 19 ++-
src/contacts-link-dialog.vala | 298 ----------------------------------------
3 files changed, 12 insertions(+), 306 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index bc22c44..d63d064 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -31,7 +31,6 @@ vala_sources = \
contacts-contact-pane.vala \
contacts-types.vala \
contacts-list-pane.vala \
- contacts-link-dialog.vala \
contacts-linked-accounts-dialog.vala \
contacts-linking.vala \
contacts-menu-button.vala \
diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala
index 30bbc7d..47677c7 100644
--- a/src/contacts-contact-pane.vala
+++ b/src/contacts-contact-pane.vala
@@ -81,6 +81,8 @@ public class Contacts.ContactPane : Notebook {
/* thrid page */
private ContactEditor editor;
+ private Button linked_button;
+ private Button remove_button;
/* single value details */
private Gtk.MenuItem nickname_item;
@@ -217,14 +219,19 @@ public class Contacts.ContactPane : Notebook {
update_sheet ();
bool can_remove = false;
+ bool has_links = false;
if (contact != null) {
contact.personas_changed.connect (personas_changed_cb);
contact.changed.connect (contact_changed_cb);
can_remove = contact.can_remove_personas ();
+ has_links = contact.individual.personas.size > 1;
}
+ remove_button.set_sensitive (can_remove);
+ linked_button.set_sensitive (has_links);
+
if (contact == null)
show_no_selection_frame ();
}
@@ -402,10 +409,11 @@ public class Contacts.ContactPane : Notebook {
edit_toolbar.insert (tool_item, -1);
tool_item = new ToolItem ();
- var linked_button = new Button.with_label (_("Linked Accounts"));
+ linked_button = new Button.with_label (_("Linked Accounts"));
linked_button.set_vexpand (true);
tool_item.add (linked_button);
edit_toolbar.insert (tool_item, -1);
+ linked_button.clicked.connect (linked_accounts);
tool_item = new SeparatorToolItem ();
tool_item.set_expand (true);
@@ -413,7 +421,7 @@ public class Contacts.ContactPane : Notebook {
edit_toolbar.insert (tool_item, -1);
tool_item = new ToolItem ();
- var remove_button = new Button.with_label (_("Remove Contact"));
+ remove_button = new Button.with_label (_("Remove Contact"));
remove_button.set_vexpand (true);
tool_item.add (remove_button);
edit_toolbar.insert (tool_item, -1);
@@ -430,11 +438,8 @@ public class Contacts.ContactPane : Notebook {
insert_page (top_grid, null, 2);
}
- void link_contact () {
- var dialog = new LinkDialog (contact);
- dialog.contacts_linked.connect ( (main_contact, linked_contact, operation) => {
- this.contacts_linked (main_contact, linked_contact, operation);
- });
+ void linked_accounts () {
+ var dialog = new LinkedAccountsDialog (contact);
dialog.show_all ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]