Commit Graph

613 Commits

Author SHA1 Message Date
Michael Hudson-Doyle 947f14a0af move stretchy signals from overlay to stretchy itself
Also add overridable opened/closed hooks.
2019-09-12 21:36:40 +12:00
Dimitri John Ledkov 25ed1e281f
Merge pull request #533 from mwhudson/app-specific-uis
allow the application to have a widget in the bottom right
2019-09-05 14:36:12 +01:00
Dimitri John Ledkov 0a1a9faa12
Merge pull request #534 from mwhudson/overlay-close-signal
define a 'closed' signal on StretchyOverlay
2019-09-05 14:34:38 +01:00
Michael Hudson-Doyle ea258973fc define a 'closed' signal on StretchyOverlay
And return the overlay from show_stretchy_overlay, so you can do things
when the overlay is closed.

Will be used by the help-showing stuff.
2019-09-05 12:30:03 +12:00
Michael Hudson-Doyle 3c2fd87e9b Allow the UI to have a widget in the bottom right of the screen
This will be a help button in subiquity soon.
2019-09-05 12:22:56 +12:00
Michael Hudson-Doyle 3f8c005237 allow console_conf and subiquity to use different UI classes
Subiquity is going to grow some global UI elements that console_conf
does not want.
2019-09-05 11:58:25 +12:00
Michael Hudson-Doyle c1e973fe1e Add Controller.showing helper 2019-09-04 15:21:26 +12:00
Michael Hudson-Doyle 9a05653150 Tweak Controller API
* rename 'default' method to 'start_ui'
 * add 'end_ui' hook
 * add Application.cur_controller helper
2019-09-04 15:18:45 +12:00
Michael Hudson-Doyle 3605514d30 extract some methods out of Application.run 2019-09-03 13:14:17 +12:00
Michael Hudson-Doyle 43f414da1f add a way to suspend the subiquity UI and run some other command
This will be used for the drop to shell functionality and also to allow
viewing an error report before we submit it to daisy.

It is almost but not quite surprisingly easy (I added a long-ish comment
about the difficulties).
2019-08-23 11:19:21 +12:00
Michael Hudson-Doyle 1947abcc5e fix mismerge self.common["loop"] vs self.loop 2019-08-20 10:34:31 +12:00
Dimitri John Ledkov 1dfffbda01
Merge pull request #523 from mwhudson/run_in_bg-fd-leak
fix fd leak in run_in_bg
2019-08-19 11:30:52 +01:00
Michael Hudson-Doyle f85fb6aac7
Merge pull request #525 from mwhudson/outermost-pile
Make the outermost widget an instance of Pile rather than Frame
2019-08-16 14:51:32 +12:00
Michael Hudson-Doyle 9e40dcbad6 Make the outermost widget an instance of Pile rather than Frame
Current plans involve putting a focusable widget (a help button) in the
footer, and Pile's behaviour is much more what we want than Frame for
this.
2019-08-16 14:31:03 +12:00
Michael Hudson-Doyle b38f47bf42 Merge branch 'master' into core-cleanups 2019-08-16 14:24:56 +12:00
Michael Hudson-Doyle 9b7eb8883c fix fd leak in run_in_bg
Notices this while debugging something entirely different.
2019-08-15 13:59:29 +12:00
Michael Hudson-Doyle 90d376fbbd put the terminal into raw mode
For whatever reason, urwid puts the terminal into cbreak mode during
initialization. If we put the terminal into raw mode instead, then we
don't have to ignore SIGINT and SIGQUIT, which is good, because when we
support dropping to a subshell we don't want to run that subshell with
those signals ignored, because that is extremely confusing.

This also lets me dump the code that puts the terminal into raw mode
during keyboard detection.
2019-08-15 13:50:23 +12:00
Michael Hudson-Doyle 518e52e8e2 move "global" key handling to an unhandled_input handler
The only observable difference here is that ctrl-x now exits in dry-run
mode when a pop up is open.
2019-08-15 13:34:10 +12:00
Michael Hudson-Doyle 7096501a6d reduce answers-related boilerplate 2019-08-15 13:34:10 +12:00
Michael Hudson-Doyle 81b9c883f3 do not copy so many things from app to controller in Controller.__init__ 2019-08-15 13:34:09 +12:00
Michael Hudson-Doyle 98908e91b2 get rid of silly common dictionary that was passed around a bit everywhere 2019-08-15 13:33:38 +12:00
Dimitri John Ledkov 962fd3ebd3 NetDev: bring back actual_global_ip_addresses used by console_conf. 2019-08-08 15:02:39 +01:00
Dimitri John Ledkov e755bf4b5f console_conf/subiquity: split identitymodel, as it is not the same at all. 2019-08-08 15:02:39 +01:00
Dimitri John Ledkov 290c26d244 consoleconf: rewrite identity page. 2019-08-07 21:35:35 +01:00
Dimitri John Ledkov be50b59dcd Allow starting subiquity/console-conf without translations.
Set fallback=True on gettext.translation() call such that it returns
NullTranslation object. This means subiquity/console-conf can start,
even if .mo files are not build in the tree, or are outright missing.
2019-08-07 12:40:10 +01:00
Michael Hudson-Doyle 6bbe02774f assume a default route on a down link has gone away
it seems netlink routing table messages are more of a notifications of
changes being explicitly made vs notifications of all changes to
routing.

