* API
Instead of having a single `load` function that exposes in its API
some elements only applicable to initializing a graph from a templates,
split it into 2 distinct functions: `load` and `initFromTemplate`.
Apply those changes to users of the API (UI, CLI), and simplify Graph
wrapper classes to better align with those concepts.
* Deserialization
Reduce the cognitive complexity of the deserizalization process
by splitting it into more atomic functions, while maintaining the
current behavior.
All the actions, file dialogs and message dialogs that are specific to
the application are removed from `main.qml` and placed instead in
`Application.qml`.
Only elements and functions related to the main window remain in
`main.qml`. As such, the `ensureSaved` and `ensureNotComputing` functions,
used when closing the main window, remain in `main.qml`.
Message dialogs that may be opened by these functions however are moved
to `Application.qml` as they are application-specific and can't be opened
on the homepage.
Application dialogs that may need to be called when triggering the closure
of the main window are aliased from `Application.qml` to remain callable
through the `StackView`.
In Image Gallery :
- drop 1 .mg open the scene
- drop images either create new camera or augment the reconstruction
In Graph Editor :
- drop 1 .mg open the scene
- drop images create new camera at position of mouse
Update the names of the commands that remove images in the "File"
menu to match with those in the Image Gallery menu.
"Clear Images" becomes "Remove All Images" and "Clear All Images" becomes
"Remove Images From All CameraInit Nodes".
Supporting the alternative palette (triggered with Ctrl+Shift+P) requires
a manual conversion from the QPalette to the QML palette, which does not
directly support disabled elements.
Keeping the previous palette management will support disabled elements,
but cause issues when switching to the alternative palette. Until both
can be fully supported, the alternative palette is disabled.
Manually convert the QPalette object to a QML Palette manually. The
conversion is not straight forward anymore, and not performing it
leads to an incomplete alternate (light) palette.
QML Palette in Qt 5.15 does not support yet disabled elements, the
support will only be enabled with Qt 6.
This commit addresses warnings that were raised by QtCreator's linter:
- IDs declared more than once
- variables declared more than once in the same scope
- type coercions
- variables declared as "var" when their type is known
- unclosed "case" in switch-case
Remove the "canStartComputation" condition which was not used anywhere
else and was not up-to-date: since it needed more than one image and no
ongoing computations to be "True", attempting to submit several branches
of a graph would always cause it to be "False", which in turn led the
"canSubmit" condition to be "False" (causing the pop-up requesting to
save the file to appear), even though the submission should have been
possible.
The submission should be possible whenever submitters are available and
the project file has been saved.
A project needs to be saved in order to be submitted to the renderfarm.
Prior to this commit, attempting to submit an unsaved project would not
prompt any dialog in the UI despite the exception that was thrown on the
Python side.
A warning dialog is now opened to let the user know that the project
cannot be submitted until it is saved.
"Load Template" allows to load an .mg file as a regular project file,
without taking into account if it is a template.
If the project file is not a template, it will be opened exactly as if the
"Open File" menu had been used. If it is a template and it contains
"Publish" nodes, they will not be filtered out (whereas they will be if
the template is opened with "Open File" or through the "New" actions).