4 Commits

Author SHA1 Message Date
Lukas Fleischer
9f6678bc49 Update copyright ranges
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-01-12 08:40:30 +01:00
Lukas Fleischer
537b2859f2 hooks.c: Fix window preparation in interactive mode
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>
2016-02-07 13:51:35 +01:00
Lukas Fleischer
2857bac971 Fix segfault when running hooks in non-interactive mode
Do not run wins_prepare_external() and wins_unprepare_external() before
and after running hooks in non-interactive mode.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-16 14:11:32 +01:00
Lukas Fleischer
767214e4f1 Add pre-save and post-save hooks
This adds support for hooks which are executed before/after saving
calcurse data. Hooks can be placed under hooks/pre-save and
hooks/post-save in the data directory and need to be executable.

Potential use cases include:

* Automatically commit any changes to the data files using a VCS.
* Automatically sync with some sever component on data file changes.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-07 19:09:46 +01:00