[QGIS Commit] r8758 - trunk/qgis/src/plugins/grass
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Fri Jul 11 19:04:43 EDT 2008
Author: timlinux
Date: 2008-07-11 19:04:43 -0400 (Fri, 11 Jul 2008)
New Revision: 8758
Modified:
trunk/qgis/src/plugins/grass/qgsgrassedit.cpp
Log:
Fix for ticket #1148 "GRASS Edit: can't modify Dynamic color"
Modified: trunk/qgis/src/plugins/grass/qgsgrassedit.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassedit.cpp 2008-07-11 21:37:14 UTC (rev 8757)
+++ trunk/qgis/src/plugins/grass/qgsgrassedit.cpp 2008-07-11 23:04:43 UTC (rev 8758)
@@ -142,6 +142,7 @@
//TODO dynamic_cast ?
mProvider = (QgsGrassProvider *) mLayer->getDataProvider();
+
init();
}
@@ -207,6 +208,12 @@
return;
}
+
+ mRubberBandLine = new QgsRubberBand(mCanvas);
+ mRubberBandIcon = new QgsVertexMarker(mCanvas);
+ mRubberBandLine->setZValue(20);
+ mRubberBandIcon->setZValue(20);
+
connect ( mCanvas, SIGNAL(keyPressed(QKeyEvent *)), this, SLOT(keyPress(QKeyEvent *)) );
QString myIconPath = QgsApplication::themePath() + "/grass/";
@@ -387,6 +394,8 @@
for ( int i = 0; i < SYMB_COUNT; i++ ) {
bool ok;
+
+
bool displ = settings.readBoolEntry (
spath + "display/" + QString::number(i),
true, &ok );
@@ -400,6 +409,11 @@
if ( ok ) {
QColor color( colorName );
mSymb[i].setColor( color );
+ // Use the 'dynamic' color for mRubberBand
+ if ( i == SYMB_DYNAMIC )
+ {
+ mRubberBandLine->setColor(QColor(colorName));
+ }
}
mSymb[i].setWidth( mLineWidth );
}
@@ -415,6 +429,7 @@
symbologyList->clear();
symbologyList->setSorting(-1);
+
for ( int i = SYMB_COUNT-1; i >= 0; i-- ) {
if ( i == SYMB_NODE_0 ) continue;
@@ -492,11 +507,8 @@
mPixmap = &mCanvasEdit->pixmap();
- mRubberBandLine = new QgsRubberBand(mCanvas);
- mRubberBandIcon = new QgsVertexMarker(mCanvas);
- mRubberBandLine->setZValue(20);
- mRubberBandIcon->setZValue(20);
+
// Init GUI values
mCatModeBox->insertItem( tr("Next not used"), CAT_MODE_NEXT );
mCatModeBox->insertItem( tr("Manual entry"), CAT_MODE_MANUAL );
@@ -729,6 +741,11 @@
// TODO use a name instead of index
sn.sprintf( "/GRASS/edit/symb/color/%d", index );
settings.writeEntry ( sn, mSymb[index].color().name() );
+ // Use the 'dynamic' color for mRubberBand
+ if ( index == SYMB_DYNAMIC )
+ {
+ mRubberBandLine->setColor(color);
+ }
}
}
More information about the QGIS-commit
mailing list