Skip to content

Commit

Permalink
Remove "Display As" control from layer properties dialogs
Browse files Browse the repository at this point in the history
This is a weird legacy control, which is read only and which just
shows a copy of the layer name with _ replaced by space. It has
no impact on anything else!
  • Loading branch information
nyalldawson committed Aug 11, 2021
1 parent e9aaee6 commit 3076c39
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 129 deletions.
7 changes: 0 additions & 7 deletions src/app/pointcloud/qgspointcloudlayerproperties.cpp
Expand Up @@ -48,7 +48,6 @@ QgsPointCloudLayerProperties::QgsPointCloudLayerProperties( QgsPointCloudLayer *
connect( buttonBox->button( QDialogButtonBox::Apply ), &QAbstractButton::clicked, this, &QgsPointCloudLayerProperties::apply );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsPointCloudLayerProperties::showHelp );

connect( mLayerOrigNameLineEdit, &QLineEdit::textEdited, this, &QgsPointCloudLayerProperties::originalNameEdited );
connect( mCrsSelector, &QgsProjectionSelectionWidget::crsChanged, this, &QgsPointCloudLayerProperties::crsChanged );

// QgsOptionsDialogBase handles saving/restoring of geometry, splitter and current tab states,
Expand Down Expand Up @@ -172,7 +171,6 @@ void QgsPointCloudLayerProperties::syncToLayer()
{
// populate the general information
mLayerOrigNameLineEdit->setText( mLayer->name() );
txtDisplayName->setText( mLayer->name() );

/*
* Information Tab
Expand Down Expand Up @@ -415,11 +413,6 @@ void QgsPointCloudLayerProperties::urlClicked( const QUrl &url )
QDesktopServices::openUrl( url );
}

void QgsPointCloudLayerProperties::originalNameEdited( const QString &text )
{
txtDisplayName->setText( mLayer->formatLayerName( text ) );
}

void QgsPointCloudLayerProperties::crsChanged( const QgsCoordinateReferenceSystem &crs )
{
QgsDatumTransformDialog::run( crs, QgsProject::instance()->crs(), this, mMapCanvas, tr( "Select transformation for the layer" ) );
Expand Down
1 change: 0 additions & 1 deletion src/app/pointcloud/qgspointcloudlayerproperties.h
Expand Up @@ -112,7 +112,6 @@ class QgsPointCloudLayerProperties : public QgsOptionsDialogBase, private Ui::Qg
void loadDefaultMetadata();
void showHelp();
void urlClicked( const QUrl &url );
void originalNameEdited( const QString &text );
void crsChanged( const QgsCoordinateReferenceSystem &crs );

protected slots:
Expand Down
7 changes: 0 additions & 7 deletions src/gui/mesh/qgsmeshlayerproperties.cpp
Expand Up @@ -69,7 +69,6 @@ QgsMeshLayerProperties::QgsMeshLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *
mTemporalProviderTimeUnitComboBox->addItem( tr( "Hours" ), QgsUnitTypes::TemporalHours );
mTemporalProviderTimeUnitComboBox->addItem( tr( "Days" ), QgsUnitTypes::TemporalDays );

connect( mLayerOrigNameLineEd, &QLineEdit::textEdited, this, &QgsMeshLayerProperties::updateLayerName );
connect( mCrsSelector, &QgsProjectionSelectionWidget::crsChanged, this, &QgsMeshLayerProperties::changeCrs );
connect( mDatasetGroupTreeWidget, &QgsMeshDatasetGroupTreeWidget::datasetGroupAdded, this, &QgsMeshLayerProperties::syncToLayer );

Expand Down Expand Up @@ -207,7 +206,6 @@ void QgsMeshLayerProperties::syncToLayer()
* Source Tab
*/
mLayerOrigNameLineEd->setText( mMeshLayer->name() );
leDisplayName->setText( mMeshLayer->name() );
whileBlocking( mCrsSelector )->setCrs( mMeshLayer->crs() );

if ( mMeshLayer )
Expand Down Expand Up @@ -420,11 +418,6 @@ void QgsMeshLayerProperties::changeCrs( const QgsCoordinateReferenceSystem &crs
mMeshLayer->setCrs( crs );
}

void QgsMeshLayerProperties::updateLayerName( const QString &text )
{
leDisplayName->setText( mMeshLayer->formatLayerName( text ) );
}

void QgsMeshLayerProperties::syncAndRepaint()
{
syncToLayer();
Expand Down
2 changes: 0 additions & 2 deletions src/gui/mesh/qgsmeshlayerproperties.h
Expand Up @@ -68,8 +68,6 @@ class GUI_EXPORT QgsMeshLayerProperties : public QgsOptionsDialogBase, private U

//!Applies the settings made in the dialog without closing the box
void apply();
//! \brief Slot to update layer display name as original is edited.
void updateLayerName( const QString &text );
//! Synchronizes GUI state with associated mesh layer and trigger repaint
void syncAndRepaint();
//! Changes layer coordinate reference system
Expand Down
8 changes: 0 additions & 8 deletions src/gui/raster/qgsrasterlayerproperties.cpp
Expand Up @@ -112,7 +112,6 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanv
mMetadataViewer = new QgsWebView( this );
mOptsPage_Information->layout()->addWidget( mMetadataViewer );

connect( mLayerOrigNameLineEd, &QLineEdit::textEdited, this, &QgsRasterLayerProperties::mLayerOrigNameLineEd_textEdited );
connect( buttonBuildPyramids, &QPushButton::clicked, this, &QgsRasterLayerProperties::buttonBuildPyramids_clicked );
connect( pbnAddValuesFromDisplay, &QToolButton::clicked, this, &QgsRasterLayerProperties::pbnAddValuesFromDisplay_clicked );
connect( pbnAddValuesManually, &QToolButton::clicked, this, &QgsRasterLayerProperties::pbnAddValuesManually_clicked );
Expand Down Expand Up @@ -857,9 +856,7 @@ void QgsRasterLayerProperties::sync()
* General Tab
*/

//these properties (layer name and label) are provided by the qgsmaplayer superclass
mLayerOrigNameLineEd->setText( mRasterLayer->name() );
leDisplayName->setText( mRasterLayer->name() );

QgsDebugMsgLevel( QStringLiteral( "populate metadata tab" ), 2 );
/*
Expand Down Expand Up @@ -1157,11 +1154,6 @@ void QgsRasterLayerProperties::apply()
QgsProject::instance()->setDirty( true );
}

void QgsRasterLayerProperties::mLayerOrigNameLineEd_textEdited( const QString &text )
{
leDisplayName->setText( mRasterLayer->formatLayerName( text ) );
}

void QgsRasterLayerProperties::buttonBuildPyramids_clicked()
{
QgsRasterDataProvider *provider = mRasterLayer->dataProvider();
Expand Down
2 changes: 0 additions & 2 deletions src/gui/raster/qgsrasterlayerproperties.h
Expand Up @@ -128,8 +128,6 @@ class GUI_EXPORT QgsRasterLayerProperties : public QgsOptionsDialogBase, private
void apply();
//! \brief Called when cancel button is pressed
void onCancel();
//! \brief Slot to update layer display name as original is edited.
void mLayerOrigNameLineEd_textEdited( const QString &text );
//! \brief this slot asks the rasterlayer to construct pyramids
void buttonBuildPyramids_clicked();
//! \brief slot executed when user presses "Add Values From Display" button on the transparency page
Expand Down
7 changes: 0 additions & 7 deletions src/gui/vector/qgsvectorlayerproperties.cpp
Expand Up @@ -107,7 +107,6 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
, mOriginalSubsetSQL( lyr->subsetString() )
{
setupUi( this );
connect( mLayerOrigNameLineEdit, &QLineEdit::textEdited, this, &QgsVectorLayerProperties::mLayerOrigNameLineEdit_textEdited );
connect( pbnQueryBuilder, &QPushButton::clicked, this, &QgsVectorLayerProperties::pbnQueryBuilder_clicked );
connect( pbnIndex, &QPushButton::clicked, this, &QgsVectorLayerProperties::pbnIndex_clicked );
connect( mCrsSelector, &QgsProjectionSelectionWidget::crsChanged, this, &QgsVectorLayerProperties::mCrsSelector_crsChanged );
Expand Down Expand Up @@ -518,7 +517,6 @@ void QgsVectorLayerProperties::syncToLayer()

// populate the general information
mLayerOrigNameLineEdit->setText( mLayer->name() );
txtDisplayName->setText( mLayer->name() );

//see if we are dealing with a pg layer here
mSubsetGroupBox->setEnabled( true );
Expand Down Expand Up @@ -938,11 +936,6 @@ QString QgsVectorLayerProperties::htmlMetadata()
return mLayer->htmlMetadata();
}

void QgsVectorLayerProperties::mLayerOrigNameLineEdit_textEdited( const QString &text )
{
txtDisplayName->setText( mLayer->formatLayerName( text ) );
}

void QgsVectorLayerProperties::mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs )
{
QgsDatumTransformDialog::run( crs, QgsProject::instance()->crs(), this, mCanvas, tr( "Select Transformation for the vector layer" ) );
Expand Down
3 changes: 0 additions & 3 deletions src/gui/vector/qgsvectorlayerproperties.h
Expand Up @@ -85,9 +85,6 @@ class GUI_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private
//! Gets metadata about the layer in nice formatted html
QString htmlMetadata();

//! Slot to update layer display name as original is edited
void mLayerOrigNameLineEdit_textEdited( const QString &text );

//! Called when apply button is pressed or dialog is accepted
void apply();

Expand Down
24 changes: 0 additions & 24 deletions src/ui/mesh/qgsmeshlayerpropertiesbase.ui
Expand Up @@ -295,29 +295,6 @@
<item>
<widget class="QLineEdit" name="mLayerOrigNameLineEd"/>
</item>
<item>
<widget class="QLabel" name="label_13">
<property name="text">
<string>displayed as</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="leDisplayName">
<property name="enabled">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">color: #505050;
background-color: #F0F0F0;
border: 1px solid #B0B0B0;
border-radius: 2px;</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down Expand Up @@ -902,7 +879,6 @@ border-radius: 2px;</string>
<tabstop>mInformationTextBrowser</tabstop>
<tabstop>scrollArea_3</tabstop>
<tabstop>mLayerOrigNameLineEd</tabstop>
<tabstop>leDisplayName</tabstop>
<tabstop>mCrsGroupBox</tabstop>
<tabstop>mCrsSelector</tabstop>
<tabstop>mTemporalStaticDatasetCheckBox</tabstop>
Expand Down
23 changes: 0 additions & 23 deletions src/ui/qgspointcloudlayerpropertiesbase.ui
Expand Up @@ -241,29 +241,6 @@
<item>
<widget class="QLineEdit" name="mLayerOrigNameLineEdit"/>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>displayed as</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="txtDisplayName">
<property name="enabled">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">color: #505050;
background-color: #F0F0F0;
border: 1px solid #B0B0B0;
border-radius: 2px;</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
Expand Down
21 changes: 0 additions & 21 deletions src/ui/qgsrasterlayerpropertiesbase.ui
Expand Up @@ -316,26 +316,6 @@
<item>
<widget class="QLineEdit" name="mLayerOrigNameLineEd"/>
</item>
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>displayed as</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="leDisplayName">
<property name="styleSheet">
<string notr="true">color: #505050;
background-color: #F0F0F0;
border: 1px solid #B0B0B0;
border-radius: 2px;</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down Expand Up @@ -2342,7 +2322,6 @@ p, li { white-space: pre-wrap; }
<tabstop>mOptionsListWidget</tabstop>
<tabstop>scrollArea_3</tabstop>
<tabstop>mLayerOrigNameLineEd</tabstop>
<tabstop>leDisplayName</tabstop>
<tabstop>mCrsGroupBox</tabstop>
<tabstop>mCrsSelector</tabstop>
<tabstop>mResetColorRenderingBtn</tabstop>
Expand Down
24 changes: 0 additions & 24 deletions src/ui/qgsvectorlayerpropertiesbase.ui
Expand Up @@ -474,29 +474,6 @@
<item>
<widget class="QLineEdit" name="mLayerOrigNameLineEdit"/>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>displayed as</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="txtDisplayName">
<property name="enabled">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">color: #505050;
background-color: #F0F0F0;
border: 1px solid #B0B0B0;
border-radius: 2px;</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down Expand Up @@ -2707,7 +2684,6 @@ border-radius: 2px;</string>
<tabstop>teMetadataViewer</tabstop>
<tabstop>scrollArea_4</tabstop>
<tabstop>mLayerOrigNameLineEdit</tabstop>
<tabstop>txtDisplayName</tabstop>
<tabstop>cboProviderEncoding</tabstop>
<tabstop>mCrsGroupBox</tabstop>
<tabstop>mCrsSelector</tabstop>
Expand Down

0 comments on commit 3076c39

Please sign in to comment.