2013-06-06 13:33:15 +00:00
|
|
|
#ifndef SUBSURFACEWEBSERVICES_H
|
|
|
|
#define SUBSURFACEWEBSERVICES_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QNetworkReply>
|
2013-06-06 14:31:55 +00:00
|
|
|
#include <libxml/tree.h>
|
2013-06-06 13:33:15 +00:00
|
|
|
|
|
|
|
namespace Ui{
|
|
|
|
class SubsurfaceWebServices;
|
|
|
|
};
|
|
|
|
class QAbstractButton;
|
|
|
|
class QNetworkReply;
|
|
|
|
|
|
|
|
class SubsurfaceWebServices : public QDialog {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
static SubsurfaceWebServices* instance();
|
|
|
|
void runDialog();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void startDownload();
|
|
|
|
void buttonClicked(QAbstractButton* button);
|
|
|
|
void downloadFinished();
|
|
|
|
void downloadError(QNetworkReply::NetworkError error);
|
|
|
|
|
|
|
|
private:
|
2013-06-06 14:31:55 +00:00
|
|
|
void setStatusText(int status);
|
|
|
|
void download_dialog_traverse_xml(xmlNodePtr node, unsigned int *download_status);
|
|
|
|
unsigned int download_dialog_parse_response(const QByteArray& length);
|
|
|
|
|
|
|
|
explicit SubsurfaceWebServices(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
|
|
|
Ui::SubsurfaceWebServices *ui;
|
2013-06-06 13:33:15 +00:00
|
|
|
QNetworkReply *reply;
|
2013-06-06 14:31:55 +00:00
|
|
|
QNetworkAccessManager *manager;
|
|
|
|
QByteArray downloadedData;
|
2013-06-06 13:33:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|