Skip to content
Permalink
Browse files

Merge branch 'server_search'

  • Loading branch information
mhugent committed Aug 18, 2011
2 parents 22f5ba2 + 0c8695c commit 0ba0f9346585a13e9164e5527438d92cb609b343
Showing with 295 additions and 91 deletions.
  1. +49 −0 src/mapserver/qgsprojectparser.cpp
  2. +3 −0 src/mapserver/qgsprojectparser.h
  3. +228 −84 src/mapserver/qgswmsserver.cpp
  4. +15 −7 src/mapserver/qgswmsserver.h
@@ -22,6 +22,7 @@
#include "qgslogger.h"
#include "qgsmapserviceexception.h"
#include "qgsrasterlayer.h"
#include "qgsrenderer.h"
#include "qgsvectorlayer.h"

#include "qgscomposition.h"
@@ -42,6 +43,7 @@ QgsProjectParser::QgsProjectParser( QDomDocument* xmlDoc, const QString& filePat
{
mOutputUnits = QgsMapRenderer::Millimeters;
setLegendParametersFromProject();
setSelectionColor();
}

QgsProjectParser::~QgsProjectParser()
@@ -1409,3 +1411,50 @@ QString QgsProjectParser::convertToAbsolutePath( const QString& file ) const
return projElems.join( "/" );
}

void QgsProjectParser::setSelectionColor()
{
int red = 255;
int green = 255;
int blue = 0;
int alpha = 255;

//overwrite default selection color with settings from the project
if ( mXMLDoc )
{
QDomElement qgisElem = mXMLDoc->documentElement();
if ( !qgisElem.isNull() )
{
QDomElement propertiesElem = qgisElem.firstChildElement( "properties" );
if ( !propertiesElem.isNull() )
{
QDomElement guiElem = propertiesElem.firstChildElement( "Gui" );
if ( !guiElem.isNull() )
{
QDomElement redElem = guiElem.firstChildElement( "SelectionColorRedPart" );
if ( !redElem.isNull() )
{
red = redElem.text().toInt();
}
QDomElement greenElem = guiElem.firstChildElement( "SelectionColorGreenPart" );
if ( !greenElem.isNull() )
{
green = greenElem.text().toInt();
}
QDomElement blueElem = guiElem.firstChildElement( "SelectionColorBluePart" );
if ( !blueElem.isNull() )
{
blue = blueElem.text().toInt();
}
QDomElement alphaElem = guiElem.firstChildElement( "SelectionColorAlphaPart" );
if ( !alphaElem.isNull() )
{
alpha = alphaElem.text().toInt();
}
}
}
}
}

QgsRenderer::setSelectionColor( QColor( red, green, blue, alpha ) );
}

@@ -145,6 +145,9 @@ class QgsProjectParser: public QgsConfigParser

/**Converts a (possibly relative) path to absolute*/
QString convertToAbsolutePath( const QString& file ) const;

/**Sets global selection color from the project or yellow if not defined in project*/
void setSelectionColor();
};

#endif // QGSPROJECTPARSER_H

0 comments on commit 0ba0f93

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