[gnome-clocks/wip/vala] More fixes for disconnection



commit cf30d9f2f23def655e10886d7d1af9c3e1997c52
Author: Paolo Borelli <pborelli gnome org>
Date:   Sat Feb 16 18:54:35 2013 +0100

    More fixes for disconnection

 src/alarm.vala  |    1 +
 src/window.vala |    6 +++++-
 src/world.vala  |    2 ++
 3 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/alarm.vala b/src/alarm.vala
index 3fdd689..e95c7d1 100644
--- a/src/alarm.vala
+++ b/src/alarm.vala
@@ -452,6 +452,7 @@ public class MainPanel : Gd.Stack, Clocks.Clock {
         });
         toolbar.destroy.connect(() => {
             disconnect (id);
+            id = 0;
         });
 
         visible_child = content_view;
diff --git a/src/window.vala b/src/window.vala
index dc927a1..3c4b5ce 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -66,12 +66,16 @@ public class Window : Gtk.ApplicationWindow {
             stack.visible_child = (Gtk.Widget) c;
         });
 
-        stack.notify["visible-child"].connect (() => {
+        var id = stack.notify["visible-child"].connect (() => {
             var clock = (Clock) stack.visible_child;
             if (clock != null) {
                 clock.update_toolbar ();
             }
         });
+        toolbar.destroy.connect(() => {
+            stack.disconnect (id);
+            id = 0;
+        });
 
         alarm.ring.connect ((w) => {
             stack.visible_child = w;
diff --git a/src/world.vala b/src/world.vala
index 527ebbf..d4ef22f 100644
--- a/src/world.vala
+++ b/src/world.vala
@@ -288,6 +288,7 @@ public class MainPanel : Gd.Stack, Clocks.Clock {
         });
         toolbar.destroy.connect(() => {
             disconnect (id);
+            id = 0;
         });
 
         visible_child = content_view;
@@ -325,6 +326,7 @@ public class MainPanel : Gd.Stack, Clocks.Clock {
             if (response == 1) {
                 var location = ((LocationDialog) dialog).get_location ();
                 add_location (location);
+                save ();
             }
             dialog.destroy ();
         });


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