1325 Commits

Author SHA1 Message Date
Lukas Fleischer
b30ccc6319 Merge branch 'maint' 2013-02-04 20:11:58 +01:00
Lukas Fleischer
a7944d335e Update copyright ranges
Add 2013 to the copyright range for all source and documentation files.

Reported-by: Frederic Culot <frederic@culot.org>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-02-04 20:10:14 +01:00
Michael Smith
ce22b13a4d Close key binding window when reassigning the same key
This allows for canceling a key reassignment. We cannot use a static key
here since every key could potentially be used in a binding. Instead,
just cancel if we are trying to reassign a key that has already been
used for that action before.

Signed-off-by: Michael Smith <crazedpsyc@mail4us.net>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-02-04 20:06:09 +01:00
Lukas Fleischer
d5cbe794e9 Do not prompt for a todo after adding an appointment
We effectively turned the addition of an appointment into a fall through
case by deleting the break statement during refactoring. Revert this
deletion to skip the second prompt.

Regression introduced in f2dca7de3e8b164a4b3af3d58dde2f6776bfbee6.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-02-03 09:55:52 +01:00
Lukas Fleischer
9d667e06d8 Release 3.1.3
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-02-02 17:26:11 +01:00
Lukas Fleischer
308ba7c983 Merge branch 'maint' 2013-02-02 16:39:16 +01:00
Lukas Fleischer
9a6df45c4b day_process_storage(): Remove redundant parameter
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-02-01 18:42:45 +01:00
Lukas Fleischer
93767ce29c Properly skip spaces after exception list
Skip whitespace after obtaining the list of exceptions instead of
skipping the next character unconditionally.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-02-01 18:30:30 +01:00
Lukas Fleischer
e27cf190d0 Skip start time update if prompt is canceled
See commit 217e66729a249a638863a9cc2ff93b8368cd6094 for details.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-02-01 18:24:36 +01:00
Lukas Fleischer
217e66729a Skip duration update if the prompt is canceled
Do not update an appointment's duration if the user cancels the prompt
at day_edit_duration(). Note that day_edit_duration() does not touch the
buffer if the prompt was canceled or an invalid value was entered,
resulting in the buffer variable being uninitialized in these cases.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-02-01 18:14:32 +01:00
Lukas Fleischer
6e733b98d0 Delete TODO file
This is outdated and has been migrated to the bug tracker which turned
out to be a much better way of keeping track of tickets.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-01-30 15:58:59 +01:00
Lukas Fleischer
de73d96188 Use strncasecmp() for case-insensitive comparison
Instead of converting everything to upper case and then using strncmp(),
use strncasecmp() which does case-insensitive comparison out of the box.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-01-30 15:42:08 +01:00
Lukas Fleischer
ef961f4927 Remove unused function mystrtol()
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-01-30 15:39:58 +01:00
Lukas Fleischer
efa3589f78 custom.c: Fix sidebar configuration help text
* Use a format string instead of the TOSTRING() macro.
* Remove "xgettext:no-c-format" hack and use "%%" instead.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-01-30 15:38:13 +01:00
Lukas Fleischer
2ea91e1a8a test/: Use faketime -f
Use the advanced timestamp specification format for libfaketime.

Before using that, some tests failed on 32-bit systems due to integer
overflows. It seems like faketime translates absolute dates to relative
dates by default. Moreover, libfaketime is not able to handle relative
dates that exceed the maximum value of a signed integer. Using "-f"
skips the conversion to relative dates.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-12-22 01:09:17 +01:00
Lukas Fleischer
c054182890 test/: Do not error out if libfaketime is missing
If the faketime library is missing, show a warning and skip the test.
However, do not error out to make sure the test suite is able to
terminate successfully on systems without libfaketime.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-12-22 01:06:20 +01:00
Lukas Fleischer
0cda64a234 Release 3.1.2
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-12-16 11:06:03 +01:00
Lukas Fleischer
574306ff85 do_storage(): Unset highlighted item if list is empty
Check if the appointment panel contains any items and unset the
highlight counter if it doesn't. Not doing this resulted in core dumps
if the edit command was invoked after switching to a day without any
appointments/events.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-12-16 02:27:39 +01:00
Lukas Fleischer
82942938be Display correct startup messages
These messages have been swapped accidentally during refactoring.
Regression introduced in 691f8a6015bafcf6ed4f99a3649d428fb7a8e915.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-12-16 02:27:39 +01:00
Lukas Fleischer
e492ac6f95 Add hidden key handler window
After BUG#6 had apparently been closed with the screen locks introduced
in commit a80f8dcf2c6eb3b54658218bc081ee9694204dd5, some people still
had problems with random characters appearing in the notification bar.
This was obviously caused by wgetch() refreshing the screen if the
status panel was changed. From wgetch(3):

    If the window is not a pad, and it has been moved or modified since
    the last call to wrefresh, wrefresh will be called before another
    character is read.

