[gnome-clocks] Implement snooze
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks] Implement snooze
- Date: Thu, 30 Aug 2012 16:29:19 +0000 (UTC)
commit 7d993e8e15eced9ffa03be7921141bb0b59a040f
Author: Paolo Borelli <pborelli gnome org>
Date: Thu Aug 30 18:26:54 2012 +0200
Implement snooze
gnomeclocks/alarm.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gnomeclocks/alarm.py b/gnomeclocks/alarm.py
index ca60d95..511e400 100644
--- a/gnomeclocks/alarm.py
+++ b/gnomeclocks/alarm.py
@@ -19,7 +19,7 @@
import os
import vobject
import time
-from datetime import datetime
+from datetime import datetime, timedelta
from gi.repository import GLib, GObject, Gio, Gtk, GdkPixbuf
from gi.repository import GWeather
from clocks import Clock
@@ -369,6 +369,7 @@ class Alarm(Clock):
def _check_alarms(self):
for i in self.liststore:
alarm = self.liststore.get_value(i.iter, 4)
+ print alarm.time
if alarm.check_expired():
widget = self.liststore.get_value(i.iter, 3)
alert = widget.get_alert()
@@ -526,7 +527,10 @@ class StandaloneAlarm(Gtk.Box):
self.alert.stop()
def _on_snooze_clicked(self, button):
- pass
+ # Add 9 minutes, but without saving the change permanently
+ self.alarm.time += timedelta(minutes=9)
+ self.alarm.expired = False
+ self.alert.stop()
def get_name(self):
name = self.alarm.get_alarm_name()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]