Commit Graph

7659 Commits

Author SHA1 Message Date
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
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
Adriaan de Groot
6a03bcb25e [users] Move setRootPassword to Config
- this really controls whether a root password is written during installtion,
  so rename to writeRootPassword in the code.
2020-07-28 11:59:53 +02:00
Adriaan de Groot
45b71c24e7 [users] Move autologin setting to Config 2020-07-28 11:41:52 +02:00
Adriaan de Groot
6c930af5cb [users] Use convenience method for labeling Full Name 2020-07-28 11:18:07 +02:00
Adriaan de Groot
0813ec3327 [users] Misc cleanups
- unused includes
- avoid "my--pc" .. the dash is inserted by makeHostnameSuggestion()
2020-07-28 10:49:12 +02:00
Adriaan de Groot
9018913af5 [users] Move hostname validation to Config 2020-07-28 10:45:38 +02:00
Adriaan de Groot
40d7d1baac [users] Move login validation to Config object
- add a loginNameStatus which is a QString (empty if things are ok)
  stating what's wrong with the loginName, if anything.
2020-07-28 10:21:23 +02:00
Adriaan de Groot
a564d7a753 [users] Fix build on Linux 2020-07-28 09:42:32 +02:00
Adriaan de Groot
d4a784f521 [users] Hook up full name to Config 2020-07-27 17:52:46 +02:00
Adriaan de Groot
630a508049 [users] Hack - create the widget anyway
- since the configuration is in the UI parts, we need the widget still
  to load the whole configuration (until the config object is complete).
  Create the widget before doing configuration; this is wrong. But now
  we don't hit nullptr derefs all over.
2020-07-27 17:29:46 +02:00
Adriaan de Groot
8a14cc7ffc [users] Move some configuration from Page to Config object
- make the HostName textbox just a view on the Config's HostName
- make the username and login textboxes view onto Config
- query the Config rather than the UI for job data
2020-07-27 17:26:46 +02:00
Adriaan de Groot
5ffa09000a [users] Add hostname guessing to Config 2020-07-27 17:26:46 +02:00
Adriaan de Groot
411a202ba5 [users] Do some login-name guessing 2020-07-27 17:26:46 +02:00
Adriaan de Groot
66ae1823a5 [users] Give Config object a user and login name
- This is incomplete, because the business logic of guessing
  a login from the username is not here.
2020-07-27 17:26:46 +02:00
Adriaan de Groot
35916eb20f [users] Move autologin and sudoers groups to Config 2020-07-27 17:26:46 +02:00
Adriaan de Groot
2f786079f3 [users] Move shell settings to the Config object
- this is a set-only property (as far as the current ViewStep is
  concerned) and is passed around in GS for non-obvious reasons.
2020-07-27 17:26:46 +02:00
Adriaan de Groot
8497aad7a1 [users] Apply coding style 2020-07-27 17:26:46 +02:00
Adriaan de Groot
f9b114a67a [users] Pass the Config object to the Page
- delay construction of the Page (widget) until it's needed
- hand the Config object to the Page on construction

This is prep-work for putting the configuration information into the
Config object, rather than in the UI elements.
2020-07-27 17:26:46 +02:00
Adriaan de Groot
4d85a64e4f [users] Fix build on Linux 2020-07-27 17:14:06 +02:00
Adriaan de Groot
dab831b2ff [users] Introduce a (stub) Config object 2020-07-27 15:55:04 +02:00
Adriaan de Groot
1e08ee084f [users] Actually add the test file 2020-07-27 15:35:24 +02:00
Adriaan de Groot
92938f63f8 Merge branch 'move-permissions' into calamares 2020-07-27 15:05:46 +02:00
Adriaan de Groot
8ce7457023 [users] Add test for create-users code
- just one test for groups-file loading
- while here fix bug that blank and comment lines were being
  kept as valid group names
2020-07-27 15:00:14 +02:00
Adriaan de Groot
8a6e4af511 [users] FreeBSD support creating user
- call pw useradd and pw usermod as needed; the code paths are basically
  the same in invoking a program in the target system to do the work.
2020-07-27 13:45:00 +02:00
Adriaan de Groot
26b8c82630 [users] Refactor user-creation and user-group-setting into methods
- This is prep-work for handling other tools for user- and group-
  creation as well.
2020-07-27 13:29:51 +02:00
Adriaan de Groot
1fddf723fe [users] FreeBSD support creating groups 2020-07-27 13:18:09 +02:00
Adriaan de Groot
b99b87f787 [users] Explain some weird internals 2020-07-27 12:37:04 +02:00
Adriaan de Groot
90a0605f38 [preservefiles] [users] Use the Permissions methods
- don't call out to tools (executables) when we have an API for it
  (which might call out to those tools, but that's abstracted)
2020-07-27 12:27:45 +02:00
Adriaan de Groot
59dff815fc [libcalamares] Additional apply() methods for Permissions 2020-07-27 12:27:38 +02:00
demmm
389e36303f Changes: document keyboardq changes 2020-07-27 11:17:00 +02:00
Adriaan de Groot
1babcd2aa4 [libcalamares] Put Permissions in CalamaresUtils namespace
- most of the things in utils/ are in the CalamaresUtils namespace,
  let Permissions follow suit. Chase the name change in the
  *preservefiles* module.
- add an `apply()` function for doing the most basic of chmod.
  Note that we don't use `QFile::setPermissions()` because the
  **values** used are different (0755 for chmod is 0x755 in the
  enum value passed to `setPermissions()`).
2020-07-27 10:57:15 +02:00
Adriaan de Groot
5e35bcc830 Changes: document new features, translations 2020-07-27 10:42:45 +02:00
Adriaan de Groot
d6910b47b5
Merge pull request #1464 from apt-ghetto/fixManualPartitionMsg
Revert Manual Partition instructions
2020-07-26 11:19:30 +02:00
Adriaan de Groot
d22f392609 CMake: update language lists
- welcome Tajik
- welcome Interlingue
2020-07-26 11:09:45 +02:00
Calamares CI
d0cdc8169e i18n: [python] Automatic merge of Transifex translations 2020-07-26 11:02:37 +02:00
Calamares CI
d5d2d2a1f1 i18n: [desktop] Automatic merge of Transifex translations 2020-07-26 11:02:36 +02:00
Calamares CI
e0bb7d9f6f i18n: [calamares] Automatic merge of Transifex translations 2020-07-26 11:02:36 +02:00
Adriaan de Groot
a01c428270
Merge pull request #1465 from apt-ghetto/fixRootUsername
[users] Do not allow 'root' as username
2020-07-25 17:22:34 +02:00
demmm
3a3507f2b2 [keyboardq] remove background image use
make the module more in line with the look of the rest of Calamares
2020-07-25 17:18:28 +02:00
apt-ghetto
01b22d27a8 Do not allow 'root' as username
On the "Users" tab, the user can choose a username. It was possible to
use 'root' as username, which led to an installation error, because
'root' exists already.

Added a new check to the username validation.

Fixes #1462.
2020-07-25 16:17:57 +02:00
apt-ghetto
2b3cc17782 Revert Manual Partition instructions
With PR calamares/calamares#1357 the label of the "Manual partitioning" option
was changed, which introduced several downsides:
  * The label is shown for UEFI and for BIOS installations.
  * The mountpoint of the ESP is and should be distro specific.
  * The label always mentioned GPT, which is irrelevant.
  * The label should explain, what the option does, and not, what
    problems can occur under certain circumstances.
2020-07-24 17:56:58 +02:00