From bca9b2dee299e07495e3261e63e4b4beda638ccc Mon Sep 17 00:00:00 2001 From: gsherman Date: Fri, 13 Aug 2004 04:40:51 +0000 Subject: [PATCH] Fixed preferences bug that caused themes to disappear when setting options. git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@1855 c8812cc2-4d05-0410-92ff-de0c093fc19c --- src/qgisapp.cpp | 1 + src/qgsoptionsbase.ui | 1 + src/qgsoptionsbase.ui.h | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/qgisapp.cpp b/src/qgisapp.cpp index f492c18478f..58f65c1fec1 100644 --- a/src/qgisapp.cpp +++ b/src/qgisapp.cpp @@ -2433,6 +2433,7 @@ void QgisApp::options() optionsDialog->addTheme(dirs[i]); } } + optionsDialog->setCurrentTheme(); if(optionsDialog->exec()) { // set the theme if it changed diff --git a/src/qgsoptionsbase.ui b/src/qgsoptionsbase.ui index 4a1c88366c5..f094cd2bfb4 100644 --- a/src/qgsoptionsbase.ui +++ b/src/qgsoptionsbase.ui @@ -534,6 +534,7 @@ identifying features without zooming in very close. addTheme( QString item ) themeChanged( const QString & ) findBrowser() + setCurrentTheme() init() diff --git a/src/qgsoptionsbase.ui.h b/src/qgsoptionsbase.ui.h index cbbcd0fa012..6b87dcdf29e 100644 --- a/src/qgsoptionsbase.ui.h +++ b/src/qgsoptionsbase.ui.h @@ -8,6 +8,7 @@ *****************************************************************************/ #include #include +#include #include "qgssvgcache.h" @@ -26,7 +27,6 @@ void QgsOptionsBase::init() hideSplashFlag =true; } cbxHideSplash->setChecked(hideSplashFlag); - cmbTheme->setCurrentText(settings.readEntry("/qgis/theme")); } void QgsOptionsBase::saveOptions() { @@ -34,7 +34,12 @@ void QgsOptionsBase::saveOptions() settings.writeEntry("/qgis/browser", cmbBrowser->currentText()); settings.writeEntry("/qgis/map/identifyRadius", spinBoxIdentifyValue->value()); settings.writeEntry("/qgis/hideSplash",cbxHideSplash->isChecked()); - settings.writeEntry("/qgis/theme",cmbTheme->currentText()); + if(cmbTheme->currentText().length() == 0) + { + settings.writeEntry("/qgis/theme", "default"); + }else{ + settings.writeEntry("/qgis/theme",cmbTheme->currentText()); + } settings.writeEntry("/qgis/map/updateThreshold", spinBoxUpdateThreshold->value()); QgsSVGCache::instance().setOversampling(spbSVGOversampling->value()); settings.writeEntry("/qgis/svgoversampling", spbSVGOversampling->value()); @@ -57,6 +62,11 @@ void QgsOptionsBase::themeChanged(const QString & ) } +void QgsOptionsBase::setCurrentTheme() +{ + QSettings settings; + cmbTheme->setCurrentText(settings.readEntry("/qgis/theme","default")); +} void QgsOptionsBase::findBrowser() {