summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* ui/ncurses/nc-widgets: Unify select keyJeremy Kerr2013-11-221-15/+11
| | | | | | | | We have a few instances where we check for a 'select' action (enter or space key event), and some are inconsistent. Unify these with a key_is_select() function. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Redraw entire screen with ctrl+LJeremy Kerr2013-11-221-4/+2
| | | | | | Use wrefresh(curscr) to clean and repaint the entire screen. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Ensure boot editor window is properly paintedJeremy Kerr2013-11-221-0/+2
| | | | | | | We're not currently drawing the window title correctly; we need to draw the main_ncw for this to hit the terminal. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Fix use-after-free when exiting boot option editorJeremy Kerr2013-11-221-13/+29
| | | | | | | | After we've called on_exit, we can no longer use the boot editor. This change moves individual button callbacks into process_key, which returns to the main loop. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Allow boot editor sysinfo updatesJeremy Kerr2013-11-222-65/+99
| | | | | | | We may start a boot editor (via 'New') before we have the sysinfo. To allow this, we redraw the device select. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add widgetset_set_windowJeremy Kerr2013-11-222-0/+9
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add widget_select_drop_optionsJeremy Kerr2013-11-222-0/+40
| | | | | | We want to be able to re-set the options in a select widget. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Implement intra-field scrollingJeremy Kerr2013-11-222-12/+10
| | | | | | | 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/widgets: Add widget focus offset queryJeremy Kerr2013-11-222-0/+24
| | | | | | | | | | When we have widgets that are larger than the screen, we'd like to scroll to the currently-focussed component of that widget. This change introduces a widget_focus_y function, which returns the y offset of the field's focus. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Draw boot editor into a scrollable padJeremy Kerr2013-11-221-5/+51
| | | | | | | | Like the config editor, draw the boot editor into a pad instead of directly into the sub window. This means that long device lists will be handled correctly. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Make boot editor paths relative to deviceJeremy Kerr2013-11-221-1/+65
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add device selector to boot editorJeremy Kerr2013-11-221-4/+93
| | | | | | | | Rather than expecting users to enter full (prefixed) mount paths, add a select widget to pick a device, and we automatically add the prefix when the form is submitted. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses/widgets: Add n_options check to widget_select_get_valueJeremy Kerr2013-11-221-0/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Split boot editor layoutJeremy Kerr2013-11-221-29/+59
| | | | | | | We want to make the boot editor dynamic later, so split the widget layout from the widget creation. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Make boot editor API consistent with config & sysinfo screensJeremy Kerr2013-11-226-105/+108
| | | | | | | | | | | | The boot-editor API is a little more exposed than it needs to be: the boot_editor struct does not need to be available to other files, and the init function and on_exit functions differ from those provided for the config and sysinfo screens. This change unifies the boot_editor API with those for the other screens. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: remove boot_editor_attr_fieldJeremy Kerr2013-11-221-5/+0
| | | | | | The widgetset code handles these attributes now. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add block devices to system info screenJeremy Kerr2013-11-221-2/+17
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: populate sysinfo with block devicesJeremy Kerr2013-11-224-0/+49
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* protocol: Add block device information to system infoJeremy Kerr2013-11-222-1/+49
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Use pxeconffile for udhcpc option nameJeremy Kerr2013-11-227-6/+7
| | | | | | | | | | | | The patch that went upstream for udhcpc's option 209 handling uses the option name 'pxeconffile' rather than 'conffile', and it was added as a non-default option: http://git.busybox.net/busybox/commit/?id=d3092c99ae90f This change uses the new name, and explicilty requests this option. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/pb-console: Exit after running getty in detached stateJeremy Kerr2013-11-221-0/+1
| | | | | | ... otherwise we'll try and bring the UI up on the current tty too. 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: Don't mess with prog_mode in cui_bootJeremy Kerr2013-11-191-5/+0
| | | | | | | The discover_client_boot call is asynchronous, so setting and resetting prog_mode doesn't gain us anything. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* automake: Fixups for maintainer-cleanGeoff Levand2013-11-182-2/+2
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* lib/system: Don't leak in pb_mkdir_recursiveJeremy Kerr2013-11-141-3/+6
| | | | | | If the mkdir fails, we'll exit without freeing str. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Use mkstemp rather than tempnamJeremy Kerr2013-11-141-4/+6
| | | | | | We're getting warnings from some compilers about tempnam being unsafe. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/pb-console: reset after UI exitJeremy Kerr2013-11-141-0/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses/menu: Allow space to select menu itemsJeremy Kerr2013-11-141-0/+1
| | | | | | To keep consistent with buttons, which also accept space. 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-143-9/+50
| | | | | | | | 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-145-10/+135
| | | | | | | 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-148-3/+283
| | | | | | This change adds a simple configuration editor to the ncurses UI. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Receive config messagesJeremy Kerr2013-11-132-0/+8
| | | | | | We just store the config in the cui for now. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Use nc-widgets for boot editorJeremy Kerr2013-11-132-240/+75
| | | | | | | Now that we have a simple widget set available, use this for the boot editor. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add simple ncurses form widget setJeremy Kerr2013-11-133-1/+804
| | | | | | | | | We're doing a lot of the same stuff with forms, and we'll to implement a lot of fields with the upcoming configuration interface. This change introduces a simple ncurses widget set. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add sysinfo screenJeremy Kerr2013-11-138-8/+332
| | | | | | | | Add a simple screen for displaying the struct system_info. We add this to the main menu as a selectable option, and separate it from the boot option list with an unselectable blank entry. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses/scr: Add definition for frame offsetJeremy Kerr2013-11-132-1/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: nc-menu.h needs assert.hJeremy Kerr2013-11-131-0/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/common: Don't talloc_free sysinfo and status explicitlyJeremy Kerr2013-11-132-8/+21
| | | | | | | | | | | | | Currently, we talloc_free() the sysinfo and status messages in the discover client, right after performing the ui's callback. However, the client may wish to keep a reference to this information beyond the callback invocation. This change introduces a per-message talloc context, which these structures are allocated under. This allows the callbacks to talloc_steal() anything they wish to keep a reference to. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add nc_scr_{un,}post()Jeremy Kerr2013-11-134-11/+29
| | | | | | | We may have nc_scrs that aren't interested in post/unpost information, so create helper functions that allow a NULL callback. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Move general nc init code to cui moduleJeremy Kerr2013-11-133-35/+32
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Handle incoming configuration messagesJeremy Kerr2013-11-134-3/+26
| | | | | | | When the client sends us a PB_PROTOCOL_ACTION_CONFIG message, we want to update the current config. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* config: Implement config messagesJeremy Kerr2013-11-135-0/+62
| | | | | | On client connect, send a PB_PROTOCOL_ACTION_CONFIG message. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/pb-protocol: Add serialise & deserialise for struct configJeremy Kerr2013-11-132-0/+209
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/types: use unsigned int for interface, dns and prio countsJeremy Kerr2013-11-135-9/+10
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib: Move config structure defitinitions to types.hJeremy Kerr2013-11-132-38/+37
| | | | | | | | We don't want to require the lib/pb-config interface in the UIs, just the structure defintions. This change moves them to the common types header. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud