@@ -1074,15 +1074,13 @@ void QgisApp::setupConnections()
10741074 connect (mMapCanvas , SIGNAL (extentsChanged (QgsRect )),this ,SLOT (showExtents (QgsRect )));
10751075 connect (mMapCanvas , SIGNAL (scaleChanged (QString)), this , SLOT (showScale (QString)));
10761076 connect (mMapCanvas , SIGNAL (scaleChanged (QString)), this , SLOT (updateMouseCoordinatePrecision ()));
1077-
1078- connect (mMapLegend , SIGNAL (currentChanged (Q3ListViewItem *)), this , SLOT (currentLayerChanged (Q3ListViewItem *)));
10791077
10801078 connect (mRenderSuppressionCBox , SIGNAL (toggled (bool )), mMapCanvas , SLOT (setRenderFlag (bool )));
10811079}
10821080void QgisApp::createCanvas ()
10831081{
10841082 // "theMapCanvas" used to find this canonical instance later
1085- mMapCanvas = new QgsMapCanvas (this , " theMapCanvas" );
1083+ mMapCanvas = new QgsMapCanvas (NULL , " theMapCanvas" );
10861084 QWhatsThis::add (mMapCanvas , tr (" Map canvas. This is where raster and vector layers are displayed when added to the map" ));
10871085
10881086 mMapCanvas ->setMinimumWidth (10 );
@@ -3777,81 +3775,6 @@ void QgisApp::zoomToLayerExtent()
37773775} // QgisApp::zoomToLayerExtent()
37783776
37793777
3780-
3781- void QgisApp::currentLayerChanged (Q3ListViewItem * lvi)
3782- {
3783- #ifdef QGISDEBUG
3784- std::cout << " QgisApp::currentLayerChanged()" << std::endl;
3785- #endif
3786- if (lvi)
3787- {
3788- // disable/enable toolbar buttons as appropriate based on selected
3789- // layer type
3790-
3791- toolPopupCapture->setItemEnabled (0 ,FALSE );
3792- toolPopupCapture->setItemEnabled (1 ,FALSE );
3793- toolPopupCapture->setItemEnabled (2 ,FALSE );
3794- toolPopupCapture->setItemEnabled (3 ,FALSE );
3795-
3796-
3797- QgsLegendLayerFile* llf = dynamic_cast <QgsLegendLayerFile*>(lvi);
3798- if (llf)
3799- {
3800- QgsMapLayer *layer = llf->layer ();
3801- if (layer->type () == QgsMapLayer::RASTER)
3802- {
3803- // actionIdentify->setEnabled(FALSE);
3804- mActionSelect ->setEnabled (FALSE );
3805- mActionOpenTable ->setEnabled (FALSE );
3806- }
3807- else
3808- {
3809- // vector layer editing buttons
3810- QgsMapLayer* mlayer=llf->layer ();
3811- if (mlayer)
3812- {
3813- QgsVectorLayer* vlayer=dynamic_cast <QgsVectorLayer*>(mlayer);
3814- if (vlayer)
3815- {
3816- const QgsVectorDataProvider* provider=vlayer->getDataProvider ();
3817- if (provider)
3818- {
3819- int cap=vlayer->getDataProvider ()->capabilities ();
3820- if (cap&QgsVectorDataProvider::DeleteFeatures)
3821- {
3822- toolPopupCapture->setItemEnabled (3 ,TRUE );
3823- }
3824- if (cap&QgsVectorDataProvider::AddFeatures)
3825- {
3826- if (vlayer->vectorType ()==QGis::Point)
3827- {
3828- toolPopupCapture->setItemEnabled (0 ,TRUE );
3829- }
3830- else if (vlayer->vectorType ()==QGis::Line)
3831- {
3832- toolPopupCapture->setItemEnabled (1 ,TRUE );
3833- }
3834- else if (vlayer->vectorType ()==QGis::Polygon)
3835- {
3836- toolPopupCapture->setItemEnabled (2 ,TRUE );
3837- }
3838- }
3839- }
3840- }
3841-
3842- mActionIdentify ->setEnabled (TRUE );
3843- mActionSelect ->setEnabled (TRUE );
3844- mActionOpenTable ->setEnabled (TRUE );
3845- }
3846-
3847- // notify the project we've made a change
3848- QgsProject::instance ()->dirty (true );
3849- }
3850- }
3851- }
3852- } // QgisApp::currentLayerChanged
3853-
3854-
38553778QgisIface *QgisApp::getInterface ()
38563779{
38573780 return mQgisInterface ;
0 commit comments