aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Fix key binding paginationLukas Fleischer2016-09-271-5/+18
| | | | | | | | | | Do not create an empty key bindings page if the number of bindings is a multiple of the number of slots per page. Also, add comments to explain the computation. Reported-by: Kevin Wang <kevin.wang2004@hotmail.com> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Stop all threads before leaving curses modeLukas Fleischer2016-09-131-2/+4
| | | | | | | This prevents from notification bar artifacts being drawn after leaving interactive mode. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Avoid starting the notification thread twiceLukas Fleischer2016-08-241-0/+3
| | | | | | | | | | | | | Starting the notification thread more than once can result in strange behavior. For example, when launching external commands, only the most recently started thread is stopped which results in the external command's screen output being overwritten by the notification bar. Currently, there are a couple of situations where the thread is started twice. As a first countermeasure, explicitly check whether the thread is already running (and terminate it) before starting a new one. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Remove duplicate code in draw_monthly_view()Lukas Fleischer2016-06-271-35/+22
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Highlight days with non-recurrent itemsLukas Fleischer2016-06-272-14/+25
| | | | | | | | Use a different color for days with non-recurrent items in the calendar panel. This makes it possible to easily spot days that actually contain appointments. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Encode the request body in UTF-8Lukas Fleischer2016-06-181-0/+3
| | | | | | | | | When a string is passed to HTTPConnection.request(), it is automatically ISO 8859-1 encoded. Therefore, since we already specify UTF-8 as character set in the headers, we need to UTF-8 encode the request body manually. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Release 4.1.0v4.1.0Lukas Fleischer2016-04-122-1/+44
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* po/: Translation updates from TransifexLukas Fleischer2016-04-11227-2049/+1620
|
* po/calcurse.pot: Update message catalogLukas Fleischer2016-04-021-4/+5
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Support relative dates when adding recurrencesLukas Fleischer2016-04-011-13/+31
| | | | | | | | | | | | 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>
* Document the hooks featureLukas Fleischer2016-04-013-1/+54
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix apoint_inday() with long appointmentsLukas Fleischer2016-03-281-1/+2
| | | | | | | Fixes a regression introduced in 9e160fa (Do not assume that days always have 86400 seconds, 2016-03-27). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Do not assume that days always have 86400 secondsLukas Fleischer2016-03-278-5/+47
| | | | | | | | Make that date membership is computed correctly, even if a day has less than 86400 seconds (e.g. after changing clocks). Reported-by: Hakan Jerning <jerning@home.se> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Add proper UTF-8 support to the notification areaLukas Fleischer2016-02-261-30/+17
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Support durations in recurrence ending datesLukas Fleischer2016-02-264-34/+125
| | | | | | | 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>
* Refactor UTF-8 choppingLukas Fleischer2016-02-264-21/+36
| | | | | | | 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>
* Fix tests to match the new item orderingLukas Fleischer2016-02-184-17/+17
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* ui-day.c: Simplify code using ui_day_selitem()Lukas Fleischer2016-02-161-8/+8
| | | | | | | Use the new ui_day_selitem() utility function to retrieve the currently selected item. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Make automatic selection of appointments/events smarterLukas Fleischer2016-02-164-0/+37
| | | | | | | 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>
* Fix segmentation fault on reload with pre-load hookLukas Fleischer2016-02-151-0/+8
| | | | | | | | | | | We need to manually force a reinitialization of the todo item list box before reloading the items. Otherwise, the list box contains dangling references to the linked list of todo items which has already been cleared at this point. After the pre-load hook is called, the windows are redrawn by wins_unprepare_external() and these invalid references are accessed, leading to a segmentation fault. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Improve ordering of appointments/eventsLukas Fleischer2016-02-154-20/+63
| | | | | | | | * Order by start time first. * Order items with the same start time by priority. * Order items with the same start and priority by description. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Support format strings when dumping imported itemsLukas Fleischer2016-02-118-65/+85
| | | | | | | | | | | | | | In commit 3eae7ce (Add --list-imported command line option, 2016-01-12), we added an option to print the hashes of imported items to stdout. Extend this command line option such that it dumps the items using the specified formatting strings. With the new behavior it is, for example, easier to check items for import errors. Also, rename the option from --list-imported to --dump-imported (it is not part of any official release yet so we do not need to care about backwards compatibility). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Allow decimals in durationsLukas Fleischer2016-02-101-9/+16
| | | | | | Parse durations containing decimal numbers (such as "1.5h") gracefully. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Install calcurse-caldav by defaultLukas Fleischer2016-02-093-2/+15
| | | | | | | Add a new Makefile to build and install calcurse-caldav and include it in the top-level build process. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Improve example hooksLukas Fleischer2016-02-083-12/+55
| | | | | | | | | | | | The post-save and post-sync hooks now automatically detect whether the data directory contains a .git/ directory and skip the commit creation process if it does not. The post-save hook and the new pre-load hook now also run calcurse-caldav in the background if that script is available and the data directory contains a caldav/ directory. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix highlighting of busy days on initializationLukas Fleischer2016-02-071-0/+1
| | | | | | | Make sure that the monthly view cache is invalidated after the data files are loaded. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* hooks.c: Fix window preparation in interactive modeLukas Fleischer2016-02-071-2/+3
| | | | | | | | | | | | | | In commit 2857bac (Fix segfault when running hooks in non-interactive mode, 2016-01-16), we added checks to fix a segmentation fault in non-interactive mode. However, at the same time, that commit broke window preparation in interactive mode. When wins_prepare_external() is called, the UI mode is changed to command line, such that we cannot determine whether we need to call wins_unprepare_external() when returning from the hook. As a workaround, we now store the mode in a temporary variable. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Do not put all files under version control in example hooksLukas Fleischer2016-02-072-2/+2
| | | | | | Modify the Git hooks such they only add known data files to the index. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Add hook supportLukas Fleischer2016-02-073-0/+34
| | | | | | | | | | | Introduce pre-sync and post-sync hooks which need to be located under ~/.calcurse/caldav/hooks/ and are executed before/after synchronization with a CalDAV server. Also, add an example post-sync hook and change the example post-save hook such that it does not create tiny commits during synchronization. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix file name of the example hookLukas Fleischer2016-02-071-0/+0
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Move example hook to contrib/hooks/Lukas Fleischer2016-02-071-0/+0
| | | | | | | | The contrib/ directory now contains another script that is not directly related to hooks. Clean things up by placing example hooks in a separate subdirectory. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Use -G and %(hash) to list hashesLukas Fleischer2016-02-051-13/+7
| | | | | | | | Instead of reimplementing the code to generate object hashes in the synchronization script, use format strings to print the hashes in grep mode. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix %(hash) formatting of eventsLukas Fleischer2016-02-051-2/+2
| | | | | | Actually print the hash instead of raw object data. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>