mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-30 18:43:55 -07:00
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:
parent
55aaca0e0d
commit
6bc2293292
2 changed files with 125 additions and 62 deletions
|
|
@ -39,6 +39,11 @@
|
||||||
#include <libcockatrice/protocol/pending_command.h>
|
#include <libcockatrice/protocol/pending_command.h>
|
||||||
#include <libcockatrice/utility/trice_limits.h>
|
#include <libcockatrice/utility/trice_limits.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Constructs a new TabDeckEditor object.
|
||||||
|
* Sets up menus, translations, shortcuts, and loads the layout.
|
||||||
|
* @param _tabSupervisor Pointer to parent TabSupervisor.
|
||||||
|
*/
|
||||||
TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor) : AbstractTabDeckEditor(_tabSupervisor)
|
TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor) : AbstractTabDeckEditor(_tabSupervisor)
|
||||||
{
|
{
|
||||||
setObjectName("TabDeckEditor");
|
setObjectName("TabDeckEditor");
|
||||||
|
|
@ -53,6 +58,11 @@ TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor) : AbstractTabDeckEdi
|
||||||
TabDeckEditor::loadLayout();
|
TabDeckEditor::loadLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Creates menus for deck editing and view customization.
|
||||||
|
*
|
||||||
|
* Adds DeckEditorMenu, view menus, and actions for dock visibility and floating.
|
||||||
|
*/
|
||||||
void TabDeckEditor::createMenus()
|
void TabDeckEditor::createMenus()
|
||||||
{
|
{
|
||||||
deckMenu = new DeckEditorMenu(this);
|
deckMenu = new DeckEditorMenu(this);
|
||||||
|
|
@ -65,6 +75,7 @@ void TabDeckEditor::createMenus()
|
||||||
filterDockMenu = viewMenu->addMenu(QString());
|
filterDockMenu = viewMenu->addMenu(QString());
|
||||||
printingSelectorDockMenu = viewMenu->addMenu(QString());
|
printingSelectorDockMenu = viewMenu->addMenu(QString());
|
||||||
|
|
||||||
|
// Card Info dock
|
||||||
aCardInfoDockVisible = cardInfoDockMenu->addAction(QString());
|
aCardInfoDockVisible = cardInfoDockMenu->addAction(QString());
|
||||||
aCardInfoDockVisible->setCheckable(true);
|
aCardInfoDockVisible->setCheckable(true);
|
||||||
connect(aCardInfoDockVisible, &QAction::triggered, this, &TabDeckEditor::dockVisibleTriggered);
|
connect(aCardInfoDockVisible, &QAction::triggered, this, &TabDeckEditor::dockVisibleTriggered);
|
||||||
|
|
@ -72,6 +83,7 @@ void TabDeckEditor::createMenus()
|
||||||
aCardInfoDockFloating->setCheckable(true);
|
aCardInfoDockFloating->setCheckable(true);
|
||||||
connect(aCardInfoDockFloating, &QAction::triggered, this, &TabDeckEditor::dockFloatingTriggered);
|
connect(aCardInfoDockFloating, &QAction::triggered, this, &TabDeckEditor::dockFloatingTriggered);
|
||||||
|
|
||||||
|
// Deck dock
|
||||||
aDeckDockVisible = deckDockMenu->addAction(QString());
|
aDeckDockVisible = deckDockMenu->addAction(QString());
|
||||||
aDeckDockVisible->setCheckable(true);
|
aDeckDockVisible->setCheckable(true);
|
||||||
connect(aDeckDockVisible, &QAction::triggered, this, &TabDeckEditor::dockVisibleTriggered);
|
connect(aDeckDockVisible, &QAction::triggered, this, &TabDeckEditor::dockVisibleTriggered);
|
||||||
|
|
@ -79,6 +91,7 @@ void TabDeckEditor::createMenus()
|
||||||
aDeckDockFloating->setCheckable(true);
|
aDeckDockFloating->setCheckable(true);
|
||||||
connect(aDeckDockFloating, &QAction::triggered, this, &TabDeckEditor::dockFloatingTriggered);
|
connect(aDeckDockFloating, &QAction::triggered, this, &TabDeckEditor::dockFloatingTriggered);
|
||||||
|
|
||||||
|
// Filter dock
|
||||||
aFilterDockVisible = filterDockMenu->addAction(QString());
|
aFilterDockVisible = filterDockMenu->addAction(QString());
|
||||||
aFilterDockVisible->setCheckable(true);
|
aFilterDockVisible->setCheckable(true);
|
||||||
connect(aFilterDockVisible, &QAction::triggered, this, &TabDeckEditor::dockVisibleTriggered);
|
connect(aFilterDockVisible, &QAction::triggered, this, &TabDeckEditor::dockVisibleTriggered);
|
||||||
|
|
@ -86,6 +99,7 @@ void TabDeckEditor::createMenus()
|
||||||
aFilterDockFloating->setCheckable(true);
|
aFilterDockFloating->setCheckable(true);
|
||||||
connect(aFilterDockFloating, &QAction::triggered, this, &TabDeckEditor::dockFloatingTriggered);
|
connect(aFilterDockFloating, &QAction::triggered, this, &TabDeckEditor::dockFloatingTriggered);
|
||||||
|
|
||||||
|
// Printing selector dock
|
||||||
aPrintingSelectorDockVisible = printingSelectorDockMenu->addAction(QString());
|
aPrintingSelectorDockVisible = printingSelectorDockMenu->addAction(QString());
|
||||||
aPrintingSelectorDockVisible->setCheckable(true);
|
aPrintingSelectorDockVisible->setCheckable(true);
|
||||||
connect(aPrintingSelectorDockVisible, &QAction::triggered, this, &TabDeckEditor::dockVisibleTriggered);
|
connect(aPrintingSelectorDockVisible, &QAction::triggered, this, &TabDeckEditor::dockVisibleTriggered);
|
||||||
|
|
@ -107,10 +121,14 @@ void TabDeckEditor::createMenus()
|
||||||
viewMenu->addAction(aResetLayout);
|
viewMenu->addAction(aResetLayout);
|
||||||
|
|
||||||
deckMenu->setSaveStatus(false);
|
deckMenu->setSaveStatus(false);
|
||||||
|
|
||||||
addTabMenu(viewMenu);
|
addTabMenu(viewMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the text to display in the tab.
|
||||||
|
* Prepends "*" if the deck is modified.
|
||||||
|
* @return Tab text including modified mark.
|
||||||
|
*/
|
||||||
QString TabDeckEditor::getTabText() const
|
QString TabDeckEditor::getTabText() const
|
||||||
{
|
{
|
||||||
QString result = tr("Deck: %1").arg(deckDockWidget->getSimpleDeckName());
|
QString result = tr("Deck: %1").arg(deckDockWidget->getSimpleDeckName());
|
||||||
|
|
@ -119,10 +137,10 @@ QString TabDeckEditor::getTabText() const
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @brief Updates text of menus and actions for localization. */
|
||||||
void TabDeckEditor::retranslateUi()
|
void TabDeckEditor::retranslateUi()
|
||||||
{
|
{
|
||||||
deckMenu->retranslateUi();
|
deckMenu->retranslateUi();
|
||||||
|
|
||||||
cardInfoDockWidget->retranslateUi();
|
cardInfoDockWidget->retranslateUi();
|
||||||
deckDockWidget->retranslateUi();
|
deckDockWidget->retranslateUi();
|
||||||
filterDockWidget->retranslateUi();
|
filterDockWidget->retranslateUi();
|
||||||
|
|
@ -136,25 +154,25 @@ void TabDeckEditor::retranslateUi()
|
||||||
|
|
||||||
aCardInfoDockVisible->setText(tr("Visible"));
|
aCardInfoDockVisible->setText(tr("Visible"));
|
||||||
aCardInfoDockFloating->setText(tr("Floating"));
|
aCardInfoDockFloating->setText(tr("Floating"));
|
||||||
|
|
||||||
aDeckDockVisible->setText(tr("Visible"));
|
aDeckDockVisible->setText(tr("Visible"));
|
||||||
aDeckDockFloating->setText(tr("Floating"));
|
aDeckDockFloating->setText(tr("Floating"));
|
||||||
|
|
||||||
aFilterDockVisible->setText(tr("Visible"));
|
aFilterDockVisible->setText(tr("Visible"));
|
||||||
aFilterDockFloating->setText(tr("Floating"));
|
aFilterDockFloating->setText(tr("Floating"));
|
||||||
|
|
||||||
aPrintingSelectorDockVisible->setText(tr("Visible"));
|
aPrintingSelectorDockVisible->setText(tr("Visible"));
|
||||||
aPrintingSelectorDockFloating->setText(tr("Floating"));
|
aPrintingSelectorDockFloating->setText(tr("Floating"));
|
||||||
|
|
||||||
aResetLayout->setText(tr("Reset layout"));
|
aResetLayout->setText(tr("Reset layout"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @brief Refreshes shortcuts for deck editor menu actions. */
|
||||||
void TabDeckEditor::refreshShortcuts()
|
void TabDeckEditor::refreshShortcuts()
|
||||||
{
|
{
|
||||||
ShortcutsSettings &shortcuts = SettingsCache::instance().shortcuts();
|
ShortcutsSettings &shortcuts = SettingsCache::instance().shortcuts();
|
||||||
aResetLayout->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aResetLayout"));
|
aResetLayout->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aResetLayout"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Displays the printing selector dock with the current card.
|
||||||
|
*/
|
||||||
void TabDeckEditor::showPrintingSelector()
|
void TabDeckEditor::showPrintingSelector()
|
||||||
{
|
{
|
||||||
printingSelectorDockWidget->printingSelector->setCard(cardInfoDockWidget->cardInfo->getCard().getCardPtr(),
|
printingSelectorDockWidget->printingSelector->setCard(cardInfoDockWidget->cardInfo->getCard().getCardPtr(),
|
||||||
|
|
@ -164,16 +182,18 @@ void TabDeckEditor::showPrintingSelector()
|
||||||
printingSelectorDockWidget->setVisible(true);
|
printingSelectorDockWidget->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Loads deck editor layout from settings or resets to default.
|
||||||
|
*/
|
||||||
void TabDeckEditor::loadLayout()
|
void TabDeckEditor::loadLayout()
|
||||||
{
|
{
|
||||||
LayoutsSettings &layouts = SettingsCache::instance().layouts();
|
LayoutsSettings &layouts = SettingsCache::instance().layouts();
|
||||||
|
|
||||||
setCentralWidget(databaseDisplayDockWidget);
|
setCentralWidget(databaseDisplayDockWidget);
|
||||||
|
|
||||||
auto &layoutState = layouts.getDeckEditorLayoutState();
|
auto &layoutState = layouts.getDeckEditorLayoutState();
|
||||||
if (layoutState.isNull()) {
|
if (layoutState.isNull())
|
||||||
restartLayout();
|
restartLayout();
|
||||||
} else {
|
else {
|
||||||
restoreState(layoutState);
|
restoreState(layoutState);
|
||||||
restoreGeometry(layouts.getDeckEditorGeometry());
|
restoreGeometry(layouts.getDeckEditorGeometry());
|
||||||
}
|
}
|
||||||
|
|
@ -215,9 +235,13 @@ void TabDeckEditor::loadLayout()
|
||||||
QTimer::singleShot(100, this, &TabDeckEditor::freeDocksSize);
|
QTimer::singleShot(100, this, &TabDeckEditor::freeDocksSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Resets all dock widgets to default layout.
|
||||||
|
*/
|
||||||
void TabDeckEditor::restartLayout()
|
void TabDeckEditor::restartLayout()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Update menu checkboxes
|
||||||
aCardInfoDockVisible->setChecked(true);
|
aCardInfoDockVisible->setChecked(true);
|
||||||
aDeckDockVisible->setChecked(true);
|
aDeckDockVisible->setChecked(true);
|
||||||
aFilterDockVisible->setChecked(true);
|
aFilterDockVisible->setChecked(true);
|
||||||
|
|
@ -234,6 +258,7 @@ void TabDeckEditor::restartLayout()
|
||||||
addDockWidget(Qt::RightDockWidgetArea, filterDockWidget);
|
addDockWidget(Qt::RightDockWidgetArea, filterDockWidget);
|
||||||
addDockWidget(Qt::RightDockWidgetArea, printingSelectorDockWidget);
|
addDockWidget(Qt::RightDockWidgetArea, printingSelectorDockWidget);
|
||||||
|
|
||||||
|
// Show/hide and reset floating
|
||||||
deckDockWidget->setFloating(false);
|
deckDockWidget->setFloating(false);
|
||||||
cardInfoDockWidget->setFloating(false);
|
cardInfoDockWidget->setFloating(false);
|
||||||
filterDockWidget->setFloating(false);
|
filterDockWidget->setFloating(false);
|
||||||
|
|
@ -252,98 +277,78 @@ void TabDeckEditor::restartLayout()
|
||||||
QTimer::singleShot(100, this, &TabDeckEditor::freeDocksSize);
|
QTimer::singleShot(100, this, &TabDeckEditor::freeDocksSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @brief Frees dock sizes to allow flexible resizing. */
|
||||||
void TabDeckEditor::freeDocksSize()
|
void TabDeckEditor::freeDocksSize()
|
||||||
{
|
{
|
||||||
deckDockWidget->setMinimumSize(100, 100);
|
const QSize minSize(100, 100);
|
||||||
deckDockWidget->setMaximumSize(5000, 5000);
|
const QSize maxSize(5000, 5000);
|
||||||
|
|
||||||
cardInfoDockWidget->setMinimumSize(100, 100);
|
deckDockWidget->setMinimumSize(minSize);
|
||||||
cardInfoDockWidget->setMaximumSize(5000, 5000);
|
deckDockWidget->setMaximumSize(maxSize);
|
||||||
|
|
||||||
filterDockWidget->setMinimumSize(100, 100);
|
cardInfoDockWidget->setMinimumSize(minSize);
|
||||||
filterDockWidget->setMaximumSize(5000, 5000);
|
cardInfoDockWidget->setMaximumSize(maxSize);
|
||||||
|
|
||||||
printingSelectorDockWidget->setMinimumSize(100, 100);
|
filterDockWidget->setMinimumSize(minSize);
|
||||||
printingSelectorDockWidget->setMaximumSize(5000, 5000);
|
filterDockWidget->setMaximumSize(maxSize);
|
||||||
|
|
||||||
|
printingSelectorDockWidget->setMinimumSize(minSize);
|
||||||
|
printingSelectorDockWidget->setMaximumSize(maxSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @brief Handles dock visibility toggling from menu actions. */
|
||||||
void TabDeckEditor::dockVisibleTriggered()
|
void TabDeckEditor::dockVisibleTriggered()
|
||||||
{
|
{
|
||||||
QObject *o = sender();
|
QObject *o = sender();
|
||||||
if (o == aCardInfoDockVisible) {
|
if (o == aCardInfoDockVisible) {
|
||||||
cardInfoDockWidget->setHidden(!aCardInfoDockVisible->isChecked());
|
cardInfoDockWidget->setHidden(!aCardInfoDockVisible->isChecked());
|
||||||
aCardInfoDockFloating->setEnabled(aCardInfoDockVisible->isChecked());
|
aCardInfoDockFloating->setEnabled(aCardInfoDockVisible->isChecked());
|
||||||
return;
|
} else if (o == aDeckDockVisible) {
|
||||||
}
|
|
||||||
|
|
||||||
if (o == aDeckDockVisible) {
|
|
||||||
deckDockWidget->setHidden(!aDeckDockVisible->isChecked());
|
deckDockWidget->setHidden(!aDeckDockVisible->isChecked());
|
||||||
aDeckDockFloating->setEnabled(aDeckDockVisible->isChecked());
|
aDeckDockFloating->setEnabled(aDeckDockVisible->isChecked());
|
||||||
return;
|
} else if (o == aFilterDockVisible) {
|
||||||
}
|
|
||||||
|
|
||||||
if (o == aFilterDockVisible) {
|
|
||||||
filterDockWidget->setHidden(!aFilterDockVisible->isChecked());
|
filterDockWidget->setHidden(!aFilterDockVisible->isChecked());
|
||||||
aFilterDockFloating->setEnabled(aFilterDockVisible->isChecked());
|
aFilterDockFloating->setEnabled(aFilterDockVisible->isChecked());
|
||||||
return;
|
} else if (o == aPrintingSelectorDockVisible) {
|
||||||
}
|
|
||||||
|
|
||||||
if (o == aPrintingSelectorDockVisible) {
|
|
||||||
printingSelectorDockWidget->setHidden(!aPrintingSelectorDockVisible->isChecked());
|
printingSelectorDockWidget->setHidden(!aPrintingSelectorDockVisible->isChecked());
|
||||||
aPrintingSelectorDockFloating->setEnabled(aPrintingSelectorDockVisible->isChecked());
|
aPrintingSelectorDockFloating->setEnabled(aPrintingSelectorDockVisible->isChecked());
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @brief Handles dock floating toggling from menu actions. */
|
||||||
void TabDeckEditor::dockFloatingTriggered()
|
void TabDeckEditor::dockFloatingTriggered()
|
||||||
{
|
{
|
||||||
QObject *o = sender();
|
QObject *o = sender();
|
||||||
if (o == aCardInfoDockFloating) {
|
if (o == aCardInfoDockFloating)
|
||||||
cardInfoDockWidget->setFloating(aCardInfoDockFloating->isChecked());
|
cardInfoDockWidget->setFloating(aCardInfoDockFloating->isChecked());
|
||||||
return;
|
else if (o == aDeckDockFloating)
|
||||||
}
|
|
||||||
|
|
||||||
if (o == aDeckDockFloating) {
|
|
||||||
deckDockWidget->setFloating(aDeckDockFloating->isChecked());
|
deckDockWidget->setFloating(aDeckDockFloating->isChecked());
|
||||||
return;
|
else if (o == aFilterDockFloating)
|
||||||
}
|
|
||||||
|
|
||||||
if (o == aFilterDockFloating) {
|
|
||||||
filterDockWidget->setFloating(aFilterDockFloating->isChecked());
|
filterDockWidget->setFloating(aFilterDockFloating->isChecked());
|
||||||
return;
|
else if (o == aPrintingSelectorDockFloating)
|
||||||
}
|
|
||||||
|
|
||||||
if (o == aPrintingSelectorDockFloating) {
|
|
||||||
printingSelectorDockWidget->setFloating(aPrintingSelectorDockFloating->isChecked());
|
printingSelectorDockWidget->setFloating(aPrintingSelectorDockFloating->isChecked());
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @brief Syncs menu state with dock floating changes. */
|
||||||
void TabDeckEditor::dockTopLevelChanged(bool topLevel)
|
void TabDeckEditor::dockTopLevelChanged(bool topLevel)
|
||||||
{
|
{
|
||||||
QObject *o = sender();
|
QObject *o = sender();
|
||||||
if (o == cardInfoDockWidget) {
|
if (o == cardInfoDockWidget)
|
||||||
aCardInfoDockFloating->setChecked(topLevel);
|
aCardInfoDockFloating->setChecked(topLevel);
|
||||||
return;
|
else if (o == deckDockWidget)
|
||||||
}
|
|
||||||
|
|
||||||
if (o == deckDockWidget) {
|
|
||||||
aDeckDockFloating->setChecked(topLevel);
|
aDeckDockFloating->setChecked(topLevel);
|
||||||
return;
|
else if (o == filterDockWidget)
|
||||||
}
|
|
||||||
|
|
||||||
if (o == filterDockWidget) {
|
|
||||||
aFilterDockFloating->setChecked(topLevel);
|
aFilterDockFloating->setChecked(topLevel);
|
||||||
return;
|
else if (o == printingSelectorDockWidget)
|
||||||
}
|
|
||||||
|
|
||||||
if (o == printingSelectorDockWidget) {
|
|
||||||
aPrintingSelectorDockFloating->setChecked(topLevel);
|
aPrintingSelectorDockFloating->setChecked(topLevel);
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method uses to sync docks state with menu items state
|
/**
|
||||||
|
* @brief Handles close/hide events to update menu state and save layout.
|
||||||
|
* @param o Object sending the event.
|
||||||
|
* @param e Event.
|
||||||
|
* @return Always returns false.
|
||||||
|
*/
|
||||||
bool TabDeckEditor::eventFilter(QObject *o, QEvent *e)
|
bool TabDeckEditor::eventFilter(QObject *o, QEvent *e)
|
||||||
{
|
{
|
||||||
if (e->type() == QEvent::Close) {
|
if (e->type() == QEvent::Close) {
|
||||||
|
|
@ -361,6 +366,7 @@ bool TabDeckEditor::eventFilter(QObject *o, QEvent *e)
|
||||||
aPrintingSelectorDockFloating->setEnabled(false);
|
aPrintingSelectorDockFloating->setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (o == this && e->type() == QEvent::Hide) {
|
if (o == this && e->type() == QEvent::Hide) {
|
||||||
LayoutsSettings &layouts = SettingsCache::instance().layouts();
|
LayoutsSettings &layouts = SettingsCache::instance().layouts();
|
||||||
layouts.setDeckEditorLayoutState(saveState());
|
layouts.setDeckEditorLayoutState(saveState());
|
||||||
|
|
|
||||||
|
|
@ -14,28 +14,85 @@ class DeckListModel;
|
||||||
class QLabel;
|
class QLabel;
|
||||||
class DeckLoader;
|
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
|
class TabDeckEditor : public AbstractTabDeckEditor
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
|
/** @brief Loads the saved layout or default layout. */
|
||||||
void loadLayout() override;
|
void loadLayout() override;
|
||||||
|
|
||||||
|
/** @brief Resets the layout to default positions and dock states. */
|
||||||
void restartLayout() override;
|
void restartLayout() override;
|
||||||
|
|
||||||
|
/** @brief Frees the dock sizes for resizing flexibility. */
|
||||||
void freeDocksSize() override;
|
void freeDocksSize() override;
|
||||||
|
|
||||||
|
/** @brief Refreshes shortcuts for this tab from settings. */
|
||||||
void refreshShortcuts() override;
|
void refreshShortcuts() override;
|
||||||
|
|
||||||
|
/** @brief Handles dock visibility, floating, and top-level changes. */
|
||||||
bool eventFilter(QObject *o, QEvent *e) override;
|
bool eventFilter(QObject *o, QEvent *e) override;
|
||||||
void dockVisibleTriggered() override;
|
void dockVisibleTriggered() override;
|
||||||
void dockFloatingTriggered() override;
|
void dockFloatingTriggered() override;
|
||||||
void dockTopLevelChanged(bool topLevel) override;
|
void dockTopLevelChanged(bool topLevel) override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Constructs a TabDeckEditor instance.
|
||||||
|
* @param _tabSupervisor Parent tab supervisor for managing tabs.
|
||||||
|
*/
|
||||||
explicit TabDeckEditor(TabSupervisor *_tabSupervisor);
|
explicit TabDeckEditor(TabSupervisor *_tabSupervisor);
|
||||||
|
|
||||||
|
/** @brief Retranslates UI elements for localization. */
|
||||||
void retranslateUi() override;
|
void retranslateUi() override;
|
||||||
|
|
||||||
|
/** @brief Returns the tab text, including modified mark if applicable. */
|
||||||
QString getTabText() const override;
|
QString getTabText() const override;
|
||||||
|
|
||||||
|
/** @brief Creates menus for deck editing and view options. */
|
||||||
void createMenus() override;
|
void createMenus() override;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
/** @brief Shows the printing selector dock and updates it with current card. */
|
||||||
void showPrintingSelector() override;
|
void showPrintingSelector() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue