Skip to content
Permalink
Browse files

layers are now editable by default such that people do not have to se…

…arch for the layer file in the legend

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5232 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Apr 8, 2006
1 parent 64c4203 commit a4aff07214de517b773fef9ed4aff2ddcd2b27e4
Showing with 17 additions and 2 deletions.
  1. +1 −1 src/gui/qgsmaptoolcapture.cpp
  2. +15 −0 src/gui/qgsvectorlayer.cpp
  3. +1 −1 src/legend/qgslegend.cpp
@@ -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;
}
@@ -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)
@@ -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);

0 comments on commit a4aff07

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