3737 Commits

Author SHA1 Message Date
Matthias Kuhn
900be9f57f
Properly report QgsDefaultValue.__bool__ in Python 2017-09-29 17:52:30 +02:00
Matthias Kuhn
f2d512a73a
Apply default values on update 2017-09-29 17:52:30 +02:00
Matthias Kuhn
7b36287ff3
Use QgsDefaultValue throughout the code 2017-09-29 17:52:29 +02:00
Matthias Kuhn
cab3a38461
Doxymentation 2017-09-29 17:52:29 +02:00
Matthias Kuhn
5fba1e85aa
Add sip bindings 2017-09-29 17:52:29 +02:00
Matthias Kuhn
d6eb7ba3e7
Add "apply on update" option to default values 2017-09-29 17:52:28 +02:00
Matthias Kuhn
ca5a0bb3de
Fix python expression functions 2017-09-29 17:01:33 +02:00
Matthias Kuhn
a97d846471
Single parameter version of represent_value
Becuase `represent_value("fieldname")` is much shorter to write and in 98%
there is no need to specify the name separately as
`represent_value("fieldname", 'fieldname')`.
2017-09-29 10:58:18 +02:00
Ismail Sunni
0c7c494831
Add section in beginGroup and remove Setting. 2017-09-28 17:01:00 +07:00
Alessandro Pasotti
829702bd24 Merge pull request #5253 from boundlessgeo/auth_proxy
[auth][feature][needs-docs] Proxy authentication integration with QGIS authentication system
2017-09-27 17:41:53 +02:00
Nyall Dawson
a87d352bd7 Run clang-tidy modernize-use-default-member-init to move member
initialization to headers (c++11 style)
2017-09-27 05:02:34 +10:00
Nyall Dawson
9518c90a8b Fix multipolygon allowing insertion of non polygon geometries 2017-09-26 12:05:04 +10:00
Nyall Dawson
5ed6605225 Fix multisurface allowing insertion of non surface geometries 2017-09-26 11:28:51 +10:00
Nyall Dawson
4d989f8fb6 Fix clearing multisurface should reset dimensionality 2017-09-26 10:58:32 +10:00
Nyall Dawson
31730f43be Ensure multisurface dimensionality is respected when adding new surfaces 2017-09-26 10:48:12 +10:00
Nyall Dawson
ed90bf4ded Fix multicurve allowing insertion of non curve geometries 2017-09-26 10:12:52 +10:00
Nyall Dawson
c9117fc585 Fix clearing multicurve should reset dimensionality 2017-09-26 09:03:28 +10:00
Nyall Dawson
f5004ed7ef Fix multi line string allowing insertion of non line geometries 2017-09-26 08:33:47 +10:00
Nyall Dawson
ed72e37f0b Fix clearing multilinestring should reset dimensionality 2017-09-26 06:29:36 +10:00
Alessandro Pasotti
07e1bd9c38 [auth] Added updateNetworkProxy method to auth manager
This allows to apply stored proxy auth settings to the
proxy configuration.
2017-09-25 17:39:41 +02:00
Nyall Dawson
ba50bf043b Fix multi point allowing insertion of non point geometries 2017-09-25 21:20:32 +10:00
Nyall Dawson
97930d13e2 Fix clearing multipoint should reset z/m status 2017-09-25 21:20:06 +10:00
Nyall Dawson
ffbf93a657 Fix incorrect /Transfer/ for geometry collection 2017-09-25 21:19:43 +10:00
Nyall Dawson
d704163884 Rename QgsRectangle::buffer to buffered and mark as const 2017-09-25 17:20:36 +10:00
Nyall Dawson
b0b1714e98 Fix build 2017-09-25 17:12:04 +10:00
Nyall Dawson
270f167829 Fix doctest 2017-09-25 17:12:04 +10:00
Nyall Dawson
01d34ede9d Sip sync 2017-09-25 17:12:03 +10:00
Nyall Dawson
60b8ec5488 Sip sync 2017-09-25 17:11:46 +10:00
Alexander Bruy
14a48c0349 Merge pull request #5201 from nyalldawson/point_crs
[processing] Transparently handle CRS for point parameters
2017-09-25 09:47:46 +03:00
Nyall Dawson
a71f2ad5dc Fix non-virtual destructor 2017-09-25 12:46:49 +10:00
Nyall Dawson
e1eef7ed19 Allow use of QgsPointXY/QgsReferencedPointXY for point parameter values 2017-09-24 12:09:38 +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
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
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
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
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
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
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
Nyall Dawson
a67dab52d2 Spelling 2017-09-20 18:45:59 +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
Nyall Dawson
20e1d72007 Merge pull request #5209 from nyalldawson/geometry_coverage
[WIP] Extend geometry classes unit test coverage
2017-09-19 22:15:14 +10:00