subsurface/qt-ui/subsurfacewebservices.h
Tomaz Canabrava f55ae15707 Hoocked up the buttons and the parsing of the XML.
The XML is now being correctly parsed, Clicking on Help
will open the browser pointing to the api site, and clicking
on cancel will cancel the download.

Clicking on Apply still doesn't apply, but that's next. :)

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-06 11:31:55 -03:00

38 lines
No EOL
926 B
C++

#ifndef SUBSURFACEWEBSERVICES_H
#define SUBSURFACEWEBSERVICES_H
#include <QDialog>
#include <QNetworkReply>
#include <libxml/tree.h>
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:
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;
QNetworkReply *reply;
QNetworkAccessManager *manager;
QByteArray downloadedData;
};
#endif