| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#ifndef QTBASEINSTALLER_H |
| 6 |
#define QTBASEINSTALLER_H |
| 7 |
|
| 8 |
#include "../util/sevenzip.h" |
| 9 |
#include "../backend/bmhandler.h" |
| 10 |
|
| 11 |
#include <QObject> |
| 12 |
|
| 13 |
enum ProgressStatus |
| 14 |
{ |
| 15 |
CHECKSPACE, |
| 16 |
CHECKINTEGRITY, |
| 17 |
FORMATUSB, |
| 18 |
INSTALLBOOTLOADER, |
| 19 |
GETINSTALLDIR, |
| 20 |
EXTRACTISO, |
| 21 |
SYNCIO, |
| 22 |
EJECTDISK, |
| 23 |
FINISHED |
| 24 |
}; |
| 25 |
|
| 26 |
class QtBaseInstaller : public QObject |
| 27 |
{ |
| 28 |
Q_OBJECT |
| 29 |
public: |
| 30 |
explicit QtBaseInstaller(QObject *parent = nullptr); |
| 31 |
virtual ~QtBaseInstaller() { |
| 32 |
|
| 33 |
} |
| 34 |
|
| 35 |
public: |
| 36 |
void setformat(bool); |
| 37 |
void setPartionName(const QString&); |
| 38 |
void setImage(const QString&); |
| 39 |
void beginInstall(); |
| 40 |
void checkError(); |
| 41 |
bool isRunning() const; |
| 42 |
void stopInstall(); |
| 43 |
bool checkISOIntegrity(); |
| 44 |
|
| 45 |
protected: |
| 46 |
virtual bool umountPartion(); |
| 47 |
virtual bool umountDisk(); |
| 48 |
virtual QString getMountPoint(); |
| 49 |
virtual bool ejectDisk(); |
| 50 |
virtual bool installBootload(); |
| 51 |
|
| 52 |
private: |
| 53 |
bool hasEnoughSpace(); |
| 54 |
bool formatUsb(); |
| 55 |
bool extractISO(); |
| 56 |
bool syncIO(); |
| 57 |
bool configSyslinux(); |
| 58 |
bool needAddRepo(); |
| 59 |
void modifyBootGrubFile(QString grub_file_name); |
| 60 |
|
| 61 |
signals: |
| 62 |
void progressfinished(ProgressStatus status, BMHandler::ErrorType error); |
| 63 |
void reportProgress(int current, const QString &title, const QString &description); |
| 64 |
void reportextractProgress(int, int, const QString &); |
| 65 |
|
| 66 |
public slots: |
| 67 |
|
| 68 |
public: |
| 69 |
SevenZip m_sevenZipCheck; |
| 70 |
|
| 71 |
protected: |
| 72 |
bool m_bFormat; |
| 73 |
bool m_bRunning; |
| 74 |
bool m_bStop; |
| 75 |
QString m_strPartionName; |
| 76 |
QString m_strImage; |
| 77 |
ProgressStatus m_progressStatus; |
| 78 |
BMHandler::ErrorType m_progressError; |
| 79 |
}; |
| 80 |
|
| 81 |
#endif |