- Used in only one place, move to .cpp
- Drop useless scaling all the images *are* that size already
- Add debugging check that the images match expected size
- search for a key and return a type-cast pointer to the result
- while here, simplify some other code
- the find() function could be done with std::find_if but doesn't
get any shorter or more elegant
- By using QList< CStringPair* > consistently, we can save
a bunch of model code at the cost of an occasional dynamic_cast;
it's fairly rare for there to be a need for the derived pointer.
- read the file and create the regions on-the-fly, then sort the
resulting list (instead of building a string list and then
building the regions afterwards)
- needs a qwidget to put the top-items (license name, button) in
- fixes issue where the gap between the button and the hrule would
change depending on what is expanded
- Move layouting code into the .ui file
- Reduce margins hugely -- atop the title block, around the
scroll area, etc -- so that more license is visible at once.
- split shared <h1> message off
- do some string-concatenation, but only of whole sentences
- shave off some vertical space by dropping the mainsubtext item
- 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
- 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
- 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.
- 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
- 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.
- 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.
- 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.
- 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.
- 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.
- 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
- 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.
- 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
- 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.
- 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.
- 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.
- 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).
- 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).
- 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.
- 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
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- Testing some of the functionality that's been added just now:
- copyfile fails, buggy implementation
- poolsize fails, buggy implementation
- removefile not tested
- 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)
- 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.
- 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 .. */
- 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).
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- Things in libcalamares/ subdirectories are namespaced
according to that subdirectory (sometimes in namespace
Calamares, sometimes CalamaresUtils). Do that in modulesystem/ too.
- 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)
- 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
- 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.
- 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)
- 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.
- 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.
- 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.
- 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)
- 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.
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>
- 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
- 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.
- 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_
- 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
- 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.
- 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.
- 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.