aboutsummaryrefslogtreecommitdiffstats
path: root/src/calcurse.c
Commit message (Collapse)AuthorAgeFilesLines
* Run pre-load hook before testing for modificationsLukas Fleischer2018-05-231-0/+4
| | | | | | | | | | | The pre-load hook is often used to manipulate the data files before loading, such as by synchronizing with a remote calendar. Make sure we always execute the pre-load hook upon reloads, even if the data files have not been modified. Fixes GitHub issue #98. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Remove unused argument from wins_other_status_pageLars Henriksen2017-11-031-1/+1
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Only reload if data files were changedLukas Fleischer2017-09-081-5/+6
| | | | | | | | Instead of blindly reloading data in io_reload_data(), compare the stored hashes of the data files with hashes of the current file contents and only reload if any of the hashes differs. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Rename keys_getch() to keys_get()Lukas Fleischer2017-08-301-1/+1
| | | | 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>
* Update copyright rangesLukas Fleischer2017-01-121-1/+1
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Automatically select new appointments/eventsLukas Fleischer2016-09-281-2/+0
| | | | | | | | 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-281-1/+10
| | | | | | | 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>
* Make automatic selection of appointments/events smarterLukas Fleischer2016-02-161-0/+4
| | | | | | | 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>
* Support format strings when dumping imported itemsLukas Fleischer2016-02-111-1/+1
| | | | | | | | | | | | | | 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>
* 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>
* Update copyright rangesLukas Fleischer2016-01-301-1/+1
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Add a "hide completed" view to the todo panelLukas Fleischer2016-01-181-0/+6
| | | | | | Add a second view to the todo panel that hides all completed items. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Export item UIDs upon requestLukas Fleischer2016-01-151-2/+2
| | | | | | | 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>
* Add --list-imported command line optionLukas Fleischer2016-01-131-1/+1
| | | | | | | 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-131-1/+1
| | | | | | | Implement a -q/--quiet command line option to disable system dialogs temporarily. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Reset status page when opening configurationLukas Fleischer2016-01-101-0/+1
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Make the generic-credits key binding work againLukas Fleischer2015-04-151-0/+8
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Show an error message on missing documentationLukas Fleischer2015-04-151-1/+2
| | | | | | | Show a warning when the user presses the generic-help binding and the main help document is not available. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Make "Add Item" work from the calendar panelLukas Fleischer2015-02-231-0/+1
| | | | | | | Support the "Add item" key binding in the calendar panel and make it add a new appointment. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Update copyright rangesLukas Fleischer2015-02-071-1/+1
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Let SIGUSR1 trigger a reloadTim Hentenaar2014-10-101-0/+5
| | | | | | | | | | | | | In an effort to better integrate the import process with external applications, it's desirable to have a mechanism by which external programs can trigger a reload of calcurse's data. This patch adds that functionality via SIGUSR1. The reload request is handled in the main loop. When the user is currently entering data, the request is delayed until the main loop is re-entered. Signed-off-by: Tim Hentenaar <tim@hentenaar.com> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Factor out item reload codeLukas Fleischer2014-10-101-92/+1
| | | | | | | Adds a new function io_reload_data() which can be used to reload all appointments and TODO items. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Add io_load_data() wrapperLukas Fleischer2014-10-101-4/+2
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Allow for filtering TODO itemsLukas Fleischer2014-08-061-2/+2
| | | | | | | | | | | The item filters now apply to both appointments and TODO items. Also, add a new type mask "todo" and the following new filter options: * --filter-priority * --filter-completed * --filter-uncompleted Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Add item filtersLukas Fleischer2014-08-061-2/+2
| | | | | | | | | | | | | | | | | This adds the following filter options that allow for restricting the set of items that are read from the appointments file: * --filter-type * --filter-start-from * --filter-start-to * --filter-start-after * --filter-start-before * --filter-end-from * --filter-end-to * --filter-end-after * --filter-end-before Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Set default panel before showing system dialogsLukas Fleischer2014-08-031-1/+1
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Show system dialog after reloading itemsLukas Fleischer2014-07-281-0/+8
| | | | | Suggested-by: HÃ¥kan Jerning <jerning@home.se> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Replace several uses of snprintf() by asprintf()Lukas Fleischer2014-07-221-25/+18
| | | | | | | | 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>
* Do not use malloc() or xmalloc()Lukas Fleischer2014-07-181-4/+4
| | | | | | | Use mem_malloc() instead which automatically picks the right implementation depending on whether memory debugging is enabled or not. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Pause notification thread when reloading itemsLukas Fleischer2014-07-171-0/+6
| | | | | | | Prevent the notification thread from accessing data structures for appointments and todo items while we are recreating them. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Only run the merge tool on files with differencesLukas Fleischer2014-07-171-7/+15
| | | | | | | If the backup file and the data file are equal, there is no need to run the merge tool. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Refactor wins_launch_external()Lukas Fleischer2014-07-161-4/+7
| | | | | | | | Allow for passing an arbitrary number of arguments. This also allows us to remove wins_launch_external2() and use wins_launch_external() at all call sites instead. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Allow for merging data files when reloadingLukas Fleischer2014-07-161-5/+48
| | | | | | | | This allows for merging the (unsaved) items with the items from the data files when invoking the reload operation. To this end, an external merge tool (defaults to vimdiff) is used. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Warn when reloading with unsaved modificationsLukas Fleischer2014-07-161-0/+9
| | | | | | | Since the reload operation overwrites all changes, warn before reloading if there are unsaved modifications. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Add a key binding to reload appointments and todosLukas Fleischer2014-07-161-0/+27
| | | | | | | This allows for reloading the appointment and todo item files without having to restart calcurse. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Initialize linked list for recurrent itemsLukas Fleischer2014-07-161-0/+1
| | | | | | | | | | When switching to the generic linked list implementation for recurring events in 9fab248 (Use generic lists for recurring apointments and events., 2011-04-16), no initialization routine for the list of recurring events was added. Fix this and properly initialize the list on startup. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Load todo items on startupLukas Fleischer2014-07-091-0/+2
| | | | | | | Reload (and show) items into the list box after reading data files. Reported-by: BARE Willy sprl <barewillysprl@euphonynet.be> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Resize panels properlyLukas Fleischer2014-05-191-1/+1
| | | | | | | Rewrite the panel resize code and remove the code that reinitializes the caption and the selected item when the window is resized. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* ui-day: Large-scale refactoringLukas Fleischer2014-05-181-78/+48
| | | | | | | | | | 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>
* ui-todo: Large-scale refactoringLukas Fleischer2014-05-181-37/+15
| | | | | | | This is a complete overhaul of the TODO list user interface. The new implementation uses the generic list box panel. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Redraw screen if command prompt is canceledLukas Fleischer2013-08-131-1/+2
| | | | | | | | | When pressing escape or entering an empty command, we returned from key_generic_cmd() without updating the screen. Fix this by creating a cleanup section at the bottom of key_generic_cmd() and jump to that section when the command prompt is cancelled. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Add write and quit commandsLukas Fleischer2013-07-181-3/+26
| | | | | | | | | | | | | | This adds following vim-style commands to the command mode: * write * w * quit * q * wq Commands can be suffixed with a "!" to force execution. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* key_generic_help(): Use display_help()Lukas Fleischer2013-07-181-1/+1
| | | | | | | | Now that we moved the online help code into a separate function, use that to display the introduction help page when pressing the generic help key binding. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Split online help code into a separate functionLukas Fleischer2013-07-181-100/+1
| | | | | | | Reintroduce help.c and move the online help code into a new function display_help(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Rename io_file_exist{,s}()Lukas Fleischer2013-07-171-3/+3
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Add several help topic aliasesLukas Fleischer2013-07-171-8/+92
| | | | | | | Add aliases and choose the right help topic if the user requests help on a key binding or a key binding label. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Allow for getting help on key bindingsLukas Fleischer2013-07-171-0/+8
| | | | | | | | | In addition to getting help on specific topics, users can type things like ":help s" or ":help ^A" to get help on specific key bindings now. Note that we do not add help texts for these keys here -- we will alias key bindings to already existing topics in a follow-up patch. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Drop legacy online help systemLukas Fleischer2013-07-171-2/+1
| | | | | | | | | | Remove the old online help system and change the generic help key to do the same thing as ":help". This also removes some context-sensitive help. We should think about re-adding support for this later. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Add introduction to the new online help systemLukas Fleischer2013-07-171-0/+3
| | | | | | | | This adds a very basic explanation of the new help command that can be displayed using ":help intro". This introduction is also added as default page so that users can simply type ":help" instead. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>