Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
deck_editor_deck_dock_widget.h
Go to the documentation of this file.
1
7
8#ifndef DECK_EDITOR_DECK_DOCK_WIDGET_H
9#define DECK_EDITOR_DECK_DOCK_WIDGET_H
10
11#include "../../key_signals.h"
13
14#include <QDockWidget>
15#include <QModelIndexList>
16#include <QString>
17#include <QTreeView>
18#include <qtmetamacros.h>
19
21class DeckListModel;
28class QAction;
29class QCheckBox;
30class QComboBox;
31class QItemSelectionModel;
32class QLabel;
33class QMenu;
34class QModelIndex;
35class QPoint;
36class QPushButton;
37class QTextEdit;
38class QTimer;
40
41class DeckEditorDeckDockWidget : public QDockWidget
42{
43 Q_OBJECT
44public:
46
48 QTreeView *deckView;
50 QLabel *playmatLabel;
52 void createDeckDock();
54 void retranslateUi();
55
56 QComboBox *getGroupByComboBox()
57 {
59 }
60
61 [[nodiscard]] QItemSelectionModel *getSelectionModel() const
62 {
63 return deckView->selectionModel();
64 }
65
66public slots:
67 void selectPrevCard();
68 void selectNextCard();
71 void actAddCard(const ExactCard &card, const QString &zoneName);
73 void actDecrementCard(const ExactCard &card, QString zoneName);
75 void actSwapCard(const ExactCard &card, const QString &zoneName);
76 void actSwapSelection();
77 void actRemoveCard();
78 void initializeFormats();
79
80signals:
81 void selectedCardChanged(const ExactCard &card);
82
83private:
86
89 QLabel *nameLabel;
96 QTextEdit *commentsEdit;
100 QLabel *hashLabel1;
104 QLabel *formatLabel;
105 QComboBox *formatComboBox;
106
108
110
111 DeckListModel *getModel() const;
112 [[nodiscard]] QModelIndexList getSelectedCardNodeSourceIndices() const;
113 void offsetCountAtIndex(const QModelIndex &idx, bool isIncrement);
114
115 void addMoveToZoneMenu(QMenu *menu, const QModelIndex &sourceCardIndex, const QString &currentBoardName);
116 void addChangeBoardMenu(QMenu *menu, const QString &zoneName);
117 QString createNewCustomZone(const QString &initialBoardName = {});
118 void addNewZoneAction(QMenu *menu, const QString &initialBoardName = {});
119
120private slots:
121 void decklistCustomMenu(QPoint point);
122 void updateCard(QModelIndex, const QModelIndex &current);
123 void writeName();
124 void writeComments();
125 void writeBannerCard(int);
126 void openPlaymatSettings();
127 void updatePlaymatLabel();
129 void setSelectedIndex(const QModelIndex &newCardIndex, bool preserveWidgetFocus);
130 void updateHash();
131 void refreshShortcuts();
132 void updateShowBannerCardComboBox(bool visible);
133 void updateShowTagsWidget(bool visible);
135 void changeSelectedCard(int changeBy);
136 void recursiveExpand(const QModelIndex &parent);
137 void expandAll();
138};
139
140#endif // DECK_EDITOR_DECK_DOCK_WIDGET_H
AbstractTabDeckEditor is the base class for all deck editor tabs.
Definition abstract_tab_deck_editor.h:77
Definition commander_bracket_widget.h:20
void updateHash()
Definition deck_editor_deck_dock_widget.cpp:440
void updateShowBannerCardComboBox(bool visible)
Definition deck_editor_deck_dock_widget.cpp:543
void addChangeBoardMenu(QMenu *menu, const QString &zoneName)
Definition deck_editor_deck_dock_widget.cpp:991
void initializeFormats()
Definition deck_editor_deck_dock_widget.cpp:354
void actRemoveCard()
Definition deck_editor_deck_dock_widget.cpp:794
void syncDisplayWidgetsToModel()
Definition deck_editor_deck_dock_widget.cpp:582
QItemSelectionModel * getSelectionModel() const
Definition deck_editor_deck_dock_widget.h:61
SettingsButtonWidget * quickSettingsWidget
Definition deck_editor_deck_dock_widget.h:92
void actAddCard(const ExactCard &card, const QString &zoneName)
Definition deck_editor_deck_dock_widget.cpp:715
QLabel * hashLabel1
Definition deck_editor_deck_dock_widget.h:100
QCheckBox * showBannerCardCheckBox
Definition deck_editor_deck_dock_widget.h:93
void writeName()
Writes the contents of the name textBox to the DeckStateManager.
Definition deck_editor_deck_dock_widget.cpp:425
void retranslateUi()
Definition deck_editor_deck_dock_widget.cpp:1046
void updateBannerCardComboBox()
Definition deck_editor_deck_dock_widget.cpp:445
QTimer * commentsDebounceTimer
Definition deck_editor_deck_dock_widget.h:97
void selectPrevCard()
Definition deck_editor_deck_dock_widget.cpp:618
void decklistCustomMenu(QPoint point)
Definition deck_editor_deck_dock_widget.cpp:829
void writeBannerCard(int)
Writes the selected bannerCard to the DeckStateManager.
Definition deck_editor_deck_dock_widget.cpp:500
QTextEdit * commentsEdit
Definition deck_editor_deck_dock_widget.h:96
DeckListStyleProxy * proxy
Definition deck_editor_deck_dock_widget.h:47
QLabel * nameLabel
Definition deck_editor_deck_dock_widget.h:89
void actSwapSelection()
Definition deck_editor_deck_dock_widget.cpp:746
CommanderBracketWidget * commanderBracketWidget
Definition deck_editor_deck_dock_widget.h:109
DeckStateManager * deckStateManager
Definition deck_editor_deck_dock_widget.h:85
QComboBox * getGroupByComboBox()
Definition deck_editor_deck_dock_widget.h:56
void openPlaymatSettings()
Definition deck_editor_deck_dock_widget.cpp:507
void updateShowTagsWidget(bool visible)
Definition deck_editor_deck_dock_widget.cpp:549
QLabel * playmatLabel
Definition deck_editor_deck_dock_widget.h:50
DeckEditorDeckDockWidget(AbstractTabDeckEditor *parent)
Definition deck_editor_deck_dock_widget.cpp:99
DeckListModel * getModel() const
Convenience method to get the underlying model instance from the DeckStateManager.
Definition deck_editor_deck_dock_widget.cpp:613
QPushButton * playmatSettingsButton
Definition deck_editor_deck_dock_widget.h:51
ExactCard getCurrentCard()
Definition deck_editor_deck_dock_widget.cpp:389
QComboBox * bannerCardComboBox
Definition deck_editor_deck_dock_widget.h:49
QComboBox * activeGroupCriteriaComboBox
Definition deck_editor_deck_dock_widget.h:103
QAction * aDecrement
Definition deck_editor_deck_dock_widget.h:107
void refreshShortcuts()
Definition deck_editor_deck_dock_widget.cpp:1038
QAction * aRemoveCard
Definition deck_editor_deck_dock_widget.h:107
QCheckBox * showTagsWidgetCheckBox
Definition deck_editor_deck_dock_widget.h:94
void selectNextCard()
Definition deck_editor_deck_dock_widget.cpp:623
QLabel * commentsLabel
Definition deck_editor_deck_dock_widget.h:95
void recursiveExpand(const QModelIndex &parent)
Expands all parents of the given index.
Definition deck_editor_deck_dock_widget.cpp:677
void selectedCardChanged(const ExactCard &card)
DeckPreviewDeckTagsDisplayWidget * deckTagsDisplayWidget
Definition deck_editor_deck_dock_widget.h:99
void setSelectedIndex(const QModelIndex &newCardIndex, bool preserveWidgetFocus)
Definition deck_editor_deck_dock_widget.cpp:568
void writeComments()
Writes the contents of the comments textBox to the DeckStateManager.
Definition deck_editor_deck_dock_widget.cpp:434
void updateCard(QModelIndex, const QModelIndex &current)
Definition deck_editor_deck_dock_widget.cpp:415
QLabel * bannerCardLabel
Definition deck_editor_deck_dock_widget.h:98
void syncBannerCardComboBoxSelectionWithDeck()
Definition deck_editor_deck_dock_widget.cpp:554
DeckListHistoryManagerWidget * historyManagerWidget
Definition deck_editor_deck_dock_widget.h:87
void addMoveToZoneMenu(QMenu *menu, const QModelIndex &sourceCardIndex, const QString &currentBoardName)
Definition deck_editor_deck_dock_widget.cpp:913
QTimer * nameDebounceTimer
Definition deck_editor_deck_dock_widget.h:91
LineEditUnfocusable * nameEdit
Definition deck_editor_deck_dock_widget.h:90
void addNewZoneAction(QMenu *menu, const QString &initialBoardName={})
Definition deck_editor_deck_dock_widget.cpp:1018
QComboBox * formatComboBox
Definition deck_editor_deck_dock_widget.h:105
void actDecrementSelection()
Definition deck_editor_deck_dock_widget.cpp:777
void actDecrementCard(const ExactCard &card, QString zoneName)
Definition deck_editor_deck_dock_widget.cpp:765
QTreeView * deckView
Definition deck_editor_deck_dock_widget.h:48
LineEditUnfocusable * hashLabel
Definition deck_editor_deck_dock_widget.h:101
void applyActiveGroupCriteria()
Definition deck_editor_deck_dock_widget.cpp:536
void actSwapCard(const ExactCard &card, const QString &zoneName)
Definition deck_editor_deck_dock_widget.cpp:733
void actIncrementSelection()
Definition deck_editor_deck_dock_widget.cpp:724
QModelIndexList getSelectedCardNodeSourceIndices() const
Definition deck_editor_deck_dock_widget.cpp:701
QAction * aIncrement
Definition deck_editor_deck_dock_widget.h:107
QString createNewCustomZone(const QString &initialBoardName={})
Definition deck_editor_deck_dock_widget.cpp:1025
QAction * aSwapCard
Definition deck_editor_deck_dock_widget.h:107
void offsetCountAtIndex(const QModelIndex &idx, bool isIncrement)
Increments or decrements the amount of the card node at the index by 1.
Definition deck_editor_deck_dock_widget.cpp:816
KeySignals deckViewKeySignals
Definition deck_editor_deck_dock_widget.h:88
QLabel * formatLabel
Definition deck_editor_deck_dock_widget.h:104
void changeSelectedCard(int changeBy)
Selects a card based on the change direction.
Definition deck_editor_deck_dock_widget.cpp:633
void createDeckDock()
Definition deck_editor_deck_dock_widget.cpp:111
AbstractTabDeckEditor * deckEditor
Definition deck_editor_deck_dock_widget.h:84
void expandAll()
Fully expands all levels of the deck view.
Definition deck_editor_deck_dock_widget.cpp:690
void updatePlaymatLabel()
Definition deck_editor_deck_dock_widget.cpp:526
QLabel * activeGroupCriteriaLabel
Definition deck_editor_deck_dock_widget.h:102
Definition deck_list_history_manager_widget.h:22
Qt model representing a decklist for use in views (tree/table).
Definition deck_list_model.h:228
Definition deck_list_style_proxy.h:8
Definition deck_preview_deck_tags_display_widget.h:19
This class centralizes the management of the state of the deck in the deck editor tab....
Definition deck_state_manager.h:32
Represents a specific card instance, defined by its CardInfo and a particular printing.
Definition exact_card.h:24
Definition key_signals.h:15
Definition custom_line_edit.h:21
Definition settings_button_widget.h:21