1
1
#include " globalsettingsdialog.h"
2
2
#include " ui_globalsettingsdialog.h"
3
- # include " rangewidget.h "
3
+
4
4
#include " widgetsettings.h"
5
5
6
6
#include < QFile>
@@ -52,6 +52,7 @@ GlobalSettingsDialog::GlobalSettingsDialog(GlobalSettings old, QWidget *parent)
52
52
connect (ui->cancelButton ,SIGNAL (clicked ()),this ,SLOT (canceled ()));
53
53
connect (ui->confirmButton ,SIGNAL (clicked ()),this , SLOT (confirmed ()));
54
54
connect ( ui->opacitySlider ,SIGNAL (valueChanged (int )),this ,SLOT (opacityChanged ()));
55
+ connect (ui->defaultButton ,SIGNAL (clicked ()),this , SLOT (restoreDefault ()));
55
56
56
57
}
57
58
@@ -91,10 +92,7 @@ void GlobalSettingsDialog::opacityChanged()
91
92
emit changeSettings (newSettings);
92
93
}
93
94
94
- void GlobalSettingsDialog::rangeChanged (int min, int max)
95
- {
96
- ui->RangeValue ->setText (QString::number (min)+" : " +QString::number (max));
97
- }
95
+
98
96
99
97
void GlobalSettingsDialog::DDenableState (bool state)
100
98
{
@@ -103,4 +101,29 @@ void GlobalSettingsDialog::DDenableState(bool state)
103
101
104
102
}
105
103
104
+ void GlobalSettingsDialog::restoreDefault ()
105
+ {
106
+ ui->DDenable ->setChecked (false );
107
+
108
+ ui->DDmin ->setEnabled (false );
109
+ ui->DDmax ->setEnabled (false );
110
+
111
+ ui->DDmin ->setTime (QTime::fromMSecsSinceStartOfDay (0 ));
112
+ ui->DDmax ->setTime (QTime::fromMSecsSinceStartOfDay (0 ));
113
+
114
+ ui->TimerFormat ->setText (" HH:mm:ss" );
115
+ ui->alarmFormat ->setText (" HH:mm" );
116
+
117
+ ui->opacitySlider ->setValue (100 );
118
+ ui->SliderValue ->setText (" 100%" );
119
+
120
+ int elpasedTimeMin = elpasedTime (ui->DDmin ->time ());
121
+ int elpasedTimeMax = elpasedTime (ui->DDmax ->time ());
122
+ GlobalSettings newSettings (ui->opacitySlider ->value ()/100.0 ,ui->alarmFormat ->text (), ui->TimerFormat ->text (),static_cast <bool >(ui->DDenable ->isChecked ()),elpasedTimeMin, elpasedTimeMax);
123
+
124
+ ui->SliderValue ->setText (QString::number (static_cast <int >(newSettings.windowOpacity *100 ))+" %" );
125
+
126
+ emit changeSettings (newSettings);
127
+ }
128
+
106
129
0 commit comments