Commit Graph

210 Commits

Author SHA1 Message Date
Maciej Borzecki 3967329832 console_conf/ui/views/chooser: use lowercase action title in canned summary
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-04-08 11:57:00 +02:00
Maciej Borzecki a957c5b889 console_conf/chooser: UI tweaks
- drop the ABORT button
- introduce BACK button, goes back to the correct previous screen
- sort actions in the order of run -> recover -> install -> rest
- capitalize action title strings
- simplify current model actions screen
- user hints in the confirm screen for well known modes
  - generic hint for unknown modes

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-04-07 17:38:45 +02:00
Maciej Borzecki d3ac0d6f36 console_conf/chooser: use model display name in top banner
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-04-07 17:36:47 +02:00
Maciej Borzecki ed791e5c9e console_conf/models/systems: add method for forgetting the current selection
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-04-07 17:22:29 +02:00
Michael Hudson-Doyle 00e33ae0e1 include ssh host key details in ssh help 2020-04-06 14:10:26 +12:00
Michael Hudson-Doyle fac202d123 move newly added tests to tests directories 2020-04-02 10:18:07 +13:00
Dimitri John Ledkov 590b4b8f23
Merge pull request #655 from bboozzoo/bboozzoo/uc20-recovery-chooser
console_conf: implement UC20 recovery chooser
2020-04-01 22:05:30 +01:00
Dimitri John Ledkov c2aa72a9ee
Merge pull request #672 from xnox/consoleconf-focus-identity
consoleconf: focus on entry field in identy.
2020-04-01 21:54:00 +01:00
Maciej Borzecki 0b58dd598b console_conf/controllers: add tests for recovery chooser
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-04-01 16:17:20 +02:00
Maciej Borzecki b0ea2e1be7 console_conf/controllers/chooser: show current system actions first
When we know which system is current, show its actions first. Optionally allow
opening the list of other systems.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-04-01 16:17:20 +02:00
Maciej Borzecki 95b65d1caf console_conf/ui/views: add screen with actions of the current system
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-04-01 16:17:20 +02:00
Maciej Borzecki 6ae155faf7 console_conf/ui/views: sort recovery systems, indicate which is the current one
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-04-01 16:00:34 +02:00
Maciej Borzecki d7e03cd5a8 console_conf/models: identify the current system
When creating a recovery systems model, find out which of the systems is
current.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-04-01 15:58:34 +02:00
Dimitri John Ledkov dffed63df5 consoleconf: focus on entry field in identy. 2020-04-01 14:32:55 +01:00
Michael Hudson-Doyle cab565304a write netplan directly to the target
rather than via curtin and then cloud-init
2020-04-01 19:37:02 +13:00
Maciej Borzecki a147c720ba console_conf: run as recovery chooser when --recovery-chooser-mode is provided
Add support for --recover-chooser-mode command line argument. When provided, run
as a recovery chooser, rather than as a regular console-conf instance.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-03-24 15:09:50 +01:00
Maciej Borzecki f6ea3bc960 console_conf: add an app for the recovery chooser
Add an app and hook it up with the rest of elements.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-03-24 15:09:50 +01:00
Maciej Borzecki 8d2f1f9a8b console_conf/controllers: add recovery chooser controllers
Add controller used by the recovery chooser.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-03-24 15:09:50 +01:00
Maciej Borzecki 5504a9aa91 console_conf/views: add recovery chooser views
Add views used by recovery chooser:
- welcome - recovery chooser specific message
- chooser - list of seed systems and actions
- confirm - where user confirms the selected action

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-03-24 15:09:50 +01:00
Maciej Borzecki c328152fb8 console_conf/models: add models for recovery systems
Add models for recovery chooser systems, brand information, snapd models and
recovery actions.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-03-24 15:09:50 +01:00
Michael Hudson-Doyle cb52ab75a2 use the asyncio loop object rather than the urwid loop almost everywhere 2019-12-20 12:04:38 +13:00
Michael Hudson-Doyle 01e5261b3f kill off other top level signals 2019-12-16 23:09:17 +13:00
Michael Hudson-Doyle 2765e6a773 replace next-screen/prev-screen signals with method calls 2019-12-16 23:02:03 +13:00
Dimitri John Ledkov d19e405666 Unbreak console-conf in UC20 images 2019-12-14 03:00:17 +00:00
Michael Hudson-Doyle 64378cdb95 refactor how controllers are stored a bit 2019-12-12 10:38:03 +13:00
Michael Hudson-Doyle a2ccb0cd9e remove all remaining footer-related things 2019-09-30 09:32:23 +13:00
Michael Hudson-Doyle b24dbf7095 remove environment_check stuff 2019-09-09 15:27:29 +12:00
Michael Hudson-Doyle 5dca5e861e remove some pointless wrapping of exceptions 2019-09-09 14:30:49 +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
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 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 caf026fb23 fix error logging in host_key_fingerprints 2019-09-03 13:13:58 +12: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 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 cad6817118 fix console-conf again 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 968fe145e6 consoleconf: Fixup write_login_details_standalone
Port to use prober API, stop using removed APIs.
2019-08-14 14:04:29 +01:00
Dimitri John Ledkov dfab5563c1 console_conf: unbreak LoginView 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 a4c7e36408 consoleconf: fix welcome header/excerpt 2019-08-07 21:26:14 +01:00
Dimitri John Ledkov dcb3458810 Introduce (currently unused) click/script arguments to console-conf
This prevents crash on startup.
2019-08-07 20:13:29 +01: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
Michael Hudson-Doyle d0c41469a7 remove login model/controller/view from subiquitycore
long ago subsumed into other code
2019-03-07 14:01:52 +13:00
Michael Hudson-Doyle c0d66f5540 make scrollbar less intrusive
also pretty up its implementation a bit while I am here
2018-06-18 21:24:23 +12:00
Michael Hudson-Doyle 0d95adb89e
Merge pull request #360 from sil2100/console-conf-core-version
console-conf identity: do not hard-code the core version
2018-06-15 14:18:52 +12:00
Michael Hudson-Doyle 9ef56239f8 fix snap build
* use a different way to avoid depending on i18n in tox
 * add __init__.py files to new packages
