10854 Commits

Author SHA1 Message Date
Nyall Dawson
83a8a8d730 Use text encoded versions of points and extents in history panel
Fixes generation of unit tests with point/extent parameters
2017-09-24 13:46:01 +10:00
Nyall Dawson
1d6e30324f Use correct SRS when building graph 2017-09-24 12:09:38 +10:00
Nyall Dawson
6898342c08 Better cursor for point picker tool 2017-09-24 12:09:38 +10:00
Nyall Dawson
506f6d40b7 [processing] Fix picking point from map always triggers a release
event for previous map tool
2017-09-24 12:09:38 +10:00
Nyall Dawson
6efcc2fe86 Transparently reproject source points in algs 2017-09-24 12:09:38 +10:00
Nyall Dawson
e1eef7ed19 Allow use of QgsPointXY/QgsReferencedPointXY for point parameter values 2017-09-24 12:09:38 +10:00
Nyall Dawson
8902d5f48f Merge pull request #5244 from nyalldawson/proc_misc
[processing] Misc test related fixes
2017-09-24 10:37:06 +10:00
Nyall Dawson
db04d65593 Use processing config help key 2017-09-24 08:30:28 +10:00
Nyall Dawson
8dffa33a27 Allow QgsOptionsPageWidget to set a specific help key to view
when clicking help in the options dialog
2017-09-24 08:29:39 +10:00
Nyall Dawson
fe98fe1131 Merge pull request #5236 from nyalldawson/field_default
[processing] Allow setting default values for field parameters in models
2017-09-24 07:58:39 +10:00
Alexander Bruy
afac940d37 [processing] add band parameter support in test generator 2017-09-24 07:50:05 +10:00
Nyall Dawson
acbba3a387 Fix excepthook handling in standalone scripts 2017-09-24 07:47:45 +10:00
Nyall Dawson
34a8c8aab8 Fix exception when running alg with no parameters from toolbox 2017-09-24 07:46:35 +10:00
Juergen E. Fischer
36e24f6c10 fix metasearch settings (fixes #16532) 2017-09-23 14:50:32 +02:00
Nyall Dawson
53aba6109c Merge pull request #5241 from nyalldawson/clean_code
[processing] Code cleanups
2017-09-23 17:21:05 +10:00
Etienne Trimaille
ba81068f49 [FEATURE] [needs-docs] Metadata editor
Adds a new metadata tab to layer properties, representing the new metadata model from QEP #91
2017-09-23 14:08:32 +10:00
Muhammad Yarjuna Rohmat
e2678936df [FEATURE][geonode] integration - copy style action
Allows copying styles directly from geonode layers for pasting into project layers.
2017-09-23 13:36:57 +10:00
Nyall Dawson
5a802b595d Add missing test files 2017-09-23 10:36:33 +10:00
Nyall Dawson
ae42bf4b6e Update expected test results (rename field) 2017-09-23 09:27:26 +10:00
Nyall Dawson
0dd434c183 [processing] Port mean coordinates to c++
And remove final use of inefficient vector.extractPoints function
2017-09-23 09:25:18 +10:00
Nyall Dawson
10d6ef06e8 Replace more duplicate code with QgsProcessingUtils.combineFields 2017-09-23 08:41:54 +10:00
Nyall Dawson
a191c77bcb Remove duplicate testForUniqueness method (replaced with QgsProcessingUtils.combineFields) 2017-09-23 08:37:35 +10:00
Matthias Kuhn
6dfe44f72b Merge pull request #5179 from vmora/listen_notify
[FEATURE] layer refresh and trigger actions on provider notification
2017-09-22 19:32:46 +02:00
Vincent Mora
02e3916bf5 [FEATURE] layer refresh and trigger actions on provider notification
[needs-docs]

In vector layer properties (only usefull for postgres datasources)

**in the rendering tab**

A "Refresh layer on notification" checkbox has been added to refresh layer
on provider notification.

For a postgres datasource, if a `NOTIFY qgis;` command is issued by one of the database clients,
a refresh of the layer will occur.

If the "Only if message is" checkbox is checked, the notification will trigger the refresh only
if the message contend is the one specified, e.g. if the user enters
"refresh" in the box right next to the "Only if message is" checkbox,
then a `NOTIFY qgis, 'refresh';` command in the datatabase will trigger
a layer refresh, but `NOTIFY qgis;` or `NOTIFY qgis, 'something else';`
won't.

**in the actions tab**

A column "On notification" has been added, the action editor widget
a has text field "Execute if notification message matches" to
specify a filter for notification from the provider. The filter is a
Perl-type regex.

Note that, as opposed to the "layer refresh" that

Exemple:
  - QGIS side "Execute if notification message matches" `^trigger my action`
  - Postgres side: `NOTIFY qgis, 'trigger my action'` will trigger the action
  - Postgres side: `NOTIFY qgis, 'trigger my action some additional data'` will trigger the action
  - Postgres side: `NOTIFY qgis, 'do not trigger my action some additional data'` will NOT trigger the action

Please note that if the `^`, which means "starts with",  in `^trigger my action` had been ommited,
the last notification would have triggered the action because the
notification message contains the `trigger my action`

A new qgis variable `notification_message` is available for use in
actions, it holds the contend of the notification message. To continue
with the previous exemple, if the action is of python type with the code:

```python
print('[% @notification_message %]')
```

The three notifictions above will result in two printed lines
```
trigger my action
trigger my action some additional data
```

User Warning:

For postgres providers, if the "Refresh layer on notification" is checked, or if one layer action has
"On notification" specified, a new connection to the database is made to
listen to postgres notifications. This olds even if transaction groups
are enabled at the project level.

Note that once the notification mechanism is started in a QGIS
session, it will not stop, even if there is no more need for it (Refresh
layer on notification" unchecked and no "On notification" in any
action). Consequently the connection listening to notification will
remain open.

IMPLEMENTATION DETAILS:

A notify signal has been added to the abstract QgsVectorDataProvider
along with a setListening function that enables/disble the notification
mechanism.

For the moment only the postgres provider implements the notification.

QgsAction has a notificationMessage member function that holds the regex
to match to trigger action

QgsActionManager becomes a QObject and is doing the filtering and execute actions on
notifications.

The notification notion extends beyond SRGBD servers (postgres and oracle at
least have the notify) and the "watch file" in the delimitedtext
provider could also benefit from this interface.

For the postgres provider a thread is created with a second connection
to the database. This thread is responsible for listening postgres
notifications.

It would be nice to avoid the creation of one listening chanel per
provider in the case transaction groups are enabled.

Please note that when listening starts (a thread and connection is
created in the postgres provider) it cannot be stopped by removing the
connected actions or unchecking the refresh check box. Indeed, since we
don't know who needs the signals, we dont't want to stop the service.

The service will not restart in the next qgis session though.

If this behavior is not deemed appropriate, we could use
```
int QObject::receivers ( const char * signal ) const
```
and have QgsDataProvider::setListening return a bool to tell the caller
if the signal has actually been closed.
2017-09-22 12:51:51 +02:00
Juergen E. Fischer
8b32d8d949 translation string fixes 2017-09-22 11:38:42 +02:00
Nyall Dawson
22eddfd4c0 Merge pull request #5238 from nyalldawson/geometry_coverage
Geometry unit test coverage + fixes
2017-09-22 17:18:39 +10:00
Nyall Dawson
a6b1c3ee9f Merge pull request #5237 from nyalldawson/port_algs
[processing] Port line intersection and split with lines to c++
2017-09-22 17:18:05 +10:00
Nyall Dawson
db738f65e6 Merge pull request #5234 from nyalldawson/action_lifetime
Fix browser action item lifetime
2017-09-22 16:11:42 +10:00
Nyall Dawson
57b76920d6 Expand docs 2017-09-22 15:22:01 +10:00
Nyall Dawson
21f92a6fb2 Port line intersection and split with lines to c++ 2017-09-22 15:19:32 +10:00
Nyall Dawson
c41dca937c Port processing combineFields to c++ 2017-09-22 15:19:32 +10:00
Nyall Dawson
33d2d1119c Update sip 2017-09-22 12:50:47 +10:00
Nyall Dawson
b39459b8ff Matching default multiple fields should also be case-insensitive 2017-09-22 12:02:48 +10:00
Nyall Dawson
c5b9fa23cd Formatting 2017-09-22 10:56:32 +10:00
Nyall Dawson
94530a9efc Allow setting default value for field parameters in models 2017-09-22 10:50:46 +10:00
Nyall Dawson
6afe25ef0f [processing] Proper progress reports during model execution
Instead of showing the progress reports for each child algorithm
individually, which leads to repeated 0->100% progress for every
step of a model, we proxy the progress reports and account for the
overall progress through a model as well. This means that
the progress accounts for both the progress within the current
model step AND the total number of steps left to execute.
2017-09-22 10:32:17 +10:00
Nyall Dawson
e7b08d520e Expand geometry test coverage 2017-09-22 09:54:23 +10:00
Nyall Dawson
7c53dc1574 Correctly parent browser item actions to transient menu instance
Currently most browser item actions are parented to the item
itself, which is often long-lived (e.g. connection items
which last for the duration of the qgis session). This
commit adds an explicit parent widget parameter to
QgsDataItem::actions to ensure that the newly created actions
are correctly parented to the menu, and deleted after the
menu is removed.
2017-09-22 09:32:54 +10:00
Matthias Kuhn
9caa7224cd Merge pull request #5230 from m-kuhn/taskWaitForFinished
QgsTask::waitForFinished without event loop
2017-09-21 18:35:43 +02:00
Matthias Kuhn
88fcbb0aac
QgsTask::waitForFinished without event loop
because the old approach with using signals, using deleteLater and using
an internal event loop is a very good recipe for big troubles.
2017-09-21 14:16:37 +02:00
Matthias Kuhn
846fef2013
Doxygen 2017-09-21 10:04:26 +02:00
Nyall Dawson
15e650d624 Merge pull request #5221 from nyalldawson/browser_awesome
Add QLR, processing models to browser
2017-09-21 05:20:07 +10:00
Matthias Kuhn
b1b21ed25f Merge pull request #5143 from m-kuhn/nulldatasetparams
QgsVectorFilewriter skip default null options
2017-09-20 11:44:57 +02:00
Nyall Dawson
a67dab52d2 Spelling 2017-09-20 18:45:59 +10:00
Nyall Dawson
ef97063029 Identation 2017-09-20 18:41:42 +10:00
Matthias Kuhn
a6dc600784
[processing] Fix single sided buffer multiline (bevel) 2017-09-20 08:51:43 +02:00
Nyall Dawson
6e1c5c4d75 [FEATURE] Show processing models in browser
And allow them to be executed and edited directly from there
2017-09-20 14:09:03 +10:00
Nyall Dawson
253c4c7a42 Add a Custom item type for QgsDataItem 2017-09-20 14:09:03 +10:00
Nyall Dawson
8bce7a62a7 Allow QgsDataItems to override default double click behavior 2017-09-20 14:09:03 +10:00
Nyall Dawson
6ce3c6100d [FEATURE] Add 'open directory' action to right click menu for
folders in browser dock

Opens the folder in the OS' file explorer
2017-09-20 09:24:02 +10:00