src/download.h

changeset 432
ef382b98a8af
parent 431
ec1e2059319b
child 435
bc3a51394953
--- a/src/download.h	Sat Aug 03 02:18:41 2013 +0300
+++ b/src/download.h	Sat Aug 03 04:32:13 2013 +0300
@@ -30,6 +30,7 @@
 class QNetworkAccessManager;
 class QNetworkRequest;
 class QNetworkReply;
+class QAbstractButton;
 
 // =============================================================================
 // -----------------------------------------------------------------------------
@@ -49,6 +50,7 @@
 class PartDownloadPrompt : public QDialog {
 	Q_OBJECT
 	PROPERTY (LDFile*, primaryFile, setPrimaryFile)
+	PROPERTY (bool, aborted, setAborted)
 	
 public:
 	enum Source {
@@ -56,17 +58,24 @@
 		CustomURL,
 	};
 	
+	enum Button {
+		Download,
+		Abort,
+		Close
+	};
+	
 	explicit PartDownloadPrompt (QWidget* parent = null);
 	virtual ~PartDownloadPrompt();
 	str getURL() const;
 	Source getSource() const;
 	void downloadFile (str dest, str url, bool primary);
 	void modifyDest (str& dest) const;
+	QPushButton* getButton (Button i);
 	
 public slots:
 	void sourceChanged (int i);
-	void startDownload();
 	void checkIfFinished();
+	void buttonClicked (QAbstractButton* btn);
 	
 protected:
 	Ui_DownloadFrom* ui;
@@ -75,6 +84,7 @@
 private:
 	List<str> m_filesToDownload;
 	List<PartDownloadRequest*> m_requests;
+	QPushButton* m_downloadButton;
 };
 
 // =============================================================================
@@ -109,7 +119,7 @@
 	void downloadFinished();
 	void readyRead();
 	void downloadProgress (qint64 recv, qint64 total);
-	void downloadError();
+	void abort();
 	
 private:
 	PartDownloadPrompt* m_prompt;

mercurial