Skip to content

Commit ece1394

Browse files
author
mhugent
committed
disabled all vector layer related actions at startup (editing, table, select). This should fix ticket 271
git-svn-id: http://svn.osgeo.org/qgis/trunk@5833 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent d6d5a76 commit ece1394

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/gui/qgisapp.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,11 +554,13 @@ void QgisApp::createActions()
554554
mActionSelect= new QAction(QIcon(myIconPath+"/mActionSelect.png"), tr("Select Features"), this);
555555
mActionSelect->setStatusTip(tr("Select Features"));
556556
connect(mActionSelect, SIGNAL(triggered()), this, SLOT(select()));
557+
mActionSelect->setEnabled(false);
557558
//
558559
mActionOpenTable= new QAction(QIcon(myIconPath+"/mActionOpenTable.png"), tr("Open Table"), this);
559560
//mActionOpenTable->setShortcut(tr("Ctrl+O","Open Table"));
560561
mActionOpenTable->setStatusTip(tr("Open Table"));
561562
connect(mActionOpenTable, SIGNAL(triggered()), this, SLOT(attributeTable()));
563+
mActionOpenTable->setEnabled(false);
562564
//
563565
mActionMeasure= new QAction(QIcon(myIconPath+"/mActionMeasure.png"), tr("Measure Line "), this);
564566
mActionMeasure->setShortcut(tr("Ctrl+M","Measure a Line"));
@@ -617,44 +619,54 @@ void QgisApp::createActions()
617619
mActionCapturePoint->setShortcut(tr(".","Capture Points"));
618620
mActionCapturePoint->setStatusTip(tr("Capture Points"));
619621
connect(mActionCapturePoint, SIGNAL(triggered()), this, SLOT(capturePoint()));
622+
mActionCapturePoint->setEnabled(false);
620623
//
621624
mActionCaptureLine= new QAction(QIcon(myIconPath+"/mActionCaptureLine.png"), tr("Capture Line"), this);
622625
mActionCaptureLine->setShortcut(tr("/","Capture Lines"));
623626
mActionCaptureLine->setStatusTip(tr("Capture Lines"));
624627
connect(mActionCaptureLine, SIGNAL(triggered()), this, SLOT(captureLine()));
628+
mActionCaptureLine->setEnabled(false);
625629
//
626630
mActionCapturePolygon= new QAction(QIcon(myIconPath+"/mActionCapturePolygon.png"), tr("Capture Polygon"), this);
627631
mActionCapturePolygon->setShortcut(tr("Ctrl+/","Capture Polygons"));
628632
mActionCapturePolygon->setStatusTip(tr("Capture Polygons"));
629633
connect(mActionCapturePolygon, SIGNAL(triggered()), this, SLOT(capturePolygon()));
634+
mActionCapturePolygon->setEnabled(false);
630635
//
631636
mActionDeleteSelected = new QAction(QIcon(myIconPath+"/mActionDeleteSelected.png"), tr("Delete Seleced"), this);
632637
mActionDeleteSelected->setStatusTip(tr("Delete Selected"));
633638
connect(mActionDeleteSelected, SIGNAL(triggered()), this, SLOT(deleteSelected()));
639+
mActionDeleteSelected->setEnabled(false);
634640
//
635641
mActionAddVertex = new QAction(QIcon(myIconPath+"/mActionAddVertex.png"), tr("Add Vertex"), this);
636642
mActionAddVertex->setStatusTip(tr("Add Vertex"));
637643
connect(mActionAddVertex, SIGNAL(triggered()), this, SLOT(addVertex()));
644+
mActionAddVertex->setEnabled(false);
638645
//
639646
mActionDeleteVertex = new QAction(QIcon(myIconPath+"/mActionDeleteVertex.png"), tr("Delete Vertex"), this);
640647
mActionDeleteVertex->setStatusTip(tr("Delete Vertex"));
641648
connect(mActionDeleteVertex, SIGNAL(triggered()), this, SLOT(deleteVertex()));
649+
mActionDeleteVertex->setEnabled(false);
642650
//
643651
mActionMoveVertex = new QAction(QIcon(myIconPath+"/mActionMoveVertex.png"), tr("Move Vertex"), this);
644652
mActionMoveVertex->setStatusTip(tr("Move Vertex"));
645653
connect(mActionMoveVertex, SIGNAL(triggered()), this, SLOT(moveVertex()));
654+
mActionMoveVertex->setEnabled(false);
646655

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

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

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

660672
void QgisApp::createActionGroups()

src/gui/qgsmaptoolvertexedit.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ void QgsMapToolVertexEdit::canvasPressEvent(QMouseEvent * e)
151151

152152
snapPoint = point;
153153
QgsVectorLayer* vlayer = dynamic_cast<QgsVectorLayer*>(mCanvas->currentLayer());
154+
if(!vlayer)
155+
{
156+
return;
157+
}
154158
if(vlayer->vectorType() == QGis::Point)//snap to point for point/multipoint layers
155159
{
156160
if(!snapVertexWithContext(snapPoint))

0 commit comments

Comments
 (0)