Skip to content
Permalink
Browse files

[GRASS] distinct icons for open/searched mapset

  • Loading branch information
blazek committed Dec 15, 2015
1 parent 2f8ea52 commit 5c551837fb4b124935ee129d16d8a86fc7cdda28
@@ -92,6 +92,8 @@
<file>themes/default/gpsicons/polarchart.svg</file>
<file>themes/default/grass_location.png</file>
<file>themes/default/grass_mapset.png</file>
<file>themes/default/grass_mapset_open.png</file>
<file>themes/default/grass_mapset_search.png</file>
<file>themes/default/histogram.png</file>
<file>themes/default/join_bevel.png</file>
<file>themes/default/join_miter.png</file>
Binary file not shown.
Binary file not shown.
@@ -353,9 +353,29 @@ QgsGrassMapsetItem::QgsGrassMapsetItem( QgsDataItem* parent, QString dirPath, QS
mGrassObject = QgsGrassObject( gisdbase, location, mName, "", QgsGrassObject::Mapset );
mActions = new QgsGrassItemActions( mGrassObject, true, this );

// emit data changed to possibly change icon
connect( QgsGrass::instance(), SIGNAL( mapsetChanged() ), this, SLOT( emitDataChanged() ) );
connect( QgsGrass::instance(), SIGNAL( mapsetSearchPathChanged() ), this, SLOT( emitDataChanged() ) );

mIconName = "grass_mapset.png";
}

QIcon QgsGrassMapsetItem::icon()
{
if ( mGrassObject == QgsGrass::getDefaultMapsetObject() )
{
return QgsApplication::getThemeIcon( "/grass_mapset_open.png" );
}
else if ( mGrassObject.locationIdentical( QgsGrass::getDefaultLocationObject() ) )
{
if ( QgsGrass::instance()->isMapsetInSearchPath( mName ) )
{
return QgsApplication::getThemeIcon( "/grass_mapset_search.png" );
}
}
return QgsDataItem::icon();
}

void QgsGrassMapsetItem::setState( State state )
{
QgsDebugMsg( "Entered" );
@@ -90,7 +90,7 @@ class QgsGrassMapsetItem : public QgsDirectoryItem, public QgsGrassObjectItemBas

virtual void setState( State state ) override;

QIcon icon() override { return QgsDataItem::icon(); }
QIcon icon() override;

QVector<QgsDataItem*> createChildren() override;
virtual QList<QAction*> actions() override { return mActions->actions(); }

0 comments on commit 5c55183

Please sign in to comment.
You can’t perform that action at this time.