mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 14:32:15 -07:00
Move action from button to menu.
This commit is contained in:
parent
366b90f267
commit
9f19ba83bd
6 changed files with 15 additions and 12 deletions
|
|
@ -51,6 +51,9 @@ DeckEditorMenu::DeckEditorMenu(AbstractTabDeckEditor *parent) : QMenu(parent), d
|
|||
connect(aSaveDeckToClipboardRawNoSetInfo, &QAction::triggered, deckEditor,
|
||||
&AbstractTabDeckEditor::actSaveDeckToClipboardRawNoSetInfo);
|
||||
|
||||
aFetchCardPrices = new QAction(QString(), this);
|
||||
connect(aFetchCardPrices, &QAction::triggered, deckEditor, &AbstractTabDeckEditor::actFetchCardPrices);
|
||||
|
||||
aPrintDeck = new QAction(QString(), this);
|
||||
connect(aPrintDeck, &QAction::triggered, deckEditor, &AbstractTabDeckEditor::actPrintDeck);
|
||||
|
||||
|
|
@ -96,6 +99,7 @@ DeckEditorMenu::DeckEditorMenu(AbstractTabDeckEditor *parent) : QMenu(parent), d
|
|||
addMenu(editDeckInClipboardMenu);
|
||||
addMenu(saveDeckToClipboardMenu);
|
||||
addSeparator();
|
||||
addAction(aFetchCardPrices);
|
||||
addAction(aPrintDeck);
|
||||
addMenu(analyzeDeckMenu);
|
||||
addSeparator();
|
||||
|
|
@ -119,6 +123,7 @@ void DeckEditorMenu::setSaveStatus(bool newStatus)
|
|||
aSaveDeckToClipboardRaw->setEnabled(newStatus);
|
||||
aSaveDeckToClipboardRawNoSetInfo->setEnabled(newStatus);
|
||||
saveDeckToClipboardMenu->setEnabled(newStatus);
|
||||
aFetchCardPrices->setEnabled(newStatus);
|
||||
aPrintDeck->setEnabled(newStatus);
|
||||
analyzeDeckMenu->setEnabled(newStatus);
|
||||
}
|
||||
|
|
@ -164,6 +169,7 @@ void DeckEditorMenu::retranslateUi()
|
|||
aSaveDeckToClipboardRaw->setText(tr("Not Annotated"));
|
||||
aSaveDeckToClipboardRawNoSetInfo->setText(tr("Not Annotated (No set info)"));
|
||||
|
||||
aFetchCardPrices->setText(tr("Fetch card prices..."));
|
||||
aPrintDeck->setText(tr("&Print deck..."));
|
||||
|
||||
analyzeDeckMenu->setTitle(tr("&Send deck to online service"));
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public:
|
|||
|
||||
QAction *aNewDeck, *aLoadDeck, *aClearRecents, *aSaveDeck, *aSaveDeckAs, *aLoadDeckFromClipboard,
|
||||
*aEditDeckInClipboard, *aEditDeckInClipboardRaw, *aSaveDeckToClipboard, *aSaveDeckToClipboardNoSetInfo,
|
||||
*aSaveDeckToClipboardRaw, *aSaveDeckToClipboardRawNoSetInfo, *aPrintDeck, *aExportDeckDecklist,
|
||||
*aSaveDeckToClipboardRaw, *aSaveDeckToClipboardRawNoSetInfo, *aFetchCardPrices, *aPrintDeck, *aExportDeckDecklist,
|
||||
*aExportDeckDecklistXyz, *aAnalyzeDeckDeckstats, *aAnalyzeDeckTappedout, *aClose;
|
||||
QMenu *loadRecentDeckMenu, *analyzeDeckMenu, *editDeckInClipboardMenu, *saveDeckToClipboardMenu;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include "../../client/tapped_out_interface.h"
|
||||
#include "../../client/ui/widgets/cards/card_info_frame_widget.h"
|
||||
#include "../../deck/deck_stats_interface.h"
|
||||
#include "../../dialogs/dlg_get_card_prices.h"
|
||||
#include "../../dialogs/dlg_load_deck.h"
|
||||
#include "../../dialogs/dlg_load_deck_from_clipboard.h"
|
||||
#include "../../game/cards/card_database_manager.h"
|
||||
|
|
@ -413,6 +414,12 @@ void AbstractTabDeckEditor::actLoadDeckFromClipboard()
|
|||
deckMenu->setSaveStatus(true);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actFetchCardPrices()
|
||||
{
|
||||
auto pricesDialog = new DlgGetCardPrices(this, deckDockWidget->deckModel);
|
||||
pricesDialog->exec();
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::editDeckInClipboard(bool annotated)
|
||||
{
|
||||
DlgEditDeckInClipboard dlg(*getDeckList(), annotated, this);
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ protected slots:
|
|||
bool actSaveDeck();
|
||||
virtual bool actSaveDeckAs();
|
||||
virtual void actLoadDeckFromClipboard();
|
||||
void actFetchCardPrices();
|
||||
void actEditDeckInClipboard();
|
||||
void actEditDeckInClipboardRaw();
|
||||
void actSaveDeckToClipboard();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#include "deck_editor_deck_dock_widget.h"
|
||||
|
||||
#include "../../../../dialogs/dlg_get_card_prices.h"
|
||||
#include "../../../../game/cards/card_database_manager.h"
|
||||
#include "../../../../settings/cache_settings.h"
|
||||
|
||||
|
|
@ -145,14 +144,6 @@ void DeckEditorDeckDockWidget::createDeckDock()
|
|||
|
||||
upperLayout->addWidget(deckTagsDisplayWidget, 3, 1);
|
||||
|
||||
cardPricesButton = new QPushButton(this);
|
||||
connect(cardPricesButton, &QPushButton::clicked, this, [this]() {
|
||||
auto pricesDialog = new DlgGetCardPrices(this, deckModel);
|
||||
pricesDialog->exec();
|
||||
});
|
||||
|
||||
upperLayout->addWidget(cardPricesButton, 4, 1);
|
||||
|
||||
hashLabel1 = new QLabel();
|
||||
hashLabel1->setObjectName("hashLabel1");
|
||||
auto *hashSizePolicy = new QSizePolicy();
|
||||
|
|
@ -575,7 +566,6 @@ void DeckEditorDeckDockWidget::retranslateUi()
|
|||
showBannerCardCheckBox->setText(tr("Show banner card selection menu"));
|
||||
showTagsWidgetCheckBox->setText(tr("Show tags selection menu"));
|
||||
commentsLabel->setText(tr("&Comments:"));
|
||||
cardPricesButton->setText(tr("Fetch Card Prices"));
|
||||
hashLabel1->setText(tr("Hash:"));
|
||||
|
||||
aIncrement->setText(tr("&Increment number"));
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ private:
|
|||
QTextEdit *commentsEdit;
|
||||
QLabel *bannerCardLabel;
|
||||
DeckPreviewDeckTagsDisplayWidget *deckTagsDisplayWidget;
|
||||
QPushButton *cardPricesButton;
|
||||
QLabel *hashLabel1;
|
||||
LineEditUnfocusable *hashLabel;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue