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
This commit is contained in:
gsherman 2004-08-13 04:40:51 +00:00
parent 7e0f9bbd1c
commit bca9b2dee2
3 changed files with 14 additions and 2 deletions

View File

@ -2433,6 +2433,7 @@ void QgisApp::options()
optionsDialog->addTheme(dirs[i]);
}
}
optionsDialog->setCurrentTheme();
if(optionsDialog->exec())
{
// set the theme if it changed

View File

@ -534,6 +534,7 @@ identifying features without zooming in very close.
<slot>addTheme( QString item )</slot>
<slot>themeChanged( const QString &amp; )</slot>
<slot>findBrowser()</slot>
<slot>setCurrentTheme()</slot>
</slots>
<functions>
<function access="private" specifier="non virtual">init()</function>

View File

@ -8,6 +8,7 @@
*****************************************************************************/
#include <qsettings.h>
#include <qfiledialog.h>
#include <qcombobox.h>
#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()
{