Skip to content

Commit

Permalink
mapserver export fix:
Browse files Browse the repository at this point in the history
- use double quotation marks for postgres layers (fixes #1104)
- export original instead of localized unit names


git-svn-id: http://svn.osgeo.org/qgis/trunk@9782 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Dec 13, 2008
1 parent 6fbda00 commit 0360d75
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 40 deletions.
2 changes: 1 addition & 1 deletion python/plugins/mapserver_export/mapserverexport.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def run(self):
exporter = Qgis2Map(str(self.dlg.ui.txtQgisFilePath.text()), str(self.dlg.ui.txtMapFilePath.text()))
print "Setting options"
exporter.setOptions(
self.dlg.ui.cmbMapUnits.currentText(),
self.dlg.ui.cmbMapUnits.itemData( self.dlg.ui.cmbMapUnits.currentIndex() ).toString(),
self.dlg.ui.cmbMapImageType.currentText(),
self.dlg.ui.txtMapName.text(),
self.dlg.ui.txtMapWidth.text(),
Expand Down
4 changes: 4 additions & 0 deletions python/plugins/mapserver_export/mapserverexportdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ def __init__(self):
self.ui = Ui_QgsMapserverExportBase()
self.ui.setupUi(self)

for unit in ["dd", "feet", "meters", "miles", "inches", "kilometers"]:
self.ui.cmbMapUnits.addItem( QtGui.QApplication.translate("QgsMapserverExportBase", unit, None, QtGui.QApplication.UnicodeUTF8), QtCore.QVariant(unit) )


6 changes: 3 additions & 3 deletions python/plugins/mapserver_export/ms_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,11 @@ def writeMapLayers(self):
# it's a postgis layer
(pgConnString, sqlData, sqlFilter) = self.parsePostgisConnection(dataString)
layer_def += " CONNECTIONTYPE postgis\n"
layer_def += " CONNECTION '" + pgConnString + "'\n"
layer_def += " DATA '" + sqlData + "'\n"
layer_def += " CONNECTION \"" + pgConnString + "\"\n"
layer_def += " DATA \"" + sqlData + "\"\n"
# don't write the filter keyword if there isn't one
if sqlFilter:
layer_def += " FILTER '" + sqlFilter + "'\n"
layer_def += " FILTER \"" + sqlFilter + "\"\n"

elif providerString == 'wms' and lyr.getAttribute("type").encode('utf-8').upper() == 'RASTER':
# it's a WMS layer
Expand Down
30 changes: 0 additions & 30 deletions python/plugins/mapserver_export/qgsmapserverexportbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -257,36 +257,6 @@
</item>
<item>
<widget class="QComboBox" name="cmbMapUnits" >
<item>
<property name="text" >
<string>dd</string>
</property>
</item>
<item>
<property name="text" >
<string>feet</string>
</property>
</item>
<item>
<property name="text" >
<string>meters</string>
</property>
</item>
<item>
<property name="text" >
<string>miles</string>
</property>
</item>
<item>
<property name="text" >
<string>inches</string>
</property>
</item>
<item>
<property name="text" >
<string>kilometers</string>
</property>
</item>
</widget>
</item>
<item>
Expand Down
6 changes: 0 additions & 6 deletions python/plugins/mapserver_export/ui_mapserverexport.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,6 @@ def retranslateUi(self, QgsMapserverExportBase):
self.btnChooseFooterFile.setText(QtGui.QApplication.translate("QgsMapserverExportBase", "Browse...", None, QtGui.QApplication.UnicodeUTF8))
self.grpMap.setTitle(QtGui.QApplication.translate("QgsMapserverExportBase", "Map", None, QtGui.QApplication.UnicodeUTF8))
self.textLabel3.setText(QtGui.QApplication.translate("QgsMapserverExportBase", "Units", None, QtGui.QApplication.UnicodeUTF8))
self.cmbMapUnits.addItem(QtGui.QApplication.translate("QgsMapserverExportBase", "dd", None, QtGui.QApplication.UnicodeUTF8))
self.cmbMapUnits.addItem(QtGui.QApplication.translate("QgsMapserverExportBase", "feet", None, QtGui.QApplication.UnicodeUTF8))
self.cmbMapUnits.addItem(QtGui.QApplication.translate("QgsMapserverExportBase", "meters", None, QtGui.QApplication.UnicodeUTF8))
self.cmbMapUnits.addItem(QtGui.QApplication.translate("QgsMapserverExportBase", "miles", None, QtGui.QApplication.UnicodeUTF8))
self.cmbMapUnits.addItem(QtGui.QApplication.translate("QgsMapserverExportBase", "inches", None, QtGui.QApplication.UnicodeUTF8))
self.cmbMapUnits.addItem(QtGui.QApplication.translate("QgsMapserverExportBase", "kilometers", None, QtGui.QApplication.UnicodeUTF8))
self.textLabel4.setText(QtGui.QApplication.translate("QgsMapserverExportBase", "Image type", None, QtGui.QApplication.UnicodeUTF8))
self.cmbMapImageType.addItem(QtGui.QApplication.translate("QgsMapserverExportBase", "gif", None, QtGui.QApplication.UnicodeUTF8))
self.cmbMapImageType.addItem(QtGui.QApplication.translate("QgsMapserverExportBase", "gtiff", None, QtGui.QApplication.UnicodeUTF8))
Expand Down

0 comments on commit 0360d75

Please sign in to comment.