more names for the map tools

This commit is contained in:
Denis Rouzaud 2014-10-09 15:54:12 +02:00
parent 2d49b59cc1
commit 0840a9d7ee
22 changed files with 63 additions and 22 deletions

View File

@ -40,6 +40,7 @@ QgsMapToolNodeTool::QgsMapToolNodeTool( QgsMapCanvas* canvas )
, mIsPoint( false )
, mDeselectOnRelease( -1 )
{
mToolName = tr( "Node tool" );
}
QgsMapToolNodeTool::~QgsMapToolNodeTool()

View File

@ -30,15 +30,17 @@
#include <QMouseEvent>
#include <QSettings>
QgsMapToolAddFeature::QgsMapToolAddFeature( QgsMapCanvas* canvas ): QgsMapToolCapture( canvas )
QgsMapToolAddFeature::QgsMapToolAddFeature( QgsMapCanvas* canvas )
: QgsMapToolCapture( canvas )
{
mToolName = tr( "Add feature" );
}
QgsMapToolAddFeature::~QgsMapToolAddFeature()
{
}
bool QgsMapToolAddFeature::addFeature(QgsVectorLayer *vlayer, QgsFeature *f, bool showModal )
bool QgsMapToolAddFeature::addFeature( QgsVectorLayer *vlayer, QgsFeature *f, bool showModal )
{
QgsFeatureAction action( tr( "add feature" ), *f, vlayer, -1, -1, this );
return action.addFeature( QgsAttributeMap(), showModal );

View File

@ -25,6 +25,7 @@
QgsMapToolAddPart::QgsMapToolAddPart( QgsMapCanvas* canvas )
: QgsMapToolCapture( canvas )
{
mToolName = tr( "Add part" );
}
QgsMapToolAddPart::~QgsMapToolAddPart()

View File

@ -22,8 +22,10 @@
#include "qgsvectorlayer.h"
QgsMapToolAddRing::QgsMapToolAddRing( QgsMapCanvas* canvas ): QgsMapToolCapture( canvas, QgsMapToolCapture::CapturePolygon )
QgsMapToolAddRing::QgsMapToolAddRing( QgsMapCanvas* canvas )
: QgsMapToolCapture( canvas, QgsMapToolCapture::CapturePolygon )
{
mToolName = tr( "Add ring" );
}
QgsMapToolAddRing::~QgsMapToolAddRing()

View File

@ -24,8 +24,10 @@
#include <QMouseEvent>
QgsMapToolDeletePart::QgsMapToolDeletePart( QgsMapCanvas* canvas )
: QgsMapToolEdit( canvas ), mRubberBand( 0 )
: QgsMapToolEdit( canvas )
, mRubberBand( 0 )
{
mToolName = tr( "Delete part" );
}
QgsMapToolDeletePart::~QgsMapToolDeletePart()

View File

@ -23,7 +23,8 @@
#include <limits>
QgsMapToolDeleteRing::QgsMapToolDeleteRing( QgsMapCanvas* canvas )
: QgsMapToolVertexEdit( canvas ), mRubberBand( 0 )
: QgsMapToolVertexEdit( canvas )
, mRubberBand( 0 )
{
mToolName = tr( "Delete ring" );
}

View File

@ -25,9 +25,10 @@
#include <limits>
QgsMapToolFillRing::QgsMapToolFillRing( QgsMapCanvas* canvas ): QgsMapToolCapture( canvas, QgsMapToolCapture::CapturePolygon )
QgsMapToolFillRing::QgsMapToolFillRing( QgsMapCanvas* canvas )
: QgsMapToolCapture( canvas, QgsMapToolCapture::CapturePolygon )
{
mToolName = tr( "Fill ring" );
}
QgsMapToolFillRing::~QgsMapToolFillRing()

View File

@ -46,6 +46,7 @@
QgsMapToolIdentifyAction::QgsMapToolIdentifyAction( QgsMapCanvas * canvas )
: QgsMapToolIdentify( canvas )
{
mToolName = tr( "Identify" );
// set cursor
QPixmap myIdentifyQPixmap = QPixmap(( const char ** ) identify_cursor );
mCursor = QCursor( myIdentifyQPixmap, 1, 1 );

View File

@ -25,7 +25,11 @@
#include "qgsdiagramrendererv2.h"
#include <QMouseEvent>
QgsMapToolLabel::QgsMapToolLabel( QgsMapCanvas* canvas ): QgsMapTool( canvas ), mLabelRubberBand( 0 ), mFeatureRubberBand( 0 ), mFixPointRubberBand( 0 )
QgsMapToolLabel::QgsMapToolLabel( QgsMapCanvas* canvas )
: QgsMapTool( canvas )
, mLabelRubberBand( 0 )
, mFeatureRubberBand( 0 )
, mFixPointRubberBand( 0 )
, mCurrentLayer( 0 )
{
}

View File

@ -25,8 +25,12 @@
#include <QSettings>
#include <cmath>
QgsMapToolMeasureAngle::QgsMapToolMeasureAngle( QgsMapCanvas* canvas ): QgsMapTool( canvas ), mRubberBand( 0 ), mResultDisplay( 0 )
QgsMapToolMeasureAngle::QgsMapToolMeasureAngle( QgsMapCanvas* canvas )
: QgsMapTool( canvas )
, mRubberBand( 0 )
, mResultDisplay( 0 )
{
mToolName = tr( "Measure angle" );
mSnapper.setMapCanvas( canvas );
connect( canvas, SIGNAL( destinationCrsChanged() ),

View File

@ -24,9 +24,11 @@
#include <QMouseEvent>
#include <QSettings>
#include <limits>
QgsMapToolMoveFeature::QgsMapToolMoveFeature( QgsMapCanvas* canvas ): QgsMapToolEdit( canvas ), mRubberBand( 0 )
QgsMapToolMoveFeature::QgsMapToolMoveFeature( QgsMapCanvas* canvas )
: QgsMapToolEdit( canvas )
, mRubberBand( 0 )
{
mToolName = tr( "Move feature" );
}
QgsMapToolMoveFeature::~QgsMapToolMoveFeature()

View File

@ -22,8 +22,10 @@
#include "qgsvectorlayer.h"
#include <QMouseEvent>
QgsMapToolMoveLabel::QgsMapToolMoveLabel( QgsMapCanvas* canvas ): QgsMapToolLabel( canvas )
QgsMapToolMoveLabel::QgsMapToolMoveLabel( QgsMapCanvas* canvas )
: QgsMapToolLabel( canvas )
{
mToolName = tr( "Move label" );
}
QgsMapToolMoveLabel::~QgsMapToolMoveLabel()

View File

@ -28,8 +28,10 @@
#include <qgslogger.h>
#include <QMouseEvent>
QgsMapToolPinLabels::QgsMapToolPinLabels( QgsMapCanvas* canvas ): QgsMapToolLabel( canvas )
QgsMapToolPinLabels::QgsMapToolPinLabels( QgsMapCanvas* canvas )
: QgsMapToolLabel( canvas )
{
mToolName = tr( "Pin labels" );
mRubberBand = 0;
mShowPinned = false;

View File

@ -31,6 +31,7 @@
QgsMapToolSelect::QgsMapToolSelect( QgsMapCanvas* canvas )
: QgsMapTool( canvas )
{
mToolName = tr( "Select" );
mCursor = Qt::ArrowCursor;
mFillColor = QColor( 254, 178, 76, 63 );
mBorderColour = QColor( 254, 58, 29, 100 );

View File

@ -30,8 +30,10 @@
QgsMapToolSelectFeatures::QgsMapToolSelectFeatures( QgsMapCanvas* canvas )
: QgsMapTool( canvas ), mDragging( false )
: QgsMapTool( canvas )
, mDragging( false )
{
mToolName = tr( "Select features" );
QPixmap mySelectQPixmap = QPixmap(( const char ** ) select_cursor );
mCursor = QCursor( mySelectQPixmap, 1, 1 );
mRubberBand = 0;

View File

@ -27,8 +27,10 @@
#include <QMouseEvent>
QgsMapToolShowHideLabels::QgsMapToolShowHideLabels( QgsMapCanvas* canvas ): QgsMapToolLabel( canvas )
QgsMapToolShowHideLabels::QgsMapToolShowHideLabels( QgsMapCanvas* canvas )
: QgsMapToolLabel( canvas )
{
mToolName = tr( "Show/hide labels" );
mRubberBand = 0;
}

View File

@ -22,9 +22,10 @@
#include <QMouseEvent>
QgsMapToolSplitFeatures::QgsMapToolSplitFeatures( QgsMapCanvas* canvas ): QgsMapToolCapture( canvas, QgsMapToolCapture::CaptureLine )
QgsMapToolSplitFeatures::QgsMapToolSplitFeatures( QgsMapCanvas* canvas )
: QgsMapToolCapture( canvas, QgsMapToolCapture::CaptureLine )
{
mToolName = tr( "Split features" );
}
QgsMapToolSplitFeatures::~QgsMapToolSplitFeatures()

View File

@ -22,9 +22,10 @@
#include <QMouseEvent>
QgsMapToolSplitParts::QgsMapToolSplitParts( QgsMapCanvas* canvas ): QgsMapToolCapture( canvas, QgsMapToolCapture::CaptureLine )
QgsMapToolSplitParts::QgsMapToolSplitParts( QgsMapCanvas* canvas )
: QgsMapToolCapture( canvas, QgsMapToolCapture::CaptureLine )
{
mToolName = tr( "Split parts" );
}
QgsMapToolSplitParts::~QgsMapToolSplitParts()

View File

@ -30,7 +30,8 @@
#include <QSettings>
#include <QPixmap>
QgsMapToolVertexEdit::QgsMapToolVertexEdit( QgsMapCanvas* canvas ): QgsMapToolEdit( canvas )
QgsMapToolVertexEdit::QgsMapToolVertexEdit( QgsMapCanvas* canvas )
: QgsMapToolEdit( canvas )
{
}

View File

@ -24,6 +24,8 @@ QgsMapToolIdentifyFeature::QgsMapToolIdentifyFeature( QgsMapCanvas* canvas, QgsV
, mCanvas( canvas )
, mLayer( vl )
{
mToolName = tr( "Identify feature" );
// set cursor
QPixmap cursorPixmap = QPixmap(( const char ** ) cross_hair_cursor );
mCursor = QCursor( cursorPixmap, 1, 1 );

View File

@ -23,8 +23,10 @@
QgsMapToolPan::QgsMapToolPan( QgsMapCanvas* canvas )
: QgsMapTool( canvas ), mDragging( false )
: QgsMapTool( canvas )
, mDragging( false )
{
mToolName = tr( "Pan" );
// set cursor
QBitmap panBmp = QBitmap::fromData( QSize( 16, 16 ), pan_bits );
QBitmap panBmpMask = QBitmap::fromData( QSize( 16, 16 ), pan_mask_bits );

View File

@ -28,8 +28,12 @@
QgsMapToolZoom::QgsMapToolZoom( QgsMapCanvas* canvas, bool zoomOut )
: QgsMapTool( canvas ), mZoomOut( zoomOut ), mDragging( false ), mRubberBand( 0 )
: QgsMapTool( canvas )
, mZoomOut( zoomOut )
, mDragging( false )
, mRubberBand( 0 )
{
mToolName = tr( "Zoom" );
// set the cursor
QPixmap myZoomQPixmap = QPixmap(( const char ** )( zoomOut ? zoom_out : zoom_in ) );
mCursor = QCursor( myZoomQPixmap, 7, 7 );