- Strings were being used as logical values, and then logged
(which should be in English) and also used in the UI (which
should be localized). Replace with a MessageAndPath class,
used only locally, that defers the translation until called-
upon explicitly.
- Replace some VG stuff with similar calls to apply().
Returning partition full-paths instead of only the block-device-name
simplifies later code -- which would prepend /dev/ to the block-
device-name and umount that.
- the tryX() functions weirdly return a string that is used for
debug-logging. Document that. The untranslated string is
later used for user-facing messages. Mark that as FIXME.
- factor out the loop-over-names-and-append to news, because that
makes the overall story of what is happening hard to read.
- all calls to tryCryptoClose() called tryUnmount() first, so
put that call inside tryCryptoClose(), so the interface is simpler.
- improve descriptive-strings in logging ("set?" is not very
meaningful)
- log only the unsatisfied entries, since the preceding
log-message suggests that that is what is happening.
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.