Skip to content

Commit 6af57f7

Browse files
committedNov 4, 2022
Add icons for GPS toolbar
1 parent dd47e25 commit 6af57f7

File tree

7 files changed

+29
-6
lines changed

7 files changed

+29
-6
lines changed
 

‎images/images.qrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,11 @@
966966
<file>themes/default/mIconFonts.svg</file>
967967
<file>themes/default/mActionNewFileGeodatabase.svg</file>
968968
<file>themes/default/mIconBrowserRelations.svg</file>
969+
<file>themes/default/gpsicons/mIconGpsConnect.svg</file>
970+
<file>themes/default/gpsicons/mIconGpsDisconnect.svg</file>
971+
<file>themes/default/gpsicons/mActionRecenter.svg</file>
972+
<file>themes/default/gpsicons/mActionReset.svg</file>
973+
<file>themes/default/gpsicons/mActionAddTrackPoint.svg</file>
969974
</qresource>
970975
<qresource prefix="/images/tips">
971976
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

‎src/app/gps/qgsgpstoolbar.cpp

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ QgsGpsToolBar::QgsGpsToolBar( QgsAppGpsConnection *connection, QgsMapCanvas *can
3838

3939
mWgs84CRS = QgsCoordinateReferenceSystem::fromOgcWmsCrs( QStringLiteral( "EPSG:4326" ) );
4040

41-
mConnectAction = new QAction( tr( "Connect" ), this );
41+
mConnectAction = new QAction( tr( "Connect GPS" ), this );
42+
mConnectAction->setToolTip( tr( "Connect to GPS" ) );
43+
mConnectAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/gpsicons/mIconGpsConnect.svg" ) ) );
4244
mConnectAction->setCheckable( true );
4345
addAction( mConnectAction );
4446

@@ -52,6 +54,7 @@ QgsGpsToolBar::QgsGpsToolBar( QgsAppGpsConnection *connection, QgsMapCanvas *can
5254

5355
mRecenterAction = new QAction( tr( "Recenter" ) );
5456
mRecenterAction->setToolTip( tr( "Recenter map on GPS location" ) );
57+
mRecenterAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/gpsicons/mActionRecenter.svg" ) ) );
5558
mRecenterAction->setEnabled( false );
5659

5760
connect( mRecenterAction, &QAction::triggered, this, [ = ]
@@ -77,20 +80,24 @@ QgsGpsToolBar::QgsGpsToolBar( QgsAppGpsConnection *connection, QgsMapCanvas *can
7780

7881
mAddTrackPointAction = new QAction( tr( "Add Track Point" ), this );
7982
mAddTrackPointAction->setEnabled( false );
83+
mAddTrackPointAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/gpsicons/mActionAddTrackPoint.svg" ) ) );
8084
connect( mAddTrackPointAction, &QAction::triggered, this, &QgsGpsToolBar::addVertexClicked );
8185
addAction( mAddTrackPointAction );
8286

83-
mAddFeatureAction = new QAction( tr( "Add Feature" ), this );
87+
mAddFeatureAction = new QAction( tr( "Create Feature" ), this );
88+
mAddFeatureAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionCaptureLine.svg" ) ) );
8489
connect( mAddFeatureAction, &QAction::triggered, this, &QgsGpsToolBar::addFeatureClicked );
8590
addAction( mAddFeatureAction );
8691

8792
mResetFeatureAction = new QAction( tr( "Reset Feature" ), this );
93+
mResetFeatureAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/gpsicons/mActionReset.svg" ) ) );
8894
connect( mResetFeatureAction, &QAction::triggered, this, &QgsGpsToolBar::resetFeatureClicked );
8995
addAction( mResetFeatureAction );
9096

9197
addSeparator();
9298

9399
mShowInfoAction = new QAction( tr( "Information" ) );
100+
mShowInfoAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionPropertiesWidget.svg" ) ) );
94101
mShowInfoAction->setToolTip( tr( "Show GPS Information Panel" ) );
95102
mShowInfoAction->setCheckable( true );
96103
addAction( mShowInfoAction );
@@ -198,7 +205,8 @@ void QgsGpsToolBar::updateCloseFeatureButton( QgsMapLayer *lyr )
198205
mLastLayer = vlayer;
199206
}
200207

201-
QString buttonLabel = tr( "&Add Feature" );
208+
QString buttonLabel = tr( "Create Feature" );
209+
QString icon = QStringLiteral( "mActionCaptureLine.svg" );;
202210
if ( vlayer )
203211
{
204212
QgsVectorDataProvider *provider = vlayer->dataProvider();
@@ -210,15 +218,18 @@ void QgsGpsToolBar::updateCloseFeatureButton( QgsMapLayer *lyr )
210218
switch ( layerGeometryType )
211219
{
212220
case QgsWkbTypes::PointGeometry:
213-
buttonLabel = tr( "&Add Point" );
221+
buttonLabel = tr( "Create Point Feature" );
222+
icon = QStringLiteral( "mActionCapturePoint.svg" );
214223
break;
215224

216225
case QgsWkbTypes::LineGeometry:
217-
buttonLabel = tr( "&Add Line" );
226+
buttonLabel = tr( "Create Line Feature" );
227+
icon = QStringLiteral( "mActionCaptureLine.svg" );
218228
break;
219229

220230
case QgsWkbTypes::PolygonGeometry:
221-
buttonLabel = tr( "&Add Polygon" );
231+
buttonLabel = tr( "Create Polygon Feature" );
232+
icon = QStringLiteral( "mActionCapturePolygon.svg" );
222233
break;
223234

224235
case QgsWkbTypes::UnknownGeometry:
@@ -234,6 +245,8 @@ void QgsGpsToolBar::updateCloseFeatureButton( QgsMapLayer *lyr )
234245
mAddFeatureAction->setEnabled( false );
235246
}
236247
mAddFeatureAction->setText( buttonLabel );
248+
mAddFeatureAction->setIcon( QgsApplication::getThemeIcon( icon ) );
249+
mAddFeatureAction->setToolTip( buttonLabel );
237250
}
238251

239252
void QgsGpsToolBar::layerEditStateChanged()

0 commit comments

Comments
 (0)
Please sign in to comment.