Send custom event from worker(-thread) to MainWindow in order to update
progress bar.
This commit is contained in:
8
worker.h
8
worker.h
@@ -84,6 +84,7 @@ QString& operator<<(QString &str, UpdateStatus status);
|
||||
|
||||
#define ISMAS_UPDATE_REQUESTS (10)
|
||||
|
||||
class MainWindow;
|
||||
class hwinf;
|
||||
class Worker : public QObject {
|
||||
Q_OBJECT
|
||||
@@ -124,6 +125,8 @@ class Worker : public QObject {
|
||||
int m_displayIndex;
|
||||
int m_returnCode;
|
||||
|
||||
MainWindow *m_mainWindow;
|
||||
|
||||
bool executeOpkgCommand(QString opkgCommand);
|
||||
QString getOsVersion() const;
|
||||
QString getATBQTVersion() const;
|
||||
@@ -135,6 +138,8 @@ class Worker : public QObject {
|
||||
|
||||
qint64 getFileSize(QString const &fileName) const;
|
||||
|
||||
void setProgress(int progress);
|
||||
|
||||
public:
|
||||
static const QString UPDATE_STEP_OK;
|
||||
static const QString UPDATE_STEP_DONE;
|
||||
@@ -153,6 +158,8 @@ public:
|
||||
char const *baudrate = "115200");
|
||||
~Worker();
|
||||
|
||||
void setMainWindow(MainWindow *mainWindow) { m_mainWindow = mainWindow; }
|
||||
|
||||
IsmasClient &getIsmasClient() { return m_ismasClient; }
|
||||
IsmasClient const &getIsmasClient() const { return m_ismasClient; }
|
||||
|
||||
@@ -175,7 +182,6 @@ public:
|
||||
signals:
|
||||
void appendText(QString, QString);
|
||||
void showErrorMessage(QString title, QString description);
|
||||
void setProgress(quint8);
|
||||
void stopStartTimer();
|
||||
void restartExitTimer();
|
||||
void enableExit();
|
||||
|
Reference in New Issue
Block a user