aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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>
* 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-275-5/+29
| | | | | | | | 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>
* 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-115-60/+72
| | | | | | | | | | | | | | 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>
* 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>
* 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>
* Support format specifiers in grep modeLukas Fleischer2016-02-051-7/+24
| | | | | | | Honor --format-* parameters when using the -G operation. In the case of recurring items, the first occurrence is used. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Refactor grep modeLukas Fleischer2016-02-054-2/+52
| | | | | | | | | Split io_save_{apts,todo}() into functions that write raw data to a file and functions that write formatted items to stdout such that one can easily extend the grep mode for format string support in a follow-up commit. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Update copyright rangesLukas Fleischer2016-01-3037-38/+38
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix behavior of --todo with an optional argumentLukas Fleischer2016-01-281-0/+2
| | | | | | | | | | The previous behavior of --todo was to always only list uncompleted items, unless zero was specified as additional argument. Restore and document this behavior. Also, fix two tests that failed because the --todo output is now sorted. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* args.c: Revise help/usage/version outputLukas Fleischer2016-01-281-86/+33
| | | | | | | Remove obsolete options from the help text, add new options, clean everything up, cut translatable strings into atomic chunks. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Add a --daemon command-line parameterLukas Fleischer2016-01-281-3/+11
| | | | | | | When specifying --daemon, calcurse immediately forks and runs the notification daemon in the background. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Display priority todo items above regular itemsLukas Fleischer2016-01-271-0/+4
| | | | | | | | We now support todo items with undefined priority and currently display them above todo items with a strictly positive priority. Change this and always list items with a priority greater than zero first. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Support sending notifications for all appointmentsLukas Fleischer2016-01-273-24/+65
| | | | | | | | | | In 45417bc (Add configuration option to notify all appointments, 2011-07-31), we added an option that allows for choosing whether the user receives notifications only for flagged or only for unflagged appointments. Convert this setting into a three-state option and allow the user to additionally enable notifications for *all* appointments. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* sigs.c: Suppress compiler warningLukas Fleischer2016-01-261-0/+4
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Support SIGUSR1 in daemon modeLukas Fleischer2016-01-261-0/+12
| | | | | | | | | In commit 7f62fb1 (Let SIGUSR1 trigger a reload, 2014-10-10), we added support for reloading the data files by sending SIGUSR1 to an interactive calcurse process. Add the same functionality to the daemon mode. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Make automatic selection of todo items smarterLukas Fleischer2016-01-183-15/+28
| | | | | | | | * Automatically focus new todo items after adding them to the list. * Keep selection when an item is moved (e.g. by changing its priority). * Focus the next item in the list when an item is removed. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Improve ordering of todo itemsLukas Fleischer2016-01-183-4/+29
| | | | | | | | * Show uncompleted items first. * Order uncompleted and completed items by priority. * Order items with the same priority alphabetically. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Hide "0." prefix of todo items with undefined priorityLukas Fleischer2016-01-181-9/+29
| | | | | | | | In the todo panel, all uncompleted items are currently prefixed with their priorities. Drop this prefix from items with priority 0, i.e. undefined priority. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Save active view on the todo panelLukas Fleischer2016-01-183-0/+38
| | | | | | | | Add a configuration option appearance.todoview and use it to automatically save the currently active todo panel view and restore it when restarting calcurse. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Support todo items with an undefined priorityLukas Fleischer2016-01-182-13/+8
| | | | | | | In addition to priorities 1-9, support todo items without any specific priority, internally represented by priority 0. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Use a separate field for the completed statusLukas Fleischer2016-01-186-43/+40
| | | | | | | Add a new field that indicates whether a todo item is completed or not instead of encoding completed todo items by negative priorities. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Add a "hide completed" view to the todo panelLukas Fleischer2016-01-185-14/+83
| | | | | | Add a second view to the todo panel that hides all completed items. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix segfault when running hooks in non-interactive modeLukas Fleischer2016-01-161-2/+6
| | | | | | | Do not run wins_prepare_external() and wins_unprepare_external() before and after running hooks in non-interactive mode. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Run pre-save and post-save hooks on reloadLukas Fleischer2016-01-151-0/+17
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Export item UIDs upon requestLukas Fleischer2016-01-155-24/+64
| | | | | | | Add a new --export-uid command line option that adds each item's hash to the UID property when exporting. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Import data from stdin when the import file is "-"Lukas Fleischer2016-01-151-1/+4
| | | | | | | Support "-" as file name to the -i/--import option and read from stdin when that file is specified. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* ical: Handle items without an end date gracefullyLukas Fleischer2016-01-131-16/+17
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* ical: Refactor item date/time parserLukas Fleischer2016-01-131-10/+8
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Reimplement ical_unformat_line() using dynamic stringsLukas Fleischer2016-01-131-22/+10
| | | | | | | Use the new dynamic string utility functions instead of relying on a fixed-size buffer. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* ical: Export completed todo items properlyLukas Fleischer2016-01-131-3/+6
| | | | | | | Do not skip completed todo items when exporting to an iCal file. Instead, mark them as "STATUS:COMPLETED". Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* ical: Honor completed status of todo itemsLukas Fleischer2016-01-131-0/+5
| | | | | | | When importing todo items from an iCal file, mark completed items as completed. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Hide import statistics in quiet modeLukas Fleischer2016-01-131-1/+1
| | | | | | | | Do not show the import summary when system dialogs are disabled or when the --quiet option is specified, even if calcurse is executed in non-interactive mode. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Add --list-imported command line optionLukas Fleischer2016-01-135-26/+66
| | | | | | | When this option is used together with -i/--import, the object identifiers of imported objects are printed to stdout. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Add command line option to suppress dialogsLukas Fleischer2016-01-136-6/+20
| | | | | | | Implement a -q/--quiet command line option to disable system dialogs temporarily. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Implement filter modeLukas Fleischer2016-01-131-4/+8
| | | | | | | Add a new -F mode that is identical to -G but writes the result back to the calcurse data files instead of stdout. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Add an option to filter by object hashLukas Fleischer2016-01-137-8/+91
| | | | | | | | | Implement a new --filter-hash option to filter by object identifiers. Each object having an identifier that has the specified pattern as a prefix is matched. Patterns starting with an exclamation mark (!) are interpreted as negative patterns. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Add long format specifiers "raw" and "hash"Lukas Fleischer2016-01-136-5/+114
| | | | | | | Add new format specifiers to print the raw item representation or an object's hash value. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Implement recur_{apoint,event}_tostr()Lukas Fleischer2016-01-132-27/+53
| | | | | | | Add functions to serialize recurrent items without immediately writing them to stdout. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Implement {apoint,event,todo}_tostr()Lukas Fleischer2016-01-134-18/+54
| | | | | | | Add functions to serialize non-recurrent objects without immediately writing them to stdout. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>