2021-08-30 17:10:46 +08:00
|
|
|
#include "editormiscwidget.h"
|
|
|
|
#include "ui_editormiscwidget.h"
|
2021-08-30 18:07:55 +08:00
|
|
|
#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()
|
|
|
|
{
|
2021-08-30 18:36:44 +08:00
|
|
|
ui->chkReadonlySystemHeaders->setChecked(pSettings->editor().readOnlySytemHeader());
|
|
|
|
ui->chkLoadLastFiles->setChecked(pSettings->editor().autoLoadLastFiles());
|
2021-08-30 23:05:08 +08:00
|
|
|
if (pSettings->editor().defaultFileCpp()) {
|
|
|
|
ui->rbCppFile->setChecked(true);
|
|
|
|
} else {
|
|
|
|
ui->rbCFile->setChecked(true);
|
|
|
|
}
|
2021-08-30 17:10:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void EditorMiscWidget::doSave()
|
|
|
|
{
|
2021-08-30 18:36:44 +08:00
|
|
|
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();
|
|
|
|
}
|