@@ -37,8 +37,8 @@ MainWindow::MainWindow(QWidget *parent) :
3737 connect (ui->addAlarmButton ,SIGNAL (clicked ()),this ,SLOT (addAlarm ()));
3838 connect (ui->settingsButton ,SIGNAL (clicked ()),this ,SLOT (changeSettings ()));
3939
40- connect (logger, SIGNAL (createTimer (int ,QString )), this , SLOT (onTimeRecieved (int ,QString )));
41- connect (logger, SIGNAL (createAlarm (int ,QString, bool )), this , SLOT (onAlarmTimeRecieved (int ,QString, bool )));
40+ connect (logger, SIGNAL (createTimer (WidgetSettings )), this , SLOT (onTimeRecieved (WidgetSettings )));
41+ connect (logger, SIGNAL (createAlarm (WidgetSettings )), this , SLOT (onAlarmTimeRecieved (WidgetSettings )));
4242 connect (logger, SIGNAL (createSettings (GlobalSettings)), this , SLOT (onSettingsRecieved (GlobalSettings)));
4343
4444
@@ -75,7 +75,7 @@ MainWindow::~MainWindow()
7575void MainWindow::addTimer ()
7676{
7777 auto *addDial = new addTimerDialog (this );
78- connect (addDial,SIGNAL (sendTimerData (int ,QString )),this , SLOT (onTimeRecieved (int ,QString )));
78+ connect (addDial,SIGNAL (sendTimerData (WidgetSettings )),this , SLOT (onTimeRecieved (WidgetSettings )));
7979
8080
8181 addDial->exec ();
@@ -84,7 +84,7 @@ void MainWindow::addTimer()
8484void MainWindow::addAlarm ()
8585{
8686 auto *addDial = new addAlarmDialog (this );
87- connect (addDial,SIGNAL (sendAlarmData (int ,QString, bool )),this , SLOT (onAlarmTimeRecieved (int ,QString, bool )));
87+ connect (addDial,SIGNAL (sendAlarmData (WidgetSettings )),this , SLOT (onAlarmTimeRecieved (WidgetSettings )));
8888
8989 addDial->exec ();
9090}
@@ -99,9 +99,9 @@ void MainWindow::changeSettings()
9999
100100}
101101
102- void MainWindow::onTimeRecieved (int msecs, const QString& _name )
102+ void MainWindow::onTimeRecieved (WidgetSettings settings )
103103{
104- auto *newTimer = new TimerWidget (msecs, _name , this );
104+ auto *newTimer = new TimerWidget (WidgetSettings (settings. msecs , settings. name ) , this );
105105
106106 timerScrollWidget->layout ()->addWidget (newTimer);
107107
@@ -138,9 +138,9 @@ void MainWindow::onTimerFinished()
138138#endif
139139}
140140
141- void MainWindow::onAlarmTimeRecieved (int msecs, const QString& _name, bool turnedOn )
141+ void MainWindow::onAlarmTimeRecieved (WidgetSettings settings )
142142{
143- auto *newAlarm = new alertwidget (msecs, _name, turnedOn , this );
143+ auto *newAlarm = new alertwidget (settings , this );
144144
145145 alarmScrollWidget->layout ()->addWidget (newAlarm);
146146
0 commit comments