blob: d187806d63c70904b31903b79cfe4c385ef7e7c0 (
plain) (
blame)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
#ifndef APP_H
#define APP_H
#include <QObject>
#include <QSystemTrayIcon>
#include <QAction>
#include <QQmlEngine>
#include <QQuickWindow>
#include "gnunet/gnunet.h"
#include "model/models.h"
#include "social/socialapp.h"
#include "settings/settings.h"
#include "util/helpers.h"
#include "util/qrimageprovider.h"
#define APP_NAME "secushare"
#define APP_VERSION "0.1"
#define URI APP_NAME
class App : public QObject
{
Q_OBJECT;
Q_PROPERTY (Models * models
READ models CONSTANT);
Q_PROPERTY (SocialApp * social
READ social CONSTANT);
Q_PROPERTY (Helpers * helpers
READ helpers CONSTANT);
Q_PROPERTY (QrImageProvider * qrProvider
READ qrProvider CONSTANT);
Q_PROPERTY (bool connected
READ isConnected
NOTIFY connectedChanged);
public:
explicit App (QObject *parent = 0);
~App ();
void registerQmlTypes ();
void registerImageProvider (QQmlEngine * engine);
Models *models () const
{
return m_models;
}
Helpers *helpers () const
{
return m_helpers;
}
QrImageProvider *qrProvider () const
{
return m_qrProvider;
}
SocialApp *social () const
{
return m_gnunet ? m_gnunet->social () : NULL;
}
void setupTray ();
Q_INVOKABLE void hide ();
Q_INVOKABLE void close ();
void setConnected (bool connected);
bool isConnected () const
{
return m_connected;
}
private:
Models * m_models;
Helpers *m_helpers;
GnuNet *m_gnunet;
QThread *m_gnunetThread;
SocialApp *m_social;
QrImageProvider *m_qrProvider;
QMenu *m_trayMenu;
QSystemTrayIcon *m_tray;
QAction *m_trayCloseAction;
// is the connection established to the GNUnet social service?
bool m_connected;
void
startGnuNet ();
signals:
void connectedChanged (bool connected);
public slots:
void trayActivated (QSystemTrayIcon::ActivationReason reason);
void setTrayMessage (QString place, QString message);
};
// externals visible to the whole application (globals)
extern App *theApp;
extern Settings *theSettings;
extern QQuickWindow *theWindow;
#endif
|