-qgisapp - fix for opening help files on win32.

-qgsoptionsbase - added browse button to preferences dialog so user can browse to location of the web browser.
-qgsprojectio and renderers - fix so project files are stored properly under win32


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@1762 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
gsherman 2004-07-14 21:36:04 +00:00
parent aafbb5137b
commit d93a13d067
6 changed files with 86 additions and 53 deletions

View File

@ -2407,7 +2407,7 @@ void QgisApp::openURL(QString url, bool useQgisDocDirectory)
// open help in user browser
if (useQgisDocDirectory)
{
url = mAppDir + "/share/qgis/doc/" + url;
url = "file://" + mAppDir + "/share/qgis/doc/" + url;
}
// find a browser
QSettings settings;
@ -2436,6 +2436,7 @@ void QgisApp::openURL(QString url, bool useQgisDocDirectory)
{
// find the installed location of the help files
// open index.html using browser
//XXX for debug on win32 QMessageBox::information(this,"Help opening...", browser + " - " + url);
QProcess *helpProcess = new QProcess(this);
helpProcess->addArgument(browser);
helpProcess->addArgument(url);

View File

@ -328,7 +328,7 @@ void QgsContinuousColRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl
void QgsContinuousColRenderer::writeXML(std::ofstream& xml)
{
xml << "\t\t<continuoussymbol>\n";
xml << "\t\t\t<classificationfield>" + QString::number(this->classificationField()) +
xml << "\t\t\t<classificationfield>" << QString::number(this->classificationField()).ascii() <<
"</classificationfield>\n";
@ -345,16 +345,15 @@ void QgsContinuousColRenderer::writeXML(std::ofstream& xml)
<< "\" blue=\""
<< QString::number(lsymbol->pen().color().blue()).ascii()
<< "\" />\n";
xml << "\t\t\t\t\t\t<outlinestyle>" + QgsSymbologyUtils::penStyle2QString(lsymbol->pen().style()) +
"</outlinestyle>\n";
xml << "\t\t\t\t\t\t<outlinewidth>" + QString::number(lsymbol->pen().width()) + "</outlinewidth>\n";
xml << "\t\t\t\t\t\t<fillcolor red=\"" + QString::number(lsymbol->brush().color().red()) + "\" green=\"" +
QString::number(lsymbol->brush().color().green()) + "\" blue=\"" +
QString::number(lsymbol->brush().color().blue()) + "\" />\n";
xml << "\t\t\t\t\t\t<fillpattern>" + QgsSymbologyUtils::brushStyle2QString(lsymbol->brush().style()) +
xml << "\t\t\t\t\t\t<outlinestyle>" << QgsSymbologyUtils::penStyle2QString(lsymbol->pen().style()).ascii() << "</outlinestyle>\n";
xml << "\t\t\t\t\t\t<outlinewidth>" << QString::number(lsymbol->pen().width()).ascii() << "</outlinewidth>\n";
xml << "\t\t\t\t\t\t<fillcolor red=\"" << QString::number(lsymbol->brush().color().red()).ascii() << "\" green=\"" <<
QString::number(lsymbol->brush().color().green()).ascii() << "\" blue=\"" <<
QString::number(lsymbol->brush().color().blue()).ascii() << "\" />\n";
xml << "\t\t\t\t\t\t<fillpattern>" << QgsSymbologyUtils::brushStyle2QString(lsymbol->brush().style()).ascii() <<
"</fillpattern>\n";
xml << "\t\t\t\t\t</symbol>\n";
xml << "\t\t\t\t\t<label>" + lowestitem->label() + "</label>\n";
xml << "\t\t\t\t\t<label>" << lowestitem->label().ascii() << "</label>\n";
xml << "\t\t\t\t</renderitem>\n";
xml << "\t\t\t</lowestitem>\n";
@ -362,21 +361,21 @@ void QgsContinuousColRenderer::writeXML(std::ofstream& xml)
QgsSymbol *hsymbol = highestitem->getSymbol();
xml << "\t\t\t<highestitem>\n";
xml << "\t\t\t\t<renderitem>\n";
xml << "\t\t\t\t<value>" + highestitem->value() + "</value>\n";
xml << "\t\t\t\t<value>" << highestitem->value() << "</value>\n";
xml << "\t\t\t\t\t<symbol>\n";
xml << "\t\t\t\t\t\t<outlinecolor red=\"" + QString::number(hsymbol->pen().color().red()) + "\" green=\"" +
QString::number(hsymbol->pen().color().green()) + "\" blue=\"" + QString::number(hsymbol->pen().color().blue()) +
xml << "\t\t\t\t\t\t<outlinecolor red=\"" << QString::number(hsymbol->pen().color().red()).ascii() << "\" green=\"" <<
QString::number(hsymbol->pen().color().green()).ascii() << "\" blue=\"" << QString::number(hsymbol->pen().color().blue()).ascii() <<
"\" />\n";
xml << "\t\t\t\t\t\t<outlinestyle>" + QgsSymbologyUtils::penStyle2QString(hsymbol->pen().style()) +
xml << "\t\t\t\t\t\t<outlinestyle>" << QgsSymbologyUtils::penStyle2QString(hsymbol->pen().style()).ascii() <<
"</outlinestyle>\n";
xml << "\t\t\t\t\t\t<outlinewidth>" + QString::number(hsymbol->pen().width()) + "</outlinewidth>\n";
xml << "\t\t\t\t\t\t<fillcolor red=\"" + QString::number(hsymbol->brush().color().red()) + "\" green=\"" +
QString::number(hsymbol->brush().color().green()) + "\" blue=\"" +
QString::number(hsymbol->brush().color().blue()) + "\" />\n";
xml << "\t\t\t\t\t\t<fillpattern>" + QgsSymbologyUtils::brushStyle2QString(hsymbol->brush().style()) +
xml << "\t\t\t\t\t\t<outlinewidth>" << QString::number(hsymbol->pen().width()).ascii() << "</outlinewidth>\n";
xml << "\t\t\t\t\t\t<fillcolor red=\"" << QString::number(hsymbol->brush().color().red()).ascii() << "\" green=\"" <<
QString::number(hsymbol->brush().color().green()).ascii() << "\" blue=\"" <<
QString::number(hsymbol->brush().color().blue()).ascii() << "\" />\n";
xml << "\t\t\t\t\t\t<fillpattern>" << QgsSymbologyUtils::brushStyle2QString(hsymbol->brush().style()).ascii() <<
"</fillpattern>\n";
xml << "\t\t\t\t\t</symbol>\n";
xml << "\t\t\t\t\t<label>" + highestitem->label() + "</label>\n";
xml << "\t\t\t\t\t<label>" << highestitem->label().ascii() << "</label>\n";
xml << "\t\t\t\t</renderitem>\n";
xml << "\t\t\t</highestitem>\n";
xml << "\t\t</continuoussymbol>\n";

View File

@ -250,29 +250,29 @@ void QgsGraduatedSymRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl)
void QgsGraduatedSymRenderer::writeXML(std::ofstream& xml)
{
xml << "\t\t<graduatedsymbol>\n";
xml << "\t\t\t<classificationfield>" + QString::number(this->classificationField()) +
xml << "\t\t\t<classificationfield>" << QString::number(this->classificationField()) +
"</classificationfield>\n";
for (std::list < QgsRangeRenderItem * >::iterator it = this->items().begin(); it != this->items().end();
++it)
{
xml << "\t\t\t<rangerenderitem>\n";
xml << "\t\t\t\t<lowervalue>" + (*it)->value() + "</lowervalue>\n";
xml << "\t\t\t\t<uppervalue>" + (*it)->upper_value() + "</uppervalue>\n";
xml << "\t\t\t\t<lowervalue>" << (*it)->value().ascii() << "</lowervalue>\n";
xml << "\t\t\t\t<uppervalue>" << (*it)->upper_value().ascii() << "</uppervalue>\n";
xml << "\t\t\t\t<symbol>\n";
QgsSymbol *symbol = (*it)->getSymbol();
xml << "\t\t\t\t\t<outlinecolor red=\"" + QString::number(symbol->pen().color().red()) + "\" green=\"" +
QString::number(symbol->pen().color().green()) + "\" blue=\"" + QString::number(symbol->pen().color().blue()) +
xml << "\t\t\t\t\t<outlinecolor red=\"" << QString::number(symbol->pen().color().red()).ascii() << "\" green=\"" <<
QString::number(symbol->pen().color().green()).ascii() << "\" blue=\"" << QString::number(symbol->pen().color().blue()).ascii() <<
"\" />\n";
xml << "\t\t\t\t\t<outlinestyle>" + QgsSymbologyUtils::penStyle2QString(symbol->pen().style()) +
xml << "\t\t\t\t\t<outlinestyle>" << QgsSymbologyUtils::penStyle2QString(symbol->pen().style()).ascii() <<
"</outlinestyle>\n";
xml << "\t\t\t\t\t<outlinewidth>" + QString::number(symbol->pen().width()) + "</outlinewidth>\n";
xml << "\t\t\t\t\t<fillcolor red=\"" + QString::number(symbol->brush().color().red()) + "\" green=\"" +
QString::number(symbol->brush().color().green()) + "\" blue=\"" +
QString::number(symbol->brush().color().blue()) + "\" />\n";
xml << "\t\t\t\t\t<fillpattern>" + QgsSymbologyUtils::brushStyle2QString(symbol->brush().style()) +
xml << "\t\t\t\t\t<outlinewidth>" << QString::number(symbol->pen().width()).ascii() << "</outlinewidth>\n";
xml << "\t\t\t\t\t<fillcolor red=\"" << QString::number(symbol->brush().color().red()).ascii() << "\" green=\"" <<
QString::number(symbol->brush().color().green()).ascii() << "\" blue=\"" <<
QString::number(symbol->brush().color().blue()).ascii() << "\" />\n";
xml << "\t\t\t\t\t<fillpattern>" << QgsSymbologyUtils::brushStyle2QString(symbol->brush().style()).ascii() <<
"</fillpattern>\n";
xml << "\t\t\t\t</symbol>\n";
xml << "\t\t\t\t<label>" + (*it)->label() + "</label>\n";
xml << "\t\t\t\t<label>" << (*it)->label().ascii() << "</label>\n";
xml << "\t\t\t</rangerenderitem>\n";
}
xml << "\t\t</graduatedsymbol>\n";

File diff suppressed because one or more lines are too long

View File

@ -7,6 +7,7 @@
** place of a destructor.
*****************************************************************************/
#include <qsettings.h>
#include <qfiledialog.h>
void QgsOptionsBase::init()
{
@ -50,3 +51,14 @@ void QgsOptionsBase::themeChanged(const QString & )
{
}
void QgsOptionsBase::findBrowser()
{
cmbBrowser->setCurrentText(QFileDialog::getOpenFileName(
"./",
"Applications (*.exe)",
this,
"open file dialog",
"Choose a browser" ));
}

View File

@ -12,7 +12,7 @@ email : sherman at mrcc.com
* (at your option) any later version. *
* *
***************************************************************************/
/* qgsprojectio.cpp,v 1.45 2004/07/11 06:01:09 mhugent Exp */
/* qgsprojectio.cpp,v 1.46 2004/07/14 21:36:04 gsherman Exp */
#include <iostream>
#include <fstream>
#include <qfiledialog.h>
@ -466,7 +466,7 @@ void QgsProjectIo::writeXML(QgsRect theExtent)
qWarning("Warning, cast failed in QgsProjectIo, line 451");
}
xml << "\t\t<provider>" << layer->providerType() << "</provider>\n";
xml << "\t\t<provider>" << layer->providerType().ascii() << "</provider>\n";
QgsRenderer* renderer;
if(renderer=layer->renderer())