QLabel allows scaling of the Pixmap by itself, and we have a
FixedAspectRatioLabel that scales a pixmap nicely. Use that.
(The new label type needed to be introduced to designer)
The screenshot should expand more agressively, so that it
does not get margins -- that just leave space around the
name and description -- when the window expands. Adjust some
of the stretching and layout in the UI file.
It is easier to put screenshots somewhere where
they can be searched-for, rather than requiring either
absolute paths (inconvenient to try out someone's
settings) or relative paths (because who knows where
Calamares will be run during testing).
The summary page can rely on the Config object to create
lists of relevant steps; this code was declared but not
defined / implemented for Config (but also not called, so
it was ok). This is basically shuffling bits around in
preparation for using the model directly, rather than
re-implementing the widget-creation code.
While here, split off the page-resizing into a free function
so that the code reads nicer.
- the page doesn't need to remember what step it belongs to,
if the step tells it when creating widgets.
- detach naming from the viewstep API that calls it.
The `partition.conf` file contains an EFI-size. The default is 300MiB,
but distributions might like to use a bigger (or smaller) value.
Apply the configuration consistently everywhere where we need
"the size of the EFI partition". Extend the internal method
to look at the configured size.
Apparently everyone shipping a squashfs image also has the tools
installed, because the error message reporting that the tools-are-
missing contained a reference to an undefined variable.
Fix that, and while here improve the error message so you
don't get a whole path as a title in the error message.
The slightly weird error-message construction is so that no
messages change and no translation work is needed.
All **other** modules fully specify libcalamares; only unpackfs
was importing shortcuts. Change to conventional usage (partly
because that's easier on the pylint implementation, partly because
it's then consistent with the rest).
Apparently nobody ever hit the else-branch here (because
each DM has exactly one implementation -- that's what the
check is there for!) because the logging of the error
itself would raise IndexError or ValueError.
- Make clear that the @ is a string-location, and how long the
pre-script is (although in practice, it will be either null
and 0, or the values set in the loadmodule executable).
Read, then write, the NM file. Add a note about how we might
handle this better. Rename live_user() function to give it
a verb (and avoid UnboundLocal when using a variable of the same name).
This class doesn't really set a pointer -- it is a scoped assignment
through a pointer, which **can** set a value on destruction (when
it leaves scope). Rename it.
While here, extend the API so that it can do an assignment to the
underlying object **now**, while also doing a scoped assignment
later when it leaves scope. This makes some code a bit easier
to read ("in this scope, X is now <v> and then it becomes <v'>")
This class was used only once, and is confusing because
the assignment happens always, but to the opposite value
as what was visible. It can be replaced with other
scoped assignment, instead.
Removes the tests for it, too.
- when an emergency strikes, log the modules that are skipped
with a Once, but if an emergency module runs, refresh that
Once so that the function header is printed again -- to
distinguish JobQueue debugging from the logging from the
emergency module.
- iterate over the lines of the source file, rather
than over indexes, and make clear that the hooks, modules and files
lines are replaced, rather than merged.
- this calls write() more often, but it's only a few lines
- don't chain directly from modify_mkinitcpio_conf() to the
function that writes the file write_mkinitcpio_lines();
split into "figure out what needs to be written" and calling
that writing-function, so that we can test / check / log
if needed between the two.
- put the system-information and -detection functions at top
and the "do the actual work" things below
- don't mix the boolean do-we-use-this flags with the
lists of files and modules which are the important
parts of modify_mkinitcpio_conf
- Transifex tools complain about missing Q_OBJECT (which makes
some sense -- you end up with a different context for calls
to tr(), of the base class).
Move some of the texts to the new TranslationFix, from ViewManager,
and use them. Keep them in ViewManager, too, so that the translations
with context ViewManager are not removed just now.
This is intended to apply translations to some common Qt UI components.
Example: a QMessageBox with standard buttons OK and Cancel; the text
for that is determined at startup using the system locale, and later
changes to the current locale or the current translation catalog,
do not affect OK and Cancel. It might be possible to load a catalog
with the right translation strings, except that there is no way to
know what the context or catalog **is** for the strings that are
used to label standard buttons: they can come from Qt base, or
the platform, or the theme. Merely loading the Qt Base translations
for the correct language does not help, because those translations
do not contain an "OK" string with the context used for standard
buttons.
Do the translation by hand; then we have all of the Calamares
languages covered, too, which is more than the Qt translations do.
Move the CMake code responsible for building the translations from
the src/calamares directory (yeah, yeah, the translations need to
link into the executable) into lang/ (which is where the source
and other infrastructure lives).
Prompted by Linlinger, I've reconsidered the names of languages
in the drop-down in the welcome page. We already have the
infrastructure for assigning specific names / locales to
"Calamares locale names" (which match Transifex names, not
necessarily Qt names). Use that to put exactly two Chinese-
language translations in the drop-down:
- Simplified Chinese (code zh_CN)
- Traditional Chinese (code zh_TW)
Drop zh (which is a peculiar locale name anyway) and zh_HK
(which is Traditional Chinese, but using the geographic
boundary is a bit weird; we're going to ignore the
minor orthographic differences with Traditional Chinese
written elsewhere for now).
Note that this makes the drop-down show "Chinese"
in the English column, twice; the difference is visible
only in the native-language representation.
SEE #1741
rewrite of keyboardq.qml, reduce stackview to 2, use a combobox for
keyboard models list
colors set to configurable
.xml files used for keyboard layouts, about a dozen added now
builds, runs, actions record as intended, GS filled correctly
With old Qt, Calamares could only run one check on a thread,
because the NAM would be switched to NotAccessible --
subsequent checks would fail because the NAM is already
hard-set to NotAccessible, so it could never be turned back
on by Calamares code.
Reset the accessible flag for the NAM while checking if
the internet is there.
- India (when in English) should use the English variant, not Hindi
- While here, fix up minor items in code:
- Typo in comment
- Asturian doesn't need a special case (which didn't match, anyway)
- Don't debug-log a country-name that might be entirely wrong
(the layout is English, variant "in" but "in" interpreted as
a country is Indonesia, and the actually-desired name is eng_in
which isn't a QLocale name at all -- just like the Hausa and Igbo
special cases)
The test was loading the config file (for testing) either from the
build directory or possibly the source directory; if the config
in the build-dir was edited (for other testing purposes) then
the test would fail. Load only the source-dir version of the file.
- improve logging
- fix failing tests -- the observed and expected behavior is
to fill in a fallback check-URL, not change to an empty list,
- **except** if there's no requirements key in the config
at all; this is a bit weird, but let's make the tests
document existing behavior so we can notice if it changes.
- Setting 'id' (which changes the Global Storage key that
gets used) is a kludge when the existing module-instance
name can be used instead -- and **was** already used, as
a fallback when 'id' is not set. There's no point in having
two places to set a particular name.
- Rip out the docs for 'id' as well.
- Add documentation on the difference between single-selection
(the QML implementation) and model-selection (what the Widgets
version does).
- use updateGlobalStorage() for both single-selection and
model-based approaches, although the model-based one
needs extra parameters.
- complain about inconsistent settings and API calls (e.g.
setting a model and single-selection at the same time)
- pkgc -> packageChoice and similar for methods, variables
- document that this is the convenience value for one-selection
QML modules, not a full model
- use std::optional to keep track of which one is being used.
The Config object can hold all of the configuration information,
including also the requirements-checking parts. Move requirements-
checking configuration there, so it is shared and consistent
across welcome and welcomeq, regardless.
This repairs the test that expects the Config object to handle
**all** of the configuration, too.
- was filtering out the wrong URLs
- was not actually removing the invalid URLs
- extend API to make it possible to count / confirm the settings
- extend tests to demonstrate that API and the issues
- Branding, Settings, and ModuleManager may all be nullptr,
in which case the corresponding code shouldn't call methods
of those instances -- this is demonstrated by just creating
a Config object
- previously, updateSwapChoicesTr() wanted to be a static free function,
but it needs QObject::tr() ; drop the unnecessary parameter (since it
is a member function).
QString -> Id for translations in the external API, to avoid
accidentally converting a QLocale name (e.g. ca_ES) into a
Calamares translation name. This preserves special-cases
like ca@valencia and sr@latin.
- enforce consistent [PYTHON JOB]
- use CDebug() constructor, because the convenience macro's
introduce the function name -- that's the C++ function, so
it isn't useful for logging.
- 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
Just have **one** Retranslator object, and install it as event-filter
(this needs to be done manually on a top-level widget) and use
signals / slots to do the actual work, rather than filtering
in multiple places and doing our own mediocre version of binding-
signal-to-lambda.
- 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