mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-12 00:02:25 -04:00
refresh action on wcs connection items
This commit is contained in:
parent
7340f6a545
commit
d43ab4c007
@ -33,6 +33,12 @@ void QgsWcsDataItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
|
|||||||
|
|
||||||
if ( QgsWCSConnectionItem *connItem = qobject_cast< QgsWCSConnectionItem * >( item ) )
|
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 );
|
QAction *actionEdit = new QAction( tr( "Edit…" ), this );
|
||||||
connect( actionEdit, &QAction::triggered, this, [connItem] { editConnection( connItem ); } );
|
connect( actionEdit, &QAction::triggered, this, [connItem] { editConnection( connItem ); } );
|
||||||
menu->addAction( actionEdit );
|
menu->addAction( actionEdit );
|
||||||
@ -74,3 +80,11 @@ void QgsWcsDataItemGuiProvider::deleteConnection( QgsDataItem *item )
|
|||||||
// the parent should be updated
|
// the parent should be updated
|
||||||
item->parent()->refreshConnections();
|
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 newConnection( QgsDataItem *item );
|
||||||
static void editConnection( QgsDataItem *item );
|
static void editConnection( QgsDataItem *item );
|
||||||
static void deleteConnection( QgsDataItem *item );
|
static void deleteConnection( QgsDataItem *item );
|
||||||
|
static void refreshConnection( QgsDataItem *item );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user