There's a switch to toggle whether the range is enabled at all, two
spinbuttons for the range itself which automatically maintain their
ordering, and a button to toggle between high and low voltages
preferred. What more could a gal ask for?
The GiveBack flag now has a dedicated row with a switch, rather than a
toggle button the row labeled "Flags". That GiveBack is one of several
flags seems like an implementation detail from the high level of a GUI.
There is now a combo box to select the dimension of the current-setting
value. Changing this combo box automatically changes the value to keep
the current the same at the present voltage. The correct item is
selected when a Sink is chosen from the list, and the unit label always
updates to match the dimension.
Now that the firmware is able to make requests from programmable power
supplies, it's important that the GUI allows setting arbitrary voltages.
This commit makes it do that.
If there are no capabilities to show, it doesn't make sense to let the
user try to open the Source Capabilities dialog. Now we don't, and we
say "None" instead of "0 W".
Back when there was a Save icon on the Sink page's HeaderBar, it made
sense to keep the separator around in the other pages. Now there's
never a separator there, so we shouldn't force one to exist in some
pages anymore.
Now when there's a violation of the USB PD power rules, an icon appears
to alert the user to their charger's noncompliance. The icon has a
tooltip explaining its meaning.
To add support for the new features in firmware 1.1.0, I decided to
split the Sink screen into two sections: Configuration and Power
Delivery. The Configuration section contains all the things the Sink
screen had before, with some layout changes (notably the Save button is
part of the Configuration section, not in the HeaderBar). The Power
Delivery section has the new features: an Output switch, which works
perfectly, and a currently half-baked Source Capabilities list item
which will eventually open a window to show the capabilities, but for
now just prints them.
Previously, the SelectListStore directly modified the GUI in its
update_items method, which was really just poor form.
This has been corrected by creating a new SelectList to encapsulate all
the GUI elements from the select-stack downward. This handles showing
the select-none or select-frame elements as appropriate, as well as
adding the list item separators. It's much nicer than the old way, if I
do say so myself.
It had been stretched vertically due to the two text labels stretching
the whole grid. Now the button is square, because it's set to align
center rather than fill.
It's by no means wonderful internally, but to a large extent it works.
The list functionality is still untested, since I won't be able to have
two PDB Sinks connected to my computer at once until tomorrow. But for
now, a neat little GUI.