Commit Graph

4911 Commits

Author SHA1 Message Date
bill-auger
344445b437 housekeeping - logging for CreateUser Job 2019-11-28 14:26:06 -05:00
Adriaan de Groot
2e22bdd7dc i18n: update the english translation files for once 2019-11-28 16:51:57 +01:00
Adriaan de Groot
b4e9ec7eb1 [hostinfo] There is no config file for this module
- the empty config file would fail in tests
 - move the documentation part of it to CMakeLists.txt
2019-11-28 16:10:01 +01:00
Adriaan de Groot
1de6062233 [license] Add should-be-expanded display option to license entries
- In code, add the necessary bool
 - document meaning in the config file
 - actually expand the full text if the entry is local and set to expanding-
   by-default. This implementation is a bit lazy since it just pretends
   to click on the toggle button.
 - While here, reduce scope for UB by initializing POD members
2019-11-28 13:42:26 +01:00
Adriaan de Groot
c870fca787 [license] Use more meaningful names for arrows
- The arrows Up, Down, Right are used on toolbuttons, but
   in the context of this module, those are directions with
   meaning; give them better names.
 - Because of #1268, the meaning of up- and down- may be swapped;
   I'm not sure of which look makes the most sense. This is prep-
   work for easily swapping the looks by using the meaningful names
   instead.

SEE #1268
2019-11-28 13:23:11 +01:00
Adriaan de Groot
d322d783ea [license] Chase deprecations in Qt 2019-11-28 13:17:15 +01:00
Adriaan de Groot
d8020e3574 [license] Tidy up setting-of-entries
- we loop over all the entries anyway, so calculate allLicensesOptional
   along the way (debatable whether std::none_of is clearer)
 - always un-check the accept-box when resetting entries.
2019-11-28 12:03:22 +01:00
Adriaan de Groot
5ed8ec9990 [license] Reduce translation overhead. 2019-11-28 11:28:02 +01:00
Adriaan de Groot
2a0716bf43 [license] Move the 'please review' text to the top. 2019-11-28 11:24:56 +01:00
Adriaan de Groot
2a45765b93 [license] Next depends not just on the checked box
- Toggling the checkbox could disable the next button
   because only the checked-state was used, instead of
   the next-is-enabled-if-everything-is-optional member variable.

FIXES #1271
2019-11-27 12:17:33 +01:00
Adriaan de Groot
ec605adf3f [license] Tidy code
- Move retranslation to a separate slot to allow it to be
   formatted nicely.
 - Use calculated m_allLicensesOptional in retranslation.
 - Untangle determining if all licenses are optional; std::none_of
   returns true on an empty list.
2019-11-26 22:37:25 +01:00
Adriaan de Groot
6dfcbd757b [welcome] Remove superfluous call to QColor::value() 2019-11-26 17:34:25 +01:00
Adriaan de Groot
7fd218d7bf [partition] Chase deprecations in Qt 2019-11-26 16:56:45 +01:00
Adriaan de Groot
ad868033f3 [locale] Chase deprecations in Qt 2019-11-26 16:56:12 +01:00
Adriaan de Groot
fc7ea80d99 [calamares] Do not attempt to center Calamares window
- this isn't really a Calamares thing to decide, and anyway centering
   on the desktop is kind of weird in multi-monitor setups and the
   DesktopWidget is deprecated as well.
2019-11-26 16:46:47 +01:00
Adriaan de Groot
94fe4d2fda [libcalamares] Avoid weak vtables in string-pair implementation 2019-11-26 12:30:59 +01:00
Adriaan de Groot
fc7f49b610 [libcalamares] Expand tests for TimeZone translations 2019-11-26 12:28:41 +01:00
Adriaan de Groot
71f3614eb7 [libcalamares] Add TimeZone support to build
- Add to CMakeLists.txt
 - Test basic scenarios
2019-11-26 11:20:33 +01:00
Adriaan de Groot
3af2754022 [libcalamares] Implement translatable-pair-of-char*
- This is base functionality for a translatable model of
   TimeZone names that is scraped from zone.tab
2019-11-26 11:18:35 +01:00
Adriaan de Groot
abd3c4171b [libcalamares] Prevent CI coding-style fixes to generated code 2019-11-26 11:08:21 +01:00
Adriaan de Groot
733fb43b5e [libcalamares] Sort the dummy zone names 2019-11-26 10:45:36 +01:00
Adriaan de Groot
c3fdb38097 [libcalamares] Stub of class for TimeZone model management
- Intent is to move out of locale module
2019-11-25 20:51:45 +01:00
Adriaan de Groot
906aeec5d3 [locale] Replace #define with a static const
- TZ_DATA_FILE is only used in one place
2019-11-25 11:49:41 +01:00
Adriaan de Groot
1df6454cfe [locale] Tidy up types
- use JobList typedef where possible
 - remove unused forward type definitions
2019-11-25 10:52:22 +01:00
Adriaan de Groot
2034dd62a4 [libcalamares]: Timezone information for translation/extraction
SEE #1259
2019-11-19 18:07:13 +01:00
Adriaan de Groot
3ee384f36c [libcalamares] Extract zone.tab data for translations 2019-11-19 18:07:13 +01:00
Adriaan de Groot
2fefa53301
Merge pull request #1274 from bill-auger/patch-requirements-fail-bgcolor
replace hard-coded bg color of requirements failure notice with relative tint
2019-11-19 16:47:11 +01:00
Adriaan de Groot
30857b59ef
Merge pull request #1273 from bill-auger/patch-packagechooser-typos
[packagechooser] fix typos in packagechooser.conf
2019-11-19 15:00:12 +01:00
Adriaan de Groot
1c853f2348
Merge pull request #1266 from bill-auger/patch-8
housekeeping - calamares style (those lambdas are always a thing)
2019-11-19 14:59:16 +01:00
Adriaan de Groot
13b90dec57 [luksbootkeyfile] Typo
- Spotted by akspatole, no user-visible change

FIXES #1277
2019-11-19 13:41:49 +01:00
Adriaan de Groot
42425e4030 [grubcfg] False is case-sensitive in Python 2019-11-18 10:48:33 +01:00
bill-auger
cde210e61c formatting in src/modules/packagechooser/packagechooser.conf 2019-11-12 09:20:15 -05:00
bill-auger
2bb338b5f6 fix typos in src/modules/packagechooser/packagechooser.conf 2019-11-12 09:19:56 -05:00
bill-auger
ee85f6bfa7 replace hard-coded bg color of requirements failure notice with relative tint 2019-11-12 09:17:11 -05:00
Adriaan de Groot
28687d0d1e Merge remote-tracking branch 'origin/issue-1201'
FIXES #1201
2019-11-08 13:34:50 +01:00
Adriaan de Groot
6a142d9edb Merge branch 'more-password-stuff' 2019-11-08 13:34:06 +01:00
Adriaan de Groot
0d7e19d5e9 [users] Do not log the password in plain text 2019-11-08 13:23:24 +01:00
Adriaan de Groot
445d8501a7 [users] Different disambiguation for pwd-empty check
- all the other checks use "PWQ" as a tag, so use that here too
2019-11-08 13:22:37 +01:00
Adriaan de Groot
e11c9a049f [users] Sort the password checks before applying them 2019-11-08 13:21:37 +01:00
Adriaan de Groot
dec0cfb7d3 [users] Give password-checks a weight, to sort them later 2019-11-08 13:16:19 +01:00
Adriaan de Groot
2b8d04ffc1 [hostinfo] Add host RAM to GS 2019-11-08 12:46:24 +01:00
Adriaan de Groot
22a9fb89e8 [hostinfo] Document what this module does 2019-11-08 12:21:25 +01:00
Adriaan de Groot
dac47d2c3a [hostinfo] Use os-release only if non-empty 2019-11-08 12:11:07 +01:00
Adriaan de Groot
6528ba30c9 [hostinfo] Fix compile and CPU detection. 2019-11-08 11:57:31 +01:00
bill-auger
6c6dcfe1cd housekeeping - calamares style 2019-11-08 05:17:40 -05:00
Adriaan de Groot
cec84ee42b [hostinfo] Fix build on FreeBSD (include order)
- while here apply coding style again
2019-11-08 00:13:23 +01:00
Adriaan de Groot
5c7acdeb44 [hostinfo] New module with information about the host, in GS 2019-11-07 16:20:39 +01:00
Adriaan de Groot
67de4af4a4 [grubcfg] Add some test configurations 2019-11-04 16:40:49 +01:00
Adriaan de Groot
f727362a90 [grubcfg] Guard against stupid configurations
- Scenario: *keepDistribution* is true, and the existing file contains
   a GRUB_DISTRIBUTION line **followed** by a commented-out GRUB_DISTRIBUTION
   line.
 - In that case, the commented-out line would change the flag back to
   False, and we'd end up writing a second GRUB_DISTRIBUTION line at the end.

Prevent that: the flag can only go to "True" and then stays there.

Editorial: If your grub configuration would have tripped this up, then
you're doing something wrong. Clean up the configuration file first.
2019-11-04 16:36:57 +01:00
Adriaan de Groot
4a0a8083f3 [grubcfg] If we only see #GRUB_DISTRIBUTION, it's not been set
- If we update the line, then GRUB_DISTRIBUTION has been set
 - If we don't update the line (e.g. because of *keepDistribution*)
   then a comment doesn't count as "have seen that line".

This means that if we get to the end of the file, with only commented-
out GRUB_DISTRIBUTION lines, and *keepDistribution* is set, then we'll
still write a distribution line -- because otherwise it's not set at all.
2019-11-04 16:34:15 +01:00
Adriaan de Groot
c6c861654d [grubcfg] Update GRUB_DISTRIBUTION as needed
- Previous fix would erase the distribution information (using an
   empty string to flag 'preserve existing GRUB_DISTRIBUTION lines'),
   but that is fragile. A distro might set that, and yet **not**
   set a GRUB_DISTRIBUTION line, in which case it would end up with
   a setup without any GRUB_DISTRIBUTION set.
 - When a GRUB_DISTRIBUTION line is found, **then** check if it should
   update the line or not. This way, we have a suitable distribution
   to write if no GRUB_DISTRIBUTION is found at all.
2019-11-04 16:06:59 +01:00
Adriaan de Groot
ac3b50fabb [grubcfg] Only replace a GRUB_DISTRIBUTOR line if wanted 2019-11-04 16:02:36 +01:00
Adriaan de Groot
aae7d7dd0a [grubcfg] Update documentation of config file
- add some more general description
 - document new-to-implement *keepDistributor* flag

SEE #1201
2019-11-04 11:05:18 +01:00
Adriaan de Groot
b3e7c3f294 [users] Run checks more often
- check password warnings when the page is entered
 - re-check (and translate) on language change
2019-11-02 19:26:40 +01:00
Adriaan de Groot
cc66903678 [users] Allow an explicit check for non-emptiness of passwords
- move the explicit checking for non-empty into a specific
   (normal) password check
 - leave only the-two-fields-are-equal outside of the password-
   requirements framework
 - having non-empty is the same as minLength 1, but gives a different
   error message
2019-11-02 19:23:04 +01:00
Calamares CI
5a98a13856 i18n: [dummypythonqt] Automatic merge of Transifex translations 2019-11-01 17:24:10 +01:00
Adriaan de Groot
196a358493 [users] Flag password problems even when weak-passwords are ok
- when you allow weak passwords, flag problems as warnings (yellow)
 - when weak passwords aren't allowed, they are fatal errors (red)
2019-11-01 14:48:46 +01:00
Adriaan de Groot
a4e3ea2a86 [users] Refactor retranslation
- move retranslation to a method so that code-formatting doesn't
   get confused by it.
2019-11-01 13:55:32 +01:00
Adriaan de Groot
28c9da414b [users] Apply coding style 2019-11-01 13:55:32 +01:00
Adriaan de Groot
9fa817a244 [users] Refactor password-validation
- add a method that does the work and sets UI strings for a
   generic double-field password entry
 - use that for user and root passwords
2019-11-01 13:55:32 +01:00
Adriaan de Groot
7d25173afb [users] Remove TODO since it doesn't make sense
- the two explicit checks are the ones that handle *two*
   strings as special cases; all the other checks from
   the password-requirements system only handle the one string.
2019-11-01 13:17:31 +01:00
Adriaan de Groot
93eb169ea5 [users] Improve error messages
- distinguish beginning of username from the rest
 - must start with a letter or _
 - tighten message for bad username and bad hostname

FIXES #1261
2019-11-01 13:05:58 +01:00
Adriaan de Groot
8232ca626c [users] Refactor constants 2019-10-29 16:21:26 +01:00
Adriaan de Groot
9cd1ef93bd [users] Apply coding style 2019-10-29 16:20:52 +01:00
Adriaan de Groot
9ee0609b72 [users] Use tooltips
- the explanations under and around the boxes is noisy,
   hard to size correctly (viz. issue #1202)
 - use tooltips in almost-all fields instead
 - add placeholder text to be more suggestive
2019-10-29 14:37:26 +01:00
Adriaan de Groot
b3765bc144 [users] Massage the weak-passwords settings
- since the wording of the checkbox itself (and the functionality)
   is to enforce strong passwords, need to switch out some
   logic and fix the wording of the documentation.
2019-10-22 16:08:21 +02:00
Adriaan de Groot
3e4e492305 [users] Polish the documentation for the various checkboxes 2019-10-22 15:32:42 +02:00
Adriaan de Groot
c030cc41cd [libcalamaresui] Refactor button-creation
- The "convenience" method was no longer convenient, since
   we now place strings on the buttons by default.
 - While here, **name** the buttons so they can be themed.
2019-10-22 15:03:37 +02:00
Adriaan de Groot
ee4cd06c23 Merge branch 'master' into bill-auger-patch-6 2019-10-22 14:27:11 +02:00
Adriaan de Groot
b78eacd7a8 [libcalamaresui] Set button texts always
- if the welcome module wasn't loaded (or loading otherwise failed)
   then no text was set, leading to confusing screens with
   buttons with icons but no label.
2019-10-21 19:47:58 +02:00
Adriaan de Groot
5ac4f3ec38 [libcalamaresui] Fix up module dependency checking
- If a module exists, and has unmet dependencies, then
   that is only a problem if the module itself is *used*.
   Merely existing is ok.

This triggers on FreeBSD, where partition isn't built, but
bootloader depends on partition -- so you can never start
Calamares on FreeBSD, because bootloader depends on something
non-existent.

Relax the check: just warn, and only fail if a non-existent
module is used (all those with unmet dependencies are considered
non-existent).
2019-10-21 19:28:59 +02:00
Adriaan de Groot
a9a12820d8 [libcalamaresui] Log the found-modules
- fix up comment because it described an old member variable name
 - log number of modules found (all the *potential* modules)
2019-10-21 19:16:15 +02:00
Adriaan de Groot
c4b0511f8d [libcalamaresui] Improve debug message for bad dirs
- Calamares scans **all** subdirs of the module-directory
   for a module.desc and complains about those that don't have
   a module.desc.
 - For ./calamares -d runs from the build-directory, this
   leads to a few complaints when some plugins have been
   ignored (and so no module.desc is generated for them).
2019-10-21 18:08:16 +02:00
Adriaan de Groot
ede50756a1 [users] Simplify config-logic for weak-passwords
- Use the convenience methods for config-reading.
 - Always set the value (to the default if nog explicitly
   set in the config-file).
2019-10-21 17:29:35 +02:00
Adriaan de Groot
21bcd560b1 [users] Use API to change weak-checkbox visibility 2019-10-21 17:26:06 +02:00
Adriaan de Groot
eb90757063 [users] Apply coding style (lots of churn) 2019-10-21 17:21:33 +02:00
Adriaan de Groot
799f1131a9 Merge branch 'patch-6' of https://github.com/bill-auger/calamares into bill-auger-patch-6 2019-10-21 17:20:34 +02:00
Adriaan de Groot
4370669fc3 [unpackfs] Put exclusion settings into the rsync command line 2019-10-11 17:46:01 +02:00
Adriaan de Groot
9d47716e5d [unpackfs] Add settings per-item for exclude and excludeFile
- support excluding specific files / lists when rsyncing, in case
   the squashfs has more in it than you really want to copy over.
2019-10-11 17:19:56 +02:00
Adriaan de Groot
4552631086 [unpackfs] Prep for more information in file_copy
- Give the whole entry to file_copy, not just the
   destination. This will allow file_copy to work
   with local excludes.
 - Pluck entry.destination out immediately, to keep
   code changes minimal.
 - Document the parameters.
2019-10-11 16:56:04 +02:00
Adriaan de Groot
311c65737f [unpackfs] Remove unused parameter
- list_excludes() turns the extra mounts from global storage
   into --exclude parameters for rsync; it doesn't do anything
   with the destination parameter.
 - while here rename to something more descriptive
2019-10-11 16:47:54 +02:00
Adriaan de Groot
fe1ddb8ead [unpackfs] Expand on the documentation 2019-10-11 16:32:39 +02:00
Adriaan de Groot
57c0b2088c [unpackfs] Allow naming a non-directory for single files
- this enables renaming files on copy
2019-10-11 15:48:17 +02:00
Adriaan de Groot
4acf63fd9a [unpackfs] Document fields of the UnpackEntry
- Document fields
 - While here, remove code for special-casing single-file copies.
   Those already work, based on rsync.
2019-10-08 17:31:51 +02:00
Adriaan de Groot
05c0398126 [unpackfs] Support multiple items better
- it's ok if item one creates directories where item two will write,
   so don't check for existence of all directories on start-up.

Reported by ArcoLinux.
2019-10-08 16:19:39 +02:00
Adriaan de Groot
d58fdaa2cd [unpackfs] Stub of special handling for a single file 2019-10-08 15:00:25 +02:00
Calamares CI
10747178e8 i18n: [dummypythonqt] Automatic merge of Transifex translations 2019-10-07 21:52:24 +02:00
Adriaan de Groot
d9e8fbf477 Merge branch 'replace-machineid'
FIXES: #1252

This adds to the *machineid* module (which generates random UUIDs
for DBus and systemd) another key to configure generation of
a urandom pool in the target from the entropy in the host system.
2019-10-07 21:46:21 +02:00
Adriaan de Groot
b00335f5b3 [displaymanager] Treat openSUSE sysconfig like anything else 2019-10-07 17:04:10 +02:00
Adriaan de Groot
d592a5bb94 [displaymanager] Fix sysconfig-only
- Improve documentation of the settings
 - If sysconfigSetup is true, **only** setup sysconfig and ignore
   the rest. This seems to be consistent with existing openSUSE-
   derivative distro's, which set displaymanagers to something
   nonsensical.
2019-10-07 15:54:55 +02:00
Adriaan de Groot
642dbf449c [machineid] Drop trailing \n, toInt() doesn't like it 2019-10-04 18:05:29 +02:00
Adriaan de Groot
9e359c98a9 [machineid] Refactor workers, demand absolute paths 2019-10-04 17:47:24 +02:00
Adriaan de Groot
12107b3113 [machineid] Turn back the change in tests
- the *mount* module inserts a rootMountPoint without trailing /
   into global storage, so we can't assume that here. On the other
   hand, the paths passed in to the Worker functions are absolute
   paths -- adjust the tests to follow that.
2019-10-04 17:47:24 +02:00
Adriaan de Groot
dd47201f27 [machineid] Fix tests by appending a /
- The code in Workers.cpp assumes that rootMountPoint ends in a /
   so that it can have filenames appended easily; make the tests
   fit that assumption, but still need to check that it is so in
   production.
2019-10-04 15:05:11 +02:00
Adriaan de Groot
c67ac999de [machineid] Implement DBUS and systemd machine-ids
- refactor running the command into a helper function,
   to deal with the regular if-command-failed-then-complain pattern.
 - mark parameters as unused.
 - move distinction about kind of DBus file up into the MachineIdJob
   and remove the enum that marked it.
2019-10-04 15:00:58 +02:00
Adriaan de Groot
145855a56f [machineid] Implement systemd machine-id creation 2019-10-04 13:48:24 +02:00
Adriaan de Groot
2b9e1d6231 [machineid] Add tests
- Testing some of the functionality that's been added just now:
   - copyfile fails, buggy implementation
   - poolsize fails, buggy implementation
   - removefile not tested
2019-10-03 13:32:48 +02:00
Adriaan de Groot
10e5995144 [machineid] Split helper functions into own file 2019-10-03 12:32:47 +02:00
Adriaan de Groot
afe7dfbcf2 [machineid] Fix include guard comment 2019-10-02 12:37:31 +02:00
Adriaan de Groot
8352a793e1 [machineid] Implement entropy-file creation
- read-urandom or copy-existing-file are implemented
 - fairly chatty on failure
 - needs tests (probably the implementation should be moved to
   a separate file and unit-tested)
2019-10-01 17:00:50 +02:00
Adriaan de Groot
50bb8cde57 [machineid] Stubs for entropy, systemd, dbus randomness 2019-10-01 16:26:41 +02:00
Adriaan de Groot
c8229733b0 [libcalamares] Document the pseudo-constructors for JobResult 2019-10-01 16:05:03 +02:00
Adriaan de Groot
9cbfd200a1 [machineid] Keep the paths unsullied
- keep the rootMountPoint and the path-with-random-data separate
   instead of concatenating them at the beginning. Then we can
   use the "clean" names also within the host system.
2019-10-01 16:01:10 +02:00
Adriaan de Groot
3a8d543c72 [libcalamares] Document operator bool() of JobResult
- this could be named isValid() instead, but basically the idea
   is that this code makes sense:

      JobResult r = do_thing();
      if ( !r ) { /* Error happened! */ return r; }
      /* Carry on .. */
2019-10-01 15:58:02 +02:00
Adriaan de Groot
8c3146a1cd [machineid] Start implementing module logic
- remove existing files for each kind of random-generation
   that is enabled. There's a helper function for the case that
   Cala is no longer setuid and needs help to remove those files
   from the target (e.g. a setuid helper).
2019-10-01 15:46:54 +02:00
Adriaan de Groot
be27b44818 [machineid] Read configuration map into instance vars 2019-10-01 14:36:21 +02:00
Adriaan de Groot
3ae5a3db76 [machineid] Improve documentation on this module
- document module's purpose
 - document existing configurations
 - deprecate "symlink" and introduce more-accurate "dbus-symlink"
 - add new configurations for upcoming entropy file
2019-10-01 14:13:01 +02:00
Adriaan de Groot
4c0719d95d [machineid] Start porting to C++ 2019-10-01 13:44:06 +02:00
Adriaan de Groot
4970c328fa [libcalamares] Fix stringification of broken instance keys 2019-10-01 10:50:12 +02:00
Adriaan de Groot
70fc480c56 [libcalamares] If test is going to fail, be more verbose on failure 2019-10-01 10:50:12 +02:00
Adriaan de Groot
95f725831f [unpackfs] Shuffle the documentation
- move all the examples to an EXAMPLES section
 - leave one single-file example enabled in the configuration
2019-09-30 17:35:31 +02:00
Adriaan de Groot
6fb2563c75 [unpackfs] Copy files when sourcefs = "file"
- Just use the existing rsync code, which can do both
   files and directory trees.
 - The existing code assumed we were always copying directories.
   Now double-check beforehand.
2019-09-30 17:14:23 +02:00
Adriaan de Groot
27cdaba8b2 [unpackfs] Special-case file sources 2019-09-30 17:14:23 +02:00
Adriaan de Groot
7856c1a6a8 [unpackfs] Do more checks before doing any work 2019-09-30 17:14:23 +02:00
Adriaan de Groot
784bc5b86e [unpackfs] Expand documentation
- comment out the squashfs example, since it's not readily
   available even on developer systems
 - add entries for the upcoming "file" type.
2019-09-30 17:14:23 +02:00
Adriaan de Groot
7ffe25fca0 [displaymanager] Document that TryExec can supplant executable 2019-09-30 15:40:44 +02:00
Adriaan de Groot
1beadee2a7 [displaymanager] Believe the .desktop file
- if a default DE is configured but the executable doesn't exist,
   believe the .desktop file. Then use that, and warn if the
   whole thing can not be found.
2019-09-30 15:38:25 +02:00
Adriaan de Groot
290a0698d8 [displaymanager] Add DE.find() which believes .desktop files
- for a DE entry which has a bad executable setting,
   update the entry from the .desktop file using TryExec.
   This assumes that the TryExec command is actually something
   you might want to run.
2019-09-30 15:38:25 +02:00
Adriaan de Groot
fe33952733 [displaymanager] Document the internal functions for DE finding
- rename find_* to _search_* to make clear they're internal.
2019-09-30 15:38:25 +02:00
Adriaan de Groot
a3666cabe0 [displaymanager] Fix naming
- Having a global and a class-local function with the same name
   that do very different things is confusing.
2019-09-30 12:41:05 +02:00
Adriaan de Groot
fb07757aab [displaymanager] Document *defaultDesktopEnvironment*
- while the keys are mandatory, their meaning is entirely optional.
2019-09-30 12:33:42 +02:00
Adriaan de Groot
0510820594 [displaymanager] Document what the list of DE's is for 2019-09-30 12:22:14 +02:00
Calamares CI
ecb1128b61 i18n: [dummypythonqt] Automatic merge of Transifex translations 2019-09-30 10:34:12 +02:00
Adriaan de Groot
5d0a5c035d
Merge pull request #1243 from stikonas/master
QLatin1Literal->QLatin1String.
2019-09-30 10:30:02 +02:00
Adriaan de Groot
d2899d4bee Merge branch 'issue-1247'
Look at the TryExec line, if it is there in the .desktop file

FIXES #1247
2019-09-25 13:06:39 +02:00
Adriaan de Groot
92ab0c1add [displaymanager] Unify looking for executables
- use executable, and the result of looking up TryExec
 - reduce chattiness again
2019-09-25 13:05:35 +02:00
Adriaan de Groot
0b81d2562b [displaymanager] Be more chatty 2019-09-25 12:52:07 +02:00
Adriaan de Groot
f9e36b9c73 [displaymanager] Missing self 2019-09-25 12:41:58 +02:00
Adriaan de Groot
01cd95512f [displaymanager] Check the TryExec key from the .desktop file 2019-09-25 12:41:37 +02:00
Adriaan de Groot
38369634df [displaymanager] Find the .desktop file explicitly 2019-09-25 12:26:26 +02:00
Adriaan de Groot
bb9cca643f [libcalamares] Avoid warnings from MOC-generated code
- Moc generates Q_UNUSED(_a); which in turn (with clang) issues
   a superfluous-semicolon warning. Existing code with automoc
   uses utils/moc-warnings.h to turn off warnings that are issued
   on moc code. Include it explicitly here because automoc isn't
   applied.
2019-09-23 11:50:06 +02:00
Adriaan de Groot
3c387a11c9 [libcalamares] class/struct mismatch
- Manager::Private is a class, not just a struct. Needed for
   hypothetical MSVC compatibility.
2019-09-23 11:26:53 +02:00
Adriaan de Groot
4799e821d3 [locale] Reduce warnings, missing override 2019-09-23 11:25:18 +02:00
Adriaan de Groot
57bb9c16f4 [displaymanager] Also look for Wayland sessions
- Sessions can be X11-sessions (living in xsessions) or Wayland-
   (living in wayland-sessions). Look in both places.
 - Refactor code a little to make it nicer to read.
2019-09-23 10:55:59 +02:00
Andrius Štikonas
490c14d93d QLatin1Literal->QLatin1String. 2019-09-21 20:44:33 +01:00
Harald Sitter
0e054f1246 [displaymanager] map plasma 5.17+ desktop environment
exec changed compared to earlier 5.x
2019-09-18 12:38:08 +02:00
Calamares CI
3bef83b152 i18n: [dummypythonqt] Automatic merge of Transifex translations 2019-09-15 21:51:51 +02:00
Adriaan de Groot
7a5ac63f92 [libcalamares] Chase change of API
- Replace QString( x ) by x.toString() where x is an InstanceKey
2019-09-15 20:38:16 +02:00
Adriaan de Groot
d6ed046495 [libcalamaresui] Replace a superfluous lambda
- The whole method body can be a lot on its own, and since
   loadModules() does nothing but single-shot the lambda,
   call it from outside instead.
2019-09-15 20:38:16 +02:00
Adriaan de Groot
ce6f6592d4 [libcalamares] Drop parts of InstanceKey API
- Drop the 1-argument QString constructor, it is suprising
 - Drop the conversion to QString
 - Add a toString() instead
 - Drop tests for the removed API
 - While here, apply code formatting to the tests

This is done to force consumers to update to strongly-typed
InstanceKeys.
2019-09-15 20:38:16 +02:00
Adriaan de Groot
7dcc6e8e07 [libcalamares] Fix bug in InstanceKey::QString 2019-09-15 20:38:16 +02:00
Adriaan de Groot
57e4b66af2 [libcalamares] Test QString() operator
- An invalid InstanceKey should give an empty string
 - Test remaining QString() cases
 - Edge cases for 2-string constructor
2019-09-15 20:38:16 +02:00
Adriaan de Groot
ba7e96c5e1 [libcalamares] Add test for InstanceKey
- cover all the constructors
 - Start with some tests that fail, showing bugs in the implementation
 - Fix bug that "derp@derp" was creating a valid instance-key with
   a bad module and id (need to use ::fromString() to get that
   functionality).
 - Extend tests with more bad cases.
 - Refactor tests to simplify "this is bad" assertions.
2019-09-15 20:38:16 +02:00
Adriaan de Groot
2f99004041 [libcalamares] Move the module instance-key
- Split out of the UI library and into (header-only) libcalamares.
2019-09-15 20:38:16 +02:00
Adriaan de Groot
666462651b [libcalamares] Namespace consistently
- Things in libcalamares/ subdirectories are namespaced
   according to that subdirectory (sometimes in namespace
   Calamares, sometimes CalamaresUtils). Do that in modulesystem/ too.
2019-09-15 20:38:16 +02:00
Adriaan de Groot
78de6776af [libcalamaresui] Swap out use of QString for ModuleInstanceKey
- The strings `module@id` are used internally, make that type explicit.
2019-09-15 20:38:19 +02:00
Adriaan de Groot
b8dd6e9ae7 [libcalamaresui] Introduce a module-instance-key class
- This replaces rather ad-hoc use of a QString as key.
2019-09-15 20:38:16 +02:00
Adriaan de Groot
57a942d155 [libcalamares] Make a NAM per thread
- To avoid warnings about creating requests and replies, parented
   by the NAM but from another thread, make a NAM per thread.
2019-09-14 07:21:24 -04:00
Adriaan de Groot
ca351ff7b6 [libcalamares] Apply (some) options to request earlier 2019-09-10 14:26:46 +02:00
Adriaan de Groot
11d3f10e26 [locale] Dispose of waiting widget
- Do the async GeoIP checking in the async requirements-checking phase
 - Do not return any requirements results -- we just need the async bit
 - Drop the waiting widget, since it's not needed (done by the
   requirements phase)
2019-09-10 14:18:47 +02:00
Adriaan de Groot
41ece863de [locale] Create widgets when needed instead of at startup
- this blocks forever, since now the GeoIP lookup isn't done at all.
2019-09-10 06:19:20 -04:00
Adriaan de Groot
0a1dc77f9b [locale] Hang on to GeoIP::Handler just once
- replace configuration settings by putting them in an object
 - use unique_ptr to allow us to create one optionally.
2019-09-10 11:26:47 +02:00
Adriaan de Groot
d70d418d92 [locale] Refactor setting of LC entries 2019-09-07 17:02:59 +02:00
Adriaan de Groot
5cac3ac6ad [locale] Apply coding style 2019-09-07 16:58:37 +02:00
Adriaan de Groot
0ee8427d5a [locale] Remove old-style GeoIP configuration 2019-09-07 16:05:09 +02:00
Adriaan de Groot
5a24e45e3b [locale] Factor out a simple lambda
- If this was handed to an algorithm it would make more sense
   as a lambda
2019-09-07 15:58:56 +02:00
Adriaan de Groot
3093f635e2 [locale] Apply coding style 2019-09-07 15:48:22 +02:00
Adriaan de Groot
21dde80a65 [locale] Refactor button handling to plain methods 2019-09-07 15:47:12 +02:00
Adriaan de Groot
91f0509272 [locale] Refactor lambdas to plain methods
- Lengthy lambda's doing UI stuff -- that doesn't change --
   are easier to read as plain methods.
2019-09-07 15:18:58 +02:00
Adriaan de Groot
782b469974 [locale] Move all the translation work to a single slot 2019-09-07 12:38:49 +02:00
Adriaan de Groot
a57a030ee2 [packagechooser] Massage the list view to be narrower 2019-09-05 06:41:06 -04:00
Adriaan de Groot
4259bc9d5d [packagechooser] Also use screenshot from no-package-selected 2019-09-05 03:23:50 -04:00
Adriaan de Groot
52e72f4fb1 [welcome] Apply coding style 2019-09-05 03:23:28 -04:00
Adriaan de Groot
88fc6685ba [libcalamares] Apply coding style to geoip/ 2019-09-05 03:23:28 -04:00
Adriaan de Groot
01c4383178 [packagechooser] Simplify parameters
- Just pass the no-package-selected item around.
2019-09-04 19:40:35 +02:00
Adriaan de Groot
996714dd06 [packagechooser] Use all translations for no-package-selected
- If there is an item with id "" (empty), it is used as the
   "no-package-selected" placeholder text.
 - Existing code iterated over the abstract model and used the
   name and description at the time the model was set -- but
   by getting the name and description from the model, only
   a single string was obtained instead of the full range
   of translations.
 - Therefore, when arriving on the page, the "no-package-selected"
   information was displayed from the translation that was active
   when the model was set.

Instead, extend the non-abstract model so we can find the no-package-
selected item and pass that explicitly to the page.

FIXES #1241
2019-09-04 19:33:24 +02:00
Adriaan de Groot
019d1c36c6 [packagechooser] Load translated strings from config
- Apply the *labels* from the configuration file to the
   visible strings (only the ViewStep name).
2019-09-02 15:29:00 +02:00
Adriaan de Groot
0eae72e10f [packagechooser] Introduce translatable labels
- Since the package chooser might be used more than once, or for
   more specific items than "Packages", introduce a way to provide
   specific strings for display.
 - The only string needed is the ViewStep name, since the item with
   id "" can be used for the no-selection item.
2019-09-02 15:28:15 +02:00
Adriaan de Groot
9850e4b35b [netinstall] Use the network-manager
- use asynchronousGet and keep the reply
 - drop unused includes
 - apply current coding style
2019-09-02 14:10:36 +02:00
Adriaan de Groot
badbdf59ee [libcalamares] Build synchronous get w/ async-get 2019-09-02 13:43:10 +02:00
Adriaan de Groot
f8356a6dcc [libcalamares] Add an async get method
- Mostly a "cheap" wrapper for a half-dozen boilerplate lines
   of Qt NAM code.
2019-09-02 12:21:33 +02:00
Adriaan de Groot
543e2d34fc [libcalamares] [locale] Remove unused includes 2019-09-02 12:02:43 +02:00
Adriaan de Groot
c7cbba3951 [welcome] Fix typo in tooltip 2019-08-30 22:54:28 +02:00
bill-auger
1513934a57
add checkbox to disable password validations 2019-08-30 08:13:33 -04:00
Adriaan de Groot
66ee6ac673 [libcalamares] Fix tests for umask != 022
- My usual test environment has umask set to 022, but on one dev
   box it is 002, leading to test failures (which show the test
   was bad, not that the umask-setting code is bad)
2019-08-30 06:35:53 -04:00
Adriaan de Groot
9053b9cecf [libcalamares] Fix Qt 5.9 compatibility
- not really sure why I went for the Qt 5.10 STL-style iterators

FIXES #1236
2019-08-30 06:20:45 -04:00
Adriaan de Groot
b685583060
Merge pull request #1226 from a-wai/fix-unpackfs-for-rootfs
[unpackfs] Enable to use "/" as a source
2019-08-29 10:25:32 -04:00
Adriaan de Groot
1d9177c5a3
Merge pull request #1230 from bill-auger/patch-1
add esperanto branding translations, fix mis-configured ones
2019-08-29 09:06:05 -04:00
Adriaan de Groot
0aabc89449 [partition] [welcome] Simplify retranslation 2019-08-29 15:02:12 +02:00
Adriaan de Groot
1cde8c20df [libcalamaresui] Simplify retranslation
- Use any object method to connect() to
2019-08-29 15:01:41 +02:00
Adriaan de Groot
f1971eed86 [libcalamares] Support calling a slot on retranslation
- sometimes a slot is easier than a lambda. Introduce
   a macro CALAMARES_RETRANSLATE_SLOT that calls a given
   slot in an object on language change.
 - extend the retranslator with support for calling slots:
   - use Qt's signal/slot mechanism alongside the private
     list of functions to call
   - provide convenience for obtaining the retranslator of
     an object.
2019-08-29 14:53:03 +02:00
Adriaan de Groot
535bf01475 [welcome] Refactor lambdas to full slots
- This helps give meaningful names to code chunks
 - Gives clang-format something to work with
 - Reduces indentation depth

I think this is a bit of a code-style opinion issue: big complicated
lambdas doing UI things just don't seem like a good idea.
2019-08-29 11:06:55 +02:00
Adriaan de Groot
fc5aa54cb2 [welcome] Fix code formatting
- the RETRANSLATE macro is a real challenge for astyle and clang-format
2019-08-29 11:01:02 +02:00
Adriaan de Groot
07bd22ba95
Merge pull request #1233 from bill-auger/patch-4
eliminate magic number in src/modules/welcome/WelcomePage.cpp
2019-08-29 04:46:18 -04:00
Adriaan de Groot
9ca864567a
Merge pull request #1231 from bill-auger/patch-5
cross-reference/clarify geoip documentation
2019-08-29 04:36:13 -04:00
Adriaan de Groot
3f90921155
Merge pull request #1232 from bill-auger/patch-3
update doc comment in src/modules/initcpio/initcpio.conf
2019-08-29 04:34:55 -04:00
bill-auger
5642576cf3
cross-reference/clarify geoip documentation 2019-08-28 13:21:42 -04:00
bill-auger
bb678e535b
add esperanto branding translations, fix mis-configured ones 2019-08-28 13:12:25 -04:00
bill-auger
4c3c6f3f91
eliminate magic number in src/modules/welcome/WelcomePage.cpp 2019-08-28 13:02:42 -04:00
bill-auger
13a58a4ab2
update doc comment in src/modules/initcpio/initcpio.conf 2019-08-28 13:02:36 -04:00
bill-auger
e459b82cfe
fix typo in src/libcalamaresui/ViewManager.cpp 2019-08-28 13:02:27 -04:00
Adriaan de Groot
559a65d169 Merge branch 'issue-1213'
FIXES #1213

Better slideshow loading, both V1 and V2. Keyboard shortcuts only while
the slideshow is visible.
2019-08-27 15:59:00 +02:00
Adriaan de Groot
8ab0fb4e5f [libcalamaresui] Apply coding style (missed earlier) 2019-08-27 15:58:09 +02:00
Adriaan de Groot
03ac0d2cf0 [qml] Document the new property and how it updates 2019-08-27 15:55:18 +02:00
Adriaan de Groot
be5388abcd [libcalamaresui] activate -> change state
- since we also need to *disable* the shortcuts, and should tell a
   V1 slideshow that it no longer is running,
 - use existing function to set the property to true / false depending.
 - instead of changeState( true ) or changeStage( false ), use
   meaningful enum names so that the code at the call site
   becomes readable; make the boolean part internal to the
   state-changing method.
2019-08-27 15:40:13 +02:00
Adriaan de Groot
1e3e53d30a [libcalamaresui] Set activatedInCalamares special property
- when the QML is activated, if the slideshow has this property,
   set it to true. This enables the keyboard shortcuts.
2019-08-27 15:12:47 +02:00
Adriaan de Groot
7df6ed31e9 [libcalamaresui] Refactor QML slideshow activation
- one function for activation, since we activate from different
   places and each loader-API may need multiple steps for activation.
2019-08-27 13:36:28 +02:00
Adriaan de Groot
0a9d0ddf68 [qml] In the default (sample) slideshow, activate key shortcuts
- with V2 loading, the key shortcuts should be enabled when the
   slideshow itself is activated, not when it is loaded.
2019-08-27 13:36:28 +02:00
Adriaan de Groot
34cb777b0a [qml] Disable all the key shortcuts via root.activatedInCalamares 2019-08-27 13:36:28 +02:00
Adriaan de Groot
ac8952f223 [libcalamaresui] Improve QML API v2 debugging
- log what is being loaded
 - distinguish "component complete" from actuial loading
2019-08-27 13:36:28 +02:00
Adriaan de Groot
e0bb53aff4 [dummycpp] Replace QProcess::execute()
- hangs unpredictably during testing
 - replace with the Calamares process-invocation runCommand(), which is also
   synchronous but doesn't hang (or, hasn't, in testing so far)
2019-08-27 13:34:26 +02:00
Adriaan de Groot
c28c97d3aa Merge branch 'issue-1215'
FIXES #1215
FIXES #1216
2019-08-26 21:42:40 +02:00
Adriaan de Groot
eb21c90861 [libcalamares] Avoid implicit 0-to-flags conversion
- clang complains about using 0 as a Flags value, so make the
   default (empty) initialization explicit.
2019-08-26 21:42:27 +02:00
Adriaan de Groot
d8a587e16e [packagechooser] Scale screenshot
- if the screenshot is too large, scale it down
 - (doesn't react to window resizes though)
2019-08-26 21:40:16 +02:00
Adriaan de Groot
6035a74a93 [packagechooser] Align the screenshot
- hcenter + vcenter the screenshot
 - make it expand as necessary
 - fill in some sample text
2019-08-26 20:48:13 +02:00
Kevin Kofler
9dbd3a765b [netinstall] Fix typo in netinstall.conf comment
s/inmportant/important/
2019-08-26 19:02:15 +02:00
Adriaan de Groot
5868f102f2 [packagechooser] Less-bad "no selection" image
- It's only "less bad", not actually a good image, composed from
   Breeze "empty" and "generic packages" icon.
2019-08-26 16:49:58 +02:00
Adriaan de Groot
d063d60e37 [packages] Explain pre-script isn't actually a shell script 2019-08-26 16:42:05 +02:00
Adriaan de Groot
56792fdcb5 [netinstall] Polish the README
- describe the format better
 - more consistent typography
 - refer to `packages.conf` for details on shell commands
2019-08-26 16:26:06 +02:00
Adriaan de Groot
ee29c45433 [netinstall] Point documentation towards netinstall README.md 2019-08-26 16:01:14 +02:00
Adriaan de Groot
6fb909a799 Merge branch 'networking-service' 2019-08-26 15:49:09 +02:00
Adriaan de Groot
f7215393d1 [tracking] Use the network service
- drop own NAM handling
 - use timeout mechanism
 - report timeout as fatal error (like it already did), other
   errors are ignored.
2019-08-26 15:47:17 +02:00
Adriaan de Groot
a1b0049bbf [libcalamares] Use more readable names 2019-08-26 15:41:30 +02:00
Adriaan de Groot
e2c6591a77 [libcalamares] Refactor request internals
- distinguish timeouts from other failures
 - git synchronousPing() a more detailed result, which is
   still bool-compatible.
2019-08-26 15:24:58 +02:00
Adriaan de Groot
f0be7fd4aa [libcalamares] Make failures in the internal methods obvious
- internally, timeout and error will return nullptr
2019-08-26 14:43:41 +02:00
Adriaan de Groot
87ea14f68a [libcalamares] Drop INTERFACES again
- The compile failure came from bad #include paths, so restoring
   this interface declaration wasn't a fix.
 - Reported to cause runtime failures on both KaOS and Manjaro.
2019-08-26 10:15:22 +02:00
Adriaan de Groot
ededebbc6c [libcalamares] Return reply early if the request is bad 2019-08-24 15:23:07 +02:00
Arnaud Ferraris
0f6b2dbe2d [unpackfs] Enable to use "/" as a source
If we don't have/need an image for the rootfs, we might want to
configure the `/` directory as a source for unpackfs. Unfortunately,
this raises an error:
  - unpackfs first creates a temporary directory
  - it then creates a subdirectory for each source, using the source
path's basename
  - when the source is `/`, the basename is an empty string, therefore
the module tries to create an already existing directory

In order to prevent this error, we use the `os.makedirs` function with
parameter `exist_ok=True` instead of `os.mkdir`.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-08-23 17:26:45 +02:00
Adriaan de Groot
d422c782ba [libcalamares] Correct include path
- no need for the subdirectories, and this confuses MOC

Reported-by: Jonathan Riddell
Fix-by: Harald Sitter
2019-08-23 17:15:51 +02:00
Adriaan de Groot
85f0d38698 [libcalamares] Refactor synchronous get
- Add timeout support
 - Refactor into a static helper method
2019-08-23 14:59:35 +02:00
Adriaan de Groot
1f2b3b734d [libcalamares] Extend synchronous API with options 2019-08-23 12:18:59 +02:00
Adriaan de Groot
af1aa701bc [libcalamares] Shuffle namespace lines around
- put all the definitions inside namespace {} to avoid
   needlessly long source lines.
2019-08-23 12:09:30 +02:00
Adriaan de Groot
383bd97a9c [displaymanager] Handle variations in config file
- GDM3 uses a different config file than previous GDM
2019-08-23 03:40:10 -04:00
Adriaan de Groot
1c61181624 [displaymanager] Handle variations in GDM executable name
- Debian https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=934504
 - Instead of hard-coding one or the other, search for gdm and gdm3
2019-08-23 03:25:41 -04:00
Adriaan de Groot
333a1f6e84 [displaymanager] Non-existent DMs don't exist
- Returning True for a non-existent DM is weird
 - Avoid suggestive parenthesis in return type
2019-08-23 03:14:41 -04:00
Adriaan de Groot
b66f3434af [displaymanager] Consistent Copyright notices 2019-08-23 03:09:53 -04:00
Adriaan de Groot
b8bad1c0b4 [welcome] Drop unused includes 2019-08-22 16:16:29 +02:00
Adriaan de Groot
8ea1ea6662 [libcalamares] Add synchronousGet() to network service
- Synchronous download of a given URL; not something to
   do from the GUI thread.
 - Use it from the GeoIP service, which downloads in a
   separate thread to do GeoIP lookups.
 - Drop now-unused headers.
 - Adjust tests for GeoIP to use network service
2019-08-22 16:11:26 +02:00
Adriaan de Groot
0b2855d6e0 [libcalamares] Fix build (bad class name) 2019-08-22 10:29:39 +02:00
Adriaan de Groot
9aae9b2f02 [libcalamares] Restore Q_DELCARE_INTERFACE
- This **may** be the cause of build failures on aarch64.
2019-08-22 10:26:15 +02:00
Adriaan de Groot
85f5410735 [libcalamaresui] Apply coding style 2019-08-22 10:25:16 +02:00
Adriaan de Groot
dbe0ccf2e1 [calamares] Apply coding style 2019-08-22 10:25:16 +02:00
Adriaan de Groot
310a1d76cf [calamares] Reduce warnings now that getInteger is qint64 2019-08-22 10:25:16 +02:00
Adriaan de Groot
eae931f2ed [libcalamares] Ping only when accessibility is unknown
- Restores exact functionality of previous version
   (noted by Kevin Kofler)
 - Short-circuit ping if the URL is bad.
2019-08-21 03:43:51 -04:00
Adriaan de Groot
e065008631 [welcome] Switch to the network service
- simplify configuration
 - use existing ping- and hasInternet()
2019-08-20 10:57:34 -04:00
Adriaan de Groot
4389c254df [libcalamares] Rely directly on QNAM's networkAccessible() 2019-08-20 10:57:34 -04:00
Adriaan de Groot
11d52df04c [libcalamares] Add API docs to network service 2019-08-20 10:57:34 -04:00
Adriaan de Groot
82622373bc [libcalamares] Remove superfluous ; (warnings--) 2019-08-20 16:05:22 +02:00
Adriaan de Groot
8d3530154f [libcalamares] Expand network service test
- Do an actual ping (also to check for memory leaks)
2019-08-20 09:57:04 -04:00
Adriaan de Groot
b8d56bb4a6 [libcalamares] Add tests for network service 2019-08-20 09:52:11 -04:00
Adriaan de Groot
d7602df51e [libcalamares] Introduce networking service
- The networking service is intended to wrap up use of
   QNetworkAccessManager and others for consumption within
   Calamares, and to provide some convenience functions
   for internet access.
 - Medium term, it may also monitor network access, so that
   we can respond to changes in network availability during
   installation.

Currently very minimal and undocumented.
2019-08-20 09:52:11 -04:00
Adriaan de Groot
8c5caf9fd0 [packagechooser] Add CMake knobs to enable/disable item choices
- AppData and AppStream can be disabled independently of finding
   their requirements (possibly useful if you want to ignore
   AppStream even when it's installed in your build environment).
 - Add a little top-level documentation about WITH_
2019-08-20 13:56:23 +02:00
Adriaan de Groot
ffa899b497 [packagechooser] Assemble the translated name and description 2019-08-20 05:37:52 -04:00
Adriaan de Groot
7b699bfc76 [libcalamares] Access list of locale Ids
- Make it easier to obtain locale-ids (from CALAMARES_TRANSLATION_LANGUAGES)
   so avoid splitting that string multiple times.
2019-08-20 05:26:26 -04:00
Adriaan de Groot
d8af11adee [packagechooser] Build AppStream Pool first
- Don't build a Pool for each PackageItem loaded
 - Do make it load all languages instead of only the current one
2019-08-20 04:38:24 -04:00
Adriaan de Groot
0a92ef7655 [packagechooser] Refactor fromApp*()
- These don't have to be static methods of PackageItem, a free
   function is more convenient.
 - Since it's not API of PackageItem anymore, need to
   - update tests not to use API
   - do API-not-available warnings in consumers
2019-08-20 04:15:35 -04:00
Adriaan de Groot
17abbeda96 [packagechooser] Try to load a screenshot
- The smallest size image of the default (or, if there is no
   default, the first) screenshot is used.
 - Remote URLs are not supported by QPixmap, so most will not
   load anyway.
2019-08-19 10:02:43 -04:00
Adriaan de Groot
fa2f5763c6 [packagechooser] Load AppStream data
- Get the id, name, and description from AppStream data

Missing:
 - No translations
 - No screenshots
2019-08-19 07:25:28 -04:00
Adriaan de Groot
eaa0c02f8d [packagechooser] Initial support for appstream items
- Use *appstream* as key in one of the items for the package-
   chooser to load data from the AppStream cache in the system.
 - Usable for some applications; for DE-selection not so much.
 - Currently unimplemented.
2019-08-19 07:10:38 -04:00
Adriaan de Groot
2f20ad30bf [packagechooser] Refactor AppData XML support into separate file
- Put the implementation entirely in a separate file, keep the
   not-supported one in PackageModel.cpp (but only in an #ifdef).
 - Makes the various optional-data-sources more similar.
2019-08-19 06:55:36 -04:00
Adriaan de Groot
5b4152133d [packagechooser] Look for AppStream libs 2019-08-19 06:45:05 -04:00
Adriaan de Groot
52af9dbaad [mount] Add docstrings to methods 2019-08-19 06:31:37 -04:00
Adriaan de Groot
395c375c60 [mount] Winnow partition list
- Simplify the iteration by first determining which partitions
   are mountable (at all).
 - This guards against the very rare case that a partition
   does not have a mountPoint at all (the if guarded against that)
   where the lambda passed to sort() would get a KeyError.
2019-08-19 06:28:32 -04:00
Adriaan de Groot
8aedd8b175
Merge pull request #1219 from a-wai/extra-mounts-after-root
mount: Make sure extra mounts are mounted right after /
2019-08-19 06:22:16 -04:00
Arnaud Ferraris
257f5da1af mount: Use a single partitions list sorted by mount point
Instead of having a special case for extra mounts to be processed right
after the rootfs, a better approach is to add them to the partitions
list, and then sort the list by mount point.

This way, we make sure every partition is mounted right when it is
needed: `/` is obviously mounted first, `/run` is mounted before
`/run/udev`, and so on.

The overall process is therefore more generic and should suit all
use-cases.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-08-14 09:58:40 +02:00
Adriaan de Groot
0b7dcf7c50 [welcome] Fix up tooltips
- the "Select language" tooltip was applied to the form, so it would
   show up inappropriately all over the place
 - the buttons didn't have useful tooltips.
2019-08-13 23:22:33 +02:00
Adriaan de Groot
c36f963954 [welcome] Adjust names of URLs to be consistent
- having show*Url and donateUrl seems inconsistent, although
   the show*Url settings were originally boolean-only.
 - add "show" to the Donate button setting, to make them
   all consistent (putting a boolean there will generate a
   warning and hide the button, that's all).
2019-08-13 23:10:56 +02:00
Adriaan de Groot
706cc73925 [branding] [welcome] Adjust documentation for welcome-overrides 2019-08-13 23:10:56 +02:00
Adriaan de Groot
341965c2b1 [welcome] Use setupButton for all four buttons
- the show* settings in welcome.conf are "upgraded" to allow
   setting the URL directly in the module configuration.
2019-08-13 23:10:56 +02:00
Adriaan de Groot
119f84d6c1 [welcome] Remove setupLinks() method, use generic
- the generic (enum-based) setupButton() can handle all four
   of the buttons, so setupLinks() can go away. Only the
   (re)translation of the text on the button needs to be
   done, so move that to the main RETRANSLATE.
2019-08-13 23:10:56 +02:00
Adriaan de Groot
64d4b0a46c [welcome] Switch API for buttons to an enum + string
- Handle buttons and their URL-opening in a more
   general way with an enum; drop existing three-boot
   method and special setupDonateButton()
 - Doesn't compile because consumers haven't changed.
2019-08-13 23:10:56 +02:00
Adriaan de Groot
03e506a826 [welcome] Add a donate button
FIXES #1197
2019-08-13 23:10:56 +02:00
Adriaan de Groot
b60ec123a0 [branding] [welcome] Document interrelationship of settings 2019-08-13 23:10:56 +02:00
Adriaan de Groot
6b8c0129fd [libcalamaresui] Add one more icon (donate) from Breeze
- LGPLv3 like the others
2019-08-13 23:10:56 +02:00
Adriaan de Groot
e7dedbbfe0 [libcalamaresui] Apply coding style to remainder 2019-08-13 21:07:46 +02:00
Adriaan de Groot
d44e8f6115 [libcalamaresui] Apply coding style to viewpages/ 2019-08-13 21:02:30 +02:00
Adriaan de Groot
6f74463a80 [libcalamaresui] Apply coding style to utils/ 2019-08-13 21:00:36 +02:00
Adriaan de Groot
1b6aed8c40 [libcalamaresui] Apply coding style to modulesystem/ 2019-08-13 20:58:39 +02:00
Adriaan de Groot
6224d6605b [libcalamaresui] Apply coding style to widgets/ 2019-08-13 20:57:52 +02:00
Adriaan de Groot
27c3a5a11d [calamares] Apply coding style 2019-08-13 20:51:46 +02:00
Adriaan de Groot
f31ff8b9ea [libcalamares] Apply coding style to PluginFactory 2019-08-13 20:50:52 +02:00
Adriaan de Groot
ccd707b23a [libcalamares] Apply coding style
- .. or, rather, avoid re-formatting tables in future.
2019-08-13 20:49:58 +02:00
Adriaan de Groot
09a36cd669
Merge pull request #1221 from a-wai/add-base-10-sizes
Add 'base 10' partition size multiples
2019-08-13 20:26:22 +02:00
Adriaan de Groot
54767812fe
Merge pull request #1218 from a-wai/fix-unpackfs
Fix error in unpackfs
2019-08-13 17:01:40 +02:00
Arnaud Ferraris
a51d612afa Revert "libcalamares: Align partition sizes on actual sectors"
This reverts commit 40202705ff.
2019-08-13 16:57:47 +02:00
Adriaan de Groot
1d047839c7
Merge pull request #1220 from a-wai/prevent-int-overflow
Prevent integer overflow when parsing configuration
2019-08-13 16:21:35 +02:00
Arnaud Ferraris
40202705ff libcalamares: Align partition sizes on actual sectors
Currently, the `bytesToSectors()` function rounds a partition size to the
nearest MiB unit, which may lead to inconsistencies when a partition
is expected to only be a few KiB's.

This patch changes the behaviour of `bytesToSectors()` so that it aligns
on sector size, without rounding the partition size to a multiple of
1MiB.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-08-12 15:55:18 +02:00
Arnaud Ferraris
209e8331b7 libcalamares: Add support for KB/MB/GB size units
Currently, all size units are expressed as KiB, MiB or GiB (resp. 2^10,
2^20 or 2^30).

In order to maximize compatibility and consistent results with other
partitioning tools, this commit adds support for sizes expressed as KB,
MB or GB (resp. 10^3, 10^6 or 10^9).

This change won't affect existing users, it simply adds a new option
that wasn't previously handled.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-08-12 15:55:18 +02:00
Adriaan de Groot
0716a46eb2 [libcalamares] Switch to using KPluginFactory
- this is not entirely straightfoward, since  we need
   different constructor arguments for the objects
   Calamares creates (no QVariantList& args, in particular).
   Implement our own registerPlugin() and createInstance()
   for that.
 - work around a bug in K_PLUGIN_FACTORY_DECLARATION_WITH_BASEFACTORY
2019-08-12 15:52:59 +02:00
Arnaud Ferraris
3929557a5a welcome: Fix requirements parsing
As the config files integer are now of type `QVariant::LongLong` instead
of `QVariant::Int`, requirements relying on this type were not parsed
correctly.

This patch fixes this, and adds an option to the python conversion to
take into account `QVariant::LongLong` types.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-08-12 15:48:48 +02:00
Arnaud Ferraris
0d06e047ae libcalamares: Prevent integer overflows when parsing configuration
Currently, a number of configuration parsing-related functions and
classes use only `int` type for dealing with integers. Should the user
need a bigger integer value, this would result in an erroneous value
being used (`0`), as the correct value would overflow the 32-bits type.

In order to prevent these overflow, this patch replaces `int` with
`qint64` in the following functions & classes :

  * CalamaresUtils::yamlScalarToVariant()
  * CalamaresUtils::getInteger
  * NamedSuffix
  * PartitionSize

This way, sizes or other integer values greater than 2^31 (for signed
types) can be used.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-08-12 15:45:34 +02:00
Arnaud Ferraris
bf47e761b0 mount: Make sure extra mounts are mounted right after /
When the rootfs partition is read-only, mount points for the other
partitions cannot be created, therefore they need to be created in a
tmpfs, already mounted somewhere in `/`.

However, the extra mounts are only mounted at the end, which causes an
error as no tmpfs is currently mounted.

This patch makes sure all extra mounts are mounted right after the `/`
partition, allowing the use of a read-only rootfs.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-08-12 15:40:59 +02:00
Arnaud Rebillout
2ab45cf4f0 Make sure that variable num_files_total_local is declared
This variable is declared in `if m:`. Of course if this codepath doesn't
run, the variable is not declared an Python doesn't like this kind of
surprise...

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2019-08-12 15:37:02 +02:00
Adriaan de Groot
1711071c58 [libcalamares] Swap out own PluginLoader for KCoreAddons 2019-08-12 13:24:53 +02:00
Adriaan de Groot
44991e700b [libcalamaresui] Check KCoreAddons version directly 2019-08-12 13:24:53 +02:00
Adriaan de Groot
bcb7f17584 [calamares] Make KCoreAddons a requirement
- Require KCoreAddons for KAboutData (also, optionally, for KOSRelease)
2019-08-12 13:24:53 +02:00
Adriaan de Groot
a6db224fcb [fsresizer] [partition] Gracefully fail on missing dependencies
- If KPMcore is found -- it requires some other KDE Frameworks but
   at least in pre-4.0 versions doesn't check very well for them --
   then missing its dependencies is no cause for CMake failure.
   Instead, log it nicely and suppress the module.
2019-08-12 13:23:34 +02:00
Adriaan de Groot
08a08f9b54 [calamares] Minor optimizations and documentation
- document the data structure; for the vector V (called m_rows)
   the values are V_i < i, so that enables microscopic optimizations.
2019-08-09 17:29:28 +02:00
Adriaan de Groot
96ef488f1b [calamares] Clean up VariantModel
- stop compiler warnings with some judicious casting;
   that's what you get when a container indexed by int
   stored those indexes as quintptr.
 - apply coding style
2019-08-09 17:17:46 +02:00
Adriaan de Groot
8a7f32d3aa [libcalamaresui] Polish ImageRegistry
- do static initialization more carefully
 - float -> qreal (double) because that's what the Qt API expects,
   to reduce type-conversion warnings
 - apply current coding style
2019-08-09 16:52:54 +02:00
Adriaan de Groot
ec08a293b2 [libcalamaresui] Reduce compile warnings
- "this" isn't used in the lambda; in future it might be if the
   lambda needs to get the configuration from settings.
2019-08-09 16:43:50 +02:00
Adriaan de Groot
91d327b224 [libcalamaresui] Paste TCP port is quint16
- no sense in feeding in an int (and getting a compiler warning
   for narrowing) into something that by spec is a 16-bit value.
2019-08-09 16:41:59 +02:00
Adriaan de Groot
41173360a7 [libcalamares] We're just testing file modes, not whole int range 2019-08-09 16:36:38 +02:00
Adriaan de Groot
76041a2184 [dummycpp] Reduce warnings and apply coding style
- tired of the (IMO, bogus) clang warnings from the
   switch() statement with a default:, so swap it out for
   some cascaded ifs.
2019-08-09 16:34:53 +02:00
Adriaan de Groot
e81bd52fb5 [initcpio] [initramfs] Set compilation options on tests
- calamares_automoc() sets AUTOMOC, but also adds some flags
   to avoid compilation warnings from the generated MOC code.
 - drop weird hard-coded include paths
2019-08-09 16:29:55 +02:00
Adriaan de Groot
739363cecd [libcalamaresui] Fix initialization order (reduce warnings) 2019-08-09 16:28:29 +02:00
Adriaan de Groot
6f73151786 [libcalamares] Reduce warnings
- Although milliseconds::count() is long long, we pass it to
   a Qt interface that only takes int; let's assume we have
   only a 32-bit count, since a timeout of 4 billion milliseconds
   is roughly 46 days, which we'll just call "no timeout".
2019-08-09 16:22:22 +02:00
Adriaan de Groot
dc09c5700b [calamares] Remove unreachable return 2019-08-09 16:15:18 +02:00
Adriaan de Groot
f5af4818fb [calamares] Apply current coding style 2019-08-09 15:27:40 +02:00
Adriaan de Groot
ea0acf1606 [calamares] Apply current coding style 2019-08-09 15:25:37 +02:00
Adriaan de Groot
ab7a559e03 [calamares] Add headerData to model (Key, Value columns) 2019-08-09 07:58:20 -04:00
Adriaan de Groot
eba4dc8df1 [calamares] Use VariantModel instead of QJsonModel
- Drop the round-trip of forming a JSON document from a QVariant,
   then parsing the document into JSON objects and building a
   model out of that. View the Variant directly.
2019-08-09 07:48:52 -04:00
Adriaan de Groot
2bd03ad3c0 [calamares] Add reload() to update model after underlying data 2019-08-09 07:40:23 -04:00
Adriaan de Groot
2a3ab4dbe7 [calamares] Add a model for viewing QVariants directly 2019-08-09 07:21:48 -04:00
Adriaan de Groot
e31a498c9b [calamares] Move DebugWindow
- This is a fairly specialized class, for use only in the
   whole-application where it ties in with the module system.
   Move it to the application directory and slim down the UI library.
 - Include it from the new location.
 - Add UIC to Calamares (the application) because there's now
   a designer-based widget in it.
2019-08-09 06:54:31 -04:00
Adriaan de Groot
85d28af1e2 [libcalamaresui] Don't include QJsonModel 2019-08-09 06:34:38 -04:00
Adriaan de Groot
419329ee49 [libcalamares] Remove friend, add accessor, make includes explicit 2019-08-09 06:27:13 -04:00
Adriaan de Groot
695e16bb87 [libcalamaresui] Drop QJsonModel from the library 2019-08-09 06:21:07 -04:00
Adriaan de Groot
48a25858f0 [partition] Chase 3rdparty move 2019-08-08 12:42:47 -04:00
Adriaan de Groot
b31c6c3a22 [calamares] Chase 3rdparty move 2019-08-08 12:42:33 -04:00
Adriaan de Groot
c83e95e66a [libcalamaresui] Chase 3rdparty move
- Widgets need to #include from different path
2019-08-08 12:42:02 -04:00
Adriaan de Groot
2166eb4511 [libcalamares] [libcalamaresui] Adjust for moved sources 2019-08-08 10:47:14 -04:00
Adriaan de Groot
937ff608eb [libcalamaresui] Move spinner widget to 3rd party 2019-08-08 10:27:52 -04:00
Adriaan de Groot
e7c66de4df [libcalamares] Move kdsingleapplicationguard to 3rdparty 2019-08-08 10:24:18 -04:00
Adriaan de Groot
47dbf9ab0c [libcalamares] Move 3rd party code to separate dir 2019-08-08 10:23:36 -04:00
Adriaan de Groot
115f5bfd82 [libcalamares] Apply coding style to remainder of geoip/ 2019-08-08 12:41:41 +02:00
Adriaan de Groot
ec073ee188 [libcalamares] Apply coding style to geoip/ 2019-08-08 12:32:21 +02:00
Adriaan de Groot
6e9f1be9e9 [libcalamares] Don't reformat string tables in GeoIP 2019-08-08 11:56:20 +02:00
Adriaan de Groot
81fa1735b1 [libcalamares] Apply current coding style 2019-08-07 23:43:45 +02:00
Adriaan de Groot
6b659b6f48 [libcalamares] Apply current coding standard to locale/ 2019-08-07 23:42:33 +02:00
Adriaan de Groot
8636689cea [packagechooser] Fix tests when run from in-source build 2019-08-07 12:58:22 +02:00
Adriaan de Groot
251e16e72c [libcalamares] Allow en_US locale for tests as well 2019-08-07 12:31:52 +02:00
Adriaan de Groot
20f43225b5 [packagechooser] Adjust AppData path for tests
- running tests by hand or from "make test" uses different paths.
2019-08-07 12:02:03 +02:00
Adriaan de Groot
781be3368e [packagechooser] Remove bogus images
- KDE and GNOME selection images were drawn by me for the bogus
   package model, and should not be used.
 - Keep Calamares logo though, even if it doesn't make much sense
   to use it in package selection.
 - Keep the no-selection image since it might be used more often,
   but it's not very good.
2019-08-07 11:57:02 +02:00
Adriaan de Groot
f3de320288 [packagechooser] Drop hard-coded data
- Now that the configuration can do all the things, we don't need
   a hard-coded model with bogus entries.
2019-08-07 11:51:56 +02:00
Adriaan de Groot
194a562727 [packagechooser] Expand tests with override features 2019-08-06 22:51:14 +02:00
Adriaan de Groot
a4362dac65 [packagechooser] Change tests for modified API 2019-08-06 22:48:04 +02:00
Adriaan de Groot
5d4c3ea92c [packagechooser] Don't give a default pixmap 2019-08-06 22:48:04 +02:00
Adriaan de Groot
0b72006ffb [packagechooser] Use overrides on AppData for example 2019-08-06 22:48:04 +02:00
Adriaan de Groot
6ddae94628 [packagechooser] Allow to override some of AppData
- The ID and Screenshot entries might be weird in AppData (in particular,
   a remove URL) so put those back under the control of Calamares even
   when using AppData as the source of descriptions.
2019-08-06 22:48:04 +02:00
Adriaan de Groot
d72391942f [packagechooser] Implement AppData loading
- An item can refer to *appdata* and load that, or provide
   the data in the config file itself.
 - Fix documentation about translations.
2019-08-06 15:55:27 +02:00
Adriaan de Groot
9a8b2c5a1e [packagechooser] CHeck that AppData load was succesful 2019-08-06 15:45:14 +02:00
Adriaan de Groot
fb547364c7 [packagechooser] Complete parsing of AppData
- Document all the static inline methods that do the work
 - Fill up a QVariantMap from <name>, <summary> and <description><p>
   elements, and use that to initialize the PackageItem.
2019-08-06 15:36:34 +02:00
Adriaan de Groot
431c4de77f [packagechooser] Use GUI for tests
- Because we'll be creating Pixmaps, we need to have a GUI main.
2019-08-06 15:19:20 +02:00
Adriaan de Groot
6821b14d00 [packagechooser] Enable logging in tests 2019-08-06 14:50:04 +02:00
Adriaan de Groot
beb5896fa2 [packagechooser] Start implementation of AppData loading
- Doing a manual read of the XML, since existing appdata libraries
   don't seem to have a convenient entry for what I need.
 - Expand tests to loading AppData (currently, they fail).
2019-08-06 14:50:04 +02:00
Adriaan de Groot
6c41151f80 [packagechooser] Just one screenshot, and mark package unused 2019-08-06 12:38:28 +02:00
Adriaan de Groot
6e05a1ef05 [packagechooser] Load translated strings as well
- This makes it possible to put the translations into the config
   file, and have them displayed when the Calamares language changes.
2019-08-06 12:02:29 +02:00
Adriaan de Groot
4febe477cf [libcalamares] Add isEmpty() to TranslatedString
- Massage the implementation a bit, don't insert a meaningless
   copy of the key as the untranslated message.
 - Add isEmpty() to check for presence of the untranslated message.
 - Document API.
 - Update tests.
2019-08-06 11:53:35 +02:00
Adriaan de Groot
8d3546f0b3 [packagechooser] Expand the example config with translated entries 2019-08-06 00:31:05 +02:00
Adriaan de Groot
6a8e10837d [libcalamares] Drop unneeded debugging 2019-08-06 00:26:04 +02:00
Adriaan de Groot
fee2297e67 [packagechooser] Fix fallthrough situation
- Add a FALLTHRU macro to annotate fallthrough situations in both
   Clang and GCC,
 - Annotate intentional fallthroughs.
 - Add missing break which meant that the selection mode was
   always multiple-selection.
2019-08-06 00:24:53 +02:00
Adriaan de Groot
56db9e9341 [packagechooser] Use translated strings 2019-08-06 00:17:50 +02:00
Adriaan de Groot
fd75b33784 [libcalamares] Add default constructor to TranslatedString 2019-08-06 00:17:30 +02:00
Adriaan de Groot
3560ea6622 Merge branch 'master' into software-chooser 2019-08-06 00:08:21 +02:00
Adriaan de Groot
39b7e4c55f Merge branch 'translatable-configuration' 2019-08-06 00:07:48 +02:00
Adriaan de Groot
764c775f08 [libcalamares] Tighten tests, add special case
- The tests should be run in C locale, otherwise the plain get()
   function uses the current locale, which will fail (e.g. running
   LANG=nl ./libcalamareslocaletest returns the Dutch strings for
   plain get, which isn't what we expect).
 - sr@latin is still special.
2019-08-06 00:05:24 +02:00
Adriaan de Groot
a9292d0c75 [libcalamares] Implement getting the string 2019-08-05 23:54:53 +02:00
Adriaan de Groot
50d74c4eca [libcalamares] Add get() to the string
- Look up the translation of the requested string with the current
   or a specific locale. This implementation is a stub.
 - Add tests for the getter.
2019-08-05 23:37:25 +02:00
Adriaan de Groot
e0edd1f3e2 [libcalamares] Fix misleading comment, add accessor
- the sort order is not English-at-the-top
 - add accessor for the locale ID.
2019-08-05 23:32:13 +02:00