38975 Commits

Author SHA1 Message Date
Nyall Dawson
2435dbc712 Nicer results, always show an icon, show description 2017-05-17 21:33:47 +10:00
Nyall Dawson
ea86049c5e Show a list of shortcut prefixes in locator bar if no text is entered 2017-05-17 21:33:47 +10:00
Nyall Dawson
11036e4d05 Always select the best result by default, even if good results are
slow to fetch
2017-05-17 21:33:47 +10:00
Nyall Dawson
56c8baaccb Provide a standard string comparison method in QgsLocatorFilter
Subclasses should use this method instead of directly calling
QString::contains or using Python 's in search' type matches.
This ensures consistent matching behaviour across different filters.
2017-05-17 21:33:47 +10:00
Nyall Dawson
6649d2b1ed Sort filter results so closer matches appear higher
A closer match means more of the text is matched, ie
a short string inside a long string is penalised
2017-05-17 21:33:47 +10:00
Nyall Dawson
a53516d71d Only show action results when . prefix is used 2017-05-17 21:33:47 +10:00
Nyall Dawson
102a46662b Implement prefix based locator searching
Filters can indicate their preferred search prefix. Searches which
begin with this character will be restricted to the single matching
filter.

E.g. entering 'l buffer' will searching only layers containing 'buffer'

Other prefixes are:
- . search actions
- pl search print layouts
- a search algorithms

Plugins are restricted to a minimum 3 character prefix. We do this
to avoid plugins 'stealing' desirable prefixes, and instead we
want to reserve them for future core filters.
2017-05-17 21:33:47 +10:00
Nyall Dawson
b33ce0bf47 Allow speciyfing the priority for filters
Higher priority (i.e. more important) filter results get shown
first. This means filters like project layers & composers will
show above 'cruder' filters like the actions/processing filters.
2017-05-17 21:33:47 +10:00
Nyall Dawson
0f80df09a7 Show locator filter names in results, sort results and group by filter 2017-05-17 21:33:47 +10:00
Nyall Dawson
0dd3fcb6e4 Add processing algorithms to locator bar
Inspired by the ghost of processing's commander
2017-05-17 21:33:47 +10:00
Nyall Dawson
cb579bb9b6 Add a locator filter for main window actions
Inspired by the ghost of processing's commander
2017-05-17 21:33:47 +10:00
Nyall Dawson
ab02f2b79c Allowing associating QgsLocatorWidget with a map canvas
This allows the widget's locator to prioritise results which
are close to the current canvas extent
2017-05-17 21:33:47 +10:00
Nyall Dawson
a7d590e041 Add a context variable for locator searches
This allows encapsulation of properties relating to the context
of a search, such as a target map extent. Locator filters could
use this to prioritise results close to the current canvas extent.
2017-05-17 21:33:47 +10:00
Nyall Dawson
376d6b3d08 Add missing docs, sip bindings 2017-05-17 21:33:47 +10:00
Nyall Dawson
1174b335dc Add inbuilt filters for project layers and compositions
The project layer filter allows you to quickly select a layer
from the current project and highlight it in the layer tree.
It's useful for complex project with lots of groups, where
it's easy to "lose" layers somewhere in the tree...

The composition filter allows searching for and opening
compositions from the current project
2017-05-17 21:33:47 +10:00
Nyall Dawson
71f7872251 [FEATURE] Implement a QtCreator style locator bar in the QGIS status bar
This adds a new "locator" bar to the QGIS status bar. If you're not
familiar with QtCreator's locator, it's a quick search bar
(activated by Ctrl+K) which displays matching search results
from any number of registered search filters.

Search filters are subclassed from QgsLocatorFilter, and
added to the app's locator via iface.registerLocatorFilter(...)

Searching is handled using threads, so that results always
become available as quickly as possible, regardless of whether
any slow search filters may be installed. They also appear
as soon as each result is encountered by each filter, which means
that e.g. a file search filter will show results one by one
as the file tree is scanned. This ensures that the UI is always
responsive even if a very slow search filter is present (e.g.
one which uses an online service).

