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.gz
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;
d-ports-graphics/commit/UPDATING?h=master&id=4b6f4ce8a380a321ff56583f70e1122281fe1f9c'>Rename editors/vim-lite to editors/vim-console. The vim-console port isn'tadamw2018-01-121-0/+14 * Document issues during the upgrade of www/qt5-webenginetcberner2018-01-101-0/+8 * Add a note about the gpg invocation from (neo)mutt changing from 2.0adamw2018-01-071-0/+18 * devel/awscli: use USE_PTYHON=noflavors, remove PKGNAMEPREFIXbhughes2018-01-021-0/+8 * - Add a note to UPDATING about recently discovered ejabberd build issueashish2017-12-301-0/+12 * dns/dnscrypt-proxy: Replace 'cisco' (OpenDNS) resolver by 'random'dbaio2017-12-231-0/+8 * Change default version of samba from 4.4 to 4.6antoine2017-12-231-0/+28 * devel/gogs: Changed user from gogs to git; Moved ini file under /usr/local/etcyuri2017-12-191-0/+19 * - Convert GUILE1 and GUILE2 options to flavors in the gnucash portmadpilot2017-12-161-0/+15 * Move the deprecated variables announcement from CHANGES to UPDATING.adamw2017-12-151-0/+20 * Add a short entry about FLAVORSadamw2017-12-061-0/+19 * Add info about recursor passthrough removal in dns/powerdnskrion2017-12-061-0/+13 * sysutils/dsbmd: update 0.4.1 -> 0.5pi2017-12-031-0/+8 * FLAVORS needs Poudriere 3.2+bdrewery2017-12-011-1/+1 * Convert Python ports to FLAVORS.mat2017-11-301-0/+14 * security/p5-openxpki[-i18n]: Update to 1.19.4dbaio2017-11-271-0/+9 * mail/sympa: update 6.2.16 -> 6.2.22pi2017-11-271-0/+8 * sysutils/zrepl: Update to 0.0.2woodsb022017-11-201-0/+13 * graphics/netpbm: Fix build with older netpbm versions installedtobik2017-11-181-12/+0 * update sysutils/terraform to 0.11.0lifanov2017-11-181-0/+9 * Note poudriere-options -p issue.bdrewery2017-11-151-0/+14 * Provide UPDATING entry for renaming of devel/oniguruma6 to devel/onigurumariggs2017-11-121-0/+18 * - Date format for UPDATING is YYYYMMDDpawel2017-11-091-1/+1 * www/node: Update 8.8.1 -> 9.0.0bhughes2017-11-081-0/+15 * security/libressl: Update to 2.6.3brnrd2017-11-071-0/+24 * www/mod_auth_cas: Update to 1.1brnrd2017-11-051-0/+9 * www/mod_rpaf2: Update to 0.8.4brnrd2017-11-051-0/+7 * Alter language bindingsadamw2017-11-011-0/+14 * Fix conflicts with emacs ctags (editors/emacs-devel, editors/emacs-nox11, edi...rodrigo2017-10-271-0/+8 * Retire WITHOUT_DEBUG flag.madpilot2017-10-151-0/+11 * Update to 7.6p1bdrewery2017-10-131-1/+16 * Fix typotobik2017-10-071-1/+1 * Provide a hint for portmaster/portupgrade/make users for dealing withtobik2017-10-061-0/+12 * Make the command rename options default. This avoids a conflict withcy2017-10-051-0/+9 * x11-wm/cwm: Update to 5.6-201-g5a46349tobik2017-10-021-0/+8 * Add a notification for users of mail/isync using Maildir sub-folders.ehaupt2017-10-021-0/+10 * Give a hint for those who strugges updating PHP aftereugen2017-09-301-0/+20 * Fix a grammar error and a typo.madpilot2017-09-291-2/+2 * Make courier-autlib ports run the sysconftool on installation, asmadpilot2017-09-291-0/+13 * Remove references to gnupg22 portadamw2017-09-201-6/+3 * Use @FreeBSD.orgsunpoet2017-09-181-2/+2 * MOVED/UPDATING: Improve cmake-modules entrieskoobs2017-09-171-5/+9 * lang/rust: Install Cargo + use bundled cratesdumbbell2017-09-161-0/+7 * Update CMake to 3.9, merge devel/cmake-modules into devel/cmakeadridg2017-09-151-0/+11 * Updated to 6.1.2, cleanup makefiles, add note in UPDATINGultima2017-09-051-0/+8 * Add gnupg22 port. GnuPG 2.2 is the new LTS stable version. gnupg20 isadamw2017-08-281-0/+13 * * Bump port revision, added emperor support to rc scriptultima2017-08-211-0/+9 * Add more detailed instructions for the dovecot rename.adamw2017-08-091-2/+14 * - Update The Glorious Glasgow Haskell Compiler to version 8.0.2tcberner2017-08-091-0/+25 * Rename dovecot2/dovecot2-pigeonhole to dovecot/dovecot-pigeonhole.adamw2017-08-081-0/+11 * Add an UPDATING note about dovecot2-antispam-plugin's removal andadamw2017-08-061-0/+10 * * Updated to 0.9.13ultima2017-08-041-0/+8