Commit Graph

6190 Commits

Author SHA1 Message Date
Adriaan de Groot
ec0b68084f [users] Refactor setting GS
- 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.
2020-08-28 23:48:47 +02:00
Adriaan de Groot
d7dc48d201 [users] Add now-obvious missed initialization
- start the checkbox off in the state from config
2020-08-28 23:48:47 +02:00
Adriaan de Groot
15b5ef467e [users] Hook up strong- and reuse- password checkboxes
- 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)
2020-08-28 23:47:11 +02:00
Adriaan de Groot
d584a96335 [users] Improve naming of widget 2020-08-28 23:47:11 +02:00
Adriaan de Groot
3ae545c8b1 REUSE: qmldir file format doesn't leave space for license information 2020-08-28 18:18:22 +02:00
Adriaan de Groot
ba2b52ed1d Merge branch 'fix-debugwindow-queue' into calamares
3.2.29 dropped the Job Queue information from the debug
window, this restores the list of names.
2020-08-28 15:54:13 +02:00
Adriaan de Groot
b37a675657 [libcalamares] Reimplement JobQueue::queueChanged
- 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.
2020-08-28 14:39:32 +02:00
Adriaan de Groot
9afe7a3711 [libcalamares] Document JobQueue signals 2020-08-28 14:24:06 +02:00
Adriaan de Groot
49e925ef47 i18n: untangle translations in the executable
- 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
2020-08-27 15:34:17 +02:00
Adriaan de Groot
242d5c6499 i18n: install Python translations from a sensible place
- put the installation code in lang/ rather than among the modules
- remove useless indirection through CMake macro
2020-08-27 13:59:23 +02:00
Adriaan de Groot
23bfcb755e i18n: pick up the translations CMake module just once 2020-08-27 13:54:08 +02:00
Adriaan de Groot
e02c21285a i18n: remove the compiled .mo files from 'sources' 2020-08-27 13:37:45 +02:00
Adriaan de Groot
c3903b6e88
Merge pull request #1502 from asif-mahmud/calamares
[libcalamares] Internet accessibility checking done by synchronous ping method
2020-08-27 13:24:50 +02:00
Asif Mahmud Shimon
c6a3e9b816 Internet accessibility checking done by ping method 2020-08-27 11:36:55 +06:00
demmm
9bdb05d4ea [localeq] rewrite Offline.qml
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
2020-08-26 18:19:42 +02:00
Adriaan de Groot
ae14059e8b [webview] Config header was still misplaced
- use #error to produce slightly more comprehensible build failers
2020-08-26 14:48:46 +02:00
demmm
7c08f9a033 [keyboardq] rewrite keyboard.qml
no longer use extra qml files
better highlighting, updated text, fewer buttons
2020-08-26 13:32:56 +02:00
Adriaan de Groot
a2180936ef CI: apply coding style across the entire codebase again 2020-08-26 02:28:43 +02:00
Adriaan de Groot
1cd9b93a22 REUSE: Giant boilerplate cleanup
- 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.
2020-08-26 02:28:38 +02:00
Adriaan de Groot
5a3fb613d9 REUSE: Default branding assets and explanation 2020-08-26 02:22:49 +02:00
Adriaan de Groot
30a85668b7 REUSE: (GPL-3.0-or-later) C++ modules 2020-08-26 02:22:49 +02:00
Adriaan de Groot
863a4cc2a4 REUSE: (GPL-3.0-or-later) Python modules 2020-08-26 02:22:49 +02:00
Adriaan de Groot
1b23520f20 REUSE: (CC0-1.0) module descriptors and configuration files
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.
2020-08-26 02:22:49 +02:00
Adriaan de Groot
92a6cbc773 REUSE: (CC0-1.0) generated files & PD files
- 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
2020-08-26 02:22:49 +02:00
Adriaan de Groot
3480988f53 REUSE: SPDX tagging of application library and main
- 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
2020-08-26 02:05:46 +02:00
Adriaan de Groot
7e9576d3d1 REUSE: fix credits for 3rd party sources
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.
2020-08-26 02:05:46 +02:00
Adriaan de Groot
2eecd431fe REUSE: (CC0-1.0) test data
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.
2020-08-26 02:05:46 +02:00
Adriaan de Groot
95ceb1e8c7 REUSE: (BSD-2-Clause) all CMakeLists
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.
2020-08-26 02:05:46 +02:00
Adriaan de Groot
965bc3b0b4 REUSE: use <author> tag in .ui for license info
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.
2020-08-26 02:05:46 +02:00
Adriaan de Groot
86f66e8f16 REUSE: (GPL-3.0-or-later) all the schema files
- these are vaguely derived from the schema's written by
  artoo@manjaro.org, but totally re-done for JSON-Schema
2020-08-26 02:01:58 +02:00
Adriaan de Groot
d6d3b41484 [webview] Missing Config include
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.
2020-08-26 01:06:55 +02:00
Adriaan de Groot
b65b5228e1 [welcome] Don't apply code-style to other C-code 2020-08-26 00:31:16 +02:00
Adriaan de Groot
31aa8be620 [locale] Remove unused original images
- These haven't been used in the module, and just take up space and
  now add licensing annoyance as well
