474 Commits

Author SHA1 Message Date
Nyall Dawson
0e928e8191 [processing] Correctly set parent widgets for algorithm dialogs
to avoid dialogs immediately going out of scope and being garbage
collected
2018-11-23 20:32:16 +11:00
Nyall Dawson
f3e9aaf79a Fix some inefficient python dictionary iteration 2018-10-31 08:42:51 +10:00
Nyall Dawson
c817e38be2 [processing] Fix an exception in modeler when editing a model in
which a child algorithm later has a new parameter added
2018-09-25 12:48:26 +10:00
Nyall Dawson
0c79d08d05 Fix tests on Travis 2018-09-22 05:26:29 +10:00
Nyall Dawson
4a0a48fe47 [processing] Also expose complete expression context inside
data defined buttons for model child algorithms

The context was not previously exposed, so users would not have
been aware that they can utilise all the variables and functions
available to parameters within child algorithms.
2018-09-22 05:26:29 +10:00
Nyall Dawson
7af13f62c0 Set widget context for widget wrappers 2018-09-22 05:26:29 +10:00
olivierdalang
340631f850 fix #19824 where modifications to project models were not saved
Models definitions are now stored in a dict rather than list
which allows for less verbose code to reference models by name
2018-09-15 14:53:40 +10:00
Nyall Dawson
d65bd5f08e [processing] Fix another exception in modeler 2018-09-11 15:40:27 +10:00
Nyall Dawson
90dbf72e98 [processing] Fix exception when showing advanced parameters for alg in modeler 2018-09-11 15:40:27 +10:00
nirvn
68b7e799f0 [processing] add msg bar links to files when saving/exporting models 2018-09-11 10:30:07 +07:00
Nyall Dawson
ac3b37ffe0 [processing] Fix wrapper value retrieval for some ported wrappers
Fixes #19813
2018-09-11 10:26:36 +10:00
Nyall Dawson
a717b85e2e [FEATURE][processing] New modeler parameter widget
A new widget which handles parameter values for child algorithms
within a model. Instead of the previous approach of requiring
individual widget wrappers to handle creation of a suitable
model widget, we do all this automatically for them.

