-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaMAssistant.cpp
33 lines (28 loc) · 890 Bytes
/
maMAssistant.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
#include "maMAssistant.h"
#include "maTimedReminder.h"
#include "maMainWindow.h"
#include "maTrayIcon.h"
const QString thought = QObject::tr("Those who can show the idea in my mind, are emerging from the heart.");
CMAssistant::CMAssistant(CTrayIcon& traIcon, CMainWindow& window, QObject* parent) :
QObject(parent),
m_trayIcon(traIcon),
m_mainWindow(window)
{
CTimedReminder* reminder = new CTimedReminder(this);
connect(reminder, SIGNAL(timeToRemid(QString)), &m_trayIcon, SLOT(on_message_remind(QString)));
m_timedReminders.append(reminder);
reminder->startReminder(20 * 60, 20, thought);
}
CMAssistant::~CMAssistant()
{
foreach (CTimedReminder* reminder, m_timedReminders) {
reminder->stop();
reminder->deleteLater();
}
// QThread thread;
// thread.msleep(500);
}
void CMAssistant::showTrayIcon()
{
m_trayIcon.show();
}