Skip to content

Commit

Permalink
disabled all vector layer related actions at startup (editing, table,…
Browse files Browse the repository at this point in the history
… select). This should fix ticket 271

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5833 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Sep 18, 2006
1 parent 058e811 commit 80f0499
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/gui/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,11 +554,13 @@ void QgisApp::createActions()
mActionSelect= new QAction(QIcon(myIconPath+"/mActionSelect.png"), tr("Select Features"), this);
mActionSelect->setStatusTip(tr("Select Features"));
connect(mActionSelect, SIGNAL(triggered()), this, SLOT(select()));
mActionSelect->setEnabled(false);
//
mActionOpenTable= new QAction(QIcon(myIconPath+"/mActionOpenTable.png"), tr("Open Table"), this);
//mActionOpenTable->setShortcut(tr("Ctrl+O","Open Table"));
mActionOpenTable->setStatusTip(tr("Open Table"));
connect(mActionOpenTable, SIGNAL(triggered()), this, SLOT(attributeTable()));
mActionOpenTable->setEnabled(false);
//
mActionMeasure= new QAction(QIcon(myIconPath+"/mActionMeasure.png"), tr("Measure Line "), this);
mActionMeasure->setShortcut(tr("Ctrl+M","Measure a Line"));
Expand Down Expand Up @@ -617,44 +619,54 @@ void QgisApp::createActions()
mActionCapturePoint->setShortcut(tr(".","Capture Points"));
mActionCapturePoint->setStatusTip(tr("Capture Points"));
connect(mActionCapturePoint, SIGNAL(triggered()), this, SLOT(capturePoint()));
mActionCapturePoint->setEnabled(false);
//
mActionCaptureLine= new QAction(QIcon(myIconPath+"/mActionCaptureLine.png"), tr("Capture Line"), this);
mActionCaptureLine->setShortcut(tr("/","Capture Lines"));
mActionCaptureLine->setStatusTip(tr("Capture Lines"));
connect(mActionCaptureLine, SIGNAL(triggered()), this, SLOT(captureLine()));
mActionCaptureLine->setEnabled(false);
//
mActionCapturePolygon= new QAction(QIcon(myIconPath+"/mActionCapturePolygon.png"), tr("Capture Polygon"), this);
mActionCapturePolygon->setShortcut(tr("Ctrl+/","Capture Polygons"));
mActionCapturePolygon->setStatusTip(tr("Capture Polygons"));
connect(mActionCapturePolygon, SIGNAL(triggered()), this, SLOT(capturePolygon()));
mActionCapturePolygon->setEnabled(false);
//
mActionDeleteSelected = new QAction(QIcon(myIconPath+"/mActionDeleteSelected.png"), tr("Delete Seleced"), this);
mActionDeleteSelected->setStatusTip(tr("Delete Selected"));
connect(mActionDeleteSelected, SIGNAL(triggered()), this, SLOT(deleteSelected()));
mActionDeleteSelected->setEnabled(false);
//
mActionAddVertex = new QAction(QIcon(myIconPath+"/mActionAddVertex.png"), tr("Add Vertex"), this);
mActionAddVertex->setStatusTip(tr("Add Vertex"));
connect(mActionAddVertex, SIGNAL(triggered()), this, SLOT(addVertex()));
mActionAddVertex->setEnabled(false);
//
mActionDeleteVertex = new QAction(QIcon(myIconPath+"/mActionDeleteVertex.png"), tr("Delete Vertex"), this);
mActionDeleteVertex->setStatusTip(tr("Delete Vertex"));
connect(mActionDeleteVertex, SIGNAL(triggered()), this, SLOT(deleteVertex()));
mActionDeleteVertex->setEnabled(false);
//
mActionMoveVertex = new QAction(QIcon(myIconPath+"/mActionMoveVertex.png"), tr("Move Vertex"), this);
mActionMoveVertex->setStatusTip(tr("Move Vertex"));
connect(mActionMoveVertex, SIGNAL(triggered()), this, SLOT(moveVertex()));
mActionMoveVertex->setEnabled(false);

mActionEditCut = new QAction(QIcon(myIconPath+"/mActionEditCut.png"), tr("Cut Features"), this);
mActionEditCut->setStatusTip(tr("Cut selected features"));
connect(mActionEditCut, SIGNAL(triggered()), this, SLOT(editCut()));
mActionEditCut->setEnabled(false);

mActionEditCopy = new QAction(QIcon(myIconPath+"/mActionEditCopy.png"), tr("Copy Features"), this);
mActionEditCopy->setStatusTip(tr("Copy selected features"));
connect(mActionEditCopy, SIGNAL(triggered()), this, SLOT(editCopy()));
mActionEditCopy->setEnabled(false);

mActionEditPaste = new QAction(QIcon(myIconPath+"/mActionEditPaste.png"), tr("Paste Features"), this);
mActionEditPaste->setStatusTip(tr("Paste selected features"));
connect(mActionEditPaste, SIGNAL(triggered()), this, SLOT(editPaste()));
mActionEditPaste->setEnabled(false);
}

void QgisApp::createActionGroups()
Expand Down
4 changes: 4 additions & 0 deletions src/gui/qgsmaptoolvertexedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ void QgsMapToolVertexEdit::canvasPressEvent(QMouseEvent * e)

snapPoint = point;
QgsVectorLayer* vlayer = dynamic_cast<QgsVectorLayer*>(mCanvas->currentLayer());
if(!vlayer)
{
return;
}
if(vlayer->vectorType() == QGis::Point)//snap to point for point/multipoint layers
{
if(!snapVertexWithContext(snapPoint))
Expand Down

0 comments on commit 80f0499

Please sign in to comment.