1569 Commits

Author SHA1 Message Date
Lukas Fleischer
25a049951c Improve ordering of todo items
* Show uncompleted items first.
* Order uncompleted and completed items by priority.
* Order items with the same priority alphabetically.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-18 18:52:24 +01:00
Lukas Fleischer
4bd8717d80 Hide "0." prefix of todo items with undefined priority
In the todo panel, all uncompleted items are currently prefixed with
their priorities. Drop this prefix from items with priority 0, i.e.
undefined priority.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-18 18:09:32 +01:00
Lukas Fleischer
1b75acf01b Save active view on the todo panel
Add a configuration option appearance.todoview and use it to
automatically save the currently active todo panel view and restore it
when restarting calcurse.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-18 18:09:23 +01:00
Lukas Fleischer
e3ac5542aa Support todo items with an undefined priority
In addition to priorities 1-9, support todo items without any specific
priority, internally represented by priority 0.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-18 18:08:45 +01:00
Lukas Fleischer
beea88e5fe Use a separate field for the completed status
Add a new field that indicates whether a todo item is completed or not
instead of encoding completed todo items by negative priorities.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-18 18:08:34 +01:00
Lukas Fleischer
1a4bf2b0a2 Add a "hide completed" view to the todo panel
Add a second view to the todo panel that hides all completed items.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-18 18:04:18 +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
6ebcbd4d69 Document new options and format specifiers
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-15 18:53:19 +01:00
Lukas Fleischer
c3648f08c7 Run pre-save and post-save hooks on reload
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-15 18:36:41 +01:00
Lukas Fleischer
caee34449c Export item UIDs upon request
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>
2016-01-15 18:25:05 +01:00
Lukas Fleischer
39a3c04144 Import data from stdin when the import file is "-"
Support "-" as file name to the -i/--import option and read from stdin
when that file is specified.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-15 08:44:57 +01:00
Lukas Fleischer
2994ea7003 ical: Handle items without an end date gracefully
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-13 18:15:59 +01:00
Lukas Fleischer
2c4a650dbe ical: Refactor item date/time parser
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-13 18:06:22 +01:00
Lukas Fleischer
56f615ffe2 Reimplement ical_unformat_line() using dynamic strings
Use the new dynamic string utility functions instead of relying on a
fixed-size buffer.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-13 17:39:44 +01:00
Lukas Fleischer
5f344e177f ical: Export completed todo items properly
Do not skip completed todo items when exporting to an iCal file.
Instead, mark them as "STATUS:COMPLETED".

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-13 17:39:44 +01:00
Lukas Fleischer
0053dd5cdc ical: Honor completed status of todo items
When importing todo items from an iCal file, mark completed items as
completed.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-13 17:39:44 +01:00
Lukas Fleischer
576784bca8 Hide import statistics in quiet mode
Do not show the import summary when system dialogs are disabled or when
the --quiet option is specified, even if calcurse is executed in
non-interactive mode.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-13 17:39:44 +01:00
Lukas Fleischer
3eae7ce828 Add --list-imported command line option
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>
2016-01-13 17:39:44 +01:00
Lukas Fleischer
c58087d591 Add command line option to suppress dialogs
Implement a -q/--quiet command line option to disable system dialogs
temporarily.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-13 17:39:44 +01:00
Lukas Fleischer
6d9129764b Implement filter mode
Add a new -F mode that is identical to -G but writes the result back to
the calcurse data files instead of stdout.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-13 17:39:44 +01:00
Lukas Fleischer
7f8c62bf57 Add an option to filter by object hash
Implement a new --filter-hash option to filter by object identifiers.
Each object having an identifier that has the specified pattern as a
prefix is matched. Patterns starting with an exclamation mark (!) are
interpreted as negative patterns.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-13 17:39:44 +01:00
Lukas Fleischer
dd85a73746 Add long format specifiers "raw" and "hash"
Add new format specifiers to print the raw item representation or an
object's hash value.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-13 17:39:44 +01:00
Lukas Fleischer
ae49ef1974 Implement recur_{apoint,event}_tostr()
Add functions to serialize recurrent items without immediately writing
them to stdout.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-13 17:39:44 +01:00
Lukas Fleischer
d118beceee Implement {apoint,event,todo}_tostr()
Add functions to serialize non-recurrent objects without immediately
writing them to stdout.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-13 17:39:44 +01:00
Lukas Fleischer
ab54c861dc Reimplement asprintf() using dynamic strings
Use the new string implementation to simplify asprintf().

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-13 17:39:44 +01:00
Lukas Fleischer
03d35bacf4 Implement utility functions for dynamic strings
Introduce support for strings which support concatenating the current
value with a printf-style formatted value, thereby growing in size
dynamically.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-13 17:39:44 +01:00
Lukas Fleischer
0b7614a4a7 Reset status page when opening configuration
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-10 22:53:04 +01:00
Lukas Fleischer
a2e3e866a6 Add pre-load and post-load hooks
Potential use case: Synchronize data with some server before loading.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-10 12:41:24 +01:00
Lukas Fleischer
626139a0b8 Add an example post-save hook
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-07 19:20:46 +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
Lukas Fleischer
ddfe49d9fe custom.c: Display missing options
Also, determine the number of displayed options on the general
configuration screen automatically (statically) instead of hard-coding
the value to prevent from future fallouts.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-07 18:42:33 +01:00
Lukas Fleischer
41b3ab7d17 Add support for --filter-end-* to events
A natural convention is to specify the end time of an event as 23:59:59
on the day it is scheduled.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2015-05-20 13:30:16 +02:00
Lukas Fleischer
794e950942 Make the generic-credits key binding work again
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2015-04-15 06:12:30 +02:00
Lukas Fleischer
dfd008717a Show an error message on missing documentation
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>
2015-04-15 06:08:32 +02:00
Lukas Fleischer
ba81d903b7 Update README and AUTHORS
* Add build instructions.
* List the current maintainer first in AUTHORS and README.
* Remove outdated information on the TODO file.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2015-04-12 19:14:15 +02:00
Lukas Fleischer
f15ac5ce09 Update maintainer email address
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2015-04-12 17:32:44 +02:00
Lukas Fleischer
776ef24075 Do not mark slice of end time busy
In weekly view, when computing busy slices, do not fill a slot that is
only hit by the end time of an appointment.

