Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added possibility not to draw vertex markers when a layer is in editi…
…ng mode

git-svn-id: http://svn.osgeo.org/qgis/trunk@10121 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Feb 7, 2009
1 parent 70e7bb8 commit 092937a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/app/qgsoptions.cpp
Expand Up @@ -207,6 +207,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
//vertex marker
mMarkerStyleComboBox->addItem( tr( "Semi transparent circle" ) );
mMarkerStyleComboBox->addItem( tr( "Cross" ) );
mMarkerStyleComboBox->addItem( tr( "None" ) );

QString markerStyle = settings.value( "/qgis/digitizing/marker_style", "SemiTransparentCircle" ).toString();
if ( markerStyle == "SemiTransparentCircle" )
Expand All @@ -217,6 +218,10 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
{
mMarkerStyleComboBox->setCurrentIndex( mMarkerStyleComboBox->findText( tr( "Cross" ) ) );
}
else if (markerStyle == "None" )
{
mMarkerStyleComboBox->setCurrentIndex( mMarkerStyleComboBox->findText( tr( "None" ) ) );
}

chkDisableAttributeValuesDlg->setChecked( settings.value( "/qgis/digitizing/disable_enter_attribute_values_dialog", false ).toBool() );

Expand Down Expand Up @@ -387,6 +392,10 @@ void QgsOptions::saveOptions()
{
settings.setValue( "/qgis/digitizing/marker_style", "Cross" );
}
else if ( markerComboText == tr( "None" ) )
{
settings.setValue( "/qgis/digitizing/marker_style", "None" );
}

settings.setValue( "/qgis/digitizing/disable_enter_attribute_values_dialog", chkDisableAttributeValuesDlg->isChecked() );

Expand Down
8 changes: 6 additions & 2 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -808,7 +808,7 @@ void QgsVectorLayer::drawVertexMarker( int x, int y, QPainter& p, QgsVectorLayer
p.setBrush( QColor( 200, 200, 210, 120 ) );
p.drawEllipse( QRectF( x - 7, y - 7, 14, 14 ) );
}
else
else if ( type == QgsVectorLayer::Cross )
{
int size = 15;
int m = ( size - 1 ) / 2;
Expand Down Expand Up @@ -3303,10 +3303,14 @@ QgsVectorLayer::VertexMarkerType QgsVectorLayer::currentVertexMarkerType()
{
return QgsVectorLayer::Cross;
}
else
else if ( markerTypeString == "SemiTransparentCircle" )
{
return QgsVectorLayer::SemiTransparentCircle;
}
else
{
return QgsVectorLayer::NoMarker;
}
}

void QgsVectorLayer::drawFeature( QPainter* p,
Expand Down
3 changes: 2 additions & 1 deletion src/core/qgsvectorlayer.h
Expand Up @@ -465,7 +465,8 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
enum VertexMarkerType
{
SemiTransparentCircle,
Cross
Cross,
NoMarker /* added in version 1.1 */
};

/** vector layers are not copyable */
Expand Down

0 comments on commit 092937a

Please sign in to comment.