From 17aa73b73fdb3181b2b2e696d094a04b8b95ed60 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Mon, 20 Feb 2012 19:23:25 +0100 Subject: 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 --- src/calcurse.c | 51 ++------------------------------------------------- 1 file changed, 2 insertions(+), 49 deletions(-) (limited to 'src/calcurse.c') diff --git a/src/calcurse.c b/src/calcurse.c index 756a79f..4216462 100644 --- a/src/calcurse.c +++ b/src/calcurse.c @@ -68,9 +68,6 @@ main (int argc, char **argv) int non_interactive; int no_data_file = 1; int cut_item = 0; - char *no_color_support = - _("Sorry, colors are not supported by your terminal\n" - "(Press [ENTER] to continue)"); char *quit_message = _("Do you really want to quit ?"); char choices[] = "[y/n] "; int count; @@ -242,52 +239,8 @@ main (int argc, char **argv) case KEY_GENERIC_CONFIG_MENU: wins_erase_status_bar (); - custom_config_bar (); - while ((key = wgetch (win[STA].p)) != 'q') - { - switch (key) - { - 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 (); - inday = do_storage (0); - } + custom_config_main (); + inday = do_storage (0); wins_update (FLAG_ALL); break; -- cgit v1.2.3-54-g00ecf