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_move_top_cards_until.cpp
|
||||||
src/dialogs/dlg_register.cpp
|
src/dialogs/dlg_register.cpp
|
||||||
src/dialogs/dlg_roll_dice.cpp
|
src/dialogs/dlg_roll_dice.cpp
|
||||||
|
src/dialogs/dlg_select_set_for_cards.cpp
|
||||||
src/dialogs/dlg_settings.cpp
|
src/dialogs/dlg_settings.cpp
|
||||||
src/dialogs/dlg_tip_of_the_day.cpp
|
src/dialogs/dlg_tip_of_the_day.cpp
|
||||||
src/dialogs/dlg_update.cpp
|
src/dialogs/dlg_update.cpp
|
||||||
|
|
|
||||||
|
|
@ -88,13 +88,6 @@ PrintingSelector::PrintingSelector(QWidget *parent, AbstractTabDeckEditor *_deck
|
||||||
|
|
||||||
sortAndOptionsLayout->addWidget(searchBar);
|
sortAndOptionsLayout->addWidget(searchBar);
|
||||||
sortAndOptionsLayout->addWidget(displayOptionsWidget);
|
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);
|
layout->addWidget(sortAndOptionsContainer);
|
||||||
|
|
||||||
|
|
@ -114,7 +107,6 @@ PrintingSelector::PrintingSelector(QWidget *parent, AbstractTabDeckEditor *_deck
|
||||||
void PrintingSelector::retranslateUi()
|
void PrintingSelector::retranslateUi()
|
||||||
{
|
{
|
||||||
navigationCheckBox->setText(tr("Display Navigation Buttons"));
|
navigationCheckBox->setText(tr("Display Navigation Buttons"));
|
||||||
selectSetForCardsButton->setText(tr("Bulk Selection"));
|
|
||||||
|
|
||||||
if (warningLabel) {
|
if (warningLabel) {
|
||||||
warningLabel->setText(
|
warningLabel->setText(
|
||||||
|
|
@ -277,11 +269,3 @@ void PrintingSelector::toggleVisibilityNavigationButtons(bool _state)
|
||||||
{
|
{
|
||||||
cardSelectionBar->setVisible(_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 setCard(const CardInfoPtr &newCard, const QString &_currentZone);
|
||||||
void getAllSetsForCurrentCard();
|
void getAllSetsForCurrentCard();
|
||||||
|
DeckListModel *getDeckModel() const
|
||||||
|
{
|
||||||
|
return deckModel;
|
||||||
|
};
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
|
|
@ -37,7 +41,6 @@ public slots:
|
||||||
void selectPreviousCard();
|
void selectPreviousCard();
|
||||||
void selectNextCard();
|
void selectNextCard();
|
||||||
void toggleVisibilityNavigationButtons(bool _state);
|
void toggleVisibilityNavigationButtons(bool _state);
|
||||||
void selectSetForCards();
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void printingsInDeckChanged();
|
void printingsInDeckChanged();
|
||||||
|
|
@ -51,7 +54,6 @@ private:
|
||||||
QLabel *warningLabel;
|
QLabel *warningLabel;
|
||||||
PrintingSelectorCardSortingWidget *sortToolBar;
|
PrintingSelectorCardSortingWidget *sortToolBar;
|
||||||
PrintingSelectorCardSearchWidget *searchBar;
|
PrintingSelectorCardSearchWidget *searchBar;
|
||||||
QPushButton *selectSetForCardsButton;
|
|
||||||
FlowWidget *flowWidget;
|
FlowWidget *flowWidget;
|
||||||
CardSizeWidget *cardSizeWidget;
|
CardSizeWidget *cardSizeWidget;
|
||||||
PrintingSelectorCardSelectionWidget *cardSelectionBar;
|
PrintingSelectorCardSelectionWidget *cardSelectionBar;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
#include "printing_selector_card_selection_widget.h"
|
#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.
|
* @brief Constructs a PrintingSelectorCardSelectionWidget for navigating through cards in the deck.
|
||||||
*
|
*
|
||||||
|
|
@ -16,12 +18,18 @@ PrintingSelectorCardSelectionWidget::PrintingSelectorCardSelectionWidget(Printin
|
||||||
previousCardButton = new QPushButton(this);
|
previousCardButton = new QPushButton(this);
|
||||||
previousCardButton->setText(tr("Previous Card in Deck"));
|
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 = new QPushButton(this);
|
||||||
nextCardButton->setText(tr("Next Card in Deck"));
|
nextCardButton->setText(tr("Next Card in Deck"));
|
||||||
|
|
||||||
connectSignals();
|
connectSignals();
|
||||||
|
|
||||||
cardSelectionBarLayout->addWidget(previousCardButton);
|
cardSelectionBarLayout->addWidget(previousCardButton);
|
||||||
|
cardSelectionBarLayout->addWidget(selectSetForCardsButton);
|
||||||
cardSelectionBarLayout->addWidget(nextCardButton);
|
cardSelectionBarLayout->addWidget(nextCardButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,3 +44,11 @@ void PrintingSelectorCardSelectionWidget::connectSignals()
|
||||||
connect(previousCardButton, &QPushButton::clicked, parent, &PrintingSelector::selectPreviousCard);
|
connect(previousCardButton, &QPushButton::clicked, parent, &PrintingSelector::selectPreviousCard);
|
||||||
connect(nextCardButton, &QPushButton::clicked, parent, &PrintingSelector::selectNextCard);
|
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();
|
void connectSignals();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void selectSetForCards();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PrintingSelector *parent;
|
PrintingSelector *parent;
|
||||||
QHBoxLayout *cardSelectionBarLayout;
|
QHBoxLayout *cardSelectionBarLayout;
|
||||||
QPushButton *previousCardButton;
|
QPushButton *previousCardButton;
|
||||||
|
QPushButton *selectSetForCardsButton;
|
||||||
QPushButton *nextCardButton;
|
QPushButton *nextCardButton;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,8 @@ DlgSelectSetForCards::DlgSelectSetForCards(QWidget *parent, DeckListModel *_mode
|
||||||
mainLayout->addWidget(buttonBox);
|
mainLayout->addWidget(buttonBox);
|
||||||
|
|
||||||
retranslateUi();
|
retranslateUi();
|
||||||
|
setWindowFlags(Qt::Window);
|
||||||
|
showMaximized();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DlgSelectSetForCards::retranslateUi()
|
void DlgSelectSetForCards::retranslateUi()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue