Skip to content

Commit d614538

Browse files
committed
Start work on settings module
1 parent bfe26af commit d614538

File tree

4 files changed

+45
-1
lines changed

4 files changed

+45
-1
lines changed

SmartTimer/SmartTimer.pro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ HEADERS += \
4747
toggleswitch.h \
4848
alertwidget.h \
4949
addalarmdialog.h \
50-
changealarmdialog.h
50+
changealarmdialog.h \
51+
widgetsettings.h
5152

5253
FORMS += \
5354
mainwindow.ui \

SmartTimer/smarttimerlog.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "smarttimerlog.h"
22
#include "timerwidget.h"
3+
#include "widgetsettings.h"
34

45
#include <iostream>
56
#include <fstream>
@@ -8,6 +9,8 @@
89
#include <QUrl>
910
#include <QString>
1011

12+
#include <QJsonDocument>
13+
1114
smartTimerLog::smartTimerLog(QObject *parent) : QObject(parent)
1215
{
1316
this->par = parent;
@@ -66,6 +69,19 @@ void smartTimerLog::runLogger()
6669
}
6770

6871
logFile2.close();
72+
73+
74+
75+
QString alarms = "alarms.json";
76+
77+
78+
79+
80+
81+
82+
83+
84+
6985
}
7086

7187
void smartTimerLog::saveLog(QList<TimerWidget*> timers, QList<alertwidget*> alarms)

SmartTimer/smarttimerlog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "timerwidget.h"
55
#include "alertwidget.h"
6+
#include "widgetsettings.h"
67

78
#include <QObject>
89
#include <QString>

SmartTimer/widgetsettings.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#ifndef WIDGETSETTINGS_H
2+
#define WIDGETSETTINGS_H
3+
4+
#include <QString>
5+
#include <QTime>
6+
7+
8+
9+
class WidgetSettings
10+
{
11+
public:
12+
WidgetSettings (const QString &_name);
13+
14+
private:
15+
QString name;
16+
int msecs;
17+
18+
bool enabled; // Used for Alarms.
19+
bool days[7]; // Used to indicate if alsrm works on some days.
20+
21+
QString signalPath;
22+
23+
24+
};
25+
26+
#endif // WIDGETSETTINGS_H

0 commit comments

Comments
 (0)