aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Backend changes for first day of weekMorgan Seltzer2021-08-076-81/+82
| | | | | | | | | | | | | Previously only Sunday and Monday were allowed for the first day of the week, and was internally treated as a binary variable. This patch changes the backend so all days are accepted, a future patch will allow users to actually select other days. Addresses GitHub feature request #321. Signed-off-by: Morgan Seltzer <MorganSeltzer000@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fixed sidebar config sometime not increasing widthMorgan Seltzer2021-08-072-1/+3
| | | | | | | | | | | | | | The sidebar has a numerical mimumum width that is statically defined, and users may set the width of the sidebar in config by incrementing the percentage of the screen between this minimum and a maximum value of 50%. However, internally the mimimum percentage could be set as low as zero, and while that did not decrease the sidebar size below the numerical minimum width, did mean that between 0 and the mimimum width increasing the percentage had no visual effect to indicate change. Now the mimimum percent is not decremented below the mimimum width. Signed-off-by: Morgan Seltzer <MorganSeltzer000@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix hook docsDhruva Sambrani2021-08-071-2/+2
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Allow configuration of appointment time formatmercurialmoon2021-04-115-8/+32
| | | | | | | | | | Added the option to configure the format in which appointment time is displayed. The setting is called "format.appointmenttime" under the general settings menu. Setting defaults to previous behavior, which was "%H:%M". Signed-off-by: mercurialmoon <mercurialmoon@protonmail.com> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Add generic-prev-view key bindingAurora2021-04-115-0/+27
| | | | | | | This can be used to cycle backwards through windows (similarly to generic-change-view). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Allow undefined actions in keys configuration fileLars Henriksen2021-04-115-252/+327
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the keys file there are three possibilities for each action: 1. One or several keys are assigned to it 2. It is marked as UNDEFINED (new) 3. It is missing from the file On load of the keys file, calcurse respectively 1. Assigns the key(s) 2. Assigns "UNDEFINED" (new) 3. Assigns a default key if possible If default keys were assigned, the user is informed of the number of actions affected, and the keys file is updated. After load each action must either have keys assigned or be undefined. If not, calcurse exits with a failure. If there are syntax/semantic errors in the file, calcurse rejects the file and exits. When an interactive user leaves the keys configuration menu, a warning is issued if any action is UNDEFINED. The keys file is always updated. Addresses GitHub issue #298. Additionally: Description of concepts and data structures used for keyboard keys and virtual keys (actions) as well as name changes and comments to improve readability. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Release 4.7.1v4.7.1Lukas Fleischer2021-04-101-0/+28
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* po/: translation updates from TransifexLukas Fleischer2021-04-1017-493/+400
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: always request href from serverMax Deineko2021-04-041-10/+12
| | | | | | | | | | | | | | | Apparently, while some CalDAV servers return href values as is in their response, some might return them URL-quoted (which, if I am not mistaken, was the reason for e943b06). Assuming either behaviour when pushing local objects will lead to discrepancy with events dictionary retrieved from the server and thus bugs, hence we always want to use whatever form of href the server returns. Addresses GitHub issues #337 and #356. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Call setsid() for hook/notification commandsLukas Fleischer2021-04-047-12/+19
| | | | | | | | | We do not want hook or notification commands to interact with the terminal in any way. Create a new session for them. Addresses GitHub issue #326. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Redirect standard descriptors for hook/notify commandsLukas Fleischer2021-04-043-26/+11
| | | | | | | | | | | | | Disconnect stdin, stdout and stderr when running an external hook or notification command. The previous solution of appending "<&- >&- 2>&-" to the shell command line does not work if the command includes pipes. Use shell_exec() in notify_launch_cmd() instead of a custom (and incomplete) reimplementation of that command. Partially addresses GitHub issue #326. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Add parameter to redirect stderr to shell_exec()Lukas Fleischer2021-04-046-18/+37
| | | | | | | Add a function parameter to allows redirecting stderr in addition to stdin and stdout. The parameter will be used with a follow-up change. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: document Hostname and Path betterLukas Fleischer2021-04-031-2/+4
| | | | | | | | | Add some clarification on the expected format for the Hostname and Path options in the sample configuration file. Addresses GitHub issues #95, #138, and #354. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* README.md: add build badgesLukas Fleischer2021-04-031-0/+3
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Add GitHub Actions workflow lint_pythonLukas Fleischer2021-04-031-0/+21
| | | | | | | Run codespell, flake8, and isort for each change to one of the scripts in contrib/. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Replace Travis CI with GitHub Actions configurationLukas Fleischer2021-04-032-23/+49
| | | | | | | Replace the Travis CI configuration with an equivalent GitHub Actions workflow. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Do not use readlink(1) in testsLukas Fleischer2021-04-033-2/+5
| | | | | | | | | | | | | Avoid using readlink(1) which is not POSIX-compatible; moreover, `readlink -f` is not available on Mac OS by default. Instead, always convert $CALCURSE to an absolute path (that may or may not be canonical, i.e., be a symlink or contain ../ as component) in test-init.sh by prepending the current working directory if the original path is relative. While not fully equivalent to `readlink -f`, this should be good enough for use in our tests. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix flake8 and isort warningsLukas Fleischer2021-04-032-6/+12
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: improve config file error handlingLukas Fleischer2021-04-031-91/+100
| | | | | | | | | | | | | | The previous implementation allowed sections and keys other than those used by the script which led to a variety of bug reports due to typos in the configuration. Disallow entries other than those explicitly used and make both section and key names case-sensitive (previously, only section names where case-sensitive). Check that Hostname and Path are set before using them. Addresses GitHub issues #327 and #350. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Todo resort() optimizationLars Henriksen2021-01-311-3/+1
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Keep a linked list sortedLars Henriksen2021-01-163-59/+148
| | | | | | | | | | | | | | | | | | | | | | | | A general linked list function, llist_reorder(), is introduced that will reorder a list after a list element has changed. Some refactoring to avoid code dupliction. Background The four linked lists of appointment panel items (appointments, recurring appointments, events, recurring events) are kept sorted by inserting elements in order, either when they are first loaded from disk or when new are added. The ordering is by start time (numerical) and description (alphabetical). The user is allowed to change start time as well as description. A change is committed directly to the list item (unlike cut/paste where an item is deleted and then inserted). This may break the order. The order property is used when events are loaded from the evenlist into the day_item vector, see LLIST_FIND_FOREACH_CONT, and when looking for the next upcoming appointment, see apoint_check_next(). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* calcurse-caldav: allow non-ascii characters in username and passwordHenrik Grimler2020-12-191-2/+2
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* docs: fix simple typo, mulitple -> multipleTim Gates2020-12-191-1/+1
| | | | | | | | There is a small typo in src/wins.c. Should read `multiple` rather than `mulitple`. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Improve performance of recur_prev_occurrence()Lars Henriksen2020-12-193-13/+19
| | | | | | | And fix item start day for prev command Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Introduce macro DAYLars Henriksen2020-12-198-39/+32
| | | | | | | DAY(t) is midnight (the day) of time_t t. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix parsing of UNTIL in iCal importLars Henriksen2020-12-191-3/+10
| | | | | Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Do not remove an empty note file after edit sessionLars Henriksen2020-11-154-21/+4
| | | | | Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Avoid double free on iCal import errorsLukas Fleischer2020-11-071-2/+13
| | | | | | | Set pointers to NULL after calling free() to prevent double free on cleanup. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Return failure if import skips any itemLars Henriksen2020-11-073-8/+13
| | | | | | | | | Other items may have been imported succesfully. Adresses Github issue #323, last part. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Make iCal event import independent of property orderingLars Henriksen2020-11-073-143/+168
| | | | | | | | | | Refactoring of ical.c: properties DTSTART, DTEND, DURATION, RRULE and EXDATE are saved and only processed after encountering END:VEVENT. Adresses Github issue #323, follow-up question. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix parallelized test runsLukas Fleischer2020-10-1314-84/+83
| | | | | | | Do not share a common temporary directory between different test cases. Reported-by: Tomasz Kłoczko <kloczko.tomasz@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Release 4.7.0v4.7.0Lukas Fleischer2020-10-124-4/+63
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* test: indent continuation linesLukas Fleischer2020-10-122-4/+4
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* test: fix recur-010.shLukas Fleischer2020-10-121-8/+15
| | | | | | | | Use mktemp(1) to create temporary directory. Copy missing todo file. Do not modify any files in tests. Simplify and make some commands more robust. Indent continuation lines. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Update message catalogLukas Fleischer2020-10-128-617/+2732
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Use dynamically allocated string in struct io_fileLukas Fleischer2020-10-112-2/+3
| | | | | | Avoid using fixed-size buffers and strncpy(). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Implemented rendering of notes in events/appts as wellAmbika Eshwar2020-10-111-4/+38
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Implemented rendering of notes in todo viewAmbika Eshwar2020-10-113-1/+33
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Fix memory leak in run_hook()Lukas Fleischer2020-10-111-4/+5
| | | | Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Redesign the item deletion menuLukas Fleischer2020-10-111-58/+66
| | | | | | | | | | | | | | | | | | | Instead of the previous inconsistent and potentially nested menus, the following message is now displayed when deleting an item: Delete (s)elected occurrence, (a)ll occurrences, or only the (n)ote? Options that are not available (e.g. because the item is not recurrent or does not have a note) are omitted. For a non-recurrent item without a note the message becomes Delete (s)elected occurrence? and is skipped if general.confirmdelete is disabled. Implements GitHub feature request #308. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Add p(revious) commandLars Henriksen2020-10-113-3/+74
| | | | | | | | | | The p(rev) command finds the previous occurrence of a recurrent item, analogous to the n(ext) command. A bug in the next command is corrected.. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Replace 'ical_rpt_t' with 'struct rpt'Lars Henriksen2020-10-071-113/+71
| | | | | | | | Refactoring and simplification only, no functional change. All error checking and logging done before call of ical_store_event/apoint(). Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Always exit with failure in case of option parsing errorsLars Henriksen2020-10-071-14/+9
| | | | | Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Extend icalendar exportLars Henriksen2020-08-264-82/+354
| | | | | | | | Export now covers advanced recurrence rules and properties imported to a note file. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Update use of note file for importLars Henriksen2020-08-268-112/+40
| | | | | | | | | | | Removes the parts of commit 'Extend use of note file for ical import' that relate to STATUS. The STATUS property is (partly) supported for todos already. Corrects insertion of a separator: always insert it before imported properties (also when there is no description). Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Improve event text for cancelled periodic saveLars Henriksen2020-07-261-1/+2
| | | | | Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Revert "Interrupt periodic save when launching process"Lars Henriksen2020-07-261-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0f3d198 (Interrupt periodic save when launching process, 2017-09-08). Stopping and starting periodic save when external/hook programs are run causes deadlocks. The periodic save thread cannot be stopped/started at will, but should be started once and run uninterrupted as long as calcurse runs. Only if the configuration parameter is changed, must the thread be stopped and possibly restarted. The reasons are - the start routine unconditionally starts a thread. - the mechanism used to detect whether a thread is running or not, is designed to be used by the main calcurse thread only and with only one running thread of each kind (the thread ID of each running thread is kept in a variable; if the thread is not running, the variable has the main thread ID as value). Any load hook will be run at the initial dataload, and the stop/start calls will start a perodic save thread (this is true for the notify thread as well). Later when threads are started, a second periodic save thread is started (for the notify thread, a running thread is stopped before restart). When hooks are run by the periodic save thread, the stop call breaks down, leading to two running save threads (if not the case already) and subsequently to a deadlock when one thread tries to stop the other. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Run hooks quietlyLars Henriksen2020-07-261-15/+20
| | | | | | | | Hooks should not be run like external programs, but like load and save operations that do not take possession of the terminal. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Remove SIGCHLD signal handlerLars Henriksen2020-07-264-19/+17
| | | | | | | | | | | | | | The purpose is to make child_wait() reliable. The handler is meant for the notify main thread, but signal handlers are shared by all threads. In the calcurse main thread and the periodic save thread (hooks) the handler and child_wait() will compete (if the signal handler kicks in first, the waitpid() call in child_wait() will fail with errno ECHILD). All child processes in the main thread, the notify thread, the periodic save thread and the notify demon are explicitly waited for. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
* Add Lars to AUTHORSLukas Fleischer2020-07-191-1/+2
| | | | | | Thanks for all the work, Lars! Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>