summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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>
* calcurse-caldav: Reword dry-run warningLukas Fleischer2016-02-021-3/+3
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Modernize format stringsLukas Fleischer2016-02-011-20/+21
| | | | | | Replace %-style string formatting with format(). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Make synchronization more robustLukas Fleischer2016-02-011-52/+83
| | | | | | | | | | In addition to storing ETag-hash tuples in the synchronization database, also store the URI of each object. This makes the synchronization process a bit more robust as we do not need to depend on ETags being globally unique. It also allows us to detect conflicts which occur when an object is modified locally and on the server at the same time. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Fix issues reported by pylintLukas Fleischer2016-02-011-29/+50
| | | | | | Add missing parameter to remote_query() and fix various style issues. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* po/calcurse.pot: Update message catalogLukas Fleischer2016-01-301-103/+86
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Update copyright rangesLukas Fleischer2016-01-3060-62/+62
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Fix version checkLukas Fleischer2016-01-281-1/+1
| | | | | | | Since commit 41389ab (args.c: Revise help/usage/version output, 2016-01-28), the version string starts with "calcurse" (lowercase). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix two iCal import testsLukas Fleischer2016-01-282-2/+2
| | | | | | | | When importing iCal files, VTODO entries without an priority are now imported with undefined priority (internally represented as zero), not with lowest priority 9. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix behavior of --todo with an optional argumentLukas Fleischer2016-01-285-10/+12
| | | | | | | | | | 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-282-3/+15
| | | | | | | 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-274-27/+71
| | | | | | | | | | 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>
* calcurse-caldav: Use calendar-multiget to obtain ETagLukas Fleischer2016-01-261-14/+17
| | | | | | | | Some CalDAV servers do not support calendar-query with a UID filter. Use a calendar-multiget request to obtain the ETag of submitted objects instead. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Fix property filterLukas Fleischer2016-01-261-3/+3
| | | | | | | Fix a TypeError that occurred during string formatting by putting parentheses around the multi-line string. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* git-version-gen: Do not use `echo -n`Lukas Fleischer2016-01-251-1/+1
| | | | | | | `echo -n` is non-portable and does not work under some operating systems, such as OS X. Replace it with printf. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Handle missing ETag gracefullyLukas Fleischer2016-01-251-1/+4
| | | | | | | | | | This was partly fixed by 475c341 (calcurse-caldav: Fix late retrieval of ETag, 2016-01-25). However, the case where the server does not return ETag after creating a new item still wasn't handled properly. This patch hopefully addresses this and also makes sure that the ETag header is matched case-insensitively. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Improve version checkLukas Fleischer2016-01-251-11/+7
| | | | | | Make sure that at least a current Git build of calcurse is used. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Print XML dump in debug mode onlyLukas Fleischer2016-01-251-1/+1
| | | | | | | | In die_atnode(), we currently print a full dump of the XML node if verbose mode is enabled. Change this behavior such that a dump is only created in debug mode. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* contrib/caldav/README: Minor improvementsLukas Fleischer2016-01-251-5/+5
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Fix comment on certificate checksLukas Fleischer2016-01-251-1/+1
| | | | | | Clarify that ssl._create_unverified_context() was added in Python 3.4.3. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Support custom HTTP headersLukas Fleischer2016-01-252-1/+11
| | | | | | | Add support for specifying additional HTTP headers, such as the User-Agent, in the configuration file. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Fix late retrieval of ETagLukas Fleischer2016-01-251-2/+2
| | | | | | | Fixes another regression introduced in badbd71 (calcurse-caldav: Add a debug mode, 2016-01-23). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Fix --init=keep-localLukas Fleischer2016-01-251-1/+1
| | | | | | | Fixes a regression introduced in badbd71 (calcurse-caldav: Add a debug mode, 2016-01-23). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Fix duplicate Content-Type prefixLukas Fleischer2016-01-251-2/+2
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Fix MIME type in requestsLukas Fleischer2016-01-251-1/+4
| | | | | | | Specify application/xml in the Content-Type of requests except for PUT, where we actually submit calendar data. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Show debug output before checking statusLukas Fleischer2016-01-241-5/+5
| | | | | | | Make sure we print the headers and the body of a HTTP response in debug mode, even if the HTTP status code indicates failure. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Add XML declaration to requestsLukas Fleischer2016-01-241-11/+13
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: Prefix error messages with "error:"Lukas Fleischer2016-01-231-3/+5
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>