979 Commits

Author SHA1 Message Date
Harrissou Sant-anna
8088659c43 More details on Processing algorithms toolbar 2018-05-01 17:58:01 +10:00
nirvn
fca5238847 [processing] replace define current projection with reproject layer in vector menu 2018-04-30 16:50:34 +07:00
Nyall Dawson
cad0f3d5b7 [processing] Throw warning when menu item links are broken 2018-04-30 16:07:13 +10:00
nirvn
f8a3de45bf [processing] fix some native algorithm IDs for menu items 2018-04-30 12:39:02 +07:00
Nyall Dawson
6358daad91 Fix broken translation string 2018-04-20 20:08:28 +10:00
Nyall Dawson
0dfb3c2d8c [processing] Use distance parameter for more algorithms 2018-04-20 18:27:00 +10:00
Nyall Dawson
6412138259 Indentation 2018-04-20 18:27:00 +10:00
Nyall Dawson
6a2625664e [processing] Add dedicated "distance" parameter
This is a subclass of QgsProcessingParameterNumber, but specifically
for numeric parameters which represent distances. It is linked
to a parent parameter, from which the distance unit will
be determined, and is shown using a dedicated distance widget
within the processing parameters panel. This widget shows
the distance unit.

This avoids the confusion when running algorithms which
use distances where the unit depends on a layer or CRS parameter -
e.g. the distance parameter in the buffer algorithm gives
the distance in layer units... so now we can show those units
directly within the dialog. Hopefully this leads to less
user confusion and accidental "1000 degree buffers"!

Additionally - if the unit is in degrees, a small warning
icon is shown next to the parameter. The tooltip for this
icon advises users to reproject data into a suitable
projected local coordinate system.

Initially implemented for the native buffer and single
sided buffer algorithm only - but more will be added.

Fixes #16290
2018-04-20 18:27:00 +10:00
Nyall Dawson
a9d820d37d [processing] Don't overwrite rows when reordering in multi input
dialog

Refs #17327
2018-04-19 14:35:41 +10:00
Nyall Dawson
ccccad54c0 [processing] Fix exception in processing.run when feedback
object is not specified
2018-04-09 09:18:04 +10:00
Nyall Dawson
ebab649438 Fix some locator filters show results when no string is entered
and filter prefix is not used
2018-04-06 12:44:56 +10:00
Nyall Dawson
08d30c3b9f [processing] Add method for algorithms to preprocess parameter values
Allows algorithms to pre-processes a set of parameters, allowing the
algorithm to clean their values.

This method is automatically called after users enter parameters, e.g.
via the algorithm dialog. This method should NOT be called manually
by algorithms.
2018-04-03 18:36:39 +10:00
Rashad Kanavath
3408e02c46 [processing] create and manage label in WidgetWrapper
ModelerParametersDialog and ParametersPanel have to keep list of
wrappers only. widget and label( if needed) are created through
WidgetWrapper.createLabel()
2018-04-03 06:09:44 +10:00
Nyall Dawson
e0255b305d [processing] Fix intersect always selected in Join by Location in modeler
Fixes #18489
2018-03-21 09:19:34 +11:00
Nyall Dawson
d907ba05fc [processing] Expand 'algorithm' group in history on load
Since all the useful stuff is in that group, you ALWAYS need
to expand it anyway!
2018-03-15 16:57:31 +10:00
Nyall Dawson
bd1d87ed86 [processing] Allow algorithms to set layer post-processors for
execution on generated layers after the algorithm (or parent
model) completes

This commit adds an interface for layer post-processing handlers
for execution following a processing algorithm operation.

Post-processing of a layer will ONLY occur if that layer is set
to be loaded into a QGIS project on algorithm completion.

Algorithms that wish to set post-processing steps for generated
layers should implement this interface in a separate class
(NOT the algorithm class itself!) and implement a method
to handle the layer post-processing.

This method always runs in the main thread and can be used to
setup renderers, editor widgets, metadata, etc for the given layer.

Fixes #17961
2018-03-15 17:55:25 +11:00
Nyall Dawson
654a4a4af6 [processing] Fix algorithm progress bar resets to 0 when an algorithm
reports a non-fatal error

