Skip to content
Permalink
Browse files

[GRASS] add edit renderer when plugin is inited

  • Loading branch information
blazek committed Oct 16, 2015
1 parent 3c85c7e commit 15af98745bd5ae2821421f134289592b7593f305
Showing with 10 additions and 9 deletions.
  1. +10 −9 src/plugins/grass/qgsgrassplugin.cpp
@@ -288,6 +288,16 @@ void QgsGrassPlugin::initGui()
mTools = new QgsGrassTools( qGisInterface, qGisInterface->mainWindow() );
qGisInterface->addDockWidget( Qt::RightDockWidgetArea, mTools );

// add edit renderer immediately so that if project was saved during editing, the layer can be loaded
if ( !QgsRendererV2Registry::instance()->renderersList().contains( "grassEdit" ) )
{
QgsRendererV2Registry::instance()->addRenderer( new QgsRendererV2Metadata( "grassEdit",
QObject::tr( "GRASS Edit" ),
QgsGrassEditRenderer::create,
QIcon(),
QgsGrassEditRendererWidget::create ) );
}

onGisbaseChanged();
mapsetChanged();
}
@@ -409,15 +419,6 @@ void QgsGrassPlugin::onEditingStarted()
//vectorLayer->styleManager()->addStyle( editStyleName, QgsMapLayerStyle() );
vectorLayer->styleManager()->setCurrentStyle( editStyleName );

if ( !QgsRendererV2Registry::instance()->renderersList().contains( "grassEdit" ) )
{
QgsRendererV2Registry::instance()->addRenderer( new QgsRendererV2Metadata( "grassEdit",
QObject::tr( "GRASS Edit" ),
QgsGrassEditRenderer::create,
QIcon(),
QgsGrassEditRendererWidget::create ) );
}

QgsGrassEditRenderer *renderer = new QgsGrassEditRenderer();

vectorLayer->setRendererV2( renderer );

0 comments on commit 15af987

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