Commit Graph

7707 Commits

Author SHA1 Message Date
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
32e3933355 CMake: stop clobbering config files
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).
2020-08-05 10:03:35 +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
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
29cfcb01da i18n: suppress Interlingue
- like Esperanto before Qt 5.12, Interlingue does not
  seem to be supported by QLocale, so it gets turned into
  "C" locale, which then messes up the default language
  selection in the welcome page.

Move it to _incomplete until QLocale does support it.

FIXES #1475
2020-08-04 12:40:08 +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
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
7e60ee059c Merge branch 'txstats' into calamares
Improve automation in handling translation-lists updates.
2020-07-31 12:48:57 +02:00
Adriaan de Groot
5380f8062d i18n: when editing CMakeLists in-place, be a little more verbose 2020-07-31 12:46:52 +02:00
Adriaan de Groot
1a87879f9b i18n: enable updating stats-in-place 2020-07-31 12:44:55 +02:00
Adriaan de Groot
dacd236f6a i18n: factor out output method for txstats 2020-07-31 12:22:40 +02:00
Adriaan de Groot
a66eabe9ef i18n: support bogus TX data for testing 2020-07-31 12:17:07 +02:00
Adriaan de Groot
3762d4df05 i18n: refactoring txstats 2020-07-31 12:07:01 +02:00
Adriaan de Groot
fad364993c i18n: use modern argument-handling in the TX statistics script 2020-07-31 10:46:54 +02:00
Adriaan de Groot
eacaa99609 Changes: welcome to a complete Tajik translation.
FIXES #1468
2020-07-31 10:32:46 +02:00
Calamares CI
40f5440517 i18n: [python] Automatic merge of Transifex translations 2020-07-31 10:29:03 +02:00
Calamares CI
eca56c7684 i18n: [desktop] Automatic merge of Transifex translations 2020-07-31 10:29:02 +02:00
Calamares CI
c6235d03e7 i18n: [calamares] Automatic merge of Transifex translations 2020-07-31 10:29:02 +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
14df032803 CI: build verbose the first time, too 2020-07-29 22:32:52 +02:00
Adriaan de Groot
8f133fe113 Merge branch 'issue-1459' into calamares
FIXES #1459
2020-07-29 19:12:33 +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
33eab6e869 CMake: improve validator dependency-checking
The configvalidator has some extra Python dependencies. Cache
the restults of checking the dependencies (convenient for developers),
and also explain what's going on if the feature is switched off.
2020-07-29 10:58:07 +02:00
Adriaan de Groot
37c236cfe7 Merge branch 'reduce-version-deps' into calamares
This is a developers quality-of-life fix: reduce the amount
of recompilation that is done after running cmake. Since KDevelop
runs cmake in the background regularly, this was causing 4 files
to be rebuilt every run that don't *really* need to be rebuilt.
2020-07-29 10:09:46 +02:00
Adriaan de Groot
afb0b36f58 CMake: simplify QRC generation
Use configure_file() to avoid stomping on timestamps: if the list
of translations doesn't change, we don't need to rebuild the
translated QRC.
2020-07-29 10:07:57 +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
506ea39508 Merge branch 'issue-1462' into calamares
This does about half of the move-settings-from-Widget-internals to Config.
By having the configuration **and** the business logic in a Config object,
we can hook up other UIs more easily while preserving the business logic.
(e.g. this is a prerequisite for QML uis, but also for scripting and
quickstart logic).

SEE #1462
2020-07-28 12:22:51 +02:00