mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-25 08:03:54 -07:00
Adjust settings dialog.
Took 5 minutes Took 59 seconds Took 22 seconds Took 6 seconds
This commit is contained in:
parent
c8c7dcba5f
commit
c4627bda32
2 changed files with 15 additions and 6 deletions
|
|
@ -1236,6 +1236,8 @@ StorageSettingsPage::StorageSettingsPage()
|
||||||
connect(&clearDownloadedPicsButton, &QPushButton::clicked, this,
|
connect(&clearDownloadedPicsButton, &QPushButton::clicked, this,
|
||||||
&StorageSettingsPage::clearDownloadedPicsButtonClicked);
|
&StorageSettingsPage::clearDownloadedPicsButtonClicked);
|
||||||
|
|
||||||
|
connect(&clearPixmapCacheButton, &QPushButton::clicked, this, &StorageSettingsPage::clearPixmapCacheButtonClicked);
|
||||||
|
|
||||||
// pixmap cache
|
// pixmap cache
|
||||||
pixmapCacheEdit.setMinimum(PIXMAPCACHE_SIZE_MIN);
|
pixmapCacheEdit.setMinimum(PIXMAPCACHE_SIZE_MIN);
|
||||||
// 2047 is the max value to avoid overflowing of QPixmapCache::setCacheLimit(int size)
|
// 2047 is the max value to avoid overflowing of QPixmapCache::setCacheLimit(int size)
|
||||||
|
|
@ -1328,6 +1330,7 @@ StorageSettingsPage::StorageSettingsPage()
|
||||||
networkRedirectCacheLayout->addWidget(&networkRedirectCacheTtlEdit);
|
networkRedirectCacheLayout->addWidget(&networkRedirectCacheTtlEdit);
|
||||||
|
|
||||||
auto pixmapCacheLayout = new QHBoxLayout;
|
auto pixmapCacheLayout = new QHBoxLayout;
|
||||||
|
pixmapCacheLayout->addWidget(&clearPixmapCacheButton);
|
||||||
pixmapCacheLayout->addStretch();
|
pixmapCacheLayout->addStretch();
|
||||||
pixmapCacheLayout->addWidget(&pixmapCacheLabel);
|
pixmapCacheLayout->addWidget(&pixmapCacheLabel);
|
||||||
pixmapCacheLayout->addWidget(&pixmapCacheEdit);
|
pixmapCacheLayout->addWidget(&pixmapCacheEdit);
|
||||||
|
|
@ -1338,10 +1341,9 @@ StorageSettingsPage::StorageSettingsPage()
|
||||||
|
|
||||||
// Image Backup Layout
|
// Image Backup Layout
|
||||||
lpImageBackupGrid->addWidget(&imageBackupExplainerLabel, 0, 0, 1, 2);
|
lpImageBackupGrid->addWidget(&imageBackupExplainerLabel, 0, 0, 1, 2);
|
||||||
lpImageBackupGrid->addWidget(&saveCardImagesToLocalStorageCheckBox, 1, 0);
|
lpImageBackupGrid->addWidget(&localCardImageStorageNamingSchemeLabel, 1, 0);
|
||||||
lpImageBackupGrid->addWidget(&localCardImageStorageNamingSchemeLabel, 2, 0);
|
lpImageBackupGrid->addWidget(localCardImageStorageNamingSchemeComboBox, 1, 1);
|
||||||
lpImageBackupGrid->addWidget(localCardImageStorageNamingSchemeComboBox, 2, 1);
|
lpImageBackupGrid->addWidget(&clearBackupsButton, 2, 1);
|
||||||
lpImageBackupGrid->addWidget(&clearBackupsButton, 3, 1);
|
|
||||||
|
|
||||||
lpPixmapCacheGrid->addWidget(&pixmapCacheExplainerLabel, 0, 0);
|
lpPixmapCacheGrid->addWidget(&pixmapCacheExplainerLabel, 0, 0);
|
||||||
lpPixmapCacheGrid->addLayout(pixmapCacheLayout, 1, 1);
|
lpPixmapCacheGrid->addLayout(pixmapCacheLayout, 1, 1);
|
||||||
|
|
@ -1407,6 +1409,12 @@ void StorageSettingsPage::clearImageBackupsButtonClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StorageSettingsPage::clearPixmapCacheButtonClicked()
|
||||||
|
{
|
||||||
|
CardPictureLoader::clearPixmapCache();
|
||||||
|
QMessageBox::information(this, tr("Success"), tr("In-memory (currently loaded) card pictures have been reset."));
|
||||||
|
}
|
||||||
|
|
||||||
void StorageSettingsPage::retranslateUi()
|
void StorageSettingsPage::retranslateUi()
|
||||||
{
|
{
|
||||||
cardPictureLoaderCacheMethodLabel.setText(tr("Card Picture Loader Caching Method:"));
|
cardPictureLoaderCacheMethodLabel.setText(tr("Card Picture Loader Caching Method:"));
|
||||||
|
|
@ -1432,6 +1440,7 @@ void StorageSettingsPage::retranslateUi()
|
||||||
|
|
||||||
clearDownloadedPicsButton.setText(tr("Delete Cached Images"));
|
clearDownloadedPicsButton.setText(tr("Delete Cached Images"));
|
||||||
clearBackupsButton.setText(tr("Delete Saved Images"));
|
clearBackupsButton.setText(tr("Delete Saved Images"));
|
||||||
|
clearPixmapCacheButton.setText(tr("Clear In-Memory Images"));
|
||||||
|
|
||||||
mpCacheMethodGroupBox->setTitle(tr("Card Picture Loader Cache Method"));
|
mpCacheMethodGroupBox->setTitle(tr("Card Picture Loader Cache Method"));
|
||||||
mpNetworkCacheGroupBox->setTitle(tr("Network Cache"));
|
mpNetworkCacheGroupBox->setTitle(tr("Network Cache"));
|
||||||
|
|
@ -1444,7 +1453,6 @@ void StorageSettingsPage::retranslateUi()
|
||||||
networkRedirectCacheTtlEdit.setToolTip(tr("How long cached redirects for urls are valid for."));
|
networkRedirectCacheTtlEdit.setToolTip(tr("How long cached redirects for urls are valid for."));
|
||||||
pixmapCacheLabel.setText(tr("Picture Cache Size:"));
|
pixmapCacheLabel.setText(tr("Picture Cache Size:"));
|
||||||
pixmapCacheEdit.setToolTip(tr("In-memory cache for pictures not currently on screen"));
|
pixmapCacheEdit.setToolTip(tr("In-memory cache for pictures not currently on screen"));
|
||||||
saveCardImagesToLocalStorageCheckBox.setText(tr("Back up downloaded images to local storage"));
|
|
||||||
localCardImageStorageNamingSchemeLabel.setText(tr("Naming scheme:"));
|
localCardImageStorageNamingSchemeLabel.setText(tr("Naming scheme:"));
|
||||||
|
|
||||||
networkRedirectCacheTtlEdit.setSuffix(" " + tr("Day(s)"));
|
networkRedirectCacheTtlEdit.setSuffix(" " + tr("Day(s)"));
|
||||||
|
|
|
||||||
|
|
@ -244,10 +244,12 @@ public:
|
||||||
private slots:
|
private slots:
|
||||||
void clearDownloadedPicsButtonClicked();
|
void clearDownloadedPicsButtonClicked();
|
||||||
void clearImageBackupsButtonClicked();
|
void clearImageBackupsButtonClicked();
|
||||||
|
void clearPixmapCacheButtonClicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPushButton clearDownloadedPicsButton;
|
QPushButton clearDownloadedPicsButton;
|
||||||
QPushButton clearBackupsButton;
|
QPushButton clearBackupsButton;
|
||||||
|
QPushButton clearPixmapCacheButton;
|
||||||
|
|
||||||
QGroupBox *mpCacheMethodGroupBox;
|
QGroupBox *mpCacheMethodGroupBox;
|
||||||
QGroupBox *mpNetworkCacheGroupBox;
|
QGroupBox *mpNetworkCacheGroupBox;
|
||||||
|
|
@ -266,7 +268,6 @@ private:
|
||||||
QSpinBox networkRedirectCacheTtlEdit;
|
QSpinBox networkRedirectCacheTtlEdit;
|
||||||
QSpinBox pixmapCacheEdit;
|
QSpinBox pixmapCacheEdit;
|
||||||
QLabel pixmapCacheLabel;
|
QLabel pixmapCacheLabel;
|
||||||
QCheckBox saveCardImagesToLocalStorageCheckBox;
|
|
||||||
QLabel localCardImageStorageNamingSchemeLabel;
|
QLabel localCardImageStorageNamingSchemeLabel;
|
||||||
QComboBox *localCardImageStorageNamingSchemeComboBox;
|
QComboBox *localCardImageStorageNamingSchemeComboBox;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue