2023-07-31 16:55:36 +02:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
2023-08-02 15:29:10 +02:00
|
|
|
#include <QTimer>
|
2023-07-31 16:55:36 +02:00
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
namespace Ui { class MainWindow; }
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
2023-08-02 15:29:10 +02:00
|
|
|
#include "worker.h"
|
|
|
|
|
2023-07-31 16:55:36 +02:00
|
|
|
class MainWindow : public QMainWindow {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2023-08-05 18:50:50 +02:00
|
|
|
protected:
|
|
|
|
void customEvent(QEvent *event) override;
|
|
|
|
|
2023-07-31 16:55:36 +02:00
|
|
|
public:
|
|
|
|
MainWindow(Worker *worker, QWidget *parent = nullptr);
|
|
|
|
~MainWindow();
|
|
|
|
|
2023-08-06 20:44:26 +02:00
|
|
|
static const int START_PROGRESS_LOOP = -1;
|
|
|
|
static const int STOP_PROGRESS_LOOP = -2;
|
|
|
|
|
|
|
|
int progressValue() const { return m_progressValue; }
|
|
|
|
|
2023-08-02 15:29:10 +02:00
|
|
|
public slots:
|
2023-08-06 14:14:47 +02:00
|
|
|
void onAppendText(QString, QString suffix = "");
|
2023-08-18 11:48:29 +02:00
|
|
|
void onReplaceLast(QStringList, QString suffix = "");
|
2023-08-07 13:53:48 +02:00
|
|
|
void onReplaceLast(QString, QString suffix = "");
|
2023-08-02 15:29:10 +02:00
|
|
|
void onShowErrorMessage(QString, QString);
|
|
|
|
void onStopStartTimer();
|
|
|
|
void onRestartExitTimer();
|
2023-08-02 17:51:35 +02:00
|
|
|
void onEnableExit();
|
|
|
|
void onDisableExit();
|
2023-08-02 15:29:10 +02:00
|
|
|
|
2023-07-31 16:55:36 +02:00
|
|
|
private slots:
|
2023-08-02 15:29:10 +02:00
|
|
|
void onQuit();
|
2023-07-31 16:55:36 +02:00
|
|
|
|
|
|
|
private:
|
2023-08-18 11:46:57 +02:00
|
|
|
void scrollDownTextEdit();
|
|
|
|
|
2023-07-31 16:55:36 +02:00
|
|
|
Ui::MainWindow *ui;
|
|
|
|
Worker *m_worker;
|
2023-08-02 15:29:10 +02:00
|
|
|
int m_width;
|
|
|
|
QTimer *m_startTimer;
|
|
|
|
QTimer *m_exitTimer;
|
2023-08-06 20:44:26 +02:00
|
|
|
bool m_progressRunning;
|
|
|
|
int m_progressValue;
|
2023-07-31 16:55:36 +02:00
|
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|