66443 Commits

Author SHA1 Message Date
Salvatore Larosa
2748215b20 [pyqgis-console] fix spell check 2020-10-24 05:49:33 +10:00
Salvatore Larosa
77c4823b50 [pyqgis-console] set focus to run button in history dialog and renaming label to run button 2020-10-24 05:49:33 +10:00
Salvatore Larosa
c0f09aa8e0 followup ae6ed7d: fix name of QPushButton 2020-10-24 05:49:33 +10:00
Salvatore Larosa
6eec68ad74 [pyqgis-console] run multiple items selected from command history dialogy 2020-10-24 05:49:33 +10:00
Richard Duivenvoorde
5f36f66cef Adding a Identify Result setting to hide the Derived attributes
Not 100% sure about what to hide for Mesh layers. For now hiding the
so called 'Geometry' feature

Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
2020-10-24 05:41:27 +10:00
Juergen E. Fischer
72574567e3 Bump version to 3.17 2020-10-23 14:12:56 +02:00
Juergen E. Fischer
308606efb1 changelog and news update for 3.16 2020-10-23 14:10:17 +02:00
Juergen E. Fischer
a759ca2271 translation update for 3.16.0 from transifex 2020-10-23 14:10:04 +02:00
Nyall Dawson
e0321be23f Add iface method and new class for delegating all responsibility
and logic for activating a custom map tool and ensuring it can
only be enabled in the right circumstances to QGIS app

If a plugin has to do this, it's a nightmare of code and hacks (partly
because of the number of changing circumstances it needs to respond
to, and partly because a lot of the useful functions available
for handling this behavior is locked away in private methods
in qgisapp.cpp)

So instead make an abstract base class for map tool handlers and
an iface method for register/unregistering them.

From the dox:

An abstract base class for map tool handlers which automatically handle all the necessary
logic for toggling the map tool and enabling/disabling the associated action
when the QGIS application is in a state permissible for the tool.

Creating these handlers avoids a lot of complex setup code and manual connections
which are otherwise necessary to ensure that a map tool is correctly activated and
deactivated when the state of the QGIS application changes (e.g. when the active
layer is changed, when edit modes are toggled, when other map tools are switched
to, etc).

- ### Example

\code{.py}
  class MyMapTool(QgsMapTool):
     ...

  class MyMapToolHandler(QgsAbstractMapToolHandler):

     def __init__(self, tool, action):
         super().__init__(tool, action)

     def isCompatibleWithLayer(self, layer, context):
         # this tool can only be activated when an editable vector layer is selected
         return isinstance(layer, QgsVectorLayer) and layer.isEditable()

  my_tool = MyMapTool()
  my_action = QAction('My Map Tool')

  my_handler = MyMapToolHandler(my_tool, my_action)
  iface.registerMapToolHandler(my_handler)
\endcode
2020-10-23 19:03:51 +10:00
Alessandro Pasotti
19842eada3
Merge pull request #39566 from elpaso/server-landingpage-clean-env2
Server landing page: restore env
2020-10-23 10:26:52 +02:00
Nyall Dawson
b925f1ed36 Prompt to save unchanged project on close before prompting to save
any unsaved scripts

It just seems more natural this way!
2020-10-23 17:26:23 +10:00
Alessandro Pasotti
e4701b11bf Server landing page: restore env
The landing page implements a system to map URLs to project using hashes.

For the legacy services (WMS, WFS etc.) this information has to be passed
in the environment `QGIS_PROJECT_FILE` and  an I/O filter takes care of
setting the environment variable.

The problem is when using the rest of the API after a project containing
bad layers has been browsed because it remains the environment and it
raises immediately an exception too early in the handleRequest server's
processing pipeline.

