Skip to content
Permalink
Browse files

Allow to open data loader dialog from metasearch

fixes #34759
  • Loading branch information
DelazJ authored and nyalldawson committed Mar 4, 2020
1 parent 323a9a4 commit eca526116071834344a2087414c2c8f659705d8d
Showing with 5 additions and 5 deletions.
  1. +5 −5 python/plugins/MetaSearch/dialogs/maindialog.py
@@ -41,7 +41,7 @@
from qgis.core import (QgsApplication, QgsCoordinateReferenceSystem,
QgsCoordinateTransform, QgsGeometry, QgsPointXY,
QgsProviderRegistry, QgsSettings, QgsProject)
from qgis.gui import QgsRubberBand
from qgis.gui import QgsRubberBand, QgsGui
from qgis.utils import OverrideCursor

with warnings.catch_warnings():
@@ -748,8 +748,7 @@ def add_to_ows(self):
self.settings.endGroup()

# open provider window
ows_provider = QgsProviderRegistry.instance().createSelectionWidget(stype[2],
self)
ows_provider = QgsGui.providerGuiRegistry().sourceSelectProviders(stype[2])[0].createDataSourceWidget()
service_type = stype[0]

# connect dialog signals to iface slots
@@ -777,8 +776,6 @@ def addAfsLayer(path, name):
ows_provider.addVectorLayer.connect(addAfsLayer)
conn_cmb = ows_provider.findChild(QComboBox)
connect = 'connectToServer'
ows_provider.setModal(False)
ows_provider.show()

# open provider dialogue against added OWS
index = conn_cmb.findText(sname)
@@ -791,6 +788,9 @@ def addAfsLayer(path, name):
ows_provider.cmbConnections_activated(index)
getattr(ows_provider, connect)()

ows_provider.setWindowModality(Qt.WindowModal)
ows_provider.exec_()

def add_gis_file(self):
"""add GIS file from result"""
item = self.treeRecords.currentItem()

0 comments on commit eca5261

Please sign in to comment.
You can’t perform that action at this time.