Remove numbers and whitespace from option menus

These are no longer needed since items are no longer accessed via
numeric keys.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2014-05-13 21:37:19 +02:00
parent 05ba450c3b
commit 7cf42c1083
2 changed files with 25 additions and 28 deletions

View File

@ -602,23 +602,23 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d
switch (i) { switch (i) {
case 0: case 0:
mvwprintw(win, y, XPOS, "[1] %s ", opt[AUTO_SAVE]); mvwprintw(win, y, XPOS, "%s", opt[AUTO_SAVE]);
print_bool_option_incolor(win, conf.auto_save, y, print_bool_option_incolor(win, conf.auto_save, y,
XPOS + 4 + strlen(opt[AUTO_SAVE])); XPOS + strlen(opt[AUTO_SAVE]));
mvwaddstr(win, y + XPOS, 1, mvwaddstr(win, y + XPOS, 1,
_("(if set to YES, automatic save is done when quitting)")); _("(if set to YES, automatic save is done when quitting)"));
break; break;
case 1: case 1:
mvwprintw(win, y, XPOS, "[2] %s ", opt[AUTO_GC]); mvwprintw(win, y, XPOS, "%s", opt[AUTO_GC]);
print_bool_option_incolor(win, conf.auto_gc, y, print_bool_option_incolor(win, conf.auto_gc, y,
XPOS + 4 + strlen(opt[AUTO_GC])); XPOS + strlen(opt[AUTO_GC]));
mvwaddstr(win, y + 1, XPOS, mvwaddstr(win, y + 1, XPOS,
_("(run the garbage collector when quitting)")); _("(run the garbage collector when quitting)"));
break; break;
case 2: case 2:
mvwprintw(win, y, XPOS, "[3] %s ", opt[PERIODIC_SAVE]); mvwprintw(win, y, XPOS, "%s", opt[PERIODIC_SAVE]);
custom_apply_attr(win, ATTR_HIGHEST); custom_apply_attr(win, ATTR_HIGHEST);
mvwprintw(win, y, XPOS + 4 + strlen(opt[PERIODIC_SAVE]), "%d", mvwprintw(win, y, XPOS + strlen(opt[PERIODIC_SAVE]), "%d",
conf.periodic_save); conf.periodic_save);
custom_remove_attr(win, ATTR_HIGHEST); custom_remove_attr(win, ATTR_HIGHEST);
mvwaddstr(win, y + 1, XPOS, mvwaddstr(win, y + 1, XPOS,
@ -626,40 +626,40 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d
"minutes)")); "minutes)"));
break; break;
case 3: case 3:
mvwprintw(win, y, XPOS, "[4] %s ", opt[CONFIRM_QUIT]); mvwprintw(win, y, XPOS, "%s", opt[CONFIRM_QUIT]);
print_bool_option_incolor(win, conf.confirm_quit, y, print_bool_option_incolor(win, conf.confirm_quit, y,
XPOS + 4 + strlen(opt[CONFIRM_QUIT])); XPOS + strlen(opt[CONFIRM_QUIT]));
mvwaddstr(win, y + 1, XPOS, mvwaddstr(win, y + 1, XPOS,
_("(if set to YES, confirmation is required before quitting)")); _("(if set to YES, confirmation is required before quitting)"));
break; break;
case 4: case 4:
mvwprintw(win, y, XPOS, "[5] %s ", opt[CONFIRM_DELETE]); mvwprintw(win, y, XPOS, "%s", opt[CONFIRM_DELETE]);
print_bool_option_incolor(win, conf.confirm_delete, y, print_bool_option_incolor(win, conf.confirm_delete, y,
XPOS + 4 + strlen(opt[CONFIRM_DELETE])); XPOS + strlen(opt[CONFIRM_DELETE]));
mvwaddstr(win, y + 1, XPOS, mvwaddstr(win, y + 1, XPOS,
_("(if set to YES, confirmation is required " _("(if set to YES, confirmation is required "
"before deleting an event)")); "before deleting an event)"));
break; break;
case 5: case 5:
mvwprintw(win, y, XPOS, "[6] %s ", opt[SYSTEM_DIAGS]); mvwprintw(win, y, XPOS, "%s", opt[SYSTEM_DIAGS]);
print_bool_option_incolor(win, conf.system_dialogs, y, print_bool_option_incolor(win, conf.system_dialogs, y,
XPOS + 4 + strlen(opt[SYSTEM_DIAGS])); XPOS + strlen(opt[SYSTEM_DIAGS]));
mvwaddstr(win, y + 1, XPOS, mvwaddstr(win, y + 1, XPOS,
_("(if set to YES, messages about loaded " _("(if set to YES, messages about loaded "
"and saved data will be displayed)")); "and saved data will be displayed)"));
break; break;
case 6: case 6:
mvwprintw(win, y, XPOS, "[7] %s ", opt[PROGRESS_BAR]); mvwprintw(win, y, XPOS, "%s", opt[PROGRESS_BAR]);
print_bool_option_incolor(win, conf.progress_bar, y, print_bool_option_incolor(win, conf.progress_bar, y,
XPOS + 4 + strlen(opt[PROGRESS_BAR])); XPOS + strlen(opt[PROGRESS_BAR]));
mvwaddstr(win, y + 1, XPOS, mvwaddstr(win, y + 1, XPOS,
_("(if set to YES, progress bar will be displayed " _("(if set to YES, progress bar will be displayed "
"when saving data)")); "when saving data)"));
break; break;
case 7: case 7:
mvwprintw(win, y, XPOS, "[8] %s ", opt[FIRST_DAY_OF_WEEK]); mvwprintw(win, y, XPOS, "%s", opt[FIRST_DAY_OF_WEEK]);
custom_apply_attr(win, ATTR_HIGHEST); custom_apply_attr(win, ATTR_HIGHEST);
mvwaddstr(win, y, XPOS + 4 + strlen(opt[FIRST_DAY_OF_WEEK]), mvwaddstr(win, y, XPOS + strlen(opt[FIRST_DAY_OF_WEEK]),
ui_calendar_week_begins_on_monday()? _("Monday") : ui_calendar_week_begins_on_monday()? _("Monday") :
_("Sunday")); _("Sunday"));
custom_remove_attr(win, ATTR_HIGHEST); custom_remove_attr(win, ATTR_HIGHEST);
@ -667,18 +667,18 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d
_("(specifies the first day of week in the calendar view)")); _("(specifies the first day of week in the calendar view)"));
break; break;
case 8: case 8:
mvwprintw(win, y, XPOS, "[9] %s ", opt[OUTPUT_DATE_FMT]); mvwprintw(win, y, XPOS, "%s", opt[OUTPUT_DATE_FMT]);
custom_apply_attr(win, ATTR_HIGHEST); custom_apply_attr(win, ATTR_HIGHEST);
mvwaddstr(win, y, XPOS + 4 + strlen(opt[OUTPUT_DATE_FMT]), mvwaddstr(win, y, XPOS + strlen(opt[OUTPUT_DATE_FMT]),
conf.output_datefmt); conf.output_datefmt);
custom_remove_attr(win, ATTR_HIGHEST); custom_remove_attr(win, ATTR_HIGHEST);
mvwaddstr(win, y + 1, XPOS, mvwaddstr(win, y + 1, XPOS,
_("(Format of the date to be displayed in non-interactive mode)")); _("(Format of the date to be displayed in non-interactive mode)"));
break; break;
case 9: case 9:
mvwprintw(win, y, XPOS, "[0] %s ", opt[INPUT_DATE_FMT]); mvwprintw(win, y, XPOS, "%s", opt[INPUT_DATE_FMT]);
custom_apply_attr(win, ATTR_HIGHEST); custom_apply_attr(win, ATTR_HIGHEST);
mvwprintw(win, y, XPOS + 4 + strlen(opt[INPUT_DATE_FMT]), "%d", mvwprintw(win, y, XPOS + strlen(opt[INPUT_DATE_FMT]), "%d",
conf.input_datefmt); conf.input_datefmt);
custom_remove_attr(win, ATTR_HIGHEST); custom_remove_attr(win, ATTR_HIGHEST);
mvwaddstr(win, y + 1, XPOS, mvwaddstr(win, y + 1, XPOS,

View File

@ -555,14 +555,13 @@ void notify_start_main_thread(void)
*/ */
static void static void
print_option(WINDOW * win, unsigned x, unsigned y, char *name, print_option(WINDOW * win, unsigned x, unsigned y, char *name,
char *valstr, unsigned valbool, char *desc, unsigned num) char *valstr, unsigned valbool, char *desc)
{ {
const int XOFF = 4;
const int MAXCOL = col - 3; const int MAXCOL = col - 3;
int x_opt, len; int x_opt, len;
x_opt = x + XOFF + strlen(name); x_opt = x + strlen(name);
mvwprintw(win, y, x, "[%u] %s", num, name); mvwprintw(win, y, x, "%s", name);
erase_window_part(win, x_opt, y, MAXCOL, y); erase_window_part(win, x_opt, y, MAXCOL, y);
if ((len = strlen(valstr)) != 0) { if ((len = strlen(valstr)) != 0) {
unsigned maxlen; unsigned maxlen;
@ -588,8 +587,6 @@ print_option(WINDOW * win, unsigned x, unsigned y, char *name,
/* Print options related to the notify-bar. */ /* Print options related to the notify-bar. */
static void print_config_option(int i, WINDOW *win, int y, int hilt, void *cb_data) static void print_config_option(int i, WINDOW *win, int y, int hilt, void *cb_data)
{ {
const int XORIG = 3;
enum { SHOW, DATE, CLOCK, WARN, CMD, NOTIFY_ALL, DMON, DMON_LOG, enum { SHOW, DATE, CLOCK, WARN, CMD, NOTIFY_ALL, DMON, DMON_LOG,
NB_OPT }; NB_OPT };
@ -654,8 +651,8 @@ static void print_config_option(int i, WINDOW *win, int y, int hilt, void *cb_da
if (hilt) if (hilt)
custom_apply_attr(win, ATTR_HIGHEST); custom_apply_attr(win, ATTR_HIGHEST);
print_option(win, XORIG, y, opt[i].name, opt[i].valstr, print_option(win, 1, y, opt[i].name, opt[i].valstr,
opt[i].valnum, opt[i].desc, i + 1); opt[i].valnum, opt[i].desc);
if (hilt) if (hilt)
custom_remove_attr(win, ATTR_HIGHEST); custom_remove_attr(win, ATTR_HIGHEST);