From 7cf42c10830c83fd09e3eb23740855526d13f54c Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 13 May 2014 21:37:19 +0200 Subject: 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 --- src/custom.c | 40 ++++++++++++++++++++-------------------- src/notify.c | 13 +++++-------- 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/src/custom.c b/src/custom.c index 9bf8905..4063205 100644 --- a/src/custom.c +++ b/src/custom.c @@ -602,23 +602,23 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d switch (i) { 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, - XPOS + 4 + strlen(opt[AUTO_SAVE])); + XPOS + strlen(opt[AUTO_SAVE])); mvwaddstr(win, y + XPOS, 1, _("(if set to YES, automatic save is done when quitting)")); break; 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, - XPOS + 4 + strlen(opt[AUTO_GC])); + XPOS + strlen(opt[AUTO_GC])); mvwaddstr(win, y + 1, XPOS, _("(run the garbage collector when quitting)")); break; 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); - mvwprintw(win, y, XPOS + 4 + strlen(opt[PERIODIC_SAVE]), "%d", + mvwprintw(win, y, XPOS + strlen(opt[PERIODIC_SAVE]), "%d", conf.periodic_save); custom_remove_attr(win, ATTR_HIGHEST); 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)")); break; 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, - XPOS + 4 + strlen(opt[CONFIRM_QUIT])); + XPOS + strlen(opt[CONFIRM_QUIT])); mvwaddstr(win, y + 1, XPOS, _("(if set to YES, confirmation is required before quitting)")); break; 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, - XPOS + 4 + strlen(opt[CONFIRM_DELETE])); + XPOS + strlen(opt[CONFIRM_DELETE])); mvwaddstr(win, y + 1, XPOS, _("(if set to YES, confirmation is required " "before deleting an event)")); break; 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, - XPOS + 4 + strlen(opt[SYSTEM_DIAGS])); + XPOS + strlen(opt[SYSTEM_DIAGS])); mvwaddstr(win, y + 1, XPOS, _("(if set to YES, messages about loaded " "and saved data will be displayed)")); break; 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, - XPOS + 4 + strlen(opt[PROGRESS_BAR])); + XPOS + strlen(opt[PROGRESS_BAR])); mvwaddstr(win, y + 1, XPOS, _("(if set to YES, progress bar will be displayed " "when saving data)")); break; 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); - 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") : _("Sunday")); 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)")); break; 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); - mvwaddstr(win, y, XPOS + 4 + strlen(opt[OUTPUT_DATE_FMT]), + mvwaddstr(win, y, XPOS + strlen(opt[OUTPUT_DATE_FMT]), conf.output_datefmt); custom_remove_attr(win, ATTR_HIGHEST); mvwaddstr(win, y + 1, XPOS, _("(Format of the date to be displayed in non-interactive mode)")); break; 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); - mvwprintw(win, y, XPOS + 4 + strlen(opt[INPUT_DATE_FMT]), "%d", + mvwprintw(win, y, XPOS + strlen(opt[INPUT_DATE_FMT]), "%d", conf.input_datefmt); custom_remove_attr(win, ATTR_HIGHEST); mvwaddstr(win, y + 1, XPOS, diff --git a/src/notify.c b/src/notify.c index 541c5ba..c833cd9 100644 --- a/src/notify.c +++ b/src/notify.c @@ -555,14 +555,13 @@ void notify_start_main_thread(void) */ static void 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; int x_opt, len; - x_opt = x + XOFF + strlen(name); - mvwprintw(win, y, x, "[%u] %s", num, name); + x_opt = x + strlen(name); + mvwprintw(win, y, x, "%s", name); erase_window_part(win, x_opt, y, MAXCOL, y); if ((len = strlen(valstr)) != 0) { unsigned maxlen; @@ -588,8 +587,6 @@ print_option(WINDOW * win, unsigned x, unsigned y, char *name, /* Print options related to the notify-bar. */ 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, NB_OPT }; @@ -654,8 +651,8 @@ static void print_config_option(int i, WINDOW *win, int y, int hilt, void *cb_da if (hilt) custom_apply_attr(win, ATTR_HIGHEST); - print_option(win, XORIG, y, opt[i].name, opt[i].valstr, - opt[i].valnum, opt[i].desc, i + 1); + print_option(win, 1, y, opt[i].name, opt[i].valstr, + opt[i].valnum, opt[i].desc); if (hilt) custom_remove_attr(win, ATTR_HIGHEST); -- cgit v1.2.3-70-g09d2