Suggested-by: Håkan Jerning <jerning@home.se>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2015-04-11 10:37:54 +02:00
Lukas Fleischer
d354a4a05d Fix range checks in day_chk_busy_slices()
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2015-04-10 16:18:38 +02:00
Lukas Fleischer
f07ef77437 Highlight week number when the calendar is selected
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2015-04-10 09:48:29 +02:00
Lukas Fleischer
7fea5451ad Show week numbers in the monthly view
Suggested-by: Håkan Jerning <jerning@home.se>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2015-04-10 09:45:04 +02:00
Lukas Fleischer
ebb8116056 Split out code for drawing week numbers
This allows for easily adding week numbers to other panel modes, such as
the monthly view.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2015-04-10 09:42:34 +02:00
Lukas Fleischer
5ac3d43e9a Fix slice computation of recurring appointments
Reported-by: Håkan Jerning <jerning@home.se>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2015-04-10 09:24:44 +02:00
Lukas Fleischer
80502f02de calcurse.1.txt: Split out filter and formatting options
Move those options into separate subsections.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2015-03-26 17:39:07 +01:00
Lukas Fleischer
90e6c61252 ical.c: Small refactoring
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2015-02-25 16:19:14 +01:00
Lukas Fleischer
8c82fc3f6d Simplify code in status_ask_choice()
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2015-02-24 14:04:30 +01:00
Lukas Fleischer
0145ba12ec Use time_t instead of long in several places
Start converting some variables and return values to store times from
long to time_t.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2015-02-24 13:57:47 +01:00
Lukas Fleischer
892d6edccd autogen.sh: Do not use sed -i
`sed -i` is not portable, use a temporary file instead.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2015-02-24 13:34:17 +01:00
Lukas Fleischer
329ef1c22a ical.c: Reduce nesting depth
Refactor the iCal parser to reduce nesting depth.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2015-02-24 11:56:55 +01:00
Lukas Fleischer
52779d2ec6 Introduce starts_with() and starts_with_ci()
Create user-defined functions to check whether a string contains a
certain prefix instead of messing around with strncmp() and
strncasecmp().

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2015-02-24 11:17:38 +01:00
Lukas Fleischer
f91208c2f4 Make "Add Item" work from the calendar panel
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>
2015-02-23 19:59:58 +01:00