929 Commits

Author SHA1 Message Date
Nyall Dawson
414c3a4bfe Fix unavailable layer inputs for multi-layer inputs set to any map layer type 2018-02-11 11:00:49 +10:00
Nyall Dawson
4bcc9df5b4 [processing] Add explicit output type for multiple layers
This was a missing capability in the processing API - while algorithms
could declare multiple layer input parameters, there was no corresponding
multi-layer output. This meant that algorithms (such as Package Layers,
Vector Split) which create a set of layers which cannot be determined
in advance had no way to pass these generated layers on for further model
processing steps.

It's also useful for algorithms which operate on a specified folder,
processing all layers found there, and allowing these generated
outputs to be utilised in other model steps (e.g. packaging
all of them, merging them, etc)
2018-02-11 10:57:44 +10:00
Juergen E. Fischer
9302613f28 fix #18066 2018-02-09 09:38:04 +01:00
nirvn
bcb68dda54 [processing] fix batch input selection panel for multiple layers parameter 2018-02-09 14:05:26 +07:00
Alexander Bruy
23a5dd3197 [processing] fix file permissions 2018-02-06 19:25:48 +02:00
Denis Rouzaud
3205c96af6
Merge pull request #6275 from 3nids/messagelevel
unite QgsMessageLog::Level and QgsMessageBar::MessageLevel in Qgis::MessageLevel
2018-02-06 05:28:17 -09:00
Denis Rouzaud
3dc3d9d1b2 unite QgsMessageLog::Level and QgsMessageBar::MessageLevel in Qgis::MessageLevel
make enum items lower case
remove unused QgsMessageLog::None and All
2018-02-06 08:56:40 -04:00
Denis Rouzaud
9389be83c6 [processing] search also show children in config 2018-02-06 08:36:46 -04:00
Denis Rouzaud
3b17d5a784 processing search: also search in group items and fix return value 2018-02-05 09:31:57 -04:00
Nyall Dawson
c8d1d2d588 Fix hang in options search widget 2018-02-05 08:51:47 -04:00
Denis Rouzaud
8d55cadeb7 Allow adding custom highlight widget to custom pages in option 2018-02-05 08:51:47 -04:00
Alexander Bruy
aee3b44909 [processing] remove not needed trAction method 2018-02-05 08:49:41 +02:00
Alexander Bruy
862b1139fa [processing] move script provider stuff into provider directory 2018-02-05 08:49:29 +02:00
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