mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Support Mod/Admin Notes Section (#5361)
This commit is contained in:
parent
14807ba036
commit
1f58f7e93d
13 changed files with 175 additions and 3 deletions
|
|
@ -284,6 +284,32 @@ int BanDialog::getDeleteMessages() const
|
|||
return deleteMessages->isChecked() ? -1 : 0;
|
||||
}
|
||||
|
||||
AdminNotesDialog::AdminNotesDialog(const QString &_userName, const QString &_notes, QWidget *_parent)
|
||||
: QDialog(_parent), userName(_userName)
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
auto *updateButton = new QPushButton(tr("Update Notes"));
|
||||
updateButton->setEnabled(false);
|
||||
connect(updateButton, &QPushButton::clicked, this, &AdminNotesDialog::accept);
|
||||
|
||||
notes = new QPlainTextEdit(_notes);
|
||||
notes->setMinimumWidth(500);
|
||||
connect(notes, &QPlainTextEdit::textChanged, this, [=]() { updateButton->setEnabled(true); });
|
||||
|
||||
auto *vbox = new QVBoxLayout;
|
||||
vbox->addWidget(notes);
|
||||
vbox->addWidget(updateButton);
|
||||
|
||||
setLayout(vbox);
|
||||
setWindowTitle(tr("Admin Notes for %1").arg(_userName));
|
||||
}
|
||||
|
||||
QString AdminNotesDialog::getNotes() const
|
||||
{
|
||||
return notes->toPlainText();
|
||||
}
|
||||
|
||||
UserListItemDelegate::UserListItemDelegate(QObject *const parent) : QStyledItemDelegate(parent)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue