Skip to content
Permalink
Browse files

options: fix display of selected theme

  • Loading branch information
jef-n committed Sep 5, 2015
1 parent eea81e8 commit cb5054f9aa59c030777ea46dde5d5581230f1965
Showing with 8 additions and 8 deletions.
  1. +3 −0 src/app/main.cpp
  2. +5 −8 src/app/qgsoptions.cpp
@@ -881,7 +881,10 @@ APP_EXPORT int main( int argc, char *argv[] )
// as it looks really ugly so we use QPlastiqueStyle.
QString style = mySettings.value( "/qgis/style" ).toString();
if ( !style.isNull() )
{
QApplication::setStyle( style );
mySettings.setValue( "/qgis/style", QApplication::style()->objectName() );
}
#ifdef Q_OS_WIN
#if QT_VERSION < 0x050000
else
@@ -94,15 +94,12 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl ) :
connect( this, SIGNAL( rejected() ), this, SLOT( rejectOptions() ) );

QStringList styles = QStyleFactory::keys();
foreach ( QString style, styles )
{
cmbStyle->addItem( style );
}
cmbStyle->addItems( styles );

QStringList themes = QgsApplication::uiThemes().keys();
cmbUITheme->addItems( themes );

connect( cmbUITheme, SIGNAL( currentIndexChanged(const QString& ) ), this, SLOT( uiThemeChanged( const QString& ) ) );
connect( cmbUITheme, SIGNAL( currentIndexChanged( const QString& ) ), this, SLOT( uiThemeChanged( const QString& ) ) );

mIdentifyHighlightColorButton->setColorDialogTitle( tr( "Identify highlight color" ) );
mIdentifyHighlightColorButton->setAllowAlpha( true );
@@ -522,10 +519,10 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl ) :

mMessageTimeoutSpnBx->setValue( settings.value( "/qgis/messageTimeout", 5 ).toInt() );

QString name = QApplication::style()->objectName();
QString name = settings.value( "/qgis/style" ).toString();
cmbStyle->setCurrentIndex( cmbStyle->findText( name, Qt::MatchFixedString ) );

QString theme = QgsApplication::themeName();
QString theme = QgsApplication::themeName();
cmbUITheme->setCurrentIndex( cmbUITheme->findText( theme, Qt::MatchFixedString ) );

mNativeColorDialogsChkBx->setChecked( settings.value( "/qgis/native_color_dialogs", false ).toBool() );
@@ -970,7 +967,7 @@ void QgsOptions::saveOptions()
{
QSettings settings;

settings.setValue( "UI/UITheme", cmbUITheme->currentText());
settings.setValue( "UI/UITheme", cmbUITheme->currentText() );

// custom environment variables
settings.setValue( "qgis/customEnvVarsUse", QVariant( mCustomVariablesChkBx->isChecked() ) );

0 comments on commit cb5054f

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