aboutsummaryrefslogtreecommitdiffstats
path: root/src/custom.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-02-20 19:23:25 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2012-03-02 09:43:06 +0100
commit17aa73b73fdb3181b2b2e696d094a04b8b95ed60 (patch)
tree485ac44d1902bd8396a6b98a5a69800ec03f1472 /src/custom.c
parentb5c1981842402f6fe8d4c02176db923e1955175b (diff)
downloadcalcurse-17aa73b73fdb3181b2b2e696d094a04b8b95ed60.tar.gz
calcurse-17aa73b73fdb3181b2b2e696d094a04b8b95ed60.zip
Break out configuration main menu
This was the only big block of code left in our main loop. Move it to a separate function, making the main loop a bit clearer. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/custom.c')
-rw-r--r--src/custom.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/custom.c b/src/custom.c
index 6dc6f04..d242b7f 100644
--- a/src/custom.c
+++ b/src/custom.c
@@ -1097,3 +1097,58 @@ custom_keys_config (void)
wins_scrollwin_display (&kwin);
}
}
+
+void
+custom_config_main (void)
+{
+ char *no_color_support =
+ _("Sorry, colors are not supported by your terminal\n"
+ "(Press [ENTER] to continue)");
+ int ch;
+
+ custom_config_bar ();
+ while ((ch = wgetch (win[STA].p)) != 'q')
+ {
+ switch (ch)
+ {
+ case 'C':
+ case 'c':
+ if (has_colors ())
+ custom_color_config ();
+ else
+ {
+ colorize = 0;
+ wins_erase_status_bar ();
+ mvwprintw (win[STA].p, 0, 0, _(no_color_support));
+ wgetch (win[STA].p);
+ }
+ break;
+ case 'L':
+ case 'l':
+ custom_layout_config ();
+ break;
+ case 'G':
+ case 'g':
+ custom_general_config ();
+ break;
+ case 'N':
+ case 'n':
+ notify_config_bar ();
+ break;
+ case 'K':
+ case 'k':
+ custom_keys_config ();
+ break;
+ case 's':
+ case 'S':
+ custom_sidebar_config ();
+ break;
+ default:
+ continue;
+ }
+ wins_reset ();
+ wins_update (FLAG_ALL);
+ wins_erase_status_bar ();
+ custom_config_bar ();
+ }
+}