Skip to content

Commit

Permalink
Fix showing warning for restart after language change
Browse files Browse the repository at this point in the history
Fixes #518
  • Loading branch information
hluk committed Jun 19, 2016
1 parent 551d2e7 commit b92b5a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gui/configurationmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,12 @@ void ConfigurationManager::apply()
// Language changes after restart.
const int newLocaleIndex = ui->comboBoxLanguage->currentIndex();
const QString newLocaleName = ui->comboBoxLanguage->itemData(newLocaleIndex).toString();
settings.setValue("Options/language", newLocaleName);
const QString oldLocaleName = settings.value("Options/language").toString();
const QLocale oldLocale;
if (QLocale(newLocaleName).name() != oldLocale.name()) {

settings.setValue("Options/language", newLocaleName);

if (QLocale(newLocaleName).name() != oldLocale.name() && newLocaleName != oldLocaleName) {
QMessageBox::information( this, tr("Restart Required"),
tr("Language will be changed after application is restarted.") );
}
Expand Down

0 comments on commit b92b5a6

Please sign in to comment.