Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[MetaSearch] OWS GetCapabilities checking regression (fixes #19787) […
…needs-docs]
  • Loading branch information
tomkralidis authored and nyalldawson committed Feb 5, 2019
1 parent 513f7ea commit 2329459
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 72 deletions.
28 changes: 4 additions & 24 deletions python/plugins/MetaSearch/dialogs/maindialog.py
Expand Up @@ -141,11 +141,6 @@ def __init__(self, iface):
self.mActionAddGisFile.triggered.connect(self.add_gis_file)
self.btnShowXml.clicked.connect(self.show_xml)

# settings
self.radioTitleAsk.clicked.connect(self.set_ows_save_title_ask)
self.radioTitleNoAsk.clicked.connect(self.set_ows_save_title_no_ask)
self.radioTempName.clicked.connect(self.set_ows_save_temp_name)

self.manageGui()

def manageGui(self):
Expand All @@ -166,16 +161,6 @@ def manageGui(self):

self.reset_buttons()

# get preferred connection save strategy from settings and set it
save_strategy = self.settings.value('/MetaSearch/ows_save_strategy',
'title_ask')
if save_strategy == 'temp_name':
self.radioTempName.setChecked(True)
elif save_strategy == 'title_no_ask':
self.radioTitleNoAsk.setChecked(True)
else:
self.radioTitleAsk.setChecked(True)

# install proxy handler if specified in QGIS settings
self.install_proxy()

Expand Down Expand Up @@ -748,15 +733,10 @@ def add_to_ows(self):

# check for duplicates
if sname in keys: # duplicate found
if self.radioTitleAsk.isChecked(): # ask to overwrite
msg = self.tr('Connection {0} exists. Overwrite?').format(sname)
res = QMessageBox.warning(self, self.tr('Saving server'), msg,
QMessageBox.Yes | QMessageBox.No)
if res != QMessageBox.Yes: # assign new name with serial
sname = serialize_string(sname)
elif self.radioTitleNoAsk.isChecked(): # don't ask to overwrite
pass
elif self.radioTempName.isChecked(): # use temp name
msg = self.tr('Connection {0} exists. Overwrite?').format(sname)
res = QMessageBox.warning(self, self.tr('Saving server'), msg,
QMessageBox.Yes | QMessageBox.No)
if res != QMessageBox.Yes: # assign new name with serial
sname = serialize_string(sname)

# no dups detected or overwrite is allowed
Expand Down
56 changes: 8 additions & 48 deletions python/plugins/MetaSearch/ui/maindialog.ui
Expand Up @@ -23,7 +23,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>2</number>
</property>
<widget class="QWidget" name="tabSearch">
<attribute name="title">
Expand Down Expand Up @@ -485,46 +485,6 @@
<string>Settings</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QGroupBox" name="saveStrategyGroup">
<property name="title">
<string>Connection Naming</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="lblSaveStrategy">
<property name="text">
<string>When saving the connection of an OWS service</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioTitleAsk">
<property name="text">
<string>Use the OWS Service Title and ask before overwriting</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioTitleNoAsk">
<property name="text">
<string>Use the OWS Service Title and always overwrite if already available</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioTempName">
<property name="text">
<string>Use a temporary name, which you can change later</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
Expand Down Expand Up @@ -606,6 +566,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsFilterLineEdit</class>
<extends>QLineEdit</extends>
<header>qgis.gui</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
Expand Down Expand Up @@ -641,11 +608,4 @@
</hints>
</connection>
</connections>
<customwidgets>
<customwidget>
<class>QgsFilterLineEdit</class>
<extends>QLineEdit</extends>
<header>qgis.gui</header>
</customwidget>
</customwidgets>
</ui>

0 comments on commit 2329459

Please sign in to comment.