forked from HumanBrainProject/nutil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dialogsettings.cpp
38 lines (32 loc) · 921 Bytes
/
dialogsettings.cpp
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
#include "dialogsettings.h"
#include "ui_dialogsettings.h"
DialogSettings::DialogSettings(QWidget *parent, CIniFile* ini) :
QDialog(parent),
ui(new Ui::DialogSettings)
{
ui->setupUi(this);
m_settings = ini;
FromIni();
}
DialogSettings::~DialogSettings()
{
delete ui;
}
void DialogSettings::ToIni()
{
m_settings->setString("fill_method", ui->cmbFillMethod->currentText());
m_settings->setString("color_theme", ui->cmbThemes->currentText());
m_settings->setFloat("csv_separator", (ui->chkUSSep->isChecked()==true)?1:0);
}
void DialogSettings::FromIni()
{
ui->cmbFillMethod->setCurrentText(m_settings->getString("fill_method"));
ui->cmbThemes->setCurrentText(m_settings->getString("color_theme"));
ui->chkUSSep->setChecked(m_settings->getdouble("csv_separator")==1.0);
}
void DialogSettings::on_pushButton_clicked()
{
ToIni();
m_settings->Save();
close();
}