Commit Graph

853 Commits

Author SHA1 Message Date
Artem Grinev
d9f7726f7d [libcalamaresui] Add SPDX-header for Error Dialog files 2021-12-06 02:41:17 +04:00
Artem Grinev
2f2a418cc4 [libcalamaresui] Run clang-format 2021-12-06 02:37:11 +04:00
Artem Grinev
2dd77ee828 [libcalamaresui] Initialize Error Dialog field 2021-12-06 02:31:05 +04:00
Artem Grinev
bfa7b9a792 [libcalamaresui] Use translation fix for Error Dialog 2021-12-06 02:27:18 +04:00
Artem Grinev
32c5e18db0 [libcalamaresui] Add QDialogButtonBox translation fix 2021-12-06 02:26:13 +04:00
Artem Grinev
6bf0da7230 [libcalamaresui] Initial rework of error dialog 2021-12-05 04:50:13 +04:00
Adriaan de Groot
dde55471ba Merge branch 'calamares' into work-3.3 2021-10-30 15:00:54 +02:00
Adriaan de Groot
329f21093b [libcalamaresui] More careful in unmarginLayout 2021-10-04 00:27:03 +02:00
Adriaan de Groot
60cc8696e3 Remove PythonQt support -- C++ bits 2021-09-28 23:56:52 +02:00
Adriaan de Groot
ca4dbabf70 Remove PythonQt support
Nothing beyond the example module was ever built with the
PythonQt bindings, as far as I can tell. They have been
deprecated, defaulting OFF for over two years now.

QML modules fill the gap with customizable, run-time
interpreted UI and stronger support from the C++ side
of Calamares.
2021-09-28 23:49:08 +02:00
Adriaan de Groot
1bd5628256 [libcalamaresui] Redundant call, not available in Qt 5.15 anyway 2021-09-16 12:04:50 +02:00
Adriaan de Groot
714605ebaa [libcalamaresui] Missing header, needed in Qt 5.15 2021-09-16 12:04:29 +02:00
Adriaan de Groot
f49627f417 [libcalamaresui] Improve sizeLimit handling in log upload
The log sizeLimit can be 0 (disable log upload) but that's
not so clear in the code. While here, tidy up and add
some comments to surprising bits.
2021-09-15 13:30:06 +02:00
Adriaan de Groot
6e0a8d8ca1 [libcalamaresui] Translate button texts for paste-message 2021-09-08 11:15:12 +02:00
Adriaan de Groot
dcfbb766dc [libcalamaresui] Use fixed standard-buttons labels
Move some of the texts to the new TranslationFix, from ViewManager,
and use them. Keep them in ViewManager, too, so that the translations
with context ViewManager are not removed just now.
2021-09-08 11:14:46 +02:00
Adriaan de Groot
683bad19fc i18n: introduce a "TranslationFix"
This is intended to apply translations to some common Qt UI components.

Example: a QMessageBox with standard buttons OK and Cancel; the text
for that is determined at startup using the system locale, and later
changes to the current locale or the current translation catalog,
do not affect OK and Cancel. It might be possible to load a catalog
with the right translation strings, except that there is no way to
know what the context or catalog **is** for the strings that are
used to label standard buttons: they can come from Qt base, or
the platform, or the theme. Merely loading the Qt Base translations
for the correct language does not help, because those translations
do not contain an "OK" string with the context used for standard
buttons.

Do the translation by hand; then we have all of the Calamares
languages covered, too, which is more than the Qt translations do.
2021-09-08 11:14:46 +02:00
Adriaan de Groot
38c65e80f3 [libcalamaresui] Warn when asking for nonexistent Branding instance 2021-08-24 11:57:37 +02:00
Adriaan de Groot
4114a2bbe8 CMake: chase renamed YAMLCPP 2021-07-26 15:08:29 +02:00
Adriaan de Groot
cbb1a5ef36 CMake: within Calamares repo, use the (eventual) imported names of libraries 2021-07-26 14:22:28 +02:00
Adriaan de Groot
59f11e9b67 i18n: make retranslator more consistent
- Improve naming.
- Both lambda and slot versions call the code immediately.
2021-07-24 23:26:02 +02:00
Adriaan de Groot
4b2b74bdbd [libcalamaresui] Do not link publicly to yamlcpp 2021-07-23 17:23:30 +02:00
Adriaan de Groot
acb731d823 [libcalamaresui] Provide the logFile path
This is intended for consumption by QML; the ViewManager object
acts as a proxy for a handful of global Settings values already,
so throw in global Logger values as well. A QML module that would
like to read the log file (e.g. for tailing it as part of a
slide-show) can get the path via this property.
2021-06-21 22:21:06 +02:00
Anubhav Choudhary
5691f95833 [logUpload] Added one more test 2021-04-02 23:50:41 -06:00
Anubhav Choudhary
b897619558 [logUpload] Added some basic tests 2021-04-02 07:40:03 -06:00
Anubhav Choudhary
c73e9ec89f [logUpload] Ran styleScript 2021-04-01 01:05:55 -06:00
Anubhav Choudhary
c1aa0b581e [logUpload] suggestionsAndFixes-part3
- Resolved the problem of incomplete log upload
- sizeLimit = 0 fixed (turns off paste functionality)
- Documentation update
- sizeLimit < 0 now needs no hardcoded upper limit
- Calamares::Branding::uploadServerFromMap() serves sizeLimit in bytes
2021-04-01 00:25:37 -06:00
Anubhav Choudhary
b42f86f20f [logUpload] suggestionsAndFixes-part2 2021-03-30 08:28:30 -06:00
Anubhav Choudhary
d109fc5856 [logUpload] suggestionsAndFixes 2021-03-30 08:13:29 -06:00
Anubhav Choudhary
6a6557e320 [logUpload] fixes 2021-03-29 13:22:56 -06:00
Anubhav Choudhary
6726a926a4 [logUpload] Configurable upload size limit
A key 'sizeLimit' added to uploadServer field in branding.desc to limit the size of logFile to upload.
2021-03-29 12:44:34 -06:00
Adriaan de Groot
779e5ecf8f [libcalamaresui] Factor out the pastebin UI
- offer a convenience method for showing a popup and
  URL information and copying the URL to the clipboard
- use that from ViewManager (on failure) and DebugWindow (on demand)
2021-03-19 14:17:34 +01:00
Adriaan de Groot
668921543a [libcalamaresui] Convenience method to check if paste would do anything 2021-03-19 13:36:40 +01:00
Adriaan de Groot
9341a84820 [libcalamares] Make the RETRANSLATE macros more statement-line
Require a ; after RETRANSLATE macros. They are statement-like;
this makes it easier for some of them to be recognized by
clang-format and resolves some existing weird formatting.
2021-03-16 14:55:26 +01:00
Adriaan de Groot
a90f510b85 [libcalamares] Convenience for logging subentries
For methods that log a bunch of things, and which want to
consistently use SubEntry, but don't know when the **first**
log entry is within the method, Logger::Once can be used
to log one regular message (with function info) and the
rest are subentries.
2021-03-15 22:45:29 +01:00
Adriaan de Groot
f8afb15c4c [libcalamaresui] Improve logging for QML modules
- mention which instance produces warnings
- tag additional debugging from the same method with Logger::SubEntry
2021-03-15 20:47:27 +01:00
Adriaan de Groot
1998405dbb [libcalamaresui] Fix up test for logfile
- this test would fail if the logfile already exists for
  any reason (including "I just ran the test")
- remove the file before expecting an empty logfile
- improve messages; a missing logfile is not a "things cannot
  work" situation, it's a warning
2021-03-14 21:37:31 +01:00
Adriaan de Groot
9f17d3fd12 [libcalamaresui] Paste the last 16KiB of the log file
- If Calamares is run more than once, reading the log file
  can get you older / not relevant log messages. Get the tail
  end instead.
2021-03-09 18:25:10 +01:00
Adriaan de Groot
a1ed303820 [libcalamaresui] Add test for Paste
This tests only the termbin ("fiche") paste by sending it
a derpy fixed string. Prints the resulting URL, doesn't
verify in particular.

It'd be rude to run this test too often.
2021-03-09 17:55:10 +01:00
Adriaan de Groot
44ec8a7c0b [libcalamaresui] Improve testability
- mark functions with STATICTEST so they can be compiled into a test
- move logfile-reading so we can call the pastebin-upload functions
  with an arbitrary payload.
2021-03-09 17:22:48 +01:00
Adriaan de Groot
846d6abaa8 [libcalamaresui] Move message- and clipboard handling
- The Paste API promises just a (string) URL back, not
  a whole message, so return just the URL from the
  abstract API and the concrete (fiche) implementation.
