diff --git a/cockatrice/src/client/menus/deck_editor/deck_editor_menu.cpp b/cockatrice/src/client/menus/deck_editor/deck_editor_menu.cpp index a01ccc3cf..73a9ef819 100644 --- a/cockatrice/src/client/menus/deck_editor/deck_editor_menu.cpp +++ b/cockatrice/src/client/menus/deck_editor/deck_editor_menu.cpp @@ -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")); diff --git a/cockatrice/src/client/menus/deck_editor/deck_editor_menu.h b/cockatrice/src/client/menus/deck_editor/deck_editor_menu.h index 7bfc58c4b..81a1e75c8 100644 --- a/cockatrice/src/client/menus/deck_editor/deck_editor_menu.h +++ b/cockatrice/src/client/menus/deck_editor/deck_editor_menu.h @@ -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; diff --git a/cockatrice/src/client/tabs/abstract_tab_deck_editor.cpp b/cockatrice/src/client/tabs/abstract_tab_deck_editor.cpp index 1c599034b..270a4af86 100644 --- a/cockatrice/src/client/tabs/abstract_tab_deck_editor.cpp +++ b/cockatrice/src/client/tabs/abstract_tab_deck_editor.cpp @@ -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); diff --git a/cockatrice/src/client/tabs/abstract_tab_deck_editor.h b/cockatrice/src/client/tabs/abstract_tab_deck_editor.h index 796213d27..c5aea7a66 100644 --- a/cockatrice/src/client/tabs/abstract_tab_deck_editor.h +++ b/cockatrice/src/client/tabs/abstract_tab_deck_editor.h @@ -94,6 +94,7 @@ protected slots: bool actSaveDeck(); virtual bool actSaveDeckAs(); virtual void actLoadDeckFromClipboard(); + void actFetchCardPrices(); void actEditDeckInClipboard(); void actEditDeckInClipboardRaw(); void actSaveDeckToClipboard(); diff --git a/cockatrice/src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.cpp b/cockatrice/src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.cpp index 5154e08c1..9adf8e095 100644 --- a/cockatrice/src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.cpp +++ b/cockatrice/src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.cpp @@ -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")); diff --git a/cockatrice/src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.h b/cockatrice/src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.h index 279b0d9a7..0a9ebcd65 100644 --- a/cockatrice/src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.h +++ b/cockatrice/src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.h @@ -64,7 +64,6 @@ private: QTextEdit *commentsEdit; QLabel *bannerCardLabel; DeckPreviewDeckTagsDisplayWidget *deckTagsDisplayWidget; - QPushButton *cardPricesButton; QLabel *hashLabel1; LineEditUnfocusable *hashLabel;