Skip to content

Commit ad0d711

Browse files
committed
new icons for Georeferencer plugin (fix #5530)
1 parent 0d23029 commit ad0d711

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+95
-34
lines changed
+32-22
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
11
<RCC>
2-
<qresource prefix="/">
3-
<file>icons/mGeorefDescription.png</file>
4-
<file>icons/mGeorefRun.png</file>
5-
<file>icons/mPushButtonClipboard.png</file>
6-
<file>icons/mPushButtonEditPaste.png</file>
7-
<file>icons/mPushButtonFileOpen.png</file>
8-
<file>icons/mPushButtonPencil.png</file>
9-
<file>icons/mPushButtonTargetSRSEnabled.png</file>
10-
<file>icons/mPushButtonTargetSRSDisabled.png</file>
11-
<file>icons/mActionGDALScript.png</file>
12-
<file>icons/mActionOpenRaster.png</file>
13-
<file>icons/mActionSaveRasterAs.png</file>
14-
<file>icons/mActionLinkGeorefToQGis.png</file>
15-
<file>icons/mActionLinkQGisToGeoref.png</file>
16-
<file>icons/mActionLoadGCPpoints.png</file>
17-
<file>icons/mActionMoveGCPPoint.png</file>
18-
<file>icons/mActionSaveGCPpointsAs.png</file>
19-
<file>icons/mActionStartGeoref.png</file>
20-
<file>icons/mActionTransformSettings.png</file>
21-
<file>icons/mActionHelp.png</file>
22-
<file>icons/mActionAbout.png</file>
23-
</qresource>
2+
<qresource prefix="/">
3+
<file>icons/default/mGeorefDescription.png</file>
4+
<file>icons/default/mGeorefRun.png</file>
5+
<file>icons/default/mPushButtonClipboard.png</file>
6+
<file>icons/default/mPushButtonEditPaste.png</file>
7+
<file>icons/default/mPushButtonFileOpen.png</file>
8+
<file>icons/default/mPushButtonPencil.png</file>
9+
<file>icons/default/mPushButtonTargetSRSEnabled.png</file>
10+
<file>icons/default/mPushButtonTargetSRSDisabled.png</file>
11+
<file>icons/default/mActionGDALScript.png</file>
12+
<file>icons/default/mActionOpenRaster.png</file>
13+
<file>icons/default/mActionSaveRasterAs.png</file>
14+
<file>icons/default/mActionLinkGeorefToQGis.png</file>
15+
<file>icons/default/mActionLinkQGisToGeoref.png</file>
16+
<file>icons/default/mActionLoadGCPpoints.png</file>
17+
<file>icons/default/mActionAddGCPPoint.png</file>
18+
<file>icons/default/mActionDeleteGCPPoint.png</file>
19+
<file>icons/default/mActionMoveGCPPoint.png</file>
20+
<file>icons/default/mActionSaveGCPpointsAs.png</file>
21+
<file>icons/default/mActionStartGeoref.png</file>
22+
<file>icons/default/mActionTransformSettings.png</file>
23+
<file>icons/default/mActionHelp.png</file>
24+
<file>icons/gis/mActionAddGCPPoint.png</file>
25+
<file>icons/gis/mActionDeleteGCPPoint.png</file>
26+
<file>icons/gis/mActionGDALScript.png</file>
27+
<file>icons/gis/mActionLoadGCPpoints.png</file>
28+
<file>icons/gis/mActionMoveGCPPoint.png</file>
29+
<file>icons/gis/mActionOpenRaster.png</file>
30+
<file>icons/gis/mActionSaveGCPpointsAs.png</file>
31+
<file>icons/gis/mActionStartGeoref.png</file>
32+
<file>icons/gis/mActionTransformSettings.png</file>
33+
</qresource>
2434
</RCC>

src/plugins/georeferencer/qgsgeorefdescriptiondialogbase.ui

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
4747
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
4848
p, li { white-space: pre-wrap; }
49-
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
50-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
49+
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Droid Sans'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
50+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:10pt;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
5151
</property>
5252
</widget>
5353
</item>
@@ -57,7 +57,7 @@ p, li { white-space: pre-wrap; }
5757
<string/>
5858
</property>
5959
<property name="pixmap">
60-
<pixmap resource="georeferencer.qrc">:/icons/mGeorefDescription.png</pixmap>
60+
<pixmap resource="georeferencer.qrc">:/icons/default/mGeorefDescription.png</pixmap>
6161
</property>
6262
<property name="scaledContents">
6363
<bool>true</bool>

src/plugins/georeferencer/qgsgeorefplugin.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static const QString sDescription = QObject::tr( "Georeferencing rasters using G
6464
static const QString sCategory = QObject::tr( "Raster" );
6565
static const QString sPluginVersion = QObject::tr( "Version 3.1.9" );
6666
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
67-
static const QString sPluginIcon = ":/icons/mGeorefRun.png";
67+
static const QString sPluginIcon = ":/icons/default/mGeorefRun.png";
6868

6969
//////////////////////////////////////////////////////////////////////
7070
//
@@ -149,7 +149,7 @@ QIcon QgsGeorefPlugin::getThemeIcon( const QString &theName )
149149
}
150150
else
151151
{
152-
return QIcon( ":/icons" + theName );
152+
return QIcon( ":/icons/default" + theName );
153153
}
154154
}
155155

src/plugins/georeferencer/qgsgeorefplugingui.cpp

+45-5
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ QgsGeorefPluginGui::QgsGeorefPluginGui( QgisInterface* theQgisInterface, QWidget
111111

112112
mCanvas->clearExtentHistory(); // reset zoomnext/zoomlast
113113

114+
connect( mIface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( updateIconTheme( QString ) ) );
115+
114116
QSettings s;
115117
if ( s.value( "/Plugin-GeoReferencer/Config/ShowDocked" ).toBool() )
116118
{
@@ -805,10 +807,10 @@ void QgsGeorefPluginGui::createActions()
805807
connect( mActionTransformSettings, SIGNAL( triggered() ), this, SLOT( getTransformSettings() ) );
806808

807809
// Edit actions
808-
mActionAddPoint->setIcon( getThemeIcon( "/mActionCapturePoint.png" ) );
810+
mActionAddPoint->setIcon( getThemeIcon( "/mActionAddGCPPoint.png" ) );
809811
connect( mActionAddPoint, SIGNAL( triggered() ), this, SLOT( setAddPointTool() ) );
810812

811-
mActionDeletePoint->setIcon( getThemeIcon( "/mActionDeleteSelected.png" ) );
813+
mActionDeletePoint->setIcon( getThemeIcon( "/mActionDeleteGCPPoint.png" ) );
812814
connect( mActionDeletePoint, SIGNAL( triggered() ), this, SLOT( setDeletePointTool() ) );
813815

814816
mActionMoveGCPPoint->setIcon( getThemeIcon( "/mActionMoveGCPPoint.png" ) );
@@ -1032,7 +1034,38 @@ void QgsGeorefPluginGui::setupConnections()
10321034

10331035
// Connect extents changed - Use for need add again Raster
10341036
connect( mCanvas, SIGNAL( extentsChanged() ), this, SLOT( extentsChanged() ) );
1037+
}
1038+
1039+
void QgsGeorefPluginGui::updateIconTheme( QString theme )
1040+
{
1041+
// File actions
1042+
mActionOpenRaster->setIcon( getThemeIcon( "/mActionOpenRaster.png" ) );
1043+
mActionStartGeoref->setIcon( getThemeIcon( "/mActionStartGeoref.png" ) );
1044+
mActionGDALScript->setIcon( getThemeIcon( "/mActionGDALScript.png" ) );
1045+
mActionLoadGCPpoints->setIcon( getThemeIcon( "/mActionLoadGCPpoints.png" ) );
1046+
mActionSaveGCPpoints->setIcon( getThemeIcon( "/mActionSaveGCPpointsAs.png" ) );
1047+
mActionTransformSettings->setIcon( getThemeIcon( "/mActionTransformSettings.png" ) );
1048+
1049+
// Edit actions
1050+
mActionAddPoint->setIcon( getThemeIcon( "/mActionAddGCPPoint.png" ) );
1051+
mActionDeletePoint->setIcon( getThemeIcon( "/mActionDeleteGCPPoint.png" ) );
1052+
mActionMoveGCPPoint->setIcon( getThemeIcon( "/mActionMoveGCPPoint.png" ) );
1053+
1054+
// View actions
1055+
mActionPan->setIcon( getThemeIcon( "/mActionPan.png" ) );
1056+
mActionZoomIn->setIcon( getThemeIcon( "/mActionZoomIn.png" ) );
1057+
mActionZoomOut->setIcon( getThemeIcon( "/mActionZoomOut.png" ) );
1058+
mActionZoomToLayer->setIcon( getThemeIcon( "/mActionZoomToLayer.png" ) );
1059+
mActionZoomLast->setIcon( getThemeIcon( "/mActionZoomLast.png" ) );
1060+
mActionZoomNext->setIcon( getThemeIcon( "/mActionZoomNext.png" ) );
1061+
mActionLinkGeorefToQGis->setIcon( getThemeIcon( "/mActionLinkGeorefToQGis.png" ) );
1062+
mActionLinkQGisToGeoref->setIcon( getThemeIcon( "/mActionLinkQGisToGeoref.png" ) );
1063+
1064+
// Settings actions
1065+
mActionRasterProperties->setIcon( getThemeIcon( "/mActionRasterProperties.png" ) );
1066+
mActionGeorefConfig->setIcon( getThemeIcon( "/mActionGeorefConfig.png" ) );
10351067

1068+
mActionQuit->setIcon( getThemeIcon( "/mActionQuit.png" ) );
10361069
}
10371070

10381071
// Mapcanvas Plugin
@@ -1451,8 +1484,6 @@ bool QgsGeorefPluginGui::writePDFMapFile( const QString& fileName, const QgsGeor
14511484
return true;
14521485
}
14531486

1454-
1455-
14561487
bool QgsGeorefPluginGui::writePDFReportFile( const QString& fileName, const QgsGeorefTransform& transform )
14571488
{
14581489
if ( !mCanvas )
@@ -1985,7 +2016,16 @@ QIcon QgsGeorefPluginGui::getThemeIcon( const QString &theName )
19852016
}
19862017
else
19872018
{
1988-
return QIcon( ":/icons" + theName );
2019+
QSettings settings;
2020+
QString themePath = ":/icons/" + settings.value( "/Themes" ).toString() + theName;
2021+
if ( QFile::exists( themePath ) )
2022+
{
2023+
return QIcon( themePath );
2024+
}
2025+
else
2026+
{
2027+
return QIcon( ":/icons/default" + theName );
2028+
}
19892029
}
19902030
}
19912031

src/plugins/georeferencer/qgsgeorefplugingui.h

+2
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ class QgsGeorefPluginGui : public QMainWindow, private Ui::QgsGeorefPluginGuiBas
107107

108108
bool updateGeorefTransform();
109109

110+
void updateIconTheme( QString theme);
111+
110112
private:
111113
enum SaveGCPs
112114
{

src/plugins/georeferencer/qgsmapcoordsdialog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ QgsMapCoordsDialog::QgsMapCoordsDialog( QgsMapCanvas* qgisCanvas, QgsPoint pixel
2828

2929
setAttribute( Qt::WA_DeleteOnClose );
3030

31-
mPointFromCanvasPushButton = new QPushButton( QIcon( ":/icons/mPushButtonPencil.png" ), tr( "From map canvas" ) );
31+
mPointFromCanvasPushButton = new QPushButton( QIcon( ":/icons/default/mPushButtonPencil.png" ), tr( "From map canvas" ) );
3232
mPointFromCanvasPushButton->setCheckable( true );
3333
buttonBox->addButton( mPointFromCanvasPushButton, QDialogButtonBox::ActionRole );
3434
adjustSize();

src/plugins/georeferencer/qgstransformsettingsdialog.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,15 @@ QIcon QgsTransformSettingsDialog::getThemeIcon( const QString &theName )
353353
}
354354
else
355355
{
356-
return QIcon( ":/icons" + theName );
356+
QSettings settings;
357+
QString themePath = ":/icons/" + settings.value( "/Themes" ).toString() + theName;
358+
if ( QFile::exists( themePath ) )
359+
{
360+
return QIcon( themePath );
361+
}
362+
else
363+
{
364+
return QIcon( ":/icons/default" + theName );
365+
}
357366
}
358367
}

0 commit comments

Comments
 (0)