Skip to content
Permalink
Browse files
mapserver export fix:
- 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 0360d75703914b28d958cc8dbe2b2177cd560f35
@@ -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(),
@@ -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) )


@@ -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
@@ -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>
@@ -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))

0 comments on commit 0360d75

Please sign in to comment.