Commit Graph

741 Commits

Author SHA1 Message Date
Adriaan de Groot
f3752e200a [libcalamaresui] Display first 6, last 2 lines of long error messages, preserve newlines 2021-02-02 16:40:01 +01:00
Adriaan de Groot
b85e5b52c2 [libcalamaresui] Apply coding style
- Some minor bits snuck in with the string-truncation code
- While here, make UPDATE_BUTTON_PROPERTY more statement-like
  so it doesn't confuse code-formatters.
2021-01-28 13:52:48 +01:00
Adriaan de Groot
8cc114bf2c [libcalamares] Move smart-string-truncation to library
Expand the API a little to support first-lines, last-lines,
and something of both. Use strong types to make the names
clear for each.
2021-01-27 23:51:03 +01:00
Adriaan de Groot
4f78afe67e [libcalamaresui] Display a reduced amount of details
Cut the error message from down to a maximum of 8 lines
so that the messagebox does not hopelessly overflow.
2021-01-26 00:37:08 +01:00
Adriaan de Groot
f0fd47eeb3 [libcalamares] Simplify logging-manipulators
Writing `Logger::NoQuote{}`` has annoyed me for a while, so
switch it to a constant, like SubEntry, so it looks more
like a regular manipulator object.
2021-01-26 00:13:10 +01:00
Anubhav Choudhary
b4078f3634 Changed branding keynames + minor fixes 2021-01-25 01:09:20 +05:30
Anubhav Choudhary
186c065b4c PasteURL sent to clipboard 2021-01-23 22:49:23 +05:30
Anubhav Choudhary
a2c930a714 Code-formatted and Copyright-text added 2021-01-23 21:16:32 +05:30
Anubhav Choudhary
ff66e4b3d5 Redirecting logUpload vars to pasteUtility 2021-01-23 20:47:33 +05:30
Anubhav Choudhary
a9539018e9 [fixed] backAndNextVisbility logic 2021-01-13 22:15:22 +05:30
Anubhav Choudhary
e3a41571f0 Spacing added 2020-12-08 18:19:14 +05:30
Anubhav Choudhary
03d1fe434c Navigation button hideability added 2020-12-06 04:32:18 +05:30
Adriaan de Groot
9a2fca7f5b CMake: prefer normal C++17 [[fallthrough]] annotation 2020-10-25 12:49:49 +01:00
Adriaan de Groot
84936a95fc [libcalamaresui] Warnings-- for Qt 5.15 deprecations
Introduce a GUI-oriented compatibility header that introduces aliases
for some enum values that are deprecated in Qt 5.15
2020-10-24 13:00:48 +02:00
Adriaan de Groot
21598ef4b3 [libcalamaresui] Update progress message only if it is non-empty
This improves the situation for jobs that do not provide
a status: their blank status does not overwrite the status
bar, and since (previous commit) the description or name
is used to start the job if the status is empty, at least
**something** is displayed.

SEE #1528
2020-10-13 00:23:57 +02:00
Adriaan de Groot
a955791766 Apply coding style globally again 2020-10-12 14:27:01 +02:00
Adriaan de Groot
02423c823d [libcalamaresui] Nothing uses the opacity for pixmaps, drop that too 2020-09-22 23:03:38 +02:00
Adriaan de Groot
268cf203a8 [libcalamaresui] Remove unused parameter/functionality
- nothing in Calamares uses the tinting, and it triggers some
  deprecation warnings, so just remove it.
2020-09-22 23:01:22 +02:00
Adriaan de Groot
2878c474c5 Warnings-- (~T() override)
Change all the places that had
	virtual ~T() override
to the less redundant form without override.
2020-09-22 22:49:30 +02:00
Adriaan de Groot
2126be6d6d Warnings-- (~T() override)
Consistently use
	~T() override;
in class declarations (so no virtual in front, and avoid
warnings due to the missing override in back).
2020-09-22 22:40:52 +02:00
Adriaan de Groot
fbab554dfa [libcalamares] Remove unused parameter for PythonJob
- parameter instanceKey was left over from previous work that
  special-cased the weight of Python modules.
- while here, consistently do `~T() override`
2020-09-22 22:35:55 +02:00
Adriaan de Groot
8e9bf1c2a9 [libcalamaresui] Another allow-to-fall-back-to-eventloop
With 1 CPU, Calamares still spawns 9 threads or so: eventloop,
dbus loop, QML loop, ... many of those are invisible to the
application. Contention occurs on startup when the UI is constructed,
and we end up with the module manager creating widgets alongside,
or ahead of, the main window UI. This can result in deadlock:

 - in CalamaresApplication::initViewSteps
 - in QML imports

This is partly because the signal-slots connections get "deep":
from loadModules() we emit *modulesLoaded* which ends up showing
the main window in initViewSteps(). Avoid this with a QTimer:
drop back to the event loop and release whatever locks are held,
so the QML thread can get on with it already. Then the timer
goes off and the view steps are created.
2020-09-22 16:27:34 +02:00
Adriaan de Groot
705756b9bb [libcalamaresui] Give UI chance to catch up before modules are done 2020-09-22 14:41:12 +02:00
Adriaan de Groot
d94b9caba5 [libcalamaresui] Less mutex shenanigans 2020-09-03 16:11:35 +02:00
Adriaan de Groot
a2180936ef CI: apply coding style across the entire codebase again 2020-08-26 02:28:43 +02:00
Adriaan de Groot
1cd9b93a22 REUSE: Giant boilerplate cleanup
- point to main Calamares site in the 'part of' headers instead
  of to github (this is the "this file is part of Calamares"
  opening line for most files).
- remove boilerplate from all source files, CMake modules and completions,
  this is the 3-paragraph summary of the GPL-3.0-or-later, which has
  a meaning entirely covered by the SPDX tag.
2020-08-26 02:28:38 +02:00
Adriaan de Groot
3480988f53 REUSE: SPDX tagging of application library and main
- CC0-1.0 for the uninteresting version-headers
- GPL-3.0-or-later for the services

- add SPDX identifiers to Calamares C++ libraries and application sources
- add SPDX identifiers to Calamares QML (panels and slideshow)
- the `qmldir` is a list of names of things in the directory,
  so CC0-1.0 it as "uninteresting"
- QRC files are lists of names of things in the directory,
  so CC0-1.0 them as well
2020-08-26 02:05:46 +02:00
Adriaan de Groot
7e9576d3d1 REUSE: fix credits for 3rd party sources
Some Calamares source files incorporate material from
3rd parties (unlike the 3rdparty/ dir, which is basically-
unchanged 3rd party source). Tidy up the FileCopyrightText
lines for those sources.

This is not an exhaustive effort.
2020-08-26 02:05:46 +02:00
Adriaan de Groot
95ceb1e8c7 REUSE: (BSD-2-Clause) all CMakeLists
The build instructions are not that interesting, it's a toss-up
between CC0 and BSD-2, but because other CMake bits are BSD-2-Clause,
apply that to more CMakeLists. The copyright date isn't all that
accurate, but these are just inconsequential files.

While here, tidy up and get rid of some useless intermediates.
2020-08-26 02:05:46 +02:00
Adriaan de Groot
c296bcffa3 [libcalamares] When enqueueing jobs, pass a weight
- The weight is the module (instance) weight, which can be
  - the default weight of 1
  - the weight specified for the module (in module.desc / the module
    descriptor; this defaults to 1, above)
  - the weight specified for the instance (in settings.conf)
  The last of these "wins"; weights are constrained to 1..100

The weight isn't actually used in progress computation yet.
2020-08-12 16:45:27 +02:00
Adriaan de Groot
e1e81bb133 [libcalamaresui] Warnings--, don't shadow a parameter 2020-08-12 00:39:01 +02:00
Adriaan de Groot
3c6e53ecb9 [libcalamaresui] Chase the change in Module descriptor
- most of the code becomes **simpler** because the requirement
  to handle unstructured data is now in the descriptor itself,
  rather than in consumers.
2020-08-11 22:26:12 +02:00
Adriaan de Groot
a8075fba5f [libcalamares] Chase API change in settings 2020-08-11 16:32:44 +02:00
Adriaan de Groot
b23dbd47c7 [libcalamaresui] Chase changes in instanceDescriptor
- this is mostly about deleting code, since the special-cases
  now live in libcalamares where `settings.conf` is interpreted.
2020-08-11 16:32:44 +02:00
Adriaan de Groot
ea709aab59 [libcalamaresui] Swap out unstructured string for structured data 2020-08-04 01:31:22 +02:00
Adriaan de Groot
09020d68b0 [libcalamaresui] Make dox of ModuleManager signals more explicit 2020-07-24 12:15:27 +02:00
Adriaan de Groot
36fb1124be [libcalamares] Export network status as Q_PROPERTY and to QML 2020-07-23 12:57:01 +02:00
Adriaan de Groot
f64a1eb16a [libcalamaresui] Document the signals from ModuleManager 2020-07-22 11:52:42 +02:00
Adriaan de Groot
e1f4224bed [libcalamaresui] Fix slideshowAPI loading
In 022045ae05 a regression was introduced: if no *slideshowAPI*
is specified in the branding file, Calamares refuses to start, with
a YAML failure.

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

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

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

- Massage the code to check for validity before checking for scalar
- Add a `get()` that produces more useful exception types when
  looking up an invalid key
- Use `get()` to lookup the slideshow node just once.
2020-07-09 11:28:09 +02:00
Adriaan de Groot
da1cc7c3a5 [libcalamaresui] Don't clear the map when inserting strings
- the documentation doesn't say the map is cleared, and the one
  place this function is used doesn't need that either.
- make type of config explicit
2020-07-09 08:46:16 +02:00
Adriaan de Groot
2b2a69631f [libcalamaresui] Suggestions for better naming of enum values 2020-07-07 15:29:13 +02:00
Adriaan de Groot
3b5c4839e3 [libcalamaresui] Warnings-- 2020-06-26 20:34:33 +02:00
Adriaan de Groot
31a1b710bc Docs: say something about QML modules 2020-06-25 15:26:48 +02:00
Adriaan de Groot
fa2f91aa46 [libcalamaresui] Minor documentation improvements 2020-06-25 14:04:49 +02:00
Adriaan de Groot
8ced67680d [calamares] Allow get/set of panel-sides
- Add access to the panel-sides membe of the view manager, and
  calculate which sides are populated by panels (if any).
- Pass the calculated panel-sides to the view manager before it
  starts adding viewpages, so they get consistent margins.
2020-06-25 00:00:13 +02:00
Adriaan de Groot
68aecf6a26 [libcalamaresui] Special margins for QML view steps
If there are no surrounding panels, drop the margin around the QML on
the assumption it needs to be full screen under special circumstances.
2020-06-24 23:41:20 +02:00
Adriaan de Groot
d952faf909 [libcalamaresui] Set margins based on viewstep suggestion 2020-06-24 22:12:59 +02:00
Adriaan de Groot
d7ed450dbf [libcalamaresui] Give ViewManager data about side-panels 2020-06-24 21:41:06 +02:00
Adriaan de Groot
1648f311fe [libcalamaresui] apidox touch-up 2020-06-24 21:26:22 +02:00
Adriaan de Groot
748d76df4f [libcalamaresui] Add support for steps with own margins 2020-06-24 21:15:37 +02:00
Adriaan de Groot
347a25d13d [libcalamaresui] Avoid nullptr deref
- there's a check already there, and probably this means things are hopelessly
  broken anyway, but let's not crash here.
2020-06-24 20:48:06 +02:00
Adriaan de Groot
4a6ee39f8b [libcalamaresui] Blanket unmargin the content area 2020-06-24 11:08:31 +02:00
Adriaan de Groot
bfbb0f1c49 [libcalamaresui] Mark some TODO for 3.3, in passing 2020-06-24 04:59:19 -04:00
Adriaan de Groot
22fdca8f44 [libcalamares] Use Logger::Pointer for logging void-pointers 2020-06-23 13:02:06 +02:00
Adriaan de Groot
dc0ed24f1a [libcalamaresui] Install libcalamaresui headers
- All the headers go to relevant subdirs, but we don't keep
  libcalamares and libcalamaresui apart.
- While here, remove unused variable from libcalamares CMake
2020-06-10 16:43:34 +02:00
Adriaan de Groot
6c272bc8be [libcalamares] Link yamlcpp privately
- link the library privately -- the public API uses QVariantMap
- install FindYAMLCPP just in case
- add yamlcpp explicitly in the few places that really need it
  (e.g. netinstall testing the parsing of netinstall.yaml)
2020-06-10 02:27:57 +02:00
Adriaan de Groot
dc16afac4a CMake: massage IMPORTED targets and module path
- Add the Calamares CMake-modules to the search path automatically
- Export to CalamaresTargets.cmake and use namespace Calamares::
- Document imported targets
- Find Qt, because the translations machinery will need macros from that
- The installed lib links to IMPORTED libraries from KF5, so we need
  to find them (again) as well.
2020-06-10 01:37:54 +02:00
Callum Farmer
210ce97bf6 [libcalamaresui] Update SPDX identifiers.
Update ImageRegistry.cpp
2020-06-03 12:28:58 +01:00
Adriaan de Groot
39b5dd4e6e [libcalamaresui] Avoid deadlock
- When loading QML V2, both loadQmlV2Complete() and changeSlideShowState()
  lock the same mutex, introduced in e7f4479df1.
- Explicitly unlock when loading is done and we need to change the state
  immediately.
2020-05-20 11:36:44 +02:00
Adriaan de Groot
c7d0df223a [libcalamaresui] Expose registering-a-single-module
- For testing purposes, it's useful to load a module externally
  and then register it to the ModuleManager (this hands off ownership).
- Refactor overall module loading to use the exposed single-module method.
2020-05-20 10:36:42 +02:00
Adriaan de Groot
1fec95ac48 [libcalamares] Move QML search-path initialization
- QML files need to be searched in specific places; this was initialized
  by Calamares, but not for the text application. Move initialization
  into the library.
2020-05-19 21:25:05 +02:00
Adriaan de Groot
6dffec2730 [libcalamaresui] Move QML-related directory functions to Qml.cpp 2020-05-19 21:02:06 +02:00
Adriaan de Groot
4491fb8c27 [libcalamaresui] Name QML-wrangling functions consistently
- Use "Qml" in camel-cased names
2020-05-19 21:00:05 +02:00
Adriaan de Groot
0947da3d41 [libcalamaresui] Report on QML errors
- If the slideshow fails to load entirely, say so
2020-05-19 17:08:49 +02:00
Adriaan de Groot
ec2fc5a763 [libcalamaresui] Better default font size
- Previously, unless setDefaultFontSize() was called explicitly,
  the default size would be 0, leading to unexpected and weird
  displays (and a warning on stderr).
- If setDefaultFontSize() is not called, get a sensible size instead
  (like defaultFontHeight() was already trying to do).
2020-05-19 16:44:44 +02:00
Adriaan de Groot
8db8752a41 [libcalamaresui] Remove spurious Q_FUNC_INFO 2020-05-19 16:44:44 +02:00
Adriaan de Groot
17231ae41f [libcalamaresui] Sanitize API of PrettyRadioButton
- Don't expose internals
- Drop unnecessary virtual
- Offer new API to do the things, for which internals were exposed
2020-05-18 11:26:22 +02:00
Adriaan de Groot
3b7c3c4f5d [libcalamaresui] Coding style
- Apply coding style
- Place the widget classes in namespace Calamares
- Export symbols for widgets
2020-05-18 11:26:12 +02:00
Adriaan de Groot
c4951d5090 [libcalamaresui] Move PrettyRadioButton from partition 2020-05-18 10:38:45 +02:00
Adriaan de Groot
8d4c7767d4 [libcalamaresui] Document ClickableLabel 2020-05-18 10:32:25 +02:00
Adriaan de Groot
022045ae05 [libcalamaresui] Refactor loading slideshow
- split into a separate method
- when QML is disabled, warn about QML settings
2020-05-14 17:04:35 +02:00
Adriaan de Groot
c83e5c57a4 [libcalamaresui] When QML is off, there is no Qml panel flavor 2020-05-14 16:57:14 +02:00
Adriaan de Groot
736f99768a [libcalamaresui] Don't build QML bits if they're not wanted
When WITH_QML is off (by explicit choice)

- don't build the QmlViewStep
- don't build the QML slideshow
2020-05-14 16:31:59 +02:00
Adriaan de Groot
c3c4b79147 Merge branch 'fix-slideshow' 2020-05-13 21:20:25 +02:00
Adriaan de Groot
20c1ae246d [libcalamaresui] Center slideshow pictures 2020-05-13 17:28:04 +02:00
Adriaan de Groot
5aafa0f4c4 [libcalamaresui] Expose slideshow image names for API -1
- Branding shows the slide pathnames or the slide QML, depending
  on selected API (which depends on the config-file).
- Use one slideshow or the other.
2020-05-13 17:19:46 +02:00
Adriaan de Groot
df74604755 [libcalamaresui] Implement non-QML Slideshow 2020-05-13 16:35:09 +02:00
Adriaan de Groot
e7f4479df1 [libcalamaresui] Move all the slideshow code out of ExecutionViewStep
- The SlideshowQML now handles all the bits that were in
  the viewstep.
- The viewstep uses the abstract Slideshow API.
2020-05-13 14:01:51 +02:00
Adriaan de Groot
f856c07b04 [libcalamares] Move progress signal to RequirementsModel
- It is the requirements model (checking) that reports progress, and now
  the model is accessible (ask for it with requirementsModel(), make the
  messages come from there.
2020-05-12 16:09:13 +02:00
Adriaan de Groot
fabe5ec439 [welcome] Config should not have its own RequirementsModel
- Use the one from ModuleManager
2020-05-11 16:30:26 +02:00
Adriaan de Groot
153757933a [libcalamares] Stop emitting signals with RequirementsList
- The architecture of letting someone build up a list of requirements
  from data emitted by the ModuleManager is broken: if it gets loaded
  later, it will miss data; passing around complicated objects is
  no fun anyway. Get rid of it, on the way to "ModuleManager has
  its own model of requirements".
2020-05-11 16:30:26 +02:00
Adriaan de Groot
b7c60cec66 [libcalamares] Re-vamp RequirementsChecker
- Give the ModuleManager a RequirementsModel -- that is the source
  of truth about the module-requirements of the modules managed
  by that particular ModuleManager.
- Let the RequirementsChecker operate on a given RequirementsModel.
2020-05-11 16:30:26 +02:00
Adriaan de Groot
df1f9f1b56 [libcalamaresui] Prep-work for image-slideshow
Doesn't compile (but I need to get it off this machine)

- Prepare to implement a picture-based slideshow alongside QML
- Split QML loading into the slideshow component

This might be good prep-work for moving QML loading out of the QMLViewStep as well.
2020-05-09 23:07:56 +02:00
Adriaan de Groot
bb2b5fd982 [libcalamaresui] No reason for bail() to be a method 2020-05-07 20:41:40 +02:00
Adriaan de Groot
526716556c [libcalamaresui] Store the slideshow-from-images data
- This code has existed for a long time but never stored anything
  to the Branding object, and the most literal slideshow (just some
  images) was not implemented.
2020-05-07 19:02:38 +02:00
Adriaan de Groot
a7a6c937ea [libcalamaresui] Add needed includes
- Return type QPixmap means we should definitely #include it
2020-05-06 15:23:27 +02:00
Adriaan de Groot
cd44f548f5 [libcalamaresui] Add donateUrl to the branding settings
SEE #1384
2020-05-06 14:34:37 +02:00
Adriaan de Groot
dc1a4fab8e [libcalamaresui] Chase Branding API change 2020-05-04 12:52:14 +02:00
Adriaan de Groot
62696a3a48 [libcalamaresui] Remove the special * operator for string-enums in branding
- This is a good example of being overly clever in C++
- the whole API with an enum requesting a specific string is a bit weird,
  although it makes sense from the 'might need more strings specified'
  point of view.
2020-05-04 12:52:05 +02:00
Adriaan de Groot
0e71957b74 [libcalamaresui] Apply coding style 2020-05-01 14:37:25 +02:00
Adriaan de Groot
8af17fafe1 [libcalamaresui] Register Global Storage (as 'Global') for QML 2020-05-01 14:37:25 +02:00
Adriaan de Groot
dc523525c2 [libcalamaresui] Register the right type for ViewManager (C&P typo) 2020-05-01 09:15:46 +02:00
Adriaan de Groot
1d44c88e0a [libcalamaresui] Refactor loading of stylesheet
- prep-work for adding special-case styling for productWallpaper
2020-04-30 12:18:15 +02:00
Adriaan de Groot
ddde817abf [libcalamaresui] Apply coding style 2020-04-30 12:10:09 +02:00
Adriaan de Groot
fabb351b77 [libcalamaresui] Give ViewManager widgets names for styling 2020-04-30 12:08:48 +02:00
Adriaan de Groot
86ffab1873 [libcalamares] Use convenience Logger::NoQuote 2020-04-21 16:46:48 +02:00
Adriaan de Groot
a0b4b2bf5e
Merge pull request #1381 from bill-auger/patch-welcome-banner
[welcome] add optional branding banner to welcome page
2020-04-21 13:18:44 +02:00
bill-auger
7bce58f6f2 [welcome] add optional branding banner to welcome page 2020-04-19 04:01:22 -04:00
Adriaan de Groot
e804ad2488 [libcalamaresui] Rename enlarge()
- rename enlarge to ensureSize() and change the meaning from
  "make this much bigger" to "make sure this is displayed",
  which is easier on the caller to calculate.
2020-04-17 12:56:47 +02:00
Adriaan de Groot
af4220331e [libcalamaresui] Move lambda to a "real" slot. 2020-04-03 16:38:10 +02:00