Skip to content

Commit

Permalink
add icon created by Robert to Zonal statistics plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Apr 26, 2012
1 parent 63fa68e commit 17e00c8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/plugins/zonal_statistics/CMakeLists.txt
Expand Up @@ -6,7 +6,7 @@ SET (ZONAL_STATISTICS_SRCS
qgszonalstatisticsdialog.cpp
)

SET (ZONAL_STATISTICS_UIS
SET (ZONAL_STATISTICS_UIS
qgszonalstatisticsdialogbase.ui
)

Expand All @@ -15,6 +15,8 @@ qgszonalstatisticsdialog.h
qgszonalstatisticsplugin.h
)

SET (ZONAL_STATISTICS_RCCS zonal_statistics.qrc)

########################################################
# Build

Expand All @@ -24,17 +26,17 @@ QT4_WRAP_CPP (ZONAL_STATISTICS_MOC_SRCS ${ZONAL_STATISTICS_MOC_HDRS})

QT4_ADD_RESOURCES(ZONAL_STATISTICS_RCC_SRCS ${ZONAL_STATISTICS_RCCS})

ADD_LIBRARY (zonalstatisticsplugin MODULE
ADD_LIBRARY (zonalstatisticsplugin MODULE
${ZONAL_STATISTICS_SRCS}
${ZONAL_STATISTICS_MOC_SRCS}
${ZONAL_STATISTICS_RCC_SRCS}
${ZONAL_STATISTICS_MOC_SRCS}
${ZONAL_STATISTICS_RCC_SRCS}
${ZONAL_STATISTICS_UIS_H})

INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${GDAL_INCLUDE_DIR}
../../core
../../core/raster
../../core
../../core/raster
../../gui
../../analysis/vector
..
Expand Down
8 changes: 7 additions & 1 deletion src/plugins/zonal_statistics/qgszonalstatisticsplugin.cpp
Expand Up @@ -27,6 +27,7 @@ static const QString name_ = QObject::tr( "Zonal statistics plugin" );
static const QString description_ = QObject::tr( "A plugin to calculate count, sum, mean of rasters for each polygon of a vector layer" );
static const QString category_ = QObject::tr( "Raster" );
static const QString version_ = QObject::tr( "Version 0.1" );
static const QString pluginIcon_ = ":/zonal_statistics/raster-stats.png";

QgsZonalStatisticsPlugin::QgsZonalStatisticsPlugin( QgisInterface* iface ): mIface( iface ), mAction( 0 )
{
Expand All @@ -40,7 +41,7 @@ QgsZonalStatisticsPlugin::~QgsZonalStatisticsPlugin()

void QgsZonalStatisticsPlugin::initGui()
{
mAction = new QAction( tr( "&Zonal statistics" ), 0 );
mAction = new QAction( QIcon( ":/zonal_statistics/raster-stats.png" ), tr( "&Zonal statistics" ), 0 );
QObject::connect( mAction, SIGNAL( triggered() ), this, SLOT( run() ) );
mIface->addRasterToolBarIcon( mAction );
mIface->addPluginToRasterMenu( tr( "&Zonal statistics" ), mAction );
Expand Down Expand Up @@ -100,6 +101,11 @@ QGISEXTERN QString version()
return version_;
}

QGISEXTERN QString icon()
{
return pluginIcon_;
}

QGISEXTERN int type()
{
return QgisPlugin::UI;
Expand Down
Binary file added src/plugins/zonal_statistics/raster-stats.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/plugins/zonal_statistics/zonal_statistics.qrc
@@ -0,0 +1,6 @@
<RCC>
<qresource prefix="/zonal_statistics/" >
<file>raster-stats.png</file>
</qresource>
</RCC>

0 comments on commit 17e00c8

Please sign in to comment.