Skip to content
Permalink
Browse files

refresh action on wcs connection items

  • Loading branch information
Samweli authored and nyalldawson committed Dec 30, 2019
1 parent 7340f6a commit d43ab4c0079a7b492911d753490023f3f619f0a2
Showing with 15 additions and 0 deletions.
  1. +14 −0 src/providers/wcs/qgswcsdataitemguiprovider.cpp
  2. +1 −0 src/providers/wcs/qgswcsdataitemguiprovider.h
@@ -33,6 +33,12 @@ void QgsWcsDataItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m

if ( QgsWCSConnectionItem *connItem = qobject_cast< QgsWCSConnectionItem * >( item ) )
{
QAction *actionRefresh = new QAction( tr( "Refresh" ), this );
connect( actionRefresh, &QAction::triggered, this, [connItem] { refreshConnection( connItem ); } );
menu->addAction( actionRefresh );

menu->addSeparator();

QAction *actionEdit = new QAction( tr( "Edit…" ), this );
connect( actionEdit, &QAction::triggered, this, [connItem] { editConnection( connItem ); } );
menu->addAction( actionEdit );
@@ -74,3 +80,11 @@ void QgsWcsDataItemGuiProvider::deleteConnection( QgsDataItem *item )
// the parent should be updated
item->parent()->refreshConnections();
}

void QgsWcsDataItemGuiProvider::refreshConnection( QgsDataItem *item )
{
item->refresh();
// the parent should be updated
if ( item->parent() )
item->parent()->refreshConnections();
}
@@ -32,6 +32,7 @@ class QgsWcsDataItemGuiProvider : public QObject, public QgsDataItemGuiProvider
static void newConnection( QgsDataItem *item );
static void editConnection( QgsDataItem *item );
static void deleteConnection( QgsDataItem *item );
static void refreshConnection( QgsDataItem *item );

};

0 comments on commit d43ab4c

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