Skip to content
Permalink
Browse files

more robust code

  • Loading branch information
DelazJ authored and nyalldawson committed Mar 5, 2020
1 parent ca89d34 commit 61d1ac1226d0e0b23a4ae5743b23f18009975ddf
Showing with 8 additions and 4 deletions.
  1. +8 −4 python/plugins/MetaSearch/dialogs/maindialog.py
@@ -750,7 +750,11 @@ def add_to_ows(self):
self.settings.endGroup()

# open provider window
ows_provider = QgsGui.providerGuiRegistry().sourceSelectProviders(stype[2])[0].createDataSourceWidget()
ows_provider = QgsGui.sourceSelectProviderRegistry().createSelectionWidget(
stype[2],
self,
Qt.Widget,
QgsProviderRegistry.WidgetMode.Embedded)
service_type = stype[0]

# connect dialog signals to iface slots
@@ -779,6 +783,9 @@ def addAfsLayer(path, name):
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)
if index > -1:
@@ -790,9 +797,6 @@ 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 61d1ac1

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