Skip to content
Permalink
Browse files

[needs-docs] Remove option to capitalize layer names, and make it alw…

…ays on

Doing this removes some work from our users - giving layers
a nicely generated name by default
  • Loading branch information
nyalldawson committed Nov 14, 2017
1 parent 6f55e50 commit 6e31fccc5dc41706b9933a3bd4a11f8d49523840
Showing with 11 additions and 48 deletions.
  1. +2 −15 src/app/qgisapp.cpp
  2. +0 −10 src/app/qgsoptions.cpp
  3. +9 −23 src/ui/qgsoptionsbase.ui
@@ -9941,15 +9941,7 @@ QgsVectorLayer *QgisApp::addVectorLayer( const QString &vectorLayerPath, const Q

freezeCanvases();

// Let render() do its own cursor management
// QApplication::setOverrideCursor(Qt::WaitCursor);

QString baseName = name;
QgsSettings settings;
if ( settings.value( QStringLiteral( "qgis/capitalizeLayerName" ), QVariant( false ) ).toBool() )
{
baseName = QgsMapLayer::formatLayerName( baseName );
}
QString baseName = QgsMapLayer::formatLayerName( name );

/* Eliminate the need to instantiate the layer based on provider type.
The caller is responsible for cobbling together the needed information to
@@ -11857,12 +11849,7 @@ QgsRasterLayer *QgisApp::addRasterLayerPrivate(
freezeCanvases();
}

QString baseName = name;
QgsSettings settings;
if ( settings.value( QStringLiteral( "qgis/capitalizeLayerName" ), QVariant( false ) ).toBool() )
{
baseName = QgsMapLayer::formatLayerName( baseName );
}
QString baseName = QgsMapLayer::formatLayerName( name );

QgsDebugMsg( "Creating new raster layer using " + uri
+ " with baseName of " + baseName );
@@ -746,8 +746,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
pbnMeasureColor->setContext( QStringLiteral( "gui" ) );
pbnMeasureColor->setDefaultColor( QColor( 222, 155, 67 ) );

capitalizeCheckBox->setChecked( mSettings->value( QStringLiteral( "/qgis/capitalizeLayerName" ), QVariant( false ) ).toBool() );

int projOpen = mSettings->value( QStringLiteral( "/qgis/projOpenAtLaunch" ), 0 ).toInt();
mProjectOnLaunchCmbBx->setCurrentIndex( projOpen );
mProjectOnLaunchLineEdit->setText( mSettings->value( QStringLiteral( "/qgis/projOpenAtLaunchPath" ) ).toString() );
@@ -1299,8 +1297,6 @@ void QgsOptions::saveOptions()

mSettings->setValue( QStringLiteral( "/qgis/map_update_interval" ), spinMapUpdateInterval->value() );
mSettings->setValue( QStringLiteral( "/qgis/legendDoubleClickAction" ), cmbLegendDoubleClickAction->currentIndex() );
bool legendLayersCapitalize = mSettings->value( QStringLiteral( "/qgis/capitalizeLayerName" ), false ).toBool();
mSettings->setValue( QStringLiteral( "/qgis/capitalizeLayerName" ), capitalizeCheckBox->isChecked() );

// Default simplify drawing configuration
QgsVectorSimplifyMethod::SimplifyHints simplifyHints = QgsVectorSimplifyMethod::NoSimplification;
@@ -1552,12 +1548,6 @@ void QgsOptions::saveOptions()
if ( mLoadedGdalDriverList )
saveGdalDriverList();

// refresh legend if any legend item's state is to be changed
if ( legendLayersCapitalize != capitalizeCheckBox->isChecked() )
{
// TODO[MD] QgisApp::instance()->legend()->updateLegendItemStyles();
}

// refresh symbology for any legend items, only if needed
if ( showLegendClassifiers != cbxLegendClassifiers->isChecked()
|| createRasterLegendIcons != cbxCreateRasterLegendIcons->isChecked() )
@@ -2991,34 +2991,14 @@
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_3">
<item row="3" column="1" colspan="2">
<widget class="QCheckBox" name="cbxCreateRasterLegendIcons">
<property name="text">
<string>Create raster icons (may be slow)</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<layout class="QGridLayout" name="gridLayout_3" columnminimumwidth="0,1,0">
<item row="1" column="1" colspan="2">
<widget class="QCheckBox" name="cbxLegendClassifiers">
<property name="text">
<string>Display classification attribute names</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="capitalizeCheckBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Capitalize layer names</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label_53">
<property name="sizePolicy">
@@ -3048,6 +3028,13 @@
</property>
</spacer>
</item>
<item row="2" column="1" colspan="2">
<widget class="QCheckBox" name="cbxCreateRasterLegendIcons">
<property name="text">
<string>Create raster icons (may be slow)</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
@@ -5538,7 +5525,6 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<tabstop>pbnCanvasColor</tabstop>
<tabstop>mLegendGrpBx</tabstop>
<tabstop>cmbLegendDoubleClickAction</tabstop>
<tabstop>capitalizeCheckBox</tabstop>
<tabstop>cbxLegendClassifiers</tabstop>
<tabstop>cbxCreateRasterLegendIcons</tabstop>
<tabstop>mLegendGraphicResolutionSpinBox</tabstop>

0 comments on commit 6e31fcc

Please sign in to comment.
You can’t perform that action at this time.