2017-09-19 04:46:49 +00:00
|
|
|
#ifndef TASKTASIX_H
|
|
|
|
#define TASKTASIX_H
|
|
|
|
|
2017-09-21 13:24:45 +00:00
|
|
|
#include "taskworker.h"
|
2017-09-19 08:35:43 +00:00
|
|
|
|
2017-10-25 12:39:01 +00:00
|
|
|
class NetDownloader;
|
2017-09-19 04:46:49 +00:00
|
|
|
|
2017-09-21 13:24:45 +00:00
|
|
|
class TaskTasix : public TaskWorker
|
2017-09-19 04:46:49 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-09-21 13:24:45 +00:00
|
|
|
explicit TaskTasix(QObject *parent = nullptr);
|
2017-09-19 04:46:49 +00:00
|
|
|
|
2017-10-25 12:39:01 +00:00
|
|
|
NetDownloader *downloader() const { return m_downloader; }
|
2017-10-25 09:51:35 +00:00
|
|
|
|
2017-10-25 12:39:01 +00:00
|
|
|
static QStringList parseTasixBuffer(const QByteArray &buffer);
|
2017-10-25 09:51:35 +00:00
|
|
|
|
|
|
|
protected:
|
2017-10-25 12:39:01 +00:00
|
|
|
virtual void setupDownloader() const;
|
2017-10-25 09:51:35 +00:00
|
|
|
|
2017-10-25 12:39:01 +00:00
|
|
|
QString parseBuffer(const QByteArray &buffer) const;
|
|
|
|
|
|
|
|
virtual QStringList parseCustomBuffer(const QByteArray &buffer) const {
|
2017-10-25 09:55:42 +00:00
|
|
|
return parseTasixBuffer(buffer);
|
2017-10-25 09:51:35 +00:00
|
|
|
}
|
2017-09-19 04:46:49 +00:00
|
|
|
|
2017-10-25 12:39:01 +00:00
|
|
|
virtual QString successMessage() const {
|
|
|
|
return tr("TAS-IX addresses updated!");
|
|
|
|
}
|
|
|
|
|
2017-09-19 04:46:49 +00:00
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
2017-09-19 08:35:43 +00:00
|
|
|
void run() override;
|
2017-09-21 13:24:45 +00:00
|
|
|
void cancel(bool success = false) override;
|
|
|
|
|
|
|
|
bool processResult(FortManager *fortManager) override;
|
2017-09-19 04:46:49 +00:00
|
|
|
|
|
|
|
private slots:
|
2017-10-25 09:51:35 +00:00
|
|
|
void downloadFinished(bool success);
|
2017-09-19 04:46:49 +00:00
|
|
|
|
|
|
|
private:
|
2017-10-25 12:39:01 +00:00
|
|
|
NetDownloader *m_downloader;
|
2017-09-19 04:46:49 +00:00
|
|
|
|
2017-10-03 09:29:54 +00:00
|
|
|
QString m_rangeText;
|
2017-09-19 04:46:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TASKTASIX_H
|