Skip to content

Commit

Permalink
new icons for Georeferencer plugin (fix #5530)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed May 6, 2012
1 parent 0d23029 commit ad0d711
Show file tree
Hide file tree
Showing 43 changed files with 95 additions and 34 deletions.
54 changes: 32 additions & 22 deletions src/plugins/georeferencer/georeferencer.qrc
@@ -1,24 +1,34 @@
<RCC>
<qresource prefix="/">
<file>icons/mGeorefDescription.png</file>
<file>icons/mGeorefRun.png</file>
<file>icons/mPushButtonClipboard.png</file>
<file>icons/mPushButtonEditPaste.png</file>
<file>icons/mPushButtonFileOpen.png</file>
<file>icons/mPushButtonPencil.png</file>
<file>icons/mPushButtonTargetSRSEnabled.png</file>
<file>icons/mPushButtonTargetSRSDisabled.png</file>
<file>icons/mActionGDALScript.png</file>
<file>icons/mActionOpenRaster.png</file>
<file>icons/mActionSaveRasterAs.png</file>
<file>icons/mActionLinkGeorefToQGis.png</file>
<file>icons/mActionLinkQGisToGeoref.png</file>
<file>icons/mActionLoadGCPpoints.png</file>
<file>icons/mActionMoveGCPPoint.png</file>
<file>icons/mActionSaveGCPpointsAs.png</file>
<file>icons/mActionStartGeoref.png</file>
<file>icons/mActionTransformSettings.png</file>
<file>icons/mActionHelp.png</file>
<file>icons/mActionAbout.png</file>
</qresource>
<qresource prefix="/">
<file>icons/default/mGeorefDescription.png</file>
<file>icons/default/mGeorefRun.png</file>
<file>icons/default/mPushButtonClipboard.png</file>
<file>icons/default/mPushButtonEditPaste.png</file>
<file>icons/default/mPushButtonFileOpen.png</file>
<file>icons/default/mPushButtonPencil.png</file>
<file>icons/default/mPushButtonTargetSRSEnabled.png</file>
<file>icons/default/mPushButtonTargetSRSDisabled.png</file>
<file>icons/default/mActionGDALScript.png</file>
<file>icons/default/mActionOpenRaster.png</file>
<file>icons/default/mActionSaveRasterAs.png</file>
<file>icons/default/mActionLinkGeorefToQGis.png</file>
<file>icons/default/mActionLinkQGisToGeoref.png</file>
<file>icons/default/mActionLoadGCPpoints.png</file>
<file>icons/default/mActionAddGCPPoint.png</file>
<file>icons/default/mActionDeleteGCPPoint.png</file>
<file>icons/default/mActionMoveGCPPoint.png</file>
<file>icons/default/mActionSaveGCPpointsAs.png</file>
<file>icons/default/mActionStartGeoref.png</file>
<file>icons/default/mActionTransformSettings.png</file>
<file>icons/default/mActionHelp.png</file>
<file>icons/gis/mActionAddGCPPoint.png</file>
<file>icons/gis/mActionDeleteGCPPoint.png</file>
<file>icons/gis/mActionGDALScript.png</file>
<file>icons/gis/mActionLoadGCPpoints.png</file>
<file>icons/gis/mActionMoveGCPPoint.png</file>
<file>icons/gis/mActionOpenRaster.png</file>
<file>icons/gis/mActionSaveGCPpointsAs.png</file>
<file>icons/gis/mActionStartGeoref.png</file>
<file>icons/gis/mActionTransformSettings.png</file>
</qresource>
</RCC>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/plugins/georeferencer/qgsgeorefdescriptiondialogbase.ui
Expand Up @@ -46,8 +46,8 @@
<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;
&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;
p, li { white-space: pre-wrap; }
&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;
&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>
&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;
&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>
</property>
</widget>
</item>
Expand All @@ -57,7 +57,7 @@ p, li { white-space: pre-wrap; }
<string/>
</property>
<property name="pixmap">
<pixmap resource="georeferencer.qrc">:/icons/mGeorefDescription.png</pixmap>
<pixmap resource="georeferencer.qrc">:/icons/default/mGeorefDescription.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/georeferencer/qgsgeorefplugin.cpp
Expand Up @@ -64,7 +64,7 @@ static const QString sDescription = QObject::tr( "Georeferencing rasters using G
static const QString sCategory = QObject::tr( "Raster" );
static const QString sPluginVersion = QObject::tr( "Version 3.1.9" );
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
static const QString sPluginIcon = ":/icons/mGeorefRun.png";
static const QString sPluginIcon = ":/icons/default/mGeorefRun.png";

//////////////////////////////////////////////////////////////////////
//
Expand Down Expand Up @@ -149,7 +149,7 @@ QIcon QgsGeorefPlugin::getThemeIcon( const QString &theName )
}
else
{
return QIcon( ":/icons" + theName );
return QIcon( ":/icons/default" + theName );
}
}

Expand Down
50 changes: 45 additions & 5 deletions src/plugins/georeferencer/qgsgeorefplugingui.cpp
Expand Up @@ -111,6 +111,8 @@ QgsGeorefPluginGui::QgsGeorefPluginGui( QgisInterface* theQgisInterface, QWidget

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

connect( mIface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( updateIconTheme( QString ) ) );

QSettings s;
if ( s.value( "/Plugin-GeoReferencer/Config/ShowDocked" ).toBool() )
{
Expand Down Expand Up @@ -805,10 +807,10 @@ void QgsGeorefPluginGui::createActions()
connect( mActionTransformSettings, SIGNAL( triggered() ), this, SLOT( getTransformSettings() ) );

// Edit actions
mActionAddPoint->setIcon( getThemeIcon( "/mActionCapturePoint.png" ) );
mActionAddPoint->setIcon( getThemeIcon( "/mActionAddGCPPoint.png" ) );
connect( mActionAddPoint, SIGNAL( triggered() ), this, SLOT( setAddPointTool() ) );

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

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

// Connect extents changed - Use for need add again Raster
connect( mCanvas, SIGNAL( extentsChanged() ), this, SLOT( extentsChanged() ) );
}

void QgsGeorefPluginGui::updateIconTheme( QString theme )
{
// File actions
mActionOpenRaster->setIcon( getThemeIcon( "/mActionOpenRaster.png" ) );
mActionStartGeoref->setIcon( getThemeIcon( "/mActionStartGeoref.png" ) );
mActionGDALScript->setIcon( getThemeIcon( "/mActionGDALScript.png" ) );
mActionLoadGCPpoints->setIcon( getThemeIcon( "/mActionLoadGCPpoints.png" ) );
mActionSaveGCPpoints->setIcon( getThemeIcon( "/mActionSaveGCPpointsAs.png" ) );
mActionTransformSettings->setIcon( getThemeIcon( "/mActionTransformSettings.png" ) );

// Edit actions
mActionAddPoint->setIcon( getThemeIcon( "/mActionAddGCPPoint.png" ) );
mActionDeletePoint->setIcon( getThemeIcon( "/mActionDeleteGCPPoint.png" ) );
mActionMoveGCPPoint->setIcon( getThemeIcon( "/mActionMoveGCPPoint.png" ) );

// View actions
mActionPan->setIcon( getThemeIcon( "/mActionPan.png" ) );
mActionZoomIn->setIcon( getThemeIcon( "/mActionZoomIn.png" ) );
mActionZoomOut->setIcon( getThemeIcon( "/mActionZoomOut.png" ) );
mActionZoomToLayer->setIcon( getThemeIcon( "/mActionZoomToLayer.png" ) );
mActionZoomLast->setIcon( getThemeIcon( "/mActionZoomLast.png" ) );
mActionZoomNext->setIcon( getThemeIcon( "/mActionZoomNext.png" ) );
mActionLinkGeorefToQGis->setIcon( getThemeIcon( "/mActionLinkGeorefToQGis.png" ) );
mActionLinkQGisToGeoref->setIcon( getThemeIcon( "/mActionLinkQGisToGeoref.png" ) );

// Settings actions
mActionRasterProperties->setIcon( getThemeIcon( "/mActionRasterProperties.png" ) );
mActionGeorefConfig->setIcon( getThemeIcon( "/mActionGeorefConfig.png" ) );

mActionQuit->setIcon( getThemeIcon( "/mActionQuit.png" ) );
}

// Mapcanvas Plugin
Expand Down Expand Up @@ -1451,8 +1484,6 @@ bool QgsGeorefPluginGui::writePDFMapFile( const QString& fileName, const QgsGeor
return true;
}



bool QgsGeorefPluginGui::writePDFReportFile( const QString& fileName, const QgsGeorefTransform& transform )
{
if ( !mCanvas )
Expand Down Expand Up @@ -1985,7 +2016,16 @@ QIcon QgsGeorefPluginGui::getThemeIcon( const QString &theName )
}
else
{
return QIcon( ":/icons" + theName );
QSettings settings;
QString themePath = ":/icons/" + settings.value( "/Themes" ).toString() + theName;
if ( QFile::exists( themePath ) )
{
return QIcon( themePath );
}
else
{
return QIcon( ":/icons/default" + theName );
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/plugins/georeferencer/qgsgeorefplugingui.h
Expand Up @@ -107,6 +107,8 @@ class QgsGeorefPluginGui : public QMainWindow, private Ui::QgsGeorefPluginGuiBas

bool updateGeorefTransform();

void updateIconTheme( QString theme);

private:
enum SaveGCPs
{
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/georeferencer/qgsmapcoordsdialog.cpp
Expand Up @@ -28,7 +28,7 @@ QgsMapCoordsDialog::QgsMapCoordsDialog( QgsMapCanvas* qgisCanvas, QgsPoint pixel

setAttribute( Qt::WA_DeleteOnClose );

mPointFromCanvasPushButton = new QPushButton( QIcon( ":/icons/mPushButtonPencil.png" ), tr( "From map canvas" ) );
mPointFromCanvasPushButton = new QPushButton( QIcon( ":/icons/default/mPushButtonPencil.png" ), tr( "From map canvas" ) );
mPointFromCanvasPushButton->setCheckable( true );
buttonBox->addButton( mPointFromCanvasPushButton, QDialogButtonBox::ActionRole );
adjustSize();
Expand Down
11 changes: 10 additions & 1 deletion src/plugins/georeferencer/qgstransformsettingsdialog.cpp
Expand Up @@ -353,6 +353,15 @@ QIcon QgsTransformSettingsDialog::getThemeIcon( const QString &theName )
}
else
{
return QIcon( ":/icons" + theName );
QSettings settings;
QString themePath = ":/icons/" + settings.value( "/Themes" ).toString() + theName;
if ( QFile::exists( themePath ) )
{
return QIcon( themePath );
}
else
{
return QIcon( ":/icons/default" + theName );
}
}
}

0 comments on commit ad0d711

Please sign in to comment.