By restoring the original `QGIS_PROJECT_FILE` at the end of the request,
this PR fixes the issue.
2020-10-23 08:18:05 +02:00
Alessandro Pasotti
694cc76ce7
Merge pull request #39553 from elpaso/bugfix-gh39530-handle-unknown-types-on-old-postgres
PG: Fixes #39530 by handling unknown
2020-10-23 07:47:14 +02:00
Rémy Léone
42fe8c3843 simplify homebrew dependencies installation command 2020-10-23 14:25:49 +10:00
Nyall Dawson
395718f0cb Fix PyQGIS docs for colorFromMimeData 2020-10-23 12:55:26 +10:00
Nyall Dawson
f86a2e91ef Fix can no longer paste colors from text strings, add tests 2020-10-23 12:55:26 +10:00
Nyall Dawson
8c623b268e Revert "DB manager: PG read enum value for sslmode"
This reverts commit 26e9ec98e76591286576d2dde098578877bef9c0.

It results in unfixable crashes on many platforms, likely due to some
issue in sip itself

Fixes #38393, reopens #38245

The original bug (being asked twice for credentials) is preferable
over a hard crash
2020-10-23 08:22:15 +10:00
Juergen E. Fischer
12a44c7829 windows: use Threads along with HDF5 in mdal provider on windows (for HDF5_ENABLE_THREADSAFE=ON) 2020-10-22 23:17:37 +02:00
Juergen E. Fischer
c688148a85 translation fixes 2020-10-22 23:17:37 +02:00
Even Rouault
98ba41c446 [OAuth2] Do not emit empty scope in requests for Keycloak compatibility
When using Keycloak in OpenId Connect mode with AuthCode or ResourceOwner
methods, and no specifying a scope, we send a &scope= query parameter that
is rejected by Keycloak with
KC-SERVICES0093: Invalid parameter value for: scope

https://tools.ietf.org/html/rfc6749#section-3.3 mentions that scope is
optional : 'If the client omits the scope parameter when requesting
authorization...'
Do the same for the optional 'state' and 'api_key' parameters
2020-10-23 04:01:28 +10:00
Nyall Dawson
fbe80985aa Avoid update loop when QgsTemporalNavigationObject::setFrameDuration
is called from code
2020-10-23 03:59:09 +10:00
Nyall Dawson
a4bcdc4e32 Add test to confirm no duplicate signal is sent 2020-10-23 03:59:09 +10:00
Nyall Dawson
61298adce7 Avoid emitting duplicate updateTemporalRange signal when calling QgsTemporalNavigationObject::setFrameDuration 2020-10-23 03:59:09 +10:00
Richard Duivenvoorde
a59de0658d Add temporalFrameDurationChanged signal, and make view more aware of changes
This commit adds a new signal to the QgsTemporalNavigationObject, which is
emitted when the frameDuration (of current QgsTemporalNavigationObject) is
change.

It also fixes the issue that changing the frame in the Temporal
Navigation-WIDGET was not reflected in the widget itself.
2020-10-23 03:59:09 +10:00
Even Rouault
ff1d21a320 [WFS provider] Fix connecting to a server with non-basic authentication 2020-10-23 03:58:36 +10:00
Nyall Dawson
abacccb7e9 Add mapToolActionGroup to iface object
Any actions added by plugins for toggling a map tool should also
be added to this action group so that they behave identically
to the native, in-built map tool actions.
2020-10-23 03:57:34 +10:00
Nyall Dawson
460bf8e534 Hardcode a DPI of 72 into GDAL GeoPDF composition file instead of
original layout DPI

This fixes the incorrect page size reported by Acrobat reader for
generated GeoPDF files.

Unfortunately it comes with a side-effect of limiting the resolution
at which GDAL will read the GeoPDF files as a raster layer, but of
the two issues the page size issue is more critical.

