diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index cb10cc3a4768..1419906c91a7 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -104,7 +104,6 @@ set(QGIS_APP_SRCS qgsmaptoolsimplify.cpp qgsmaptoolsplitfeatures.cpp qgsmaptoolsplitparts.cpp - qgsmaptooltextannotation.cpp annotations/qgsannotationitempropertieswidget.cpp annotations/qgsannotationlayerproperties.cpp diff --git a/src/app/maptools/qgsappmaptools.cpp b/src/app/maptools/qgsappmaptools.cpp index 1831072e88ef..c726e7c65088 100644 --- a/src/app/maptools/qgsappmaptools.cpp +++ b/src/app/maptools/qgsappmaptools.cpp @@ -23,7 +23,6 @@ #include "qgsmaptoolpan.h" #include "qgsmaptoolfeatureaction.h" #include "qgsmeasuretool.h" -#include "qgsmaptooltextannotation.h" #include "qgsmaptoolhtmlannotation.h" #include "qgsmaptoolmeasureangle.h" #include "qgsmaptoolmeasurebearing.h" @@ -70,7 +69,6 @@ QgsAppMapTools::QgsAppMapTools( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockW mTools.insert( Tool::MeasureArea, new QgsMeasureTool( canvas, true /* area */ ) ); mTools.insert( Tool::MeasureAngle, new QgsMapToolMeasureAngle( canvas ) ); mTools.insert( Tool::MeasureBearing, new QgsMapToolMeasureBearing( canvas ) ); - mTools.insert( Tool::TextAnnotation, new QgsMapToolTextAnnotation( canvas ) ); mTools.insert( Tool::FormAnnotation, new QgsMapToolFormAnnotation( canvas ) ); mTools.insert( Tool::HtmlAnnotation, new QgsMapToolHtmlAnnotation( canvas ) ); mTools.insert( Tool::AddFeature, new QgsMapToolAddFeature( canvas, cadDock, QgsMapToolCapture::CaptureNone ) ); diff --git a/src/app/maptools/qgsappmaptools.h b/src/app/maptools/qgsappmaptools.h index cb329d476c46..8d7bad78d0f6 100644 --- a/src/app/maptools/qgsappmaptools.h +++ b/src/app/maptools/qgsappmaptools.h @@ -68,7 +68,6 @@ class QgsAppMapTools Annotation, // Unused FormAnnotation, HtmlAnnotation, - TextAnnotation, PinLabels, ShowHideLabels, MoveLabel, diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index 9c880287c93d..952c536af77d 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -3021,7 +3021,6 @@ void QgisApp::createActions() connect( mActionMapTips, &QAction::toggled, this, &QgisApp::toggleMapTips ); connect( mActionNewBookmark, &QAction::triggered, this, [ = ] { newBookmark( true ); } ); connect( mActionDraw, &QAction::triggered, this, [this] { refreshMapCanvas( true ); } ); - connect( mActionTextAnnotation, &QAction::triggered, this, &QgisApp::addTextAnnotation ); connect( mActionFormAnnotation, &QAction::triggered, this, &QgisApp::addFormAnnotation ); connect( mActionHtmlAnnotation, &QAction::triggered, this, &QgisApp::addHtmlAnnotation ); connect( mActionLabeling, &QAction::triggered, this, &QgisApp::labeling ); @@ -3966,22 +3965,18 @@ void QgisApp::createToolBars() bt = new QToolButton(); bt->setPopupMode( QToolButton::MenuButtonPopup ); - bt->addAction( mActionTextAnnotation ); bt->addAction( mActionFormAnnotation ); bt->addAction( mActionHtmlAnnotation ); - QAction *defAnnotationAction = mActionTextAnnotation; + QAction *defAnnotationAction = mActionHtmlAnnotation; switch ( settings.value( QStringLiteral( "UI/annotationTool" ), 0 ).toInt() ) { case 0: - defAnnotationAction = mActionTextAnnotation; + defAnnotationAction = mActionHtmlAnnotation; break; case 1: defAnnotationAction = mActionFormAnnotation; break; - case 2: - defAnnotationAction = mActionHtmlAnnotation; - break; } bt->setDefaultAction( defAnnotationAction ); QAction *annotationAction = mAnnotationsToolBar->addWidget( bt ); @@ -4359,7 +4354,6 @@ void QgisApp::setTheme( const QString &themeName ) mActionAddToOverview->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionInOverview.svg" ) ) ); mActionFormAnnotation->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionFormAnnotation.svg" ) ) ); mActionHtmlAnnotation->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionHtmlAnnotation.svg" ) ) ); - mActionTextAnnotation->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionTextAnnotation.svg" ) ) ); mActionLabeling->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionLabeling.svg" ) ) ); mActionShowPinnedLabels->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionShowPinnedLabels.svg" ) ) ); mActionPinLabels->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionPinLabels.svg" ) ) ); @@ -4579,7 +4573,6 @@ void QgisApp::setupCanvasTools() mMapTools->mapTool( QgsAppMapTools::MeasureArea )->setAction( mActionMeasureArea ); mMapTools->mapTool( QgsAppMapTools::MeasureAngle )->setAction( mActionMeasureAngle ); mMapTools->mapTool( QgsAppMapTools::MeasureBearing )->setAction( mActionMeasureBearing ); - mMapTools->mapTool( QgsAppMapTools::TextAnnotation )->setAction( mActionTextAnnotation ); mMapTools->mapTool( QgsAppMapTools::FormAnnotation )->setAction( mActionFormAnnotation ); mMapTools->mapTool( QgsAppMapTools::HtmlAnnotation )->setAction( mActionHtmlAnnotation ); mMapTools->mapTool( QgsAppMapTools::AddFeature )->setAction( mActionAddFeature ); @@ -7933,11 +7926,6 @@ void QgisApp::addHtmlAnnotation() mMapCanvas->setMapTool( mMapTools->mapTool( QgsAppMapTools::HtmlAnnotation ) ); } -void QgisApp::addTextAnnotation() -{ - mMapCanvas->setMapTool( mMapTools->mapTool( QgsAppMapTools::TextAnnotation ) ); -} - void QgisApp::reprojectAnnotations() { const auto annotations = annotationItems(); @@ -17015,12 +17003,10 @@ void QgisApp::toolButtonActionTriggered( QAction *action ) settings.setValue( QStringLiteral( "UI/measureTool" ), 1 ); else if ( action == mActionMeasureAngle ) settings.setValue( QStringLiteral( "UI/measureTool" ), 2 ); - else if ( action == mActionTextAnnotation ) - settings.setValue( QStringLiteral( "UI/annotationTool" ), 0 ); else if ( action == mActionFormAnnotation ) settings.setValue( QStringLiteral( "UI/annotationTool" ), 1 ); else if ( action == mActionHtmlAnnotation ) - settings.setValue( QStringLiteral( "UI/annotationTool" ), 2 ); + settings.setValue( QStringLiteral( "UI/annotationTool" ), 0 ); else if ( action == mActionNewSpatiaLiteLayer ) settings.setValue( QStringLiteral( "UI/defaultNewLayer" ), 0 ); else if ( action == mActionNewVectorLayer ) diff --git a/src/app/qgisapp.h b/src/app/qgisapp.h index 023a1356e2a1..e35865276bb8 100644 --- a/src/app/qgisapp.h +++ b/src/app/qgisapp.h @@ -1947,7 +1947,6 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow //annotations void addFormAnnotation(); - void addTextAnnotation(); void addHtmlAnnotation(); void reprojectAnnotations(); diff --git a/src/app/qgsmaptooltextannotation.cpp b/src/app/qgsmaptooltextannotation.cpp deleted file mode 100644 index b52274b078d6..000000000000 --- a/src/app/qgsmaptooltextannotation.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/*************************************************************************** - qgsmaptooltextannotation.cpp - ------------------------------- - begin : February 9, 2010 - copyright : (C) 2010 by Marco Hugentobler - email : marco dot hugentobler at hugis dot net - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "qgsmaptooltextannotation.h" -#include "qgstextannotation.h" -#include "qgsproject.h" -#include - -QgsMapToolTextAnnotation::QgsMapToolTextAnnotation( QgsMapCanvas *canvas ): QgsMapToolAnnotation( canvas ) -{ - -} - -QgsAnnotation *QgsMapToolTextAnnotation::createItem() const -{ - return new QgsTextAnnotation(); -} - diff --git a/src/app/qgsmaptooltextannotation.h b/src/app/qgsmaptooltextannotation.h deleted file mode 100644 index 55762fd15b56..000000000000 --- a/src/app/qgsmaptooltextannotation.h +++ /dev/null @@ -1,35 +0,0 @@ -/*************************************************************************** - qgsmaptooltextannotation.h - ------------------------- - begin : February 9, 2010 - copyright : (C) 2010 by Marco Hugentobler - email : marco dot hugentobler at hugis dot net - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef QGSMAPTOOLTEXTANNOTATION_H -#define QGSMAPTOOLTEXTANNOTATION_H - -#include "qgsmaptoolannotation.h" -#include "qgis_app.h" - -class APP_EXPORT QgsMapToolTextAnnotation: public QgsMapToolAnnotation -{ - Q_OBJECT - - public: - QgsMapToolTextAnnotation( QgsMapCanvas *canvas ); - - protected: - QgsAnnotation *createItem() const override; -}; - -#endif // QGSMAPTOOLTEXTANNOTATION_H diff --git a/src/ui/qgisapp.ui b/src/ui/qgisapp.ui index 9a48bd4b20b4..57cbb783fde7 100644 --- a/src/ui/qgisapp.ui +++ b/src/ui/qgisapp.ui @@ -349,7 +349,6 @@ Add Annotation - @@ -1506,18 +1505,6 @@ Shift+O to turn segments into straight or curve lines. F5 - - - true - - - - :/images/themes/default/mActionTextAnnotation.svg:/images/themes/default/mActionTextAnnotation.svg - - - Text Annotation - - true