- If there is an item with id "" (empty), it is used as the
"no-package-selected" placeholder text.
- Existing code iterated over the abstract model and used the
name and description at the time the model was set -- but
by getting the name and description from the model, only
a single string was obtained instead of the full range
of translations.
- Therefore, when arriving on the page, the "no-package-selected"
information was displayed from the translation that was active
when the model was set.
Instead, extend the non-abstract model so we can find the no-package-
selected item and pass that explicitly to the page.
FIXES#1241
FIXES#1228
The label on the left can now be specified (and translated)
in the config file. The strings corresponding to "nothing
selected" from PackageChooserPage.cpp L33-34 can already
be specified in the *items* section.
- Since the package chooser might be used more than once, or for
more specific items than "Packages", introduce a way to provide
specific strings for display.
- The only string needed is the ViewStep name, since the item with
id "" can be used for the no-selection item.
- My usual test environment has umask set to 022, but on one dev
box it is 002, leading to test failures (which show the test
was bad, not that the umask-setting code is bad)
- sometimes a slot is easier than a lambda. Introduce
a macro CALAMARES_RETRANSLATE_SLOT that calls a given
slot in an object on language change.
- extend the retranslator with support for calling slots:
- use Qt's signal/slot mechanism alongside the private
list of functions to call
- provide convenience for obtaining the retranslator of
an object.
- This helps give meaningful names to code chunks
- Gives clang-format something to work with
- Reduces indentation depth
I think this is a bit of a code-style opinion issue: big complicated
lambdas doing UI things just don't seem like a good idea.