@@ -72,6 +72,7 @@ extern "C" {
72
72
#include " qgsgrassedit.h"
73
73
#include " qgsgrassedittools.h"
74
74
#include " qgsgrassutils.h"
75
+ #include " qgsgrassplugin.h"
75
76
76
77
#ifdef _MSC_VER
77
78
#define round (x ) ((x) >= 0 ? floor((x)+0.5 ) : floor((x)-0.5 ))
@@ -216,77 +217,76 @@ void QgsGrassEdit::init()
216
217
217
218
connect ( mCanvas , SIGNAL (keyPressed (QKeyEvent *)), this , SLOT (keyPress (QKeyEvent *)) );
218
219
219
- QString myIconPath = QgsApplication::themePath () + " /grass/" ;
220
220
221
221
mToolBar = addToolBar (tr (" Edit tools" ));
222
222
223
223
mNewPointAction = new QAction (
224
- QIcon (myIconPath+ " grass_new_point.png" ), tr (" New point" ), this );
224
+ QgsGrassPlugin::getThemeIcon ( " grass_new_point.png" ), tr (" New point" ), this );
225
225
mNewPointAction ->setShortcut ( QKeySequence (Qt::Key_F1) );
226
226
mToolBar ->addAction ( mNewPointAction );
227
227
connect ( mNewPointAction , SIGNAL (triggered ()), this , SLOT (newPoint ()) );
228
228
229
229
mNewLineAction = new QAction (
230
- QIcon (myIconPath+ " grass_new_line.png" ), tr (" New line" ), this );
230
+ QgsGrassPlugin::getThemeIcon ( " grass_new_line.png" ), tr (" New line" ), this );
231
231
mNewLineAction ->setShortcut ( QKeySequence (Qt::Key_F2) );
232
232
mToolBar ->addAction ( mNewLineAction );
233
233
connect ( mNewLineAction , SIGNAL (triggered ()), this , SLOT (newLine ()) );
234
234
235
235
mNewBoundaryAction = new QAction (
236
- QIcon (myIconPath+ " grass_new_boundary.png" ), tr (" New boundary" ), this );
236
+ QgsGrassPlugin::getThemeIcon ( " grass_new_boundary.png" ), tr (" New boundary" ), this );
237
237
mNewBoundaryAction ->setShortcut ( QKeySequence (Qt::Key_F3) );
238
238
mToolBar ->addAction ( mNewBoundaryAction );
239
239
connect ( mNewBoundaryAction , SIGNAL (triggered ()), this , SLOT (newBoundary ()) );
240
240
241
241
mNewCentroidAction = new QAction (
242
- QIcon (myIconPath+ " grass_new_centroid.png" ), tr (" New centroid" ), this );
242
+ QgsGrassPlugin::getThemeIcon ( " grass_new_centroid.png" ), tr (" New centroid" ), this );
243
243
mNewCentroidAction ->setShortcut ( QKeySequence (Qt::Key_F4) );
244
244
mToolBar ->addAction ( mNewCentroidAction );
245
245
connect ( mNewCentroidAction , SIGNAL (triggered ()), this , SLOT (newCentroid ()) );
246
246
247
247
mMoveVertexAction = new QAction (
248
- QIcon (myIconPath+ " grass_move_vertex.png" ), tr (" Move vertex" ), this );
248
+ QgsGrassPlugin::getThemeIcon ( " grass_move_vertex.png" ), tr (" Move vertex" ), this );
249
249
mMoveVertexAction ->setShortcut ( QKeySequence (Qt::Key_F5) );
250
250
mToolBar ->addAction ( mMoveVertexAction );
251
251
connect ( mMoveVertexAction , SIGNAL (triggered ()), this , SLOT (moveVertex ()) );
252
252
253
253
mAddVertexAction = new QAction (
254
- QIcon (myIconPath+ " grass_add_vertex.png" ), tr (" Add vertex" ), this );
254
+ QgsGrassPlugin::getThemeIcon ( " grass_add_vertex.png" ), tr (" Add vertex" ), this );
255
255
mAddVertexAction ->setShortcut ( QKeySequence (Qt::Key_F6) );
256
256
mToolBar ->addAction ( mAddVertexAction );
257
257
connect ( mAddVertexAction , SIGNAL (triggered ()), this , SLOT (addVertex ()) );
258
258
259
259
mDeleteVertexAction = new QAction (
260
- QIcon (myIconPath+ " grass_delete_vertex.png" ), tr (" Delete vertex" ), this );
260
+ QgsGrassPlugin::getThemeIcon ( " grass_delete_vertex.png" ), tr (" Delete vertex" ), this );
261
261
mDeleteVertexAction ->setShortcut ( QKeySequence (Qt::Key_F7) );
262
262
mToolBar ->addAction ( mDeleteVertexAction );
263
263
connect ( mDeleteVertexAction , SIGNAL (triggered ()), this , SLOT (deleteVertex ()) );
264
264
265
265
mMoveLineAction = new QAction (
266
- QIcon (myIconPath+ " grass_move_line.png" ), tr (" Move element" ), this );
266
+ QgsGrassPlugin::getThemeIcon ( " grass_move_line.png" ), tr (" Move element" ), this );
267
267
mMoveLineAction ->setShortcut ( QKeySequence (Qt::Key_F9) );
268
268
mToolBar ->addAction ( mMoveLineAction );
269
269
connect ( mMoveLineAction , SIGNAL (triggered ()), this , SLOT (moveLine ()) );
270
270
271
271
mSplitLineAction = new QAction (
272
- QIcon (myIconPath+ " grass_split_line.png" ), tr (" Split line" ), this );
272
+ QgsGrassPlugin::getThemeIcon ( " grass_split_line.png" ), tr (" Split line" ), this );
273
273
mSplitLineAction ->setShortcut ( QKeySequence (Qt::Key_F10) );
274
274
mToolBar ->addAction ( mSplitLineAction );
275
275
connect ( mSplitLineAction , SIGNAL (triggered ()), this , SLOT (splitLine ()) );
276
276
277
277
mDeleteLineAction = new QAction (
278
- QIcon (myIconPath+ " grass_delete_line.png" ), tr (" Delete element" ), this );
278
+ QgsGrassPlugin::getThemeIcon ( " grass_delete_line.png" ), tr (" Delete element" ), this );
279
279
mDeleteLineAction ->setShortcut ( QKeySequence (Qt::Key_F11) );
280
280
mToolBar ->addAction ( mDeleteLineAction );
281
281
connect ( mDeleteLineAction , SIGNAL (triggered ()), this , SLOT (deleteLine ()) );
282
282
283
283
mEditAttributesAction = new QAction (
284
- QIcon (myIconPath+ " grass_edit_attributes.png" ), tr (" Edit attributes" ), this );
284
+ QgsGrassPlugin::getThemeIcon ( " grass_edit_attributes.png" ), tr (" Edit attributes" ), this );
285
285
mToolBar ->addAction ( mEditAttributesAction );
286
286
connect ( mEditAttributesAction , SIGNAL (triggered ()), this , SLOT (editAttributes ()) );
287
287
288
288
mCloseEditAction = new QAction (
289
- QIcon (myIconPath+ " grass_close_edit.png" ), tr (" Close" ), this );
289
+ QgsGrassPlugin::getThemeIcon ( " grass_close_edit.png" ), tr (" Close" ), this );
290
290
mToolBar ->addAction ( mCloseEditAction );
291
291
connect ( mCloseEditAction , SIGNAL (triggered ()), this , SLOT (closeEdit ()) );
292
292
0 commit comments