2020-08-26 00:31:16 +02:00
Adriaan de Groot
42417ed3b2 [libcalamares] Rip out the broken jobqueue information signals (break build) 2020-08-20 22:30:12 +02:00
Adriaan de Groot
2b86d2481c [libcalamares] finish() is a private implementation detail for the job queue 2020-08-20 22:28:52 +02:00
Adriaan de Groot
41769c8794 [packages] Alphabetize package manager implementations 2020-08-19 21:12:40 +02:00
Adriaan de Groot
cf1ee2cffe Docs: explain how module weights work 2020-08-19 16:50:40 +02:00
Adriaan de Groot
ade7a22314 Merge branch 'module-weight' into calamares
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.
2020-08-19 16:20:28 +02:00
Adriaan de Groot
9d395e82f0 [libcalamares] Try to avoid progress going backwards
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.
2020-08-19 15:32:19 +02:00
Adriaan de Groot
053321d4d2 [libcalamares] Test for progress reporting
- add a dummy job class for tests
- run a queue with 3 jobs from 2 modules to check progress reporting
2020-08-19 15:07:47 +02:00
Adriaan de Groot
521015b1b4 [libcalamares] Match types to existing qreal usage, signal progress 2020-08-19 13:06:50 +02:00
Adriaan de Groot
941b5af3a2 [libcalamares] Rip out the guts of job-queue-running
- 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
2020-08-19 12:54:40 +02:00
Adriaan de Groot
08ea51a344 [partition] Fix tests after removal of single-job-enqueue 2020-08-19 11:28:53 +02:00
demmm
8ad7184024 [usersq] users.qml update some config vars
reflect changes from users/Config.cpp
corrected id missing capital
mirror UsersQmlViewStep.cpp/h with the users versions
connections are still not made
2020-08-18 20:06:30 +02:00
Adriaan de Groot
ecaf97aa60 [users] Tests of config-loading of groups lists 2020-08-18 17:20:37 +02:00
Adriaan de Groot
ab3e393d45 [users] Protect against a nullptr deref
- there is typically no GS during tests
2020-08-18 17:20:08 +02:00
Adriaan de Groot
4b4d7f3b10 [libcalamares] Print a big fat warning before a typical now-crash situation 2020-08-18 17:17:29 +02:00
Adriaan de Groot
2ac518d8b9 [libcalamares] Change in stringlist extraction also changes single-string 2020-08-18 16:44:56 +02:00
Adriaan de Groot
41e2de85b1 [libcalamares] Fix up test -- 'lam' isn't supposed to be in the loaded data 2020-08-18 16:43:18 +02:00
Adriaan de Groot
a5555c3f94
Merge pull request #1491 from asif-mahmud/calamares
[libcalamares] retrieving string list fix
2020-08-18 16:41:56 +02:00
Adriaan de Groot
e55def87e9 [libcalamares] Test for Variant methods
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
2020-08-18 16:40:33 +02:00
Adriaan de Groot
117859082e [libcalamares] Merge Tests.h into Tests.cpp
- no real need for separate file in the utils/ tests
2020-08-18 16:40:33 +02:00
Adriaan de Groot
626ac572d9 Merge branch 'hotfix-3.2.28.2' into calamares 2020-08-18 15:19:06 +02:00
Adriaan de Groot
c92e12ef74 [users] Consistent styling of status badges on input fields
- Use Status* icons rather than the yes/no
2020-08-18 12:48:51 +02:00
Adriaan de Groot
fd2399f702 [users] Re-check password validity on change of conditions
- 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
2020-08-18 12:46:27 +02:00
Adriaan de Groot
5d016baee9 [hostinfo] Fix up ARM "detection"
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.
2020-08-18 12:33:42 +02:00
Adriaan de Groot
3ecab4bedb [users] Fix test building
- now Config can create jobs, tests that consume Config need
  to build the jobs as well; re-jig CMakeLists to make
  those a little easier.
2020-08-18 11:41:43 +02:00
Adriaan de Groot
2c72524f29 [users] Move job-creation to Config
- this makes Config entirely stand-alone: it has all the business
  logic and can be hooked up to alternate UIs or used from
  other view steps or jobs
2020-08-18 11:31:32 +02:00
Adriaan de Groot
abae942e55 [users] Complete isReady move to Config
- give Config slots and signals for ready-status
- disconnect the page from the viewstep and use the Config object
  ready-status instead
2020-08-18 11:21:53 +02:00
Adriaan de Groot
36cefe3be1 [users] Remove calculation of 'ready' from Page
- simplify UI update methods
- drop all the m_ready* members, that should live in Config
2020-08-17 16:18:02 +02:00
Adriaan de Groot
eb44d0c6be [users] Move GlobalStorage wrangling to config
- the whole fill-GS method is a bit weird, since you might want
  to reflect that "live" in GS instead.
2020-08-17 15:30:09 +02:00
Adriaan de Groot
24efce0c1d [locale] Make sanity checks in tests more explicit
SEE #1490
2020-08-17 15:09:20 +02:00
Adriaan de Groot
5db4195b7e [users] Remove most remaining business logic from the Page
- report password status from config
- tie config-value of fields to the text-boxes
2020-08-17 15:01:35 +02:00
Adriaan de Groot
34946ecdee [users] Refactor validity-checking
- provide a structured datatype for password status
2020-08-17 14:20:54 +02:00
Adriaan de Groot
1a7b2668dc [users] Emit password status changes 2020-08-17 14:08:59 +02:00
Adriaan de Groot
d7b895b45d [users] Extend tests
- password requirements can disallow weak passwords
- start checking for signals on password changes
2020-08-17 14:05:03 +02:00
Adriaan de Groot
a16ecba2bd [users] Inline isPasswordAcceptable
- 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.
2020-08-17 13:22:44 +02:00
Adriaan de Groot
5f2bbd179c [users] New test for password-setting
- check new config for accepting empty and bogus passwords
- check a config with minor pw checks for empty and bogus passwords
2020-08-17 13:16:41 +02:00
Adriaan de Groot
1dcf56761f [users] Apply validation to the passwords config knows about
- 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.
2020-08-17 12:48:43 +02:00
Adriaan de Groot
e145bf68f1 [users] Remove extra ; 2020-08-17 12:48:43 +02:00
Asif Mahmud Shimon
3245d602db retrieving string list fix 2020-08-14 20:52:53 +06:00
Adriaan de Groot
f4eac6c86f [users] Create all the groups needed for the user
- 26b8c82630 added the list of all-the-groups-for-the-user,
  but didn't change the list passed to the method that
  creates groups.

FIXES #1488
2020-08-12 16:50:28 +02:00
Adriaan de Groot
c296bcffa3 [libcalamares] When enqueueing jobs, pass a weight
- 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.
2020-08-12 16:45:27 +02:00
Adriaan de Groot
a91ef65a37 [libcalamares] Make job weights integers 2020-08-12 16:08:37 +02:00
Adriaan de Groot
73b8ecd622 [unpackfs] Drop special-case for unpackfs
- make the module weight 12, rather than special-casing internals
2020-08-12 16:03:25 +02:00
Adriaan de Groot
c19866f887 [libcalamares] Add a module-weight to the module descriptor 2020-08-12 16:00:27 +02:00
Adriaan de Groot
14875259c7 [users] Create all the groups needed for the user
- 26b8c82630 added the list of all-the-groups-for-the-user,
  but didn't change the list passed to the method that
  creates groups.

FIXES #1488
2020-08-12 11:20:24 +02:00
Adriaan de Groot
575bc03a5c
Merge pull request #1487 from PureTryOut/alpine-initramfs
[mkinitfs] New module
2020-08-12 10:50:44 +02:00
Adriaan de Groot
e18cc81757
Merge pull request #1486 from demmm/calamares
[usersq] adding QML module usersq
2020-08-12 10:35:41 +02:00
Adriaan de Groot
050d74b4be Fix YAML schemas for all the remaining config files 2020-08-12 10:29:24 +02:00
Adriaan de Groot
14afce538b [netinstall] Fix schema -- the groups file still needs attention 2020-08-12 10:29:24 +02:00
Adriaan de Groot
fcbd6e38c5 [keyboard] Fix schema -- forgotten field *writeEtcDefaultKeyboard* 2020-08-12 10:29:19 +02:00
Adriaan de Groot
efab699479 [umount] Fix schema -- prefer *preservefiles* for keeping the log 2020-08-12 10:29:13 +02:00
Adriaan de Groot
2061024a03 [unpackfs] Fix schema -- new fields *exclude* and *excludeFile* 2020-08-12 10:28:27 +02:00
Adriaan de Groot
57f02464d9 [hostinfo] The hackish ARM-detection is only for Linux 2020-08-12 09:58:48 +02:00
Adriaan de Groot
665c2d53ab [libcalamares] Fix Doxygen comment for TZ locations 2020-08-12 09:58:48 +02:00
Adriaan de Groot
c22e0a3451 [netinstall][users][tracking] Warnings--, extra ; 2020-08-12 09:58:39 +02:00
Adriaan de Groot
e2f6817536 Merge branch 'issue-1176' into calamares
This doesn't actually implement the job-weight work, but lays important
groundwork in module instances and descriptors.

SEE #1176
FIXES #1473
FIXES #1474
2020-08-12 09:43:35 +02:00
Adriaan de Groot
f73f94da27 Repait module.desc
- 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
2020-08-12 09:36:30 +02:00
Adriaan de Groot
efd7145f76 [libcalamares] Implement the interface-specific fields for descriptor 2020-08-12 09:06:47 +02:00
Adriaan de Groot
c8b96c278b [libcalamares] Complete the generic module descriptor
- loads emergency, noconfig, requiredModules keys
- warns (and marks descriptor invalid) if there are unused / unknown
  keys left over in the descriptor data.
2020-08-12 08:42:52 +02:00
Adriaan de Groot
e406ae1967 [libcalamares] Add name to module descriptor
- introduce basic tests of the data structure
- interpret name when passed in as descriptor data
2020-08-12 00:52:54 +02:00
Adriaan de Groot
e1e81bb133 [libcalamaresui] Warnings--, don't shadow a parameter 2020-08-12 00:39:01 +02:00
Adriaan de Groot
f1bb70269f [libcalamares] Improve warning/error logging
- the lack of a space after the : was inconsistent with most of the
  rest of the logging.
2020-08-12 00:34:22 +02:00
Adriaan de Groot
65273a262b [libcalamares] Start putting data into the module Descriptor 2020-08-12 00:33:08 +02:00
Adriaan de Groot
60fbf04594 [calamares] Adjust module test-loader for changed API
- the test-loader needs to create modules (and does so hackishly,
  outside of the ModuleManager) so it needs to chase the API as well.
2020-08-11 22:26:12 +02:00
Adriaan de Groot
3c6e53ecb9 [libcalamaresui] Chase the change in Module descriptor
- most of the code becomes **simpler** because the requirement
  to handle unstructured data is now in the descriptor itself,
  rather than in consumers.
2020-08-11 22:26:12 +02:00
Adriaan de Groot
ee834a7abb [libcalamares] Define interface for Module descriptor
- 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
2020-08-11 22:26:12 +02:00
Adriaan de Groot
f0c4164515 [libcalamares] Add a more convenient find() to NamedEnum
- 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.
2020-08-11 22:26:12 +02:00
Adriaan de Groot
197cb9982c [libcalamares] Sort the tests by subdir 2020-08-11 22:26:12 +02:00
Adriaan de Groot
bdd6bdc3b2 [libcalamares] Migrate module type and interface to descriptor
- 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
2020-08-11 22:26:12 +02:00
Adriaan de Groot
215cd0d1c3 [users] Repair test on openSUSE 2020-08-11 22:16:03 +02:00
Bart Ribbers
b144f1dfc0
[mkinitfs] New module
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.
2020-08-11 18:18:52 +02:00
Adriaan de Groot
7cef99605f [libcalamares] Distinguish instances with an explicit weight
- setting the weight in *instances* should be different from letting
  the default weight (of 1) stand; explicitly saying 1 should
  carry some weight (ha!)
2020-08-11 16:45:51 +02:00
Adriaan de Groot
c8964717c7 [calamares] Bail out on invalid settings 2020-08-11 16:32:44 +02:00
Adriaan de Groot
d81d585c32 [libcalamares] Add isValid() to Settings
- settings can be invalid (missing data, whatever) and that
  can be used to shut things down early. Validity must be
  checked explicitly, though.
2020-08-11 16:32:44 +02:00
Adriaan de Groot
4cd2a4ae91 [libcalamares] Produce warnings while reading settings
- 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
2020-08-11 16:32:44 +02:00
Adriaan de Groot
a8075fba5f [libcalamares] Chase API change in settings 2020-08-11 16:32:44 +02:00
Adriaan de Groot
253e5610af [libcalamares] Better type for the list of InstanceKeys
- *sequence* lists module instance keys; make the stored type of
  those keys InstanceKey instead of QString
2020-08-11 16:32:44 +02:00
Adriaan de Groot
b23dbd47c7 [libcalamaresui] Chase changes in instanceDescriptor
- this is mostly about deleting code, since the special-cases
  now live in libcalamares where `settings.conf` is interpreted.
2020-08-11 16:32:44 +02:00
Adriaan de Groot
57f5a92d96 [libcalamares] Build complete instanceDescriptor list
- 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.
2020-08-11 16:32:44 +02:00
Adriaan de Groot
4968efdaa7 [libcalamares] Simplify constructors of InstanceDescription
- 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
2020-08-11 16:32:44 +02:00
demmm
355a4f9b8d [usersq] adding QML module usersq
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.
2020-08-11 13:46:05 +02:00
Adriaan de Groot
e507338f4c [libcalamares] Test config filenames as well (custom vs standard) 2020-08-11 13:27:15 +02:00
Adriaan de Groot
1f57a99ff2 [libcalamares] Rename moduleInstances() and fix tests
- "custom" is a misnomer, so drop that from the name
- tests adjusted: all instances are returned, not just the "custom"
  ones.
2020-08-11 12:54:29 +02:00
Adriaan de Groot
6f7234e4ac [libcalamares] Add all mentioned instances to the instanceList
- "custom" instances is now a misnomer, since all the instances
  go into it; they are distinguished by `isCustom()` on the descriptor
