| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Adds the -l/--limit command line option. Limits the number of appointments
and/or ToDo items displayed.
Signed-off-by: William Pettersson <william.pettersson@gmail.com>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
| |
Use following macro instead of "sizeof(x) / sizeof(x[0])" everywhere:
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
| |
This completes our switch to the Linux kernel coding style. Note that we
still use deeply nested constructs at some places which need to be fixed
up later.
Converted using the `Lindent` script from the Linux kernel code base,
along with some manual fixes.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
| |
Split date/time validation into separate functions check_date() and
check_time(). These will be used to validate date/time information when
reading items from the appointments file.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
| |
This is needed in "ui-todo.c" now.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
| |
This unit belongs to the presentation layer -- rename the file
accordingly.
Also, rename calendar_*() to ui_calendar_*().
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
* Move UI-related functions to "ui-todo.c".
* Rename UI-related functions to ui_todo_*().
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
* Move UI-related functions to "ui-day.c".
* Rename UI-related functions to ui_day_*().
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
| |
* Rename "interaction.c" to "ui-day.c" since it no longer contains
todo-related UI functions.
* Rename appointment/event-related UI functions to ui_day_*().
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
| |
* Move todo-related UI functions from "interaction.c" to a new
compilation unit "ui-todo.c".
* Rename all todo-related UI functions to todo_ui_*().
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| | |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| | |
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>
|
|/
|
|
| |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
This was broken in commit 87fb8cfec0d8e8fc901746095458bd316314b6ee. Fix
function signatures and update all invocations accordingly.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
We only call this once. Remove the wrapper and directly call the wrapped
function instead.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|\|
| |
| |
| |
| |
| | |
Conflicts:
src/day.c
src/recur.c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is kind of useless since users are not able to react to an
auto-save notification. It also causes all kinds of problems if the
status bar is in a non-standard mode (message, prompt, ...) and is prone
to race conditions if the status bar is updated by another thread at the
same time.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Remove the export bar and use a simple status_ask_choice() dialog
instead. This reduces code complexity and replaces another unnecessary
menu by the well-tested dialog feature that is used everywhere else.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This is no longer needed. Note removal, as well as exception handling,
have been moved to separate functions and the cut feature has been
merged into the deletion function.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| | |
Remove the cut function and merge it into the del-item command. This
allows for vim-style cutting/pasting.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove the exception handling code from recur_*_erase() and move it to
separate functions recur_*_add_exc(). Create a wrapper function
day_item_add_exc() that can be used to add an exception to generic
items.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Remove the note removal code from *_delete()/*_erase() and create a new
wrapper function called day_item_erase_note() that is be used to drop
the note being associated to an item.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds support for vim-style copy/paste registers which allows
cutting and copying multiple items without having to overwrite the
copy/paste buffer. Registers can be specified using the quote key ('"').
To access a register, type '"x' before a command where "x" is the name
of a register. If you want to copy the currently selected item into
register 1, type '"1c'.
Valid registers are 0-9, a-z, "-" and "_". Note that the latter is the
so-called black hole register, which works similar to the black hole
register in vim.
The register prefix key is currently hardcoded and cannot be configured.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| | |
This finally adds full copy-paste support. Implements FR#15.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| | |
This can be used to copy an item, so that it can be pasted somewhere
else later.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| | |
Add a new function that can be used to copy one day item into another,
cloning the actual item that is linked.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
* Actually duplicate an item instead of copying data only.
* Properly clone an item without a note.
* Mark *_dup() public.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| | |
Pass an item instead of passing a list item index (analogous to commit
02c90ba53a658686bad5cb5f88c555d9eef06399).
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| | |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a very simple cache, which is used to store the days that contain an
event or an appointment. This makes redrawing and browsing the calendar
panel much faster.
The cache has a size of 31 integers (which is equivalent to 124 bytes on
a 32 bit system and 248 bytes on a 64 bit system) and invalidates itself
if the current month has changed. If an item is added/changed/removed,
the cache needs to be invalidated manually by calling
calendar_monthly_view_cache_set_invalid(). Note that this will always
invalidate the whole cache, even if only one item at the last day of the
month was removed. This is a trade-off between simplicity and
efficiency.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The item type parameter/return value no longer needs to be
passed/returned to interact_day_item_{paste,cut}(), since the type
descriptor is saved when cutting an item now.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of calling type-specific duplication handlers and inserting
clones of the original items when pasting, save the generic day item and
remove the actual item from the linked list, so that it can be inserted
anywhere else later.
The cut/paste buffer is moved to the interaction unit, item-specific cut
operations are changed to remove the item from the linked list only
instead of copying and freeing it. An item is only freed if another item
is cut before the current cut/paste buffer is pasted. All paste
operations are changed and reinsert the actual item instead of creating
a clone.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| | |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
These functions get the current selection, call day_*_item() and fix the
current selection on the appointment panel, so move them where they
belong.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| | |
This is no longer used and removing it saves a few bytes per item.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
These functions operate on arbitrary items. Pull out the code that gets
the currently selected item, get the current selection when one of the
functions is called and pass it as a parameter.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
These functions operate on arbitrary items. Pull out the code that gets
the currently selected item, get the current selection when one of the
functions is called and pass it as a parameter.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Always pass an item instead of passing a date and a index. This makes
use of the NULL callback that was added with one of the previous
patches.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Change the data type of the "data" parameter from "long" to "void *" in
llist_find_*() signatures to allow for passing more complex objects.
Change all llist_find_*() invocations and callbacks accordingly.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Rename all interaction functions for the sake of consistency and add a
"interact_" prefix. Also, mark day_erase_item() static since it is not
used anywhere else.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a first step to clean up several compilation units and separate
the front end from back-end operations. All functions that require user
interaction are moved to a new compilation unit "interaction.c". Also,
following things are adjusted to the new layout:
* Make day_item_get_*() and a few other functions public, so that it can
be accessed from the new compilation unit.
* Use apoint_hilt(), todo_hilt(), etc. instead of directly accessing
static variables.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|