- the loadJson behavior did too many notifications, and was likely to
deadlock; write directly to the map instead and emit only once.
- the loadYaml method did something very different from its
documentation or intent.
- refactor into some free functions (out of the lambda's for connecting)
- introduce new method to call from onLeave(), matching previous
widget behavior
- we can do GeoIP and GeoNames lookups, **or**
- use Calamares's internal GeoIP lookup and country / city hints.
The online version is much more accurate, but costs more lookups;
in these examples, set it all to "offline" and document what needs
to change (code edit) to use the online version.
It's probably a good beginner job to introduce a bool in localeq.qml
to switch the behaviors.
- Config has suitable strings for displaying TZ information.
Use them and automatic bindings. Don't update the strings manually.
- Suggest online or offline TZ lookups based on what the distro wants.
Edit the QML to pick online lookups (needs access to the geonames
service, though).
- Drop the variables that point at config and geoip: the Config
object has a currentLocation, which is filled in by both the
configuration and any GeoIP lookup -- it doesn't have city
or country information though.
- status is a longer phrase
- name is a short human-readable name
- code is the internal code
Code that writes its own "Timezone set to" messages can use
the name, rather than the status.
- when no location has been set at all, there's no sensible TZ
to report; just leave it blank. In *practice* you won't hit this
code from the Calamares UI before a location has been set, because
the Config object is instantiated and then immediately configured,
but from tests or unusual UIs it could be.
- needs some massaging because Config otherwise depends on
ModuleManager which is a UI class (for the Reasons),
but we already have a BUILD_AS_TEST define for that purpose.
- demonstrate a nullptr deref.
- The Config object now uses the re-done models and timezone data
- most of the properties of the locale Config are unchanged
- much less complication in extracting data from the zones model
It's convenient when e.g. QComboBox::currentData() gets the key
"automatically", and the default role for that method is UserRole,
so let the value of KeyRole overlap.
The (renamed) class TranslatableString keeps a key value
(e.g. New_York) and a human-readable version around; the
human-readable one is passed through QObject::tr() for translation
on-the-fly.
- The models are overly complicated: **overall** there is just one
list of timezones, and we need various views on that list.
Start over with an empty model of regions.
- there **is** another source of information about the CPU,
so in the test use that to cross-check what hostCPU() says.
NB: it's probably a good idea to fall back on the same file
in hostCPU() for better accuracy.
- get username, password etc. from the config object, not the page
- jobs now depend entirely on config
- handle logic of "what's the root password" in Config
- The configuration for writing the hostname (to /etc/hostname,
to /etc/hosts and possibly to systemd-hostname) is read-only,
because it comes from the config file and won't change after.
When CMake runs, configure_file() will clobber the config files in
the build/ directory, which is annoying during testing: you need
to keep making the same edits, or edit the source.
- Introduce new behavior: the config file is **not** overwritten unless
the source file is newer. This means that edits to config files
in the build directory are preserved.
- If INSTALL_CONFIG is **on** then the files are clobbered anyway (the
source is considered new regardless).