mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Merge pull request #47087 from landryb/fix/28858
Update wms layer title each time a new layer is selected
This commit is contained in:
commit
99dd9699fc
@ -986,32 +986,27 @@ void QgsWMSSourceSelect::updateButtons()
|
||||
}
|
||||
}
|
||||
|
||||
if ( leLayerName->text().isEmpty() || leLayerName->text() == mLastLayerName )
|
||||
if ( addButton()->isEnabled() )
|
||||
{
|
||||
if ( addButton()->isEnabled() )
|
||||
if ( !lstTilesets->selectedItems().isEmpty() )
|
||||
{
|
||||
if ( !lstTilesets->selectedItems().isEmpty() )
|
||||
{
|
||||
QTableWidgetItem *item = lstTilesets->selectedItems().first();
|
||||
mLastLayerName = item->data( Qt::UserRole + 5 ).toString();
|
||||
if ( mLastLayerName.isEmpty() )
|
||||
mLastLayerName = item->data( Qt::UserRole + 0 ).toString();
|
||||
leLayerName->setText( mLastLayerName );
|
||||
}
|
||||
else
|
||||
{
|
||||
QStringList layers, styles, titles;
|
||||
collectSelectedLayers( layers, styles, titles );
|
||||
mLastLayerName = titles.join( QLatin1Char( '/' ) );
|
||||
leLayerName->setText( mLastLayerName );
|
||||
}
|
||||
QTableWidgetItem *item = lstTilesets->selectedItems().first();
|
||||
QString tileLayerName = item->data( Qt::UserRole + 5 ).toString();
|
||||
if ( tileLayerName.isEmpty() )
|
||||
tileLayerName = item->data( Qt::UserRole + 0 ).toString();
|
||||
leLayerName->setText( tileLayerName );
|
||||
}
|
||||
else
|
||||
{
|
||||
mLastLayerName.clear();
|
||||
leLayerName->setText( mLastLayerName );
|
||||
QStringList layers, styles, titles;
|
||||
collectSelectedLayers( layers, styles, titles );
|
||||
leLayerName->setText( titles.join( QLatin1Char( '/' ) ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
leLayerName->setText( "" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -160,9 +160,6 @@ class QgsWMSSourceSelect : public QgsAbstractDataSourceWidget, private Ui::QgsWM
|
||||
//! URI for selected connection
|
||||
QgsDataSourceUri mUri;
|
||||
|
||||
//! layer name derived from latest layer selection (updated as long it's not edited manually)
|
||||
QString mLastLayerName;
|
||||
|
||||
//! The widget that controls the image format radio buttons
|
||||
QButtonGroup *mImageFormatGroup = nullptr;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user