int entry; /* Entry number inside menu */
enum menu_action action;
unsigned char hotkey;
+ bool save; /* Save this entry if selected */
};
static inline bool is_disabled(struct menu_entry *me)
int nentries;
int nentries_space;
int defentry;
- int allowedit;
int timeout;
+ bool allowedit;
+ bool save; /* MENU SAVE default for this menu */
+
int curentry;
int curtop;
/* These are global parameters regardless of which menu we're displaying */
extern int shiftkey;
extern int hiddenmenu;
-extern bool menusave;
extern long long totaltimeout;
void parse_configs(char **argv);
int shiftkey = 0; /* Only display menu if shift key pressed */
int hiddenmenu = 0;
long long totaltimeout = 0;
-bool menusave = false;
/* Keep track of global default */
static int has_ui = 0; /* DEFAULT only counts if UI is found */
static const char *globaldefault = NULL;
+static bool menusave = false; /* True if there is any "menu save" */
/* Linked list of all entires, hidden or not; used by unlabel() */
static struct menu_entry *all_entries;
m->allowedit = parent->allowedit;
m->timeout = parent->timeout;
+ m->save = parent->save;
m->ontimeout = refstr_get(parent->ontimeout);
m->onerror = refstr_get(parent->onerror);
for (i = 0; i < NPARAMS; i++)
m->mparm[i] = mparm[i].value;
- m->allowedit = 1; /* Allow edits of the command line */
+ m->allowedit = true; /* Allow edits of the command line */
m->color_table = default_color_table();
}
unsigned int menudisabled;
unsigned int menuindent;
enum menu_action action;
+ int save;
struct menu *submenu;
};
me->helptext = ld->helptext;
me->hotkey = 0;
me->action = ld->action ? ld->action : MA_CMD;
+ me->save = ld->save ? (ld->save > 0) : m->save;
if ( ld->menuindent ) {
const char *dn;
shiftkey = 1;
} else if ( looking_at(p, "save") ) {
menusave = true;
+ if (ld.label)
+ ld.save = 1;
+ else
+ m->save = true;
+ } else if ( looking_at(p, "nosave") ) {
+ if (ld.label)
+ ld.save = -1;
+ else
+ m->save = false;
} else if ( looking_at(p, "onerror") ) {
refstr_put(m->onerror);
m->onerror = refstrdup(skipspace(p+7));
} else if ( looking_at(p, "ontimeout") ) {
m->ontimeout = refstrdup(skipspace(p+9));
} else if ( looking_at(p, "allowoptions") ) {
- m->allowedit = atoi(skipspace(p+12));
+ m->allowedit = !!atoi(skipspace(p+12));
} else if ( looking_at(p, "ipappend") ) {
if (ld.label)
ld.ipappend = atoi(skipspace(p+8));
MENU SAVE
+MENU NOSAVE
Remember the last entry selected and make that the default for
the next boot. A password-protected menu entry is *not*
file gracefully.
The MENU SAVE information can be cleared with
- "extlinux --reset-adv".
+ "extlinux --reset-adv <bootdir>".
+
+ A MENU SAVE or MENU NOSAVE at the top of a (sub)menu affects
+ all entries underneath that (sub)menu except those that in
+ turn have MENU SAVE or MENU NOSAVE declared. This can be used
+ to only save certain entires when selected.
INCLUDE filename [tagname]