|
@@ -23,6 +23,7 @@ |
|
|
#include "qgsafssourceselect.h" |
|
|
#endif |
|
|
|
|
|
#include <QMessageBox> |
|
|
#include <QCoreApplication> |
|
|
#include <QSettings> |
|
|
#include <QUrl> |
|
@@ -131,11 +132,19 @@ QList<QAction *> QgsAfsConnectionItem::actions( QWidget *parent ) |
|
|
{ |
|
|
QList<QAction *> lst; |
|
|
|
|
|
QAction *actionEdit = new QAction( tr( "Edit…" ), parent ); |
|
|
QAction *actionRefresh = new QAction( tr( "Refresh" ), parent ); |
|
|
connect( actionRefresh, &QAction::triggered, this, &QgsAfsConnectionItem::refreshConnection ); |
|
|
lst.append( actionRefresh ); |
|
|
|
|
|
QAction *separator = new QAction( parent ); |
|
|
separator->setSeparator( true ); |
|
|
lst.append( separator ); |
|
|
|
|
|
QAction *actionEdit = new QAction( tr( "Edit Connection…" ), parent ); |
|
|
connect( actionEdit, &QAction::triggered, this, &QgsAfsConnectionItem::editConnection ); |
|
|
lst.append( actionEdit ); |
|
|
|
|
|
QAction *actionDelete = new QAction( tr( "Delete" ), parent ); |
|
|
QAction *actionDelete = new QAction( tr( "Delete Connection" ), parent ); |
|
|
connect( actionDelete, &QAction::triggered, this, &QgsAfsConnectionItem::deleteConnection ); |
|
|
lst.append( actionDelete ); |
|
|
|
|
@@ -155,6 +164,11 @@ void QgsAfsConnectionItem::editConnection() |
|
|
|
|
|
void QgsAfsConnectionItem::deleteConnection() |
|
|
{ |
|
|
if ( QMessageBox::question( nullptr, QObject::tr( "Delete Connection" ), |
|
|
QObject::tr( "Are you sure you want to delete the connection to %1?" ).arg( mName ), |
|
|
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes ) |
|
|
return; |
|
|
|
|
|
QgsOwsConnection::deleteConnection( QStringLiteral( "arcgisfeatureserver" ), mName ); |
|
|
mParent->refresh(); |
|
|
} |
|
|