45 lines
1.0 KiB
C++
45 lines
1.0 KiB
C++
#include "stagesettings.h"
|
|
#include "ui_stagesettings.h"
|
|
|
|
StageSettings::StageSettings(QWidget *parent) : QWidget(parent), ui(new Ui::StageSettings) {
|
|
ui->setupUi(this);
|
|
setMinimumSize(ui->gridLayout->minimumSize());
|
|
}
|
|
|
|
StageSettings::~StageSettings() {
|
|
delete ui;
|
|
}
|
|
|
|
QString StageSettings::getName() const {
|
|
return ui->groupBox->title();
|
|
}
|
|
|
|
void StageSettings::setName(const QString& n) {
|
|
ui->groupBox->setTitle(n);
|
|
ui->checkBox->setText(tr("Enable %1").arg(n));
|
|
}
|
|
|
|
bool StageSettings::getState() const {
|
|
return ui->checkBox->checkState() == Qt::CheckState::Checked;
|
|
}
|
|
|
|
void StageSettings::setState(bool b) {
|
|
ui->checkBox->setCheckState(b ? Qt::CheckState::Checked : Qt::CheckState::Unchecked);
|
|
}
|
|
|
|
QString StageSettings::getChampion() const {
|
|
return ui->lineEdit->text();
|
|
}
|
|
|
|
void StageSettings::setChampion(const QString& str) {
|
|
ui->lineEdit->setText(str);
|
|
}
|
|
|
|
void StageSettings::championChangedinternal(const QString& str) {
|
|
emit championChanged(str);
|
|
}
|
|
|
|
void StageSettings::toggledinternal(int state) {
|
|
emit toggled(state == Qt::CheckState::Checked);
|
|
}
|