Doxygen tab_deck_editor (#6287)

Took 21 seconds

Took 4 minutes

Took 4 minutes

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2025-11-08 22:30:19 +01:00 committed by GitHub
parent 55aaca0e0d
commit 6bc2293292
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 125 additions and 62 deletions

View file

@ -14,28 +14,85 @@ class DeckListModel;
class QLabel;
class DeckLoader;
/**
* @class TabDeckEditor
* @ingroup DeckEditorTabs
* @brief 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:**
*
* - DeckEditorCardInfoDockWidget Displays detailed card information.
* - DeckEditorDeckDockWidget Shows deck contents and zones.
* - DeckEditorDatabaseDisplayWidget Displays cards from the database in a table view for adding to the deck.
* - DeckEditorFilterDockWidget Provides filter/search capabilities for the database display.
* - DeckEditorPrintingSelectorDockWidget Allows selection of specific card printings.
*
* **Key Methods:**
*
* - loadLayout() Loads saved layout or applies default layout positions and dock states.
* - restartLayout() Resets dock visibility, positions, and floating states to defaults.
* - freeDocksSize() Frees constraints on dock sizes to allow flexible resizing.
* - refreshShortcuts() Updates tab-specific shortcuts from settings.
* - eventFilter(QObject *o, QEvent *e) Handles dock close/hide events and saves layout state.
* - dockVisibleTriggered() Responds to menu actions toggling dock visibility.
* - dockFloatingTriggered() Responds to menu actions toggling dock floating state.
* - dockTopLevelChanged(bool topLevel) Updates menu states when a dock changes top-level/floating status.
* - retranslateUi() Updates all text/UI elements for localization.
* - getTabText() const Returns the tab title with a modified marker if applicable.
* - createMenus() Initializes menus for deck and view actions.
* - showPrintingSelector() Displays the printing selector dock for the current card.
*/
class TabDeckEditor : public AbstractTabDeckEditor
{
Q_OBJECT
protected slots:
/** @brief Loads the saved layout or default layout. */
void loadLayout() override;
/** @brief Resets the layout to default positions and dock states. */
void restartLayout() override;
/** @brief Frees the dock sizes for resizing flexibility. */
void freeDocksSize() override;
/** @brief Refreshes shortcuts for this tab from settings. */
void refreshShortcuts() override;
/** @brief Handles dock visibility, floating, and top-level changes. */
bool eventFilter(QObject *o, QEvent *e) override;
void dockVisibleTriggered() override;
void dockFloatingTriggered() override;
void dockTopLevelChanged(bool topLevel) override;
public:
/**
* @brief Constructs a TabDeckEditor instance.
* @param _tabSupervisor Parent tab supervisor for managing tabs.
*/
explicit TabDeckEditor(TabSupervisor *_tabSupervisor);
/** @brief Retranslates UI elements for localization. */
void retranslateUi() override;
/** @brief Returns the tab text, including modified mark if applicable. */
QString getTabText() const override;
/** @brief Creates menus for deck editing and view options. */
void createMenus() override;
public slots:
/** @brief Shows the printing selector dock and updates it with current card. */
void showPrintingSelector() override;
};