Since the wgetch(3) isn't thread-safe, there were race conditions
between the notification bar thread drawing to the notification bar and
wgetch() updating the screen. Introduce a (hidden) window that handles
all key presses and never gets changed in order to avoid this.

Also, call wins_wrefresh() explicitly in status_mesg(), since we can no
longer rely on wgetch() updating windows automatically.

Fixes reopened BUG#6. Note that this is a hotfix -- FR#26 has been
opened to ensure we fix this properly in the next major release.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-12-16 02:27:36 +01:00
Lukas Fleischer
aa7844942e Release 3.1.1
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-12-06 22:01:48 +01:00
Lukas Fleischer
64662ff2ce Fix two enumeration types in function signatures
Spotted with clang and "-Wconversion".

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-12-06 20:41:19 +01:00
Lukas Fleischer
db51503b64 keys.c: Remove several unneeded assertions
Seen when compiling with clang and "-Wtautological-compare".

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-12-06 20:32:41 +01:00
Lukas Fleischer
599b01b06d wins_show(): Fix size of the slave window array
The slave window array was just big enough to hold a single element,
whereas two elements are written/accessed. Fix this off-by-one error in
the array declaration.

Note that this messed up the panel layout when using clang as a
compiler.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-12-06 20:20:30 +01:00
Lukas Fleischer
36a447b8b9 Release 3.1.0
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-12-05 16:04:11 +01:00
Lukas Fleischer
0f8fe2cf40 io_load_keys(): Skip legacy entry
This binding was used pre-3.1.0. Simply ignore it and avoid showing a
needlessly complicated error message.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-12-05 16:02:04 +01:00
Lukas Fleischer
db8886a34c keys_save_bindings(): Skip unset key bindings
Saving unset key bindings currently results in a segmentation fault or
invalid key specifiers being stored. Skip these entries to avoid this.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-12-05 15:57:29 +01:00
Lukas Fleischer
a9cbf27536 po/: Translation updates from Transifex
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-12-05 12:28:55 +01:00
Lukas Fleischer
c6b5da3e16 test/Makefile.am: Add missing files to EXTRA_DIST
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-12-05 00:16:46 +01:00
Lukas Fleischer
a91fd72641 Merge branch 'maint' 2012-11-29 11:34:00 +01:00
Lukas Fleischer
8ae75f3ca7 Ignore signals during command execution
Disable signal handlers in wins_prepare_external() and reactivate them
in wins_unprepare_external().

Before, it was possible that resizing the window during editor/pager
mode resulted in the calcurse main screen appearing on top.

Addresses BUG#9.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-28 21:49:02 +01:00
Lukas Fleischer
db2df835da run-test.c: Return failure if actual output is too short
We always terminated run-test when reached the end of the expected
output and returned success if actual output and expected output were
the same up to this point. This resulted in run-test always returning
successfully if the actual output was a prefix of the expected output,
even if it was a proper prefix.

Check if the expected output contains more data after string comparison
has finished to ensure we only return successfully if both outputs are
actually equal.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-26 20:34:36 +01:00
Lukas Fleischer
0715a4433c test/: Add a couple of tests for recurrent items
This adds tests for following features/scenarios:

