Skip to content
Permalink
Browse files

added refresh action on wms connection items

  • Loading branch information
Samweli authored and nyalldawson committed Dec 28, 2019
1 parent 35550ef commit 7340f6a545064bf05cfb0ec4eb3feecca7da1351
Showing with 15 additions and 0 deletions.
  1. +14 −0 src/providers/wms/qgswmsdataitemguiproviders.cpp
  2. +1 −0 src/providers/wms/qgswmsdataitemguiproviders.h
@@ -43,6 +43,12 @@ void QgsWmsDataItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
{
if ( QgsWMSConnectionItem *connItem = qobject_cast< QgsWMSConnectionItem * >( 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 );
@@ -97,6 +103,14 @@ void QgsWmsDataItemGuiProvider::newConnection( QgsDataItem *item )
}
}

void QgsWmsDataItemGuiProvider::refreshConnection( QgsDataItem *item )
{
item->refresh();
// the parent should be updated
if ( item->parent() )
item->parent()->refreshConnections();
}


// -----------

@@ -31,6 +31,7 @@ class QgsWmsDataItemGuiProvider : public QObject, public QgsDataItemGuiProvider
QWidget *createParamWidget( QgsDataItem *root, QgsDataItemGuiContext ) override;

private:
static void refreshConnection( QgsDataItem *item );
static void editConnection( QgsDataItem *item );
static void deleteConnection( QgsDataItem *item );
static void newConnection( QgsDataItem *item );

0 comments on commit 7340f6a

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