Skip to content

Commit

Permalink
[browser] Standardize text for "remove connection" actions
Browse files Browse the repository at this point in the history
Instead of mixing delete/remove/delete connection, standardize
on always using "Remove Connection". This is the most explicit,
and avoids the confusion of users misinterpreting the action
as deleting the linked databases.
  • Loading branch information
nyalldawson authored and github-actions[bot] committed Dec 14, 2021
1 parent 16a3bed commit 7df55fb
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion src/gui/qgsowssourceselect.cpp
Expand Up @@ -284,7 +284,7 @@ void QgsOWSSourceSelect::mDeleteButton_clicked()
{
const QString msg = tr( "Are you sure you want to remove the %1 connection and all associated settings?" )
.arg( mConnectionsComboBox->currentText() );
const QMessageBox::StandardButton result = QMessageBox::question( this, tr( "Delete Connection" ), msg, QMessageBox::Yes | QMessageBox::No );
const QMessageBox::StandardButton result = QMessageBox::question( this, tr( "Remove Connection" ), msg, QMessageBox::Yes | QMessageBox::No );
if ( result == QMessageBox::Yes )
{
QgsOwsConnection::deleteConnection( mService, mConnectionsComboBox->currentText() );
Expand Down
6 changes: 3 additions & 3 deletions src/gui/vectortile/qgsvectortiledataitemguiprovider.cpp
Expand Up @@ -30,11 +30,11 @@ void QgsVectorTileDataItemGuiProvider::populateContextMenu( QgsDataItem *item, Q
{
if ( QgsVectorTileLayerItem *layerItem = qobject_cast< QgsVectorTileLayerItem * >( item ) )
{
QAction *actionEdit = new QAction( tr( "Edit…" ), menu );
QAction *actionEdit = new QAction( tr( "Edit Connection" ), menu );
connect( actionEdit, &QAction::triggered, this, [layerItem] { editConnection( layerItem ); } );
menu->addAction( actionEdit );

QAction *actionDelete = new QAction( tr( "Delete" ), menu );
QAction *actionDelete = new QAction( tr( "Remove Connection" ), menu );
connect( actionDelete, &QAction::triggered, this, [layerItem] { deleteConnection( layerItem ); } );
menu->addAction( actionDelete );
}
Expand Down Expand Up @@ -102,7 +102,7 @@ void QgsVectorTileDataItemGuiProvider::editConnection( QgsDataItem *item )

void QgsVectorTileDataItemGuiProvider::deleteConnection( QgsDataItem *item )
{
if ( QMessageBox::question( nullptr, tr( "Delete Connection" ), tr( "Are you sure you want to delete the connection “%1”?" ).arg( item->name() ),
if ( QMessageBox::question( nullptr, tr( "Remove Connection" ), tr( "Are you sure you want to remove the connection “%1”?" ).arg( item->name() ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes )
return;

Expand Down
6 changes: 3 additions & 3 deletions src/providers/arcgisrest/qgsarcgisrestdataitemguiprovider.cpp
Expand Up @@ -52,7 +52,7 @@ void QgsArcGisRestDataItemGuiProvider::populateContextMenu( QgsDataItem *item, Q
connect( actionEdit, &QAction::triggered, this, [connectionItem] { editConnection( connectionItem ); } );
menu->addAction( actionEdit );

QAction *actionDelete = new QAction( tr( "Delete Connection…" ), menu );
QAction *actionDelete = new QAction( tr( "Remove Connection…" ), menu );
connect( actionDelete, &QAction::triggered, this, [connectionItem] { deleteConnection( connectionItem ); } );
menu->addAction( actionDelete );

Expand Down Expand Up @@ -148,8 +148,8 @@ void QgsArcGisRestDataItemGuiProvider::editConnection( QgsDataItem *item )

void QgsArcGisRestDataItemGuiProvider::deleteConnection( QgsDataItem *item )
{
if ( QMessageBox::question( nullptr, QObject::tr( "Delete Connection" ),
QObject::tr( "Are you sure you want to delete the connection to %1?" ).arg( item->name() ),
if ( QMessageBox::question( nullptr, QObject::tr( "Remove Connection" ),
QObject::tr( "Are you sure you want to remove the connection to %1?" ).arg( item->name() ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes )
return;

Expand Down
2 changes: 1 addition & 1 deletion src/providers/db2/qgsdb2dataitemguiprovider.cpp
Expand Up @@ -48,7 +48,7 @@ void QgsDb2DataItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
connect( actionEdit, &QAction::triggered, this, [connItem] { editConnection( connItem ); } );
menu->addAction( actionEdit );

QAction *actionDelete = new QAction( tr( "Delete Connection" ), menu );
QAction *actionDelete = new QAction( tr( "Remove Connection" ), menu );
connect( actionDelete, &QAction::triggered, this, [connItem] { deleteConnection( connItem ); } );
menu->addAction( actionDelete );
}
Expand Down
4 changes: 2 additions & 2 deletions src/providers/geonode/qgsgeonodedataitemguiprovider.cpp
Expand Up @@ -43,7 +43,7 @@ void QgsGeoNodeDataItemGuiProvider::populateContextMenu( QgsDataItem *item, QMen
connect( actionEdit, &QAction::triggered, this, [connItem] { editConnection( connItem ); } );
menu->addAction( actionEdit );

QAction *actionDelete = new QAction( tr( "Delete Connection" ), menu );
QAction *actionDelete = new QAction( tr( "Remove Connection" ), menu );
connect( actionDelete, &QAction::triggered, this, [connItem] { deleteConnection( connItem ); } );
menu->addAction( actionDelete );
}
Expand Down Expand Up @@ -73,7 +73,7 @@ void QgsGeoNodeDataItemGuiProvider::editConnection( QgsDataItem *item )

void QgsGeoNodeDataItemGuiProvider::deleteConnection( QgsDataItem *item )
{
if ( QMessageBox::question( nullptr, tr( "Delete Connection" ), tr( "Are you sure you want to delete the connection “%1”?" ).arg( item->name() ),
if ( QMessageBox::question( nullptr, tr( "Remove Connection" ), tr( "Are you sure you want to remove the connection “%1”?" ).arg( item->name() ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes )
return;

Expand Down
6 changes: 3 additions & 3 deletions src/providers/hana/qgshanadataitemguiprovider.cpp
Expand Up @@ -49,7 +49,7 @@ void QgsHanaDataItemGuiProvider::populateContextMenu(
connect( actionEdit, &QAction::triggered, this, [connItem] { editConnection( connItem ); } );
menu->addAction( actionEdit );

QAction *actionDelete = new QAction( tr( "Delete Connection" ), this );
QAction *actionDelete = new QAction( tr( "Remove Connection" ), this );
connect( actionDelete, &QAction::triggered, this, [connItem] { deleteConnection( connItem ); } );
menu->addAction( actionDelete );

Expand Down Expand Up @@ -197,8 +197,8 @@ void QgsHanaDataItemGuiProvider::editConnection( QgsDataItem *item )

void QgsHanaDataItemGuiProvider::deleteConnection( QgsDataItem *item )
{
if ( QMessageBox::question( nullptr, tr( "Delete Connection" ),
tr( "Are you sure you want to delete the connection to %1?" ).arg( item->name() ),
if ( QMessageBox::question( nullptr, tr( "Remove Connection" ),
tr( "Are you sure you want to remove the connection to %1?" ).arg( item->name() ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes )
return;

Expand Down
6 changes: 3 additions & 3 deletions src/providers/mssql/qgsmssqldataitemguiprovider.cpp
Expand Up @@ -58,7 +58,7 @@ void QgsMssqlDataItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu
connect( actionEdit, &QAction::triggered, this, [connItem] { editConnection( connItem ); } );
menu->addAction( actionEdit );

QAction *actionDelete = new QAction( tr( "Delete Connection" ), menu );
QAction *actionDelete = new QAction( tr( "Remove Connection" ), menu );
connect( actionDelete, &QAction::triggered, this, [connItem] { deleteConnection( connItem ); } );
menu->addAction( actionDelete );

Expand Down Expand Up @@ -181,8 +181,8 @@ void QgsMssqlDataItemGuiProvider::editConnection( QgsDataItem *item )

void QgsMssqlDataItemGuiProvider::deleteConnection( QgsDataItem *item )
{
if ( QMessageBox::question( nullptr, QObject::tr( "Delete Connection" ),
QObject::tr( "Are you sure you want to delete the connection to %1?" ).arg( item->name() ),
if ( QMessageBox::question( nullptr, QObject::tr( "Remove Connection" ),
QObject::tr( "Are you sure you want to remove the connection to %1?" ).arg( item->name() ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes )
return;

Expand Down
6 changes: 3 additions & 3 deletions src/providers/oracle/qgsoracledataitems.cpp
Expand Up @@ -285,7 +285,7 @@ QList<QAction *> QgsOracleConnectionItem::actions( QWidget *parent )
connect( actionEdit, &QAction::triggered, this, &QgsOracleConnectionItem::editConnection );
lst.append( actionEdit );

QAction *actionDelete = new QAction( tr( "Delete Connection" ), parent );
QAction *actionDelete = new QAction( tr( "Remove Connection" ), parent );
connect( actionDelete, &QAction::triggered, this, &QgsOracleConnectionItem::deleteConnection );
lst.append( actionDelete );

Expand All @@ -304,8 +304,8 @@ void QgsOracleConnectionItem::editConnection()

void QgsOracleConnectionItem::deleteConnection()
{
if ( QMessageBox::question( nullptr, QObject::tr( "Delete Connection" ),
QObject::tr( "Are you sure you want to delete the connection to %1?" ).arg( mName ),
if ( QMessageBox::question( nullptr, QObject::tr( "Remove Connection" ),
QObject::tr( "Are you sure you want to remove the connection to %1?" ).arg( mName ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes )
return;

Expand Down
6 changes: 3 additions & 3 deletions src/providers/postgres/qgspostgresdataitemguiprovider.cpp
Expand Up @@ -56,7 +56,7 @@ void QgsPostgresDataItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
connect( actionEdit, &QAction::triggered, this, [connItem] { editConnection( connItem ); } );
menu->addAction( actionEdit );

QAction *actionDelete = new QAction( tr( "Delete Connection" ), menu );
QAction *actionDelete = new QAction( tr( "Remove Connection" ), menu );
connect( actionDelete, &QAction::triggered, this, [connItem] { deleteConnection( connItem ); } );
menu->addAction( actionDelete );

Expand Down Expand Up @@ -214,8 +214,8 @@ void QgsPostgresDataItemGuiProvider::editConnection( QgsDataItem *item )

void QgsPostgresDataItemGuiProvider::deleteConnection( QgsDataItem *item )
{
if ( QMessageBox::question( nullptr, QObject::tr( "Delete Connection" ),
QObject::tr( "Are you sure you want to delete the connection to %1?" ).arg( item->name() ),
if ( QMessageBox::question( nullptr, QObject::tr( "Remove Connection" ),
QObject::tr( "Are you sure you want to remove the connection to %1?" ).arg( item->name() ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes )
return;

Expand Down
10 changes: 5 additions & 5 deletions src/providers/spatialite/qgsspatialitedataitemguiprovider.cpp
Expand Up @@ -47,9 +47,9 @@ void QgsSpatiaLiteDataItemGuiProvider::populateContextMenu( QgsDataItem *item, Q

if ( QgsSLConnectionItem *connItem = qobject_cast< QgsSLConnectionItem * >( item ) )
{
QAction *actionDelete = new QAction( tr( "Delete" ), menu );
connect( actionDelete, &QAction::triggered, this, [connItem] { deleteConnection( connItem ); } );
menu->addAction( actionDelete );
QAction *actionDeleteConnection = new QAction( tr( "Remove Connection" ), menu );
connect( actionDeleteConnection, &QAction::triggered, this, [connItem] { deleteConnection( connItem ); } );
menu->addAction( actionDeleteConnection );
}
}

Expand Down Expand Up @@ -133,8 +133,8 @@ void QgsSpatiaLiteDataItemGuiProvider::createDatabase( QgsDataItem *item )

void QgsSpatiaLiteDataItemGuiProvider::deleteConnection( QgsDataItem *item )
{
if ( QMessageBox::question( nullptr, QObject::tr( "Delete Connection" ),
QObject::tr( "Are you sure you want to delete the connection to %1?" ).arg( item->name() ),
if ( QMessageBox::question( nullptr, QObject::tr( "Remove Connection" ),
QObject::tr( "Are you sure you want to remove the connection to %1?" ).arg( item->name() ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes )
return;

Expand Down
6 changes: 3 additions & 3 deletions src/providers/wcs/qgswcsdataitemguiprovider.cpp
Expand Up @@ -49,11 +49,11 @@ void QgsWcsDataItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m

menu->addSeparator();

QAction *actionEdit = new QAction( tr( "Edit…" ), menu );
QAction *actionEdit = new QAction( tr( "Edit Connection" ), menu );
connect( actionEdit, &QAction::triggered, this, [connItem] { editConnection( connItem ); } );
menu->addAction( actionEdit );

QAction *actionDelete = new QAction( tr( "Delete" ), menu );
QAction *actionDelete = new QAction( tr( "Remove Connection" ), menu );
connect( actionDelete, &QAction::triggered, this, [connItem] { deleteConnection( connItem ); } );
menu->addAction( actionDelete );
}
Expand Down Expand Up @@ -82,7 +82,7 @@ void QgsWcsDataItemGuiProvider::editConnection( QgsDataItem *item )

void QgsWcsDataItemGuiProvider::deleteConnection( QgsDataItem *item )
{
if ( QMessageBox::question( nullptr, tr( "Delete Connection" ), tr( "Are you sure you want to delete the connection “%1”?" ).arg( item->name() ),
if ( QMessageBox::question( nullptr, tr( "Remove Connection" ), tr( "Are you sure you want to remove the connection “%1”?" ).arg( item->name() ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes )
return;

Expand Down
6 changes: 3 additions & 3 deletions src/providers/wfs/qgswfsdataitemguiprovider.cpp
Expand Up @@ -50,11 +50,11 @@ void QgsWfsDataItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m

menu->addSeparator();

QAction *actionEdit = new QAction( tr( "Edit…" ), menu );
QAction *actionEdit = new QAction( tr( "Edit Connection" ), menu );
connect( actionEdit, &QAction::triggered, this, [connItem] { editConnection( connItem ); } );
menu->addAction( actionEdit );

QAction *actionDelete = new QAction( tr( "Delete" ), menu );
QAction *actionDelete = new QAction( tr( "Remove Connection" ), menu );
connect( actionDelete, &QAction::triggered, this, [connItem] { deleteConnection( connItem ); } );
menu->addAction( actionDelete );
}
Expand Down Expand Up @@ -85,7 +85,7 @@ void QgsWfsDataItemGuiProvider::editConnection( QgsDataItem *item )

void QgsWfsDataItemGuiProvider::deleteConnection( QgsDataItem *item )
{
if ( QMessageBox::question( nullptr, tr( "Delete Connection" ), tr( "Are you sure you want to delete the connection “%1”?" ).arg( item->name() ),
if ( QMessageBox::question( nullptr, tr( "Remove Connection" ), tr( "Are you sure you want to remove the connection “%1”?" ).arg( item->name() ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes )
return;

Expand Down
12 changes: 6 additions & 6 deletions src/providers/wms/qgswmsdataitemguiproviders.cpp
Expand Up @@ -49,11 +49,11 @@ void QgsWmsDataItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m

menu->addSeparator();

QAction *actionEdit = new QAction( tr( "Edit…" ), menu );
QAction *actionEdit = new QAction( tr( "Edit Connection" ), menu );
connect( actionEdit, &QAction::triggered, this, [connItem] { editConnection( connItem ); } );
menu->addAction( actionEdit );

QAction *actionDelete = new QAction( tr( "Delete" ), menu );
QAction *actionDelete = new QAction( tr( "Remove Connection" ), menu );
connect( actionDelete, &QAction::triggered, this, [connItem] { deleteConnection( connItem ); } );
menu->addAction( actionDelete );
}
Expand Down Expand Up @@ -92,7 +92,7 @@ void QgsWmsDataItemGuiProvider::editConnection( QgsDataItem *item )

void QgsWmsDataItemGuiProvider::deleteConnection( QgsDataItem *item )
{
if ( QMessageBox::question( nullptr, tr( "Delete Connection" ), tr( "Are you sure you want to delete the connection “%1”?" ).arg( item->name() ),
if ( QMessageBox::question( nullptr, tr( "Remove Connection" ), tr( "Are you sure you want to remove the connection “%1”?" ).arg( item->name() ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes )
return;

Expand Down Expand Up @@ -144,11 +144,11 @@ void QgsXyzDataItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
{
if ( QgsXyzLayerItem *layerItem = qobject_cast< QgsXyzLayerItem * >( item ) )
{
QAction *actionEdit = new QAction( tr( "Edit…" ), this );
QAction *actionEdit = new QAction( tr( "Edit Connection" ), this );
connect( actionEdit, &QAction::triggered, this, [layerItem] { editConnection( layerItem ); } );
menu->addAction( actionEdit );

QAction *actionDelete = new QAction( tr( "Delete" ), this );
QAction *actionDelete = new QAction( tr( "Remove Connection" ), this );
connect( actionDelete, &QAction::triggered, this, [layerItem] { deleteConnection( layerItem ); } );
menu->addAction( actionDelete );
}
Expand Down Expand Up @@ -189,7 +189,7 @@ void QgsXyzDataItemGuiProvider::editConnection( QgsDataItem *item )

void QgsXyzDataItemGuiProvider::deleteConnection( QgsDataItem *item )
{
if ( QMessageBox::question( nullptr, tr( "Delete Connection" ), tr( "Are you sure you want to delete the connection “%1”?" ).arg( item->name() ),
if ( QMessageBox::question( nullptr, tr( "Remove Connection" ), tr( "Are you sure you want to remove the connection “%1”?" ).arg( item->name() ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes )
return;

Expand Down

0 comments on commit 7df55fb

Please sign in to comment.