[TabDeckEditor] Refactor to use signal instead of calling tab (#6965)

* [TabDeckEditor] Refactor to use signal instead of calling tab

* update docs

* fix cardInfoRequest
This commit is contained in:
RickyRister 2026-06-03 10:41:55 -07:00 committed by GitHub
parent f37c418865
commit 86256602ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 43 additions and 12 deletions

View file

@ -105,16 +105,17 @@ void AbstractTabDeckEditor::registerDockWidget(QMenu *_viewMenu, QDockWidget *wi
dockToActions.insert(widget, {menu, aVisible, aFloating, defaultSize});
}
/**
* @brief Updates the card info dock and printing selector.
* @param card The card to display.
*/
void AbstractTabDeckEditor::updateCard(const ExactCard &card)
{
cardInfoDockWidget->updateCard(card);
printingSelectorDockWidget->printingSelector->setCard(card.getCardPtr());
}
void AbstractTabDeckEditor::updateCardInfo(const ExactCard &card)
{
cardInfoDockWidget->updateCard(card);
}
/** @brief Placeholder: called when the deck changes. */
void AbstractTabDeckEditor::onDeckChanged()
{
@ -595,3 +596,8 @@ void AbstractTabDeckEditor::showPrintingSelector()
printingSelectorDockWidget->printingSelector->updateDisplay();
printingSelectorDockWidget->setVisible(true);
}
void AbstractTabDeckEditor::openEdhrecTab(const CardInfoPtr &info, bool isCommander)
{
getTabSupervisor()->addEdhrecTab(info, isCommander);
}

View file

@ -140,11 +140,18 @@ public slots:
/** @brief Called when the deck is modified. */
virtual void onDeckModified();
/** @brief Updates the card info panel.
* @param card The card to display.
/**
* @brief Updates the card info dock and printing selector.
* @param card The card to display.
*/
void updateCard(const ExactCard &card);
/**
* @brief Updates just the card info dock
* @param card The card to display
*/
void updateCardInfo(const ExactCard &card);
/**
* @brief Adds a card to the given zone
* @param card Card to add.
@ -175,6 +182,13 @@ public slots:
/** @brief Shows the printing selector dock and updates it with the current card. */
void showPrintingSelector();
/**
* @brief Opens an EDHRec tab for the given card
* @param info The card
* @param isCommander The type of search
*/
void openEdhrecTab(const CardInfoPtr &info, bool isCommander);
signals:
/** @brief Emitted when a deck should be opened in a new editor tab. */
void openDeckEditor(const LoadedDeck &deck);