966 Commits

Author SHA1 Message Date
Alexander Bruy
87e55ba3c7 [processing] remove Get scripts and models functionality
Users should use Resource Sharing plugin instead
2018-02-04 11:11:47 +02:00
Salvatore Larosa
77163ba0ec [processing] fix toggle advanced mode button in batch panel (#6193) 2018-01-29 08:12:30 +01:00
Nyall Dawson
a05d941e4e [processing] Default to allowing background execution of algorithms
Since the underlying issues with the Python bindings are now fixed,
in most cases we can safely default to allowing an algorithm to
run in a background thread!!

So now we make this the default, and require individual algorithms
which are NOT thread safe to declare this. This includes algorithms
which directly manipulate the current project or layers (such as
setting layer styles), alter the selections in layers, or which
rely on 3rd party libraries (for now, SAGA and GRASS algorithms
are marked as not thread safe... TODO - someone more familiar with
these libraries can investigate and remove the flag if appropriate).

Also models are marked as non-thread safe. TODO: only flag an
individual model as thread-unsafe if any of its child algorithms
report this flag.
2018-01-29 17:37:05 +11:00
Salvatore Larosa
ebb725ec04 [processing] create widget correctly from wrapper when in batch mode 2018-01-28 22:11:51 +01:00
Salvatore Larosa
550c74e106 [processing] fix wrong getter 2018-01-28 21:31:18 +01:00
nirvn
6d5dce22f6 [processing] properly size toolbar button for provider actions 2018-01-26 13:11:24 +07:00
Salvatore Larosa
f4f89bbcbe [processing] resurrects matrix parameter 2018-01-25 21:54:22 +01:00
Mathieu Pellerin
34c2d32b3e
[processing] add actions when provider is registered / activated 2018-01-25 16:16:44 +07:00
Nyall Dawson
bf19eb6f35 [processing] Non-filed based outputs (e.g. postgis, geopackage)
options should be available for certain model outputs and script
algorithm outputs

We do this by swapping the test for non-file based output support
from checking only the algorithm's provider to instead checking
on a parameter-by-parameter basis.

This is done in order to support models. For models, depending
on what child algorithm a model output is based off, an individual
model may or may not have support for non-file based outputs. E.g
a model may generate outputs from a native qgis alg (supporting
these outputs) AND an output from a GDAL alg (with no support
for these outputs). In this case we need to enable or disable
the ui controls for non-file based outputs on an individual
output basis.

For scripts (for now) we blindly just say all outputs support
non-file based formats. This is going to be the case most of
the time, since scripts will usually be written using PyQGIS
API. For the exceptions (e.g. scripts which call other algs
like GDAL algs) we probably should add some way for the script
to indicate whether an individual output supports this, but
for now we just say they all do.

Fixes #17949
2018-01-25 15:47:42 +11:00
nirvn
746701bf33 [processing] add default extension to empty filter when available 2018-01-24 18:18:32 +07:00
Nyall Dawson
2013725793 Fix gui handling of NULL/None default values in processing script algorithms 2018-01-24 17:54:47 +11:00
Mathieu Pellerin
c5d9830db2
[needs-docs][processing] move providers actions into the processing
panel toolbar (#6150)
2018-01-24 13:24:44 +07:00
Nyall Dawson
54f9846eda Fix executing processing scripts through script editor 2018-01-24 15:53:33 +11:00
Nyall Dawson
63db1be890 [processing] Improve main window Toolbox action
Brings the behaviour into line with the styling dock, where
the action is checkable and checked only when the toolbox
is open AND user visible (i.e. not hidden behind another tab). If
the toolbox is open but hidden, then hitting the Toolbox action
brings it to the front tab.

Otherwise it's often necessary to hit to Toolbox shortcut twice -
once to close a hidden toolbox tab, and a second time to open
and raise it.
2018-01-24 11:38:07 +11:00
Alexander Bruy
d7e1813180 [processing] make items hidden after adding them to the view (fix #17881) 2018-01-23 10:00:28 +02:00
Nyall Dawson
40f09fab85 [processing] Fix creating tests when alg has optional outputs 2018-01-23 12:18:55 +11:00
Mathieu Pellerin
add40c1e22
[processing] use combined vector and raster filters for map layer file picker 2018-01-16 18:01:21 +07:00
Nyall Dawson
87c1986c4b Improved memory managment of algorithm dialogs
Ensure that dialogs are always correctly deleted when appropriate.

Also, if an algorithm is running in a background task and hits
an error, we automatically re-show the algorithm dialog and the
associated log for debugging.

Fixes #16858
2018-01-16 19:45:40 +10:00
Nyall Dawson
971aec8056 Rename QgsTaskManager::triggered to taskTriggered 2018-01-16 19:45:40 +10:00
Nyall Dawson
b8defc113c When processing tasks are clicked in task manager, reopen the
algorithm dialog
2018-01-16 19:45:40 +10:00
Nyall Dawson
240c52a4c0 [processing] Show a modal progress dialog when running algorithms
which cannot run in background tasks

This is not fantastic UX, but we have lots of constraints here:

- The algorithm dialog itself cannot be made modal. There's child
widgets (such as the point and extent parameter widgets) which
interact with the main QGIS window.
- There is no reliable way in Qt to make a dialog modal after
it's shown (e.g. make it modal only when the algorithm is
running). Trust me - I've tried everything, and all approaches
break with some corner case.
- For non-background algorithms, we must have processEvents calls
in order to show the algorithm feedback and progress to users,
and detect cancel button clicks. Yet these processEvents calls
means that users can interact with other parts of QGIS, e.g.
removing layers from a project, and other operations which
could cause the algorithm to crash. So we MUST have some modal
dialog in order to block interactions outside of allowing
the cancel button clicks/progress repainting.

I've tried many approaches, but this is the only one which
works reliably...
2018-01-10 08:33:36 +10:00
Nyall Dawson
c14e6ca772 Most c++ algorithms can run safely in background threads 2018-01-10 05:33:02 +10:00
Nyall Dawson
40e47e0fe7 [processing] Add flag to indicate whether an algorithm is safe
to run in a background thread
2018-01-10 05:33:02 +10:00
Nyall Dawson
e7e37efed7
Merge pull request #5926 from nyalldawson/proc_dialog
[processing] Add api to show algorithm dialog, use dialog for history
2017-12-27 22:34:13 +11:00
Mathieu Pellerin
3b8905209e
[processing] harmonize and improve UI spacing 2017-12-27 10:50:52 +07:00
Nyall Dawson
b25681cc43 [needs-docs][processing] Double clicking a history entry shows
the algorithm dialog instead of immediately executing same alg

This allows users to edit the parameters before re-running,
which is a more common user-operation (e.g. changing the
input layer, changing a parameter value "oops, that buffer
was a bit too big....").

If someone wants to exactly re-run the algorithm without changes
it's only one extra click anyway...
2017-12-21 11:01:56 +10:00
Nyall Dawson
ce28cf5087 Save algorithm results to dialog 2017-12-21 10:38:38 +10:00
Nyall Dawson
edcd058e32 [processing] Add a setParameters method to AlgorithmDialog
Allows pre-populating the dialog with non-default parameter
values.
2017-12-21 10:22:19 +10:00
Nyall Dawson
595b9812ce [processing] Implement a todo (set layer param's wrapper values) 2017-12-21 10:04:54 +10:00
Alexander Bruy
e9feeaacc6
Merge pull request #5875 from alexbruy/processing-editor
[FEATURE][processing][needs-docs] add find and replace functionality to script editor
2017-12-15 13:21:41 +02:00
Alexander Bruy
5016c21ed3 [FEATURE][processing][needs-docs] add find and replace functionality to
Processing script editor (forward-port from 2.18 branch)
2017-12-15 11:07:15 +02:00
Nyall Dawson
bbf00279ad [processing] Don't sort field names in multi-field input dialog
Field names should always be listed in the order that the layer
defines them
2017-12-15 08:58:54 +11:00
volaya
ea49c8276c [processing] Set value of unused optional layer parameters to None instead of empty string 2017-12-13 14:39:12 +01:00
volaya
0858652e84 [Processing] correctly report missing layers in postprocessing task 2017-12-13 14:39:10 +01:00
Alexander Bruy
79d83f2066 [processing] use core methods for raster and vector extensions handling 2017-12-11 09:38:14 +02:00
Nyall Dawson
1625d1fa2c Disable direct parameter value input when data defined override is set 2017-12-02 11:17:19 +10:00
Nyall Dawson
58ab507717 Fix failing test 2017-12-02 11:17:18 +10:00
Nyall Dawson
901dae1110 [processing] Expose data defined button for dynamic numeric parameters
When running algorithms through the toolbox, which have dynamic
numeric parameters, add a data defined property override button
next to the widget so that users can set the overrides for these
parameters.

Previously this was available only in the backend, but not
exposed anywhere in the GUI.

Note that currently no algorithms support dynamic parameters,
so don't expect to see this everywhere. It's also only available
in toolbox/batch processing modes, not in models.
2017-12-02 11:17:18 +10:00
Nyall Dawson
1c1de3a88b [processing] Fix optional numeric parameters cannot be cleared
Without this change optional numeric parameters have no way to
be cleared in the GUI - they are always forced to have a value

Fixes #17471 - but I've noticed that many optional numeric
GRASS parameters have a non-null default value. These may
need to be investigated and manually changed to None defaults
in the description files.
2017-12-01 20:42:38 +11:00
Nyall Dawson
6b56565f89 Show nicer tooltips for numeric processing parameters
With min/max and default values (when set)
2017-12-01 20:42:38 +11:00
Nyall Dawson
8303b94685 [processing] Fix optional layer parameters are filled by default
Refs #17471

Not a full fix for 17471 - that requires handling of optional
numeric values too
2017-12-01 20:42:38 +11:00
Nyall Dawson
f6e63d7f4c Fixes and cleanups to algorithm dialogs 2017-12-01 18:15:40 +11:00
Nyall Dawson
ce170918c9 Start moving processing algorithm dialog to c++
In an attempt to avoid Python global interpreter locks which
block the UI thread.
2017-12-01 18:15:40 +11:00
Nyall Dawson
c12770d041 Indentation 2017-12-01 10:00:42 +11:00
Nyall Dawson
e1ce7dda70 Show algorithm ID in tooltip in toolbox 2017-12-01 10:00:42 +11:00
Alexander Bruy
d65c036781 [processing] remove old params from wrappers 2017-11-28 12:27:45 +02:00
Alexander Bruy
3d4a59bb8b [processing] cleanup files from unused code and remove some files 2017-11-28 12:27:45 +02:00
Alexander Bruy
0059b2b692 [processing] remove Python 2 compatibility layer 2017-11-28 12:27:45 +02:00
Nyall Dawson
c0e732b799 [processing] Add QGIS 3d provider
Adds a new QGIS processing provider for 3d algorithms, available
only when QGIS is built WITH_3D

Currently includes only a single algorithm for tesselating geometries,
which exposes the functionality of QgsTesselator to processing.

Like the native c++ algorithm provider, algorithms in the 3d
provider are transparently merged with the other QGIS providers
(i.e. they aren't separated into their own group)
2017-11-27 06:54:29 +11:00
Nyall Dawson
bb63a83e04 Add missing output from package algorithm 2017-11-27 06:38:21 +11:00