| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The changes are related to the selected item and the visible lines in
the scroll window viewport.
In particular, the function listbox_fix_visible_region() has been
eliminated, and functions previously only called by it have been
removed. It performed several tasks that are now elsewhere. One was
removed in an earlier commit (scroll window pad improvement). The task
of making a multi-line item visible has been moved to
listbox_item_in_view(). The task of making a caption line above a text
line visible is listbox specific (for the ap_list) and will be moved to
ui_day_sel_move(), where it is needed.
Boundary checks for the listbox selection have been moved to
listbox_fix_sel().
For future use listbox_sel_move() returns success or failure.
The function wins_scrollwin_ensure_visible() has been renamed
wins_scrollwin_in_view().
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A scroll window consists of a pad to write on, and a window through
which to view the pad, the viewport. The pad may change in size when new
contents are loaded into the scroll window. If so, the pad size is set
with wins_scrollwin_set_linecount(). But the offset into the pad (the
top line to be displayed in the viewport) is not adjusted, although it
may not be appropriate for the new pad size. The same is the case when a
scroll window is resized and the viewport changes size. This is probably
the cause of the problem solved by commit 0b46ad4, Avoid blank space
after the last list box item, and the fix has been removed.
The wins_scrollwin_set_linecount() has been renamed
wins_scrollwin_set_pad() and sets size as well as offset. The offset is
only changed if necessary.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The introduction of hooks raised a problem with window updates. The diagnosis
in commit feb059e8 (Fix segmentation fault on reload with pre-load hook) was
right, the cure was wrong.
The problem is wins_update(), not the listbox contents. The wins_update() call
does not belong in wins_unprepare_external() (or in io_reload_data()), but at a
higher level. It should be called _after_ reload, as indeed it is in
key_generic_reload() when the listbox contents have been updated (todo as well
as appointments). The call was introduced in commit 8ae75f3 without comment.
The todo updates in io_reload_data() also belong in key_generic_reload() where
they were before commit 7f06c252.
When saving data, all panels must be updated in case a hook was executed.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a scrollbar is on display in APP or TOD windows, the right
vertical border (outside the scrollbar) is not highlighted
when the window is selected.
The scrollbar is always highlighted:
- when APP or TOD is deselected
- in configuration windows where borders otherwise are not
The patch moves the scrollbar parameters (except highlight)
from arguments of draw_scrollbar() to the function itself.
The highlight argument was 1; instead it is set higher in
the call hierarchy (wins_update_panels()) and passed on down.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In colour customization, pressing cancel ('ESC' by default) will
deselect all colours and put calcurse in no-color mode. For this
to work, all colour changes must be performed with the routines
custom_apply_attr()/custom_remove_attr(). Fixed for the getstring
cursor, the scroll window border and the week number.
In addition, the week number is unconditionally coloured as the
rest of the calendar contents whether CAL is selected or not.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a scrollbar is on display in APP or TOD windows, the right
vertical border (outside the scrollbar) is not highlighted
when the window is selected.
The scrollbar itself is always highlighted:
- when APP or TOD is deselected
- in configuration windows where borders otherwise are not
The patch moves the scrollbar parameters from arguments of
draw_scrollbar() to the function itself.
The highlight argument to draw_scrollbar() was always 1.
Instead call circumstances are figured out and highlight set
accordingly.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
| |
The window was not deleted if an "already in use"-key was detected,
and a new one was created as the loop was reentered.
Create/delete of the popup are moved outside the loop.
A redrawwin() call is needed to have the window displayed again.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
| |
To avoid interactions between the periodic save thread and external
processes, stop the periodic save thread before launching an external
program and restart the thread as soon as the program is terminated.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
| |
Do not create an empty key bindings page if the number of bindings is a
multiple of the number of slots per page.
Also, add comments to explain the computation.
Reported-by: Kevin Wang <kevin.wang2004@hotmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
| |
Add a second view to the todo panel that hides all completed items.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
Store key binding contexts using another data structure to optimize
space usage and execution time.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
| |
Split wins_status_bar() into wins_set_bindings(), wins_update_bindings()
and wins_status_bar(). This allows for using wins_set_bindings() to set
custom key bindings to be displayed.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
Store the current number of commands in a static variable and drop the
NB_*_CMDS variables which we outdated anyway.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
| |
Allow for passing an arbitrary number of arguments. This also allows us
to remove wins_launch_external2() and use wins_launch_external() at all
call sites instead.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
| |
This allows for merging the (unsaved) items with the items from the data
files when invoking the reload operation. To this end, an external merge
tool (defaults to vimdiff) is used.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
This allows for reloading the appointment and todo item files without
having to restart calcurse.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
Automatically scroll down the list box when resizing creates some blank
space below the list of items.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
Rewrite the panel resize code and remove the code that reinitializes the
caption and the selected item when the window is resized.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
This adds support for rows that cannot be selected. Such rows can be
used for section headings and the like.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
| |
Use the generic list box implementation for the appointments panel. This
results in some major changes to how the items are printed.
Note that this temporarily removes the heading showing the POM and the
date as well as the separating line between events and appointments.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
| |
Make use of the generic scroll window implementation for the calendar
view. Note that this is useful despite the panel not needing a scroll
bar, since the scroll window functions can be used to draw the panel
border and take care of relative positions.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
This is a complete overhaul of the TODO list user interface. The new
implementation uses the generic list box panel.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
This allows for drawing selected scroll windows and list boxes with a
highlighted border.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
Do not update the main windows when resizing the terminal in the general
options menu or in the notification options menu.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
| |
This complete rewrite of the scroll window implementation decouples
scroll windows from every other window abstraction layer we use. Note
that this leads to some code duplication. The long-term purpose of this
rewrite, however, is to eventually make every panel use scroll windows.
This makes for a huge cleanup of the UI code.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
This allows for drawing appointment panels for days other than the
current day.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
| |
This adds support for vim-style command mode. The command mode can be
entered with pressing ":" (by default, the key binding is configurable).
Currently, no command is supported. Support for various commands will be
added later.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
| |
* Remove space before punctuation.
* Use "TODO" instead of "ToDo".
* Strip some formats to make sure lines are <=80 characters wide.
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>
|
|
|
|
|
|
|
|
|
|
| |
From the Linux kernel coding guidelines:
Do not unnecessarily use braces where a single statement will do.
[...] This does not apply if one branch of a conditional statement
is a single statement. Use braces in both branches.
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| | |
Remove the huge layout switch block and use simple calculations instead.
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>
|
| |
| |
| |
| |
| |
| |
| | |
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>
|