2020-08-11 12:43:59 +02:00
Adriaan de Groot
f157d9c459 [libcalamares] Refactor data-loading in Settings
- 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
2020-08-11 11:53:50 +02:00
Adriaan de Groot
34e31d4331 [libcalamares] Revert PRIVATETEST
- 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
2020-08-11 11:09:07 +02:00
Adriaan de Groot
53eb6c614a [libcalamares] Make InstanceDescription a class
- switch from dumb struct to a class; use a structured InstanceKey
- expand testing of InstanceKey and InstanceDescription
2020-08-11 10:31:12 +02:00
Adriaan de Groot
9c382e3555 [libcalamares] Support switching public/private during tests 2020-08-11 10:16:00 +02:00
Adriaan de Groot
e96198e61c Merge branch 'calamares' into issue-1176 2020-08-10 23:22:14 +02:00
Adriaan de Groot
9413b28209 [libcalamares] Improve logging - report correct number of jobs left 2020-08-10 20:22:48 +02:00
Adriaan de Groot
e9f2c57442 [users] Missing ! makes install always fail
FIXES #1483
2020-08-10 18:37:26 +02:00
Adriaan de Groot
31cfdf926c [libcalamares] Apply SPDX to utils/ 2020-08-10 18:21:42 +02:00
Adriaan de Groot
c48ec6bf94
Merge pull request #1481 from demmm/calamares
[welcomeq] language bar icon configurable
2020-08-10 17:02:58 +02:00
Adriaan de Groot
03871db597 [users] **keep** the create users job
- need to add the job to the list rather than just leaking it
2020-08-10 16:52:19 +02:00
Adriaan de Groot
cac3e042d8 [libcalamares] Improve logging in runCommand() (less chatty) 2020-08-10 16:41:19 +02:00
Adriaan de Groot
3a0155b69d [calamares] Fix up multiple-moc of 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
2020-08-10 16:41:19 +02:00
Adriaan de Groot
3227658475 [calamares] Fix up multiple-moc of 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
2020-08-10 16:10:16 +02:00
demmm
01f0367459 [localeq] use image instead of theme icon 2020-08-10 12:30:55 +02:00
Adriaan de Groot
483c0a84f8 [libcalamares] Update SPDX in modulesystem/ 2020-08-10 09:53:05 +02:00
Adriaan de Groot
21b4a36a91 [libcalamares] Remove empty .cpp file
- 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).
2020-08-10 09:50:27 +02:00
Adriaan de Groot
d83543d904 Merge branch 'calamares' into issue-1176 2020-08-10 09:45:05 +02:00
Adriaan de Groot
a873badf87 [libcalamares] Update SPDX identifiers in locale/ 2020-08-10 09:43:13 +02:00
Adriaan de Groot
296146e4f8 [libcalamares] update SPDX licensing on generated files
- 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)
2020-08-10 09:32:50 +02:00
Adriaan de Groot
4a3378d8b9 [libcalamares] Repair tests around save/load YAML round-trip
- 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.
2020-08-09 23:01:59 +02:00
Adriaan de Groot
e2bf62a64b [libcalamares] Repair test for old Qt
- Qt 5.11 and early 5.12 just don't support Esperanto at all
2020-08-09 22:35:10 +02:00
Adriaan de Groot
f08b4e502a i18n: update English source translations 2020-08-09 20:58:16 +02:00
Adriaan de Groot
62a8ee9708 [libcalamares] Add name-for-partition-type method
- 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.
2020-08-09 00:00:14 +02:00
Adriaan de Groot
537aad1222 [libcalamares] SPDX, DLLEXPORT on partition/FileSystem.h 2020-08-08 23:32:09 +02:00
Adriaan de Groot
fe3495ff97 [libcalamares] Expand KPMCore tests
- check on FS names as well
2020-08-08 22:54:59 +02:00
Adriaan de Groot
5e5701363c [libcalamares] Test the spot-patch for Johannesburg
- Add a note about notation, degrees-minutes
2020-08-09 00:35:19 +10:00
Adriaan de Groot
e35992cf0b [libcalamares] Add spot-patches to timezone data
- 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.
2020-08-09 00:21:31 +10:00
Adriaan de Groot
028d424c73 [libcalamares] Expand testing of TZ location lookup
- 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.
2020-08-09 00:21:31 +10:00
Adriaan de Groot
6a33e72b58 [libcalamares] Refactor test to be data-driven
- this test is going to get a lot more cases, so prepare for that
2020-08-09 00:21:30 +10:00
Adriaan de Groot
00626fd96c [libcalamares] Refactor timezone loading
- load from a TextStream. This is prep-work for alternate TZ data
  sources.
