52 Commits

Author SHA1 Message Date
Panos Mavrogiorgos
d8b0cdacb7 Make setting "Grass7AlgorithProvider.activateSetting" optional.
This change makes it easier to subclass `Grass7AlgorithProvider` which
allows e.g. to expose GRASS Addons as QGIS plugins.

Disclaimer: `Grass7AlgorithProvider` is a private API and it may change
            without warning. 3rd parties that rely on this should expect
            that their code will break in future releases.
            For more info please check the comments at #30252

Nevertheless, it currently is possible to subclass with something like this:

    class CustomGrassBasedProvider(Grass7AlgorithmProvider):
        # Set descriptionFolder to our own description directory
        descriptionFolder = os.path.join(os.path.dirname(__file__), 'description')

        # 3rd party plugins don't need an activation/deactivation setting
        activateSetting = None

        # define the rest of the methods that are needed (e.g. name(), id() etc)
        # ...

Fixes #30241
Continues #9202
2019-06-29 09:51:13 +10:00
Panos Mavrogiorgos
03f1ae9576 Stop hardcoding activation setting name in Grass7AlgorithmProvider 2019-06-29 09:51:13 +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
Panos Mavrogiorgos
1d8bd004a6 [grass7] Make it easier to subclass "Grass7AlgorithmProvider"
After @Nyalldawson suggestion [1], we've implemented a Processing plugin
that exposes a GRASS Addon [2]. In order to do this we had to subclass
`Grass7AlgorithmProvider` and override `createAlgsList()`.

`createAlgsList()` had to be overriden in order to change the
"description folder" location.

Nyall wrote:

> And if you do it right (and only import existing
> processing grass code, minimising the copy/paste of this code), then
> your provider will automatically inherit any future fixes and
> features added to the main grass provider.

With this commit we convert the `descriptionFolder` to a class attribute
and in this way, subclasses of `Grass7AlgorithmProvider` will no longer
have to override `createAlgsList()` and will be able to continue inheriting
future enhancements.

References:

1. https://lists.osgeo.org/pipermail/qgis-developer/2019-February/056155.html
2. 948820b1c0/estimap_recreation_provider.py (L40-59)
2019-02-20 05:41:47 +10:00
lbartoletti
2e92dabd20 [Processing][Grass] Add the possibility to return a shp if ogr is not compiled with gpkg 2019-01-31 09:55:29 +11:00
Jon McCormack
9493f55117 fix processing plugin error when grass7 disabled 2018-12-10 10:02:09 +10:00
Juergen E. Fischer
3a4a3af1d6 osgeo4w:
* only use GRASS major version in executable names
* autodetect GRASS folder
2018-11-10 21:35:09 +01:00
Nyall Dawson
95d68e9172 [processing] Default to hiding help button for algorithms
And require that showing help is opt-in. Apart from a handful
of built-in providers, most providers will not have help pages
available within the QGIS documentation (including model and
script algorithms). Accordingly, we should hide the help button
by default and only show it for these selected providers.

Note that 3rd party algorithms can still specify custom helpUrl
urls, in which case the button WILL be shown.
2018-09-26 04:26:49 +10:00
nirvn
3bfc93d95b [processing] fix grass provider svg path 2018-04-30 13:04:20 +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
Médéric RIBREUX
0f1cb25085 Fix v.external default configuration and handling 2018-01-07 11:01:44 +01: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
nirvn
a477ea3ae4 [processing] move grass & saga version number to tooltips 2017-11-24 17:16:25 +07:00
Médéric RIBREUX
d10aaf4bd4 Support multiple output file raster formats:
* A new createopt textbox has been added to the parameters dialog for algorithms which exports to raster files.
* A new metaopt textbox has also been added to the Algorithm parameters dialog.
* Raster file format is detected from output filename extension.
* GdalUtils has been improved to correctly detect raster formats supported for creation.
* QFileDialog for output rasters now display only file filters for supported output raster file formats.
2017-11-05 13:18:24 +01:00
Médéric RIBREUX
b46e969325 Fix indentation 2017-11-04 15:31:21 +01:00
Médéric Ribreux
56b963e313 Improve ext scripts and support OutputFolder 2017-11-04 15:31:21 +01:00
Médéric Ribreux
6bf8448bfb Improve cell size detection and FileDestinationOutput (but not perfect) 2017-11-04 15:31:21 +01:00
Médéric Ribreux
9a52e344fd First working raster algorithm 2017-11-04 15:31:21 +01:00
Nyall Dawson
d85522582a Temporarily deactivate more algorithms 2017-06-06 07:41:20 +10:00
Nyall Dawson
e9f13d1ea3 Just use standard QgsMessageLog functionality instead of a dedicated
method for processing
2017-04-26 13:57:06 +10:00
Nyall Dawson
1394c28d13 [processing] Move some log handling to c++ class 2017-04-26 13:56:29 +10:00
Nyall Dawson
ebd851993a Remove processing specific methods for adding/removing providers
QgsProcessingRegistry methods should always be used instead
2017-04-07 13:21:28 +10:00
Nyall Dawson
fdcf04f9f3 Remove AlgorithmProvider
Totally ported to QgsProcessingProvider
2017-04-07 13:21:28 +10:00
Nyall Dawson
117260dcf3 Remove activation control from AlgorithmProvider
Split between QgsProcessingProvider and subclasses
2017-04-07 13:21:28 +10:00
Nyall Dawson
3739c3aa51 Move tr out of AlgorithmProvider to subclasses 2017-04-07 13:21:28 +10:00
Nyall Dawson
4970bb4cd5 Move more algList functionality to QgsProcessingRegistry 2017-04-07 13:21:28 +10:00
Nyall Dawson
b3142a0baf Move provider algorithm handling to QgsProcessingProvider 2017-04-07 13:21:28 +10:00
Nyall Dawson
d2a242aa95 Move format handling flags to QgsAlgorithmProvider 2017-04-04 08:15:54 +10:00
Nyall Dawson
6987d7b37c Port handling of algorithm names to QgsProcessingAlgorithm 2017-04-03 21:17:45 +10:00
Juergen E. Fischer
f00a87cb8a update translation strings 2017-03-05 10:21:24 +01:00
Nyall Dawson
04eb293362 [processing] Move some SVG icons out of plugin to themes
...and swap to using QgsApplication methods for retrieving cached icons,
implement svgIconPath for providers with SVG icons
2017-01-11 10:55:16 +10:00
Nyall Dawson
bb24dfe245 [processing] c++ base class for providers
Nothing particularly exciting here yet, but this commit
moves the definition of the provider base class to a c++
QgsProcessingProvider abstract base class.

As part of this some existing python methods were renamed
to make their use clearer and to fit with the QGIS c++
api conventions:

- getName was renamed to id
- getDescription was renamed to name
- getIcon was renamed to icon

These API breaks are documented
2017-01-11 10:55:15 +10:00
Alexander Bruy
7cda002ba2 [processing] configurable help files location for GDAL and GRASS providers 2017-01-09 16:31:13 +02:00
Alexander Bruy
ce9c08f3f6 [processing] rename GdalOgr provider to Gdal provider
Show version numbers in providers descriptions
2016-12-31 09:09:07 +02:00
Juergen E. Fischer
31df84aa6b run 2to3 on source 2016-09-21 23:30:04 +02:00
Denis Rouzaud
8071acd064 move PyQt compat folder to python/qgis 2016-04-29 14:10:26 +02:00
Alexander Bruy
525194dc0b [processing] don't ask for MSYS folder for GRASS7 (fix #14431) 2016-04-10 11:31:46 +03:00
Alexander Bruy
aef26c90f3 [processing] more HiDPI fixes (refs #14474) 2016-04-01 16:48:04 +03:00
Juergen E. Fischer
2526d3e3c8 processing: switch to pyqt wrappers, flake8 fixes 2016-03-21 17:00:25 +01:00
Alexander Bruy
a3c76c617a [processing] activate GRASS 7 by default and disable GRASS 6 2016-03-20 08:42:13 +02:00
Juergen E. Fischer
c6d921729e python fixes:
* issues identified by pyflakes (star and unused imports)
* pyqtwrapper: add QtSvg
* some exceptions e.message => unicode(e)
* some translations tr("..." % foo) => tr("...") % foo
* TODO:
  python/console/console_sci.py:547 QsciScintillaCompat?
  python/plugins/db_manager/dlg_query_builder.py:304 pop_up_error?
2016-03-15 17:25:23 +01:00
volaya
62302377db [processing] UI/UX improvements
Related to QEP #19

Some algorithm description provided by Frank Sokolic
2016-01-08 08:27:22 +01:00
Juergen E. Fischer
b39055b39c indentation update (now including autopep8) 2015-08-22 14:29:41 +02:00
volaya
b80a1bcac5 [processing] fixed handling of folders and files in settings
fixes #12511
2015-06-26 12:00:02 +02:00
Alexander Bruy
30dbd8fd5b [processing] drop resources.qrc and load images dynamically. Also remove
unused images
2015-05-19 15:30:25 +03:00
Juergen E. Fischer
4a44956222 fix processing plugin main translation and add translations
for toplevel toolbox entries (fixes #12168)
2015-02-13 20:32:18 +01:00
Juergen E. Fischer
956c155e8f fix python pep8 warnings and fix some revealed errors
pep8 --ignore=E111,E128,E201,E202,E203,E211,E221,E222,E225,E226,E227,E231,E241,E261,E265,E272,E302,E303,E501,E701 \
     --exclude="ui_*.py,debian/*,python/ext-libs/*" \
     .
2015-02-01 20:46:47 +01:00
Alexander Bruy
321ff1b1d5 [processing] i18n support in grass, R, OTB and example providers 2015-01-17 11:24:54 +02:00
Alexander Bruy
2cd177068c [processing] disable GRASS 7 algorithm provider by default 2014-10-03 15:47:44 +03:00