printf("k\033[%d;%dH\1#1x\017\1#2 %s \1#1\016x",
VSHIFT+2,
HSHIFT+MARGIN+1,
- pad_line(cm->messages[MSG_TITLE], 1, WIDTH-2*MARGIN-4));
+ pad_line(cm->title, 1, WIDTH-2*MARGIN-4));
printf("\033[%d;%dH\1#1t", VSHIFT+3, HSHIFT+MARGIN+1);
for ( x = 2+HSHIFT ; x <= (WIDTH-2*MARGIN-1)+HSHIFT ; x++ )
static struct menu_entry **all_entries_end = &all_entries;
static const struct messages messages[MSG_COUNT] = {
- [MSG_TITLE] = { "title", "" },
[MSG_AUTOBOOT] = { "autoboot", "Automatic boot in # second{,s}..." },
[MSG_TAB] = { "tabmsg", "Press [Tab] to edit options" },
[MSG_NOTAB] = { "notabmsg", "" },
for (i = 0; i < MSG_COUNT; i++)
m->messages[i] = refstr_get(parent->messages[i]);
- refstr_put(m->messages[MSG_TITLE]);
- m->messages[MSG_TITLE] = refstr_get(empty_string);
-
memcpy(m->mparm, parent->mparm, sizeof m->mparm);
m->allowedit = parent->allowedit;
m->timeout = parent->timeout;
+ m->title = refstr_get(empty_string);
m->ontimeout = refstr_get(parent->ontimeout);
m->onerror = refstr_get(parent->onerror);
m->menu_master_passwd = refstr_get(parent->menu_master_passwd);
refstr_put(m->parent_entry->displayname);
m->parent_entry->displayname = refstrdup(skipspace(p+5));
consider_for_hotkey(m, m->parent_entry);
- if (!m->messages[MSG_TITLE][0]) {
+ if (!m->title[0]) {
/* MENU LABEL -> MENU TITLE on submenu */
- refstr_put(m->messages[MSG_TITLE]);
- m->messages[MSG_TITLE] = refstr_get(m->parent_entry->displayname);
+ refstr_put(m->title);
+ m->title = refstr_get(m->parent_entry->displayname);
+ }
+ }
+ } else if ( looking_at(p, "title") ) {
+ refstr_put(m->title);
+ m->title = refstrdup(skipspace(p+5));
+ if (m->parent_entry) {
+ /* MENU TITLE -> MENU LABEL on submenu */
+ if (m->parent_entry->displayname == m->parent_entry->label) {
+ refstr_put(m->parent_entry->displayname);
+ m->parent_entry->displayname = refstr_get(m->title);
}
}
} else if ( looking_at(p, "default") ) {