-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathoptionsdialog.cpp
More file actions
45 lines (38 loc) · 1.49 KB
/
optionsdialog.cpp
File metadata and controls
45 lines (38 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "optionsdialog.h"
#include "ui_optionsdialog.h"
#include <QCheckBox>
#include <QComboBox>
#include <QSlider>
#include <QSpinBox>
OptionsDialog::OptionsDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::OptionsDialog),
mSettings("mq32.de", "versa-tile")
{
ui->setupUi(this);
this->mSettings.beginGroup("behaviour");
this->ui->cbEnableAutoGrid->setChecked(this->mSettings.value("autogrid", true).toBool());
this->ui->slAutoGridThreshold->setValue(this->mSettings.value("gridthresh", 50).toInt());
this->mSettings.endGroup();
this->mSettings.beginGroup("display");
this->ui->cbGroundMode->setCurrentIndex(this->mSettings.value("groundmode", 2).toInt());
this->ui->sbGroundSize->setValue(this->mSettings.value("groundsize", 10).toInt());
this->ui->cbShowCoordinateAxis->setChecked(this->mSettings.value("axis", false).toBool());
this->mSettings.endGroup();
}
OptionsDialog::~OptionsDialog()
{
delete ui;
}
void OptionsDialog::on_buttonBox_accepted()
{
this->mSettings.beginGroup("behaviour");
this->mSettings.setValue("autogrid", this->ui->cbEnableAutoGrid->isChecked());
this->mSettings.setValue("gridthresh", this->ui->slAutoGridThreshold->value());
this->mSettings.endGroup();
this->mSettings.beginGroup("display");
this->mSettings.setValue("groundmode", this->ui->cbGroundMode->currentIndex());
this->mSettings.setValue("groundsize", this->ui->sbGroundSize->value());
this->mSettings.setValue("axis", this->ui->cbShowCoordinateAxis->isChecked());
this->mSettings.endGroup();
}