mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
Add the button to the print selector instead.
This commit is contained in:
parent
b3ee6f95a2
commit
22f98f28e0
6 changed files with 27 additions and 18 deletions
|
|
@ -169,6 +169,7 @@ set(cockatrice_SOURCES
|
|||
src/dialogs/dlg_move_top_cards_until.cpp
|
||||
src/dialogs/dlg_register.cpp
|
||||
src/dialogs/dlg_roll_dice.cpp
|
||||
src/dialogs/dlg_select_set_for_cards.cpp
|
||||
src/dialogs/dlg_settings.cpp
|
||||
src/dialogs/dlg_tip_of_the_day.cpp
|
||||
src/dialogs/dlg_update.cpp
|
||||
|
|
|
|||
|
|
@ -88,13 +88,6 @@ PrintingSelector::PrintingSelector(QWidget *parent, AbstractTabDeckEditor *_deck
|
|||
|
||||
sortAndOptionsLayout->addWidget(searchBar);
|
||||
sortAndOptionsLayout->addWidget(displayOptionsWidget);
|
||||
searchAndSetLayout->addWidget(searchBar);
|
||||
|
||||
selectSetForCardsButton = new QPushButton(this);
|
||||
connect(selectSetForCardsButton, &QPushButton::clicked, this, &PrintingSelector::selectSetForCards);
|
||||
searchAndSetLayout->addWidget(selectSetForCardsButton);
|
||||
|
||||
layout->addLayout(searchAndSetLayout);
|
||||
|
||||
layout->addWidget(sortAndOptionsContainer);
|
||||
|
||||
|
|
@ -114,7 +107,6 @@ PrintingSelector::PrintingSelector(QWidget *parent, AbstractTabDeckEditor *_deck
|
|||
void PrintingSelector::retranslateUi()
|
||||
{
|
||||
navigationCheckBox->setText(tr("Display Navigation Buttons"));
|
||||
selectSetForCardsButton->setText(tr("Bulk Selection"));
|
||||
|
||||
if (warningLabel) {
|
||||
warningLabel->setText(
|
||||
|
|
@ -277,11 +269,3 @@ void PrintingSelector::toggleVisibilityNavigationButtons(bool _state)
|
|||
{
|
||||
cardSelectionBar->setVisible(_state);
|
||||
}
|
||||
|
||||
void PrintingSelector::selectSetForCards()
|
||||
{
|
||||
DlgSelectSetForCards *setSelectionDialog = new DlgSelectSetForCards(nullptr, deckModel);
|
||||
if (!setSelectionDialog->exec()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ public:
|
|||
|
||||
void setCard(const CardInfoPtr &newCard, const QString &_currentZone);
|
||||
void getAllSetsForCurrentCard();
|
||||
DeckListModel *getDeckModel() const
|
||||
{
|
||||
return deckModel;
|
||||
};
|
||||
|
||||
public slots:
|
||||
void retranslateUi();
|
||||
|
|
@ -37,7 +41,6 @@ public slots:
|
|||
void selectPreviousCard();
|
||||
void selectNextCard();
|
||||
void toggleVisibilityNavigationButtons(bool _state);
|
||||
void selectSetForCards();
|
||||
|
||||
private slots:
|
||||
void printingsInDeckChanged();
|
||||
|
|
@ -51,7 +54,6 @@ private:
|
|||
QLabel *warningLabel;
|
||||
PrintingSelectorCardSortingWidget *sortToolBar;
|
||||
PrintingSelectorCardSearchWidget *searchBar;
|
||||
QPushButton *selectSetForCardsButton;
|
||||
FlowWidget *flowWidget;
|
||||
CardSizeWidget *cardSizeWidget;
|
||||
PrintingSelectorCardSelectionWidget *cardSelectionBar;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
#include "printing_selector_card_selection_widget.h"
|
||||
|
||||
#include "../../../../dialogs/dlg_select_set_for_cards.h"
|
||||
|
||||
/**
|
||||
* @brief Constructs a PrintingSelectorCardSelectionWidget for navigating through cards in the deck.
|
||||
*
|
||||
|
|
@ -16,12 +18,18 @@ PrintingSelectorCardSelectionWidget::PrintingSelectorCardSelectionWidget(Printin
|
|||
previousCardButton = new QPushButton(this);
|
||||
previousCardButton->setText(tr("Previous Card in Deck"));
|
||||
|
||||
selectSetForCardsButton = new QPushButton(this);
|
||||
connect(selectSetForCardsButton, &QPushButton::clicked, this,
|
||||
&PrintingSelectorCardSelectionWidget::selectSetForCards);
|
||||
selectSetForCardsButton->setText(tr("Bulk Selection"));
|
||||
|
||||
nextCardButton = new QPushButton(this);
|
||||
nextCardButton->setText(tr("Next Card in Deck"));
|
||||
|
||||
connectSignals();
|
||||
|
||||
cardSelectionBarLayout->addWidget(previousCardButton);
|
||||
cardSelectionBarLayout->addWidget(selectSetForCardsButton);
|
||||
cardSelectionBarLayout->addWidget(nextCardButton);
|
||||
}
|
||||
|
||||
|
|
@ -36,3 +44,11 @@ void PrintingSelectorCardSelectionWidget::connectSignals()
|
|||
connect(previousCardButton, &QPushButton::clicked, parent, &PrintingSelector::selectPreviousCard);
|
||||
connect(nextCardButton, &QPushButton::clicked, parent, &PrintingSelector::selectNextCard);
|
||||
}
|
||||
|
||||
void PrintingSelectorCardSelectionWidget::selectSetForCards()
|
||||
{
|
||||
DlgSelectSetForCards *setSelectionDialog = new DlgSelectSetForCards(nullptr, parent->getDeckModel());
|
||||
if (!setSelectionDialog->exec()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,10 +16,14 @@ public:
|
|||
|
||||
void connectSignals();
|
||||
|
||||
public slots:
|
||||
void selectSetForCards();
|
||||
|
||||
private:
|
||||
PrintingSelector *parent;
|
||||
QHBoxLayout *cardSelectionBarLayout;
|
||||
QPushButton *previousCardButton;
|
||||
QPushButton *selectSetForCardsButton;
|
||||
QPushButton *nextCardButton;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -128,6 +128,8 @@ DlgSelectSetForCards::DlgSelectSetForCards(QWidget *parent, DeckListModel *_mode
|
|||
mainLayout->addWidget(buttonBox);
|
||||
|
||||
retranslateUi();
|
||||
setWindowFlags(Qt::Window);
|
||||
showMaximized();
|
||||
}
|
||||
|
||||
void DlgSelectSetForCards::retranslateUi()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue