Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches

TabDeckEditor provides a fully-featured deck editor tab. It extends AbstractTabDeckEditor. More...

#include <tab_deck_editor.h>

Inheritance diagram for TabDeckEditor:
[legend]
Collaboration diagram for TabDeckEditor:
[legend]

Public Slots

void showPrintingSelector () override
 Shows the printing selector dock and updates it with current card.
Public Slots inherited from AbstractTabDeckEditor
virtual void onDeckChanged ()
 Called when the deck changes.
virtual void onDeckModified ()
 Called when the deck is modified.
virtual void onDeckHistorySaveRequested (const QString &modificationReason)
 Called when a widget is about to modify the state of the DeckList.
virtual void onDeckHistoryClearRequested ()
 Called when a widget would like to clear the history.
void updateCard (const ExactCard &card)
 Updates the card info panel.
void actAddCard (const ExactCard &card)
 Adds a card to the main deck or sideboard based on Ctrl key.
void actAddCardToSideboard (const ExactCard &card)
 Adds a card to the sideboard explicitly.
void actDecrementCard (const ExactCard &card)
 Decrements a card from the main deck.
void actDecrementCardFromSideboard (const ExactCard &card)
 Decrements a card from the sideboard.
void actOpenRecent (const QString &fileName)
 Opens a recently opened deck file.
void filterTreeChanged (FilterTree *filterTree)
 Called when the filter tree changes.
bool closeRequest () override
 Requests closing the tab.
virtual void showPrintingSelector ()=0
 Shows the printing selector dock. Pure virtual.
virtual void dockTopLevelChanged (bool topLevel)=0
 Slot for when a dock's top-level state changes. Pure virtual.

Public Member Functions

 TabDeckEditor (TabSupervisor *_tabSupervisor)
 Constructs a TabDeckEditor instance.
void retranslateUi () override
 Retranslates UI elements for localization.
QString getTabText () const override
 Returns the tab text, including modified mark if applicable.
void createMenus () override
 Creates menus for deck editing and view options.
Public Member Functions inherited from AbstractTabDeckEditor
 AbstractTabDeckEditor (TabSupervisor *_tabSupervisor)
 Constructs an AbstractTabDeckEditor.
bool confirmClose ()
 Confirms whether the tab can be safely closed.
void openDeck (DeckLoader *deck)
 Opens a deck in this tab.
DeckLoader * getDeckLoader () const
 Returns the currently active deck loader.
DeckListgetDeckList () const
 Returns the currently active deck list.
void setModified (bool _windowModified)
 Sets the modified state of the tab.
DeckEditorDeckDockWidgetgetDeckDockWidget () const
DeckListHistoryManagergetHistoryManager () const
Public Member Functions inherited from Tab
 Tab (TabSupervisor *_tabSupervisor)
const QList< QMenu * > & getTabMenus () const
TabSupervisorgetTabSupervisor () const
bool getContentsChanged () const
void setContentsChanged (bool _contentsChanged)
virtual bool closeRequest ()
virtual void tabActivated ()

Protected Slots

void loadLayout () override
 Loads the saved layout or default layout.
void restartLayout () override
 Resets the layout to default positions and dock states.
void freeDocksSize () override
 Frees the dock sizes for resizing flexibility.
void refreshShortcuts () override
 Refreshes shortcuts for this tab from settings.
bool eventFilter (QObject *o, QEvent *e) override
 Handles dock visibility, floating, and top-level changes.
void dockVisibleTriggered () override
 Handles dock visibility toggling from menu actions.
void dockFloatingTriggered () override
 Handles dock floating toggling from menu actions.
void dockTopLevelChanged (bool topLevel) override
 Syncs menu state with dock floating changes.
Protected Slots inherited from AbstractTabDeckEditor
virtual void actNewDeck ()
 Starts a new deck in this tab.
void cleanDeckAndResetModified ()
 Cleans the current deck and resets the modified state.
virtual void actLoadDeck ()
 Loads a deck from file.
bool actSaveDeck ()
 Saves the current deck.
virtual bool actSaveDeckAs ()
 Saves the current deck under a new name.
virtual void actLoadDeckFromClipboard ()
 Loads a deck from the clipboard.
void actEditDeckInClipboard ()
 Opens a deck editor for clipboard contents.
void actEditDeckInClipboardRaw ()
 Opens a raw clipboard deck editor.
void actSaveDeckToClipboard ()
 Saves deck to clipboard with full info.
void actSaveDeckToClipboardNoSetInfo ()
 Saves deck to clipboard without set info.
void actSaveDeckToClipboardRaw ()
 Saves deck to clipboard in raw format.
void actSaveDeckToClipboardRawNoSetInfo ()
 Saves deck to clipboard in raw format without set info.
void actPrintDeck ()
 Prints the deck using a preview dialog.
void actLoadDeckFromWebsite ()
 Loads a deck from an online website.
void actExportDeckDecklist ()
 Exports the deck to decklist.org.
void actExportDeckDecklistXyz ()
 Exports the deck to decklist.xyz.
void actAnalyzeDeckDeckstats ()
 Analyzes the deck using deckstats.net.
void actAnalyzeDeckTappedout ()
 Analyzes the deck using tappedout.net.
void saveDeckRemoteFinished (const Response &r)
 Callback when a remote deck save finishes.
virtual void loadLayout ()=0
virtual void restartLayout ()=0
virtual void freeDocksSize ()=0
virtual void refreshShortcuts ()=0
void closeEvent (QCloseEvent *event) override
 Handles dock close events.
bool eventFilter (QObject *o, QEvent *e) override
 Event filter for dock state changes.
virtual void dockVisibleTriggered ()=0
 Slot triggered when a dock visibility changes. Pure virtual.
virtual void dockFloatingTriggered ()=0
 Slot triggered when a dock floating state changes. Pure virtual.
Protected Slots inherited from Tab
void showCardInfoPopup (const QPoint &pos, const CardRef &cardRef)
void deleteCardInfoPopup (const QString &cardName)

Additional Inherited Members

Signals inherited from AbstractTabDeckEditor
void openDeckEditor (DeckLoader *deckLoader)
 Emitted when a deck should be opened in a new editor tab.
void deckEditorClosing (AbstractTabDeckEditor *tab)
 Emitted before the tab is closed.
void decrementCard (const ExactCard &card, QString zoneName)
 Emitted when a card should be decremented.
Signals inherited from Tab
void userEvent (bool globalEvent=true)
void tabTextChanged (Tab *tab, const QString &newTabText)
Public Attributes inherited from AbstractTabDeckEditor
DeckListHistoryManagerhistoryManager
DeckEditorMenudeckMenu
 Menu for deck operations.
DeckEditorDatabaseDisplayWidgetdatabaseDisplayDockWidget
 Database dock.
DeckEditorCardInfoDockWidgetcardInfoDockWidget
 Card info dock.
DeckEditorDeckDockWidgetdeckDockWidget
 Deck dock.
DeckEditorFilterDockWidgetfilterDockWidget
 Filter dock.
DeckEditorPrintingSelectorDockWidgetprintingSelectorDockWidget
 Printing selector dock.
Protected Types inherited from AbstractTabDeckEditor
enum  DeckOpenLocation { CANCELLED , SAME_TAB , NEW_TAB }
 Enum describing deck open locations. More...
Protected Member Functions inherited from AbstractTabDeckEditor
DeckOpenLocation confirmOpen (bool openInSameTabIfBlank=true)
 Confirms deck open action based on settings and modified state.
QMessageBox * createSaveConfirmationWindow ()
 Creates a save confirmation message box.
bool isBlankNewDeck () const
 Returns true if the tab is a blank newly created deck.
void addCardHelper (const ExactCard &card, QString zoneName)
 Helper function to add a card to a specific deck zone.
void actSwapCard (const ExactCard &card, const QString &zoneName)
 Swaps a card in the deck view.
virtual void openDeckFromFile (const QString &fileName, DeckOpenLocation deckOpenLocation)
 Opens a deck from a file.
Protected Member Functions inherited from Tab
void addTabMenu (QMenu *menu)
Protected Attributes inherited from AbstractTabDeckEditor
QMenu * viewMenu
QMenu * cardInfoDockMenu
QMenu * deckDockMenu
QMenu * filterDockMenu
QMenu * printingSelectorDockMenu
QAction * aResetLayout
QAction * aCardInfoDockVisible
QAction * aCardInfoDockFloating
QAction * aDeckDockVisible
QAction * aDeckDockFloating
QAction * aFilterDockVisible
QAction * aFilterDockFloating
QAction * aPrintingSelectorDockVisible
QAction * aPrintingSelectorDockFloating
bool modified = false
 Whether the deck/tab has unsaved changes.
Protected Attributes inherited from Tab
TabSupervisortabSupervisor

Detailed Description

TabDeckEditor provides a fully-featured deck editor tab. It extends AbstractTabDeckEditor.

Description: TabDeckEditor is a fully-featured deck editor tab. It extends AbstractTabDeckEditor. It manages layout, dock widgets, menus, and deck-specific actions for traditional (non-visual) editing.

Purpose:

  • Provides a complete deck editing interface for mainboard, sideboard, and card database interactions.
  • Handles dock widgets, keyboard shortcuts, layout persistence, and UI updates.
  • Facilitates card addition, removal, and deck saving/loading through menu and UI interactions.

Dock Widgets:

Key Methods:

Constructor & Destructor Documentation

◆ TabDeckEditor()

TabDeckEditor::TabDeckEditor ( TabSupervisor * _tabSupervisor)
explicit

Constructs a TabDeckEditor instance.

Constructs a new TabDeckEditor object. Sets up menus, translations, shortcuts, and loads the layout.

Parameters
_tabSupervisorParent tab supervisor for managing tabs.
_tabSupervisorPointer to parent TabSupervisor.
Here is the call graph for this function:

Member Function Documentation

◆ createMenus()

void TabDeckEditor::createMenus ( )
overridevirtual

Creates menus for deck editing and view options.

Creates menus for deck editing and view customization.

Adds DeckEditorMenu, view menus, and actions for dock visibility and floating.

Implements AbstractTabDeckEditor.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dockFloatingTriggered

void TabDeckEditor::dockFloatingTriggered ( )
overrideprotectedslot

Handles dock floating toggling from menu actions.

Here is the caller graph for this function:

◆ dockTopLevelChanged

void TabDeckEditor::dockTopLevelChanged ( bool topLevel)
overrideprotectedslot

Syncs menu state with dock floating changes.

◆ dockVisibleTriggered

void TabDeckEditor::dockVisibleTriggered ( )
overrideprotectedslot

Handles dock visibility toggling from menu actions.

Here is the caller graph for this function:

◆ eventFilter

bool TabDeckEditor::eventFilter ( QObject * o,
QEvent * e )
overrideprotectedslot

Handles dock visibility, floating, and top-level changes.

Handles close/hide events to update menu state and save layout.

Parameters
oObject sending the event.
eEvent.
Returns
Always returns false.
Here is the call graph for this function:

◆ freeDocksSize

void TabDeckEditor::freeDocksSize ( )
overrideprotectedslot

Frees the dock sizes for resizing flexibility.

Frees dock sizes to allow flexible resizing.

Here is the caller graph for this function:

◆ getTabText()

QString TabDeckEditor::getTabText ( ) const
nodiscardoverridevirtual

Returns the tab text, including modified mark if applicable.

Returns the text to display in the tab. Prepends "*" if the deck is modified.

Returns
Tab text including modified mark.

Implements AbstractTabDeckEditor.

◆ loadLayout

void TabDeckEditor::loadLayout ( )
overrideprotectedslot

Loads the saved layout or default layout.

Loads deck editor layout from settings or resets to default.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshShortcuts

void TabDeckEditor::refreshShortcuts ( )
overrideprotectedslot

Refreshes shortcuts for this tab from settings.

Refreshes shortcuts for deck editor menu actions.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ restartLayout

void TabDeckEditor::restartLayout ( )
overrideprotectedslot

Resets the layout to default positions and dock states.

Resets all dock widgets to default layout.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ retranslateUi()

void TabDeckEditor::retranslateUi ( )
overridevirtual

Retranslates UI elements for localization.

Updates text of menus and actions for localization.

Implements AbstractTabDeckEditor.

Here is the caller graph for this function:

◆ showPrintingSelector

void TabDeckEditor::showPrintingSelector ( )
overrideslot

Shows the printing selector dock and updates it with current card.

Displays the printing selector dock with the current card.


The documentation for this class was generated from the following files: