41734 Commits

Author SHA1 Message Date
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
Ismail Sunni
54e5bfda5c Fix 'Qsci/qsciapis.h' file not found 2017-09-22 21:41:35 +02:00
Juergen E. Fischer
644bdd4ed8 fix typo 2017-09-22 20:54:21 +02: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
Juergen E. Fischer
782ed47d00 translation string improvements 2017-09-22 15:00:31 +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
Juergen E. Fischer
d6d7c6e499 fix build 2017-09-22 10:02:20 +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
5d6c178f71 Merge pull request #5227 from nyalldawson/browser_awesome
[browser] Show QPT print templates and Python scripts
2017-09-22 16:45:00 +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
cbca7c97bc Boost test coverage of geometry classes 2017-09-22 15:41:41 +10:00
Nyall Dawson
57b76920d6 Expand docs 2017-09-22 15:22:01 +10:00
Nyall Dawson
395ed9307b Fix incorrect result for reversing compound curves 2017-09-22 15:20:24 +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
cf636dcafa Merge pull request #5235 from nyalldawson/model_progress2
[processing] Proper progress reports during model execution
2017-09-22 15:17:51 +10:00
Nyall Dawson
33d2d1119c Update sip 2017-09-22 12:50:47 +10:00
Larry Shaffer
559973739c Merge pull request #5202 from dmarteau/fix_ln_option_OSX
Execute ln command with GNU compatible options in install phase
2017-09-21 19:37:42 -06:00
Nyall Dawson
eaee80acfe Better debugging for models by showing child algorithm parameters in the log 2017-09-22 10:32:17 +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
9d6d60727a Expand unit tests for compound curves 2017-09-22 09:54:23 +10:00
Nyall Dawson
a7d0d5ef2d Fix loss of dimensionality when cloning compound curves 2017-09-22 09:54:23 +10:00
Nyall Dawson
148a906cb5 Fix adding curves with Z/M to non Z/M compound curves
Z/M for these curves should be dropped to ensure consistent
dimensionality for the whole compound curve
2017-09-22 09:54:23 +10:00
Nyall Dawson
f268ccc837 Expand test coverage for compound curves 2017-09-22 09:54:23 +10:00
Nyall Dawson
9d9c0e40a6 Fix setting correct WKB type for compound curves when adding first curve 2017-09-22 09:54:23 +10:00
Nyall Dawson
cee1f56159 Fix crash when trying to delete invalid curve from compound curves 2017-09-22 09:54:23 +10:00
Nyall Dawson
840a9c104a Fix crash when requesting invalid curve from compound curves 2017-09-22 09:54:23 +10:00
Nyall Dawson
e7b08d520e Expand geometry test coverage 2017-09-22 09:54:23 +10:00
Nyall Dawson
c77afeda9a Expand geometry unit test coverage 2017-09-22 09:54:23 +10:00
Nyall Dawson
387771fad4 Consistent capitalization for browser item actions 2017-09-22 09:36:33 +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
8f2c885436
[travis] Disable flaky test
See https://travis-ci.org/qgis/QGIS/jobs/278224577
https://github.com/qgis/QGIS/pull/5230#issuecomment-331189552
2017-09-21 18:00:46 +02:00
Matthias Kuhn
e47aa6d701
Add some docstring
Mainly to run travis again
2017-09-21 16:54:58 +02:00
Matthias Kuhn
8ef28e3f87 Merge pull request #5114 from gacarrillor/update_add_feature_tooltips
[needs-docs] Update tooltips for adding features/records
2017-09-21 15:24:23 +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
Sandro Mani
54ea029de8 Merge pull request #5224 from manisandro/ogr_gdb_subset
[OGR] Add workaround for OGRSQL not recognizing the column name returned by OGR_L_GetFIDColumn
2017-09-21 13:12:46 +02:00
Matthias Kuhn
06dc9660a3 Merge pull request #5229 from m-kuhn/cleanCode
Clean code
2017-09-21 11:32:34 +02:00
Sandro Mani
a67194df77 [OGR] Add orig_ogc_fid as last field to avoid changing field order 2017-09-21 11:17:12 +02:00
Sandro Mani
4ce2cf1744 [OGR] Add workaround for OGRSQL not recognizing the column name returned by OGR_L_GetFIDColumn 2017-09-21 10:50:39 +02:00
Alessandro Pasotti
6e5324b9d8 Fix doxygen ingroup gui -> core for moved classes 2017-09-21 10:23:11 +02:00
Matthias Kuhn
846fef2013
Doxygen 2017-09-21 10:04:26 +02:00
Matthias Kuhn
813e9d32b0
Remove dummy method 2017-09-21 09:28:53 +02:00
Matthias Kuhn
7b14d4870d
Move definition to class 2017-09-21 09:28:52 +02:00
Nyall Dawson
d6bf31783c Add an 'Open in external editor' option for python scripts in browser 2017-09-21 08:16:06 +10:00
Nyall Dawson
274a9024cd [FEATURE] Show python scripts in browser
Double clicking (or dragging them onto canvas) executes the script
2017-09-21 08:10:52 +10:00
Nyall Dawson
695cf6b5d5 Make sure iface is available when executing dropped python scripts 2017-09-21 08:10:43 +10:00
Nyall Dawson
fc10b77f45 [FEATURE] Show QPT print templates in browser
Double clicking the template (or dragging and dropping to canvas)
results in a new layout being created from the template
2017-09-21 07:55:18 +10:00