iCub-main
settingsdialog.cpp
Go to the documentation of this file.
1 /*
2  * settingsdialog.cpp
3  */
4 
5 /*
6  * Copyright (C) 2009 RobotCub Consortium
7  * Copyright (c) 2014 iCub Facility - Istituto Italiano di Tecnologia
8  * Authors: Alessandro Scalzo <alessandro.scalzo@iit.it>
9  * Davide Perrone <dperrone@aitek.it>
10  * CopyPolicy: Released under the terms of the GNU GPL v2.0.
11  *
12  * Based on:
13  *
14  * Qavimator
15  * Copyright (C) 2006 by Zi Ree *
16  * Zi Ree @ SecondLife *
17  * Released under the terms of the GNU GPL v2.0.
18  */
19 
20 
21 #include "settingsdialog.h"
22 #include "ui_settingsdialog.h"
23 #include "settings.h"
24 
26  QDialog(parent),
27  ui(new Ui::SettingsDialog)
28 {
29  ui->setupUi(this);
30  ui->fogCheck->setChecked(Settings::fog());
31  ui->spinBox->setValue(Settings::floorTranslucency());
32 }
33 
35 {
36  delete ui;
37 }
38 
39 void SettingsDialog::on_btnApply_clicked()
40 {
41  Settings::setFog(ui->fogCheck->isChecked());
42  Settings::setFloorTranslucency(ui->spinBox->value());
43  configChanged();
44  //qApp->processEvents();
45 }
46 
47 void SettingsDialog::on_btnCancel_clicked()
48 {
49  reject();
50 }
51 
52 void SettingsDialog::on_btnOk_clicked()
53 {
54  on_btnApply_clicked();
55  accept();
56 }
SettingsDialog(QWidget *parent=0)
void configChanged()
static void setFog(bool on)
Definition: settings.cpp:38
static void setFloorTranslucency(int value)
Definition: settings.cpp:48
static bool fog()
Definition: settings.cpp:43
static int floorTranslucency()
Definition: settings.cpp:53