[gnome-clocks] Resets World Clocks View when alarm rings



commit dc167c5bbbc51ec4a18aac0d4659a78eb509baca
Author: Daniel Renninghoff <daniel renninghoff gmail com>
Date:   Sat Nov 16 12:54:38 2013 +0100

    Resets World Clocks View when alarm rings
    
    When an alarm rings, the headerbar changes to the alarm tab. So, the
    world clocks view should be reset. I introduced a new method to do this.
    Fixes bug 700997
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700997

 src/window.vala |    1 +
 src/world.vala  |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/window.vala b/src/window.vala
index 9df49c8..9927a0b 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -87,6 +87,7 @@ public class Window : Gtk.ApplicationWindow {
         });
 
         ((Alarm.MainPanel)panels[PanelId.ALARM]).ring.connect ((w) => {
+            ((World.MainPanel)panels[PanelId.WORLD]).reset_view ();
             stack.visible_child = w;
         });
 
diff --git a/src/world.vala b/src/world.vala
index 3436c3b..63323ed 100644
--- a/src/world.vala
+++ b/src/world.vala
@@ -421,6 +421,10 @@ public class MainPanel : Gtk.Stack, Clocks.Clock {
         return content_view.escape_pressed ();
     }
 
+    public void reset_view () {
+        visible_child = content_view;
+    }
+
     public void update_header_bar () {
         switch (header_bar.mode) {
         case HeaderBar.Mode.NORMAL:


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