aboutsummaryrefslogtreecommitdiffstats
path: root/src/hci/tui
Commit message (Collapse)AuthorAgeFilesLines
* [menu] Allow a post-activity timeout to be definedHEADmastercoverity_scanMichael Brown4 days1-5/+11
| | | | | | | | | Allow the "--retimeout" option to be used to specify a timeout value that will be (re)applied after each keypress activity. This allows script authors to ensure that a single (potentially accidental) keypress will not pause the boot process indefinitely. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hci] Remove the generalised widget user interface abstractionMichael Brown2024-06-212-146/+0
| | | | | | | | Remove the now-unused generalised text widget user interface, along with the associated concept of a widget set and the implementation of a read-only label widget. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [form] Reimplement the "login" user interfaceMichael Brown2024-06-211-61/+31
| | | | | | | | | | | | | | | | | | Rewrite the code implementing the "login" user interface to use a predefined interactive form. The command "login" then becomes roughly equivalent to: #!ipxe form item username Username item --secret password Password present with the result that login form customisations (e.g. to add a Windows domain name) may be implemented within the scripting language. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [form] Add support for dynamically created interactive formsMichael Brown2024-06-201-0/+544
| | | | | | | | | | | | | | | | Add support for presenting a dynamic user interface as an interactive form, alongside the existing support for presenting a dynamic user interface as a menu. An interactive form may be used to allow a user to input (or edit) values for multiple settings on a single screen, as a user-friendly alternative to prompting for setting values via the "read" command. In the present implementation, all input fields must fit on a single screen (with no scrolling), and the only supported widget type is an editable text box. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dynui] Allow for multiple flags on a user interface itemMichael Brown2024-06-201-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dynui] Generalise mechanisms for looking up user interface itemsMichael Brown2024-06-201-32/+6
| | | | | | | | Generalise the ability to look up a dynamic user interface item by index or by shortcut key, to allow for reuse of this code for interactive forms. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dynui] Generalise the concept of a menu to a dynamic user interfaceMichael Brown2024-06-201-21/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently have an abstract model of a dynamic menu as a list of items, each of which has a name, a description, and assorted metadata such as a shortcut key. The "menu" and "item" commands construct representations in this abstract model, and the "choose" command then presents the items as a single-choice menu, with the selected item's name used as the output value. This same abstraction may be used to model a dynamic form as a list of editable items, each of which has a corresponding setting name, an optional description label, and assorted metadata such as a shortcut key. By defining a "form" command as an alias for the "menu" command, we could construct and present forms using commands such as: #!ipxe form Login to ${url} item username Username or email address item --secret password Password present or #!ipxe form Configure IPv4 networking for ${netX/ifname} item netX/ip IPv4 address item netX/netmask Subnet mask item netX/gateway Gateway address item netX/dns DNS server address present Reusing the same abstract model for both menus and forms allows us to minimise the increase in code size, since the implementation of the "form" and "item" commands is essentially zero-cost. Rename everything within the abstract data model from "menu" to "dynamic user interface" to reflect this generalisation. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hci] Allow tab key to be used to cycle through UI elementsMichael Brown2024-06-202-4/+4
| | | | | | | | | | | Add support for wraparound scrolling and allow the tab key to be used to move forward through a list of elements, wrapping back around to the beginning of the list on overflow. This is mildly useful for a menu, and likely to be a strong user expectation for an interactive form. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hci] Rename "item" command's first parameter from "label" to "name"Michael Brown2024-06-181-13/+13
| | | | | | | | | | | Switch terminology for the "item" command from "item <label> <text>" to "item <name> <text>", in preparation for repurposing the "item" command to cover interactive forms as well as menus. Since this renaming affects only a positional parameter, it does not break compatibility with any existing scripts. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hci] Split out msg() and alert() from settings UI codeMichael Brown2024-06-182-72/+115
| | | | | | | | | | | The msg() and alert() functions currently defined in settings_ui.c provide a general-purpose facility for printing messages centred on the screen. Split this out to a separate file to allow for reuse by the form presentation code. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hci] Draw all widgets on the standard screenMichael Brown2024-06-183-7/+7
| | | | | | | | | | | | | | | The curses concept of a window has been supported but never actively used in iPXE since the mucurses library was first implemented in 2006. Simplify the code by removing the ability to place a widget set in a specified window, and instead use the standard screen for all drawing operations. This simplification allows the widget set parameter to be omitted for the draw_widget() and edit_widget() operations, since the only reason for its inclusion was to provide access to the specified window. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hci] Provide a general concept of a text widget setMichael Brown2024-05-153-76/+187
| | | | | | | | | Create a generic abstraction of a text widget, refactor the existing editable text box widget to use this abstraction, add an implementation of a non-editable text label widget, and generalise the login user interface to use this generic widget abstraction. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hci] Use dynamically allocated buffers for editable stringsMichael Brown2024-04-152-49/+50
| | | | | | | | | | | Editable strings currently require a fixed-size buffer, which is inelegant and limits the potential for creating interactive forms with a variable number of edit box widgets. Remove this limitation by switching to using a dynamically allocated buffer for editable strings and edit box widgets. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Use generic jump scrolling abstractionMichael Brown2015-03-031-196/+155
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [menu] Abstract out the generic concept of a jump scrollerMichael Brown2015-03-031-65/+31
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+5
| | | | | | | | | | These files cannot be automatically relicensed by util/relicense.pl since they either contain unusual but trivial contributions (such as the addition of __nonnull function attributes), or contain lines dating back to the initial git revision (and so require manual knowledge of the code's origin). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+5
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Allow setting help text URI to be customised via config/branding.hMichael Brown2015-02-111-2/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Use PRODUCT_SHORT_NAME for end-user visible stringsMichael Brown2015-02-111-1/+2
| | | | | | | | | | | Use PRODUCT_SHORT_NAME instead of a hardcoded "iPXE" for strings which are typically shown in the user interface. Note that this only allows for customisation of the user interface. Where the "iPXE" string serves a technical purpose (such as in the HTTP User-Agent), the string cannot be customised. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [mucurses] Use centralised concept of colour pairsMichael Brown2013-12-093-29/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [menu] Adapt user interface to fit display sizeMichael Brown2013-12-061-8/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [login] Adapt user interface to fit display sizeMichael Brown2013-12-061-7/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Adapt user interface to fit display sizeMichael Brown2013-12-061-29/+44
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Allow for multiple definitions of each predefined settingMichael Brown2013-12-051-2/+10
| | | | | | | | | | Allow for multiple setting definitions with the same name but different scopes and tags. For example, allow for a "filename" setting with default scope and tag value 67 (for DHCPv4) and a corresponding "filename" setting with IPv6 scope and tag value 59 (for DHCPv6). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Explicitly separate the concept of a completed fetched settingMichael Brown2013-12-051-31/+28
| | | | | | | | | | The fetch_setting() family of functions may currently modify the definition of the specified setting (e.g. to add missing type information). Clean up this interface by requiring callers to provide an explicit buffer to contain the completed definition of the fetched setting, if required. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [menu] Hide cursor when displaying menuMichael Brown2013-12-021-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Hide cursor when not actively editing a settingMichael Brown2013-12-021-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Add parse_timeout()Michael Brown2013-11-011-3/+3
| | | | | | | | Parsing a timeout value (specified in milliseconds) into an internal timeout value measured in timer ticks is a common operation. Provide a parse_timeout() value to carry out this conversion automatically. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add support for navigation keys in "config" user interfaceMichael Brown2013-07-151-9/+27
| | | | | | | | Add support for page up, page down, home and end keys, matching the navigation logic used in the menu user interface. Originally-implemented-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Make "netX" settings block function as a symbolic linkMichael Brown2013-07-131-1/+1
| | | | | | | | | | | | | | Add a facility for settings blocks to act as symbolic links to other settings blocks, and reimplement the "netX" virtual settings block using this facility. The primary advantage of this approach is that unscoped settings such as ${mac} and ${filename} will now reflect the settings obtained from the most recently opened network device: in most cases, this will mean the settings obtained from the most recent DHCP attempt. This should improve conformance to the principle of least astonishment. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [menu] Prevent separators with shortcut keys from being selectedMichael Brown2013-03-061-10/+12
| | | | | | | | | | | | | | | | | | | | | | | Nothing currently prevents a menu separator from being assigned a shortcut key, and then from being selected using that shortcut key. This produces an inconsistency in the user interface, since separators cannot be selected by other means of menu navigation (arrow keys, page up/down, etc). It would be trivial to prevent separators from being assigned shortcut keys, but this would eliminate one potentially useful use case: having a large menu and using shortcut keys to jump to a section within the menu. Fix by treating a shortcut key on a separator as equivalent to "select the separator, then press the down arrow key". This has the effect of moving to the first non-separator menu item following the specified separator, which is probably the most intuitive behaviour. (The existing logic for moving the selection already handles the various nasty corner cases such as a menu ending with one or more separators.) Reported-by: Ján ONDREJ (SAL) <ondrejj@salstar.sk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [menu] Prevent character code zero from acting as a shortcut keyMichael Brown2013-03-061-1/+2
| | | | | | | | | | | | Unrecognised keys may be returned by getkey() as character code zero, which currently matches against the first menu item with no shortcut key defined. Prevent this unintended behaviour by explicitly checking that the menu item has a defined shortcut key. Reported-by: Ján ONDREJ (SAL) <ondrejj@salstar.sk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-203-3/+6
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [menu] Truncate menu title when necessaryChristian Hesse2012-07-031-2/+3
| | | | | Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ui] Allow colours to be configured via config/colour.hChristian Hesse2012-06-273-10/+13
| | | | | Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ui] Change "login" colours to match other UIsMichael Brown2012-06-271-7/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [menu] Add "--default" option to "choose" commandMichael Brown2012-04-281-3/+8
| | | | | Suggested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [menu] Fix default selection when default is item 0Michael Brown2012-03-301-2/+2
| | | | | Reported-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [menu] Add menu user interfaceMichael Brown2012-03-291-0/+359
| | | | | | Inspired-by: Robin Smidsrød <robin@smidsrod.no> Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Display "delete" option only for locally-originated settingsMichael Brown2011-03-281-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Refer to online documentation for settings helpMichael Brown2011-03-231-2/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Match terminology used elsewhereMichael Brown2011-03-231-1/+1
| | | | | | | iPXE documentation tends to refer to "settings" rather than "options", since settings can be more general than DHCP options. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Return to first row on navigating to a new settings blockMichael Brown2011-03-231-4/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add hierarchy navigation in "config" user interfaceMichael Brown2011-03-231-199/+260
| | | | | | | Allow the user to browse through the settings block hierarchy. Originally-implemented-by: Glenn Brown <glenn@myri.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Display locally-originated settings in boldMichael Brown2011-03-221-1/+11
| | | | | Originally-implemented-by: Glenn Brown <glenn@myri.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Display canonical setting name in "config" user interfaceMichael Brown2011-03-221-4/+16
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Display only applicable settings in "config" user interfaceMichael Brown2011-03-221-10/+18
| | | | | | | | | Display only settings relevant to the current scope. For example, "config net0" no longer displays SMBIOS settings, and "config smbios" displays only SMBIOS settings. Originally-implemented-by: Glenn Brown <glenn@myri.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Move include/console.h to include/ipxe/console.hMichael Brown2011-03-092-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Add a timeout parameter to getkey()Michael Brown2011-03-072-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add setting deletion (Ctrl-D) interfaceGlenn Brown2010-06-241-0/+7
| | | | | | | | | | | Make Ctrl-D delete a setting, because the Text User Interface (tui) previously provided no way to delete a setting. Also, update the on-screen instructions to describe the new feature. Deleting settings is especially important for settings stored in precious nonvolatile storage. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>