mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 19:47:46 -07:00
[CardInfo] Display set short name and collector number in info widget. (#6378)
* [CardInfo] Display set short name and collector number in info widget. * Lint. * Use reference.
This commit is contained in:
parent
30cc8ad6f9
commit
d29e72ce72
4 changed files with 16 additions and 4 deletions
|
|
@ -49,7 +49,7 @@ void CardInfoDisplayWidget::setCard(const ExactCard &card)
|
||||||
if (exactCard)
|
if (exactCard)
|
||||||
connect(exactCard.getCardPtr().data(), &QObject::destroyed, this, &CardInfoDisplayWidget::clear);
|
connect(exactCard.getCardPtr().data(), &QObject::destroyed, this, &CardInfoDisplayWidget::clear);
|
||||||
|
|
||||||
text->setCard(exactCard.getCardPtr());
|
text->setCard(exactCard);
|
||||||
pic->setCard(exactCard);
|
pic->setCard(exactCard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ void CardInfoFrameWidget::setCard(const ExactCard &card)
|
||||||
|
|
||||||
setViewTransformationButtonVisibility(hasTransformation(exactCard.getInfo()));
|
setViewTransformationButtonVisibility(hasTransformation(exactCard.getInfo()));
|
||||||
|
|
||||||
text->setCard(exactCard.getCardPtr());
|
text->setCard(exactCard);
|
||||||
pic->setCard(exactCard);
|
pic->setCard(exactCard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,9 @@ void CardInfoTextWidget::setTexts(const QString &propsText, const QString &textT
|
||||||
textLabel->setText(textText);
|
textLabel->setText(textText);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CardInfoTextWidget::setCard(CardInfoPtr card)
|
void CardInfoTextWidget::setCard(const ExactCard &exactCard)
|
||||||
{
|
{
|
||||||
|
auto card = exactCard.getCardPtr();
|
||||||
if (card == nullptr) {
|
if (card == nullptr) {
|
||||||
setTexts("", "");
|
setTexts("", "");
|
||||||
return;
|
return;
|
||||||
|
|
@ -61,6 +62,15 @@ void CardInfoTextWidget::setCard(CardInfoPtr card)
|
||||||
text += QString("<tr><td>%1</td><td width=\"5\"></td><td>%2</td></tr>")
|
text += QString("<tr><td>%1</td><td width=\"5\"></td><td>%2</td></tr>")
|
||||||
.arg(tr("Name:"), card->getName().toHtmlEscaped());
|
.arg(tr("Name:"), card->getName().toHtmlEscaped());
|
||||||
|
|
||||||
|
if (exactCard.getPrinting() != PrintingInfo()) {
|
||||||
|
QString setShort = exactCard.getPrinting().getSet()->getShortName().toHtmlEscaped();
|
||||||
|
QString cardNum = exactCard.getPrinting().getProperty("num").toHtmlEscaped();
|
||||||
|
|
||||||
|
text += QString("<tr><td>%1</td><td></td><td>%2</td></tr>").arg(tr("Set:"), setShort);
|
||||||
|
|
||||||
|
text += QString("<tr><td>%1</td><td></td><td>%2</td></tr>").arg(tr("Collector Number:"), cardNum);
|
||||||
|
}
|
||||||
|
|
||||||
QStringList cardProps = card->getProperties();
|
QStringList cardProps = card->getProperties();
|
||||||
for (const QString &key : cardProps) {
|
for (const QString &key : cardProps) {
|
||||||
if (key.contains("-"))
|
if (key.contains("-"))
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@
|
||||||
#ifndef CARDINFOTEXT_H
|
#ifndef CARDINFOTEXT_H
|
||||||
#define CARDINFOTEXT_H
|
#define CARDINFOTEXT_H
|
||||||
|
|
||||||
|
#include "libcockatrice/card/printing/exact_card.h"
|
||||||
|
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
#include <libcockatrice/card/card_info.h>
|
#include <libcockatrice/card/card_info.h>
|
||||||
class QLabel;
|
class QLabel;
|
||||||
|
|
@ -32,7 +34,7 @@ public:
|
||||||
signals:
|
signals:
|
||||||
void linkActivated(const QString &link);
|
void linkActivated(const QString &link);
|
||||||
public slots:
|
public slots:
|
||||||
void setCard(CardInfoPtr card);
|
void setCard(const ExactCard &card);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue