Skip to content
Permalink
Browse files

User interface audit updates round #1

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11962 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Nov 7, 2009
1 parent 637910c commit 5d0be94d18158303fdc5be39b4346fbed8430ad5
Showing with 6,084 additions and 5,807 deletions.
  1. +4 −6 python/plugins/mapserver_export/CMakeLists.txt
  2. +48 −8 python/plugins/mapserver_export/mapserverexport.py
  3. +18 −3 python/plugins/mapserver_export/mapserverexportdialog.py
  4. +422 −85 python/plugins/mapserver_export/ms_export.py
  5. +363 −227 python/plugins/mapserver_export/qgsmapserverexportbase.ui
  6. +5 −21 src/app/composer/qgscomposermapwidget.cpp
  7. +1 −2 src/app/composer/qgscomposermapwidget.h
  8. +1 −1 src/gui/qgsdetaileditemdelegate.cpp
  9. +167 −138 src/plugins/copyright_label/pluginguibase.ui
  10. +0 −13 src/plugins/delimited_text/qgsdelimitedtextplugingui.cpp
  11. +256 −269 src/plugins/delimited_text/qgsdelimitedtextpluginguibase.ui
  12. +2 −8 src/plugins/georeferencer/mapcoordsdialog.cpp
  13. +1 −2 src/plugins/georeferencer/mapcoordsdialog.h
  14. +47 −160 src/plugins/georeferencer/mapcoordsdialogbase.ui
  15. +41 −43 src/plugins/georeferencer/qgsgeorefwarpoptionsdialogbase.ui
  16. +170 −153 src/plugins/georeferencer/qgspointdialogbase.ui
  17. +0 −4 src/plugins/gps_importer/qgsgpsdevicedialog.cpp
  18. +283 −259 src/plugins/gps_importer/qgsgpsdevicedialogbase.ui
  19. +0 −89 src/plugins/gps_importer/qgsgpsplugingui.cpp
  20. +457 −516 src/plugins/gps_importer/qgsgpspluginguibase.ui
  21. +94 −92 src/plugins/interpolation/qgsidwinterpolatordialogbase.ui
  22. +398 −410 src/plugins/interpolation/qgsinterpolationdialogbase.ui
  23. +136 −105 src/plugins/interpolation/qgstininterpolatordialogbase.ui
  24. +161 −165 src/plugins/north_arrow/pluginguibase.ui
  25. +340 −320 src/plugins/ogr_converter/ogrconverterguibase.ui
  26. +109 −248 src/plugins/oracle_raster/qgsoracleconnectbase.ui
  27. +2 −2 src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp
  28. +239 −284 src/plugins/oracle_raster/qgsselectgeorasterbase.ui
  29. +151 −180 src/plugins/quick_print/quickprintguibase.ui
  30. +158 −144 src/plugins/raster_terrain_analysis/qgsrasterterrainanalysisdialogbase.ui
  31. +127 −210 src/plugins/scale_bar/pluginguibase.ui
  32. +220 −206 src/plugins/spit/qgsspitbase.ui
  33. +188 −177 src/plugins/wfs/qgswfssourceselectbase.ui
  34. +13 −9 src/ui/qgsaddattrdialogbase.ui
  35. +1 −1 src/ui/qgscomposerbase.ui
  36. +16 −13 src/ui/qgscomposeritemwidgetbase.ui
  37. +542 −404 src/ui/qgscomposermapwidgetbase.ui
  38. +305 −298 src/ui/qgscompositionwidgetbase.ui
  39. +121 −78 src/ui/qgscontinuouscolordialogbase.ui
  40. +122 −114 src/ui/qgscustomprojectiondialogbase.ui
  41. +2 −2 src/ui/qgsfieldcalculatorbase.ui
  42. +62 −61 src/ui/qgsitempositiondialogbase.ui
  43. +60 −46 src/ui/qgsmeasurebase.ui
  44. +231 −231 src/ui/qgsvectorlayerpropertiesbase.ui
@@ -1,15 +1,13 @@
#TODO: Need to configure cmake to run pyrcc4 and pyuic4 as required when the resource
# file or the ui change
SET(INSTALLER_FILES
mapserver_export.png
__init__.py
mapserverexportdialog.py
mapserverexport.py
ms_export.py
resources.py
ui_mapserverexport.py
)

PYQT4_WRAP_UI(PYUI_FILES qgsmapserverexportbase.ui)
PYQT4_ADD_RESOURCES(PYRC_FILES resources.qrc)
ADD_CUSTOM_TARGET(mapserverexport ALL DEPENDS ${PYUI_FILES} ${PYRC_FILES})

SET(INSTALLER_FILES ${INSTALLER_FILES} ${PYUI_FILES} ${PYRC_FILES})

