From 19290ca39aa343f046bf98d0c87181a59a0802f2 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 18 Jul 2013 12:10:25 +0200 Subject: Allow for making an appointment punctual This allows for setting an empty end time when editing an item, converting it into a punctual appointment. Signed-off-by: Lukas Fleischer --- src/ui-day.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ui-day.c b/src/ui-day.c index 08248e6..0501642 100644 --- a/src/ui-day.c +++ b/src/ui-day.c @@ -78,11 +78,16 @@ static int day_edit_duration(int start, int dur, unsigned *new_duration) unsigned hr, mn; for (;;) { + int ret; + status_mesg(msg_time, ""); - if (updatestring(win[STA].p, ×tr, 0, 1) != - GETSTRING_VALID) + ret = updatestring(win[STA].p, ×tr, 0, 1); + if (ret == GETSTRING_ESC) { return 0; - if (*timestr == '+' + } else if (ret == GETSTRING_RET) { + *new_duration = 0; + break; + } else if (*timestr == '+' && parse_duration(timestr + 1, new_duration) == 1) { *new_duration *= MININSEC; break; -- cgit v1.2.3-70-g09d2