Commit Graph

5928 Commits

Author SHA1 Message Date
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
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
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
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
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
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
d6910b47b5
Merge pull request #1464 from apt-ghetto/fixManualPartitionMsg
Revert Manual Partition instructions
2020-07-26 11:19:30 +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
demmm
d114c383fa [localeq] remove obsolete vars & comments
set index in i18n.qml to -1, old settings were just for reading from the bogus model
current model uses strings, so index fails to read from it.  This fixes cala crashing on loading i18n.qml
2020-07-24 17:34:14 +02:00
Adriaan de Groot
409ab6ee86 [users] Refactor writing sudoers file
- use existing convenience methods
2020-07-24 14:27:42 +02:00
Adriaan de Groot
bc484ae5da [users] Refactor /etc/group file handing 2020-07-24 14:27:42 +02:00
Adriaan de Groot
4d3422b931 [libcalamares] dox for Permissions
- Expand the documentation, emphasize octal-vs-decimal
- east-const consistently in this file (most of Calamares is west-const)
- shuffle the is-valid bool to the end of the data members,
  so sorting by size.
2020-07-24 14:24:03 +02:00
Adriaan de Groot
11482559ad [netinstall] There is no netinstall.qrc 2020-07-24 13:39:43 +02:00
Adriaan de Groot
2c110bfc66 Merge branch 'calamares' into move-permissions 2020-07-24 12:29:10 +02:00
Adriaan de Groot
682146aa9b [libcalamares] Expand dox on TimeZone pairs 2020-07-24 12:15:32 +02:00
Adriaan de Groot
09020d68b0 [libcalamaresui] Make dox of ModuleManager signals more explicit 2020-07-24 12:15:27 +02:00
Adriaan de Groot
a080e47f4b [locale] Add prettyStatus to Config
- this is present in the previous config, and helps make the modules
  consistent by returning prettyStatus in both ViewSteps.
2020-07-24 11:53:32 +02:00
Adriaan de Groot
07c096673d [localeq] Report summary before install 2020-07-24 11:10:56 +02:00
Adriaan de Groot
a4ed160060 [localeq] Offer a Config setting to set location from region/zone
- already had methods for various kinds of broken-up data, but
  not one for plain "region/zone" strings; having this makes
  it easier for QML to report a zone.
- use the region/zone method from QML, so that clicking on the
  world map updates the actual TZ in Config.
2020-07-24 11:07:58 +02:00
Adriaan de Groot
e78cde7ccb [locale] Update GS when the LC value changes (not just location) 2020-07-23 23:32:53 +02:00
Adriaan de Groot
00e9454344 [localeq] Hook up to Config object
- get network status from the global Network object; document that
- get the strings describing the language and LC settings from
  the config-object instead of roll-our-own
- use the model of supported locales from Config to populate listboxes
- connect selection of language or LC to the Config object
2020-07-23 23:32:53 +02:00
Adriaan de Groot
75da1bece4 [locale] Add properties for language and LC codes
- we already had the human-readable status strings, but also want the
  actual code (particularly for being able to **update** the code
  from QML)
2020-07-23 23:25:52 +02:00
Adriaan de Groot
fdbfbfe284 [localeq] Fix build, missed one case of removed member variable 2020-07-23 17:46:20 +02:00
Adriaan de Groot
fb927c9763 [localeq] Use network-connected property to direct map-loading 2020-07-23 12:57:26 +02:00
Adriaan de Groot
36fb1124be [libcalamares] Export network status as Q_PROPERTY and to QML 2020-07-23 12:57:01 +02:00
Adriaan de Groot
51e743a67f [libcalamares] Give GlobalStorage a parent 2020-07-23 12:48:18 +02:00
Adriaan de Groot
4b7403d115 [localeq] Re-do with new Config
- remove stray and useless TODOs
- remove unnecessary empty overrides
- clean up includes
- drop all the code that is now in Config

Since the business logic (setting locations, maintaining GS, ...)
is all in the Config object, the ViewStep is remarkably simple:
hook up a UI to the Config, which in the case of QML is done
automatically.
2020-07-23 11:11:18 +02:00
Adriaan de Groot
d90d451f42 [locale] Remove unnecessary includes 2020-07-23 10:43:31 +02:00
Adriaan de Groot
1f3cb32486 [locale] Apply coding style 2020-07-22 17:10:08 +02:00
Adriaan de Groot
824cb4d4b8 [locale] As the Page is constructed, it shouldn't change the location
- since the Page hooked up a model and changed the region-selection
  **after** connecting to signals, it would reset the location
  to Africa/Abijan (alphabetically the first timezone) during
  construction. Don't do that.
2020-07-22 17:06:14 +02:00
Adriaan de Groot
4f684be83d [locale] Avoid crashes in the map widget if there is no current location 2020-07-22 17:06:14 +02:00
Adriaan de Groot
42331f6e13 [locale] Move GeoIP lookup to config
- replace the weird synchronous-lookup-during-requirements-checking
  with a proper async lookup when the system is ready.
2020-07-22 17:06:14 +02:00
Adriaan de Groot
a25d61077f [locale] Add GeoIP settings to Config
- this doesn't do the lookup **yet**
- while here, refactor setConfigurationMap so it reads like a story,
  with chunks bitten out into a handful of static inline void methods.
2020-07-22 11:53:06 +02:00
Adriaan de Groot
f64a1eb16a [libcalamaresui] Document the signals from ModuleManager 2020-07-22 11:52:42 +02:00
Adriaan de Groot
b607cf3f98 [locale] Get starting TZ in Config
- read the *region* and *zone* settings; this duplicates what
  the ViewStep does and is currently unused, but ..
- add new support for using the system's TZ (rather than
  the fixed values from *region* and *zone*). This complements
  GeoIP lookup.

This is the actual feature that started the long rewrite of
the Config object (so that all the business logic would be in
one place, usable for both widgets and QML).

FIXES #1381
2020-07-22 01:28:10 +02:00
Adriaan de Groot
781d76c9e5 [locale] Avoid nullptr if there is no location 2020-07-22 00:32:29 +02:00
Adriaan de Groot
0c9480aa3f [locale] Move more business logic to Config
- writing *localeConf* settings to GS can be done always when the
  formats are set, rather than special-cased. The code
  that handles the "special case" of no widget existing for the ViewStep
  overlooks the other crashes that happen then.
- Since Config knows what jobs to create, just ask it rather than
  keeping a copy.
2020-07-22 00:23:50 +02:00
Adriaan de Groot
f6419d5de1 [locale] New setting *adjustLiveTimezone*
- allow finer-grained control over whether-or-not to adjust the
  timezone in the live system.
- handle some special cases at the point of loading-configuration.
- document the setting in locale.conf
- correct some documentation bugs
- adjust the YAML schema for locale.conf so it's legal YAML syntax
  **and** validates the current file.
2020-07-22 00:11:55 +02:00
Adriaan de Groot
995ebd5c83 [locale] Remove unused #includes 2020-07-21 17:44:44 +02:00
Adriaan de Groot
1de2210d29 [locale] Move the GS updating to the Config object
- since all locale changes need to be entered into GS anyway, this
  is something the Config object can do because it is the source
  of truth for locale settings.
- drop all the GS settings from the Page.
2020-07-21 17:38:22 +02:00
Adriaan de Groot
f7c2e4a3e7 [locale] Sanitize Config signals and slots
- remove the weirdly-structured prettyStatus and similar:
  the Config object has human-readable status strings (three,
  for location, language, and LC-formats) which can be
  normal properties with signals.
- Implement prettyStatus in the view step by querying the Config.
2020-07-21 17:38:22 +02:00
Adriaan de Groot
ef08ff6ac0 [locale] Move status strings from Page to Config
- the config knows the status and how to describe it,
  fetch the strings from there.
2020-07-21 15:51:49 +02:00
Adriaan de Groot
855b21a7db [locale] Remove redundant method
- configuration information lives in the Config object
2020-07-21 15:35:38 +02:00
Adriaan de Groot
abc98cfa79 [locale] Simplify allocation, guard against crashes if the dialog is deleted. 2020-07-21 14:57:09 +02:00
Adriaan de Groot
66eacce654 [locale] Move localeconfiguration to Config object
- the language and LC settings migrate from page to config
- add API for explicitly setting language (which is then preserved
  when clicking new locations)
2020-07-21 13:16:52 +02:00
Adriaan de Groot
a307217d83 [locale] Tidy LocaleConfiguration
- expand API documentation
- minor coding-style adjustments
2020-07-21 11:13:40 +02:00
Adriaan de Groot
81520bbbf9 [locale] Chase RAII conveniences
- several early-return paths would leave the TZ widget blocked
- use the zones data from config
2020-07-21 00:21:42 +02:00
Adriaan de Groot
0645a46b42 [libcalamares] Expand RAII conveniences 2020-07-21 00:21:16 +02:00
Adriaan de Groot
98f912f80a [locale] Drop LocalePage:;init
- setting the initial location is something the Config-object should do
- setting up the combo-boxes can be done in the constructor
2020-07-21 00:11:16 +02:00
Adriaan de Groot
726f882185 [locale] Move current-location to Config 2020-07-20 23:06:12 +02:00
Adriaan de Groot
5a6a9a0d45 [locale] Move job-creation to Config
- since Config knows what settings there are, it should create the
  jobs to run later -- not the Page.
- this doesn't work yet, because the Config does **not** know what
  the selected timezone is yet.
2020-07-20 22:21:29 +02:00
Adriaan de Groot
8c21b59853 [locale] Remove unused localegen (moved to Config earlier) 2020-07-20 18:13:33 +02:00
Adriaan de Groot
f0cac7d669 [locale] Hook tz widget up to the Config's data 2020-07-20 16:54:44 +02:00
Adriaan de Groot
4d5ff6d5c4 [locale] Make the Page use the region model from Config 2020-07-20 16:27:15 +02:00
Adriaan de Groot
88d1d255f6 [locale] Add regions & zones models to Config
- The models are constant pointers, even if their contents aren't.
- Make the top-level (region) model point to the global TZ list.
2020-07-20 16:16:53 +02:00
Adriaan de Groot
51b7ec875f [locale] Don't need own copy of zones list 2020-07-20 13:55:00 +02:00
Adriaan de Groot
439f828d9b [locale] Document TZ widget 2020-07-20 13:47:23 +02:00
Adriaan de Groot
931ce20f30 [locale] Reduce API surface
- getLocationPosition doesn't need to be a method, since it calls out
  to a static function of TimeZoneImageList anyway.
2020-07-20 13:38:20 +02:00
Adriaan de Groot
25ba1bb767 [locale] Remove localeGenLines from page
- the Config object took over loading of the string list
- expose the list as a property
- drop loading code from the page.
2020-07-20 13:24:31 +02:00
Adriaan de Groot
338635146f [locale] Hand the Config object also to the page 2020-07-20 12:58:35 +02:00
Adriaan de Groot
b6b5c44996 [locale] Load supported locales in Config 2020-07-20 12:55:07 +02:00
Adriaan de Groot
8119c7e72a [locale] Reset Config object
The Config object wasn't being used at all in the locale module;
reset it to empty and start using it in locale, so that
configuration functionality can be added to it as-needed,
and with the necessary refactoring built-in.
2020-07-20 12:37:27 +02:00
Adriaan de Groot
0d5db2dd06 [localeq] Config-handling is a total bodge-job, disable 2020-07-20 12:36:58 +02:00
Adriaan de Groot
724b92ee60 [partition] Drop documentation of vanished parameter 2020-07-11 16:35:54 +02:00
Adriaan de Groot
e1f4224bed [libcalamaresui] Fix slideshowAPI loading
In 022045ae05 a regression was introduced: if no *slideshowAPI*
is specified in the branding file, Calamares refuses to start, with
a YAML failure.

Before the refactoring, we had `YAML::Node doc` and looked up
the *slideshowAPI* in it with `doc["slideshowAPI"]`. After the
refactoring, we had `const YAML::Node& doc`. The `const` makes
all the difference:
 - subscripting a non-existent key in a mutable Node silently
   returns a Null node (and possibly inserts the key);
 - subscripting a non-existent key in a const Node returns an
   invalid or undefined node.

Calling IsNull() or IsScalar() on a Null node works: the functions
return a bool. Calling them on an invalid node throws an exception.

So in the **const** case, this code can throws an exception that it
doesn't in the non-const case:
    `doc[ "slideshowAPI" ].IsScalar()`

- Massage the code to check for validity before checking for scalar
- Add a `get()` that produces more useful exception types when
  looking up an invalid key
- Use `get()` to lookup the slideshow node just once.
2020-07-09 11:28:09 +02:00
Adriaan de Groot
a58d59d86c [libcalamares] Minor documentation on Yaml.* 2020-07-09 10:45:28 +02:00
Adriaan de Groot
da1cc7c3a5 [libcalamaresui] Don't clear the map when inserting strings
- the documentation doesn't say the map is cleared, and the one
  place this function is used doesn't need that either.
- make type of config explicit
2020-07-09 08:46:16 +02:00
Adriaan de Groot
a91edfef89 [netinstall] auto-resize the columns
- previously, the first column (name) was sized to show the
  names **that were visible at startup**, which fails when
  there are long names hidden in groups that are not expanded
  immediately.
- change the columns to resize according to the contents; this makes
  the descriptions jump to the right as the name column gets wider.

FIXES #1448
2020-07-08 13:34:38 +02:00
Adriaan de Groot
240c703549 [partition] Don't leak the PM core object 2020-07-08 13:11:10 +02:00
Adriaan de Groot
7f1a59f02b [partition] Fix typo 2020-07-08 13:11:10 +02:00
Adriaan de Groot
313531bc4b [partition] Remove unused parameter
- there are no consumers for checking-the-capacity-of-the-drive

This parameter was introduced in 3cd18fd285 as "preparatory work"
but never completed. The architecture of the PartitionCoreModule
makes it very difficult to get the necessary parameters to
the right place, and it would probably be better to put
a SortFilterProxyModel in front of a partitioning model anyway.

Since the display code can already filter on size, just drop this one.
2020-07-08 13:08:51 +02:00
Adriaan de Groot
948c078e1a [partition] winnow floppy drives
- don't list floppy drives

FIXES #1393
2020-07-07 23:03:12 +02:00
Adriaan de Groot
a78c368367 [calamares] Tweak default QML sidebar
- make the rectangles slightly larger
- align text to center of the rectangle
- make the rectangle fill out the column; without this, the
  width would collapse back to 0 after a change in the model,
  which would draw 0-width rectangles.

FIXES #1453
2020-07-07 16:11:18 +02:00
Adriaan de Groot
2b2a69631f [libcalamaresui] Suggestions for better naming of enum values 2020-07-07 15:29:13 +02:00
Adriaan de Groot
3565b6806a [libcalamares] Massage the logger output
- continuations, for the console, no longer print the date + level,
  which makes things easier to visually group and read.
- the file log is mostly unchanged, except it contains more spaces now.
2020-07-07 15:25:25 +02:00
Adriaan de Groot
631923abf8 [libcalamares] Console-logging follows -D flag exactly
- Don't always log LOGEXTRA and below.
2020-07-07 15:12:50 +02:00
Adriaan de Groot
67aa34c4a4 [calamares] Center the progress texts 2020-07-07 14:13:49 +02:00
Adriaan de Groot
43ebcf8b61 [packages] Keep package-manager list alphabetized 2020-07-07 13:48:07 +02:00
Vitor Lopes
c16866fb88 pep8 302 2020-07-05 08:37:28 +01:00
Vitor Lopes
e29462bc05 [pamac] rework db_lock 2020-07-05 08:35:52 +01:00
Vitor Lopes
d78cbfc644 update example configurations and schema 2020-07-05 08:18:38 +01:00
Vitor Lopes
2c76106a66 Merge branch 'calamares' of https://github.com/calamares/calamares into calamares 2020-07-05 08:14:32 +01:00
Adriaan de Groot
46ad704ede [partition] Fix build for old KPMCore
SEE #1444
2020-07-03 22:33:00 +02:00
Adriaan de Groot
36a9088480
Merge pull request #1444 from gportay/add-parttype-partattrs-to-global-storage
[partition] Add the GPT type and attributes to global storage
2020-07-03 16:18:56 -04:00
Adriaan de Groot
0be6f63d2a
Merge pull request #1443 from gportay/add-default-value-to-variant-helpers
[libcalamares] Add default value to variant helpers
2020-07-03 16:12:34 -04:00
Adriaan de Groot
d3f9415bc1 [packages] Expand schema to cover the operations
- Not complete, since the items in the operations aren't done
2020-07-03 22:07:18 +02:00
Adriaan de Groot
8aa8ac2d26 [packages] Tidy up configuration
- fix the schema so the schema is valid json-schema
- the schema doesn't actually validate the *operations* yet
- sort the named backends (needs a double-check that the
  list covers all the ones we currently support)

SEE #1441
2020-07-03 21:51:39 +02:00
Adriaan de Groot
08aa362c5c [license] Warnings-reduction
- Don't do in code what is already done in the designer (.ui) file
- setFrameStyle() is difficult because it mixes different enums
  into an int, which causes the warning from clang.
