Cockatrice/cockatrice/src/interface/widgets/playmat/playmat_collection_dialog.h
BruebachL 9eafd90a91
[Game] Playmats (#7101)
* [Game] Playmats

Took 19 seconds

Took 1 minute

* [Playmats] Add fixed override and configurable fallbacks to settings.

Took 29 minutes

Took 43 seconds

* Add main to test.

Took 1 minute

Took 29 seconds

* Move settings to own group

Took 11 minutes

* Some attempts to refresh macOS compositor

Took 2 minutes

* Try something else

Took 17 minutes

* Don't manipulate live list

Took 11 minutes

* Change things about resolution, address comments.

Took 45 minutes

Took 12 minutes

* Comments.

Took 14 minutes

Took 8 seconds

* Re-order settings menu location

Took 2 minutes

* Rename PlaymatResolution to Info and add enums

Took 8 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-08-21 10:40:49 +02:00

54 lines
1.3 KiB
C++

#ifndef COCKATRICE_PLAYMAT_COLLECTION_DIALOG_H
#define COCKATRICE_PLAYMAT_COLLECTION_DIALOG_H
#include <QDialog>
#include <libcockatrice/utility/playmat_params.h>
class QComboBox;
class QLabel;
class QListWidget;
class QListWidgetItem;
class QPushButton;
/**
* @brief Dialog for editing the user-level playmat collection.
*
* The collection is the fallback used when a deck has no playmat of its own.
* It supports multiple entries and a pick mode (always first / round-robin /
* random). The dialog edits a working copy and writes it to the settings only
* when accepted.
*/
class PlaymatCollectionDialog : public QDialog
{
Q_OBJECT
public:
explicit PlaymatCollectionDialog(QWidget *parent = nullptr);
void accept() override;
private slots:
void addPlaymat();
void editPlaymat();
void removePlaymat();
void movePlaymatUp();
void movePlaymatDown();
void selectionChanged();
private:
void setupUi();
void retranslateUi();
int currentRow() const;
QList<PlaymatInfo> playmats; ///< Working copy edited by the dialog.
QListWidget *playmatList;
QComboBox *modeCombo;
QLabel *modeLabel;
QPushButton *addButton;
QPushButton *editButton;
QPushButton *removeButton;
QPushButton *moveUpButton;
QPushButton *moveDownButton;
};
#endif // COCKATRICE_PLAYMAT_COLLECTION_DIALOG_H