mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 00:54:53 -07:00
Added confirmation dialogue when set added.
This commit is contained in:
parent
c914395236
commit
54a759497f
4 changed files with 61 additions and 0 deletions
39
cockatrice/src/dlg_add_set.cpp
Normal file
39
cockatrice/src/dlg_add_set.cpp
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#include "dlg_add_set.h"
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
DlgAddSet::DlgAddSet(QWidget *parent, bool success) : QDialog(parent) {
|
||||
status = new QLabel(this);
|
||||
restart = new QLabel(this);
|
||||
|
||||
if (success) {
|
||||
setWindowTitle(tr("Success"));
|
||||
status->setText(QString("Set added to Cockatrice."));
|
||||
restart->setText(QString("You must restart to use your new set."));
|
||||
}
|
||||
else {
|
||||
setWindowTitle(tr("Failed"));
|
||||
status->setText(QString("Set failed to import."));
|
||||
}
|
||||
|
||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
|
||||
ok = new QPushButton(tr("Ok"), this);
|
||||
buttonBox->addButton(ok, QDialogButtonBox::AcceptRole);
|
||||
connect(ok, SIGNAL(clicked()), this, SLOT(closeDialog()));
|
||||
|
||||
QVBoxLayout *parentLayout = new QVBoxLayout(this);
|
||||
parentLayout->addWidget(status);
|
||||
parentLayout->addWidget(restart);
|
||||
parentLayout->addWidget(buttonBox);
|
||||
|
||||
setLayout(parentLayout);
|
||||
|
||||
exec();
|
||||
}
|
||||
|
||||
void DlgAddSet::closeDialog()
|
||||
{
|
||||
accept();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue