diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-10-27 03:22:09 +0000 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-10-27 03:22:09 +0000 |
commit | 899f077abd2c582aba4e52814b858b75d0e5ea09 (patch) | |
tree | bd6838534c29dba5fbae90abe9f76bfe7264b1aa /qt-ui/subsurfacewebservices.h | |
parent | 6259b0301bbdf10c8337be35d440f6f1521ee2b0 (diff) | |
parent | a4da3004da2f5179e2e7cac46047eec39c7b6949 (diff) | |
download | subsurface-899f077abd2c582aba4e52814b858b75d0e5ea09.tar.gz |
Merge branch 'webservices' of github.com:tcanabrava/subsurface
Diffstat (limited to 'qt-ui/subsurfacewebservices.h')
-rw-r--r-- | qt-ui/subsurfacewebservices.h | 51 |
1 files changed, 41 insertions, 10 deletions
diff --git a/qt-ui/subsurfacewebservices.h b/qt-ui/subsurfacewebservices.h index 0719a8f15..515e3fe9c 100644 --- a/qt-ui/subsurfacewebservices.h +++ b/qt-ui/subsurfacewebservices.h @@ -5,33 +5,64 @@ #include <QNetworkReply> #include <libxml/tree.h> -#include "ui_subsurfacewebservices.h" +#include "ui_webservices.h" class QAbstractButton; class QNetworkReply; -class SubsurfaceWebServices : public QDialog { +class WebServices : public QDialog{ + Q_OBJECT +public: + explicit WebServices(QWidget* parent = 0, Qt::WindowFlags f = 0); + void hidePassword(); + void hideUpload(); + +private slots: + virtual void startDownload() = 0; + virtual void startUpload() = 0; + virtual void buttonClicked(QAbstractButton* button) = 0; + +protected: + Ui::WebServices ui; + QNetworkReply *reply; + QNetworkAccessManager *manager; + QByteArray downloadedData; +}; + +class SubsurfaceWebServices : public WebServices { Q_OBJECT public: static SubsurfaceWebServices* instance(); - void runDialog(); - + private slots: void startDownload(); void buttonClicked(QAbstractButton* button); void downloadFinished(); void downloadError(QNetworkReply::NetworkError error); - + void startUpload(){} /*no op*/ private: + explicit SubsurfaceWebServices(QWidget* parent = 0, Qt::WindowFlags f = 0); 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; +class DivelogsDeWebServices : public WebServices { + Q_OBJECT +public: + static DivelogsDeWebServices * instance(); + +private slots: + void startDownload(); + void buttonClicked(QAbstractButton* button); + void downloadFinished(); + void downloadError(QNetworkReply::NetworkError error); + void startUpload(); +private: + explicit DivelogsDeWebServices (QWidget* parent = 0, Qt::WindowFlags f = 0); + void setStatusText(int status); + void download_dialog_traverse_xml(xmlNodePtr node, unsigned int *download_status); + unsigned int download_dialog_parse_response(const QByteArray& length); }; #endif |