-
Notifications
You must be signed in to change notification settings - Fork 60
/
mainwindow.h
80 lines (66 loc) · 1.88 KB
/
mainwindow.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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#define VERSION "0.6.1"
#define APP_NAME "MBPMid2010-GPU-Fix"
#include <QMainWindow>
//#include <QWidget>
#include <QMessageBox>
#include <QHBoxLayout>
#include <QFile>
#include <QTextStream>
#include <QApplication>
#include <QProcess>
#include <iostream>
#include <QDir>
#include <QDebug>
#include <QDirIterator>
#include <QStack>
#include <QFileDialog>
#include <QSettings>
#include <QList>
#include <QtXml>
#include <QDesktopServices>
#include <QLibrary>
#include <QInputDialog>
#include <QLabel>
#include <QPixmap>
#include <QSysInfo>
#include "logger.h"
using namespace std; // Indique quel espace de noms on va utiliser
//GoogleC++ Style Guide : https://google.github.io/styleguide/cppguide.html
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
bool init();
private slots:
void on_patchButton_clicked();
void on_restoreButton_clicked();
void on_gitHubButton_clicked();
void on_versionButton_clicked();
void on_pushButton_clicked();
void exit();
private:
Ui::MainWindow *ui;
QFile kernelFile;
Logger *logger;
QString password;
QString getMBPModelVersion(void);
bool isCompatibleVersion(QString modelVersion);
bool searchKernelExtensionFile(QFile* kernelExtensionFile);
void backupOldKernelExtension(void);
bool patchKernelExtensionFile(QFile* kernelFile);
int loadKernelExtension(QFile* kernelFile);
int restoreOldKernelExtension(QFile* kernelFile);
QDomElement findElementChild(QDomElement parent, const QString &textToFind);
QDomElement findElementSibling(QDomElement parent, const QString &textToFind);
bool isSIPEnabled(void);
int disableKextSigning(void);
int executeProcess(QProcess* process,QString command,QStringList arguments);
};
#endif // MAINWINDOW_H