summaryrefslogtreecommitdiffstats
path: root/ui/ncurses/nc-config.c
Commit message (Collapse)AuthorAgeFilesLines
* ui/ncurses: Disable autoboot if boot list is emptySamuel Mendoza-Jonas2016-04-051-2/+1
| | | | | | | | If an empty boot order is saved disable autoboot. However don't set autoboot_enabled to false by clearing the list, as this will hide the list when it is likely the user wants to make changes. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Re-add autoboot selection to config screenSam Mendoza-Jonas2016-03-231-19/+63
| | | | | | | | | | | | | | The new boot order interface removed the autoboot enable/disable buttons. However this means the only way to disable autoboot is to remove all options from the boot order list, or know that you can manually set the `auto-boot?` flag in nvram. This re-introduces an autoboot enable/disable widget so that autoboot can be disabled without losing an existing boot order. The translated strings for "Autoboot" are salvaged from earlier use, and two new untranslated strings are introduced. Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
* ui: add URL for static configurations to load a specified fileNishanth Aravamudan2015-12-181-4/+28
| | | | | | | | | | | | In certain configurations, e.g. automation, we want to use static networking but load a particular file, automatically and parse it as a pxelinux config file. Currently, we support something like this for DHCP based booting, but not static. Add a URL field to the UI for static configurations and reuse the logic from device_handler_process_url() to load the specified file. Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com> Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Improve scrolling behaviourSamuel Mendoza-Jonas2015-09-101-6/+10
| | | | | | | | | | The nc-config screen now includes several select options with a FIELD height greater than one, but config_screen_widget_focus() will only scroll down enough to see the first line of text. Update config_screen_widget_focus() to try and make as much of the focussed widget visible as possible. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Allow text wrapping in select widgetsSamuel Mendoza-Jonas2015-09-101-2/+4
| | | | | | | | | | Several string translations used in select widgets are longer than the maximum possible width of the widget. Rather than associating several FIELDs with a select option, use a fold_text callback to pad out substrings of the original string such that the ncurses O_WRAP option properly wraps strings within the field. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Improve update handling in nested screensSamuel Mendoza-Jonas2015-09-071-15/+30
| | | | | | | | | | | | | | | | Several screens in petitboot-nc require an update if a config or sysinfo update is received. However if those screens exist but are not the current screen they will incorrectly try to draw to the screen. Where the currently active screen is a textscreen (eg. a help screen) the update is delayed until after the screen is exited. In the particular case of nc-config where the current screen can be an nc-subset screen, the nc-subset screen is exited immediately so the update can be performed, since the nc-subset screen depends on the information in the previous screen. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Change arrangement of boot order buttonsSamuel Mendoza-Jonas2015-09-071-6/+11
| | | | | | | | | | | The buttons 'Add Device', 'Clear', and 'Clear & Boot Any' are short enough to be positioned horizontally, but several localisations have strings as long as all three buttons combined. Instead arrange the buttons vertically and allow longer strings to resize the width of the button to fit the whole string. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Resize & adjust OK/Help/Cancel buttonsSamuel Mendoza-Jonas2015-09-071-3/+3
| | | | | | | | The localisation of 'OK' is cut short in a few languages by a character or two - adjust the buttons in each affected screen slightly to accommodate. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* Recognise storage devices on USB busSamuel Mendoza-Jonas2015-08-311-1/+1
| | | | | | | | Users may want to prioritise USB-attached storage devices differently to other devices. Detect if a device is USB-attached and add a new device type to identify it. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* Make read-only guarantee user-settableSamuel Mendoza-Jonas2015-08-061-1/+27
| | | | | | | | Create a new Petitboot option 'petitboot,write?' that specifies whether the system is allowed to mount devices read-write. The option can be toggled by the user in the nc-config screen. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Layout tweaks for boot order interfaceJeremy Kerr2015-06-261-11/+11
| | | | | | | | | | | | | | | | | | | | This change implements a few minor tweaks for the bootorder layout interface: - make the verical spacing of widgets more consistent (we have a couple of 3-line gaps) - use a consistent 2-space gap between buttons on the same line - clarify the title text for the subset widget instance, and move the select widget closer to the title - use consistent title-case for widget labels - left-align the select & button widgets on the subset screen, for consistency with other screens Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* 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>
* 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: Reduce unnecessary calls to redrawwinSamuel Mendoza-Jonas2015-02-161-1/+7
| | | | | | | | | | | | | | | | | | | | | | | 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: 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: Properly size cancel and help buttonsSamuel Mendoza-Jonas2014-10-081-3/+3
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Expand cancel & help button widthSamuel Mendoza-Jonas2014-09-231-4/+4
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* 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>
* 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: Exit safe mode on configuration changeSamuel Mendoza-Jonas2014-09-041-1/+14
| | | | | | | | | | 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: Use a separate type for help textJeremy Kerr2014-07-281-2/+2
| | | | | | | | | | | | 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-281-32/+38
| | | | 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-221-17/+151
| | | | | | | | | | | | | | | | 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: Use a fixed-sized for small, known-length fieldsJeremy Kerr2014-04-161-1/+5
| | | | | | | | | | | | | 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: clear DNS server setting before appending new serversJeremy Kerr2014-04-071-0/+4
| | | | | | | | | | Currently, we have a bug where newly-configured DNS servers are appended to the existing set of servers, rather than replacing them. This change clears the existing servers out before adding the newly-configured ones. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Unify key bindings & key help textJeremy Kerr2014-01-311-2/+15
| | | | | | | | | | This change is a small cleanup of the key bindings; we ensure that the general key bindings are available (and documented) on all screens. In order to keep things consistent, this change adds an initial UI guidelines text file, which documents the general key bindings. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add help to system configuration screenJeremy Kerr2014-01-311-4/+25
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: do all config screen updates in config_screen_postJeremy Kerr2014-01-311-5/+10
| | | | | | | | We call _post when the config screen is to be displayed, so do all drawing here. This means we get the same drawing code on both init and update. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/pb-config: Add config_copyJeremy Kerr2014-01-301-2/+3
| | | | | | | | | | | | | | At the moment, UIs have the config_set_defaults function to estabilish an initial configuration when performing an update. Rather than using the defaults, this change provides a config_copy() function, so that the updated configuration can be initialised from the current config. With this in place, the UI/server-common pb-config module can be reduced to just the one function. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses/nc-config: Add validation for network settingsJeremy Kerr2013-12-181-9/+30
| | | | | | | Use the new widget validators, plus a bit of whole-form logic, to implement some basic validation on the config UI. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses/nc-config: expand mask fieldJeremy Kerr2013-12-181-1/+1
| | | | | | This makes it obvious if there's more than two characters in the field. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* configure: Use AC_GNU_SOURCEJeremy Kerr2013-12-181-2/+3
| | | | | | | Rather than #defining _GNU_SOURCE in our .c files, we can define this from config.h instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add link status to system info & system config screensJeremy Kerr2013-12-181-2/+7
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Implement intra-field scrollingJeremy Kerr2013-11-221-6/+5
| | | | | | | Now that we can calculate the focus within a field, ensure that the focussed-element remains scrolled. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Fix pad size checkJeremy Kerr2013-11-191-1/+1
| | | | | | We need the y-coord, not x. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add descriptive text for configuration editorJeremy Kerr2013-11-141-12/+44
| | | | | | | | This change adds: - 'seconds' to the timeout text entry - examples to the ip/mask, gateway and DNS text entries Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses/nc-config: Draw config form into a scrollable padJeremy Kerr2013-11-141-4/+70
| | | | | | | | | | Currently, when the config form is larger than the screen size, the form fails to draw. This change draws the config screen onto a pad instead, which we can scroll. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* nui/ncurses: Allow config screen updatesJeremy Kerr2013-11-141-8/+41
| | | | | | | | We may receive configuration (or sysinfo) data after the configuration screen has been displayed. Implement config_screen_update and redraw the widgetset when new config data arrives. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add help for the DNS optionJeremy Kerr2013-11-141-1/+14
| | | | | | It's not obvious why it's there when we're configuring DHCP. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Populate configuration interface with current defaultsJeremy Kerr2013-11-141-14/+85
| | | | | | | Sets the default values of configuration widgets to the values found in t he current config. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Parse configuration form & send to serverJeremy Kerr2013-11-141-10/+107
| | | | | | | This change implements the configuration save action, when the user submits the nc-config form. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add network configurationJeremy Kerr2013-11-141-8/+130
| | | | | | | Add network configuration parameters. This requires a somewhat-dynamic layout, as the fields shown depend on earlier configuration. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add basic config editorJeremy Kerr2013-11-141-0/+213
This change adds a simple configuration editor to the ncurses UI. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud