mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
merge
This commit is contained in:
commit
eced4e2340
20 changed files with 5273 additions and 1121 deletions
|
|
@ -26,6 +26,8 @@ GeneralSettingsPage::GeneralSettingsPage()
|
|||
{
|
||||
languageLabel = new QLabel;
|
||||
languageBox = new QComboBox;
|
||||
customTranslationButton = new QPushButton("...");
|
||||
customTranslationButton->setMaximumWidth(50);
|
||||
|
||||
QString setLanguage = settingsCache->getLang();
|
||||
QStringList qmFiles = findQmFiles();
|
||||
|
|
@ -40,12 +42,14 @@ GeneralSettingsPage::GeneralSettingsPage()
|
|||
picDownloadCheckBox->setChecked(settingsCache->getPicDownload());
|
||||
|
||||
connect(languageBox, SIGNAL(currentIndexChanged(int)), this, SLOT(languageBoxChanged(int)));
|
||||
connect(customTranslationButton, SIGNAL(clicked()), this, SLOT(customTranslationButtonClicked()));
|
||||
connect(picDownloadCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setPicDownload(int)));
|
||||
|
||||
QGridLayout *personalGrid = new QGridLayout;
|
||||
personalGrid->addWidget(languageLabel, 0, 0);
|
||||
personalGrid->addWidget(languageBox, 0, 1);
|
||||
personalGrid->addWidget(picDownloadCheckBox, 1, 0, 1, 2);
|
||||
personalGrid->addWidget(customTranslationButton, 0, 2);
|
||||
personalGrid->addWidget(picDownloadCheckBox, 1, 0, 1, 3);
|
||||
|
||||
personalGroupBox = new QGroupBox;
|
||||
personalGroupBox->setLayout(personalGrid);
|
||||
|
|
@ -155,9 +159,19 @@ void GeneralSettingsPage::cardDatabasePathButtonClicked()
|
|||
|
||||
void GeneralSettingsPage::languageBoxChanged(int index)
|
||||
{
|
||||
settingsCache->setCustomTranslationFile(QString());
|
||||
settingsCache->setLang(languageBox->itemData(index).toString());
|
||||
}
|
||||
|
||||
void GeneralSettingsPage::customTranslationButtonClicked()
|
||||
{
|
||||
QString path = QFileDialog::getOpenFileName(this, tr("Choose path"));
|
||||
if (path.isEmpty())
|
||||
return;
|
||||
|
||||
settingsCache->setCustomTranslationFile(path);
|
||||
}
|
||||
|
||||
void GeneralSettingsPage::retranslateUi()
|
||||
{
|
||||
personalGroupBox->setTitle(tr("Personal settings"));
|
||||
|
|
@ -575,6 +589,7 @@ DlgSettings::DlgSettings(QWidget *parent)
|
|||
: QDialog(parent)
|
||||
{
|
||||
connect(settingsCache, SIGNAL(langChanged()), this, SLOT(updateLanguage()));
|
||||
connect(settingsCache, SIGNAL(customTranslationFileChanged()), this, SLOT(updateLanguage()));
|
||||
|
||||
contentsWidget = new QListWidget;
|
||||
contentsWidget->setViewMode(QListView::IconMode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue