[gnome-contacts] Window: fixed bug when calling set_list_pane twice



commit e0389920fa0ec2c88c073d8518f48dfbf6a41e39
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Wed May 28 23:31:54 2014 -0400

    Window: fixed bug when calling set_list_pane twice
    
    Moved ListPane signal hooking to Window::set_list_pane method

 src/contacts-window.vala |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/src/contacts-window.vala b/src/contacts-window.vala
index 0903ea8..a659b3c 100644
--- a/src/contacts-window.vala
+++ b/src/contacts-window.vala
@@ -122,11 +122,25 @@ public class Contacts.Window : Gtk.ApplicationWindow {
   }
 
   public void set_list_pane () {
+    /* FIXME: if no contact is loaded per backend, I must place a sign
+     * saying "import your contacts/add online account" */
+    if (list_pane != null)
+      return;
+
     list_pane = new ListPane (store);
     list_pane.selection_changed.connect (list_pane_selection_changed_cb);
     list_pane.link_contacts.connect (list_pane_link_contacts_cb);
     list_pane.delete_contacts.connect (list_pane_delete_contacts_cb);
 
+    list_pane.contacts_marked.connect ((nr_contacts) => {
+       if (nr_contacts == 0) {
+         left_title = _("Select");
+       } else {
+         left_title = ngettext ("%d Selected",
+                                "%d Selected", nr_contacts).printf (nr_contacts);
+       }
+      });
+
     left_pane_size_group.add_widget (list_pane);
     left_pane_size_group.remove_widget (loading_box);
     loading_box.destroy ();
@@ -230,15 +244,6 @@ public class Contacts.Window : Gtk.ApplicationWindow {
       left_toolbar.decoration_layout = tokens[0];
     }
 
-    list_pane.contacts_marked.connect ((nr_contacts) => {
-       if (nr_contacts == 0) {
-         left_title = _("Select");
-       } else {
-         left_title = ngettext ("%d Selected",
-                                "%d Selected", nr_contacts).printf (nr_contacts);
-       }
-      });
-
     select_button.toggled.connect (() => {
        activate_selection_mode (select_button.active);
       });


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]