159 Commits

Author SHA1 Message Date
Nyall Dawson
61454c67cd [processing] Add api to allow providers to report warnings which should
be shown to users when using that provider

This can be used to return a translated warning message which should be
shown to users of this provider. It's intended for use in cases such as
a provider which relies on a 3rd-party backend, where the version of the
backend software is not officially supported, or for alerting users to
providers in a "beta" or "untrustworthy" state.
2019-12-06 17:35:41 +10:00
Bas Couwenberg
2628c480c5 Don't include revision in sources.
Prevent changes to files that weren't changed between releases.
This eases review of the changes between releases significantly.
2019-05-17 16:47:47 +02:00
Nyall Dawson
933559b655 [processing] Report provider version string alongside QGIS version in log
Helpful for debugging and reproducability of results
2019-04-08 16:59:15 +10:00
Nyall Dawson
7674e1657b [processing] Include version information at start of log
Start the log text with QGIS/Qt/GEOS/GDAL version information strings.
This is helpful for debugging and accountability.
2019-04-02 06:16:45 +10:00
Rashad Kanavath
46da10a1e8 Revert "fixes #21374: ignore optional output parameters"
This reverts commit af2421541c78742a233b3c5a00cbbd6c11ceaaab.
2019-03-21 04:44:59 +10:00
Rashad Kanavath
f6ad4745bd fixes #21374: ignore optional output parameters 2019-03-21 04:44:59 +10:00
Víctor Olaya
13bff9620c [processing] do not allow using unsupported file formats
Show warning message if user selects incompatible output file format

fixes #21089
2019-02-23 05:24:56 +10:00
Nyall Dawson
7acfefadad Fix infinite progress when an algorithm could not be created 2019-02-20 13:05:13 +10:00
Nyall Dawson
29fa7b6e7b Fix build, indentation 2019-02-13 07:59:30 +10:00
volaya
eb47288fac [processing] correctly set output styles for models
fixes #20573
2019-01-23 08:02:19 +01:00
Nyall Dawson
f10b62c380 [processing] Fix crash on closing batch processing dialog
Refs #20650
2018-11-29 10:57:07 +10:00
Nyall Dawson
2c425c7bf0 Fix unit test 2018-11-23 20:32:16 +11:00
Nyall Dawson
2617fd56f7 Fix context going out of scope 2018-11-23 20:32:16 +11:00
Nyall Dawson
6fff62e668 Fix confusing override of accept method for non-dialog acceptance 2018-11-23 20:32:16 +11:00
Alessandro Pasotti
cdf5bb630f Fix test 2018-10-05 11:03:49 +02:00
Alessandro Pasotti
29c4970f8a [processing] In-place add layer name to dlg title and store active layer 2018-10-05 10:10:20 +02:00
Alessandro Pasotti
0782b9d869 Dynamically change button text for in-place editing
The button title changes if there are selected features
2018-10-05 09:21:28 +02:00
Nyall Dawson
6d1a9295f7 Use correct stylesheet for processing dialogs 2018-09-26 04:26:27 +10:00
Alessandro Pasotti
c7ac4fe7fd Fix widget (broken by rebase) 2018-09-14 18:23:03 +10:00
Alessandro Pasotti
4549ee5fff In-place moved check logic into QgsAlgorithm
+ new tests
+ fixed fixer function
+ drop z/m
2018-09-14 18:23:03 +10:00
Nyall Dawson
681d44f11f Messy mockup of feature 2018-09-14 18:23:03 +10:00
Nyall Dawson
3c2499ba95 Add some notes on deprecated class handling 2018-09-04 19:06:07 +10:00
Nyall Dawson
8082497724 Fix evaluation of Python wrapper values 2018-09-04 19:06:07 +10:00
Nyall Dawson
70c1680754 Automatically handle adding data defined button for dynamic properties
Also exposes this capability to modeler - so that model algorithms
can use data defined parameters within their child algorithms.

TODO:
- tests
- setting the associated vector layer
2018-09-04 19:06:07 +10:00
Nyall Dawson
644ef6a752 [processing] Initial work on porting base GUI classes to c++
- Add abstract base class for Processing widget wrappers to c++
- Add wrapper factory interface to c++
- Make QgsProcessingGuiRegistry also register widget wrapper
factories, and be responsible for creation of new c++
processing widget wrapper instances
- Start on private c++ implementation of boolean widget wrapper,
including unit tests
2018-09-04 19:06:07 +10:00
Juergen E. Fischer
1cc1f16501 Fix translation string
(caused "tx ERROR: Error received from server: Qt Linguist variants are
not yet supported." on vanish)
2018-08-22 10:40:23 +02:00
nirvn
94300eab7c Add proxy progress task for non-background algorithms 2018-08-16 06:22:16 +10:00
Nyall Dawson
6c014b46ba [processing] Use c++ recent algorithm log, remove python log
Indirectly fixes #19218
2018-07-05 02:37:03 +10:00
Martin Dobias
80b0c72c50 Fix a Python error in Processing GUI
It turns out that an empty QComboBox evaluates to False:

>>> t=QLineEdit()
>>> bool(t)
True
>>> c=QComboBox()
>>> bool(c)
False

Due to that, the 'TABLE' parameter was missing if its (editable) combo box was empty.

Original error - while updating an algorithm's parameters (gdal:importvectorintopostgisdatabaseavailableconnections)

Traceback (most recent call last):
  File "/home/martin/qgis/git-master/build-debug/output/python/plugins/processing/algs/gdal/GdalAlgorithmDialog.py", line 121, in parametersHaveChanged
    or (not p.checkValueIsAcceptable(parameters[p.name()])):
KeyError: 'TABLE'
2018-06-22 13:30:26 +02:00
Nyall Dawson
870d20740c [processing] Tweaks and checks for checkParameterValues 2018-05-28 16:02:38 +10:00
arnaud.morvan@camptocamp.com
81dabd185c [processing] Finish default values in model for destination parameters 2018-05-14 22:12:32 +10:00
arnaud.morvan@camptocamp.com
4ccd4446fe [processing] Add default values in model for destination parameters 2018-05-14 22:12:32 +10:00
Nyall Dawson
c32611b2c4 [processing] Remove unused code 2018-05-02 04:55:01 +10:00
Nyall Dawson
6358daad91 Fix broken translation string 2018-04-20 20:08:28 +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
Ari Jolma
b0cd3fb5f0 Translate strings before making changes to them. 2018-03-09 18:10:23 +11:00
Juergen E. Fischer
6dfedc38e9 translation string fixes and cleanups 2018-02-15 22:31:15 +01:00
nirvn
e5d7733bfc [processing] harmonize order of result panel (latest first) and add timestamp 2018-02-12 13:51:31 +07: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
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
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
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
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