-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkernel.h
57 lines (53 loc) · 1.24 KB
/
kernel.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
#ifndef KERNEL_H
#define KERNEL_H
#include <QObject>
#include <QDebug>
#include <QAction>
#include <QSharedMemory>
#include <QMessageBox>
#include <QProcess>
#include <QDesktopServices>
#include <QNetworkConfigurationManager>
#include <QNetworkSession>
#include <QUrl>
#include <QTimer>
#include <QtConcurrent>
#include <QFuture>
#include "settings.h"
#include <memory.h>
class Kernel : public QObject
{
Q_OBJECT
public:
explicit Kernel(QObject *parent = nullptr);
bool isMount();
signals:
void launchSettings();
void showMount();
void showUnmount();
void isUpFinished();
public slots:
void Mount();
bool Unmount(bool silent=false);
void OpenFinder();
void Settings();
void Quit()__attribute__((noreturn));
void onNetworkStateChanged(QNetworkSession::State state);
void preBoot();
void postBoot();
void Shutdown();
void Reboot();
void Shell();
void checkDevice();
private:
bool isUp();
void executeInTerminal(QString command);
void readSettings();
QStringList getCommandArgs();
mSettings settings;
QNetworkConfigurationManager manager;
QNetworkConfiguration cfg;
std::unique_ptr<QNetworkSession> session;
QFuture<bool> isUpFuture;
};
#endif // KERNEL_H