Fixes the "flashy" progress bar when an algorithm encounters a lot
of errors.
2018-03-15 13:43:01 +11:00
Nyall Dawson
f06b3691c5 More spelling fixes 2018-03-12 14:32:17 +11:00
Juergen E. Fischer
e1ad1cb473 more translation string fixes 2018-03-10 12:23:45 +01:00
Alexander Bruy
7eb7e9361e Revert "[processing] replace QCoreApplication.translate() with tr() in"
This reverts commit 007903494582b1e71273e7b801b928d32eb2f330.
2018-03-09 18:31:10 +02:00
Alexander Bruy
0079034945 [processing] replace QCoreApplication.translate() with tr() in
ParametersPanel class
2018-03-09 14:57:37 +02:00
Ari Jolma
b0cd3fb5f0 Translate strings before making changes to them. 2018-03-09 18:10:23 +11:00
Nyall Dawson
4e182be4ec [processing] Fix 'selected features' checkbox is incorrectly disabled
Fixes #18278
2018-03-01 15:29:06 +10:00
Nyall Dawson
b17a5560b8
Merge pull request #6486 from nyalldawson/dynamic
[processing] Support dynamic properties for all native c++ algorithms
2018-03-01 10:40:25 +11:00
Nyall Dawson
98b902bdc0
Merge pull request #6472 from DelazJ/algShortcuts
Fix list of algorithms shortcut in vector and raster menus
2018-02-27 12:15:00 +11:00
Nyall Dawson
81d53644eb [processing] Fix restoring parameter values from batch panel load button
Fixes #18236
2018-02-27 11:58:50 +11:00
Nyall Dawson
6e44a27764 [processing] Fix exception when parameters are missing in batch dialog
Refs #18236
2018-02-27 11:58:50 +11:00
Harrissou Sant-anna
4c32a01bde
Fix list of algorithms shortcut in vector and raster menus
Fix #18175
2018-02-26 20:14:12 +01:00
Nyall Dawson
7f9274350a [processing] Fix expection when double clicking alg in history with dynamic property 2018-02-26 13:40:05 +10:00
Alexander Bruy
673421b00d
Merge pull request #6423 from nyalldawson/proc_auto_select_alg
[processing] Some toolbox ux tweaks
2018-02-23 08:38:22 +02:00
Nyall Dawson
75a9150a41 [processing] Fix config exception with INT/FLOAT settings
Fixes #18179
2018-02-23 10:43:30 +10:00
Nyall Dawson
62cd1edbb3 [processing] Pressing enter in search box executes the selected algorithm 2018-02-23 08:27:40 +10:00
Nyall Dawson
82bfc407b8 [processing] When searching in toolbox, automatically select
the first visible algorithm if the previously selected item
was hidden

Avoids hidden selections in the toolbox
2018-02-23 08:26:47 +10: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
nirvn
6573eb30e7 [processing] small fix in the MultipleLayerWidgetWrapper wrapper 2018-02-21 12:00:32 +07:00
Nyall Dawson
fdebddd13a [processing] Fix raster layers shown as inputs for certain vector algs
Fixes #18148, #18149
2018-02-20 10:03:27 +11:00
Juergen E. Fischer
2c53630747 add missing copyright headers 2018-02-18 20:53:40 +01:00
Nyall Dawson
a6a36acc14
Merge pull request #6316 from nyalldawson/locator_thread
Make QgsLocator more thread safe
2018-02-16 12:36:09 +11:00
Juergen E. Fischer
6dfedc38e9 translation string fixes and cleanups 2018-02-15 22:31:15 +01:00
nirvn
4aef3b719f [processing] fix python error with OSM vector layers 2018-02-15 15:56:53 +07:00
Nyall Dawson
46dc2f6e5b [processing] Avoid losing static, user-entered parameter values
in model child algorithms

Prior to this change if you edited an algorithm in a model and
tried to enter a preset string for certain parameter types, this
string would get silently discarded on closing the dialog. E.g.
with a dissolve algorithm it was not possible to have a fixed
field name within the model to dissolve by.

This was caused by WidgetWrapper.comboValue  returning the customData
for these manually entered values in the parameters combo box,
yet manually entered values never have custom data.

To work around this we only return the custom data if its
set for the selected item - otherwise we return the text unchanged.
In order to handle the "[not set]" options, a new static custom
data value of WidgetWrapper.NOT_SET_OPTION is added to that
comboValue can detect this and return the appropriate None value.
2018-02-15 17:45:19 +11:00
Nyall Dawson
8ceb6fc007 [processing] In batch dialog, use layer names for input layers
if they are unique in the current project

Instead of always using the layer id, which is generally
gibberish and meaningless for users, instead prefer to use
the layer name as an input in the batch processing dialog. This
is done only if the name is unique within the current project's
loaded layers.

This change makes the dialog more user-friendly, but more importantly
it means that autofilling output values based on an input layer
parameter generates more meaningful automatic output file names.
2018-02-14 16:46:26 +10: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
nirvn
4ada4989e5 [processing] automatically open results viewer panel when items added 2018-02-12 18:09:38 +07:00
nirvn
207a94738d [processing] offer hyperlink to file path in the results viewer
because users don't always get that there is a dbl-click action
against the tree view items.
2018-02-12 18:09:38 +07:00
Nyall Dawson
7609ab7c9d Allow certain locator filters to operate on the main thread
Some filters are fast enough to return results that it's overkill
to run them in a background thread - add a flag to these filters
to allow them to run (blocking) in the main thread instead.
2018-02-12 20:28:32 +10:00
Nyall Dawson
d5e649292d Fix error when running gdal algorithms through locator 2018-02-12 20:28:32 +10:00
Nyall Dawson
981afb3da1 Make QgsLocator more thread safe
- add a clone() method to filters, and always search using the
clone instead of the original filter
- add a prepare() method to filters, which is always run in the
main thread and can be used to prepare the filter for safe
background execution (e.g. creating feature iterators in advance)
- don't use QtConcurrent to perform searches in background threads,
since it is not safe to use with QObjects
- instead manually create threads and ensure that cloned objects
are always moved to the thread that they will run in, to ensure
that they correctly have thread affinity with the thread in which
they are executed
2018-02-12 20:26:26 +10:00
nirvn
e5d7733bfc [processing] harmonize order of result panel (latest first) and add timestamp 2018-02-12 13:51:31 +07:00