forked from Skarsnik/QUsb2snes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appui.h
77 lines (64 loc) · 2.19 KB
/
appui.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef APPUI_H
#define APPUI_H
#include "devices/luabridge.h"
#include "devices/snesclassicfactory.h"
#include "devices/sd2snesfactory.h"
#include "devices/retroarchfactory.h"
#include <QMenu>
#include <QObject>
#include <QSettings>
#include <QSystemTrayIcon>
class AppUi : public QObject
{
Q_OBJECT
public:
explicit AppUi(QObject *parent = nullptr);
void init();
QSystemTrayIcon* sysTray;
signals:
public slots:
private slots:
void onRetroarchTriggered(bool checked);
void onLuaBridgeTriggered(bool checked);
void onSNESClassicTriggered(bool checked);
void onMenuAboutToshow();
void onAppsMenuTriggered(QAction* action);
void onMagic2SnesMenuTriggered(QAction*action);
void addWindowsSendToEntry();
void onUntrustedConnection(QString origin);
private:
struct ApplicationInfo {
bool isQtApp;
QString name;
QString description;
QString icon;
QString folder;
QString executable;
ApplicationInfo() {
isQtApp = false;
}
friend QDebug operator<<(QDebug debug, const ApplicationInfo& req);
};
friend QDebug operator<<(QDebug debug, const AppUi::ApplicationInfo& req);
QMenu* menu;
QMenu* deviceMenu;
QMenu* appsMenu;
QMenu* magic2SnesMenu;
QMenu* miscMenu;
QString magic2SnesExe;
QAction* retroarchAction;
QAction* snesClassicAction;
QAction* luaBridgeAction;
LuaBridge* luaBridge;
SD2SnesFactory* sd2snesFactory;
RetroArchFactory* retroarchFactory;
SNESClassicFactory* snesClassic;
QMap<QString, ApplicationInfo> regularApps;
void checkForApplications();
void handleMagic2Snes(QString path);
void addMagic2SnesFolder(QString path);
void addDevicesInfo(DeviceFactory *devFact);
ApplicationInfo parseJsonAppInfo(QString fileName);
void checkForNewVersion(bool manual = false);
};
#endif // APPUI_H