510 Commits

Author SHA1 Message Date
Andrea Giudiceandrea
7903889f54 Modeler: Set default action to Export as Script Algorithm
otherwise the button tooltip is not shown
2019-09-30 09:48:30 +10:00
Nyall Dawson
e05572a11d Port file parameter definition widget to new APi 2019-07-08 15:07:42 +10:00
Nyall Dawson
b8e53dc012 Add missing visual links between layout and layout item parameters in models 2019-07-01 17:01:34 +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
5ec43cfdc1 [processing] Add project to QgsProcessingParameterWidgetContext 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
9f6ddaf5c5 Fix qt warning on modeler algorithm edit 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
63d648738d [processing][needs-docs] By default, hide algorithms with known issues from toolbox
And add a Processing setting to allow these to be shown. When shown, they
are highlighted in red with a tooltip explaining that the algorithm
has known issues
2019-03-06 06:33:06 +10:00
Nyall Dawson
c1cc2b53d9 Fix qt warning on opening modeler dialog 2019-03-05 14:44:02 +10:00
Nyall Dawson
723051b291 [processing] Fix initial zoom of models on hidpi displays
Fixes #16456
2019-03-05 14:44:02 +10:00
Nyall Dawson
8154008daf [processing] Fix items are not correctly placed in model designer
when view is not set to top-left of model scene
2019-03-05 14:44:02 +10:00
Nyall Dawson
30f786c129 [processing] Fix crashes and random behavior after dropping algorithms
to model designer

Also fixes drag and drop within the algorithm parameter dialog and
the qt warnings thrown during these operations
2019-03-05 14:44:02 +10:00
Nyall Dawson
dab4a04309 [processing] Draw arrows connected to selected/hovered components
slightly darker

Makes it easier to track connections in a complex model
2019-03-01 15:39:49 +10:00
Nyall Dawson
2178e1a71a [processing] Pre-highlight model components on hover 2019-03-01 15:39:49 +10:00
Nyall Dawson
93de4d15a6 [processing] Show tooltips in modeler when hovering over model component 2019-03-01 15:39:49 +10:00
Nyall Dawson
c1aac3228c [FEATURE][processing] Allow expression variables to be set for a model
This adds a new "Model Variables" dock panel to the model editor, allowing
users to create and set custom expression variables for use in the model.
These variables are available anywhere expressions are (correctly) evaluated
within the model, so can be used as input parameter values for child
algorithms, within data-defined dynamic parameters, etc.

The use case here is for models which use a constant value throughout
multiple steps within the model (e.g. @target_resolution: a target
raster resolution, @max_simplification: a simplification value for
input features coming from different sources, etc), allowing users
one single place to define and edit these constant values (instead
of hunting down and setting them in multiple places throughout the model).

These variables are stored within the model itself, and are not exposed
outside of the model designer dialog.
2019-02-23 05:23:23 +10:00
Nyall Dawson
521ebdc973 [processing] Wrappers built off old API can still take advantage of the full widget context 2019-02-20 05:39:04 +10:00
Nyall Dawson
eb335c3973 [processing] Set full context for QgsProcessingAlgorithmConfigurationWidget in modeler config dialogs 2019-02-20 05:39:04 +10:00
Juergen E. Fischer
92f5cb9a7e translation fix 2019-02-04 00:52:23 +01:00
Nyall Dawson
56e465cc8a [processing][needs-docs] Resurrect ability to convert models to scripts
Brings back QGIS 2.18's ability to directly convert a Processing model
to an equivalent Processing Python script algorithm, correctly
updated and working in the 3.x API.

Available from the model dialog, and from the right-click context
menu on an existing model.

Sponsored by Solspec
2019-02-01 17:54:28 +11:00
Nyall Dawson
f77cf4fae4 [processing] Formalise object design for ContextAction, allow icons to be set 2019-02-01 17:54:28 +11: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
Matthias Kuhn
9bdaac9dd0
Update python/plugins/processing/modeler/EditModelAction.py
Co-Authored-By: volaya <volayaf@gmail.com>
2019-01-24 10:50:19 +01:00
volaya
a86965e94b [processing] do not allow editing model if it's missing algorithms
fixes #19607
2019-01-23 14:02:42 +01:00
Mathieu Pellerin
6957009f8b [themes] Fix the processing modeler's rendering on dark backgrounds 2019-01-15 12:24:50 +07:00
Nyall Dawson
3a66b92522 [processing] Fix crash when running model through modeler dialog
Fixes #20676
2018-11-30 10:02:52 +10:00
Nyall Dawson
64bd9e5a5e [processing] Fix traceback when modeller parameter invalid value is detected 2018-11-26 16:41:44 +10:00
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