diff options
author | Frederic Culot <calcurse@culot.org> | 2010-03-21 12:21:11 +0000 |
---|---|---|
committer | Frederic Culot <calcurse@culot.org> | 2010-03-21 12:21:11 +0000 |
commit | b6f84b3ef91bc03a73e6f0a2bab641c4306d94f9 (patch) | |
tree | 7cdc56e62a947e8839eb59c64f69bb8505273756 | |
parent | 6892b596222bdc5b2c0757a8f6cc79bcf2691d1a (diff) | |
download | calcurse-b6f84b3ef91bc03a73e6f0a2bab641c4306d94f9.zip |
Online help added for side bar configuration screen.
-rwxr-xr-x | ChangeLog | 2 | ||||
-rwxr-xr-x | src/custom.c | 44 |
2 files changed, 26 insertions, 20 deletions
@@ -3,6 +3,8 @@ * src/wins.c (wins_refresh, wins_wrefresh, wins_doupdate) (screen_acquire, screen_release): new functions to improve concurrent screen refreshes + + * src/custom.c (custom_sidebar_config): help screen added 2010-03-20 Frederic Culot <frederic@culot.org> diff --git a/src/custom.c b/src/custom.c index e6d547d..5d89719 100755 --- a/src/custom.c +++ b/src/custom.c @@ -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 @@ -602,10 +602,18 @@ custom_layout_config (void) void custom_sidebar_config (void) { + struct scrollwin hwin; struct binding inc = {_("Width +"), KEY_MOVE_UP}; struct binding dec = {_("Width -"), KEY_MOVE_DOWN}; 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; 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) { - unsigned need_update; - - need_update = 0; switch (ch) { case KEY_MOVE_UP: wins_sbar_winc (); - need_update = 1; break; case KEY_MOVE_DOWN: wins_sbar_wdec (); - need_update = 1; break; case KEY_GENERIC_HELP: - /* XXX - Add help screen for sidebar configuration - */ + help_wins_init (&hwin, 0, 0, + (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; + default: + continue; } - - if (need_update) - { - wins_reinit_panels (); - wins_update_border (); - wins_update_panels (); - keys_display_bindings_bar (win[STA].p, binding, 0, binding_size); - wins_doupdate (); - need_update = 0; - } + wins_reinit_panels (); + wins_update_border (); + wins_update_panels (); + keys_display_bindings_bar (win[STA].p, binding, 0, binding_size); + wins_doupdate (); } } |