This framework is designed to be extended by plugins, such as
OSM nominatim searches, direct database searching (i.e. Discovery
plugin), layer catalog searches, etc...
2017-05-17 21:33:47 +10:00
Nyall Dawson
afc9788881 Better method to ensure memory layers always have unique sources 2017-05-17 21:31:37 +10:00
Alexander Bruy
49a7158a9f Merge pull request #4565 from alexbruy/processing-single2multi
[processing] handle NULL values in the single to multi algorithm (fix #15822)
2017-05-17 13:37:06 +03:00
Martin Dobias
591c3ab995 Remove QgsPoint::onSegment() method
This is a completely wrong use of an algorithm that is meant to be used with *integer* values,
e.g. when dealing with pixels on screen, but not for coordinates that are floating point numbers.
The algorithm has a fixed tolerance of 1 unit.

QgsPoint(5,0.9).onSegment(QgsPoint(0,0), QgsPoint(10,0)) would return 2 (i.e. point is on line segment)

See the original code: https://github.com/erich666/GraphicsGems/blob/master/gems/PntOnLine.c
2017-05-17 17:38:29 +08:00
Alexander Bruy
5112a0dc88 remove QgsSponsors widget. Instead open sponsors page in the webbrowser
(fix #16169)
2017-05-17 12:06:20 +03:00
Alessandro Pasotti
14ee435761 Merge pull request #4569 from boundlessgeo/xyz-inverted-y
[bugfix] Fix broken inverted Y support in XYZ layers
2017-05-17 10:15:15 +02:00
Alessandro Pasotti
ccd5d75225 [bugfix] Fix broken inverted Y support in XYZ layers
This follows the convention used by OpenLayers, where
an inverted axis is indicated by {-y} in the URL
definition.

Fixes #15927

Needs backporting.
2017-05-17 10:14:23 +02:00
Alexander Bruy
84871ce00d [processing] temporarily disable singleparts to multiparts test 2017-05-17 08:26:47 +03:00
Werner Macho
d0d6959b6f Merge pull request #4570 from mach0/master
[i18n] adding translator on request
2017-05-16 19:34:54 +02:00
Sandro Santilli
0bac937173 Fix indentation as requested by Travis
NOTE: I do have the prepare-commit.sh hook in place, but it did
      not handle this
2017-05-16 19:22:58 +02:00
Sandro Santilli
4ed096b94d Add test for unprojectible polygon labeling
See #15507
2017-05-16 18:16:54 +02:00
Alexander Bruy
b9bd66d2b3 store profiles as QStringList to avoid issues with spaces (fix #16327) 2017-05-16 19:05:01 +03:00
Blottiere Paul
0c72d4bc2b Add unit tests 2017-05-16 13:00:38 +02:00
Blottiere Paul
e2ee1534ed Update sip binding 2017-05-16 13:00:38 +02:00
Blottiere Paul
877363873f [bugfix] Fix unit of sizes when reading a SLD file (fixes #8978) 2017-05-16 13:00:38 +02:00
Alexander Bruy
fe7c981aea [processing] handle NULL values in the single to multi algorithm (fix #15822) 2017-05-16 13:43:42 +03:00
Alexander Bruy
11475c621d Revert "Merge pull request #4562 from alexbruy/processing-singletomulti-3"
This reverts commit e3d79a1fe940b5d813b5f79c51b43393d085bb16, reversing
changes made to 3f7f95ee262ea3646d61600c21faed0866bc70b0.

Reverting again, as Travis started failing after merging PR (with all
test passed) into master branch
2017-05-16 13:42:47 +03:00
Alessandro Pasotti
3f4ad0f4d0 Merge pull request #4564 from boundlessgeo/server-more-requesthandler-api
[server] Add url and post data getters to request handler
2017-05-16 12:30:03 +02:00
Alessandro Pasotti
45166aaf71 [server] Clearer log message when parsing non-XML POST data 2017-05-16 11:57:28 +02:00
Alessandro Pasotti
cbef51cc0a [server] Sipify QgsRequestHandler 2017-05-16 11:57:28 +02:00
Alessandro Pasotti
2f75bab844 [server] Add url and post data getters to request handler
This completes the API to eventually get rid of all
getEnv usage from python server plugins.

The request handler has now access to the request URL
and POST data without the need to query the env.
2017-05-16 11:08:38 +02:00
Alexander Bruy
e3d79a1fe9 Merge pull request #4562 from alexbruy/processing-singletomulti-3
[processing] handle NULL values in the single to multi algorithm (fix #15822)
2017-05-16 11:59:51 +03:00
Juergen E. Fischer
3f7f95ee26 db_manager versioning: add RETURNING to INSERT rule (fixes #16083) 2017-05-16 10:34:59 +02:00
Alexander Bruy
b56e46dad4 [processing] handle NULL values in the single to multi algorithm (fix #15822) 2017-05-16 10:06:26 +03:00
Juergen E. Fischer
2f70b426e9 sip bindings: exclude QgsCompositionChecker when not building tests 2017-05-16 09:04:08 +02:00
Juergen E. Fischer
70da239a24 debian packaging: include native gui library 2017-05-16 09:04:08 +02:00
Martin Dobias
f153e19168 Fix saving of "obstacle only" state + misc fixes to unit tests 2017-05-16 14:25:32 +08:00
Martin Dobias
bfdc84fc69 Fixes to unit tests 2017-05-16 14:25:32 +08:00
Martin Dobias
ee9fabbec1 Fix for style loading and clean up of used labeling custom properties 2017-05-16 14:25:32 +08:00
Martin Dobias
56309efc4c Fix loading of labeling from 2.x projects 2017-05-16 14:25:32 +08:00
Martin Dobias
53f8e7f744 Remove dead code for writing of labeling from custom properties 2017-05-16 14:25:32 +08:00
Martin Dobias
828bd384c5 Convert remaining bits where labeling was configured using setCustomProperty() 2017-05-16 14:25:32 +08:00
Martin Dobias
21f03bc11c Clean up reading/writing of labeling configuration in vector layers
Historically the configuration used to be stored in layer's custom properties, but that does not scale
beyond simple rendering and so rule-based labeling introduced storage of configuration natively in XML elements.
That left us with two different ways of reading/writing labeling configurations. This work makes all configuration
to use native XML elements.

To keep compatibility of 2.x projects, reading of configuration from custom properties is preserved.

This commit also adds Python APIs for direct manipulation of labeling configuration through vector layer's
setLabeling() and labeling() calls.
2017-05-16 14:25:32 +08:00
Nyall Dawson
7e345a7327 Merge pull request #4561 from nyalldawson/proj_thread2
Avoid using thread unsafe proj API - approach 2
2017-05-16 15:12:42 +10:00
Nyall Dawson
5201eb251e Optimise storage/retrieval of projPJ objects 2017-05-16 13:31:35 +10:00