Skip to content

Commit

Permalink
Remove rectangle3points (crash)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbartoletti committed Jul 30, 2017
1 parent 430953c commit 3ae1a2b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 185 deletions.
2 changes: 0 additions & 2 deletions src/app/CMakeLists.txt
Expand Up @@ -146,7 +146,6 @@ SET(QGIS_APP_SRCS
qgsmaptooladdregularpolygon.cpp
qgsmaptoolrectanglecenter.cpp
qgsmaptoolrectangleextent.cpp
qgsmaptoolrectangle3points.cpp
qgsmaptoolsquarecenter.cpp
qgsmaptoolregularpolygon2points.cpp
qgsmaptoolregularpolygoncenterpoint.cpp
Expand Down Expand Up @@ -315,7 +314,6 @@ SET (QGIS_APP_MOC_HDRS
qgsmaptooladdregularpolygon.h
qgsmaptoolrectanglecenter.h
qgsmaptoolrectangleextent.h
qgsmaptoolrectangle3points.h
qgsmaptoolsquarecenter.h
qgsmaptoolregularpolygon2points.h
qgsmaptoolregularpolygoncenterpoint.h
Expand Down
17 changes: 1 addition & 16 deletions src/app/qgisapp.cpp
Expand Up @@ -336,7 +336,6 @@ Q_GUI_EXPORT extern int qt_defaultDpiX();
#include "qgsmaptoolellipsecenterpoint.h"
#include "qgsmaptoolellipseextent.h"
#include "qgsmaptoolellipsefoci.h"
#include "qgsmaptoolrectangle3points.h"
#include "qgsmaptoolrectanglecenter.h"
#include "qgsmaptoolrectangleextent.h"
#include "qgsmaptoolsquarecenter.h"
Expand Down Expand Up @@ -1387,7 +1386,6 @@ QgisApp::~QgisApp()
delete mMapTools.mEllipseCenterPoint;
delete mMapTools.mEllipseExtent;
delete mMapTools.mEllipseFoci;
delete mMapTools.mRectangle3Points;
delete mMapTools.mRectangleCenterPoint;
delete mMapTools.mRectangleExtent;
delete mMapTools.mSquareCenter;
Expand Down Expand Up @@ -1819,7 +1817,6 @@ void QgisApp::createActions()
connect( mActionEllipseCenterPoint, &QAction::triggered, this, &QgisApp::ellipseCenterPoint );
connect( mActionEllipseExtent, &QAction::triggered, this, &QgisApp::ellipseExtent );
connect( mActionEllipseFoci, &QAction::triggered, this, &QgisApp::ellipseFoci );
connect( mActionRectangle3Points, &QAction::triggered, this, &QgisApp::rectangle3Points );
connect( mActionRectangleCenterPoint, &QAction::triggered, this, &QgisApp::rectangleCenterPoint );
connect( mActionRectangleExtent, &QAction::triggered, this, &QgisApp::rectangleExtent );
connect( mActionSquareCenter, &QAction::triggered, this, &QgisApp::squareCenter );
Expand Down Expand Up @@ -2106,7 +2103,6 @@ void QgisApp::createActionGroups()
mMapToolGroup->addAction( mActionEllipseCenterPoint );
mMapToolGroup->addAction( mActionEllipseExtent );
mMapToolGroup->addAction( mActionEllipseFoci );
mMapToolGroup->addAction( mActionRectangle3Points );
mMapToolGroup->addAction( mActionRectangleCenterPoint );
mMapToolGroup->addAction( mActionRectangleExtent );
mMapToolGroup->addAction( mActionSquareCenter );
Expand Down Expand Up @@ -2604,11 +2600,10 @@ void QgisApp::createToolBars()
//Rectangle digitize tool button
QToolButton *tbAddRectangle = new QToolButton( mRegularShapeDigitizeToolBar );
tbAddRectangle->setPopupMode( QToolButton::MenuButtonPopup );
tbAddRectangle->addAction( mActionRectangle3Points );
tbAddRectangle->addAction( mActionRectangleCenterPoint );
tbAddRectangle->addAction( mActionRectangleExtent );
tbAddRectangle->addAction( mActionSquareCenter );
tbAddRectangle->setDefaultAction( mActionRectangleExtent );
tbAddRectangle->setDefaultAction( mActionRectangleCenterPoint );
connect( tbAddRectangle, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered );
mRegularShapeDigitizeToolBar->insertWidget( mActionNodeTool, tbAddRectangle );

Expand Down Expand Up @@ -3216,8 +3211,6 @@ void QgisApp::createCanvasTools()
mMapTools.mEllipseExtent->setAction( mActionEllipseExtent );
mMapTools.mEllipseFoci = new QgsMapToolEllipseFoci( dynamic_cast<QgsMapToolAddFeature *>( mMapTools.mAddFeature ), mMapCanvas );
mMapTools.mEllipseFoci->setAction( mActionEllipseFoci );
mMapTools.mRectangle3Points = new QgsMapToolRectangle3Points( dynamic_cast<QgsMapToolAddFeature *>( mMapTools.mAddFeature ), mMapCanvas );
mMapTools.mRectangle3Points->setAction( mActionRectangle3Points );
mMapTools.mRectangleCenterPoint = new QgsMapToolRectangleCenter( dynamic_cast<QgsMapToolAddFeature *>( mMapTools.mAddFeature ), mMapCanvas );
mMapTools.mRectangleCenterPoint->setAction( mActionRectangleCenterPoint );
mMapTools.mRectangleExtent = new QgsMapToolRectangleExtent( dynamic_cast<QgsMapToolAddFeature *>( mMapTools.mAddFeature ), mMapCanvas );
Expand Down Expand Up @@ -7939,11 +7932,6 @@ void QgisApp::ellipseFoci()
mMapCanvas->setMapTool( mMapTools.mEllipseFoci );
}

void QgisApp::rectangle3Points()
{
mMapCanvas->setMapTool( mMapTools.mRectangle3Points );
}

void QgisApp::rectangleCenterPoint()
{
mMapCanvas->setMapTool( mMapTools.mRectangleCenterPoint );
Expand Down Expand Up @@ -11260,7 +11248,6 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
mActionEllipseCenterPoint->setEnabled( false );
mActionEllipseExtent->setEnabled( false );
mActionEllipseFoci->setEnabled( false );
mActionRectangle3Points->setEnabled( false );
mActionRectangleCenterPoint->setEnabled( false );
mActionRectangleExtent->setEnabled( false );
mActionSquareCenter->setEnabled( false );
Expand Down Expand Up @@ -11415,8 +11402,6 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
&& ( vlayer->geometryType() == QgsWkbTypes::LineGeometry || vlayer->geometryType() == QgsWkbTypes::PolygonGeometry ) );
mActionEllipseFoci->setEnabled( isEditable && ( canAddFeatures || canChangeGeometry )
&& ( vlayer->geometryType() == QgsWkbTypes::LineGeometry || vlayer->geometryType() == QgsWkbTypes::PolygonGeometry ) );
mActionRectangle3Points->setEnabled( isEditable && ( canAddFeatures || canChangeGeometry )
&& ( vlayer->geometryType() == QgsWkbTypes::LineGeometry || vlayer->geometryType() == QgsWkbTypes::PolygonGeometry ) );
mActionRectangleCenterPoint->setEnabled( isEditable && ( canAddFeatures || canChangeGeometry )
&& ( vlayer->geometryType() == QgsWkbTypes::LineGeometry || vlayer->geometryType() == QgsWkbTypes::PolygonGeometry ) );
mActionRectangleExtent->setEnabled( isEditable && ( canAddFeatures || canChangeGeometry )
Expand Down
4 changes: 0 additions & 4 deletions src/app/qgisapp.h
Expand Up @@ -1211,8 +1211,6 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void ellipseExtent();
//! activates the add ellipse from foci tool
void ellipseFoci();
//! activates the add rectangle from 3 points tool
void rectangle3Points();
//! activates the add rectangle from center and a point tool
void rectangleCenterPoint();
//! activates the add rectangle from extent tool
Expand Down Expand Up @@ -1778,7 +1776,6 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
, mEllipseCenterPoint( nullptr )
, mEllipseExtent( nullptr )
, mEllipseFoci( nullptr )
, mRectangle3Points( nullptr )
, mRectangleCenterPoint( nullptr )
, mRectangleExtent( nullptr )
, mSquareCenter( nullptr )
Expand Down Expand Up @@ -1837,7 +1834,6 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QgsMapTool *mEllipseCenterPoint = nullptr;
QgsMapTool *mEllipseExtent = nullptr;
QgsMapTool *mEllipseFoci = nullptr;
QgsMapTool *mRectangle3Points = nullptr;
QgsMapTool *mRectangleCenterPoint = nullptr;
QgsMapTool *mRectangleExtent = nullptr;
QgsMapTool *mSquareCenter = nullptr;
Expand Down
109 changes: 0 additions & 109 deletions src/app/qgsmaptoolrectangle3points.cpp

This file was deleted.

33 changes: 0 additions & 33 deletions src/app/qgsmaptoolrectangle3points.h

This file was deleted.

26 changes: 5 additions & 21 deletions src/ui/qgisapp.ui
Expand Up @@ -295,7 +295,6 @@
</property>
<addaction name="mActionRectangleExtent"/>
<addaction name="mActionRectangleCenterPoint"/>
<addaction name="mActionRectangle3Points"/>
<addaction name="mActionSquareCenter"/>
</widget>
<widget class="QMenu" name="mMenuRegularPolygon">
Expand Down Expand Up @@ -2832,7 +2831,7 @@ Acts on currently active editable layer</string>
<normaloff>:/images/themes/default/mActionRectangleExtent.svg</normaloff>:/images/themes/default/mActionRectangleExtent.svg</iconset>
</property>
<property name="text">
<string>Add Rectangle From Extent</string>
<string>&amp;Add Rectangle From Extent</string>
</property>
<property name="toolTip">
<string>Add rectangle from extent</string>
Expand All @@ -2847,27 +2846,12 @@ Acts on currently active editable layer</string>
<normaloff>:/images/themes/default/mActionRectangleCenter.svg</normaloff>:/images/themes/default/mActionRectangleCenter.svg</iconset>
</property>
<property name="text">
<string>Add Rectangle From Center and a Point</string>
<string>Add &amp;Rectangle From Center and a Point</string>
</property>
<property name="toolTip">
<string>Add rectangle from center and a point</string>
</property>
</action>
<action name="mActionRectangle3Points">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionRectangle3Points.svg</normaloff>:/images/themes/default/mActionRectangle3Points.svg</iconset>
</property>
<property name="text">
<string>Add Rectangle From 3 Points</string>
</property>
<property name="toolTip">
<string>Add rectangle from 3 points</string>
</property>
</action>
<action name="mActionSquareCenter">
<property name="checkable">
<bool>true</bool>
Expand All @@ -2877,7 +2861,7 @@ Acts on currently active editable layer</string>
<normaloff>:/images/themes/default/mActionSquareCenter.svg</normaloff>:/images/themes/default/mActionSquareCenter.svg</iconset>
</property>
<property name="text">
<string>Add Square From Center</string>
<string>Add &amp;Square From Center</string>
</property>
<property name="toolTip">
<string>Add square from center</string>
Expand All @@ -2892,7 +2876,7 @@ Acts on currently active editable layer</string>
<normaloff>:/images/themes/default/mActionRegularPolygonCenterPoint.svg</normaloff>:/images/themes/default/mActionRegularPolygonCenterPoint.svg</iconset>
</property>
<property name="text">
<string>Add Regular Polygon From Center and a Point</string>
<string>&amp;Add Regular Polygon From Center and a Point</string>
</property>
<property name="toolTip">
<string>Add regular polygon from center and a point</string>
Expand All @@ -2907,7 +2891,7 @@ Acts on currently active editable layer</string>
<normaloff>:/images/themes/default/mActionRegularPolygon2Points.svg</normaloff>:/images/themes/default/mActionRegularPolygon2Points.svg</iconset>
</property>
<property name="text">
<string>Add Regular Polygon From 2 Points</string>
<string>Add &amp;Regular Polygon From 2 Points</string>
</property>
<property name="toolTip">
<string>Add regular polygon from 2 points</string>
Expand Down

0 comments on commit 3ae1a2b

Please sign in to comment.