2040 Commits

Author SHA1 Message Date
Lukas Fleischer
6e6663c5dd Release 4.7.1
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2021-04-10 16:50:32 -04:00
Lukas Fleischer
3d0cc429d9 po/: translation updates from Transifex
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2021-04-10 09:14:10 -04:00
Max Deineko
cb6b3340f8 calcurse-caldav: always request href from server
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>
2021-04-04 18:35:03 -04:00
Lukas Fleischer
5398f3a24e Call setsid() for hook/notification commands
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>
2021-04-04 12:15:31 -04:00
Lukas Fleischer
193ad3415a Redirect standard descriptors for hook/notify commands
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>
2021-04-04 12:15:31 -04:00
Lukas Fleischer
5710a8bd7f Add parameter to redirect stderr to shell_exec()
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>
2021-04-04 12:15:26 -04:00
Lukas Fleischer
f41955e491 calcurse-caldav: document Hostname and Path better
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>
2021-04-03 18:12:31 -04:00
Lukas Fleischer
be5cf3578d README.md: add build badges
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2021-04-03 18:12:31 -04:00
Lukas Fleischer
81c26f8fd5 Add GitHub Actions workflow lint_python
Run codespell, flake8, and isort for each change to one of the scripts
in contrib/.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2021-04-03 18:12:31 -04:00
Lukas Fleischer
3e8bba2fd1 Replace Travis CI with GitHub Actions configuration
Replace the Travis CI configuration with an equivalent GitHub Actions
workflow.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2021-04-03 18:12:31 -04:00
Lukas Fleischer
b36e603997 Do not use readlink(1) in tests
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>
2021-04-03 17:55:46 -04:00
Lukas Fleischer
f1e84bd18b Fix flake8 and isort warnings
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2021-04-03 17:55:46 -04:00
Lukas Fleischer
594bd62378 calcurse-caldav: improve config file error handling
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>
2021-04-03 17:55:08 -04:00
Lars Henriksen
4777c60056 Todo resort() optimization
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2021-01-31 09:55:44 -05:00
Lars Henriksen
b44307cc83 Keep a linked list sorted
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>
2021-01-16 22:37:24 -05:00
Henrik Grimler
e44613411a calcurse-caldav: allow non-ascii characters in username and password
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-12-19 13:50:46 -05:00
Tim Gates
67068c1ac3 docs: fix simple typo, mulitple -> multiple
There is a small typo in src/wins.c.

Should read `multiple` rather than `mulitple`.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-12-19 13:49:31 -05:00
Lars Henriksen
1efe24105e Improve performance of recur_prev_occurrence()
And fix item start day for prev command

Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-12-19 09:19:59 -05:00
Lars Henriksen
3599766cee Introduce macro DAY
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>
2020-12-19 09:19:59 -05:00
Lars Henriksen
0af69778b5 Fix parsing of UNTIL in iCal import
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-12-19 09:19:59 -05:00
Lars Henriksen
e3dd92ef71 Do not remove an empty note file after edit session
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-11-15 12:11:27 -05:00
Lukas Fleischer
e1b5580bdf Avoid double free on iCal import errors
Set pointers to NULL after calling free() to prevent double free on
cleanup.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-11-07 19:53:21 -05:00
Lars Henriksen
97df01b534 Return failure if import skips any item
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>
2020-11-07 19:50:23 -05:00
Lars Henriksen
d126696999 Make iCal event import independent of property ordering
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>
2020-11-07 19:50:23 -05:00
Lukas Fleischer
1e243dba90 Fix parallelized test runs
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>
2020-10-13 20:43:37 -04:00
Lukas Fleischer
d960391bd5 Release 4.7.0
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-10-12 11:16:08 -04:00
Lukas Fleischer
06ce86c600 test: indent continuation lines
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-10-12 11:16:08 -04:00
Lukas Fleischer
701f8e4fbd test: fix recur-010.sh
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>
2020-10-12 11:15:48 -04:00
Lukas Fleischer
c1b3807cb0 Update message catalog
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-10-12 11:04:10 -04:00
Lukas Fleischer
d25b9c0f37 Use dynamically allocated string in struct io_file
Avoid using fixed-size buffers and strncpy().

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-10-11 09:59:37 -04:00
Ambika Eshwar
5f47194b3b Implemented rendering of notes in events/appts as well
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-10-11 09:59:37 -04:00
Ambika Eshwar
b144b19964 Implemented rendering of notes in todo view
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-10-11 09:59:37 -04:00
Lukas Fleischer
1b40844aa3 Fix memory leak in run_hook()
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-10-11 09:59:37 -04:00
Lukas Fleischer
47fb9b740f Redesign the item deletion menu
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>
2020-10-11 09:59:37 -04:00
Lars Henriksen
95151e3f0c Add p(revious) command
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>
2020-10-11 09:59:35 -04:00
Lars Henriksen
4d9d50722a Replace 'ical_rpt_t' with 'struct rpt'
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>
2020-10-07 17:36:55 -04:00
Lars Henriksen
1cecfead43 Always exit with failure in case of option parsing errors
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-10-07 17:36:55 -04:00
Lars Henriksen
f2a7eea311 Extend icalendar export
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>
2020-08-26 07:52:08 -04:00
Lars Henriksen
e3cfca7568 Update use of note file for import
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>
2020-08-26 07:52:08 -04:00
Lars Henriksen
7b28e38d13 Improve event text for cancelled periodic save
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-07-26 10:31:34 -04:00
Lars Henriksen
7b8b7f0548 Revert "Interrupt periodic save when launching process"
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>
2020-07-26 10:31:33 -04:00
Lars Henriksen
2230525f4a Run hooks quietly
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>
2020-07-26 10:31:31 -04:00
Lars Henriksen
f743eab5ac Remove SIGCHLD signal handler
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>
2020-07-26 10:31:28 -04:00
Lukas Fleischer
41e1a89aa7 Add Lars to AUTHORS
Thanks for all the work, Lars!

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-07-19 08:19:55 -04:00
Lars Henriksen
5198638ea3 Fix configuration menu 'Quit' action
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-06-21 09:27:18 -04:00
Lars Henriksen
4ea59f23dc Improve help texts for recurrence rules
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-06-13 10:58:10 -04:00
Lars Henriksen
fb0ebe0b8a Icalendar templates for recurrence rules
To provide a starting point for advanced repeating items.

Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-06-13 10:56:15 -04:00
Lars Henriksen
5942c0760d Remove systemdialogs option from configuration
The option controls the welcome window and the export/import result messages.
The former is dropped. The latter are now always displayed unless calcurse is
invoked with the "quiet" option (-q).

Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-06-13 10:56:15 -04:00
Lars Henriksen
223f722b1d Allow repeat count input (for until) in interactive UI
Shortened repetition type text.

Avoid "duration" in until-contexts (reserve it for appointment duration):
"duration" changed to "increment" in user texts as well as source.

Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-06-13 10:56:15 -04:00
Lars Henriksen
382e60ba69 Extend import of recurrence rules
Support has been implemented for recurrence rule parts BYMONTH, BYMONTHDAY and
BYDAY.  A new test has been added.

Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2020-06-13 10:56:15 -04:00