Fixes #33465
2020-10-23 03:56:43 +10:00
Alessandro Pasotti
ac807697f1 PG: Fixes #39530 by handling unknown 2020-10-22 16:33:08 +02:00
Denis Rouzaud
f5c8739365
Merge pull request #39548 from 3nids/fix-duplicate-errors
Fix duplicating features
2020-10-22 11:46:13 +02:00
Nyall Dawson
f749089d94 Fix test 2020-10-22 18:30:21 +10:00
Nyall Dawson
82f025752b Show warning when configuring 3d map and all lights are removed from the scene 2020-10-22 18:30:21 +10:00
Nyall Dawson
f476ca4e61 More appropriate step size for light intensity 2020-10-22 18:30:21 +10:00
Nyall Dawson
d41eb25cb2 Increase default intensity of 3d lights to avoid underexposed scenes by default 2020-10-22 18:30:21 +10:00
Nyall Dawson
350bc602e0 A newly created 3d map now defaults to a single directional light
instead of a point light source

These are a better default lighting, because they are simpler to
configure and will lead to more of the scene being immediately lit
by default.
2020-10-22 18:30:21 +10:00
Nyall Dawson
c5fe9faa3c Newly created directional lights default to slightly angled lights,
instead of directly top-down directions

This is more friendly behavior, because it allows visibility of
vertical features with a default light (instead of "black" walls
and lit roofs you get shaded walls + roofs)
2020-10-22 18:30:21 +10:00
Nyall Dawson
19f79d4155 Ensure newly added point lights default to same y position of 1000 as the initial scene light 2020-10-22 18:30:21 +10:00
Denis Rouzaud
ffbe377cec add feature before adding its children
otherwise, this leads to an error in transaction mode as the referenced feature does not exist yet (foreign key constraint error)
2020-10-22 09:40:38 +02:00
Denis Rouzaud
32ca4b17de correctly initilaze feature with fields in map layer action from attribute table 2020-10-22 08:22:25 +02:00
nirvn
ecc6bfcd7a [ui] Add an Apply button to the 3D map configuration dialog 2020-10-22 11:07:09 +07:00
vcloarec
e8c895ad95 no negative altitude 2020-10-22 12:14:32 +10:00
vcloarec
16847cd33f fix 3D directional light ui 2020-10-22 12:14:32 +10:00
vcloarec
04d665f409 make mesh 3d rendering more thread safe 2020-10-22 12:02:11 +10:00
vcloarec
560cc73a10 fix #39455 2020-10-22 12:02:11 +10:00
Nyall Dawson
67e7825d29 Remove use of deprecated std::ios_base::streamoff method 2020-10-22 11:14:30 +10:00
Harrissou Sant-anna
35d62ab0d4
Set a clear value for spinboxes to avoid clear icon for default values (#39534)
* Set a clear value for spinboxes to avoid clear icon for default values
2020-10-22 11:04:12 +10:00
olivierdalang
dd4af80eb9 fix #39068 : geometry_overlays's limit parameter not working as expected - test 2020-10-22 09:39:10 +10:00
olivierdalang
4975965297 fix #39068 : geometry_overlays's limit parameter not working as expected 2020-10-22 09:39:10 +10:00
Ivan Ivanov
7854c61189 Update src/gui/processing/qgsprocessingfieldmapwidgetwrapper.cpp
Co-authored-by: Matthias Kuhn <matthias@opengis.ch>
2020-10-22 09:33:56 +10:00
Ivan Ivanov
e3db51f27c Add option to add field constraint hints via programatic call
Test with:
dlg = processing.createAlgorithmDialog("native:refactorfields", {
    'FIELDS_MAPPING' : [
        {'expression': '\"id\"','length': -1,'name': 'id','precision': 0,'type': 2},
        {'expression': '4','length': -1,'name': 'name1','precision': 0,'type': 10, 'constraints': QgsFieldConstraints.ConstraintNotNull | QgsFieldConstraints.ConstraintUnique}
        ],
    'INPUT' : 'memory://Point?crs=EPSG:4326&field=id:integer(-1,0)&field=name:string(-1,0)',
    'OUTPUT' : '/home/suricactus/projects/tmp/asd1.gpkg' })
res = dlg.exec_()
2020-10-22 09:33:56 +10:00
Even Rouault
c857a33325 [OGR provider] Check return value of commitTransaction() in addFeatures() and deleteFeatures(); call rollback when an error was detected before 2020-10-22 09:14:58 +10:00