[evolution-patches] patch for #41760



This patch makes snoozing re-use the same internal structure than the
original alarm. This was causing the snooze alarm to be removed when the
object was updated (cal_client_discard_alarm being called), thus having
a non-working snooze button.
? gui/alarm-notify/alarm-notify.gladep
? gui/dialogs/alarm-options.gladep
? gui/dialogs/alarm-page.gladep
? gui/dialogs/cal-prefs-dialog.gladep
? gui/dialogs/e-delegate-dialog.gladep
? gui/dialogs/event-page.gladep
? gui/dialogs/meeting-page.gladep
? gui/dialogs/recurrence-page.gladep
? gui/dialogs/schedule-page.gladep
? gui/dialogs/task-details-page.gladep
? gui/dialogs/task-page.gladep
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.1761
diff -u -p -r1.1761 ChangeLog
--- ChangeLog	8 May 2003 14:02:34 -0000	1.1761
+++ ChangeLog	12 May 2003 16:52:30 -0000
@@ -1,3 +1,12 @@
+2003-05-12  Rodrigo Moya <rodrigo ximian com>
+
+	Fixes #41760
+
+	* gui/alarm-notify/alarm-queue.c (create_snooze): don't add a new
+	alarm, but update the already existing one.
+	(notify_dialog_cb): make sure we don't remove the alarm if we are
+	snoozing.
+	
 2003-05-07  JP Rosevear  <jpr ximian com>
 
 	* gui/dialogs/task-page.glade: fix button conversion problem
Index: gui/alarm-notify/alarm-queue.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/alarm-queue.c,v
retrieving revision 1.38
diff -u -p -r1.38 alarm-queue.c
--- gui/alarm-notify/alarm-queue.c	26 Apr 2003 16:44:46 -0000	1.38
+++ gui/alarm-notify/alarm-queue.c	12 May 2003 16:52:31 -0000
@@ -580,8 +580,7 @@ obj_removed_cb (CalClient *client, const
 static void
 create_snooze (CompQueuedAlarms *cqa, gpointer alarm_id, int snooze_mins)
 {
-	QueuedAlarm *orig_qa, *qa;
-	CalAlarmInstance *instance;
+	QueuedAlarm *orig_qa;
 	time_t t;
 	gpointer new_id;
 
@@ -599,20 +598,9 @@ create_snooze (CompQueuedAlarms *cqa, gp
 		return;
 	}
 
-	instance = g_new (CalAlarmInstance, 1);
-	instance->auid = orig_qa->instance->auid;
-	instance->trigger = t;
-	instance->occur_start = orig_qa->instance->occur_start;
-	instance->occur_end = orig_qa->instance->occur_end;
-
-	cqa->alarms->alarms = g_slist_prepend (cqa->alarms->alarms, instance);
-
-	qa = g_new (QueuedAlarm, 1);
-	qa->alarm_id = new_id;
-	qa->instance = instance;
-	qa->snooze = TRUE;
-
-	cqa->queued_alarms = g_slist_prepend (cqa->queued_alarms, qa);
+	orig_qa->instance->trigger = t;
+	orig_qa->alarm_id = new_id;
+	orig_qa->snooze = TRUE;
 }
 
 /* Launches a component editor for a component */
@@ -707,7 +695,7 @@ notify_dialog_cb (AlarmNotifyResult resu
 	switch (result) {
 	case ALARM_NOTIFY_SNOOZE:
 		create_snooze (c->cqa, c->alarm_id, snooze_mins);
-		break;
+		return;
 
 	case ALARM_NOTIFY_EDIT:
 		edit_component (c->client, c->comp);


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