7#ifndef DECK_ZONE_DIALOG_H
8#define DECK_ZONE_DIALOG_H
13#include <qtmetamacros.h>
16class QDialogButtonBox;
44 const QString &initialBoardName = {},
45 const std::function<QString(
const QString &)> &_nameValidator = {},
46 bool _allowBoardSelection =
true);
78 const QString &initialBoardName,
79 QString *chosenBoardName,
80 const std::function<QString(
const QString &)> &
nameValidator = {});
95 const QString ¤tZoneName,
96 const std::function<QString(
const QString &)> &
nameValidator = {});
QComboBox * boardCombo
Definition deck_zone_dialog.h:117
void retranslateUi()
Sets every user-visible string. Runs on construction and on runtime language changes.
Definition deck_zone_dialog.cpp:96
static QString promptForNewZone(QWidget *parent, const QString &initialBoardName, QString *chosenBoardName, const std::function< QString(const QString &)> &nameValidator={})
Prompts the user for a new custom zone name and the board zone to nest it under.
Definition deck_zone_dialog.cpp:126
bool allowBoardSelection
Definition deck_zone_dialog.h:120
QString getBoardName() const
The internal name of the board zone selected in the combo.
Definition deck_zone_dialog.cpp:76
static QString promptForRename(QWidget *parent, const QString ¤tZoneName, const std::function< QString(const QString &)> &nameValidator={})
Prompts the user for a new name for an existing custom zone.
Definition deck_zone_dialog.cpp:142
void validateName()
Validates the current input, toggling Ok and the inline error label.
Definition deck_zone_dialog.cpp:111
QDialogButtonBox * buttonBox
Definition deck_zone_dialog.h:118
QString getZoneName() const
The trimmed zone name entered by the user.
Definition deck_zone_dialog.cpp:71
QLabel * nameLabel
Definition deck_zone_dialog.h:113
void setZoneName(const QString &zoneName)
Prefills the name field, e.g. with the current name when renaming.
Definition deck_zone_dialog.cpp:81
DeckZoneDialog(QWidget *parent=nullptr, const QString &initialBoardName={}, const std::function< QString(const QString &)> &_nameValidator={}, bool _allowBoardSelection=true)
Constructs the dialog and runs the initial validation pass.
Definition deck_zone_dialog.cpp:16
QLabel * errorLabel
Definition deck_zone_dialog.h:115
QLabel * boardLabel
Definition deck_zone_dialog.h:116
QLineEdit * nameEdit
Definition deck_zone_dialog.h:114
void changeEvent(QEvent *event) override
Definition deck_zone_dialog.cpp:87
std::function< QString(const QString &)> nameValidator
Definition deck_zone_dialog.h:119