[gnome-clocks] Alarm: Disable alarm while the user is editing it



commit 13454804a793ee75bd79a7a5cdf371da6b5816d8
Author: Volker Sobek <reklov live com>
Date:   Tue Feb 19 14:17:14 2013 +0100

    Alarm: Disable alarm while the user is editing it
    
    When the alarm editing dialog is open, the alarm being edited should
    not ring. (The dialog settings are applied to the alarm when saving, not
    instantly.)

 src/alarm.vala |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/alarm.vala b/src/alarm.vala
index 86de9ce..b1f49a4 100644
--- a/src/alarm.vala
+++ b/src/alarm.vala
@@ -454,11 +454,18 @@ public class MainPanel : Gd.Stack, Clocks.Clock {
                 Item alarm;
                 list_store.get (i, IconView.Column.ITEM, out alarm);
                 var dialog = new SetupDialog ((Gtk.Window) get_toplevel (), alarm);
+
+                // Disable alarm while editing it and remember the original active state.
+                var saved_active = alarm.active;
+                alarm.active = false;
+
                 dialog.response.connect ((dialog, response) => {
                     if (response == 1) {
                         ((SetupDialog) dialog).apply_to_alarm (alarm);
                         alarm.reset ();
                         save ();
+                    } else {
+                        alarm.active = saved_active;
                     }
                     dialog.destroy ();
                 });


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