Home
last modified time | relevance | path

Searched hist:"5 c1b51658125f5a9bf94179f89a9f24bc7761311" (Results 1 – 2 of 2) sorted by relevance

/freebsd/stand/lua/
H A Dcore.luadiff 5c1b51658125f5a9bf94179f89a9f24bc7761311 Mon Feb 19 18:40:19 CET 2018 Kyle Evans <kevans@FreeBSD.org> stand/lua: Change boot menu items' names when swapped

[Enter] should be moved to the single user menu item when we swap them.

Define a non-standard menu entry function "alternate_name" to use for this
purpose for ultimate flexibility if we change our minds later. When we're
booting single user, make a shallow copy of the menu that we'd normally
display and swap the items and their name functions to use alternate_name
instead. Toggling single user in the options menu and going back to the main
menu will now correctly reflect the current boot setting with the first two
menu options and "[Enter]" will always be on the right one.

This shallow copy technique has the chance of being quite slow since it's
done on every redraw, but in my testing it does not seem to make any obvious
difference.

shallowCopyTable could likely belong better in a general-purpose utility
module, but this (and the key constnats) are the only candidates we have at
the moment so we'll drop it into our core stuff for the moment and consider
re-organization at a later date.
H A Dmenu.luadiff 5c1b51658125f5a9bf94179f89a9f24bc7761311 Mon Feb 19 18:40:19 CET 2018 Kyle Evans <kevans@FreeBSD.org> stand/lua: Change boot menu items' names when swapped

[Enter] should be moved to the single user menu item when we swap them.

Define a non-standard menu entry function "alternate_name" to use for this
purpose for ultimate flexibility if we change our minds later. When we're
booting single user, make a shallow copy of the menu that we'd normally
display and swap the items and their name functions to use alternate_name
instead. Toggling single user in the options menu and going back to the main
menu will now correctly reflect the current boot setting with the first two
menu options and "[Enter]" will always be on the right one.

This shallow copy technique has the chance of being quite slow since it's
done on every redraw, but in my testing it does not seem to make any obvious
difference.

shallowCopyTable could likely belong better in a general-purpose utility
module, but this (and the key constnats) are the only candidates we have at
the moment so we'll drop it into our core stuff for the moment and consider
re-organization at a later date.