summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2006-11-30 14:39:10 +0000
committerFrederic Culot <calcurse@culot.org>2006-11-30 14:39:10 +0000
commitd311a8ebaf2416a39ad27d11a2896935f1fe7b9f (patch)
tree37522036a70915c77e00f88abc39239f56e3275f
parent9cfb967f30f6e47cd20b6901865f80b86c6bec91 (diff)
downloadcalcurse-d311a8ebaf2416a39ad27d11a2896935f1fe7b9f.tar.gz
calcurse-d311a8ebaf2416a39ad27d11a2896935f1fe7b9f.zip
day_edit_item() created
-rwxr-xr-xsrc/day.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/day.c b/src/day.c
index cdfd20e..baf95cc 100755
--- a/src/day.c
+++ b/src/day.c
@@ -1,4 +1,4 @@
-/* $calcurse: day.c,v 1.10 2006/10/28 13:12:30 culot Exp $ */
+/* $calcurse: day.c,v 1.11 2006/11/30 14:39:10 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -389,6 +389,42 @@ void day_popup_item(void)
return 0;
}
+/* Edit an already existing item. */
+void day_edit_item(int item_num, int colr)
+{
+ struct day_item_s *p;
+ int ch = 0;
+ char *msg_norecur =
+ _("Edit: (1)Start time, (2)End time or (3)Description?");
+ char *choice_norecur = "[1/2/3] ";
+ char *msg_recur =
+ _("Edit: (1)Start time, (2)End time, (3)Description or (4)Repetition?");
+ char *choice_recur = "[1/2/3/4] ";
+
+ p = day_get_item(item_num);
+ if (p->type == APPT || p->type == EVNT) {
+ status_mesg(msg_norecur, choice_norecur);
+ while (ch != '1' && ch != '2' && ch != '3')
+ ch = wgetch(swin);
+ } else {
+ status_mesg(msg_recur, choice_recur);
+ while (ch != '1' && ch != '2' && ch != '3' && ch != '4')
+ ch = wgetch(swin);
+ }
+ switch (ch) {
+ case '1':
+mvwprintw(swin, 0, 0, "date de debut:%d", p->start);wgetch(swin);
+ break;
+ case '2':
+ break;
+ case '3':
+ updatestring(swin, colr, &p->mesg, 0, 1);
+ break;
+ case '4':
+ break;
+ }
+}
+
/*
* In order to erase an item, we need to count first the number of
* items for each type (in order: recurrent events, events,