200 Commits

Author SHA1 Message Date
Alexander Bruy
8d69dc1fb6 indentation 2018-02-23 11:43:32 +02:00
Alexander Bruy
a554409ede [processing] don't use scandir() to get directory contents (fix #18180) 2018-02-23 10:30:03 +02:00
Juergen E. Fischer
9a3bfa01c2 fix translation strings 2018-02-22 00:37:48 +01:00
Nyall Dawson
835cca7cae [processing] More string HIG fixes 2018-02-22 06:44:17 +11:00
Nyall Dawson
277e06ec28 [processing] Fix some message box titles 2018-02-22 06:44:17 +11:00
Juergen E. Fischer
dcfe5ca63f update translation strings 2018-02-18 17:35:34 +01:00
Salvatore Larosa
a8a449f8c1 [processing] fix variable name 2018-02-17 16:50:43 +01: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
Alexander Bruy
4f2a4644db [processing] remove obsolete code and disable exporting models as script
until we update it so support new scripts format
2018-02-05 08:50:44 +02:00
Alexander Bruy
fa5ab81a2a [processing] scripts also can be feature-based algorithms 2018-02-05 08:50:37 +02:00
Alexander Bruy
cd7bb16ad5 [processing] class name is not needed anymore to load scripts 2018-02-05 08:50:37 +02:00
Alexander Bruy
f5f0399171 [processing] use custom editor class, as QgsCodeEditor is not available
on some platforms
2018-02-05 08:50:37 +02:00
Alexander Bruy
e1a64f6a8f [processing] remove unused files 2018-02-05 08:50:37 +02:00
Alexander Bruy
724390c7df [processing] completely restore support for script execution from editor 2018-02-05 08:50:37 +02:00
Alexander Bruy
263702e1f0 [processing] ressurect script execution from editor (work in progress) 2018-02-05 08:50:37 +02:00
Alexander Bruy
53ff800ff8 [processing] temporarily disable fetch actions for scripts and models 2018-02-05 08:50:37 +02:00
Alexander Bruy
472b8bf6bf [processing] ressurect 'new script' action 2018-02-05 08:49:59 +02:00
Alexander Bruy
7115e044e3 [processing] ressurect 'add from file' action 2018-02-05 08:49:59 +02:00
Alexander Bruy
b747a6b50c [processing] ressurect delete and edit actions for scripts 2018-02-05 08:49:59 +02:00
Alexander Bruy
422d804db1 [processing] update script provider to use QgsProcessingAlgorithm
subclasses instead of custom script code
2018-02-05 08:49:59 +02: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
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
Nyall Dawson
54f9846eda Fix executing processing scripts through script editor 2018-01-24 15:53:33 +11:00
Alexander Bruy
0ffd993d02 [processing] update script collection metadata and homogenize quotes 2018-01-15 11:59:01 +02:00
Alexander Bruy
d58053d486 [processing] restore script collection creator (fix #17649) 2017-12-27 11:41:08 +02:00
Alexander Bruy
2674022b6c [processing] add group id to scripts 2017-12-14 18:10:35 +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
f6600f23aa Port raster relief alg to new API 2017-08-19 00:01:58 +10:00
Nyall Dawson
1e13d733c2 Move declaration of algorithm parameters/outputs to a new virtual
initAlgorithm() method

This allows 2 benefits:
- algorithms can be subclassed and have subclasses add additional
parameters/outputs to the algorithm. With the previous approach
of declaring parameters/outputs in the constructor, it's not
possible to call virtual methods to add additional parameters/
outputs (since you can't call virtual methods from a constructor).

- initAlgorithm takes a variant map argument, allowing the algorithm
to dynamically adjust its declared parameters and outputs according
to this configuration map. This potentially allows model algorithms which
can be configured to have variable numbers of parameters and
outputs at run time. E.g. a "router" algorithm which directs
features to one of any number of output sinks depending on some
user configured criteria.
2017-07-10 16:31:14 +10:00
Nyall Dawson
03275bbace Split QgsProcessingAlgorithm::create into non virtual-create
and pure virtual createInstance

Allows us to add logic which always need applying within
create(), leaving createInstance() free to just return a
raw new instance of the class
2017-07-10 10:07:32 +10:00
Nyall Dawson
8a84e134cc Algorithms don't have to be split to prepare/process/postProcess
Since it's safe to evaluate parameters in background threads
now, it's usually going to be ok to evaluate everything in
the processAlgorithm step.

This keeps the algorithm code as simple as possible, and will
make porting faster.

Note that the prepare/postProcess virtual methods still exist
and can be used when an algorithm MUST do setup/cleanup work
in the main thread.
2017-07-07 09:28:19 +10:00
Nyall Dawson
6654aec6a5 Fix execution of script algorithms was not releasing layers/sinks 2017-07-07 09:28:19 +10:00
Nyall Dawson
e0c7daa2d8 Rename QgsProcessingAlgorithm::clone to ::create
Since it better describes what the function does. It returns a new
pristine copy of the algorithm, not a clone of its current state
2017-07-07 09:27:35 +10:00
Nyall Dawson
cd7776ca1c Upgrade ported python algs to be thread ready 2017-07-07 09:27:35 +10:00
Nyall Dawson
5c4f64270d Add clone method to ScriptAlgorithm 2017-07-07 09:26:17 +10:00
Nyall Dawson
d49114cfc1 Correct parameter evaluation for multiple field types 2017-06-27 08:33:13 +10:00
Nyall Dawson
a72eea2256 Fix auto creation of variables when running script algorithms 2017-06-27 08:33:13 +10:00
Nyall Dawson
3bf9ea3682 Restore ability to run script algorithms 2017-06-27 08:33:13 +10:00
Nyall Dawson
f13920bb19 First steps in resurrecting script algorithms 2017-06-27 08:33:13 +10:00
Nyall Dawson
2d2c229332 Port checkInputCRS to c++, and allow algorithms to flag when they
require all input layers to be in the same CRS

The default behaviour is to assume that algorithms are well behaved
and can handle multi-CRS inputs, but algs have the option to
flag that they do not allow this and require the input CRS check.

Those algs should document that they require all inputs to have
matching CRS - processing 3.0 behaviour is to assume that algs
can handle this.
2017-06-12 07:26:02 +10:00
Alexander Bruy
a137a7c0f3 [processing] open help in the default webbrowser to be consistent with
the rest of QGIS dialogs
2017-06-06 10:51:22 +03:00
Nyall Dawson
0c3ad14c79 Adapt more python code to new API 2017-06-06 07:41:19 +10:00
Nyall Dawson
4cb7d18b1c Push parameters into processAlgorithm and related functions 2017-06-06 07:41:19 +10:00
Nyall Dawson
2d1579d28a Port algorithm help to QgsProcessingAlgorithm 2017-06-06 07:41:19 +10:00
Nyall Dawson
fac8ca4d4f Move execution check to QgsProcessingAlgorithm 2017-06-06 07:41:19 +10:00
Nyall Dawson
03e40f7497 [processing] Remove all remaining algorithm copies
Algorithms are no longer copied - just a single const instance
of each algorithm is used
2017-06-06 07:41:19 +10:00
Juergen E. Fischer
b29a10eeb7 hub.qgis.org moved to issues.qgis.org 2017-04-29 23:34:27 +02:00