SingleDownload
Manage file downloads and tracking the progress. More...
Import Statement: | import Ubuntu.DownloadManager 0.1 |
Properties
- allowMobileDownload : bool
- autoStart : bool
- downloadId : string
- downloadInProgress : bool
- downloading : bool
- errorMessage : string
- isCompleted : bool
- progress : int
- throttle : long
Methods
Detailed Description
SingleDownload provides facilities for downloading a single file, track the process, react to error conditions, etc.
Example usage:
import QtQuick 2.0 import Ubuntu.Components 0.1 import Ubuntu.DownloadManager 0.1 Rectangle { width: units.gu(100) height: units.gu(20) TextField { id: text placeholderText: "File URL to download..." height: 50 anchors { left: parent.left right: button.left rightMargin: units.gu(2) } } Button { id: button text: "Download" height: 50 anchors.right: parent.right onClicked: { single.download(text.text); } } ProgressBar { minimumValue: 0 maximumValue: 100 value: single.progress anchors { left: parent.left right: parent.right bottom: parent.bottom } SingleDownload { id: single } } }
See also DownloadManager.
Property Documentation
This property sets if the download handled by this object will work under mobile data connection.
This property sets if the downloads should start automatically, or let the user decide when to start them calling the "start()" method.
This property provides the unique identifier that represents the download within the download manager.
This property represents if the download is active, no matter if it's paused or anything. If a download is active, the value will be True. It will become False when the download finished or get canceled.
This property represents the current state of the download. False if paused or not downloading anything. True if the file is currently being downloaded.
The current state of the download. True if the download already finished, False otherwise.
This property reports the current progress in percentage of the download, from 0 to 100.
Method Documentation
Creates the download for the given url and reports the different states through the properties.
Starts the download, used when autoStart is False.