mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-12 00:02:25 -04:00
added refresh action on wms connection items
This commit is contained in:
parent
35550ef5cf
commit
7340f6a545
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user