2020-08-09 00:21:30 +10:00
Adriaan de Groot
0948963d86 [locale] Port TZ widget lookup to new find() method
- 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.
2020-08-09 00:21:30 +10:00
Adriaan de Groot
2f871acbfd [libcalamares] Expose distanceFunc-find for timezones 2020-08-08 13:45:32 +02:00
Adriaan de Groot
0fda1dcf7d [libcalamares] Refactor finding-TZ algorithm
- 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.
2020-08-08 13:26:39 +02:00
Adriaan de Groot
473daecdbf [grubcfg] expand config-testing for the new features
- 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.
2020-08-07 13:58:28 +02:00
demmm
e2a5eb6840 [welcomeq] language bar icon configurable
similar functionality as in welcome module, set in welcomeq.conf
2020-08-07 12:44:07 +02:00
Adriaan de Groot
8bf95b6881 [grubcfg] Support prefer_grub_d settings 2020-08-07 12:13:51 +02:00
Adriaan de Groot
064fff0c12 [grubcfg] Drop default_dir
- 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).
2020-08-07 12:07:26 +02:00
Adriaan de Groot
aa50dfb8a1 [grubcfg] refactor finding-the-grub-paths into a function 2020-08-07 12:02:42 +02:00
Adriaan de Groot
f85c70d4d2 [grubcfg] Introduce prefer_grub_d
- new setting for using /etc/defaults/grub.d/ (SEE #1457), not implemented
- add missing fields to schema for config file
2020-08-07 11:55:16 +02:00
Adriaan de Groot
3fc23e3b07 [grubcfg] Fix config schema 2020-08-07 11:43:48 +02:00
Adriaan de Groot
43f9f2e2f4 Merge branch 'issue-1477' into calamares
FIXES #1477
2020-08-07 11:30:30 +02:00
Adriaan de Groot
463ea3c73f [displaymanager] Fix config schema 2020-08-07 10:50:33 +02:00
Adriaan de Groot
2ce12d5368 Merge branch 'issue-1476' into calamares
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 #1476
FIXES #1426
2020-08-07 08:33:44 +02:00
Adriaan de Groot
cb20ba6aba [libcalamares] More GS load/save testing
- failures elsewhere boil down to QStringList is not supported,
  but a QVariantList of QVariants of QStrings is.
2020-08-07 01:11:14 +02:00
Adriaan de Groot
0de98fe4c1 [libcalamares] Expand YAML testing a little
- load/save of a stringlist seems to work
2020-08-07 00:57:30 +02:00
Adriaan de Groot
dbc49f001e [libcalamares] Test GS
- 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)
2020-08-07 00:45:36 +02:00
Adriaan de Groot
a44e6802e5 [libcalamares] Rename tests for consistency 2020-08-07 00:13:58 +02:00
Adriaan de Groot
3c618a9a19 [libcalamares] Fix GS load behavior
- 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.
2020-08-07 00:08:47 +02:00
Adriaan de Groot
ac713d8c4b [libcalamares] Apply locking to GS access 2020-08-07 00:06:13 +02:00
Adriaan de Groot
dc5d98af7d [libcalamares] Address outdates assumptions about thread-safety 2020-08-07 00:02:14 +02:00
Adriaan de Groot
0121e3755b [libcalamares] GS improve load/save
- save should be const
- rename save() to saveJson() for parity with saveYaml()
2020-08-07 00:02:14 +02:00
Adriaan de Groot
104452513b [libcalamares] Document GS
- write apidox for all of GlobalStorage
- while here, polish up the SPDX bits
2020-08-06 23:14:44 +02:00
Adriaan de Groot
527449a102 [libcalamares] Improve GS debugDump() formatting 2020-08-06 22:54:37 +02:00
Adriaan de Groot
c64aefe43c [libcalamares] Remove unused include, declaration 2020-08-06 22:53:32 +02:00
Adriaan de Groot
52d1c8f88a [locale] Explicitly update GS from the locale step
- refactor into some free functions (out of the lambda's for connecting)
- introduce new method to call from onLeave(), matching previous
  widget behavior
2020-08-06 18:32:51 +02:00
Adriaan de Groot
c69bd972e9 [localeq] Demonstrate "offline" lookups
- 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.
2020-08-06 16:09:41 +02:00
Adriaan de Groot
71ca1e1544 [localeq] Pick up Config changes before showing the module 2020-08-06 16:09:41 +02:00
Adriaan de Groot
32c8338a9c [locale] QML doesn't like const 2020-08-06 16:09:41 +02:00
Adriaan de Groot
91cc5a2b42 [locale] Update the map-QML implementation
- 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.
2020-08-06 16:09:41 +02:00
Adriaan de Groot
15a8d62986 [locale] Add a 'current timezone' strings to Config
- 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.
2020-08-06 16:09:41 +02:00
Adriaan de Groot
eda14ce548 [locale] Avoid nullptr deref
- 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.
2020-08-06 16:09:41 +02:00
Adriaan de Groot
b36ad4c7f4 [locale] Add test for Config initialization
- 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.
2020-08-06 16:09:41 +02:00
Adriaan de Groot
04e53be934 [locale] Repair test: don't re-init te occupied-pixels set each loop
- while here, merge Tests.h to the cpp file
- Fix build when debugging timezones (missed during earlier refactor)
2020-08-06 16:09:41 +02:00
Adriaan de Groot
21f97db8fd [libcalamares] Offer translation lookup of regions 2020-08-06 16:09:41 +02:00
Adriaan de Groot
ad3c0de936 [libcalamares] Reduce logging in POD manipulation 2020-08-06 14:27:55 +02:00
Adriaan de Groot
296337d45d [libcalamares] Implement nearest-TZ lookup
- This version, based on lat+lon lookup, handles wrap-around the
  globe at -180 W (which is very close to +180 E)
- Test wrap-around-the-globe lookups
2020-08-06 14:27:44 +02:00
Adriaan de Groot
9e274aac07 [libcalamares] Make ZonesModel more QML-friendly
- expose TZ lookup (as a QObject*, which QML needs)
- C++ code should use find(), which is safer
2020-08-06 14:27:09 +02:00
Adriaan de Groot
ab69e7c83a [libcalamares] Add API for geographical lookup
- find a zone given lat, lon -- with a failing test and a bogus
  implementation.
2020-08-06 01:52:50 +02:00
Adriaan de Groot
626dd038da [locale] Re-do locale module with new TZ data
- 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
2020-08-06 01:34:55 +02:00
Adriaan de Groot
d814a3dba8 [libcalamares] Sort the models before use
- zones and regions alphabetically by key
2020-08-06 01:34:55 +02:00
Adriaan de Groot
37c211fd14 [libcalamares] Add an iterator for the full zones model 2020-08-06 01:34:55 +02:00
Adriaan de Groot
7ea2ad7dc6 [libcalamares] Add accessors for TZ data and region in the 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.
2020-08-06 01:34:44 +02:00
Adriaan de Groot
245d4a8ef7 [libcalamares] Add a find() to ZonesModel
- Look up TZ data by region and zone name.
2020-08-06 01:33:25 +02:00
Adriaan de Groot
478a275764 [libcalamares] Make TimeZoneData public
- Also make it a QObject so we can add properties and make it useful
  for QML consumption.
2020-08-06 01:33:21 +02:00
Adriaan de Groot
10fb5b95c7 [libcalamares] Split out CStringPair into TranslatableString
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.
2020-08-05 17:52:41 +02:00
Adriaan de Groot
3e32335511 [libcalamares] Introduce a filtering model per-region 2020-08-05 17:14:13 +02:00
Adriaan de Groot
1afdcc9c82 [libcalamares] Give zones data, too
- while here, fix bug in TimeZoneData that didn't munge names
  (so it reported "New_York")
2020-08-05 16:45:41 +02:00
Adriaan de Groot
33e39b92fb [libcalamares] Satisfy test, return region names 2020-08-05 16:36:00 +02:00
Adriaan de Groot
609ea8350c [libcalamares] Failing test: there is data in the regions model 2020-08-05 16:25:45 +02:00
Adriaan de Groot
82cc652f55 [libcalamares] Re-done zones loading
- just make one big list of zones, one short list of regions
- the models are non-functional right now
2020-08-05 16:21:05 +02:00
Adriaan de Groot
ca40d2e2d9 [libcalamares] Introduce a failing test for the number of regions 2020-08-05 15:17:09 +02:00
Adriaan de Groot
fce05acf1e [libcalamares] Rip out all the TZ models
- 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.
2020-08-05 15:11:52 +02:00
Adriaan de Groot
5066624a8e Merge branch 'issue-1471' into calamares
FIXES #1471
2020-08-05 14:25:49 +02:00
Adriaan de Groot
082770032f [hostinfo] Massage test to handle ARM
- 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.
2020-08-05 14:24:28 +02:00
Adriaan de Groot
272cf099be [hostinfo] Try to recognize ARM as well
- /proc/cpuinfo is a terrible information source; it contains very
  different information on x86 from arm (testen on rpi4 and rock64).
2020-08-05 14:07:39 +02:00
Adriaan de Groot
b49b9a66e6 [users] Drop data-access from the Page
- 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
2020-08-05 13:42:18 +02:00
Adriaan de Groot
eb72d662d1 [users] Add password fields to Config
- no checking is done for validity, and there is no password-status
2020-08-05 13:29:12 +02:00
Adriaan de Groot
b2b9ae7799 [users] Add tests for moved password-check configuration
- link the PW checks to the test, and libpwquality if needed
- test only does very basic config-mungeing
2020-08-05 13:03:56 +02:00
Adriaan de Groot
900deb5dc8 [users] Move the configuration of password checks to Config
- the Widget (Page) does not need to know the password checks,
  that's business logic that belongs to Config.
2020-08-05 13:03:18 +02:00
Adriaan de Groot
7b87242107 [users] PW checking does not need widgets 2020-08-05 12:56:09 +02:00
Adriaan de Groot
0ecf1e1cc1 [users] Drop default parameter for badness 2020-08-05 12:24:39 +02:00
Adriaan de Groot
fcafe5db8f [users] Test the moved setHostname Config
- document that the default for writeHostsFile is *true*
2020-08-05 10:50:38 +02:00
Adriaan de Groot
2efce1ac7a [users] Move the hostname-setting 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.
2020-08-05 10:29:13 +02:00
Adriaan de Groot
35dff4d12c [users] Migrate reuse-password and password-strength to Config
- 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.
2020-08-04 22:40:27 +02:00
Adriaan de Groot
44bc61d4be [users] set up Config object before widget 2020-08-04 22:37:27 +02:00
Adriaan de Groot
23b507ae8e [partition] Chase constness, makeJob() 2020-08-04 16:53:29 +02:00
Adriaan de Groot
20b477d063 [partition] Distinguish jobs with updatePreview() 2020-08-04 16:20:04 +02:00
Adriaan de Groot
62579e0f42 Merge branch 'calamares' into issues-1166 2020-08-04 16:08:01 +02:00
Adriaan de Groot
05f3fbea05 [locale] Apply SPDX headers 2020-08-04 13:45:36 +02:00
Adriaan de Groot
3f1b31e352 [libcalamares] Explicit tests for Interlingue
- 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.
2020-08-04 13:26:37 +02:00
Adriaan de Groot
b27bc11975 [libcalamares] Merge locale tests files
- No need for a separate .h in most test cases
2020-08-04 12:59:55 +02:00
Adriaan de Groot
320779ccbe [libcalamares] Document Job::prettyDescription
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).
2020-08-04 11:19:17 +02:00
Adriaan de Groot
88e5e98d29 [libcalamares] Use consistent type alias (Descriptor) 2020-08-04 10:19:40 +02:00
Adriaan de Groot
ea709aab59 [libcalamaresui] Swap out unstructured string for structured data 2020-08-04 01:31:22 +02:00
Adriaan de Groot
b5c0158ec2 [libcalamares] Some if-method-exists trickery
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.
2020-08-03 21:52:47 +02:00
Adriaan de Groot
7b6ff8dd37 [libcalamares] Minor tests for parts of RAII 2020-08-03 15:13:51 +02:00
Adriaan de Groot
6e31d9de4b [partition] Name deviceInfo consistently, auto*
- use auto* for pointer type where we already say "device info" twice
2020-08-03 13:41:34 +02:00
Adriaan de Groot
22ba3cc62d [partition] Make private struct type private
- 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
2020-08-03 13:38:12 +02:00
Adriaan de Groot
c2929e93b3 [partition] Start sanitizing the Jobs on a Device
- 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.
2020-08-03 13:13:56 +02:00
Adriaan de Groot
c63d4ad2cc [partition] Enable 'file' swap choice
SEE #1166
2020-08-03 12:31:38 +02:00
Adriaan de Groot
0902c74809 [hostinfo] Editorialize on the tests
- the implementation understands Intel and AMD, but the test
  was written for my desktop machine (which fails elsewhere).