- Set clipboard contents from the UI
- Build (translated) message in the UI code
2021-03-09 15:51:24 +01:00
Adriaan de Groot
81badc36f4 [libcalamaresui] Implement abstract doLogUpload() API
This is a "do the right thing" function, which then calls
the implementation-specific code for each type.
2021-03-09 15:42:21 +01:00
Adriaan de Groot
1ff854f05d [libcalamaresui] Push upload to a more abstract API
- have a namespace Paste with just one entry point, which will handle
  untangling type &c.

This doesn't compile, but indicates the direction to take the API
2021-03-09 15:32:46 +01:00
Adriaan de Groot
efec12d001 [libcalamares] Read structured upload-server info
- Use just type and url, since port can be specified in
  a URL. Note that we only use host and port, not the
  scheme (or the path, for that matter).
- Factor out understanding the *uploadServer* key to a function.
2021-03-09 15:24:02 +01:00
Adriaan de Groot
bce6f3f1b7 [libcalamaresui] Adjust paste code to desired API
Still doesn't compile because consumers are not ready.
2021-03-09 14:56:37 +01:00
Adriaan de Groot
3c6683bd98 [libcalamaresui] Rip out untyped data about upload server
This doesn't compile, but indicates the **type** information
desired about the (a) upload server.
2021-03-09 14:51:59 +01:00
Adriaan de Groot
f72436aa0a [libcalamaresui] Drop RE-wrangling, compare hosts instead to detect valid paste URL 2021-03-09 14:41:58 +01:00
Adriaan de Groot
8af5fb5da5 [libcalamaresui] Simplify getting URL response
- get a QByteArray rather than going through a char[] buffer
- bytes-read is not important since the RE can only match if
  there **are** that many characters.
2021-03-09 14:38:43 +01:00
Adriaan de Groot
1bf95eacb0 [libcalamaresui] Tidy the logging some more 2021-03-09 14:33:47 +01:00
Adriaan de Groot
260862fabc [libcalamaresui] Move the format-string closer to where it is used 2021-03-09 14:31:46 +01:00
Adriaan de Groot
844831751d [libcalamaresui] Factor out the reading of the log file
- this will be needed for other pastebins, too
2021-03-09 14:30:20 +01:00
Adriaan de Groot
92e36558fa [libcalamaresui] Remove unnecessary shadowing in lambda 2021-03-09 14:25:40 +01:00
Adriaan de Groot
bc2435eb7d [libcalamaresui] Apply coding style 2021-03-09 14:23:52 +01:00
Adriaan de Groot
fc8830ae4a [libcalamaresui] Tidy logging 2021-03-09 14:23:27 +01:00
Adriaan de Groot
6a1e46d7f6 [libcalamaresui] Add properties to ViewManager to expose Settings 2021-03-03 16:06:53 +01:00
Adriaan de Groot
849da3f322 [libcalamaresui] The ViewManager is a UI component for QML, not core 2021-03-03 15:54:11 +01:00
Adriaan de Groot
c3860849c1 [libcalamaresui] Notify step number when modules are all loaded
- using the QML sidebar would not highlight the first step on startup,
  only after next / prev would the highlight show up. Now, notify
  when all the modules are loaded (and number 0 is active).
2021-03-03 15:43:11 +01:00
Adriaan de Groot
cc3017be53
Merge pull request #1619 from deprov447/Upload_Install_Log
[libcalamaresui] Implementing LogUpload functionality from branding
2021-02-26 13:13:16 +01:00
Adriaan de Groot
cdbf45b5d3 [libcalamaresui] Remove unused include 2021-02-19 14:29:46 +01:00
Adriaan de Groot
3a4dcb6913 [libcalamaresui] Give slideshow (ExecutionViewStep) widgets names 2021-02-17 14:34:33 +01:00
Adriaan de Groot
7e6c3a2309 [libcalamaresui] Give the slideshow-widgets a name
- this is the *working* part of the slideshow, not its background
2021-02-17 14:25:06 +01:00
Anubhav Choudhary
9738851261 YAML list for uploadServer key 2021-02-15 20:51:41 +05:30
Anubhav Choudhary
7057081bdf QUrl for serverURL + renames 2021-02-10 14:38:26 +05:30
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