29 Commits

Author SHA1 Message Date
Nyall Dawson
835cca7cae [processing] More string HIG fixes 2018-02-22 06:44:17 +11:00
Juergen E. Fischer
6dfedc38e9 translation string fixes and cleanups 2018-02-15 22:31:15 +01:00
Nyall Dawson
66b9b435b6 [processing] Fix destination files are silently ignored when relaunching
algorithms from the history panel
2018-02-13 14:24:48 +10:00
Alexander Bruy
23a5dd3197 [processing] fix file permissions 2018-02-06 19:25:48 +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
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
Alexander Bruy
0059b2b692 [processing] remove Python 2 compatibility layer 2017-11-28 12:27:45 +02:00
Nyall Dawson
aca22663d0 [processing] Change save as spatialite option to save as GeoPackage
Since it's much more useful. Also add a prompt for layer name, so that
you can save the results of an algorithm into an existing geopackage
without wiping existing layers.
2017-11-24 09:31:50 +10:00
Nyall Dawson
b97c6a8d88 Use native file picker for spatialite export option also 2017-11-22 05:26:34 +10:00
Nyall Dawson
31086d3ac5 [processing] Move destination encoding option to separate menu action
...instead of embedding in output destination file selector. Otherwise
Qt downgrades the file picker to the Qt basic file picker, instead of
the native OS file picker. Which is a huge downgrade and barely
functional for users.

Also remember last selected file format
2017-11-21 21:24:18 +10:00
Nyall Dawson
612f51601a [processing] Remove expression buttons from parameters outside modeler
Since these expressions were only evaluated immediately, it led to
confusing behavior for users who were expecting that the expression
would be applied per-feature.

Given that expressions can be directly entered into spin boxes, we already
have a way of users evaluating simple calculations for numeric
parameters at least.

I don't think there's a strong enough use case for needing to
calculate string results to leave the confusing expression builder
option in place.

This should be re-evaluated when we add UI support for dynamic
parameters (which are already supported in the backend), where
expressions are evaluated per-feature.

Fixes #17267
2017-11-10 10:42:25 +10:00
Médéric RIBREUX
4b8b6a09c8 Massive conversion 2017-11-04 15:31:21 +01:00
Nyall Dawson
1342f4d9ac Add API to set optional destination parameters as not created by default
This allows optional outputs (such as null geometry features detected
by the Remove Null Geometries algorithm) to be skipped by default
when desirable.
2017-07-16 18:19:24 +10:00
Nyall Dawson
9d04f87249 Rename "output" style parameters for clarity
The previous naming was too easily confused with processing outputs.
Rename them to QgsProcessingParameterFileDestination, etc... to
make it clearer what they are used for.
2017-07-08 20:49:17 +10:00
Matthias Kuhn
875a5d6d9d Merge pull request #4818 from DelazJ/spelling
Fix some spelling issues
2017-07-08 10:20:40 +02:00
Nyall Dawson
e0915103fd Fix folder destinations always default to temp folder (fix #16800) 2017-07-07 17:02:19 +10:00
Harrissou Sant-anna
6fab688298 Use SpatiaLite right spelling when needed 2017-07-07 01:26:38 +02:00
Nyall Dawson
1e5d773e57 Fix use of temporary files for outputs 2017-06-27 13:18:22 +10:00
Nyall Dawson
9d8118c995 Fix dest selection panel when used in folder mode
Also fix some UX issues with the panel in folder, such as
correctly remembering/restoring last used folders, defaulting
to home dir, don't clear value when canceling while browsing
2017-06-22 18:21:51 +10:00
Nyall Dawson
e49cc78674 Make html output in basic stats algorithm optional 2017-06-12 07:26:02 +10:00
Nyall Dawson
6b55300fbc If a feature sink parameter is optional and not set, don't create the sink
This adds a lot of flexibility to algorithms, as it makes output
sinks truely optional. For instance, the various "Extract by..."
algorithms could add a new optional sink for features which
'fail' the extraction criteria. This effectively allows these
algorithms to become feature 'routers', directing features onto
other parts of a model depending on whether they pass or fail
the test.

But in this situation we don't always care about these failing
features, and we don't want to force them to always be fetched
from the provider. By making the outputs truely optional,
the algorithm can tweak its logic to either fetch all features
and send them to the correct output, or only fetch
matching features from the provider in the first place (a big
speed boost).
2017-06-09 14:22:29 +10:00
Nyall Dawson
9038872200 Fix warning 2017-06-06 15:43:19 +10:00
Nyall Dawson
b75a174780 Rename QgsProcessingFeatureSinkDefinition to QgsProcessingOutputLayerDefinition
Since it also applies to raster layer outputs, we need a more generic name
2017-06-06 13:43:55 +10:00
Nyall Dawson
39d20a4cb4 Move algorithm expression context generation to QgsProcessingAlgorithm
Fix error when selecting "from expression" in algorithm parameter dialog
2017-06-06 11:25:09 +10:00
Nyall Dawson
607fed8c48 Restore ability to save outputs directly to Spatialite/PostGIS providers 2017-06-06 10:34:57 +10:00
Nyall Dawson
5e92c0dbf4 Fix saving processing outputs with correct encoding 2017-06-06 09:51:49 +10:00
Nyall Dawson
7683b25f81 Move getFileFilter from params to gui wrappers 2017-06-06 07:41:20 +10:00
Nyall Dawson
6517470ddd Temporarily fix memory layer outputs 2017-06-06 07:41:19 +10:00
Nyall Dawson
f1c53c3aa4 Refactor Algorithm setParamValues -> getParamValues
Now returns a dict of parameter inputs for the algorithm
2017-06-06 07:41:19 +10:00