SEE #1471
2020-08-03 11:36:44 +02:00
Adriaan de Groot
b1b81f27cc Merge branch 'issue-1297' into calamares
This does **not** result issue-1297, but brings in some
prep-work and pleasant clean-ups.
2020-07-31 23:21:23 +02:00
Adriaan de Groot
41ce42cd4b [partition] Drop InstallChoice enum from Page
- 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.
2020-07-31 23:20:51 +02:00
Adriaan de Groot
e21a2f0676 [partition] Add InitialInstallChoice to Config
- 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
2020-07-31 23:20:10 +02:00
Adriaan de Groot
380e2b3613 [partition] Fix up schema file 2020-07-31 23:12:49 +02:00
Adriaan de Groot
42889b5d7f [users] Perhaps triggers the build failure
- This is the only use of STATICTEST together with , and is the only
  one failing to link.
2020-07-31 09:52:06 +02:00
Adriaan de Groot
fec8361ed5 [partition] Drop "convenience" functions
- the functions are used just once
- thin wrappers for named-enum methods that are just as convenient
2020-07-30 10:51:48 +02:00
Adriaan de Groot
824dac62d8 [partition] ChoicePage to use Config object 2020-07-30 10:44:10 +02:00
Adriaan de Groot
d103c42091 [partition] Fix build now swapChoices lives in config 2020-07-30 10:26:58 +02:00
Adriaan de Groot
baabcc5bb4 Merge branch 'calamares' into issue-1297 2020-07-29 22:35:23 +02:00
Adriaan de Groot
33fd5a1fad [partition] Report a valid choice if a partition is selected 2020-07-29 17:58:13 +02:00
Adriaan de Groot
ef4c2666e1 [partition] Update icons on all state changes
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).
2020-07-29 14:46:11 +02:00
Adriaan de Groot
0eb1f002db [partition] defuse is-next-enabled
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.
2020-07-29 14:21:19 +02:00
Adriaan de Groot
f1c4caba48 [partition] Refactor checking next-enabled
- move the calculations to an own method (so it can use
  early-return and log things to explain why next is disabled)
