2021-11-02 13:12:36 +08:00
|
|
|
#include "executorproblemsetwidget.h"
|
|
|
|
#include "ui_executorproblemsetwidget.h"
|
|
|
|
#include "../settings.h"
|
|
|
|
#include "../mainwindow.h"
|
|
|
|
|
|
|
|
ExecutorProblemSetWidget::ExecutorProblemSetWidget(const QString& name, const QString& group, QWidget *parent):
|
|
|
|
SettingsWidget(name,group,parent),
|
|
|
|
ui(new Ui::ExecutorProblemSetWidget)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
ExecutorProblemSetWidget::~ExecutorProblemSetWidget()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ExecutorProblemSetWidget::doLoad()
|
|
|
|
{
|
|
|
|
ui->grpProblemSet->setChecked(pSettings->executor().enableProblemSet());
|
|
|
|
ui->grpCompetitiveCompanion->setChecked(pSettings->executor().enableCompetitiveCompanion());
|
|
|
|
ui->spinPortNumber->setValue(pSettings->executor().competivieCompanionPort());
|
2021-11-27 15:43:47 +08:00
|
|
|
ui->chkIgnoreSpacesWhenValidatingCases->setChecked(pSettings->executor().ignoreSpacesWhenValidatingCases());
|
2021-11-02 13:12:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void ExecutorProblemSetWidget::doSave()
|
|
|
|
{
|
|
|
|
pSettings->executor().setEnableProblemSet(ui->grpProblemSet->isChecked());
|
|
|
|
pSettings->executor().setEnableCompetitiveCompanion(ui->grpCompetitiveCompanion->isChecked());
|
|
|
|
pSettings->executor().setCompetivieCompanionPort(ui->spinPortNumber->value());
|
2021-11-27 15:43:47 +08:00
|
|
|
pSettings->executor().setIgnoreSpacesWhenValidatingCases(ui->chkIgnoreSpacesWhenValidatingCases->isChecked());
|
2021-11-02 13:12:36 +08:00
|
|
|
pSettings->executor().save();
|
|
|
|
pMainWindow->applySettings();
|
|
|
|
}
|