summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2018-04-02 17:23:49 +0200
committerNiels De Graef <nielsdegraef@gmail.com>2018-04-02 17:32:01 +0200
commite7a638ec13b3d0202d52afdb0ccf39467eb8ebaf (patch)
treedb8767a7236943c6ef183ef550c624428c3c741d
parent5633dec96ec40ea115177dec916fb99ea46bfcac (diff)
downloadgnome-contacts-e7a638ec13b3d0202d52afdb0ccf39467eb8ebaf.tar.gz
ContactPane: move constructor before methods.
This is to finally have some convention that we can follow.
-rw-r--r--src/contacts-contact-pane.vala60
1 files changed, 26 insertions, 34 deletions
diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala
index 1ca6d15..50de345 100644
--- a/src/contacts-contact-pane.vala
+++ b/src/contacts-contact-pane.vala
@@ -75,6 +75,32 @@ public class Contacts.ContactPane : Stack {
public signal void display_name_changed (string new_display_name);
+ public ContactPane (Window parent_window, Store contacts_store) {
+ this.parent_window = parent_window;
+ this.store = contacts_store;
+
+ this.edit_contact_actions.add_action_entries (action_entries, this);
+
+ // Contact editor
+ this.editor = new ContactEditor (this.store, this.edit_contact_actions);
+ this.editor.linked_button.clicked.connect (linked_accounts);
+ this.editor.remove_button.clicked.connect (delete_contact);
+ this.contact_editor_page.add (this.editor);
+
+ /* enable/disable actions*/
+ var birthday_action = this.edit_contact_actions.lookup_action ("add.birthday") as SimpleAction;
+ this.editor.bind_property ("has-birthday-row", birthday_action, "enabled",
+ BindingFlags.SYNC_CREATE | BindingFlags.INVERT_BOOLEAN);
+
+ var nickname_action = this.edit_contact_actions.lookup_action ("add.nickname") as SimpleAction;
+ this.editor.bind_property ("has-nickname-row", nickname_action, "enabled",
+ BindingFlags.SYNC_CREATE | BindingFlags.INVERT_BOOLEAN);
+
+ var notes_action = this.edit_contact_actions.lookup_action ("add.notes") as SimpleAction;
+ this.editor.bind_property ("has-notes-row", notes_action, "enabled",
+ BindingFlags.SYNC_CREATE | BindingFlags.INVERT_BOOLEAN);
+ }
+
public void add_suggestion (Contact c) {
var parent_overlay = this.get_parent () as Overlay;
@@ -112,40 +138,6 @@ public class Contacts.ContactPane : Stack {
}
}
- public ContactPane (Window parent_window, Store contacts_store) {
- this.parent_window = parent_window;
- this.store = contacts_store;
-
- this.edit_contact_actions.add_action_entries (action_entries, this);
-
- // Contact editor
- this.editor = new ContactEditor (this.store, this.edit_contact_actions);
- this.editor.linked_button.clicked.connect (linked_accounts);
- this.editor.remove_button.clicked.connect (delete_contact);
- this.contact_editor_page.add (this.editor);
-
- /* enable/disable actions*/
- var birthday_action = this.edit_contact_actions.lookup_action ("add.birthday") as SimpleAction;
- this.editor.bind_property ("has-birthday-row",
- birthday_action, "enabled",
- BindingFlags.SYNC_CREATE |
- BindingFlags.INVERT_BOOLEAN);
-
- var nickname_action = this.edit_contact_actions.lookup_action ("add.nickname") as SimpleAction;
- this.editor.bind_property ("has-nickname-row",
- nickname_action, "enabled",
- BindingFlags.DEFAULT |
- BindingFlags.SYNC_CREATE |
- BindingFlags.INVERT_BOOLEAN);
-
- var notes_action = this.edit_contact_actions.lookup_action ("add.notes") as SimpleAction;
- this.editor.bind_property ("has-notes-row",
- notes_action, "enabled",
- BindingFlags.DEFAULT |
- BindingFlags.SYNC_CREATE |
- BindingFlags.INVERT_BOOLEAN);
- }
-
private void show_contact_sheet () {
assert (this.contact != null);