aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Factor out UTF-8 code point decodingLukas Fleischer2017-08-302-16/+16
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Relocate HANDLE_KEY macrosLukas Fleischer2017-08-301-46/+44
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Implement CTRL-U in getstring()Quentin Hibon2017-08-291-1/+7
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Use nl_langinfo() for month and day namesLars Henriksen2017-08-283-35/+8
| | | | | | | | Use the locale setting to fetch the month names and abbreviated day names. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Add basic Travis CI supportLukas Fleischer2017-08-281-0/+10
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Remove extra star from recurrent appointmentsLars Henriksen2017-08-281-2/+1
| | | | | | | | | | | In the appointments panel, an appointment has a '-' to mark the time span, and the description on the following line is slightly indented. When the appointment is changed into a recurrent one, the '-' is changed to a '*', making it easily distinguishable but the description also gets a '*', thus breaking the pattern. Drop the extra '*'. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Remove some leftovers from the pastLars Henriksen2017-08-281-7/+0
| | | | | Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Rename README to README.mdLukas Fleischer2017-08-281-0/+0
| | | | | | | Make sure that the Markdown syntax already used in the README file is recognized by repository browsers such as cgit or GitHub. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Make heading in appointments panel configurableLars Henriksen2017-08-285-7/+40
| | | | | | | | Add a new configuration variable format.dayheading to set the format of the date displayed at the top of the event and appointment list. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Extend strings API for formatted datesLukas Fleischer2017-08-282-0/+22
| | | | | | | | Add two new functions string_catftime(), resp. string_strftime(), which can be used to append, resp. print, a formatted date to a dynamic string. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Make the selected day in the calendar stand outLars Henriksen2017-08-282-3/+3
| | | | | Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* ical-002: Fix broken testLukas Fleischer2017-08-281-0/+2
| | | | | | | | | | | In the expected output, the punctual appointment (lasting one second in the iCal data) was missing. The test was not failing because calcurse did not print the missing item due to a bug. This bug was fixed by 7924315 (Fix support for punctual appointments at 00:00, 2017-08-28), making the test case fail. Fix the test case as well such that everything behaves as expected again. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix support for punctual appointments at 00:00Lukas Fleischer2017-08-281-2/+3
| | | | | | | | | | | | | | When checking whether an appointment belongs to a given day in apoint_inday(), the return value was 0 if the end time of the appointment matched 00:00 on that day (because we do not want to include appointments starting on the day before and lasting until midnight). However, this means that punctual appointments at 00:00 were not included in any day. Fix the apoint_inday() logic to take this into consideration. Fixes GitHub issue #39. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Specify depth in the initial requestLukas Fleischer2017-08-281-1/+3
| | | | | | | | | | For the initial calendar-query request, set the Depth header to 1. This is required because according to RFC 4791, the depth value defaults to 0 if no header is specified. Fixes GitHub issue #38. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix empty warning box when key is already in useLars Henriksen2017-08-121-0/+2
| | | | | | | | | | | | When adding a key already in use for another action, a warning box is displayed. The text length is limited by the window width through the use of strncpy(). If the limit is exceeded, the string will have no null termination, resulting in unpredictable behaviour. A similar problem in fatalbox() is fixed as well. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix fatal error when using the help commandLars Henriksen2017-08-121-5/+6
| | | | | | | Check that an action is defined for the key. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Check for optional argument to -s optionLars Henriksen2017-08-121-0/+2
| | | | | Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Include stdarg.h when using variable argument listsLukas Fleischer2017-07-283-0/+4
| | | | | | Fixes GitHub issue #36. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix segmentation fault when changing colorsLukas Fleischer2017-07-281-3/+3
| | | | | | | | | | | | | | | | The pair_content() function can be used to retrieve a color pair. The foreground and the background color numbers are written to addresses specified by the second and third parameters. While both parameters were optional in older ncurses implementations (making it possible to pass NULL pointers if the one does not care about either foreground or background color), recent implementations seem to assume that both parameters are valid pointers. Thus, instead of passing NULL, we need to pass a pointer to a dummy variable when we do not care about the background color. Partly fixes GitHub issue #31. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix another error in the notification codeLukas Fleischer2017-02-111-1/+6
| | | | | | | | | | In addition to checking whether a recurrent item predates the current next appointment, we need to check that the actual occurrence of the item predates the current appointment as well. Fixes GitHub issue #26. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix notification of recurrent appointmentsLukas Fleischer2017-02-091-2/+8
| | | | | | | | | | | | | | | The recur_apoint_starts_before() filter function expected the second parameter to be passed by value, whereas its only caller passed the value by reference. For consistency with apoint_starts_after(), change the signature and the implementation of recur_apoint_starts_before() such that the parameter is passed by reference. Also, add a comment to the only caller of recur_apoint_starts_before() to clarify on why recur_apoint_starts_before() is used. Fixes GitHub issue #25. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Do not read past NUL character in ical_get_value()Lukas Fleischer2017-02-081-2/+2
| | | | | | | Make sure we never read beyond the end of the buffer, even if the terminating quote of a quoted string is missing. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Gracefully parse iCal parameters with colonsLukas Fleischer2017-02-074-12/+65
| | | | | | | | | | | | According to RFC 5545, iCalendar content lines can have optional parameters, which can be quoted strings containing colons (":"). Make sure that such colons are not interpreted as delimiters marking the start of the value string. Also, add a test case that covers this corner case. Reported-by: Håkan Jerning <jerning@home.se> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Release 4.2.2v4.2.2Lukas Fleischer2017-01-142-1/+6
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Update copyright rangesLukas Fleischer2017-01-1272-82/+82
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Use right diffs when synchronizingLukas Fleischer2016-12-151-8/+8
| | | | | | | | | | | Some parameters where swapped accidentally when reworking the diff computation in c8d3d87 (calcurse-caldav: Compute diffs before synchronizing, 2016-12-13) such that the synchronization functions were working with incorrect diffs since that commit. Exchange the parameters again to fix this. Reported-by: Guillaume Laurès <guillaume@lauresfamily.fr> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Fix scrambled commentLukas Fleischer2016-12-131-2/+2
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Compute diffs before synchronizingLukas Fleischer2016-12-131-31/+29
| | | | | | | | Instead of computing the objects to push/pull on-demand, use a snapshot of the synchronization database taken before the synchronization process starts. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Fix appointment importsLukas Fleischer2016-12-081-0/+1
| | | | | | | | When importing an appointment from the server, make sure we store a hash of the item in the sync DB, and not the serialized item itself. Reported-by: Guillaume Laurès <guillaume@lauresfamily.fr> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Add debug output for sync DB operationsLukas Fleischer2016-12-081-5/+17
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Avoid empty multigetLukas Fleischer2016-12-081-0/+3
| | | | | | | When there are no new objects to pull from the server, skip the import routine instead of sending a query that requests zero items. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Split object addition and removalLukas Fleischer2016-12-081-18/+34
| | | | | | | | | | | | | | Instead of performing two synchronization steps (push/pull), split the synchronization protocol into four steps: 1. Retrieve new objects from the server. 2. Delete local objects that no longer exist on the server. 3. Push new objects to the server. 4. Delete remote objects that no longer exist locally. Each of the steps is performed by a separate function. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Release 4.2.1v4.2.1Lukas Fleischer2016-10-302-1/+16
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix visible region after loading list box itemsLukas Fleischer2016-10-301-0/+1
| | | | | | | | Make sure the visible region is updated after loading items, e.g. when the users switches from the full todo list to the "uncompleted items only" view. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix listbox_fix_visible_region()Lukas Fleischer2016-10-301-22/+20
| | | | | | | | | Make sure that listbox_fix_visible_region() always updates the visible region to show the entire list if it fits into the box. Also, reuse listbox_fix_visible_region() in listbox_resize() instead of duplicating the code. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Do not start the daemon more than onceLukas Fleischer2016-10-193-3/+4
| | | | | | | | | Avoid starting multiple daemon instances if the --daemon argument is passed and the daemon is already running. Terminate the already running instance before spawning a new one instead. Suggested-by: Vlad Glagolev <scm@vaygr.net> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse.1.txt: Document --daemonLukas Fleischer2016-10-191-0/+3
| | | | | | | | Mention the --daemon command line parameter in the man page. This was forgotten when adding the flag in 6061fec (Add a --daemon command-line parameter, 2016-01-28). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Prevent segfault when all todo items are hiddenLukas Fleischer2016-10-142-21/+28
| | | | | | | | | | | | | | | | | To prevent from illegal memory access, we checked whether the list of todo items is empty before performing an interactive todo item action such as flagging or removal. However, since 1a4bf2b (Add a "hide completed" view to the todo panel, 2016-01-17), it is possible to hide completed items from the todo panel. Thus, it may occur that the todo list box is empty while the list of todo items is not. To detect such situations as well, teach todo_get_item() to return NULL if the requested item does not exist. Then, instead of checking whether the todo item list is non-empty, make sure that the item returned by todo_get_item() is non-NULL when performing an action. Reported-by: Vlad Glagolev <scm@vaygr.net> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Always use memory management wrappersLukas Fleischer2016-10-137-18/+18
| | | | | | | Use mem_*() wrappers instead of directly accessing libc functions when allocating/deallocating memory. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Prevent free-before-init of timstrVlad Glagolev2016-10-131-1/+1
| | | | | | | | 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>
* Release 4.2.0v4.2.0Lukas Fleischer2016-10-102-1/+22
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Update message catalogLukas Fleischer2016-10-101-2/+2
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Replace parse_datetime() constants by named flagsLukas Fleischer2016-10-103-5/+9
| | | | | | | 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>
* Refactor duration/end time parsingLukas Fleischer2016-10-101-35/+39
| | | | | | | 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>
* Support dates when specifying start/end timesLukas Fleischer2016-10-092-32/+33
| | | | | | | | | | 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>
* Factor out parse_datetime()Lukas Fleischer2016-10-093-25/+45
| | | | | | | | 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>
* Add support for moving items to another dayLukas Fleischer2016-10-081-11/+27
| | | | | | | | | | | | | 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>
* Refactor day_edit_time()Lukas Fleischer2016-10-011-8/+7
| | | | | | | 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>
* Automatically select new appointments/eventsLukas Fleischer2016-09-282-10/+11
| | | | | | | | 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>
* Fix out-of-bounds memory accessLukas Fleischer2016-09-284-5/+26
| | | | | | | 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>