-
Notifications
You must be signed in to change notification settings - Fork 0
/
emudiscer.h
87 lines (69 loc) · 2.43 KB
/
emudiscer.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
78
79
80
81
82
83
84
85
86
87
#ifndef EMUDISCER_H
#define EMUDISCER_H
#include <QtWidgets/QDialog>
#include <qsystemtrayicon.h>
#include <qmenu.h>
#include <QFileSystemWatcher>
#include <QAbstractNativeEventFilter>
#include <QTemporaryDir>
#include <QSessionManager>
#include <QTimer>
#include <QSharedMemory>
#include "ui_emudiscer.h"
#include "MiIni.h"
struct SharedMemData
{
bool raiseWindow;
};
class EmuDiscer : public QDialog
{
Q_OBJECT
public:
EmuDiscer(QSharedMemory* sharedMem, QWidget *parent = 0);
~EmuDiscer();
private:
Ui::EmuDiscerClass ui;
WMiIni mConfig;
QMenu* mSysTrayMenu;
QMenu* mMacrosMenu;
QSystemTrayIcon* mSysTrayIcon;
QTemporaryDir mTempDir;
QSharedMemory* mSharedMem;
QString mLastEmulatorType;
QPalette mLineeditDefaultPalette;
std::wstring mSelectedEmulator;
QStringList mMediaDirectories;
QStringList mPartitions;
void closeEvent(QCloseEvent *event);
bool nativeEvent(const QByteArray & eventType, void * message, long *result);
/**
* @param directory The directory of the disc files
* @param drive The drive letter (Win) or device file (unix)
* @param header The first bytes of the inserted drive
* @param headerSize The number of bytes read and stored in header
*/
bool insertedMediaDir(QString directory, QString drive);
bool insertedMediaRaw(QString drive, const char *header, size_t headerSize);
bool tryLaunchEmu(QString emulatorType, QString mediaType, const std::map<std::wstring, std::wstring>& vars);
void emulatorChanged();
void enableDefaultOptions();
private slots:
void on_trayIconActivated(QSystemTrayIcon::ActivationReason reason);
void on_notificationClicked();
void on_mediaDirChanged(const QString &path);
void on_partitionChanged(QString drive);
void on_driveMounted(QString drive, QString mountDir);
void on_timer();
void on_autoRunCheckbox_stateChanged(int state);
void on_notificationsCheckbox_stateChanged(int state);
void on_emulatorsTabWidget_currentChanged(int index);
void on_pathEdit_textChanged();
void on_pathButton_clicked();
void on_appsButton_clicked();
void on_macrosButton_clicked();
void on_optionsEdit_textChanged();
void on_saveStateRequest(QSessionManager &manager);
void optionCheckbox_triggered(int state);
};
bool checkIfPathOk(QLineEdit* lne, const QPalette& defaultPalette);
#endif // EMUDISCER_H