alphabetical order console language

This commit is contained in:
DanielSvoboda 2024-08-18 17:24:41 -03:00 committed by GitHub
parent c9a502b31a
commit c58ad6d3b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 40 additions and 32 deletions

View File

@ -1,41 +1,43 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <QCompleter>
#include "settings_dialog.h" #include "settings_dialog.h"
#include "ui_settings_dialog.h" #include "ui_settings_dialog.h"
const QVector<int> languageIndexes = { QStringList languageNames = {"Arabic",
21, // Arabic "Czech",
23, // Czech "Danish",
14, // Danish "Dutch",
6, // Dutch "English (United Kingdom)",
18, // English (United Kingdom) "English (United States)",
1, // English (United States) "Finnish",
12, // Finnish "French (Canada)",
22, // French (Canada) "French (France)",
2, // French (France) "German",
4, // German "Greek",
25, // Greek "Hungarian",
24, // Hungarian "Indonesian",
29, // Indonesian "Italian",
5, // Italian "Japanese",
0, // Japanese "Korean",
9, // Korean "Norwegian",
15, // Norwegian "Polish",
16, // Polish "Portuguese (Brazil)",
17, // Portuguese (Brazil) "Portuguese (Portugal)",
7, // Portuguese (Portugal) "Romanian",
26, // Romanian "Russian",
8, // Russian "Simplified Chinese",
11, // Simplified Chinese "Spanish (Latin America)",
20, // Spanish (Latin America) "Spanish (Spain)",
3, // Spanish (Spain) "Swedish",
13, // Swedish "Thai",
27, // Thai "Traditional Chinese",
10, // Traditional Chinese "Turkish",
19, // Turkish "Vietnamese"};
28, // Vietnamese
}; const QVector<int> languageIndexes = {21, 23, 14, 6, 18, 1, 12, 22, 2, 4, 25, 24, 29, 5, 0,
9, 15, 16, 17, 7, 26, 8, 11, 20, 3, 13, 27, 10, 19, 28};
SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidget* parent) SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidget* parent)
: QDialog(parent), ui(new Ui::SettingsDialog) { : QDialog(parent), ui(new Ui::SettingsDialog) {
@ -51,6 +53,12 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidge
ui->graphicsAdapterBox->addItem(device); ui->graphicsAdapterBox->addItem(device);
} }
ui->consoleLanguageComboBox->addItems(languageNames);
QCompleter* completer = new QCompleter(languageNames, this);
completer->setCaseSensitivity(Qt::CaseInsensitive);
ui->consoleLanguageComboBox->setCompleter(completer);
LoadValuesFromConfig(); LoadValuesFromConfig();
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close); connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close);