* Recurrent appointments and events of all (repetition) types.
* Recurrent appointments with a duration of more than 24 hours.
* Overlapping recurrent appointments.
* Recurrent items and leap years.
* Recurrent items with an end date.
* Recurrent items with exceptions.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-26 20:23:05 +01:00
Lukas Fleischer
4e28e8a9cc Merge branch 'maint' 2012-11-26 02:04:29 +01:00
Lukas Fleischer
7f16e1c1d3 day.c: Fix weekly view
Calculate busy slices correctly if (recurrent) appointments with a
duration of more than 24 hours are used.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-26 02:04:19 +01:00
Lukas Fleischer
9a6b875b1d io_check_*()/io_file_exist(): Fix signatures
This was broken in commit 87fb8cfec0d8e8fc901746095458bd316314b6ee. Fix
function signatures and update all invocations accordingly.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-26 01:49:04 +01:00
Lukas Fleischer
225a310de1 po/: Add Makevars
Add project-specific gettext settings to "po/Makevars". Also, remove the
"AM_XGETTEXT_OPTION" autoconf macro and use "XGETTEXT_OPTIONS" Makevars
instead.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-26 01:46:56 +01:00
Lukas Fleischer
8c60b0fdd9 autogen.sh: Add missing autopoint(1) command
autopoint(1) is needed to create the gettext infrastructure. This was
forgotten in 7e7987575a4d5228137dba649813307c381c5034.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-26 01:44:09 +01:00
Lukas Fleischer
87fb8cfec0 io.c: Several minor simplifications
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-25 18:41:47 +01:00
Lukas Fleischer
4871ae8e65 args.c: Several minor simplifications
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-25 18:41:44 +01:00
Lukas Fleischer
69d79b1c63 Replace switch block in layout calculation
Remove the huge layout switch block and use simple calculations instead.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-25 18:39:01 +01:00
Lukas Fleischer
4d0c095947 Add compact panels support
Add a configuration option that allows for switching to compact panel
mode. In this mode, all window labels are hidden, so that there's more
space for actual information.

This patch doesn't add a configuration menu entry and doesn't add any
documentation.

Implements FR#7.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-25 18:33:29 +01:00
Lukas Fleischer
edf3903ac8 Avoid core dump if window is too small
Avoid setting the maximum number of items to a negative number (which
eventually results in a core dump).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-25 18:30:10 +01:00
Lukas Fleischer
660eef88e4 Add configuration option to set a default panel
This allows for customizing the panel that is selected by default when
calcurse is started.

Note that this patch doesn't add any documentation. Also, this
configuration option currently cannot be configured using the
configuration menu.

Implements FR#19.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-25 18:13:37 +01:00
Lukas Fleischer
69b5293c87 Remove wins_slctd_init()
We only call this once. Remove the wrapper and directly call the wrapped
function instead.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-25 18:07:40 +01:00
Lukas Fleischer
b4bd37902a calcurse.pot: Update message catalog
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-23 22:51:07 +01:00
Lukas Fleischer
535e9b6c0b io_load_*(): Add line numbers to error messages
Currently, error messages for (syntax) errors do not contain any line
number information. Add the file name and line number to allow users for
easily locating any errors in the corresponding data files.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-23 22:29:54 +01:00
Lukas Fleischer
1f0f05ecc1 Merge branch 'maint'
Conflicts:
	src/day.c
	src/recur.c
2012-11-23 19:03:57 +01:00
Lukas Fleischer
0ea23c24bf Release screen mutex if thread dies
We did not setup a thread cleanup procedure which resulted in calcurse
freezing if a thread tried to draw on the screen after another thread
was canceled while locking the screen.

Note that this kind of cleanup handlers should be added to other mutexes
as well. This patch just removes the most common case of triggering a
deadlock.

Also note that we cannot move pthread_cleanup_push() and
pthread_cleanup_pop() into the locking/unlocking functions since both
pthread_cleanup_push() and pthread_cleanup_pop() may be implemented as
macros that must be used in pairs within the same lexical scope.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-23 11:12:08 +01:00
Lukas Fleischer
a80f8dcf2c Lock screen when drawing on the calendar/notification panel
Lock the screen if either the calendar panel or the notification bar is
updated to avoid race conditions.

Addresses BUG#6.

Note that we currently always use a screen-level lock, even if only one
window is affected. This is to be changed in the future.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-23 11:12:08 +01:00