[gnome-contacts] Make it possible to not send changes when selecting contact



commit e62c84ae3387dec6a1ba8d694f216565c1d4b121
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Aug 29 15:16:02 2011 +0200

    Make it possible to not send changes when selecting contact

 src/contacts-list-pane.vala |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/contacts-list-pane.vala b/src/contacts-list-pane.vala
index 0b1cd9c..3c02448 100644
--- a/src/contacts-list-pane.vala
+++ b/src/contacts-list-pane.vala
@@ -28,6 +28,7 @@ public class Contacts.ListPane : Frame {
   private uint filter_entry_changed_id;
   private ulong non_empty_id;
   private EventBox empty_box;
+  private bool ignore_selection_change;
 
   public signal void selection_changed (Contact? contact);
   public signal void create_new ();
@@ -121,7 +122,8 @@ public class Contacts.ListPane : Frame {
 
     list = new ViewWidget (contacts_view);
     list.selection_changed.connect( (l, contact) => {
-	selection_changed (contact);
+	if (!ignore_selection_change)
+	  selection_changed (contact);
       });
 
     scrolled.add (list);
@@ -186,7 +188,10 @@ public class Contacts.ListPane : Frame {
 
   }
 
-  public void select_contact (Contact contact) {
+  public void select_contact (Contact contact, bool ignore_change = false) {
+    if (ignore_change)
+      ignore_selection_change = true;
     list.select_contact (contact);
+    ignore_selection_change = false;
   }
 }



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