- the partition module makes a nice descriptive widget,
which includes the text it **also** has for the summary;
(the text is intended for the QML summary).
- In general, if a module has a widget for the summary, assume
that that is the **whole** summary and use it instead of text.
This resolves duplicate summaries -- showing the text of the
partitioning-step, followed by its widget -- introduced in July.
- the (n/m) lines are output of specific steps, not actual package-
installation. So look for "<action> <packagename> ..." lines instead.
This means we keep some state around, and need extra machinery to
report those lines rather than the generic progress reporting
that reports on groups.
- during install and remove, check for (n/m) output lines which
report progress of the pacman actions and turn those into progress
reports for the *packages* module.
- remove from GS
- remove duplication across Config and ChoicePage
- improve translations (presumably "msdos or gpt" is the most
complicated it will get)
FIXES#1735
- make the installation work,
- special case because rsync can return error 23 (which throws, from
inside the Python API) which still means "it was ok".
SEE #1740
By processing each line in turn (and just counting is) rather
than collecting all of the lines of output from the tools,
we end up with lower memory usage.
- document a bit more of the methods
- provide convenience method enableOutputProcessing() alongside
an explicit setter; adjust tests to the changed API.
- add an executable() information method.
- this was an internal class for logging commands, let's lift
it up to the Logger framework where it might be more generally
useful (or not .. everything needs special-casing for actual
redaction).
This is an experiment in Python API that will allow a callback
function in the Python module to be called for each output line.
It builds on the run-a-process extensions that are being built
simultaneously.
The background idea is that, while CalamaresUtils::System::runCommand()
is a useful general API, it is
- still missing flexibility
- lacking a way to process output from the command "as it happens"
Waiting until the process ends, and then reading all stdout, is
inconvenient for processes that produce a **lot** of output,
and also makes it impossible to report progress. One module
in calamares-extensions has its own run-a-process implementation
for reading output, and this branch aims to introduce something
similar into Calamares core.
- when (manually) using an existing LV, it shouldn't be closed
prior to formatting, since that kills the volume and then the
path (/dev/myvg/mylv) no longer exists. Then creating the
filesysytem on that device path fails.
- 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.
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).
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.
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)