Skip to content

Commit

Permalink
new icon for Interpolation plugins. Thanks, Robert!
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Apr 26, 2012
1 parent 0c700d3 commit 6410a9f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
Binary file removed src/plugins/interpolation/interpolation.png
Binary file not shown.
2 changes: 1 addition & 1 deletion src/plugins/interpolation/interpolator.qrc
@@ -1,6 +1,6 @@
<RCC>
<qresource prefix="/" >
<file>options.png</file>
<file>interpolation.png</file>
<file>raster-interpolate.png</file>
</qresource>
</RCC>
54 changes: 27 additions & 27 deletions src/plugins/interpolation/qgsinterpolationplugin.cpp
Expand Up @@ -26,7 +26,7 @@ static const QString name_ = QObject::tr( "Interpolation plugin" );
static const QString description_ = QObject::tr( "A plugin for interpolation based on vertices of a vector layer" );
static const QString category_ = QObject::tr( "Raster" );
static const QString version_ = QObject::tr( "Version 0.001" );
static const QString icon_ = ":/interpolation.png";
static const QString icon_ = ":/raster-interpolate.png";

QgsInterpolationPlugin::QgsInterpolationPlugin( QgisInterface* iface ): mIface( iface ), mInterpolationAction( 0 )
{
Expand All @@ -42,8 +42,8 @@ void QgsInterpolationPlugin::initGui()
{
if ( mIface )
{
mInterpolationAction = new QAction( QIcon(), tr( "&Interpolation" ), 0 );
setCurrentTheme( "" );
mInterpolationAction = new QAction( QIcon( ":/raster-interpolate.png" ), tr( "&Interpolation" ), 0 );
//~ setCurrentTheme( "" );
QObject::connect( mInterpolationAction, SIGNAL( triggered() ), this, SLOT( showInterpolationDialog() ) );
mIface->addRasterToolBarIcon( mInterpolationAction );
mIface->addPluginToRasterMenu( tr( "&Interpolation" ), mInterpolationAction );
Expand All @@ -65,30 +65,30 @@ void QgsInterpolationPlugin::showInterpolationDialog()
dialog.exec();
}

//! Set icons to the current theme
void QgsInterpolationPlugin::setCurrentTheme( QString theThemeName )
{
Q_UNUSED( theThemeName );
QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/interpolation.png";
QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/interpolation.png";
QString myQrcPath = ":/interpolation.png";
if ( QFile::exists( myCurThemePath ) )
{
mInterpolationAction->setIcon( QIcon( myCurThemePath ) );
}
else if ( QFile::exists( myDefThemePath ) )
{
mInterpolationAction->setIcon( QIcon( myDefThemePath ) );
}
else if ( QFile::exists( myQrcPath ) )
{
mInterpolationAction->setIcon( QIcon( myQrcPath ) );
}
else
{
mInterpolationAction->setIcon( QIcon() );
}
}
//~ //! Set icons to the current theme
//~ void QgsInterpolationPlugin::setCurrentTheme( QString theThemeName )
//~ {
//~ Q_UNUSED( theThemeName );
//~ QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/interpolation.png";
//~ QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/interpolation.png";
//~ QString myQrcPath = ":/interpolation.png";
//~ if ( QFile::exists( myCurThemePath ) )
//~ {
//~ mInterpolationAction->setIcon( QIcon( myCurThemePath ) );
//~ }
//~ else if ( QFile::exists( myDefThemePath ) )
//~ {
//~ mInterpolationAction->setIcon( QIcon( myDefThemePath ) );
//~ }
//~ else if ( QFile::exists( myQrcPath ) )
//~ {
//~ mInterpolationAction->setIcon( QIcon( myQrcPath ) );
//~ }
//~ else
//~ {
//~ mInterpolationAction->setIcon( QIcon() );
//~ }
//~ }

QGISEXTERN QgisPlugin * classFactory( QgisInterface * theQgisInterfacePointer )
{
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/interpolation/qgsinterpolationplugin.h
Expand Up @@ -39,8 +39,8 @@ class QgsInterpolationPlugin: public QObject, public QgisPlugin
void unload();

public slots:
//! update the plugins theme when the app tells us its theme is changed
void setCurrentTheme( QString theThemeName );
//~ //! update the plugins theme when the app tells us its theme is changed
//~ void setCurrentTheme( QString theThemeName );

private slots:
void showInterpolationDialog();
Expand Down
Binary file added src/plugins/interpolation/raster-interpolate.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6410a9f

Please sign in to comment.