summaryrefslogtreecommitdiffstats
path: root/ui
Commit message (Collapse)AuthorAgeFilesLines
...
* ui/ncurses: Properly reposition cursor after menu updateSamuel Mendoza-Jonas2015-05-201-2/+28
| | | | | | | | | The currently selected item in the main menu can be set to an item off the visible portion of the menu after the additional or removal of a boot option. Update the currently selected item and/or the current view such that the item remains in the visible area. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Toggle visibility of timeout help labelSamuel Mendoza-Jonas2015-05-201-0/+1
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Display current ipmi bootdev settingsSamuel Mendoza-Jonas2015-05-051-1/+44
| | | | | | | Display the current IPMI bootdev override if it exists, and allow the user to clear it from the configuration screen. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Update config screen help textSamuel Mendoza-Jonas2015-05-051-12/+15
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* petitboot: Implement ordered boot optionsSamuel Mendoza-Jonas2015-05-051-110/+216
| | | | | | | | | | | Move petitboot to a more familiar 'boot-order' based autoboot system. The discover server now reads multiple values from the petitboot,bootdev parameter and adds them in order to config->autoboot_opts. Boot priority is determined by the options' position in the list. On the client, nc-config now recognises the new boot order, and allows the user to add, remove, and reorder the devices in the list. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Use sorted field navigationSamuel Mendoza-Jonas2015-05-051-4/+4
| | | | | | | | | Changing the visual order of widgets will cause their associated fields to be out of order relative to the widgetset field array. Rather than manually resorting the array, use sorted navigation to move according to a field's visual positon Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Add nc-subset selection screenSamuel Mendoza-Jonas2015-05-056-1/+356
| | | | | | | | | | The nc-subset screen is intended to be used as a sub-screen from the current screen (eg. nc-config) which passes a pointer to a nc_widget_subset struct. The nc-subset screen allows the user to select an option from a list of 'inactive' options, before returning control back to the current screen. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Add nc_widget_subsetSamuel Mendoza-Jonas2015-05-052-1/+383
| | | | | | | | The new nc_widget_subset is similar to nc_widget_select, but hides added options until they are made active. This allows the widget to have multiple options selected and ordered without cluttering the screen. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Define Home, End, and Page Up/Down keysSamuel Mendoza-Jonas2015-04-221-0/+10
|
* ui/ncurses: Reduce unnecessary calls to redrawwinSamuel Mendoza-Jonas2015-02-165-5/+21
| | | | | | | | | | | | | | | | | | | | | | | All current *_post() methods in ui/ncurses call redrawwin() and wrefresh() together. wrefresh() updates any lines on the screen that have been marked as changed or invalid. However redrawwin() marks the entire screen as invalid unconditionally. We can reduce the amount of data written to the screen by avoiding calls to redrawwin(). Screen transitions are the primary use case of redrawwin(), where the whole screen must be invalidated to avoid stale data remaining on screen. All other 'in-screen' updates such as changes to widgets or changing focus do not require a call to redrawwin(). The most noticeable performance improvement is in nc-menu, which makes an unnecssary call to redrawwin() after every addition to the boot option menu. eg. The number of bytes written to STDOUT in the main menu: # Boot options | Before | After -------------------------------- 8 | 5488 | 1149 133 | 422454 | 4652 Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Prevent creation of empty boot entrySamuel Mendoza-Jonas2015-02-161-0/+9
| | | | | | | | | A boot option requires an image path at minimum. If an option is created without an image, trying to edit the resulting user item causes a segfault. Prevent the user from creating a boot option without at least an image path. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Properly size buttons in boot option editorSamuel Mendoza-Jonas2014-10-131-3/+3
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Expand width of padSamuel Mendoza-Jonas2014-10-081-1/+1
| | | | | | | | Widgets running over the horizontal width of the pad will cause the screen to blank. Expand the (non-viewable) size of the pad to prevent blanking until shorter translations are available for nc-config. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Warn if widget runs over horizontal pad widthSamuel Mendoza-Jonas2014-10-081-0/+4
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Properly size cancel and help buttonsSamuel Mendoza-Jonas2014-10-083-7/+7
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Dynamically align text fields in nc-configSamuel Mendoza-Jonas2014-10-081-1/+35
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Adjust position of add-url field to fit translated labelSamuel Mendoza-Jonas2014-09-301-1/+1
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Expand cancel & help button widthSamuel Mendoza-Jonas2014-09-234-12/+12
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Fix unstranslated strings in sysinfo screenJeremy Kerr2014-09-191-2/+4
| | | | | | We have a couple of strings that are missing the gettext call. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Fix clearing a boot device UUIDJeremy Kerr2014-09-181-7/+6
| | | | | | | | | | | | Currently, we have a bug where we can't clear a boot device UUID, as we only update config->boot_device if we're in AUTOBOOT_ONE state. This means that the config UI can't be used to change out of "autoboot from a single device" mode. This sets the autoboot device unconditionally, allowing it to be cleared. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* po: Add initial translationsJeremy Kerr2014-09-181-0/+10
| | | | | | | Add the initial translation set for de, en, es, fr, it, ja, ko, pt_BR, ru, zh_CN and zh_TW languages. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Correctly size pad for config screenSamuel Mendoza-Jonas2014-09-101-5/+10
| | | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Help string fixesJeremy Kerr2014-09-042-3/+3
| | | | | | | | The Configuration screen help doesn't reflect the option name, so update that to match. Also, fix the wording of the "Rescan devices" help. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Exit safe mode on configuration changeSamuel Mendoza-Jonas2014-09-042-2/+27
| | | | | | | | | | Selecting 'OK' in the configuration or language select screen will send a configuration change to the server and exit safe mode. Exit safe mode explicity and warn the user that they are about to exit it. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Update 'add-url' help messageSamuel Mendoza-Jonas2014-08-251-4/+4
| | | | | | | We should make it clear that we're looking for a PXE-style config file. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add new main menu options to help screenJeremy Kerr2014-08-211-0/+8
| | | | | | | The language, rescan and retrieve options are new, so add them to the help text. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Make device labels translateableJeremy Kerr2014-08-211-5/+5
| | | | | | | | | | We're not using gettext for the device label strings; this change adds the necessary macros to do so. Also, we change "Interface" to "Network", to make the label a little more obvious. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* autotools: Use non-recursive makeJeremy Kerr2014-08-014-137/+101
| | | | | | | | | | | | With the current testing infrastructure, we don't have a strictly hierarchical set of dependencies. This causes problems with a recursive make, and means we have to hack around some of the dependencies. This change generates a single, top-level makefile from all of the Makefile.am fragments. We still need the po/ directory as a separate SUBDIR, but all others can be converted to non-recursive. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add support for 'add-url' actionSamuel Mendoza-Jonas2014-07-289-4/+349
| | | | | | | | Creates a menu option to specify a remote conf file url to send to the server for parsing. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add language selector & support for language changesJeremy Kerr2014-07-287-5/+478
| | | | | | | This change adds a language selector UI, and allows language changes from incoming configuration messages. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/common: Add discover_client_enumerate to re-add device dataJeremy Kerr2014-07-282-0/+23
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Move menu initialisation to cui codeJeremy Kerr2014-07-287-135/+124
| | | | | | | | | | | We'll want to re-initialise the petitboot main menu (when the language is changed), which we can't do if the items are populated entirely from the main() function. This change moves the menu initilisation to the cui code, we we can re-init when necessary. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* i18n: Add english translationJeremy Kerr2014-07-281-2/+2
| | | | | | No translation necessary. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Mark help text as translateableJeremy Kerr2014-07-281-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Use a separate type for help textJeremy Kerr2014-07-2814-32/+53
| | | | | | | | | | | | Because it's initialised statically, help text won't be directly gettext()-ed. Instead, we need to perform the gettext translation at runtime, and pass untranslated strings into the help_screen code. Instead of trusting callers to pass the untranslated strings though, we encapsulate the help text data into struct help_text, so we know we have an unstranslated string. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* i18n: Mark translatable strings for ncurses UIJeremy Kerr2014-07-289-81/+105
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add gettext infrastructureJeremy Kerr2014-07-281-3/+0
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add device hierarchySamuel Mendoza-Jonas2014-07-223-9/+197
| | | | | | | | Boot options are now listed under their matching boot device in the ncurses UI to help differentitate similar boot option names Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add safe mode indicatorJeremy Kerr2014-07-221-0/+5
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: allow tab/backtab to skip through a widget's fieldsJeremy Kerr2014-07-221-2/+19
| | | | | | | | Since we may have a long list of devices on the configuration screen, we'd like a way to jump between widgets. This change repeats the PREV_FIELD/NEXT_FIELD driver request on these events. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Make Network: heading consistent with other labelsJeremy Kerr2014-07-221-1/+1
| | | | | | | The 'Network' label was originally intended as a header, but we should keep it consistent with other field labels. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Expose boot_device configuration through UIJeremy Kerr2014-07-222-22/+170
| | | | | | | | | | | | | | | | Add a configuration setting for the default boot device. We change the autoboot option to a select, as we have three possible behaviours for autoboot: ( ) Don't autoboot ( ) Autoboot from any disk/network device ( ) Only autoboot from a specific disk/network device The latter option will show a list of possible devices to seelct for autoboot behaviour. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Remove net_conf parameter from sconfig_screen_layout_widgetsJeremy Kerr2014-07-171-8/+7
| | | | | | | We always pass screen->net_conf_type as this parameter, so we may as weel grab it from screen directly. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: specify a fixed length for status messagesJeremy Kerr2014-07-161-2/+2
| | | | | | | | | | Incoming status messages can be an arbitrary length; if so, the status line may be corrupt. This change uses the 'n' variant of mvwaddnstr(), so we only write one line of characters. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover,ui: fix checks for debug optionJeremy Kerr2014-05-011-1/+1
| | | | | | We need to check for equality with opt_yes, not just check for non-zero. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: only cancel default boot on valid key eventsJeremy Kerr2014-04-221-4/+7
| | | | | | | | | | We're seeing occasionaly failures to autoboot due to supirious key events (getch() returing -1) on an IPMI console. This change modifies the process_key logic to only abort the default if we see a valid key event. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Always provide a key definition for backtabJeremy Kerr2014-04-161-0/+5
| | | | | | | | | | | | | Petitboot environments will probably want a basic terminfo defintion (eg, vt220) rather than a full linux or xterm, but vt220 and friends don't define a backtab key. Backtab can be useful for proper form navigation, and without a key definition, we just get an escape, which exits the current screen. This change provides a static definition for KEY_BTAB, so we should always have one available. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Use a fixed-sized for small, known-length fieldsJeremy Kerr2014-04-163-1/+11
| | | | | | | | | | | | | Fields without O_STATIC can "scroll" horizontally, and we may miss a left-hand section of text from the current display. This can mean that the user can't leave a validated field with no indication why, if the off-to-the-left data is not a valid entry. This change adds a widgetset function to mark a field as fixed-size, so we don't have this scrolling behaviour. This means that the entire field contents will always be visible, and any validation errors can be seen. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Ensure boot option labels are displayable as menu itemsJeremy Kerr2014-04-101-1/+43
| | | | | | | | | | | | | | | ncurses' new_item() expects the name parameter to be a "printable string", by converting it to a wchar *, and checking that each character is printable with iswprint(). If it fails, we won't see a boot option at all. This change introduces a function to convert the label into something we know is printable, and valid UTF-8. If mbstowcs fails, we replace it with a generic 'Invalid option' label. If we encounter a valid multibyte string with unprintable characters, we replace those with U+fffd REPLACEMENT CHARACTER. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Fix discover_client leakJeremy Kerr2014-04-101-0/+1
| | | | | | | We're not freeing the discover_client on exit, as it's not attached to any existing talloc context. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud