- when activating the page, the "guess" functions do their
work and afterwards the config is left in a "guessable"
state, but if the user makes a specific choice, then
the config leaves the "guessable" state and the user's
explicit choice is preserved.
FIXES#1744
- expose only intended API, guessLayout() becomes internal and static
- rename onActivate() since it was *called* for activation, but does
something totally different.
- Long and complicated, nested, lambdas are not convenient for reasoning.
- The debug messages from the innermost lambda have a totally useless
function name, which makes debugging harder.
- do not link (explicitly) to Calamares libraries, the CMake
functions do that automatically.
- while here, tidy and remove commented-out-bits
- while here, remove unneeded includes
- the message had been arbitrarily changed; change it back
- update (warning) message when there is progress in checking the
model, so it doesn't stay at "unchecked" until you change language
- minor clean-ups
- The Config object owns the requirements model, and has messages /
strings describing the state of the model. Use that message,
dropping the duplicate message from the requirements widget.
- Re-jig to pass the Config object around rather than the model
that it owns.
- This does not work, because translation events do not arrive
(and the slot isn't called automatically either).
Rather than Config asking its (owning) ViewStep what the title
is -- all existing implementations have a prettyName() for that --
move the title into Config and re-do-the ViewSteps to use it.
Rename init() to something meaningful.
- the Page displays a simple message describing what the
summary is all about; Config has the same message,
use that. Needed some re-jigging to get the signals
and slots right.
- Create Config object, even if it's not used just yet
- Introduce onLeave() for the Page, better name than
(re-)creating the content (!?) when leaving
Config classes, which intend to be shared between widgets-
and QML-based view-steps, should not tie closely to internals.
None of the ParserStatus methods are used in a meaningful
way (init() can be called by the view step).
(This assertion may be dialed back if the Config object is used
in the summary ViewStep, which will want to get at the widget
pointers, but that's for later)
- filter() returns the items for which the predicate is True;
we want to keep the subvolumes that do not have an explicit
partition already associated.
- need list() to hammer it back into a list for appending swap subvol.
function added to store selections from packagechooserq
line 103 in Config.cpp needs adjusting to restore working regular widget based packagechooser
prettyStatus added, made visible in packagechooserq only, ViewStep not altered in packagechooser for this yet
initial work done by Nitrux/Camilo Higuita in 2020, reflected in license headers
C++ adjusted to make it build & work
as noted in the inline comments e80618ef1c
there are quite a few errors in the C++, but it builds, runs and shows the correct output
will be used in summaryq, reading from widgets not an option
section probably better suited for Config.cpp/h, since quite a bit of duplicated code from
createSummaryWidget
In 942221c764 the fixed-setup
(with /@ and /@home) was replaced by the configurable btrfs
layout, but the default went away. Restore the two-subvolume
layout if nothing is configured.
Re-use the existing message about partition type and size,
since I don't want to introduce another message with all the
specifics; give a works-always message instead.
The check itself is also straightforward, avoiding all of the
nuances and technically-this-might-work cases: FAT32, 300MiB+.
FIXES#607
kirigami inlinemessages adjusted for password fields
coding style, break lines in variables
add closing button for root password inline message, needed bc of
re-use root password option does not remove all messages
bug introduced with Qt 5.15 KDE patches makes near impossible to set location
adding - 5 seems to fix, otherwise the coordinates label will have to be removed
Modules nearly always have a Config and either a Job or ViewStep
as their "top level" components. Everything else is implementation-
detail. The *partition* module was unusual in that those two
"top level" components were tucked away in subdirectories.
Shuffle them to the top: this makes it more clear that these
two files are there to coordinate the module.
warning messages implemented for user & host names
move root password option box inline with password section
adjust background color according to text.length
hardcode color instead of kirigami colors
usersq is now usable, sets user, hostname & password correctly on install
warning messages & color changes not fully done yet
The existing API required calling the one constructor with
specific pointers (nullptr for a partition-from-free-space)
followed by calling one of the initFrom*() functions. This
is fragile design.
Use tag-classes to distinguish create-from-free-space and
edit-another-freshly-created-partition cases, refactor
to merge the initFrom*() methods into the constructors
and factor out the shared UI creation.
Callers can now use the tag-class to distinguish. While
here, adjust both callers to use QPointer, avoiding some
very specific dialog-on-the-stack crash possibilities.
When a partition is set as "freshly created", the dialog was
passing in newFlags() as the **already-active** flags on the
partition; then the caller was setting those same flags as
"set these in the future", so that afterwards, no flags would
actually be set (because they're already active -- see the
first sentence).
Now, fresh partitions have no flags.
- fsName was a QString (a copy) so it could be modified;
- the modification isn't really necessary.
- While here, pick up new PointerSetter convenience class.
This is related to https://invent.kde.org/neon/neon/calamares-settings/-/merge_requests/1
which adds .. the default things from the example configuration to the
configuration file KDE neon ships. The default layout doesn't add
any subvolumes at all, which seems to be non-functional.
If nothing is configured, complain and use /@ as the lone subvolume.
PARTITION_UNSAFE is a debug mode. It is not used in
production, because it allows you to pick an install
device that would be dangerous (e.g. the current / device).
Existing code kept two copies of a list of pointers,
and deleted pointers from one of the lists and returned
the other -- which now contains dangling pointers.
Refactor by applying suitable lambdas to a single
copy of the list; this avoids copying the list so
there is no danger of dangling pointers.
The bootloader model knows about both rows and
devices, so we can look up both at once. The
existing implementation as a non-member was rather
sketchy and wasn't used except as support for
restoreSelectedBootLoader().
If the pakcage manager fails in some way, convert to a readable
error message instead of leaking the exception to the caller
(which produces a traceback, which is harder to read and less
informative)
Widgets are easier to style if they have a name, and easier to spot
in the widget tree as well. Give the requirements-checker
parts meaningful names.
SEE #1685
- in legacy mode, *id* can have an effect and leads to
"packagechooser_<id>"; if unset, uses the the module
instance id instead, still as "packagechooser_<instanceid>".
- in packages mode, *id* is not used and only the whole
module Id (generally, "packagechooser@<instanceid>")
is used, but in packages mode there's no need for other
packages to mess with GS settings for this packagechooser.
When the module is loaded and the viewstep created, it doesn't have a
module Id **yet**. That is set after reading more of the configuration
file. It **is** set by the time setConfigurationMap() is called,
so pass it on to the Config object then. This means that packagechooser
modules can skip the *id* config key and use the module Id.
The model needs to be attached to the widget; because of changes
in the order that widget() and setConfigurationMap() are called,
the model is created earlier, but needs to be connected later.
- the %4 is left-over from the feature-summary string,
- replace it with ""; don't change the source string
because that will break translations right now.
- don't pass the item IDs to packages module, use the
packages lists for each item
- document the item list in more detail (including the packages member
and new install-method item)