add_item() updated to check if newly added appointment is to be notified

This commit is contained in:
Frederic Culot 2006-09-14 14:52:37 +00:00
parent ed5453bf80
commit ed73629e68

View File

@ -1,4 +1,4 @@
/* $calcurse: calcurse.c,v 1.16 2006/09/12 15:08:21 culot Exp $ */ /* $calcurse: calcurse.c,v 1.17 2006/09/14 14:52:37 culot Exp $ */
/* /*
* Calcurse - text-based organizer * Calcurse - text-based organizer
@ -36,6 +36,7 @@
#include <math.h> #include <math.h>
#include <locale.h> #include <locale.h>
#include "apoint.h"
#include "i18n.h" #include "i18n.h"
#include "io.h" #include "io.h"
#include "help.h" #include "help.h"
@ -44,7 +45,6 @@
#include "utils.h" #include "utils.h"
#include "vars.h" #include "vars.h"
#include "day.h" #include "day.h"
#include "apoint.h"
#include "event.h" #include "event.h"
#include "recur.h" #include "recur.h"
#include "todo.h" #include "todo.h"
@ -933,7 +933,7 @@ void add_item(void)
int Id; int Id;
char item_time[MAX_LENGTH]; char item_time[MAX_LENGTH];
char item_mesg[MAX_LENGTH]; char item_mesg[MAX_LENGTH];
long apoint_duration; long apoint_duration, apoint_start;
apoint_llist_node_t *apoint_pointeur; apoint_llist_node_t *apoint_pointeur;
struct event_s *event_pointeur; struct event_s *event_pointeur;
unsigned heures, minutes; unsigned heures, minutes;
@ -996,11 +996,11 @@ void add_item(void)
if (strlen(item_mesg) != 0) { if (strlen(item_mesg) != 0) {
if (is_appointment){ if (is_appointment){
// insert the appointment in list // insert the appointment in list
apoint_start = date2sec(sel_year, sel_month, sel_day,
heures, minutes);
apoint_pointeur = apoint_pointeur =
apoint_new(item_mesg, apoint_new(item_mesg, apoint_start, min2sec(apoint_duration));
date2sec(sel_year, sel_month, sel_day, notify_check_added(item_mesg, apoint_start);
heures, minutes),
min2sec(apoint_duration));
// insert the event in list // insert the event in list
} else { } else {
event_pointeur = event_new(item_mesg, date2sec( event_pointeur = event_new(item_mesg, date2sec(