mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Language chooser improvements
Show language instead of country, sort the list. Show country in brackets to avoid ambiguity for locales like de_DE and de_CH. Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4c3f51291e
commit
482214703b
2 changed files with 2 additions and 1 deletions
|
@ -1772,7 +1772,7 @@ QVariant LanguageModel::data(const QModelIndex& index, int role) const
|
|||
switch(role){
|
||||
case Qt::DisplayRole:{
|
||||
QLocale l( currentString.remove("subsurface_"));
|
||||
return currentString == "English" ? currentString : l.countryToString(l.country());
|
||||
return currentString == "English" ? currentString : QString("%1 (%2)").arg(l.languageToString(l.language())).arg(l.countryToString(l.country()));
|
||||
}break;
|
||||
case Qt::UserRole:{
|
||||
QString currentString = languages.at(index.row());
|
||||
|
|
|
@ -110,6 +110,7 @@ void PreferencesDialog::setUiFromPrefs()
|
|||
filterModel->setSourceModel(LanguageModel::instance());
|
||||
filterModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||
ui.languageView->setModel(filterModel);
|
||||
filterModel->sort(0);
|
||||
connect(ui.languageFilter, SIGNAL(textChanged(QString)), filterModel, SLOT(setFilterFixedString(QString)));
|
||||
|
||||
QSettings s;
|
||||
|
|
Loading…
Add table
Reference in a new issue