-
Notifications
You must be signed in to change notification settings - Fork 0
/
settingsdialog.cpp
38 lines (32 loc) · 947 Bytes
/
settingsdialog.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
#include "settingsdialog.h"
#include "ui_settingsdialog.h"
SettingsDialog::SettingsDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::SettingsDialog)
{
ui->setupUi(this);
setupCheckboxesUsingSavedSettings();
}
SettingsDialog::~SettingsDialog()
{
delete ui;
}
void SettingsDialog::setupCheckboxesUsingSavedSettings(){
array<bool,4> boolSettings = settings -> loadSettings();
if(boolSettings[1]== true){
ui ->cbHideAbsPaths->setChecked(true);
}
if(boolSettings[2]== true){
ui ->cbHideIpAddresses->setChecked(true);
}
if(boolSettings[3]== true){
ui ->cbHideMac->setChecked(true);
}
}
void SettingsDialog::on_buttonBox_accepted()
{
bool hideAbsPaths = ui->cbHideAbsPaths -> isChecked();
bool hideIps = ui->cbHideIpAddresses ->isChecked();
bool hideMacs = ui -> cbHideMac -> isChecked();
settings -> saveSettings(true, hideAbsPaths, hideIps, hideMacs);
}