QTfrontend/ui/page/pageoptions.cpp
changeset 9048 c58a9829e1cc
parent 8924 13ac59499066
child 9080 9b42757d7e71
equal deleted inserted replaced
9047:8edc79df026d 9048:c58a9829e1cc
   585             groupMisc->layout()->addWidget(labelLanguage, 0, 0);
   585             groupMisc->layout()->addWidget(labelLanguage, 0, 0);
   586 
   586 
   587             CBLanguage = new QComboBox(groupMisc);
   587             CBLanguage = new QComboBox(groupMisc);
   588             groupMisc->layout()->addWidget(CBLanguage, 0, 1);
   588             groupMisc->layout()->addWidget(CBLanguage, 0, 1);
   589             QStringList locs = DataManager::instance().entryList("Locale", QDir::Files, QStringList("hedgewars_*.qm"));
   589             QStringList locs = DataManager::instance().entryList("Locale", QDir::Files, QStringList("hedgewars_*.qm"));
   590             CBLanguage->addItem(QComboBox::tr("(System default)"), QString(""));
   590             CBLanguage->addItem(QComboBox::tr("(System default)"), QString());
   591             for(int i = 0; i < locs.count(); i++)
   591             for(int i = 0; i < locs.count(); i++)
   592             {
   592             {
   593                 QLocale loc(locs[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1"));
   593                 QString lname = locs[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1");
   594                 CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name());
   594                 QLocale loc(lname);
       
   595                 CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", lname);
   595             }
   596             }
   596 
   597 
   597             QLabel *restartNoticeLabel = new QLabel(groupMisc);
   598             QLabel *restartNoticeLabel = new QLabel(groupMisc);
   598             restartNoticeLabel->setText(QLabel::tr("This setting will be effective at next restart."));
   599             restartNoticeLabel->setText(QLabel::tr("This setting will be effective at next restart."));
   599             groupMisc->layout()->addWidget(restartNoticeLabel, 1, 1);
   600             groupMisc->layout()->addWidget(restartNoticeLabel, 1, 1);