Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
options: fix display of selected theme
  • Loading branch information
jef-n committed Sep 5, 2015
1 parent eea81e8 commit cb5054f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/app/main.cpp
Expand Up @@ -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
Expand Down
13 changes: 5 additions & 8 deletions src/app/qgsoptions.cpp
Expand Up @@ -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 );
Expand Down Expand Up @@ -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() );
Expand Down Expand Up @@ -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() ) );
Expand Down

0 comments on commit cb5054f

Please sign in to comment.