summaryrefslogtreecommitdiffstats
path: root/src/calcurse.c
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Add help commandLukas Fleischer2013-07-171-1/+30
| | | | | | | | | This adds a "help" command to the list of available command mode commands. You can currently type "help", followed by a topic like "add". calcurse will then try to open a file named "add.txt" in the documentation directory and display it in an external pager. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Add command promptLukas Fleischer2013-07-171-0/+12
| | | | | | | | | | This adds support for vim-style command mode. The command mode can be entered with pressing ":" (by default, the key binding is configurable). Currently, no command is supported. Support for various commands will be added later. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Fix a couple of translatable stringsLukas Fleischer2013-05-141-2/+2
| | | | | | | | * Remove space before punctuation. * Use "TODO" instead of "ToDo". * Strip some formats to make sure lines are <=80 characters wide. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Use tabs instead of spaces for indentationLukas Fleischer2013-04-141-418/+429
| | | | | | | | | | | This completes our switch to the Linux kernel coding style. Note that we still use deeply nested constructs at some places which need to be fixed up later. Converted using the `Lindent` script from the Linux kernel code base, along with some manual fixes. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Fix braces in if-else statementsLukas Fleischer2013-02-171-4/+6
| | | | | | | | | | From the Linux kernel coding guidelines: Do not unnecessarily use braces where a single statement will do. [...] This does not apply if one branch of a conditional statement is a single statement. Use braces in both branches. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* calendar.c: Rename to "ui-calendar.c"Lukas Fleischer2013-02-141-20/+20
| | | | | | | | | This unit belongs to the presentation layer -- rename the file accordingly. Also, rename calendar_*() to ui_calendar_*(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* todo.c: Split out UI-related functionsLukas Fleischer2013-02-141-33/+33
| | | | | | | * Move UI-related functions to "ui-todo.c". * Rename UI-related functions to ui_todo_*(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>