Skip to content

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed
 

‎src/plugins/grass/qgsgrassplugin.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// includes
1919
#include "qgisapp.h"
2020
#include "qgsmaplayer.h"
21+
#include "qgslegend.h"
2122
#include "qgisiface.h"
2223
#include "qgsmapcanvas.h"
2324
#include "qgsmaplayer.h"
@@ -222,8 +223,11 @@ void QgsGrassPlugin::initGui()
222223
// Connect display region
223224
connect( mCanvas, SIGNAL(renderComplete(QPainter *)), this, SLOT(postRender(QPainter *)));
224225

225-
226-
connect ( mCanvas, SIGNAL(layersChanged()), this, SLOT(setEditAction()) );
226+
setEditAction();
227+
//connect ( qGisInterface, SIGNAL(currentLayerChanged(QgsMapLayer *)),
228+
// this, SLOT(setEditAction()) );
229+
connect ( mQgis->legend(), SIGNAL(currentLayerChanged(QgsMapLayer *)),
230+
this, SLOT(setEditAction()) );
227231

228232
// Init Region symbology
229233
mRegionPen.setColor( QColor ( settings.readEntry ("/GRASS/region/color", "#ff0000" ) ) );
@@ -468,9 +472,6 @@ void QgsGrassPlugin::setEditAction()
468472
{
469473
mEditAction->setEnabled(false);
470474
}
471-
472-
// TODO connect to currentItemChanged()? and disable this:
473-
mEditAction->setEnabled(true);
474475
}
475476

476477
void QgsGrassPlugin::newVector()

0 commit comments

Comments
 (0)
Please sign in to comment.