2008-01-10 04:49:11 +00:00
|
|
|
"""
|
|
|
|
/***************************************************************************
|
|
|
|
MapServerExport - A QGIS plugin to export a saved project file
|
|
|
|
to a MapServer map file
|
|
|
|
-------------------
|
|
|
|
begin : 2008-01-07
|
|
|
|
copyright : (C) 2007 by Gary E.Sherman
|
|
|
|
email : sherman at mrcc.com
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
***************************************************************************/
|
|
|
|
"""
|
|
|
|
from PyQt4 import QtCore, QtGui
|
2009-11-07 16:59:29 +00:00
|
|
|
from ms_export import defaults
|
|
|
|
from ui_mapserverexport import Ui_QgsMapserverExportBase
|
2008-01-10 04:49:11 +00:00
|
|
|
# create the dialog for mapserver export
|
|
|
|
class MapServerExportDialog(QtGui.QDialog):
|
2009-11-07 16:59:29 +00:00
|
|
|
def __init__(self):
|
2008-01-10 04:49:11 +00:00
|
|
|
QtGui.QDialog.__init__(self)
|
|
|
|
# Set up the user interface from Designer.
|
|
|
|
self.ui = Ui_QgsMapserverExportBase()
|
|
|
|
self.ui.setupUi(self)
|
|
|
|
|
2009-11-07 16:59:29 +00:00
|
|
|
for unit in ["meters", "dd", "feet", "miles", "inches", "kilometers"]:
|
2008-12-13 13:19:26 +00:00
|
|
|
self.ui.cmbMapUnits.addItem( QtGui.QApplication.translate("QgsMapserverExportBase", unit, None, QtGui.QApplication.UnicodeUTF8), QtCore.QVariant(unit) )
|
2009-11-07 16:59:29 +00:00
|
|
|
|
|
|
|
# TODO: set default unit. Is now the first value entered in the unit-list above
|
|
|
|
|
|
|
|
# Set defaults from ms_export.py:
|
|
|
|
self.ui.txtMapServerUrl.setText(defaults.mapServerUrl)
|
|
|
|
self.ui.txtFontsetPath.setText(defaults.fontsPath)
|
|
|
|
self.ui.txtSymbolsetPath.setText(defaults.symbolsPath)
|
|
|
|
self.ui.checkBoxAntiAlias.setChecked(defaults.antialias)
|
|
|
|
self.ui.checkBoxDump.setChecked(defaults.dump)
|
|
|
|
self.ui.checkBoxForce.setChecked(defaults.force)
|
|
|
|
self.ui.checkBoxPartials.setChecked(defaults.partials)
|
|
|
|
self.ui.txtMapWidth.setText(defaults.width)
|
|
|
|
self.ui.txtMapHeight.setText(defaults.height)
|
|
|
|
|
2008-12-13 13:19:26 +00:00
|
|
|
|
|
|
|
|