11/************************************************************************
22 * This file has been generated automatically from *
33 * *
4- * src/gui /qgsfiledownloader.h *
4+ * src/core /qgsfiledownloader.h *
55 * *
66 * Do not edit manually ! Edit header and run scripts/sipify.pl again *
77 ************************************************************************/
@@ -16,29 +16,33 @@ class QgsFileDownloader : QObject
1616
1717 To use this class, it is necessary to pass the URL and an output file name as
1818 arguments to the constructor, the download will start immediately.
19- The download is asynchronous and depending on the guiNotificationsEnabled
20- parameter accepted by the constructor (default = true) the class will
21- show a progress dialog and report all errors in a QMessageBox.warning dialog.
22- If the guiNotificationsEnabled parameter is set to false, the class can still
23- be used through the signals and slots mechanism.
19+
20+ The download is asynchronous.
21+
2422 The object will destroy itself when the request completes, errors or is canceled.
2523 An optional authentication configuration can be specified.
2624
27- .. versionadded:: 2.18.1
25+ .. note::
26+
27+ This class was part of the GUI library from QGIS 2.18.1 until QGIS 3.0
28+ .. versionadded:: 3.0
2829%End
2930
3031%TypeHeaderCode
3132#include "qgsfiledownloader.h"
3233%End
3334 public:
3435
35- QgsFileDownloader( const QUrl &url, const QString &outputFileName, bool guiNotificationsEnabled = true, const QString &authcfg = QString() );
36+ QgsFileDownloader( const QUrl &url, const QString &outputFileName, const QString &authcfg = QString(), bool delayStart = false );
3637%Docstring
3738 QgsFileDownloader
3839 \param url the download url
3940 \param outputFileName file name where the downloaded content will be stored
40- \param guiNotificationsEnabled if false, the downloader will not display any progress bar or error message
4141 \param authcfg optionally apply this authentication configuration
42+ \param delayStart if true, the download will not be commenced immediately and must
43+ be triggered by a later call to startDownload(). This can be useful if connections need
44+ to be made to the downloader and there's a chance the download will emit
45+ signals before these connections have been made.
4246%End
4347
4448 signals:
@@ -50,10 +54,13 @@ Emitted when the download has completed successfully
5054%Docstring
5155Emitted always when the downloader exits
5256%End
57+
5358 void downloadCanceled();
5459%Docstring
55- Emitted when the download was canceled by the user
60+ Emitted when the download was canceled by the user.
61+ .. seealso:: cancelDownload()
5662%End
63+
5764 void downloadError( QStringList errorMessages );
5865%Docstring
5966Emitted when an error makes the download fail
@@ -65,13 +72,16 @@ Emitted when data are ready to be processed
6572
6673 public slots:
6774
68- void onDownloadCanceled();
75+ void cancelDownload();
76+ %Docstring
77+ Call to abort the download and delete this object after the cancelation
78+ has been processed.
79+ .. seealso:: downloadCanceled()
80+ %End
81+
82+ void startDownload();
6983%Docstring
70- Called when a download is canceled by the user
71- this slot aborts the download and deletes
72- the object.
73- Never call this slot directly: this is meant to
74- be managed by the signal-slot system.
84+ Called to start the download
7585%End
7686
7787 protected:
@@ -82,7 +92,7 @@ Emitted when data are ready to be processed
8292/************************************************************************
8393 * This file has been generated automatically from *
8494 * *
85- * src/gui /qgsfiledownloader.h *
95+ * src/core /qgsfiledownloader.h *
8696 * *
8797 * Do not edit manually ! Edit header and run scripts/sipify.pl again *
8898 ************************************************************************/
0 commit comments