summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2013-07-18 12:10:25 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2013-07-18 12:10:25 +0200
commit19290ca39aa343f046bf98d0c87181a59a0802f2 (patch)
tree93a949157e82bd035831adb6f42c446819325049
parent2b5f891ba36aeb242a2448a9ca4ef3a4307c95de (diff)
downloadcalcurse-19290ca39aa343f046bf98d0c87181a59a0802f2.tar.gz
calcurse-19290ca39aa343f046bf98d0c87181a59a0802f2.zip
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 <calcurse@cryptocrack.de>
-rw-r--r--src/ui-day.c11
1 files changed, 8 insertions, 3 deletions
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, &timestr, 0, 1) !=
- GETSTRING_VALID)
+ ret = updatestring(win[STA].p, &timestr, 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;