diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-09-10 12:07:34 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-09-10 12:07:34 -0700 |
commit | 636477becc3d8bea147382a7fec13d53c0e04433 (patch) | |
tree | e7a714d5da006021f3a633c09153faec2c04851f /qt-ui/downloadfromdivecomputer.h | |
parent | e7fd45c7efe8dcb2c38bd518e02e20bfb8898c86 (diff) | |
parent | 3f8e183008530fb8e110b77d04cf794c46ba4720 (diff) | |
download | subsurface-636477becc3d8bea147382a7fec13d53c0e04433.tar.gz |
Merge branch 'downloaddialog' of github.com:danilocesar/subsurface
Diffstat (limited to 'qt-ui/downloadfromdivecomputer.h')
-rw-r--r-- | qt-ui/downloadfromdivecomputer.h | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/qt-ui/downloadfromdivecomputer.h b/qt-ui/downloadfromdivecomputer.h index 26216c1e0..e10d61b38 100644 --- a/qt-ui/downloadfromdivecomputer.h +++ b/qt-ui/downloadfromdivecomputer.h @@ -15,20 +15,10 @@ struct device_data_t; class DownloadThread : public QThread{ Q_OBJECT public: - explicit DownloadThread(device_data_t* data); - virtual void run(); -private: - device_data_t *data; -}; - -class InterfaceThread : public QThread{ - Q_OBJECT -public: - InterfaceThread(QObject *parent, device_data_t *data); + DownloadThread(QObject* parent, device_data_t* data); virtual void run(); -signals: - void updateInterface(int value); + QString error; private: device_data_t *data; }; @@ -41,19 +31,30 @@ public: static DownloadFromDCWidget *instance(); void reject(); + enum states { + INITIAL, + DOWNLOADING, + CANCELLING, + CANCELLED, + ERROR, + DONE, + }; + public slots: void on_ok_clicked(); void on_cancel_clicked(); - void runDialog(); - void stoppedDownloading(); void on_vendor_currentIndexChanged(const QString& vendor); + void onDownloadThreadFinished(); + void updateProgressBar(); + void runDialog(); + private: - void markChildrenAsDisabled(); - void markChildrenAsEnabled(); + void markChildrenAsDisabled(); + void markChildrenAsEnabled(); Ui::DownloadFromDiveComputer *ui; - InterfaceThread *thread; + DownloadThread *thread; bool downloading; QStringList vendorList; @@ -65,8 +66,13 @@ private: QStringListModel *productModel; void fill_computer_list(); + QTimer *timer; + public: bool preferDownloaded(); + void updateState(states state); + states currentState; + }; #endif |