Online help added for side bar configuration screen.

This commit is contained in:
Frederic Culot 2010-03-21 12:21:11 +00:00
parent 6892b59622
commit b6f84b3ef9
2 changed files with 26 additions and 20 deletions

View File

@ -3,6 +3,8 @@
* src/wins.c (wins_refresh, wins_wrefresh, wins_doupdate) * src/wins.c (wins_refresh, wins_wrefresh, wins_doupdate)
(screen_acquire, screen_release): new functions to improve (screen_acquire, screen_release): new functions to improve
concurrent screen refreshes concurrent screen refreshes
* src/custom.c (custom_sidebar_config): help screen added
2010-03-20 Frederic Culot <frederic@culot.org> 2010-03-20 Frederic Culot <frederic@culot.org>

View File

@ -1,4 +1,4 @@
/* $calcurse: custom.c,v 1.49 2010/03/21 10:17:03 culot Exp $ */ /* $calcurse: custom.c,v 1.50 2010/03/21 12:21:12 culot Exp $ */
/* /*
* Calcurse - text-based organizer * Calcurse - text-based organizer
@ -602,10 +602,18 @@ custom_layout_config (void)
void void
custom_sidebar_config (void) custom_sidebar_config (void)
{ {
struct scrollwin hwin;
struct binding inc = {_("Width +"), KEY_MOVE_UP}; struct binding inc = {_("Width +"), KEY_MOVE_UP};
struct binding dec = {_("Width -"), KEY_MOVE_DOWN}; struct binding dec = {_("Width -"), KEY_MOVE_DOWN};
struct binding help = {_("Help"), KEY_GENERIC_HELP}; struct binding help = {_("Help"), KEY_GENERIC_HELP};
struct binding *binding[] = {&inc, &dec, &help}; struct binding *binding[] = {&inc, &dec, &help};
char *help_text =
_("This configuration screen is used to change the width of the side bar.\n"
"The side bar is the part of the screen which contains two panels:\n"
"the calendar and, depending on the chosen layout, either the todo list\n"
"or the appointment list.\n\n"
"The side bar width can be up to 50% of the total screen width, but\n"
"can't be smaller than " TOSTRING(SBARMINWIDTH) " characters wide.\n\n");
int ch, binding_size; int ch, binding_size;
binding_size = sizeof (binding) / sizeof (binding[0]); binding_size = sizeof (binding) / sizeof (binding[0]);
@ -615,35 +623,31 @@ custom_sidebar_config (void)
while ((ch = keys_getch (win[STA].p)) != KEY_GENERIC_QUIT) while ((ch = keys_getch (win[STA].p)) != KEY_GENERIC_QUIT)
{ {
unsigned need_update;
need_update = 0;
switch (ch) switch (ch)
{ {
case KEY_MOVE_UP: case KEY_MOVE_UP:
wins_sbar_winc (); wins_sbar_winc ();
need_update = 1;
break; break;
case KEY_MOVE_DOWN: case KEY_MOVE_DOWN:
wins_sbar_wdec (); wins_sbar_wdec ();
need_update = 1;
break; break;
case KEY_GENERIC_HELP: case KEY_GENERIC_HELP:
/* XXX help_wins_init (&hwin, 0, 0,
Add help screen for sidebar configuration (notify_bar ()) ? row - 3 : row - 2, col);
*/ mvwprintw (hwin.pad.p, 1, 0, "%s", help_text);
hwin.total_lines = 6;
wins_scrollwin_display (&hwin);
wgetch (hwin.win.p);
wins_scrollwin_delete (&hwin);
break; break;
default:
continue;
} }
wins_reinit_panels ();
if (need_update) wins_update_border ();
{ wins_update_panels ();
wins_reinit_panels (); keys_display_bindings_bar (win[STA].p, binding, 0, binding_size);
wins_update_border (); wins_doupdate ();
wins_update_panels ();
keys_display_bindings_bar (win[STA].p, binding, 0, binding_size);
wins_doupdate ();
need_update = 0;
}
} }
} }