aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.c
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@nuclecu.unam.mx>1998-12-17 12:40:38 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-12-17 12:40:38 +0800
commitadac6994268794b434973701ed5f20386eed02c9 (patch)
treec611807515f7815b4d5ac8a7be5069b2bf012461 /calendar/gui/gnome-cal.c
parent52f6c4b4fe2c9ed4bed484b9e9d20a378275de61 (diff)
downloadgsoc2013-evolution-adac6994268794b434973701ed5f20386eed02c9.tar
gsoc2013-evolution-adac6994268794b434973701ed5f20386eed02c9.tar.gz
gsoc2013-evolution-adac6994268794b434973701ed5f20386eed02c9.tar.bz2
gsoc2013-evolution-adac6994268794b434973701ed5f20386eed02c9.tar.lz
gsoc2013-evolution-adac6994268794b434973701ed5f20386eed02c9.tar.xz
gsoc2013-evolution-adac6994268794b434973701ed5f20386eed02c9.tar.zst
gsoc2013-evolution-adac6994268794b434973701ed5f20386eed02c9.zip
Rewrote the old and broken alarm system. It never actually worked
1998-12-16 Miguel de Icaza <miguel@nuclecu.unam.mx> Rewrote the old and broken alarm system. It never actually worked properly. Now it works properly, and I figured a nice way to get the Audio alarm do something nicer (it is now like an alarm clock :-). * gnome-cal.c (calendar_notify): Now we take a CalendarAlarm to actually distinguish which alarm was triggered. * alarm.c (alarm_ready): The code was only activating the first alarm. Reschedule the timer upon delivery of an alarm. svn path=/trunk/; revision=535
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r--calendar/gui/gnome-cal.c42
1 files changed, 36 insertions, 6 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 4468eeb483..5403fd3a94 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -338,29 +338,59 @@ mail_notify (char *mail_address, char *text, time_t app_time)
g_free (command);
}
+static void
+stop_beeping (GtkObject *object, gpointer tagp)
+{
+ guint tag = GPOINTER_TO_INT (tagp);
+
+ gtk_timeout_remove (tag);
+}
+
+static gint
+start_beeping (gpointer data)
+{
+ gdk_beep ();
+
+ return TRUE;
+}
+
void
-calendar_notify (time_t time, void *data)
+calendar_notify (time_t time, CalendarAlarm *which, void *data)
{
iCalObject *ico = data;
+ guint tag;
+
+ if (&ico->aalarm == which){
+ time_t app = ico->dalarm.trigger + ico->dalarm.offset;
+ GtkWidget *w;
+ char *msg;
+
+ msg = g_copy_strings (_("Reminder of your appointment at "),
+ ctime (&app), "`",
+ ico->summary, "'", NULL);
+
+ /* Idea: we need Snooze option :-) */
+ w = gnome_message_box_new (msg, GNOME_MESSAGE_BOX_INFO, "Ok", NULL);
+ tag = gtk_timeout_add (1000, start_beeping, NULL);
+ gtk_signal_connect (GTK_OBJECT (w), "destroy", stop_beeping, GINT_TO_POINTER (tag));
+ gtk_widget_show (w);
- if (ico->aalarm.enabled && ico->aalarm.trigger == time){
- printf ("bip\n");
return;
}
- if (ico->palarm.enabled && ico->palarm.trigger == time){
+ if (&ico->palarm == which){
execute (ico->palarm.data, 0);
return;
}
- if (ico->malarm.enabled && ico->malarm.trigger == time){
+ if (&ico->malarm == which){
time_t app = ico->malarm.trigger + ico->malarm.offset;
mail_notify (ico->malarm.data, ico->summary, app);
return;
}
- if (ico->dalarm.enabled && ico->dalarm.trigger == time){
+ if (&ico->dalarm == which){
time_t app = ico->dalarm.trigger + ico->dalarm.offset;
GtkWidget *w;
char *msg;