Commit Graph

25 Commits

Author SHA1 Message Date
Michael Hudson-Doyle 0395b6e9b0 add support for 'dd' image sources
I think only a core dd image source will work for now. Probably.
2023-08-03 09:07:06 +12:00
Dan Bungert 34d40643ad format with black + isort 2023-07-25 15:27:42 -06:00
Michael Hudson-Doyle 9ff059eae7 put zdev rows directly in a listbox, not in a pile in a listbox
this required adding TableListRow.set_contents.

it fixes (partly by accident) a crash when a row becomes unselectable
after a refresh (https://bugs.launchpad.net/subiquity/+bug/1874114), it
also makes the home and end keys do something sane.

really this view should not rebuild every row on any change, but that's
something for another day.
2020-04-22 15:36:06 +12:00
Dimitri John Ledkov dce0f10c10 Merge guided method & disk selection into one screen. (#588)
Merge guided method & disk selection into one screen.
2019-12-17 12:59:03 +13:00
Michael Hudson-Doyle 3d9cbeac95 light sanitization of log statements 2019-09-09 14:28:48 +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
Michael Hudson-Doyle f4cf947b0a center the list of disks 2019-02-04 17:41:11 +13:00
Michael Hudson-Doyle 15b6bb1114 Major refactor of network model
The main thrust of this is to not create virtual interfaces until
applying the config.

This meant that the network model has to change a bit to be able to
represent interfaces that do not yet exist on the system. I did this
by ripping out most of the existing network device code: now a
NetworkDev is really just a wrapper for the config for a device and (if
it exists) the netlink data too. A few places had to adjust to checking
if the netlink info is available before accessing it but all in all it
was not that painful.

There are a few other refactorings in this commit that perhaps should be
split out (how the bond parameters are handled, some stuff about
resizing the table rows when interfaces are edited) but it doesn't
really seem worth it.
2018-10-31 09:58:56 +13:00
Michael Hudson-Doyle c69b89b4df expand a whinge about urwid's focus behaviour 2018-07-11 09:35:01 +12:00
Michael Hudson-Doyle 91def10468 improve message on vlan interfaces 2018-07-10 22:58:47 +12:00
Michael Hudson-Doyle 53a14e30ad make updates to network screen in response to netlink events more finegrained 2018-07-10 13:25:05 +12:00
Michael Hudson-Doyle d5f136c413 improve behaviour when a spanning column makes table want to be wider than view 2018-07-06 15:20:25 +12:00
Michael Hudson-Doyle 38eccb8382 use the new variable table padding on filesystem views 2018-06-29 14:00:22 +12:00
Michael Hudson-Doyle 5e621a4780 allow for variable spacing between table columns 2018-06-29 13:40:58 +12:00
Michael Hudson-Doyle dbe07faa5c fix infinite loop in table width calculations 2018-06-29 09:24:12 +12:00
Michael Hudson-Doyle 1895d98ac4 tweak TableRow.selectable 2018-06-26 11:40:02 +12:00
Michael Hudson-Doyle 22ae45e99b move widget_width() to its own module
also allow our widget subclasses to specify their width
2018-06-26 09:59:48 +12:00
Michael Hudson-Doyle 7093006711 fix binding more than two tables 2018-06-21 20:48:08 +12:00
Michael Hudson-Doyle 88e23fce54 fix distribution of space when widening columns to accommodate a colspan>1 column 2018-06-21 16:07:00 +12:00
Michael Hudson-Doyle f09696862a add a column option to allow a column to take available space 2018-06-21 16:07:00 +12:00
Michael Hudson-Doyle 8eb21bce72 split Table into TablePile and TableListBox
and get rid of that confusing container_maker thing
2018-06-21 16:07:00 +12:00
Michael Hudson-Doyle de80a06f47 add actionmenu widget 2018-06-18 21:36:35 +12:00
Michael Hudson-Doyle 3a59925265 work around a strange behaviour of Pile when contents is changed 2018-06-15 11:51:40 +12:00
Michael Hudson-Doyle 66578aff79 account for colspan>1 cells in width computations
I ran into that gotcha pretty quickly.
2018-06-15 11:48:19 +12:00
Michael Hudson-Doyle b34ca65aba a slightly over-engineered table widget
that takes column widths from the contens of the cells, unlike
most things in urwid
2018-06-15 11:48:19 +12:00