mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-05 20:39:59 -08:00
Compare commits
2 Commits
f0ebd28148
...
d29e72ce72
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d29e72ce72 | ||
|
|
30cc8ad6f9 |
@@ -49,7 +49,7 @@ void CardInfoDisplayWidget::setCard(const ExactCard &card)
|
||||
if (exactCard)
|
||||
connect(exactCard.getCardPtr().data(), &QObject::destroyed, this, &CardInfoDisplayWidget::clear);
|
||||
|
||||
text->setCard(exactCard.getCardPtr());
|
||||
text->setCard(exactCard);
|
||||
pic->setCard(exactCard);
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ void CardInfoFrameWidget::setCard(const ExactCard &card)
|
||||
|
||||
setViewTransformationButtonVisibility(hasTransformation(exactCard.getInfo()));
|
||||
|
||||
text->setCard(exactCard.getCardPtr());
|
||||
text->setCard(exactCard);
|
||||
pic->setCard(exactCard);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,8 +50,9 @@ void CardInfoTextWidget::setTexts(const QString &propsText, const QString &textT
|
||||
textLabel->setText(textText);
|
||||
}
|
||||
|
||||
void CardInfoTextWidget::setCard(CardInfoPtr card)
|
||||
void CardInfoTextWidget::setCard(const ExactCard &exactCard)
|
||||
{
|
||||
auto card = exactCard.getCardPtr();
|
||||
if (card == nullptr) {
|
||||
setTexts("", "");
|
||||
return;
|
||||
@@ -61,6 +62,15 @@ void CardInfoTextWidget::setCard(CardInfoPtr card)
|
||||
text += QString("<tr><td>%1</td><td width=\"5\"></td><td>%2</td></tr>")
|
||||
.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();
|
||||
for (const QString &key : cardProps) {
|
||||
if (key.contains("-"))
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#ifndef CARDINFOTEXT_H
|
||||
#define CARDINFOTEXT_H
|
||||
|
||||
#include "libcockatrice/card/printing/exact_card.h"
|
||||
|
||||
#include <QFrame>
|
||||
#include <libcockatrice/card/card_info.h>
|
||||
class QLabel;
|
||||
@@ -32,7 +34,7 @@ public:
|
||||
signals:
|
||||
void linkActivated(const QString &link);
|
||||
public slots:
|
||||
void setCard(CardInfoPtr card);
|
||||
void setCard(const ExactCard &card);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -69,6 +69,7 @@ public slots:
|
||||
void actSwapCard();
|
||||
void actRemoveCard();
|
||||
void offsetCountAtIndex(const QModelIndex &idx, int offset);
|
||||
void expandAll();
|
||||
|
||||
signals:
|
||||
void nameChanged();
|
||||
@@ -117,7 +118,6 @@ private slots:
|
||||
void updateShowBannerCardComboBox(bool visible);
|
||||
void updateShowTagsWidget(bool visible);
|
||||
void syncBannerCardComboBoxSelectionWithDeck();
|
||||
void expandAll();
|
||||
};
|
||||
|
||||
#endif // DECK_EDITOR_DECK_DOCK_WIDGET_H
|
||||
|
||||
@@ -153,6 +153,7 @@ void AbstractTabDeckEditor::addCardHelper(const ExactCard &card, QString zoneNam
|
||||
card.getPrinting().getProperty("num")));
|
||||
|
||||
QModelIndex newCardIndex = deckDockWidget->deckModel->addCard(card, zoneName);
|
||||
deckDockWidget->expandAll();
|
||||
deckDockWidget->deckView->clearSelection();
|
||||
deckDockWidget->deckView->setCurrentIndex(newCardIndex);
|
||||
setModified(true);
|
||||
|
||||
Reference in New Issue
Block a user