layers are now editable by default such that people do not have to search for the layer file in the legend

git-svn-id: http://svn.osgeo.org/qgis/trunk@5232 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
mhugent 2006-04-08 16:41:28 +00:00
parent ea91bfbdc2
commit b1bc18490b
3 changed files with 17 additions and 2 deletions

View File

@ -85,7 +85,7 @@ void QgsMapToolCapture::canvasReleaseEvent(QMouseEvent * e)
if (!vlayer->isEditable())
{
QMessageBox::information(0,"Layer not editable",
"Cannot edit the vector layer. Use 'Start editing' in the legend item menu",
"Cannot edit the vector layer. To make it editable, go to the file item of the layer, right click and check 'Allow Editing'.",
QMessageBox::Ok);
return;
}

View File

@ -138,6 +138,11 @@ QgsVectorLayer::QgsVectorLayer(QString vectorLayerPath,
// have no effect on existing layers
QSettings settings;
updateThreshold = settings.readNumEntry("Map/updateThreshold", 1000);
//editing is now enabled by default
if(dataProvider->capabilities()&QgsVectorDataProvider::AddFeatures)
{
startEditing();
}
} // QgsVectorLayer ctor
@ -1265,6 +1270,16 @@ void QgsVectorLayer::initContextMenu_(QgisApp * app)
{
mToggleEditingAction = popMenu->addAction(tr("Allow Editing"),this,SLOT(toggleEditing()));
mToggleEditingAction->setCheckable(true);
mToggleEditingAction->blockSignals(true);
if(mEditable)
{
mToggleEditingAction->setChecked(true);
}
else
{
mToggleEditingAction->setChecked(false);
}
mToggleEditingAction->blockSignals(false);
}
if(cap&QgsVectorDataProvider::SaveAsShapefile)

View File

@ -482,7 +482,7 @@ void QgsLegend::addLayer( QgsMapLayer * layer )
setExpanded(indexFromItem(llayer), true);
setExpanded(indexFromItem(llfgroup), false);
//todo: only if qsetting for 'legend layer file visible' is not set
//only if qsetting for 'legend layer file visible' is not set
if(!mShowLegendLayerFiles)
{
setItemHidden(llfgroup, true);