diff --git a/mainwindow.cpp b/mainwindow.cpp index 743a471..ed4d2f3 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -3,21 +3,22 @@ #include "worker.h" #include "utils.h" #include "progress_event.h" +#include "plugins/interfaces.h" #include #include #include #include -MainWindow::MainWindow(Worker *worker, QWidget *parent) +MainWindow::MainWindow(hwinf *hw, Worker *worker, QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) + , m_hw(hw) , m_worker(worker) , m_width(70) , m_progressRunning(false) , m_progressValue(0) { - this->setStatusBar(new QStatusBar(this)); QFont f; f.setStyleHint(QFont::Monospace); diff --git a/mainwindow.h b/mainwindow.h index e54b0fc..9d4e3cd 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -11,6 +11,7 @@ QT_END_NAMESPACE #include "worker.h" +class hwinf; class MainWindow : public QMainWindow { Q_OBJECT @@ -18,13 +19,15 @@ protected: void customEvent(QEvent *event) override; public: - MainWindow(Worker *worker, QWidget *parent = nullptr); + MainWindow(hwinf *hw, Worker *worker, QWidget *parent = nullptr); ~MainWindow(); static const int START_PROGRESS_LOOP = -1; static const int STOP_PROGRESS_LOOP = -2; int progressValue() const { return m_progressValue; } + hwinf *getPlugin() { return m_hw; } + hwinf const *getPlugin() const { return m_hw; } public slots: void onAppendText(QString, QString suffix = ""); @@ -43,6 +46,7 @@ private: void scrollDownTextEdit(); Ui::MainWindow *ui; + hwinf *m_hw; Worker *m_worker; int m_width; QTimer *m_startTimer;