/
monitoring-center.h
56 lines (44 loc) · 1.11 KB
/
monitoring-center.h
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
55
56
#ifndef MONITORING_CENTER_H
#define MONITORING_CENTER_H
#include <QObject>
class DownloadQueue;
class Favorite;
class ImageDownloader;
class Monitor;
class Profile;
class QSystemTrayIcon;
class SearchQuery;
class MonitoringCenter : public QObject
{
Q_OBJECT
Q_ENUMS(LoadResult)
public:
enum MonitoringStatus
{
Waiting,
Checking,
Performing,
};
explicit MonitoringCenter(Profile *profile, DownloadQueue *downloadQueue, QSystemTrayIcon *trayIcon, QObject *parent = nullptr);
bool isRunning() const;
public slots:
void start();
void stop();
protected slots:
void tick();
void queueEmpty();
protected:
void checkMonitor(Monitor &monitor, const Favorite &favorite);
bool checkMonitor(Monitor &monitor, const SearchQuery &search, const QStringList &postFiltering);
void sync();
signals:
void statusChanged(const Monitor &monitor, MonitoringCenter::MonitoringStatus status);
private:
Profile *m_profile;
DownloadQueue *m_downloadQueue;
QSystemTrayIcon *m_trayIcon;
bool m_waitingForQueue = false;
bool m_changed = false;
bool m_stop = false;
};
#endif // MONITORING_CENTER_H