2020-07-29 14:21:19 +02:00
Adriaan de Groot
43cd415d9a [partition] Switch to 'modern' Error/ok icons 2020-07-29 14:21:19 +02:00
Adriaan de Groot
892e9798f4 [users] Sanitize tests
- move the testing of config-object methods to its own tests
- simplify file structure for the password job tests
2020-07-29 13:31:39 +02:00
Adriaan de Groot
cc1136fb0e [users] Untangle tests
- name sources for tests consistently Test<something>
- chase some required source changes with the renaming
- name test targets consistently too
2020-07-29 13:23:41 +02:00
Adriaan de Groot
f75839340a [users] Drop QRegExpValidator
- QREValidator is a GUI part, so to avoid a dependency on GUI for the
  (non-GUI) Config object, port to the simpler QRE (which we had
  available anyway)
2020-07-29 12:27:56 +02:00
Adriaan de Groot
b9372ba432 [users] Move default groups setting to Config
- 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.
2020-07-29 12:18:25 +02:00
Adriaan de Groot
bfa1f618c7 CMake: Improve RCC version-checking
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.
2020-07-29 10:05:01 +02:00
Adriaan de Groot
38b347f8f2 [libcalamares] Take ownership of the versioning headers
- 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
2020-07-29 10:02:37 +02:00
Adriaan de Groot
9568fc082f [calamares] Try to reduce compile-churn with version header
- 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.
2020-07-29 10:02:37 +02:00
Adriaan de Groot
b06498194e [machineid] Fix up schema
- schema didn't allow recent (2019) configuration entries
- remove mention of deprecated key from example config
2020-07-28 14:46:56 +02:00
Adriaan de Groot
cc2e3f79ff [users] Move job creation from widget to viewstep
- 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().
2020-07-28 12:16:03 +02:00