INSTALL(FILES ${INSTALLER_FILES} DESTINATION ${QGIS_DATA_DIR}/python/plugins/mapserver_export)
@@ -16,13 +16,15 @@
* (at your option) any later version. *
* *
***************************************************************************/
/* Adapted by Erik van de Pol, B3Partners BV. */
"""
# Import the PyQt and QGIS libraries
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from xml.dom import minidom
from qgis.core import *
# Initialize Qt resources from file resources.py
import resources_rc
import resources
# Import the code for the dialog
from mapserverexportdialog import MapServerExportDialog
# Import the ms_export script that does the real work
@@ -59,7 +61,7 @@ def initGui(self):
"MapServer Export", self.iface.mainWindow())
#self.action.setWhatsThis("Configuration for Zoom To Point plugin")
# connect the action to the run method
QObject.connect(self.action, SIGNAL("triggered()"), self.run)
QObject.connect(self.action, SIGNAL("activated()"), self.run)
QObject.connect(self.iface, SIGNAL("currentThemeChanged ( QString )"), self.setCurrentTheme)

# Add toolbar button and menu item
@@ -74,17 +76,48 @@ def unload(self):
# run method that performs all the real work
def run(self):
# create and show the MapServerExport dialog
self.dlg = MapServerExportDialog()
self.dlg = MapServerExportDialog()
#dlg.setupUi(self)

project = QgsProject.instance()
# question: save project on loading export dialog?
if project.isDirty():
shouldSave = QMessageBox.question(None,
"Save?",
"Save project to \"" + project.fileName() + "\" before exporting? Only the last saved version of your project will be exported.",
QMessageBox.Yes,
QMessageBox.No,
QMessageBox.Cancel
)
if shouldSave == QMessageBox.Yes:
if project.fileName().size() == 0:
# project has not yet been saved:
saveAsFileName = QFileDialog.getSaveFileName(self.dlg,
"Save QGIS Project file as...",
".",
"QGIS Project Files (*.qgs)",
"Filter list for selecting files from a dialog box")
project.setFileName(saveAsFileName)
project.write()
elif shouldSave == QMessageBox.Cancel:
return # do not show the export dialog

self.dlg.ui.txtQgisFilePath.setText(project.fileName())
self.dlg.ui.txtMapName.setText(project.title())

# TODO: fetch unit used from QSettings

# TODO: fetch width/height guess from QSettings:
# fetch the last used values from settings and intialize the
# dialog with them
#settings = QSettings("MicroResources", "ZoomToPoint")
#xValue = settings.value("coordinate/x")
#dlg.ui.xCoord.setText(str(xValue.toString()))
#self.dlg.ui.xCoord.setText(str(xValue.toString()))
#yValue = settings.value("coordinate/y")
#dlg.ui.yCoord.setText(str(yValue.toString()))
#self.dlg.ui.yCoord.setText(str(yValue.toString()))
#scale = settings.value("zoom/scale", QVariant(4))
#dlg.ui.spinBoxScale.setValue(scale.toInt()[0])
#self.dlg.ui.spinBoxScale.setValue(scale.toInt()[0])

QObject.connect(self.dlg.ui.btnChooseFile, SIGNAL("clicked()"), self.setSaveFile)
QObject.connect(self.dlg.ui.btnChooseProjectFile, SIGNAL("clicked()"), self.setProjectFile)
QObject.connect(self.dlg.ui.chkExpLayersOnly, SIGNAL("clicked(bool)"), self.toggleLayersOnly)
@@ -100,15 +133,22 @@ def run(self):
print "Creating exporter using %s and %s" % (self.dlg.ui.txtQgisFilePath.text(), self.dlg.ui.txtMapFilePath.text())
exporter = Qgis2Map(unicode(self.dlg.ui.txtQgisFilePath.text()), unicode(self.dlg.ui.txtMapFilePath.text()))
print "Setting options"
exporter.setOptions(
exporter.setOptions(
unicode(self.dlg.ui.txtMapServerUrl.text()),
unicode(self.dlg.ui.cmbMapUnits.itemData( self.dlg.ui.cmbMapUnits.currentIndex() ).toString()),
unicode(self.dlg.ui.cmbMapImageType.currentText()),
unicode(self.dlg.ui.txtMapName.text()),
unicode(self.dlg.ui.txtMapWidth.text()),
unicode(self.dlg.ui.txtMapHeight.text()),
unicode(self.dlg.ui.txtWebTemplate.text()),
unicode(self.dlg.ui.txtWebFooter.text()),
unicode(self.dlg.ui.txtWebHeader.text())
unicode(self.dlg.ui.txtWebHeader.text()),
self.dlg.ui.checkBoxDump.isChecked(),
self.dlg.ui.checkBoxForce.isChecked(),
self.dlg.ui.checkBoxAntiAlias.isChecked(),
self.dlg.ui.checkBoxPartials.isChecked(),
unicode(self.dlg.ui.txtFontsetPath.text()),
unicode(self.dlg.ui.txtSymbolsetPath.text())
)
print "Calling writeMapFile"
result = exporter.writeMapFile()
@@ -18,16 +18,31 @@
***************************************************************************/
"""
from PyQt4 import QtCore, QtGui
from ui_qgsmapserverexportbase import Ui_QgsMapserverExportBase
from ms_export import defaults
from ui_mapserverexport import Ui_QgsMapserverExportBase
# create the dialog for mapserver export
class MapServerExportDialog(QtGui.QDialog):
def __init__(self):
def __init__(self):
QtGui.QDialog.__init__(self)
# Set up the user interface from Designer.
self.ui = Ui_QgsMapserverExportBase()
self.ui.setupUi(self)

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

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



0 comments on commit 5d0be94

Please sign in to comment.
You can’t perform that action at this time.