Allow Custom HQ URL

This commit is contained in:
Zach H 2015-06-15 00:25:01 -04:00
parent 50b908c7c4
commit 45c2e6f646
4 changed files with 41 additions and 9 deletions

View file

@ -51,12 +51,17 @@ GeneralSettingsPage::GeneralSettingsPage()
pixmapCacheEdit.setSuffix(" MB");
picDownloadHqCheckBox.setChecked(settingsCache->getPicDownloadHq());
picDownloadCheckBox.setChecked(settingsCache->getPicDownload());
highQualityURLEdit = new QLineEdit(settingsCache->getPicUrlHq());
highQualityURLEdit->setEnabled(settingsCache->getPicDownloadHq());
connect(&clearDownloadedPicsButton, SIGNAL(clicked()), this, SLOT(clearDownloadedPicsButtonClicked()));
connect(&languageBox, SIGNAL(currentIndexChanged(int)), this, SLOT(languageBoxChanged(int)));
connect(&picDownloadCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setPicDownload(int)));
connect(&picDownloadHqCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setPicDownloadHq(int)));
connect(&pixmapCacheEdit, SIGNAL(valueChanged(int)), settingsCache, SLOT(setPixmapCacheSize(int)));
connect(&picDownloadHqCheckBox, SIGNAL(clicked(bool)), this, SLOT(setEnabledStatus(bool)));
connect(highQualityURLEdit, SIGNAL(textChanged(QString)), settingsCache, SLOT(setPicUrlHq(QString)));
QGridLayout *personalGrid = new QGridLayout;
personalGrid->addWidget(&languageLabel, 0, 0);
@ -66,6 +71,12 @@ GeneralSettingsPage::GeneralSettingsPage()
personalGrid->addWidget(&picDownloadCheckBox, 2, 0, 1, 2);
personalGrid->addWidget(&picDownloadHqCheckBox, 3, 0, 1, 2);
personalGrid->addWidget(&clearDownloadedPicsButton, 4, 0, 1, 1);
personalGrid->addWidget(&highQualityURLLabel, 5, 0, 1, 1);
personalGrid->addWidget(highQualityURLEdit, 5, 1, 1, 1);
personalGrid->addWidget(&highQualityURLLinkLabel, 6, 1, 1, 1);
highQualityURLLinkLabel.setTextInteractionFlags(Qt::LinksAccessibleByMouse);
highQualityURLLinkLabel.setOpenExternalLinks(true);
personalGroupBox = new QGroupBox;
personalGroupBox->setLayout(personalGrid);
@ -229,9 +240,16 @@ void GeneralSettingsPage::retranslateUi()
cardDatabasePathLabel.setText(tr("Card database:"));
tokenDatabasePathLabel.setText(tr("Token database:"));
pixmapCacheLabel.setText(tr("Picture cache size:"));
highQualityURLLabel.setText(tr("High Quality Source URL:"));
highQualityURLLinkLabel.setText(QString("<a href='https://github.com/Cockatrice/Cockatrice/wiki/Custom-Download-HQ-URLs'>" + tr("Linking FAQ") + "</a>"));
clearDownloadedPicsButton.setText(tr("Reset/Clear Downloaded Pictures"));
}
void GeneralSettingsPage::setEnabledStatus(bool status)
{
highQualityURLEdit->setEnabled(status);
}
AppearanceSettingsPage::AppearanceSettingsPage()
{
QIcon deleteIcon(":/resources/icon_delete.svg");
@ -511,7 +529,7 @@ DeckEditorSettingsPage::DeckEditorSettingsPage()
//priceTagsCheckBox.setChecked(settingsCache->getPriceTagFeature());
//connect(&priceTagsCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setPriceTagFeature(int)));
connect(this, SIGNAL(priceTagSourceChanged(int)), settingsCache, SLOT(setPriceTagSource(int)));
//connect(this, SIGNAL(priceTagSourceChanged(int)), settingsCache, SLOT(setPriceTagSource(int)));
QGridLayout *generalGrid = new QGridLayout;
//generalGrid->addWidget(&priceTagsCheckBox, 0, 0);