-
Notifications
You must be signed in to change notification settings - Fork 8
/
schedulemodel.cpp
54 lines (48 loc) · 1.32 KB
/
schedulemodel.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "schedulemodel.h"
#include <QDateTime>
#include <QTime>
#include <QString>
ScheduleModel::ScheduleModel(QObject *parent) :
QObject(parent)
{
this->isMonEnabled = false;
this->isTueEnabled = false;
this->isWedEnabled = false;
this->isThurEnabled = false;
this->isFriEnabled = false;
this->isSatEnabled = false;
this->isSunEnabled = false;
this->isCustomAlarmEnabled = false;
this->AlarmTime = QTime::fromMSecsSinceStartOfDay(0);
this->CustomAlarm=QDate::currentDate();
this->CustomSoundPath = "";
this->isCustomSoundEnabled = false;
this->isBastard = false;
this->isOneshot = false;
}
QString ScheduleModel::Name()
{
QString name;
name=this->AlarmTime.toString()+" ";
if(this->isMonEnabled)
name.append(" M");
if(this->isTueEnabled)
name.append(" T");
if(this->isWedEnabled)
name.append(" W");
if(this->isThurEnabled)
name.append(" Th");
if(this->isFriEnabled)
name.append(" F");
if(this->isSatEnabled)
name.append(" Sat");
if(this->isSunEnabled)
name.append(" Sun");
if(this->isCustomAlarmEnabled)
name.append(" "+this->CustomAlarm.toString());
if(this->isBastard)
name.append(" Σ");
if(this->isOneshot)
name.append("💣");
return name;
}