This widget uses a stacked widget with a toolbutton to select
the parameter's source, instead of the previous combo box approach
(which didn't scale well for large models). I.e. users select
first whether the value is taken from a static value, a
model input, or an output from a different child algorithm. The
widget then changes appearance and behavior based on this
choice.

Additionally, a new option is present for all parameters
of using a "precalculated expression". This expression is
evaluated once before the child algorithm is executed
and used during the execution of that algorithm.
2018-09-04 19:06:07 +10:00
Nyall Dawson
a0b4e024bb [processing] Respect application stylesheet in modeler/script editor dialogs 2018-08-16 09:12:22 +10:00
Nyall Dawson
6072350942 Tooltip for project provider 2018-08-13 17:39:00 +10:00
Nyall Dawson
a4a74a907d Add new icon for 'Save in project' thanks to @nirvn 2018-08-13 15:47:01 +10:00
Nyall Dawson
63fd4bab2a [processing][FEATURE] Store models inside QGIS project files
Allows processing models to be stored inside QGIS project files,
so that opening the project makes that model available.

Some models are so intrinsically linked to the logic inside
a particular project that they have no meaning (or are totally
broken) outside of that project (e.g. models which rely
on the presence of particular map layers, relations, etc)

This change allows these models to be stored inside that project,
avoid cluttering up the "global" model provider with models
which make no sense, and making it easier to distribute a single
project with these models included.

Models are stored inside projects by clicking the new "embed
in project" button in the modeler dialog toolbar. Models can be
removed from a project from the model's right click menu in the
toolbox.
2018-08-13 15:47:01 +10:00
Alexander Bruy
65ae32aadd [processing] homogenize filter strings for models and scripts 2018-08-03 08:34:05 +03:00
Nyall Dawson
d43f1a2823 [processing] Allow models to have no group name set
This is supported by the toolbox now, so relax the requirement
that all models have a compulsory group name. If no group is set,
the model is shown directly under the Models node in the toolbox.

Also switch a warning from message box to message bar
2018-07-18 08:56:52 +10:00
Nyall Dawson
68aae3a0e6 Replace processing modeler toolbox with common widget/model 2018-07-16 11:38:13 +10:00
Alexander Bruy
dcff720bb0 also use 1-dimensional table in modeler dialog (follow up 4b354984e8) 2018-06-14 09:35:11 +10:00
Nyall Dawson
db2c3d4986 [processing] Show search icon in search boxes 2018-05-31 12:51:53 +10:00
Nyall Dawson
879622547c [processing] Fix bad layout for docks in modeler
Because there's some deep underlying issue which causes the dock
layouts to get corrupted in certain circumstances, avoid the
issue entirely by moving construction of the docks out of
the .ui file and instead do it all manually via Python code.

Fixes #16428, #19068
2018-05-31 12:45:47 +10:00
Nyall Dawson
c0d9528090 Silence python warnings from 3rd party libraries on startup 2018-05-22 06:02:55 +10:00
nirvn
fb882494d5 [needs-docs][processing] reword add model/script to toolbox actions 2018-05-21 10:58:40 +07:00
Nyall Dawson
b98f8f1d37 [processing] Also filter using algorithm short descriptions 2018-05-17 08:50:39 +10:00
Nyall Dawson
5edcc64f72 [processing] Allow algorithms to return a translated short description
This is used in the algorithm's tooltip in the toolbox, and is intended
for single sentence description of the algorithm, e.g.
"Converts 2D features to 3D by sampling a DEM raster."

Convert grass algorithms to use short description for the
descriptive parts of their names, to cleanup the toolbox
and make it more uniform.
2018-05-17 08:50:39 +10:00
arnaud.morvan@camptocamp.com
81dabd185c [processing] Finish default values in model for destination parameters 2018-05-14 22:12:32 +10:00
Nyall Dawson
1a45a79719 [processing][model] Fix handling of mandatory checkbox in output definitions 2018-05-14 22:12:32 +10:00
arnaud.morvan@camptocamp.com
4ccd4446fe [processing] Add default values in model for destination parameters 2018-05-14 22:12:32 +10:00
Alexander Bruy
26a97a7da7 [processing] improve default values handling in the enum modeler GUI 2018-05-11 15:49:06 +10:00
Alexander Bruy
e97212e8b7 [processing] correctly restore default values 2018-05-11 15:49:06 +10:00
Alexander Bruy
39456ba6b4 [processing] fix handling of the multiple enum values 2018-05-11 15:49:06 +10:00
Alexander Bruy
1ba34dcbea [processing] add matrix and enum parameters to wrappers and handle them
in the modeler dialogs
2018-05-11 15:49:06 +10:00
Alexander Bruy
038da1131d [processing] modeler GUI for matrix parameter 2018-05-11 15:49:06 +10:00
Alexander Bruy
ffa4b04e29 [processing] add modeler GUI for enum parameter 2018-05-11 15:49:06 +10:00
nirvn
08db66fb03 [processing] draw vector icons when available in modeler 2018-04-30 13:04:20 +07:00
Nyall Dawson
6a2625664e [processing] Add dedicated "distance" parameter
This is a subclass of QgsProcessingParameterNumber, but specifically
for numeric parameters which represent distances. It is linked
to a parent parameter, from which the distance unit will
be determined, and is shown using a dedicated distance widget
within the processing parameters panel. This widget shows
the distance unit.

This avoids the confusion when running algorithms which
use distances where the unit depends on a layer or CRS parameter -
e.g. the distance parameter in the buffer algorithm gives
the distance in layer units... so now we can show those units
directly within the dialog. Hopefully this leads to less
user confusion and accidental "1000 degree buffers"!

Additionally - if the unit is in degrees, a small warning
icon is shown next to the parameter. The tooltip for this
icon advises users to reproject data into a suitable
projected local coordinate system.

Initially implemented for the native buffer and single
sided buffer algorithm only - but more will be added.

Fixes #16290
2018-04-20 18:27:00 +10:00
Alexander Bruy
90c65405fd [processing] use parameter description instead of name when retrieving
parameter from the registry
2018-04-17 11:09:30 +03:00
Matthias Kuhn
d7b75d1e99 Immediately apply configuration after change 2018-04-09 13:10:49 +02:00
Matthias Kuhn
dbced352b8 Fix use before assign 2018-04-09 13:10:48 +02:00
Matthias Kuhn
eb39d2379c Move processing algorithm configuration code to gui lib 2018-04-09 13:10:47 +02:00
Matthias Kuhn
3be4324d60 Move processing algorithm configuration widget to gui library
This way we can also use all the fancy widgets like a QgsExpressionLineEdit.
2018-04-09 13:10:47 +02:00
Matthias Kuhn
e6ef7639cb [processing] Allow algorithms to provide additional configuration widgets 2018-04-09 13:10:46 +02:00
Matthias Kuhn
4a14a36034 Remove leftover method getCustomModelerParametersDialog 2018-04-09 09:15:15 +02:00
Matthias Kuhn
4e4c189820 Remove unrequired cast 2018-04-05 22:50:13 +02:00
Matthias Kuhn
6eabb45043 Fix type hints in ModelerParametersDialog attributes 2018-04-05 22:47:23 +02:00
Matthias Kuhn
7c191a46c2 Make modeler text translatable 2018-04-05 22:47:12 +02:00
Matthias Kuhn
0aa8241da4 Avoid catch all exception 2018-04-05 22:46:59 +02:00
Rashad Kanavath
3408e02c46 [processing] create and manage label in WidgetWrapper
ModelerParametersDialog and ParametersPanel have to keep list of
wrappers only. widget and label( if needed) are created through
WidgetWrapper.createLabel()
2018-04-03 06:09:44 +10:00
Alexander Bruy
092557b16a [processing] correctly handle inactive providers in the modeler (fix #18461) 2018-03-19 11:55:10 +02:00