mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-15 23:12:14 -07:00
fix: Always prefer local cards if available (#5762)
* Try to better reproduce pre-provider ID behavior If "override all card art with personal preference" setting is set, look for custom art for all sets instead of just the most preferred set. * Warning when using both custom art and the printing selector * QDirIterator::nextFileInfo is Qt 6.3+ * Translation
This commit is contained in:
parent
91ee6097d2
commit
1ada5ea424
9 changed files with 305 additions and 205 deletions
|
|
@ -1,12 +1,15 @@
|
|||
#include "printing_selector.h"
|
||||
|
||||
#include "../../../../settings/cache_settings.h"
|
||||
#include "../../picture_loader/picture_loader.h"
|
||||
#include "printing_selector_card_display_widget.h"
|
||||
#include "printing_selector_card_search_widget.h"
|
||||
#include "printing_selector_card_selection_widget.h"
|
||||
#include "printing_selector_card_sorting_widget.h"
|
||||
|
||||
#include <QFrame>
|
||||
#include <QScrollBar>
|
||||
#include <qboxlayout.h>
|
||||
|
||||
/**
|
||||
* @brief Constructs a PrintingSelector widget to display and manage card printings.
|
||||
|
|
@ -29,6 +32,24 @@ PrintingSelector::PrintingSelector(QWidget *parent, AbstractTabDeckEditor *_deck
|
|||
layout = new QVBoxLayout(this);
|
||||
setLayout(layout);
|
||||
|
||||
if (PictureLoader::hasCustomArt()) {
|
||||
QFrame *warningFrame = new QFrame(this);
|
||||
warningFrame->setFrameShape(QFrame::StyledPanel);
|
||||
|
||||
warningLabel = new QLabel(this);
|
||||
warningLabel->setTextFormat(Qt::RichText);
|
||||
warningLabel->setWordWrap(true);
|
||||
|
||||
auto *warningLayout = new QVBoxLayout(warningFrame);
|
||||
warningFrame->setLayout(warningLayout);
|
||||
|
||||
warningLayout->addWidget(warningLabel);
|
||||
|
||||
layout->addWidget(warningFrame);
|
||||
} else {
|
||||
warningLabel = nullptr;
|
||||
}
|
||||
|
||||
widgetLoadingBufferTimer = new QTimer(this);
|
||||
|
||||
flowWidget = new FlowWidget(this, Qt::Horizontal, Qt::ScrollBarAlwaysOff, Qt::ScrollBarAsNeeded);
|
||||
|
|
@ -83,6 +104,12 @@ PrintingSelector::PrintingSelector(QWidget *parent, AbstractTabDeckEditor *_deck
|
|||
void PrintingSelector::retranslateUi()
|
||||
{
|
||||
navigationCheckBox->setText(tr("Display Navigation Buttons"));
|
||||
|
||||
if (warningLabel) {
|
||||
warningLabel->setText(
|
||||
tr("<b>Warning:</b> You appear to be using custom card art, which has known bugs when also "
|
||||
"using the printing selector in this version of Cockatrice."));
|
||||
}
|
||||
}
|
||||
|
||||
void PrintingSelector::printingsInDeckChanged()
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ private:
|
|||
QWidget *sortAndOptionsContainer;
|
||||
QHBoxLayout *sortAndOptionsLayout;
|
||||
QCheckBox *navigationCheckBox;
|
||||
QLabel *warningLabel;
|
||||
PrintingSelectorCardSortingWidget *sortToolBar;
|
||||
PrintingSelectorCardSearchWidget *searchBar;
|
||||
FlowWidget *flowWidget;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue