Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
dlg_create_token.h
Go to the documentation of this file.
1
6
7#ifndef DLG_CREATETOKEN_H
8#define DLG_CREATETOKEN_H
9
10#include <QDialog>
11
12class QLabel;
13class QLineEdit;
14class QComboBox;
15class QCheckBox;
16class QPushButton;
17class QRadioButton;
18class QCloseEvent;
19class QTreeView;
20class DeckList;
24
26{
27 QString name;
28 QString color;
29 QString pt;
30 QString annotation;
31 bool destroy = true;
32 bool faceDown = false;
33 QString providerId;
34};
35
36class DlgCreateToken : public QDialog
37{
38 Q_OBJECT
39public:
40 explicit DlgCreateToken(const QStringList &_predefinedTokens, QWidget *parent = nullptr);
41 [[nodiscard]] TokenInfo getTokenInfo() const;
42
43protected:
44 void closeEvent(QCloseEvent *event) override;
45private slots:
46 void faceDownCheckBoxToggled(bool checked);
47 void tokenSelectionChanged(const QModelIndex &current, const QModelIndex &previous);
48 void updateSearch(const QString &search);
49 void actChooseTokenFromAll(bool checked);
50 void actChooseTokenFromDeck(bool checked);
51 void actOk();
52 void actReject();
53
54private:
57 QStringList predefinedTokens;
59 QComboBox *colorEdit;
61 QCheckBox *destroyCheckBox;
62 QCheckBox *faceDownCheckBox;
65 QTreeView *chooseTokenView;
66
67 void updateSearchFieldWithoutUpdatingFilter(const QString &newValue) const;
68};
69
70#endif
Definition card_database_model.h:16
Widget that displays an enlarged image of a card, loading the image based on the card's info or showi...
Definition card_info_picture_widget.h:22
Represents a complete deck, including metadata, zones, cards, and sideboard plans.
Definition deck_list.h:127
void actReject()
Definition dlg_create_token.cpp:240
QCheckBox * destroyCheckBox
Definition dlg_create_token.h:61
QTreeView * chooseTokenView
Definition dlg_create_token.h:65
void actOk()
Definition dlg_create_token.cpp:234
QLineEdit * annotationEdit
Definition dlg_create_token.h:60
QLineEdit * nameEdit
Definition dlg_create_token.h:60
CardDatabaseModel * cardDatabaseModel
Definition dlg_create_token.h:55
QLabel * colorLabel
Definition dlg_create_token.h:58
QRadioButton * chooseTokenFromAllRadioButton
Definition dlg_create_token.h:63
QLineEdit * ptEdit
Definition dlg_create_token.h:60
void faceDownCheckBoxToggled(bool checked)
Definition dlg_create_token.cpp:162
void actChooseTokenFromDeck(bool checked)
Definition dlg_create_token.cpp:223
void actChooseTokenFromAll(bool checked)
Definition dlg_create_token.cpp:216
QComboBox * colorEdit
Definition dlg_create_token.h:59
void tokenSelectionChanged(const QModelIndex &current, const QModelIndex &previous)
Definition dlg_create_token.cpp:177
QStringList predefinedTokens
Definition dlg_create_token.h:57
QRadioButton * chooseTokenFromDeckRadioButton
Definition dlg_create_token.h:63
void updateSearch(const QString &search)
Definition dlg_create_token.cpp:211
DlgCreateToken(const QStringList &_predefinedTokens, QWidget *parent=nullptr)
Definition dlg_create_token.cpp:25
QLabel * ptLabel
Definition dlg_create_token.h:58
QLabel * annotationLabel
Definition dlg_create_token.h:58
TokenInfo getTokenInfo() const
Definition dlg_create_token.cpp:246
void updateSearchFieldWithoutUpdatingFilter(const QString &newValue) const
Definition dlg_create_token.cpp:204
QLabel * nameLabel
Definition dlg_create_token.h:58
CardInfoPictureWidget * pic
Definition dlg_create_token.h:64
void closeEvent(QCloseEvent *event) override
Definition dlg_create_token.cpp:156
TokenDisplayModel * cardDatabaseDisplayModel
Definition dlg_create_token.h:56
QCheckBox * faceDownCheckBox
Definition dlg_create_token.h:62
Definition token_display_model.h:13
static peg::parser search(R"( Start <- QueryPartList ~ws <- [ ]+ QueryPartList <- ComplexQueryPart ( ws ("AND" ws)? ComplexQueryPart)* ws* ComplexQueryPart <- SomewhatComplexQueryPart ws "OR" ws ComplexQueryPart / SomewhatComplexQueryPart SomewhatComplexQueryPart <- [(] QueryPartList [)] / QueryPart QueryPart <- NotQuery / DeckContentQuery / DeckNameQuery / FileNameQuery / PathQuery / GenericQuery NotQuery <- ('NOT' ws/'-') SomewhatComplexQueryPart DeckContentQuery <- CardSearch NumericExpression? CardSearch <- '[[' CardFilterString ']]' CardFilterString <- (!']]'.)* DeckNameQuery <- ([Dd] 'eck')? [Nn] 'ame'? [:] String FileNameQuery <- [Ff] ('ile' 'name'?)? [:] String PathQuery <- [Pp] 'ath'? [:] String GenericQuery <- String NonDoubleQuoteUnlessEscaped <- '\\\"'. / !["]. NonSingleQuoteUnlessEscaped<- "\\\'"./![']. UnescapedStringListPart<- !['":<>=! ]. SingleApostropheString <- (UnescapedStringListPart+ ws*)* ['] (UnescapedStringListPart+ ws*)* String <- SingleApostropheString / UnescapedStringListPart+ / ["]< NonDoubleQuoteUnlessEscaped * >["] / ['] <NonSingleQuoteUnlessEscaped*> ['] NumericExpression <- NumericOperator ws? NumericValue NumericOperator <- [=:] / <[><!][=]?> NumericValue <- [0-9]+ )")
Definition dlg_create_token.h:26
QString annotation
Definition dlg_create_token.h:30
QString name
Definition dlg_create_token.h:27
bool destroy
Definition dlg_create_token.h:31
QString color
Definition dlg_create_token.h:28
QString providerId
Definition dlg_create_token.h:33
bool faceDown
Definition dlg_create_token.h:32
QString pt
Definition dlg_create_token.h:29