- Add some extra checks for validity of m_currentStep (an index)
- Start off with explicitly invalid index, and keep it so until
loading is complete; this prevents the situation where quit-at-end
gets triggered after loading the very first module.
- Introduce an enum for panel-side
- Expose this to QML -- I can imagine that QML panels need to know
which side of the Calamares window they're on.
- Refactor loading the setting into a method that handles both
flavor and side
- With an empty list, the question is meaningless
- .. and we called this with an empty list while constructing the
ViewManager; if quit-at-end is true, then this would terminate
Calamares immediately because the list was at the end.
- Now the back button should be done by clients as well
- Refactor in CalamaresWindow to avoid leaking local button pointers
to surrounding code.
- Add macro UPDATE_BUTTON_PROPERTY for convenience in ViewManager
(ugh, macro) to change a value and emit corresponding update signal.
- add properties for the next button (enabled, label, icon...)
- update those properties as normal
- connect to the properties in the UI implementation
- the checker only collects and calls requirements; it has no
UI component, and only manages data (and a thread to do the
checking). Move it out of the UI library.
- this function lives in Module -- and is the only thing typing
Module to the ViewSteps and JobTypes. Split it out into its
own funciton. Nothing else in Module needs to befriend the
ViewSteps, so we move the friend declaration around a bit
as well.
- while here, apply coding style.
This is prep-work for moving module to libcalamares.
- drop the current and completed roles, and expose only
the currentIndex. QML can use the QObject property on
the model, while QWidgets can call internally through
the model's data() function.
- we don't need to provide role names for this, so drop that bit.
- simplify the delegate code while here.
- In some cases, it makes sense to close Calamares automatically
when it is done. Set *quit-at-end* to do so -- although this
probably also means you should remove the *finished* page.
Pull in the instance-weight changes and type-improvements,
but not the part where special-casing of unsquash is dropped:
weights are still per-job, not per-module.
- Refactor into a support method and two API points
- Use std::transform for doing-things-to-a-list
- Add searchQmlFile that only takes a name, for
non-modules to use.
- Registration of QML modules may need to be done
for more parts of Calamares. Move into the library,
out of the model.
- Register for QML when using the QML sidebar.
- This is utility code, so it can be in the QML "service"
from Calamares, rather than in the QmlViewStep itself.
That makes it usable for other QML bits as well.
- The name is just the module identifier, and now we
search for *m@i* and also *m* from that identifier,
the name becomes much less important -- and it
can be set from the config key *qmlFilename* as well.
- To avoid name-collisions in otherwise well-behaved
modules and configurations, make the QML settings
more specific:
search -> qmlSearch
filename -> qmlFilename
- Having a ProgressTreeModel that does nothing but
proxy to ViewManager methods is kind of useless.
- Move the relevant code from ProgressTreeModel to
ViewManager.
- Remove now-unused ProgressTreeModel.
- Different libraries should have different EXPORTs, so that
you can IMPORT one while building the other. Reported (and
kindly explained) by Kevin Kofler.
- Stick to one header file, though.
While here, update copyright on file.
- The scattering of DLL export macro's is kind of useless;
there are several headers, and then the export macro isn't
even applied consistently. Just drop the one for UI exports,
which was only used in libcalamaresui.
Introduces a "partitioning service" into libcalamares,
shuffles a bunch of things into it, tries to help out
with settling the system between partitioning actions.
- The config context object should be set earlier, otherwise
QML code will try binding to a non-existent config already
- Document that QMLViewStep::setConfigurationMap() parent implementation
should be called **last**, at the end of the subclass implementation.
- Using Branding::ImageEntry, when ImageEntry is an enum class
defined *in* Branding, is superfluous, and it also confuses
moc; the enum type isn't recognized from QML.
This is an ugly hack, using Bill Auger's support for Job weights.
The unpackfs job is arbitrarily awarded a weight of 12. That makes it
(in a Netrunner install) use progress from 12% to 40% or so, overall,
as all the files are unpacked.
Also fixes bug reported by Kevin Kofler that unpackfs was only reporting
progress when it hit an exact multiple of 100 (instead of over 100).
SEE #1176
- this is currently just an alias for QVariantMap, which is
the type already in use.
- future plan is to tighten this up and have an actual
Descriptor class that carries only the information
actually needed for the module descriptor.
- Replace stringlist with a stronger-typed list of InstanceKey objects
- Move smashing-that-to-stringlist into consumers of the list
(just one, the debug window)
- introduce NamedEnum lookup tables for interface and type
- drop "final" and "virtual" from methods that don't make
sense as virtual
- shuffle declaration order so the virtual API for modules
sits together
- Trying to get away from untyped strings with special meaning.
- The "split identifier" branch tried the same thing, but
was duplicating the existing InstanceKey.h work.
- need a configuration before we can start loading (to support
the variable search paths)
- refactor showing a failure in the spinner widget. On failure,
the spinner will never go away, so a message for the user is good.
- stop clang-format from messing up the table of names.
- 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).
- Things in libcalamares/ subdirectories are namespaced
according to that subdirectory (sometimes in namespace
Calamares, sometimes CalamaresUtils). Do that in modulesystem/ too.
- 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.
- 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
- 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
- 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.
- Change to std::chrono::seconds wasn't tried against the (optional)
PythonQt bindings, leading to build failure. Reported by Phil (Manjaro).
FIXES#1210
- While called from the ViewManager (to post the debug log)
this isn't really part of the ViewManager itself, so factor
out the pasting code into its own file.
- Give each check a name (based on the module it runs for, so
there might be overlaps when there are multiple module instances).
- Log the remaining checks each time the timeout fires, to help
figure out which one is hanging.
- updateButtonLabels() knows all the special cases for
buttons, so use it when the language changes instead
of setting up some possibly-wrong values.
- One edge case that this fixes is: have **just** the welcome
page before the first exec section in sequence. Then the
*next* button label was *next* instead of *install*.
- The component isn't ready immediately, so instatiate
once it is fully loaded and ready
- Edge case if the execution view step is already visible, then
start the show (because a previous call to onActivate() will
have missed it).
- By instantiating only on activation, an ugly "white" gap
appears where there is no widget at all. So instantiate
earlier so that the widget already exists and is painting
by the time the slideshow part is visible.
- This makes the net effect of this branch so far zero:
the slideshow is still loaded and started when Calamares starts.
- From an exec section, next() is called automatically when
all the jobs in that section are done.
- If there **is** no next section (e.g. there's no finished
page to show after the exec), then m_steps.at() would assert
on an out-of-range index.
- Introdcuce a helper predicate isAtVeryEnd() which handles both
out-of-range and normal at-the-end scenarios.
- If there's no page following the exec section, stay with the
slideshow but update buttons to match the normal last-page
behavior, and don't ask about cancel (since we're done).
- The not-publicly documented setContent() method does all the
parenting and resizing needed; some of this isn't available
from outside of the widget either.
The QML slideshow now sizes and re-sizes correctly.
- Load QML on startup, compile async
- Create QML component when the page is reached.
- On leave, stop the slideshow (otherwise, e.g. timers will keep running)
This should move some of the delay from loading a large
slideshow forward as the engine is already initialized when
we reach the install / slideshow page.
- d78bc0c5 added an early `return false` when cancel is disabled,
before checking if we were at the last step; so last-step
didn't get any special handling.
- refactor so that last-step now gets special handling first,
**then** disable-cancel handling, and then the usual case.
- Avoid races which might double-delete the timer, or enter
the if twice (which would lead to duplicate emissions of
requirementsComplete and the associated UI glitches).
If the requirements checking is **really fast**, e.g. you don't
have a check for internet connectivity, then the checks
might be done as fast as the 0-timeout single-shot timer,
which means that finished() is called once by the QFutureWatcher,
and then after that by the QTimer .. leading to two messages
"All requirements have been checked", but also twice
requirementsComplete being emitted, so you end up with two
results lists being added by the CheckerContainer.
Stop that by using the results-progress timer as an additional
flag: the first time everything is complete, delete that timer
and set the pointer back to nullptr.
- In debug mode, hitting assert(false) is meaningless,
- In release mode, the assert is optimized out.
- So assert the condition we're actually testing, for better messages.
- It's ok to use path / filenames in images, but you can also
use icon names according to the FDO icon spec. This makes
sense for at least *productLogo*, possibly *productIcon*, but
not really for *productWelcome*.
- Branding images might want to use os-release data as well.
- Refactor a little to keep the number of #ifdefs the same;
an intermediate expand() lambda handles expansion (or not,
if it's not enabled).
FIXES#1153
- From the debug-window, clicking *reload stylesheet* does just
that, and applies the new stylesheet to the Calamares window.
- Remove stylesheet caching from the Branding class; we only
need the sheet once (on Calamares startup) or when updating
the stylesheet, which is seldom-enough that we don't need
to keep an extra copy around.
- To use, start Calamares, open the debug window, open stylesheet.qss
in an editor. Make changes, save, then click *reload stylesheet*.
SEE #1149
- Adds another tool to the debug window, which dumps (to the debug
log) a tree-like view of all the widgets in the application.
This can be used when writing stylesheets.
- allows you to use -- at runtime -- values from os-release in the
branding file.
- WIP because the only machine I have with sufficiently new KF5
is the FreeBSD box.
- Do the checking for IsMap inside loadStrings() and use
YAML::Exception to get to bail() (since we're already dealing
with exceptions here, no extra costs). This tidies up the code
somewhat.
- Checking if the **next** step is an execute-step is a little
weird, so make the API more general (and add the +1 to indexes
where it was using NextWillExecute before).