RedPanda-CPP/RedPandaIDE/settingsdialog/editormiscwidget.cpp

36 lines
1.0 KiB
C++
Raw Normal View History

2021-08-30 17:10:46 +08:00
#include "editormiscwidget.h"
#include "ui_editormiscwidget.h"
#include "../settings.h"
2021-08-30 17:10:46 +08:00
EditorMiscWidget::EditorMiscWidget(const QString& name, const QString& group,
QWidget *parent) :
SettingsWidget(name,group,parent),
ui(new Ui::EditorMiscWidget)
{
ui->setupUi(this);
}
EditorMiscWidget::~EditorMiscWidget()
{
delete ui;
}
void EditorMiscWidget::doLoad()
{
ui->chkReadonlySystemHeaders->setChecked(pSettings->editor().readOnlySytemHeader());
ui->chkLoadLastFiles->setChecked(pSettings->editor().autoLoadLastFiles());
if (pSettings->editor().defaultFileCpp()) {
ui->rbCppFile->setChecked(true);
} else {
ui->rbCFile->setChecked(true);
}
2021-08-30 17:10:46 +08:00
}
void EditorMiscWidget::doSave()
{
pSettings->editor().setReadOnlySytemHeader(ui->chkReadonlySystemHeaders->isChecked());
pSettings->editor().setAutoLoadLastFiles(ui->chkLoadLastFiles->isChecked());
pSettings->editor().setDefaultFileCpp(ui->rbCppFile->isChecked());
2021-08-30 17:10:46 +08:00
pSettings->editor().save();
}