2020-06-27 00:33:50 +02:00
Adriaan de Groot
3b5c4839e3 [libcalamaresui] Warnings-- 2020-06-26 20:34:33 +02:00
Adriaan de Groot
31a1b710bc Docs: say something about QML modules 2020-06-25 15:26:48 +02:00
Adriaan de Groot
6735ff1cd0 Docs: give up on PythonQt modules 2020-06-25 14:45:35 +02:00
Adriaan de Groot
fa2f91aa46 [libcalamaresui] Minor documentation improvements 2020-06-25 14:04:49 +02:00
Adriaan de Groot
8ced67680d [calamares] Allow get/set of panel-sides
- Add access to the panel-sides membe of the view manager, and
  calculate which sides are populated by panels (if any).
- Pass the calculated panel-sides to the view manager before it
  starts adding viewpages, so they get consistent margins.
2020-06-25 00:00:13 +02:00
Adriaan de Groot
68aecf6a26 [libcalamaresui] Special margins for QML view steps
If there are no surrounding panels, drop the margin around the QML on
the assumption it needs to be full screen under special circumstances.
2020-06-24 23:41:20 +02:00
Adriaan de Groot
d952faf909 [libcalamaresui] Set margins based on viewstep suggestion 2020-06-24 22:12:59 +02:00
Adriaan de Groot
d7ed450dbf [libcalamaresui] Give ViewManager data about side-panels 2020-06-24 21:41:06 +02:00
Adriaan de Groot
1648f311fe [libcalamaresui] apidox touch-up 2020-06-24 21:26:22 +02:00
Adriaan de Groot
748d76df4f [libcalamaresui] Add support for steps with own margins 2020-06-24 21:15:37 +02:00
Adriaan de Groot
347a25d13d [libcalamaresui] Avoid nullptr deref
- there's a check already there, and probably this means things are hopelessly
  broken anyway, but let's not crash here.
2020-06-24 20:48:06 +02:00
Adriaan de Groot
4a6ee39f8b [libcalamaresui] Blanket unmargin the content area 2020-06-24 11:08:31 +02:00
Adriaan de Groot
bfbb0f1c49 [libcalamaresui] Mark some TODO for 3.3, in passing 2020-06-24 04:59:19 -04:00
Adriaan de Groot
8a9e85db71 Branding: shuffle around a bit, expand documentation 2020-06-24 04:53:22 -04:00
Adriaan de Groot
e206eb086b [partition] Missing includes for Qt-compatibility 2020-06-23 17:05:08 +02:00
Adriaan de Groot
c3ff9edfa2 [tracking] Add a test executable
- just a stub, hardly tests useful functionality
2020-06-23 14:43:26 +02:00
Adriaan de Groot
3ee53435c5 [libcalamares] Fix constness issue (gcc reported) 2020-06-23 14:30:12 +02:00
Adriaan de Groot
1dfb25372b [tracking] Warnings-reduction
- Give classes a virtual destructor that need them
- Remove spurious ;
- Refactor addJobs() because that doesn't need to be in a class
- Remove redundant intermediate base-classes
2020-06-23 13:37:56 +02:00
Adriaan de Groot
0bede0692a [locale] Warnings-- on static_cast with no message 2020-06-23 13:18:30 +02:00
Adriaan de Groot
daf9451e69 [welcome] Warnings-- 2020-06-23 13:16:56 +02:00
Adriaan de Groot
22fdca8f44 [libcalamares] Use Logger::Pointer for logging void-pointers 2020-06-23 13:02:06 +02:00
Adriaan de Groot
8a14316e16 [calamares] be less chatty in startup
- without the SubEntry part, the function name is printed each time.
2020-06-23 13:01:08 +02:00
Adriaan de Groot
916c10816b [libcalamares] Logging-convenience for pointers
- This reduces the amount of (void*) C-style casts in the code,
  and formats generic pointers more consistently.
2020-06-23 12:29:18 +02:00
Adriaan de Groot
192263cf9d [libcalamares][modules] Use compatibility for QString::split()
- Use the compatibility value, which has an enum value suitable
  for the Qt version in use.
2020-06-23 11:13:55 +02:00
Adriaan de Groot
d6b0583bad [libcalamares] Compatibility-layer for QString::split
- QString::split() api changed in 5.14, in 5.15 generates warnings,
  so introduce a compatibility value.
2020-06-23 11:08:55 +02:00
Gaël PORTAY
9392473fec [partition] Add the GPT type and attributes to global storage 2020-06-22 16:37:20 -04:00
Adriaan de Groot
e24f812b2d [libcalamares] Chase Permissions move
- Fix include names in *preservefiles*
- Tidy up include guards
- Fix CMakeLists in *perservefiles* and *libcalamares*
- Use SPDX license headers
2020-06-22 16:32:47 -04:00
Adriaan de Groot
4473d7f5dd [preservefiles] Move permissions classes to libcalamares 2020-06-22 16:22:59 -04:00
Gaël PORTAY
c9f942ad67 [libcalamares] Add default value to variant helpers
- Some variant helpers take a default parameter if the map does not
  contains the given key or if the type mismatches. Make all helpers
  behave the same.
2020-06-22 15:37:24 -04:00
Gaël PORTAY
4974d86932 [partition] Fix missing initialization of the attribute partAttributes
- Initialize the attribute partAttributes to 0; it is a primitive type
  and it is not initialized in some constructors.
  Fixes commit c1b5426c6 ([partition] Add support for partition attributes).
- Move implementation of default constructor to cpp.
2020-06-22 14:24:14 -04:00
Adriaan de Groot
fde1aad465 CMake: add support for USE_*=none (from the os-modules branch) 2020-06-22 13:39:36 +02:00
Adriaan de Groot
bff0bed07e [users] Apply coding style (only CreateUserJob.cpp though)
- use ci/calamaresstyle
- SPDX licensing
2020-06-22 13:17:39 +02:00
Vitor Lopes
976150bc1e
simplify install code 2020-06-22 00:12:02 +01:00
Vitor Lopes
ddfd120197
add missing self 2020-06-21 23:43:31 +01:00
Vitor Lopes
5bb49e252d
Update main.py 2020-06-21 18:28:17 +01:00
Vitor Lopes
75bba349be
Update main.py 2020-06-21 18:03:21 +01:00
Vitor Lopes
f8db15adc4
add pamac support 2020-06-21 17:24:29 +01:00
demmm
ccff4edd91 [keyboard] fully functional QML module
added missing components listed as ResponsiveBase, ListItemDelegate & ListViewTemplate
parts of which were on nitrux
keyboard.qml no longer uses buttons within ListView, can't work as buttons and have them visible
see https://doc.qt.io/qt-5/qml-qtquick-listview.html#footerPositioning-prop
set ListView as actually visible within a normal calamares window size
2020-06-19 17:05:29 +02:00
Adriaan de Groot
5da2012465 [users] Expand schema to support the keys documented in users.conf
- Now the documentation in the file and the source is leading
  to update the schema, but in future those should go hand-in-hand
2020-06-18 16:23:32 +02:00
Adriaan de Groot
463545290e [users] Fix up schema syntax
- Remove schema items *availableShells* and *avatarFilePath* because
  those have no implementation.
2020-06-18 16:12:40 +02:00
Adriaan de Groot
c284024b0e i18n: Update English translations 2020-06-18 15:47:18 +02:00
Adriaan de Groot
b9b79f11a4 [unpackfs] Prevent accidental 0777 permissions on /
FIXES #1418
2020-06-18 14:47:33 +02:00
Adriaan de Groot
0305476f8a Merge branch 'issue-1287' into calamares
Major update to the 'tracking' module with improved wording,
functionality, QML-preparation, and a working kuserfeedback mode.

FIXES #1287
2020-06-18 13:46:57 +02:00
Adriaan de Groot
1b11cc90c4 [tracking] Polish the phrase for 'none' a bit 2020-06-18 13:37:43 +02:00
Adriaan de Groot
6365b7a362 Merge branch 'calamares' into issue-1287 2020-06-17 18:10:33 +02:00
Adriaan de Groot
2cad90d9ca
Merge pull request #1437 from gportay/handle-integers-with-octal-or-hexa-prefix
[libcalamares] Handle integers prefixed with 0 or 0x
2020-06-17 17:32:19 +02:00
demmm
fc91b4ce60 [localeq] use js to get the hasInternet status
switching between Map.qml & Offline.qml now happens properly
2020-06-17 16:52:59 +02:00
Adriaan de Groot
8ad221311d [tracking] Can't uncheck 'none' box by itself
- If the 'no tracking' box is checked, then the way to uncheck
  it is to tick some **other** box.
- It doesn't make sense to unselect 'none' and then have .. none
  selected.
2020-06-17 15:31:53 +02:00
Adriaan de Groot
47b0fa5d55 [tracking] Get username from gs 2020-06-17 15:24:21 +02:00