Skip to content

Commit

Permalink
more robust code
Browse files Browse the repository at this point in the history
(cherry picked from commit 61d1ac1)
  • Loading branch information
DelazJ authored and nyalldawson committed Mar 16, 2020
1 parent 1ddf3bf commit a677daa
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions python/plugins/MetaSearch/dialogs/maindialog.py
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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()
Expand Down

0 comments on commit a677daa

Please sign in to comment.