2023-04-18 14:14:46 +08:00
|
|
|
#ifndef WAITINGDLG_H
|
|
|
|
#define WAITINGDLG_H
|
|
|
|
|
|
|
|
#include "basedlg.h"
|
|
|
|
#include "base/customprogressindicator.h"
|
|
|
|
#include <QLabel>
|
2023-04-23 17:01:35 +08:00
|
|
|
#include <QNetworkReply>
|
2023-04-18 14:14:46 +08:00
|
|
|
|
|
|
|
class WaitingDlg : public BaseDlg {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit WaitingDlg(QWidget *parent = nullptr, QString text = 0, QString sucText = 0);
|
|
|
|
|
2023-04-23 17:01:35 +08:00
|
|
|
inline void connAbort(QNetworkReply *reply) {
|
|
|
|
connect(this, &WaitingDlg::rejected, reply, [reply] {
|
|
|
|
reply->blockSignals(true);
|
|
|
|
reply->abort();
|
|
|
|
reply->blockSignals(false);
|
|
|
|
reply->deleteLater();
|
|
|
|
});
|
|
|
|
}
|
2023-04-18 14:14:46 +08:00
|
|
|
QPushButton *btnAbort;
|
|
|
|
QLabel *fdText;
|
|
|
|
QString sucText;
|
|
|
|
CustomProgressIndicator *mIndicator;
|
|
|
|
public slots:
|
|
|
|
void success();
|
|
|
|
protected:
|
|
|
|
void timerEvent(QTimerEvent *) override;
|
|
|
|
private:
|
|
|
|
int closeTimerId{0};
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // WAITINGDLG_H
|