2018-06-13 13:21:20 +12:00
Łukasz 'sil2100' Zemczak d5413fde2d Zyga is right - better to check the ID instead of NAME. 2018-06-12 17:14:37 +02:00
Łukasz 'sil2100' Zemczak 75bdbab36b Whoops, it was a real failure reported by flake8 - fix missing bracket. 2018-06-11 13:22:39 +02:00
Łukasz 'sil2100' Zemczak 32b724e608 Forgot the version string in one template. 2018-06-11 13:17:30 +02:00
Łukasz 'sil2100' Zemczak 17c6358320 console-conf identity: Reuse the login_details_tmpl_no_ip template in standalone, use os-release to determine the Ubuntu Core version as we now support both 16 and 18. 2018-06-08 21:21:02 +02:00
Scott Moser af94275618 Make tox and Makefile more similar.
This does a few things with the end goal of making simplifying and
making consistent tox and 'make' methods of test or check.

Things here:
 * move python programs out of bin and into their own main.  Use
   entry_points to get scripts written for them.  One gain here is
   that we no longer have python programs that are not named .py.
   flake8 and friends would not check those programs by default.
 * install scripts in bin/ using the setup.py scripts and adjust
   snapcraft.yaml and debian packaging for that.
 * declare and use PYTHON in Makefile to avoid repeating 'python3'
 * declare and use CHECK_DIRS in Makefile for list of dirs to check.
 * no longer run 'flake8' from 'make check' by default.
 * remove the old tests/ directory.
