Skip to content

Commit

Permalink
Fix issue where in first time useage of QGIS 0.8 newly added layers a…
Browse files Browse the repository at this point in the history
…re hidden by default.

Adjusted text in qgsoptions to be hopefully more easy to read



git-svn-id: http://svn.osgeo.org/qgis/trunk@5067 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Mar 19, 2006
1 parent 07d23be commit 67ab7f3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/gui/qgisapp.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ void QgisApp::readSettings()
// layers when they are added to the map. This is useful when adding // layers when they are added to the map. This is useful when adding
// many layers and the user wants to adjusty symbology, etc prior to // many layers and the user wants to adjusty symbology, etc prior to
// actually viewing the layer. // actually viewing the layer.
mAddedLayersHidden = settings.readBoolEntry("/qgis/new_layers_visible", true); mAddedLayersVisible = settings.readBoolEntry("/qgis/new_layers_visible", 1);


// Add the recently accessed project file paths to the File menu // Add the recently accessed project file paths to the File menu
mRecentProjectPaths = settings.readListEntry("/UI/recentProjectsList"); mRecentProjectPaths = settings.readListEntry("/UI/recentProjectsList");
Expand Down Expand Up @@ -1821,7 +1821,7 @@ bool QgisApp::addLayer(QStringList const &theLayerQStringList, const QString& en
Q_CHECK_PTR( layer ); Q_CHECK_PTR( layer );
// set the visibility based on user preference for newly added // set the visibility based on user preference for newly added
// layers // layers
layer->setVisible(mAddedLayersHidden); layer->setVisible(mAddedLayersVisible);


if ( ! layer ) if ( ! layer )
{ {
Expand Down Expand Up @@ -1967,7 +1967,7 @@ void QgisApp::addDatabaseLayer()
if (layer->isValid()) if (layer->isValid())
{ {
// set initial visibility based on user preference // set initial visibility based on user preference
layer->setVisible(mAddedLayersHidden); layer->setVisible(mAddedLayersVisible);


// give it a random color // give it a random color
QgsSingleSymbolRenderer *renderer = new QgsSingleSymbolRenderer(layer->vectorType()); // add single symbol renderer as default QgsSingleSymbolRenderer *renderer = new QgsSingleSymbolRenderer(layer->vectorType()); // add single symbol renderer as default
Expand Down Expand Up @@ -4323,7 +4323,7 @@ void QgisApp::options()
setTheme(optionsDialog->theme()); setTheme(optionsDialog->theme());
setupToolbarPopups(optionsDialog->theme()); setupToolbarPopups(optionsDialog->theme());
// set the visible flag for new layers // set the visible flag for new layers
mAddedLayersHidden = optionsDialog->newVisible(); mAddedLayersVisible = optionsDialog->newVisible();
QSettings mySettings; QSettings mySettings;
mMapCanvas->enableAntiAliasing(mySettings.value("/qgis/enable_anti_aliasing").toBool()); mMapCanvas->enableAntiAliasing(mySettings.value("/qgis/enable_anti_aliasing").toBool());
} }
Expand Down Expand Up @@ -5286,7 +5286,7 @@ bool QgisApp::addRasterLayer(QStringList const &theFileNameQStringList, bool gui
QgsRasterLayer *layer = new QgsRasterLayer(*myIterator, myBaseNameQString); QgsRasterLayer *layer = new QgsRasterLayer(*myIterator, myBaseNameQString);


// set initial visibility based on user preference // set initial visibility based on user preference
layer->setVisible(mAddedLayersHidden); layer->setVisible(mAddedLayersVisible);


addRasterLayer(layer); addRasterLayer(layer);
layer->refreshLegend(); layer->refreshLegend();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgisapp.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ public slots:
QgsHelpViewer *mHelpViewer; QgsHelpViewer *mHelpViewer;
//! Flag to indicate that newly added layers are not shown on //! Flag to indicate that newly added layers are not shown on
// the map // the map
bool mAddedLayersHidden; bool mAddedLayersVisible;
//! menu map (key is name, value is menu id) //! menu map (key is name, value is menu id)
std::map<QString, int>mMenuMapByName; std::map<QString, int>mMenuMapByName;
//! menu map (key is menu id, value is name) //! menu map (key is menu id, value is name)
Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsoptions.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ QgsOptions::QgsOptions(QWidget *parent, Qt::WFlags fl) :
cmbTheme->setCurrentText(settings.readEntry("/Themes","default")); cmbTheme->setCurrentText(settings.readEntry("/Themes","default"));
//set teh state of the checkboxes //set teh state of the checkboxes
chkAntiAliasing->setChecked(settings.value("/qgis/enable_anti_aliasing",false).toBool()); chkAntiAliasing->setChecked(settings.value("/qgis/enable_anti_aliasing",false).toBool());
chkAddedVisibility->setChecked(!settings.value("/qgis/new_layers_visible",false).toBool()); chkAddedVisibility->setChecked(settings.value("/qgis/new_layers_visible",true).toBool());
cbxHideSplash->setChecked(settings.value("/qgis/hideSplash",false).toBool()); cbxHideSplash->setChecked(settings.value("/qgis/hideSplash",false).toBool());
//set the colour for selections //set the colour for selections
int myRed = settings.value("/qgis/default_selection_color_red",255).toInt(); int myRed = settings.value("/qgis/default_selection_color_red",255).toInt();
Expand Down Expand Up @@ -147,7 +147,7 @@ void QgsOptions::saveOptions()
settings.writeEntry("/qgis/browser", cmbBrowser->currentText()); settings.writeEntry("/qgis/browser", cmbBrowser->currentText());
settings.writeEntry("/Map/identifyRadius", spinBoxIdentifyValue->value()); settings.writeEntry("/Map/identifyRadius", spinBoxIdentifyValue->value());
settings.writeEntry("/qgis/hideSplash",cbxHideSplash->isChecked()); settings.writeEntry("/qgis/hideSplash",cbxHideSplash->isChecked());
settings.writeEntry("/qgis/new_layers_visible",!chkAddedVisibility->isChecked()); settings.writeEntry("/qgis/new_layers_visible",chkAddedVisibility->isChecked());
settings.writeEntry("/qgis/enable_anti_aliasing",chkAntiAliasing->isChecked()); settings.writeEntry("/qgis/enable_anti_aliasing",chkAntiAliasing->isChecked());
if(cmbTheme->currentText().length() == 0) if(cmbTheme->currentText().length() == 0)
{ {
Expand Down Expand Up @@ -247,7 +247,7 @@ void QgsOptions::on_pbnSelectProjection_clicked()


bool QgsOptions::newVisible() bool QgsOptions::newVisible()
{ {
return !chkAddedVisibility->isChecked(); return chkAddedVisibility->isChecked();
} }


void QgsOptions::getEllipsoidList() void QgsOptions::getEllipsoidList()
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsoptionsbase.ui
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QCheckBox" name="chkAddedVisibility" > <widget class="QCheckBox" name="chkAddedVisibility" >
<property name="text" > <property name="text" >
<string>New la&amp;yers added to the map are not displayed</string> <string>By default new la&amp;yers added to the map should be displayed</string>
</property> </property>
</widget> </widget>
</item> </item>
Expand Down

0 comments on commit 67ab7f3

Please sign in to comment.