- both changing the autologin and changing the user (login) name
affect global storage, and both may need to change the autologin
username; split it into a free function.
- the fullname change was bypassing the login in changing the
login name, **but** then it needs a back-workaround to keep
the "custom" setting off (when custom is off, auto-fill username
and hostname is active).
- after loading the config, fill GS already.
- when finalizing GS, get the autologin settings again.
- setup the visibility and initial checked-state of the reuse-user-
password-for-root near where it gets connected; do similar
for the require-strong-password
- squash the lambda slot into the regular slot: no sense in
connecting twice to the same signal with the same receiver.
- only connect config->ui once
- only connect at all if the setting is visible (e.g. when weak
passwords are allowed for the require-strong checkbox, or
when root's password will be written for the reuse-password)
- switch to QStringList as parameter, since consumers (that is,
the debug dialog, which is what this is for) are interested
just in the **names** of the jobs.
- to allow mutex locking in const methods, mark them mutable.
- there's no need for a macro that is going to be used once,
especially if there's only one place it can be called.
- expand it in place and remove it from the installed CMake
module
once completed, this can be a fully functional (offline) locale selection option
worldmap.png no longer needed/in use
working is the stackview of the region & zones models
Timezone text bar shows correct timezone
currentIndex see comments on lines 65 & 139, not working
update of timezone text bar can't be tested if working as long no index is connected (see lines 93 & 168)
Still, already committing, since it does more then old Offline.qml, which had no function for timezone
- 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.
In spite of there being considerable documentation sometimes in the
config file, we go with CC0 because we don't want the notion of
'derived work' of a config file.
The example `settings.conf` is also CC0. Add some docs to
it while we're at it.
- the translations generated from public-domain files are CC0-1.0
- the files derived from Unicode tables are close to CC0-1.0,
possibly except that there is a FileCopyrightText line
- CC0-1.0 for the uninteresting version-headers
- GPL-3.0-or-later for the services
- add SPDX identifiers to Calamares C++ libraries and application sources
- add SPDX identifiers to Calamares QML (panels and slideshow)
- the `qmldir` is a list of names of things in the directory,
so CC0-1.0 it as "uninteresting"
- QRC files are lists of names of things in the directory,
so CC0-1.0 them as well
Some Calamares source files incorporate material from
3rd parties (unlike the 3rdparty/ dir, which is basically-
unchanged 3rd party source). Tidy up the FileCopyrightText
lines for those sources.
This is not an exhaustive effort.
There's lots of (YAML) test data that is just trivial configurations
for modules. Since the configurations themselves are **also** CC0-1.0,
and the tests are less interesting, license them equally liberally.
The build instructions are not that interesting, it's a toss-up
between CC0 and BSD-2, but because other CMake bits are BSD-2-Clause,
apply that to more CMakeLists. The copyright date isn't all that
accurate, but these are just inconsequential files.
While here, tidy up and get rid of some useless intermediates.
The .ui files are all GPL-3.0-or-later style, but it's
slightly difficult to keep licensing information in them:
it's XML, so an XML comment might work, but there's no
guarantee that safe/load will preserve them.
Put the SPDX tags in the <author> tag, so that it's visible
in Qt Designer.
This was causing CI builds to fail, since WEBVIEW_WITH_WEBKIT
is defined only in the Config file, not on the command-line.
This crept in accidentally while trying to get rid of that
config file entirely.
Re-jig the module-weight calculations.
- modules can have a weight
- module instances can have a weight
- jobs, from the module, can have a weight
This is now configurable on a case-by-case basis, rather than having
C++ only as an option and a weird hack for unpackfs.
This is more a test-inspired hack than anything else: since signals
are delivered asynchronously, we can end up delivering progress
signals out-of-order, and then the signal spy lists them wrong:
progress goes backwards.
Insert a tiny delay between jobs to allow signals to be delivered
in-order.
- compute weights and accumulations beforehand
- mutex-lock structures so you can enqueue while running jobs
- simplify progress reporting calculations
- doesn't actually run any jobs
reflect changes from users/Config.cpp
corrected id missing capital
mirror UsersQmlViewStep.cpp/h with the users versions
connections are still not made
In advance of PR #1491, test loading and stringlist extraction.
- from code, extraction works "normally"
- for YAML data, the stringlist isn't actually a stringlist
- if the user password is reused (or not) then check the
status of the passwords against the new reuse-setting
- if the allow-weak-passwords setting is changed, then
check the status of passwords (both of them) against
the new weakness setting
As explained by Kevin Kofler and abucodonosor, the
implementer line can carry a bunch of different values,
but none of them are actually interesting. Simplify
the code.
- the way isPasswordAcceptable was being used was buggy, leading
to test failures (now fixed)
- don't expose the function, anyway: it's an implementation
detail for passwordStatus() which in itself is an implementation
detail for status notifications.
- avoid update loops by checking values before emitting *Changed()
- check validity of user and root passwords when asked
- if root isn't going to be written, or re-uses the user password,
defer to those status checks.
- The weight is the module (instance) weight, which can be
- the default weight of 1
- the weight specified for the module (in module.desc / the module
descriptor; this defaults to 1, above)
- the weight specified for the instance (in settings.conf)
The last of these "wins"; weights are constrained to 1..100
The weight isn't actually used in progress computation yet.
- a handful of modules had an unused *requires* key in module.desc;
this is probably from previous intentions around
prerequisites-testing. Since the settings were empty anyway,
they have been removed.
- [unpackfs] Compacted the way *requiredModules* list is written
- loads emergency, noconfig, requiredModules keys
- warns (and marks descriptor invalid) if there are unused / unknown
keys left over in the descriptor data.
- add fields -- all const, all bogus -- to the descriptor,
introduce a stub method to load the descriptor from
YAML data (e.g. read from module.desc)
- lighten the type-naming in Module a little, with usings
- In most cases, you **know** the table covers all the enum
values, and the extra parameter *ok* is just annoying.
Provide a convenience that doesn't distinguish empty
from empty-but-valid.
- move the enums
- expose the named-enum functions for them
- **start** replacing Descriptor with something stronger; this fails
zero tests so it obviously wasn't tested at all
This module allows the generation of the initramfs in Alpine Linux based
systems (excluding postmarketOS). Very bare bones, but then again it
doesn't need much. It uses the Alpine Linux tool "mkinitfs" to do the
job.
- setting the weight in *instances* should be different from letting
the default weight (of 1) stand; explicitly saying 1 should
carry some weight (ha!)
- any invalid instance key will cause a complaint
- "new" custom instances in sequence get a complaint, but
the instance description added to the list is valid
- there's no reason to ignore custom instances that are **not**
mentioned in the *instances* section: it may be useful to
name more that one even without distinct config files.
- no more weights in constructors; do that in fromSettings() only.
- simplify test to drop those constructors
- set config file also for "normal" descriptors; fix test
module builds, installs and runs, connections are not working yet.
UserQmlViewstep.cpp/h are from PR https://github.com/calamares/calamares/pull/1356
sections are commented out to make the module build, but help is needed to get those 2 files corrected.
config names used in usersq.qml are guessed from users/Config.cpp
debug window shows correct entries in GS, and under the module tab, usersq.conf is read
as should too. Running shows most config used in users.qml are not registered/wrong,
many entries like: qrc:/usersq.qml:228:13: Unable to assign [undefined] to bool
It is understood not all needed from the users module has moved to Config.cpp yet,
but doing the PR now, since it runs, doesn't crash cala and help is needed to further implement.
- expose, for testing purposes, the load-from-YAML-data part
alongside the public constructor that reads a YAML file
- add test for building the list of instances
- looks funny
- is hard to get clang-format to respect this; it's intended as an
access-modifier, but those are baked into the code rather than
being configurable.
- is probably rare enough that #ifdef is acceptable
- was getting multiple definitions of moc-related code due to automoc
combined with KDSAG having its own #include moc, comment-out the include.
- while here, simplify the CMake bits for building KDSAG
- was getting multiple definitions of moc-related code due to automoc
combined with KDSAG having its own #include moc, comment-out the include.
- while here, simplify the CMake bits for building KDSAG
- Requirement.cpp was there "just in case" the header grew
functions that need an implementation, but that seems
unlikely (the header is just a struct of POD).
- the scripts are BSD-2-clause,
- the generated files are CC0 (I'm not *100%* sure about the
derived file CountryData_p.cpp, which lists countries and
country codes -- it **is** extracted from CLDR data which
is not CC0)
- QStringList doesn't round-trip correctly; add a test to
demonstrate that.
- Fix existing test to **not** use QStringList, but QVariantList
(of strings), which is how other code would use it.
The above is **kind** of moot because nothing uses the YAML-save
function, but it might.
While here, fix another test: YAML-loading can load JSON just fine.
- add apidox to all the untranslatedFS() methods
- add the most-basic of untranslatedFS(), which works on a given
FileSystem::Type; this one can handle special cases where
Cala needs a different untranslated name than what KPMCore provides.
- for the purposes of Calamares's nearest-location selection algorithm
for timezone selection, introduce spot patches: alternate markers
on the map to indicate "things close to here belong in this timezone".
- hide the implementation detail in the find() methods.
- Cape Town is in South Africa, so one might expect it to get South
Africa's timezone -- which is Africa/Johannesburg -- but Windhoek
is closer, so it gets that.
- Port Elisabeth is similar: Maseru lies between it an Johannesburg,
so it gets the wrong timezone, too.
These both illustrate how the limited resolution of the map, together
with the "closest location" lookup, can give poor results. For most
of South Africa, the "wrong" timezone is closer than the right one.
- The TZ widget uses a different coordinate system (mapping lat and lon
to pixel locations, and then calculating Manhattan distance from
that), so needs a different distance function.
- Simplify code: there's just one "closest TZ" function.
- introduce a distance function and use that, rather than coding it
inside the find() function. This is prep-work for unifying the
find() calls, based on various coordinate systems.
- create directories for new tests ahead of the tests themselves;
this **can** still cause problems if a test is run standalone.
- if creating the grub-dir at runtime is necessary, be informative
if it fails.
- the default_dir was only stored in modify_grub_default() to
create the directory if needed; move that functionality to
the get_grub_config_paths() function (and drop the "s",
since it now returns just one).
Go over the locale module again:
- new models that avoid weird casts and inconvenient iteration
- shared timezone data
- simple sorting and filtering
- simplify the map / QML version
FIXES#1476FIXES#1426
- test insert, remove, emitted signals
- test loading and saving of YAML and JSON
This shows up a big bug in the YAML saving code (which was never
used, it seems, anyway)
- 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.
- add the "reuse user password for root" setting to Config,
make the UI page follow that setting.
- add the require-strong-password default and toggle settings to
Config; this is not well-checked yet.
On the widget / UI side, connect checkboxes only if they are
visible; refactor reuse-user-password-for-root settings.
- The language code "ie" is not recognized,
- "ia" is, and it seems to be the post-war variant of
Interlingue, so we may want to rename / relabel.
The testEsperanto test -- now split into scripts and
esperanto -- would have picked "ie" out of the list
because it does map to C locale.
The TODO said it was unused: it **is** used, but only in
a very limited scope. Drop it from jobs where it wasn't
useful (e.g. those that just return prettyName(), outside
of the partition module).
This builds some machinery so that we can create
a detector for member-functions (methods) named <whatever>.
Use the macro to build the machinery:
DECLARE_HAS_METHOD(myFunction)
then after that,
has_myFunction<T>
is either std::true_type or std::false_type
depending on whether T has a method myFunction.
- no need for the definition to be in public header, move to implementation
- while here, sort the members and private methods
- add a makeJob() to add jobs to the queue
- having a struct with an obtuse API for adding jobs-that-need-to-happen-
to-this-device is just not good for maintainability.
- break the build by making things private.
- The enum for install choice was copied into PartitionActions and
used in the Config object; its definition does not belong in the UI.
- Chase the renamings required.
- add an option to select what button should be selected when the
partitioning module is started; TODO: the actual functionality is
**not** implemented.
- drop the previously suggested name, which didn't get beyond the
comments-in-the-config-file stage (but which intended to do the
same things as this one)
- add option to schema already, even if it's not implemented.
See #1297
FIXUP conf
The encryption widget (passphrase for disk encryption) should show
ok / warning / error whenever the state changes; this avoids
it showing up first with **no** icon (it should show a warning
when both passphrases are empty).
Both the KPMCore and the ChoicePage -- asynchronously -- were connected
to the nextStatusChanged() signal. So if the core said next was true,
that could end up communicated to the ViewManager, enabling the *next*
button in the UI.
Changing to the *erase* page generally triggers a KPMCore reload,
which later emits a `hasRootMountPointChanged()` signal, once the
layout is applied and the disk gets a root mount point. So we'd
get a `true` from KPMCore, which -- because it was connected directly
to the signal to the VM -- would override any other considerations.
Hook up both signals to an intermediate slot that just recalculates
whether the next button should be enabled, based on the state
both of the Choice page and whatever else.
- drop groups from the viewstep
- note that the Config object should also be in charge of creating
Jobs (but then the de-tangling needs to be completed)
- add tests of default groups loading
Doesn't compile because QRegExpValidator is a gui thing.
Previously, we check for RCC support every single time CMake runs.
This is slightly wasteful, and it wasn't being done right anyway.
But it's moot because:
- Calamares supports back to Qt 5.9
- Qt 5.9's version of rcc (at least, 5.9.7) **does** support the
command-line argument `--format-version 1`
- Everything newer does too.
Simplify translations a little, too: just use autorcc rather than
building things by hand.
- The sources were in src/calamares but processed and generated
in libcalamares, which is weird at best.
- Generate an "extended" version header.
- Use the extended version in the logger and nowhere else.
- While here, minor coding style cleanups
The overall change here means that after running CMake, only
Logger.cpp needs to be rebuilt (if the extended version has
changed) and not a handful of other files that don't need the
full version number, but do happen to include CalamaresVersion.h
- Very rarely do we need the full-git-version of Calamares,
so split that into a separate header with a little trickery.
- In the "normal" version header, drop the full-git-version values.
- This is a half-step: the ViewStep shouldn't do job creation either,
eventually it needs to be the Config object, but this is better
than asking the widget (UI) to create some jobs.
- When updating login- or host-name, or the autologin setting,
set it in GS as well. This is a minor improvement over doing
it only when leaving the page.
- Since the Config object isn't complete, there are leftovers in
the widget, which has a fillGlobalStorage() for the not-jobs-related
bits previously in createJobs().