Skip to content

Commit

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

Adjusted text in qgsoptions to be hopefully more easy to read



git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5067 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Mar 19, 2006
1 parent 96b3697 commit be8446b
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
Expand Up @@ -347,7 +347,7 @@ void QgisApp::readSettings()
// 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
// 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
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 );
// set the visibility based on user preference for newly added
// layers
layer->setVisible(mAddedLayersHidden);
layer->setVisible(mAddedLayersVisible);

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

// give it a random color
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());
setupToolbarPopups(optionsDialog->theme());
// set the visible flag for new layers
mAddedLayersHidden = optionsDialog->newVisible();
mAddedLayersVisible = optionsDialog->newVisible();
QSettings mySettings;
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);

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

addRasterLayer(layer);
layer->refreshLegend();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgisapp.h
Expand Up @@ -543,7 +543,7 @@ public slots:
QgsHelpViewer *mHelpViewer;
//! Flag to indicate that newly added layers are not shown on
// the map
bool mAddedLayersHidden;
bool mAddedLayersVisible;
//! menu map (key is name, value is menu id)
std::map<QString, int>mMenuMapByName;
//! menu map (key is menu id, value is name)
Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsoptions.cpp
Expand Up @@ -95,7 +95,7 @@ QgsOptions::QgsOptions(QWidget *parent, Qt::WFlags fl) :
cmbTheme->setCurrentText(settings.readEntry("/Themes","default"));
//set teh state of the checkboxes
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());
//set the colour for selections
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("/Map/identifyRadius", spinBoxIdentifyValue->value());
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());
if(cmbTheme->currentText().length() == 0)
{
Expand Down Expand Up @@ -247,7 +247,7 @@ void QgsOptions::on_pbnSelectProjection_clicked()

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

void QgsOptions::getEllipsoidList()
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsoptionsbase.ui
Expand Up @@ -259,7 +259,7 @@
<item row="0" column="0" >
<widget class="QCheckBox" name="chkAddedVisibility" >
<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>
</widget>
</item>
Expand Down

0 comments on commit be8446b

Please sign in to comment.