205 Commits

Author SHA1 Message Date
Nyall Dawson
e6fb69c41e Also add "Run from Here" action to right click menu on algorithms
Allows running the part of the model which starts at the right
clicked algorithm only
2024-05-04 06:30:43 +10:00
Nyall Dawson
834167018e Add algorithmAboutToRun signal to QgsProcessingAlgorithmDialogBase
This signal can be used to tweak the algorithm's context prior to
the algorithm execution.
2024-05-04 06:30:43 +10:00
Nyall Dawson
a979931960 Function naming improvements 2024-04-21 06:46:35 +10:00
Nyall Dawson
de0f5cf87c Make API more future proof 2024-04-21 06:46:35 +10:00
Nyall Dawson
e2d6b54f35 Add "View Log" action for child algorithms
This action shows the log of that child step, regardless of whether
or not it failed. This is handy for debugging model errors after
testing, when you've already closed the algorithm window...!
2024-04-21 06:46:35 +10:00
Nyall Dawson
8302259463 Make child results handling API more flexible 2024-04-21 06:46:35 +10:00
Nyall Dawson
6c22cd0355 [feature] Add "View Output Layers" option for model child algorithms
When editing a model through the designer (and after having run
that model), you can now right click any child step in the model
and select "View Output Layers". This will add the output layers
from that step as new layers in the current QGIS project.

This action is available for ALL child algorithms in the model,
even if the model is not configured to use the outputs from those
children as model outputs.

This is designed as a helpful debugging action. If a user's model
fails (or gives unexpected results), they can then trace through
the model and view the outputs for suspected problematic steps.
It avoids the need to add temporary outputs to a model and re-run
to test.

Additionally, this action is always available after running the model,
EVEN if the model itself failed (eg because of a misconfigured
step later in the model).

Sponsored by City of Canning
2024-04-21 06:46:35 +10:00
Nyall Dawson
133bad76ee Move some model designer code to c++ 2024-04-21 06:46:35 +10:00
Even Rouault
15ea5c46bc
Header files: remove all mentions of '\since QGIS 3.0' 2024-02-18 20:57:23 +01:00
Nyall Dawson
09dc6838a7 Upgrade another enum to get filtering working in processing toolbox 2024-02-10 17:25:22 +10:00
Nyall Dawson
ee53b9ae48 Port processing enums to enum class
A step towards a Qt6 compatible Processing framework
2024-02-10 17:25:22 +10:00
Nyall Dawson
ac2f1179c8 More item data role enum to enum class conversions 2024-02-06 21:04:43 +10:00
Nyall Dawson
3e7d376953 Add method to push formatted text to Processing feedback
Provides a method for algorithms to push HTML contents to the log
(the other feedback methods all escape HTML strings to strip
formatting characters)
2024-01-09 17:02:21 +10:00
Nyall Dawson
440cac298f Promote QgsProcessingModelChildParameterSource source to enum class and move to Qgis
This wasn't marked as stable API, so we don't need any of the usual monkey patching code
2023-08-25 15:44:05 +10:00
Alexander Bruy
0f2d2bc360 allow changing number of threads through the algorithm settings panel 2023-04-25 05:41:04 +10:00
Nyall Dawson
cce5cc28f0 Spelling 2023-04-24 13:09:46 +10:00
Nyall Dawson
45d891870a Port history dialog to c++ 2023-04-24 13:09:46 +10:00
Nyall Dawson
4c778193c9 Address review 2023-04-23 18:12:14 +10:00
Nyall Dawson
f794b17fa4 [processing] Port functionality from history dialog to history
provider framework
2023-04-23 18:12:14 +10:00
Nyall Dawson
3c64bcc6a6 Fix false positive cppcheck pureVirtualCall warnings when pure
virtual functions are called as slots
2023-04-17 16:29:44 +10:00
Alex
5a0fba972e
[processing] Multilayer selection drop support
Adds drop support for layers in the multiple layer selection widgets to more efficiently select the desired elements. Especially useful in big project of with duplicated layer names.
2023-03-24 06:47:11 +10:00
Nyall Dawson
7cd6b616b1 Allow processing dialog to override default processing context settings 2023-03-17 05:59:15 +10:00
Julien Cabieces
d5505e329d Add missing Q_OBJECT macros and enable clazy check missing-qobject-macro 2022-07-13 08:24:23 +10:00
Nyall Dawson
092279e90d [feature] Run batch processing steps in tasks
Instead of forcing all steps in the batch processing dialog to execute
in the main thread, we now run each step as a separate task whenever
possible. This keeps the UI nice and responsive, and permits
responsive cancelation and progress reporting.

Individual steps are still run sequentially, not in parallel (yet!)
2022-03-15 11:44:08 +10:00
Nyall Dawson
d62d0b82e3 Port model help editor dialog to c++ 2022-02-28 17:33:49 +10:00
Nyall Dawson
8f34557037 [processing] When closing a model with unsaved changes, if the user
accepts the prompt to save the changes BUT then cancels the file dialog
asking for the destination file name, don't treat this as though the
user has opted to discard the model
2022-02-07 12:01:07 +10:00
Nyall Dawson
b5d2ebd696 Fix build 2022-02-05 11:05:51 +10:00
Nyall Dawson
a169055277 [processing] Improve UX when saving models
- When saving a model to a file, don't require that the model already
has a name entered. Instead, if no model name has been entered then
set the model name automatically to match the selected save filename.
E.g. if the user saves the model as "Process incoming features.model3",
then the model name will be set to "Process incoming features".
- When first saving a model, IF the user HAS already entered a model
name then make the default file name suggested by the dialog match
this model name
2022-02-05 11:05:51 +10:00
Nyall Dawson
91cf8954f4 [processing] Default to "Model Input" sources for map layer parameters
when configuring a new algorithm

While the previous behaviour of defaulting to a static value makes
sense for things like numeric parameters, this is a very rare use
case for map layer parameters. For better new user experience we can
default instead to showing model inputs for these parameter types.
2022-02-04 18:14:22 +10:00
Nyall Dawson
8486afbdd1 [processing] Fix model designer sometimes opens behind other windows 2022-02-04 16:34:53 +10:00
Nyall Dawson
5e5540c890 [processing] Port algorithm log to new history provider API
No user visible changes, but we gain the flexibility for better
history storage, including the ability to store the outputs
calculated by the algorithm execution...!
2021-12-21 15:32:57 +10:00
Nyall Dawson
86e94aed42 [feature] Add action to processing algorithm advanced menu to copy the
current settings as JSON and paste json settings from clipboard

The utility of this is two fold:

1. It provides a way for users to copy the settings defined in the
dialog in a text format, so they can store these easily and then
restore later by pasting the value

2. It provides an easy way for users to copy the settings into
the json format consumed by qgis_process (following
https://github.com/qgis/QGIS/pull/46497), so that it is easy
for users to see the expected format even for complex parameters
(like tin interpolation parameters)
2021-12-17 08:29:31 +10:00
Nyall Dawson
132294b3c9 Spelling 2021-12-16 11:15:34 +10:00
Nyall Dawson
eea2ba3d93 QgsProcessingAlgorithmDialogBase subclasses should also implement
the QgsProcessingContextGenerator interface
2021-12-16 11:15:34 +10:00
Nyall Dawson
03d0c573c4 Add mode enum for processing algorithm dialogs so that code can
determine if the single execution or batch execution dialog is shown
2021-12-16 11:15:34 +10:00
Nyall Dawson
86794dabdc Fix interface for QgsProcessingParametersGenerator was modified for
the python subclasses only and no longer correctly overrides the
base class method
2021-12-16 11:15:34 +10:00
Nyall Dawson
dcf0cfe5a3 Fix API issues causing malformed python stub files
Fixes #46240
2021-11-29 11:54:06 +10:00
Juergen E. Fischer
c6008b7ee1 fix MSVC build: reverts fee62e4, dff05dd and e3a77b9484c effectivly
reverting 3fb0f66 (followup #45348)

Using --no-public-is-protected (default on Windows) also works on Linux
and fixes #45331 too
2021-10-21 23:03:48 +02:00
nirvn
ef84e48a09 Run sipify_all.sh 2021-10-12 16:34:05 +10:00
Denis Rouzaud
a6645d9cba fix test + rebase 2021-10-12 16:34:05 +10:00
Denis Rouzaud
ec16736306 run sipify 2021-10-12 16:34:05 +10:00
nirvn
7a0fb2acdd [ui] Fix unmet expectation: when navigating the processing toolbox panel via keyboard, hitting return/enter should launch focused algorithm 2021-10-10 23:36:37 -07:00
Nyall Dawson
02266ef8e6 Rename Qgis::MessageLevel::None to NoLevel. None is a reserved
keyword in Python, so this value was previously inaccessible to PyQGIS
scripts

Also change all references to Qgis::MessageLevel values to their
fully qualified names, to ease a future transition to an enum
class (when sip bugs are fixed)

Fixes #42996
2021-05-30 10:36:01 +10:00
Nyall Dawson
eaf70803b0
Cleanup auto generated sip files and remove orphaned files (#43240) 2021-05-17 08:09:27 +02:00
Nyall Dawson
615b63e76d [processing] When configurating a field calculator algorithm in a model,
ensure that the correct expression context is set for the widget

Otherwise we don't see any of the available variables ready for
use in the calculation.

We need to do this manually after creating the widget, because the
context generator isn't set till after the widget is created, and
this particular widget configuration doesn't fetch the expression
context on demand.
2021-04-02 06:30:27 +10:00
Denis Rouzaud
ba8a445850 run sipify 2021-03-22 21:13:52 +01:00
Nyall Dawson
c8d61499ff [processing] Instead of a hidden parameter for verbose model logging,
add an explicit log level getter/setter to QgsProcessingContext which
algorithms can use to determine an appropriate level of feedback
to push to users.

Initially the verbose log only triggers the full verbose output
of model executions (which is also used when running models through
the model designer), but the intention is that more algorithms
will fine tune their output based on the logging level.

qgis_process also gains a new --verbose switch to enable verbose
log output.
2021-02-20 05:04:00 +10:00
Alessandro Pasotti
7b2fc4c1f8 More doxy nonsense, pt 2 2021-02-19 08:15:29 +10:00
Luigi Pirelli
2f7d6defee Added sanity check of links between graphicitems showing error in dialog. Fixes #40724 #39260 2021-02-11 11:47:28 +10:00
Nyall Dawson
50b9beaad6 [sipify] Catch more class references and insert :py:class: annotations 2021-01-31 05:41:22 +10:00