Skip to content

Commit

Permalink
Added message box to display status of the MapServer export.
Browse files Browse the repository at this point in the history
Fixes bug #520


git-svn-id: http://svn.osgeo.org/qgis/trunk@7444 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
gsherman committed Nov 17, 2007
1 parent f35fb37 commit 88b602b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 11 additions & 3 deletions tools/mapserver_export/ms_export.py
Expand Up @@ -20,7 +20,7 @@
# CHANGES SHOULD NOT BE MADE TO THE writeMapFile METHOD UNLESS YOU
# ARE CHANGING THE QgsMapserverExport CLASS AND YOU KNOW WHAT YOU ARE
# DOING
import sys, string
import sys, string, os
from xml.dom import minidom, Node

# symbol map
Expand Down Expand Up @@ -69,42 +69,50 @@ def writeMapFile(self):
# write the general map and web settings
print " --- python : map section "
self.writeMapSection()
logmsg = "Wrote map section\n"
print " --- python : map section done"
# write the projection section
print " --- python : proj section "
self.writeProjectionSection()
logmsg += "Wrote projection section\n"
print " --- python : proj section done"
# write the output format section
print " --- python : outputformat section "
self.writeOutputFormat()
logmsg += "Wrote output format section\n"
print " --- python : outputformat section done"
# write the legend section
print " --- python : legend section"
self.writeLegendSection()
logmsg += "Wrote legend section\n"
print " --- python : legend section done"

# write the WEB section
print " --- python : web section "
self.writeWebSection()
logmsg += "Wrote web section\n"
print " --- python : web section done"

# write the LAYER sections
print " --- python : layer section "
self.writeMapLayers()
logmsg += "Wrote map layers\n"
print " --- python : layer section done"

# write the symbol defs section
# must happen after layers so we can build a symbol queue
print " --- python : symbol section "
self.writeSymbolSection()
logmsg += "Wrote symbol section\n"
print " --- python : symbol section done"

# END and close the map file
self.outFile.write("END")
self.outFile.close()

ret = "Writing the map file using " + self.project + " " + self.mapFile
return ret
logmsg += "Map file completed for " + os.path.basename(self.project) + "\n"
logmsg += "Map file saved as " + os.path.basename(self.mapFile) + "\n"
return logmsg

# Write the general parts of the map section
def writeMapSection(self):
Expand Down
4 changes: 3 additions & 1 deletion tools/mapserver_export/qgsmapserverexport.cpp
Expand Up @@ -169,7 +169,9 @@ void QgsMapserverExport::apply()
pstr = PyEval_CallObject(pmeth, pargs);
// Show the return value
PyArg_Parse(pstr, "s", &cstr);
std::cout << cstr << std::endl;
std::cout << "Result: " << std::endl << cstr << std::endl;
// Show the results to the user
QMessageBox::information(this, "Results of Export", QString(cstr));

Py_DECREF(pstr);

Expand Down

0 comments on commit 88b602b

Please sign in to comment.