2018-06-05 22:19:17 -04:00
Ryan Harper dc5661ebd5 pyflakes fixes for console_conf/__init__.py 2018-05-24 16:59:31 -05:00
Ryan Harper 103fc1edda pep8 fixes for console_conf/ui/views/identity.py 2018-05-24 16:59:31 -05:00
Ryan Harper b1d9581b9a pep8 fixes for console_conf/ui/views/login.py 2018-05-24 16:59:31 -05:00
Ryan Harper a06c15bd28 pep8 fixes for console_conf/ui/views/welcome.py 2018-05-24 16:59:31 -05:00
Ryan Harper 1451bfc93b pep8 fixes for console_conf/models/console_conf.py 2018-05-24 16:59:31 -05:00
Ryan Harper 8743ff5200 pep8 fixes for console_conf/controllers/identity.py 2018-05-24 16:59:31 -05:00
Ryan Harper a0bf68f3c4 pyflakes3 fixes
Add and enable pyflakes3 on console_conf, subiquity, subiquitycore and tests.
Replace NOQA markers with __all__ declarations for module imports.
Replace some obvious deadcode that voilates flake8, separate pass for removing
dead code rather than commenting will be handled later.
2018-05-24 16:51:51 -05:00
Ryan Harper 3c9b2e28c7 Drop commented out / dead code 2018-05-23 18:53:12 -05:00
Michael Hudson-Doyle 626488e988
Merge pull request #334 from CanonicalLtd/mwhudson/move-excerpt-title-to-view
move excerpt, title and footer from controller to view
2018-05-22 22:38:39 +12:00
Ryan Harper e1a6542d86 run_command returns a CalledProcess object, no 'output' attribute, but 'stdout' instead 2018-05-21 11:29:41 -05:00
Michael Hudson-Doyle cbd5afe2c0 move imports of i18n higher so _ is always installed before tests are imported 2018-05-21 10:14:34 +12:00
Michael Hudson-Doyle 488802fc8b update users of run_command (i thought there was more than this) 2018-05-18 13:11:15 +12:00
Michael Hudson-Doyle b3da7266b9 do not show wlan interfaces in server installer 2018-03-21 09:35:21 +13:00
Michael Hudson-Doyle d9091b12dc add __init__.py to console_conf/models/ 2018-03-16 15:29:50 +13:00
Michael Hudson-Doyle c31183ff13 change danger color to be #ff0000 2018-03-12 14:28:34 +13:00
Michael Hudson-Doyle 6f4a87101b flakes-- 2018-03-08 19:05:51 +13:00
Michael Hudson-Doyle 0273a3d110 "modernize" console-conf views 2018-03-08 18:51:39 +13:00
Michael Hudson-Doyle 1d4d5021ec fix button creation 2018-03-08 18:06:07 +13:00
Michael Hudson-Doyle 1d4fa36dee give console_conf its own palette definition 2018-03-08 18:03:51 +13:00
Michael Hudson-Doyle 386d44ee14 add ConsoleConf model and some other bits to get to point of starting the UI up 2018-03-08 16:39:03 +13:00
Michael Hudson-Doyle 68c15176ac some trivial stuff 2018-03-08 16:34:25 +13:00
Michael Hudson-Doyle 86ac32905b change the progress bar to show x / y rather than a %age
Also make its progress more automatic.
2017-09-26 09:01:22 -04:00
Dimitri John Ledkov 648d7d4086
Buttons 2017-09-18 14:01:11 +01:00
Michael Hudson-Doyle 61a88fb422 add missing files 2017-09-08 13:00:18 +12:00
Michael Hudson-Doyle 34f1e67d49 make it possible for subiquity and console_conf to use different colours 2017-09-07 21:37:48 +12:00
Michael Hudson-Doyle 395b30451e stop being clever in handling of escape in network screens 2017-04-05 14:36:46 +12:00
Michael Hudson-Doyle 618c4e6e72 do not crash in final console-conf screen if no host keys are read (mostly dry-run mode) 2017-04-05 14:26:28 +12:00
Michael Hudson-Doyle 435ed77ade fix crash on startup with no ip address
console-conf-write-login-details would crash if it ran before the system
got an ip address. re-jig things a bit so that it displays an nice message
when there is no ip address but still checks for a new address every 5s until
it finds one.
2017-03-28 15:54:50 +13:00
Michael Hudson-Doyle 3facaab59e more care around how ttyname is displayed 2017-02-17 15:08:12 +13:00
Michael Hudson-Doyle e5847fb863 rewrite login screen per feedback 2017-02-17 14:43:16 +13:00
Michael Hudson-Doyle 19ec2b5c41 only suggest the user logs in via scope global addresses 2017-02-17 14:21:54 +13:00
Michael Hudson-Doyle f44c37e0a3 fix cancel button in console-conf identity view 2017-02-17 14:18:58 +13:00
Michael Hudson-Doyle 8af0639dd4 cope with probert API changes 2017-02-17 12:37:47 +13:00
Michael Hudson-Doyle ce2bdae0bd simplify something now i know urwid a bit better 2017-02-14 15:22:43 +13:00
Michael Hudson-Doyle a6954b49e2 the various editor classes' caption argument is optional now 2017-02-14 15:19:56 +13:00
Michael Hudson-Doyle f0eb2cdf70 make Color.button etc apply the corresponding focus map
about 1e6 times more readable
2017-02-08 15:37:18 +13:00
Michael Hudson-Doyle 3c5ac3140f use new containers everywhere 2017-02-03 14:21:39 +13:00
Michael Hudson-Doyle 2408dda6c7 remove references to firstboot (an old name for console-conf?) 2017-01-26 11:18:03 +13:00
Michael Hudson-Doyle d75cbabb61 move subiquity welcome stuff out of subiquitycore 2017-01-17 12:04:15 +13:00
Michael Hudson-Doyle 24c915ff17 simplify console_conf.controllers.WelcomeController 2017-01-17 11:34:32 +13:00
Michael Hudson-Doyle ee51fda2f5 console_conf.views.welcome.WelcomeView no longer inherits from CoreWelcomeView 2017-01-17 11:34:32 +13:00
Michael Hudson-Doyle e50ccb9c76 stop sharing WelcomeController 2017-01-17 11:34:32 +13:00
Michael Hudson-Doyle 5f6be3c094 stop consoleconf's IdentityController inheriting from BaseIdentityController 2017-01-17 11:34:32 +13:00
Michael Hudson-Doyle d65b4191aa improve grammar in login-details.txt 2016-12-15 20:50:51 +13:00
Michael Hudson-Doyle 74dc27043b rewrite login-details.txt a bit
for https://bugs.launchpad.net/ubuntu/+source/subiquity/+bug/1643930
2016-11-23 10:16:12 +13:00