116 Commits

Author SHA1 Message Date
Nyall Dawson
dd89f3779a [processing] Always use the same method to launder names
Ultimately avoids forced removal of _ characters in model
parameter names
2022-03-30 15:41:23 +10:00
Nyall Dawson
5df4882380 Fix exception when editing outputs in models 2022-02-28 19:57:15 +10:00
Nyall Dawson
817895d6d3 [processing] When an input parameter is renamed in the model designer,
also update the internal name of that parameter and all child algorithms
in the model accordingly

Before we just "faked" this by changing the parameter's description
only, but that meant that the old name was permenantly stuck and
had to be used in qgis_process or when calling the model via
python.
2022-02-28 17:33:19 +10:00
Nyall Dawson
d899da1ed2 [processing] Fix issues with edits to model outputs getting discarded
Specifically, this fixes two issues

1. If a user edits a dark green output block in a model and changes the
name of the output, that new name was always discarded and the only
way to change it was by editing the algorithm it was attached to

2. If an output was renamed through the algorithm properties dialog,
then any properties previously associated with that output (like
comments, coloring, placement, default value, mandatory flag)
would get reset back to their default settings
2022-02-07 10:04:00 +10:00
Alexander Bruy
82ad2051e6 fix file permissions
remove duplicated short help file
2021-06-21 07:17:36 +03:00
Alexander Bruy
076a0268ab cleanup imports 2020-04-05 05:23:29 +10:00
Alexander Bruy
91229e366a [processing] port map layer parameter definition widget to C++ 2020-04-05 05:23:29 +10:00
Alexander Bruy
abe12c4cd4 [processing] port distance parameter definition widget to C++ 2020-04-05 05:23:29 +10:00
Alexander Bruy
ffd21f3ceb [processing] port scale parameter definition widget to C++ 2020-04-05 05:23:29 +10:00
Alexander Bruy
bae6d214d8 [processing] port number parameter definition widget to C++ 2020-04-05 05:23:29 +10:00
Alexander Bruy
7330ca8e37 [processing] port vector layer and feature source parameter definition
widgets to C++
2020-04-05 05:23:29 +10:00
Alexander Bruy
6f84358a9f [processing] port multiple layers parameter defintion widget to C++ 2020-04-05 05:23:29 +10:00
Alexander Bruy
ebd0a72025 [processing] port field parameter definition widget to C++, expose
defaultToAll option to modeler parameter definition dialog
2020-04-05 05:23:29 +10:00
Alexander Bruy
a2ed502cf5 [processing] port band parameter definition widget to C++, expose
option to define multiple bands parameter in modeler parameter defintion
dialog
2020-04-05 05:23:29 +10:00
Nyall Dawson
e788be93fa [processing][FEATURE] Add api for setting model component colors, and expose
the option to set manual colors for individual model comments
2020-04-01 18:20:09 +10:00
Alexander Bruy
72404a9038 [processing] use native matrix parameter definition widget 2020-03-27 07:08:42 +10:00
Alexander Bruy
87eefa325e [processing] use native enum parameter definition widget 2020-03-27 07:08:42 +10:00
Nyall Dawson
1915a16bf3 Port extent parameter to new c++ API widget wrapper 2020-03-25 19:25:40 +10:00
Alexander Bruy
16b4ef8e32 [processing] port expression parameter definition widget to C++ 2020-03-19 11:49:13 +02:00
Alexander Bruy
972223b55e [processing] port point parameter definition widget to C++ 2020-03-19 11:49:13 +02:00
Alexander Bruy
f4e4adbef8 [processing] port CRS parameter defintion widget to C++ 2020-03-19 11:49:13 +02:00
Nyall Dawson
517aa9667b [processing] Port DestinationSelectionPanel to c++
This is basically a 1:1 port (+some fixes relating to incorrect signal
emissions and many more tests)
2020-03-17 07:24:40 +10:00
Alexander Bruy
70c5018b74 map layer data type support in modeler 2020-03-14 08:51:02 +02:00
Nyall Dawson
961557dacd UX improvements for comment editing 2020-03-06 03:49:16 +10:00
Nyall Dawson
13fc85d740 [FEATURE][processsing] Add support for comments attached to components
This allows users to create comments attached to model components (inputs,
algorithms or outputs). Comments are shown linked to the associated component,
and can be freely moved around the model.
2020-03-06 03:49:16 +10:00
Nyall Dawson
e05572a11d Port file parameter definition widget to new APi 2019-07-08 15:07:42 +10:00
Nyall Dawson
a9788339ea Port an item type which has a parent parameter choice (layout items) for reference 2019-07-01 17:01:34 +10:00
Nyall Dawson
d83997c490 Port string parameter to new config widget 2019-07-01 17:01:34 +10:00
Nyall Dawson
477d3b1f1a Port boolean widget config dialog to new API 2019-07-01 17:01:34 +10:00
Nyall Dawson
10d6a8a122 [processing][API] Add API to QgsProcessingGuiRegistry and QgsProcessingParameterWidgetFactoryInterface
to handle creation of parameter definition widgets

Previously, these configuration widgets were all hardcoded into the Python modeler
dialog. This prevented 3rd party, plugin provided, parameters from ever being full
first class citizens in QGIS, as there was no way to allow their use as inputs to
user created models to be customised.

Now, the registry is responsible for creating the configuration widget, allowing
for 3rd party parameter types to provide their own customised configuration
widgets.

Refs #26493
2019-07-01 17:01:34 +10:00
Alexander Bruy
ff24ab53ef outputs can not be advanced 2019-06-24 20:09:57 +10:00
Alexander Bruy
625cc01fc3 [processing][feature][needs-docs] allow to define model parameters as
advanced
2019-06-24 20:09:57 +10:00
Bas Couwenberg
2628c480c5 Don't include revision in sources.
Prevent changes to files that weren't changed between releases.
This eases review of the changes between releases significantly.
2019-05-17 16:47:47 +02:00
Nyall Dawson
32fbf0a92b [processing][FEATURE] New parameter type for map scales
This adds a new parameter type specifically for map scales,
QgsProcessingParameterScale. The values are evaluated using
self.parameterAsDouble, which returns the map scale
denominator (matching the standard in other parts of the
QGIS API).

Scale parameters are displayed to users using the standard
QgsScaleWidget, which includes the combo box of predefined
scales and a shortcut button to match the current map scale.
2019-03-13 16:52:29 +10:00
Nyall Dawson
021d1ef237 [FEATURE][processing] New parameter types for layouts and layout items
Allows processing algorithms which operate on a specific layout
and layout item selection
2019-03-12 08:16:52 +10:00
Nyall Dawson
82b186f00f [processing] Allow data type for numeric inputs to be specified 2019-03-11 08:05:07 +10:00
Nyall Dawson
cf43446885 [processing] Show parameter type in input definition dialog title 2019-03-11 08:05:07 +10:00
Nyall Dawson
4f6df2980f [processing] Fixes to distance inputs for models
- fix parameter can get converted to plain number parameter after edits
- allow parameter to be linked to parent parameters, so that the
correct distance unit and choices are shown for the parameter
2019-01-31 17:53:25 +11:00
Alexander Bruy
dcff720bb0 also use 1-dimensional table in modeler dialog (follow up 4b354984e8) 2018-06-14 09:35:11 +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
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