summaryrefslogtreecommitdiff
path: root/src/ui-day.c
AgeCommit message (Collapse)Author
2017-01-12Update copyright rangesLukas Fleischer
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-10-13Prevent free-before-init of timstrVlad Glagolev
Fixes a crash when editing the repetition of an appointment and passing an empty repetition value. Signed-off-by: Vlad Glagolev <scm@vaygr.net> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-10-10Replace parse_datetime() constants by named flagsLukas Fleischer
Remove the magic constants used in the return value of parse_datetime() and use named flags instead. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-10-10Refactor duration/end time parsingLukas Fleischer
Replace all remaining invocations of parse_time() by parse_datetime() which now indicates whether a date was supplied or not. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-10-09Support dates when specifying start/end timesLukas Fleischer
Add support for combined date/time or date-only strings when specifying the start or end time of a new item. This is a follow-up to 1f39b5c (Add support for moving items to another day, 2016-09-30). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-10-09Factor out parse_datetime()Lukas Fleischer
Create a new function that takes a time stamp and updates the date or time components of that time stamp according to a given date/time string. Use that function for updating the start time of an item. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-10-08Add support for moving items to another dayLukas Fleischer
When moving an item (or when changing the start time of an item), allow for optionally specifying a date. If both date and time are entered, the item is updated to start on the given date and time. If only a date is entered, the item is modified to start on the given date, keeping the current start time. If only a time is entered, the item is modified to start on the current date and the new start time. Fixes GitHub issue #12. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-10-01Refactor day_edit_time()Lukas Fleischer
Make the function more flexible by returning the updated time instead of single hour and minute components. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-09-28Automatically select new appointments/eventsLukas Fleischer
This is a follow-up to commit 65b699f (Make automatic selection of appointments/events smarter, 2016-02-16). Newly created appointments and events are now selected automatically. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-09-28Fix out-of-bounds memory accessLukas Fleischer
Do not try to access freed day items. This also fixes unexpected selection changes after modifying appointments or events. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-04-01Support relative dates when adding recurrencesLukas Fleischer
In commit f5d8b5e (Support durations in recurrence ending dates, 2016-02-25), we added support for the `+xxwxxd` syntax when specifying recurrence end dates. However, this only worked when *editing* the recurrence, not when converting a regular item to a recurrent one. Fix this and support the new syntax in both cases. Also, mention the new syntax in the prompt. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-26Support durations in recurrence ending datesLukas Fleischer
When spending the end date of recurring items, allow date duration specifiers such as "+5d" or "+3w2d". Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-26Refactor UTF-8 choppingLukas Fleischer
Add a function that makes sure a string does not exceed a given display size. If the string is too long, dots ("...") are appended. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-16ui-day.c: Simplify code using ui_day_selitem()Lukas Fleischer
Use the new ui_day_selitem() utility function to retrieve the currently selected item. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-16Make automatic selection of appointments/events smarterLukas Fleischer
Keep item selection when an item is moved (e.g. by changing the start time or description). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-30Update copyright rangesLukas Fleischer
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2015-02-24Use time_t instead of long in several placesLukas Fleischer
Start converting some variables and return values to store times from long to time_t. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2015-02-07Update copyright rangesLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-07-27ui-day.c: Reorganize some free() operationsLukas Fleischer
Fixes regressions introduced in 21fc7a4 (Replace several uses of snprintf() by asprintf(), 2014-07-21). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-07-22Replace several uses of snprintf() by asprintf()Lukas Fleischer
Use asprintf() in some cold code paths. While allocating memory on the heap is a bit slower, using asprintf() is a bit more memory efficient and less prone to buffer overflow errors. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-07-16Warn when reloading with unsaved modificationsLukas Fleischer
Since the reload operation overwrites all changes, warn before reloading if there are unsaved modifications. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-07-09Do not highlight items on inactive windowsLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-06-25Fix segmentation faultLukas Fleischer
This adds some more accurate checks to avoid a segmentation fault that occurred when accessing a nonexistent item. Fixes GitHub issue #7. Reported-by: Bromind <martin.vassor@hotmail.fr> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Add default cases to some switch statementsLukas Fleischer
This squelches several compiler warnings. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Reintroduce heading and separator in appointmentsLukas Fleischer
This re-introduces the heading (showing the POM and the current date) as well as the separating line between events and appointments. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18Add support for caption rows in list boxesLukas Fleischer
This adds support for rows that cannot be selected. Such rows can be used for section headings and the like. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-18ui-day: Large-scale refactoringLukas Fleischer
Use the generic list box implementation for the appointments panel. This results in some major changes to how the items are printed. Note that this temporarily removes the heading showing the POM and the date as well as the separating line between events and appointments. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-05-13Pass date parameter to ui_day_update_panel()Lukas Fleischer
This allows for drawing appointment panels for days other than the current day. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-18Add support for moving appointmentsLukas Fleischer
This adds an edit option to change an appointment's start time without changing its duration. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-18update_start_time(): Allow for moving an itemLukas Fleischer
Add a parameter that specifies whether the duration should be updated when updating the start time of an item. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-07-18Allow for making an appointment punctualLukas Fleischer
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>
2013-05-14Fix a couple of translatable stringsLukas Fleischer
* Remove space before punctuation. * Use "TODO" instead of "ToDo". * Strip some formats to make sure lines are <=80 characters wide. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-05-14Support punctual appointments in the UILukas Fleischer
Allow for skipping the end date which means that a punctual appointment will be created. Implements FR#25. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-04-14Use tabs instead of spaces for indentationLukas Fleischer
This completes our switch to the Linux kernel coding style. Note that we still use deeply nested constructs at some places which need to be fixed up later. Converted using the `Lindent` script from the Linux kernel code base, along with some manual fixes. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-02-14ui-day.c: Several minor simplificationsLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-02-14calendar.c: Rename to "ui-calendar.c"Lukas Fleischer
This unit belongs to the presentation layer -- rename the file accordingly. Also, rename calendar_*() to ui_calendar_*(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-02-14apoint.c: Split out UI-related functionsLukas Fleischer
* Move UI-related functions to "ui-day.c". * Rename UI-related functions to ui_day_*(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-02-14Rename appointment/event-related UI functionsLukas Fleischer
* Rename "interaction.c" to "ui-day.c" since it no longer contains todo-related UI functions. * Rename appointment/event-related UI functions to ui_day_*(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>