for https://bugs.launchpad.net/subiquity/+bug/1837822
2019-07-25 17:37:41 +12:00
Michael Hudson-Doyle 94df386a6c display a message when the user obstinately types in an unsuitable mount point 2019-07-24 13:03:04 +12:00
Michael Hudson-Doyle 619a92e252 always copy the options when creating a Selector
as I want to support mutating them after the fact
2019-07-24 11:27:29 +12:00
Dimitri John Ledkov 94de7dc522 Merge remote-tracking branch 'origin/pull/500/head'
Merge using existing partitions. Revert to using archive
curtin/deps/etc.

Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
2019-07-02 13:18:46 +01:00
Dimitri John Ledkov dac6f12c0f Basic zdev view 2019-06-06 16:15:15 +01:00
Michael Hudson-Doyle 628758811e support for editing existing partitions 2019-05-30 15:10:54 +12:00
Michael Hudson-Doyle 3bdca52ed4 Tweak the adjustment of table columns widths for cells with colspan > 1
When allocating space for a cell colspan > 1, preferentially
allocate space to columns that have no colspan = 1 cells. If you
have content like this (content padded to 10 and 20 chars to make
calculations easier):

[[(2, "longer content567890"), "shorter890"],
 ["shorter890", (2, "longer content567890")]]

Taking only colspan = 1 cells into account, the widths of the
columns are (10, 0, 10).

To fit the first longer content in, the current algorithm expands
the first two columns equally, so the widths become (15, 5, 10).

Then to fit the second longer content in, the second two columns
are widened equally (or nearly so), resulting in final widths
of (15, 8, 12) and a table layout like this:

    +-------------------------+--------------+
    | longer content567890    | shorter890   |
    +-----------------+-------+--------------+
    | shorter890      | longer content567890 |
    +-----------------+----------------------+

which is bizarrely asymmetrical given the input and wider than it
needs to be.

If instead we preferentially widen columns that have no width
from colspan = 1 columns, we get this layout:

    +----------------------+------------+
    | longer content567890 | shorter890 |
    +------------+---------+------------+
    | shorter890 | longer content567890 |
    +------------+----------------------+

Which is much more in line with my expectations.
2019-05-30 15:10:34 +12:00
Dimitri John Ledkov e46de5def8 Drop Installpath 2019-05-14 15:09:55 +02:00
Michael Hudson-Doyle bdf33a2adf make SubiquityModel objects easier to construct
So I can write a unittest more easily.

This involves shuffling around how locale changes are done but as my new
design document says the "controller also manages the relationship
between the outside world and the model and views" this does make things
more consistent.
2019-05-10 09:44:01 +12:00
Dimitri John Ledkov fee6fe6947 netplan.Config().config should initialize to a dict
Normally netplan.Config().config is a dict as produced by
yaml.safe_load(). However, on systems without any netplan configs that
is not true. The subiquity code that calls into this function expects
.config to be a dictionary. When it's not
subiquitycore/models/network.py produces traceback that "list does not
have get method" when trying to get 'network' key.
2019-05-02 15:22:23 +01:00
Michael Hudson-Doyle 6a72b229b1 try probing for blockdev only if probing fails; report failure to user 2019-04-29 15:58:19 +12:00
Michael Hudson-Doyle e8423acd28 do storage probing in the background 2019-04-29 15:54:47 +12:00
Michael Hudson-Doyle 3e8bc81190 add some logging around moving between screens
my best guess at why CI is currently hanging sometimes is that the
'next-screen' signal is being sent too often / too early.  add some
logging around this so that we will be able to confirm / deny this by
reading the logs.
2019-04-18 10:22:05 +12:00
Dimitri John Ledkov 488f6fd2c0
Lock answers file. 2019-04-12 17:36:12 +01:00
Michael Hudson-Doyle 7cc56a8b58 trying to debug edge ci failures
* add a bit more logging
* wait for initial network apply to finish before moving on from
  network screen
2019-04-04 12:06:41 +13:00
Michael Hudson-Doyle ec15929d60 Update to probert tip
The minimum required: it still only looks at the "blockdev" key in the
probe data, none of the exciting new stuff.
2019-04-02 13:43:09 +13:00
Michael Hudson-Doyle 3384eb5c84 small fixes 2019-03-26 11:32:02 +13:00
Michael Hudson-Doyle b485cf487b make the re-dhcp on entry to the network screen a little more discreet 2019-03-26 10:59:50 +13:00
Michael Hudson-Doyle 099e658670 make applying changes less jarring for virtual devices 2019-03-26 10:59:50 +13:00
Michael Hudson-Doyle 23488a6f2e some fixes found in testing 2019-03-26 10:59:50 +13:00
Michael Hudson-Doyle b571b3d1a9 track and display DHCP status
Mark all devices with DHCP enabled as pending when the config is
applied, and mark them as timed out ten seconds later if they have not
received any addresses.
2019-03-26 10:57:36 +13:00
Michael Hudson-Doyle eae2497d41 auto disable inactive NICs
This disables any NIC that does not have a global address by the first
time the network screen is shown
2019-03-26 10:57:36 +13:00
Michael Hudson-Doyle 3bb9268974 apply network changes immediately, rather than when the "Done" is pressed
diff makes this change look more involved than really necessary :(
2019-03-26 10:57:33 +13:00
Michael Hudson-Doyle 594db86618 have DownNetworkDevices do its work in a background thread
not that it should block, but no reason not to
2019-03-26 10:57:13 +13:00
Michael Hudson-Doyle ff59de4a9c change "Done" button to "Continue without network" if there is no default route 2019-03-26 10:57:13 +13:00