@@ -383,6 +383,7 @@ do_resize:
case 'n':
case 'm':
case '/':
+ case '<':
/* save scroll info */
*s_scroll = scroll;
delwin(menu);
@@ -402,6 +403,8 @@ do_resize:
return 6;
case '/':
return 7;
+ case '<':
+ return 8;
}
return 0;
case 'h':
@@ -276,6 +276,7 @@ static int single_menu_mode;
static void conf(struct menu *menu);
static void conf_choice(struct menu *menu);
static void conf_string(struct menu *menu);
+static void conf_remark(struct menu *menu);
static void conf_load(void);
static void conf_save(void);
static void show_textbox(const char *title, const char *text, int r, int c);
@@ -619,6 +620,9 @@ static void conf(struct menu *menu)
case 7:
search_conf();
break;
+ case 8:
+ conf_remark(submenu);
+ break;
}
}
}
@@ -743,6 +747,53 @@ static void conf_string(struct menu *menu)
}
}
+/**
+ * Based on conf_string(), this edits the remark for a config symbol
+ */
+static void conf_remark(struct menu *menu)
+{
+ const char *prompt = menu_get_prompt(menu);
+
+ if (!prompt || !menu->sym) {
+ show_textbox(NULL,
+ N_("Editing comments for menus without a config symbol\n"
+ "is currently not supported."), 6, 63);
+ return;
+ }
+
+ while (1) {
+ int res;
+ dialog_clear();
+ res = dialog_inputbox(prompt ? _(prompt) : _("Main Menu"),
+ _("Edit the remark below"), 10, 75,
+ menu->sym->remark);
+ switch (res) {
+ case 0:
+ if (!dialog_input_result[0] && !menu->sym->remark)
+ return;
+ if (menu->sym->remark) {
+ if (!strcmp(menu->sym->remark, dialog_input_result))
+ return;
+ free(menu->sym->remark);
+ }
+ if (dialog_input_result[0]) {
+ menu->sym->remark = strdup(dialog_input_result);
+ } else {
+ menu->sym->remark = NULL;
+ }
+ /* Write new .config{,-remarks} on exit: */
+ sym_add_change_count(1);
+ sym_clear_all_valid();
+ return;
+ case 1:
+ show_help(menu);
+ break;
+ case KEY_ESC:
+ return;
+ }
+ }
+}
+
static void conf_load(void)
{