- Need to update the variant that is in use, **and**
explicitly update it in the widget, in order to re-load
the keyboard image for the newly-selected layout+variant.
- only widgets get language change events, so we need to
hook that up to the ViewSteps and inform the Config
object so that it can (re)load translations for the
keyboard data.
- With debugging and untangling done, the lambdas are simple
and short, so return to using them. One point of improvement
might be to give the models suitable slots themselves,
to avoid even this indirection.
- Remove code that is duplicated in Config.
- Hook up UI for physical keyboard model, and back.
- For now, introduce some named slots with debugging output.
This makes debugging a lot easier since we have function names
to work with rather than anonymous lambdas
- Config already *has* everythind, but drop the useless copies
and duplicated code from the Page
- Plug the models model into the Page
- While here, document the model / layout / variant distinctions
The code doesn't fill the UI properly, and the drop-down
for the models combobox is not right, but at least the data
is shared.
- point to main Calamares site in the 'part of' headers instead
of to github (this is the "this file is part of Calamares"
opening line for most files).
- remove boilerplate from all source files, CMake modules and completions,
this is the 3-paragraph summary of the GPL-3.0-or-later, which has
a meaning entirely covered by the SPDX tag.
This basically means we talk about localization in the respective
localized variant. e.g. "German (Germany)" ➡ "Deutsch (Deutschland)".
If geoip lookup failed or isn't configured for whatever reason it's a
stretch to expect the user to know english enough to find their own
language. Preferring the localized strings resolves this issue.
Additionally this happens to bypass #712 respectively
https://bugreports.qt.io/browse/QTBUG-34287
as the native names are properly spelled. So, as long as Qt has localized
names the names will also be properly spelled.
- In many cases, using QLatin1String is a de-optimization, when
applied to a C string literal. Kevin Kofler pointed out that
those should basically all be QStringLiteral, instead. (Compile
tests with -O3 show that in the optimized object file, the
code size difference is negligible).
- Drop the explicit constructor entirely in cases where we're calling
QProcess::execute(), for consistency.
- Do a little less messing around in the mapping of keyboard locales
to keyboard map names.
Use QProcess::execute() with the 'safer' argument-list, rather than
escaping and de-escaping strings. Also reduce noise by only passing
a variant if there is one.
Split locale into <language>_<country> and go looking for keyboard
layouts that match. Do that in reverse, so look for country first.
- known weakness is el_CY (should get layout gr) because CY and el
don't name any keyboard layout.
- known weakness are Hausa, Igbo .. which are ha_NG and ig_NG. They select
keyboard layout ng, which is labeled "English (Nigeria)"; they ought
to select ng(hausa) and ng(igbo), which are the right variant keyboard
layouts to use.
- similar selecting a locale in Canada (en_CA, fr_CA, iu_CA ...) will
select keyboard layout ca, which is for French-speaking Canada.
Locale en_CA should select keyboard en -- e.g. en(us). But iu_CA
(Inuktituk) needs layout ca(ike).
When selecting keyboard layout, pause, then select another, the
QTimer wasn't being disconnected from the previously selected
language, so the second selection would fire the timeout, and
then call *two* slots .. and then three, ... Disconnect when
the timer fires, too.
In order to avoid deep copies, Qt containers over which we iterate must be const
The remaining unported cases require qAsConst (Qt 5.7) or std::as_const (C++17)