44 |
44 |
45 Downloading = 0 |
45 Downloading = 0 |
46 DownloadSuccessful = 1 |
46 DownloadSuccessful = 1 |
47 DownloadCancelled = 2 |
47 DownloadCancelled = 2 |
48 |
48 |
49 def __init__(self, downloadItem=None, parent=None): |
49 def __init__(self, downloadItem=None, pageUrl="", parent=None): |
50 """ |
50 """ |
51 Constructor |
51 Constructor |
52 |
52 |
53 @param downloadItem reference to the download object containing the |
53 @param downloadItem reference to the download object containing the |
54 download data. |
54 download data. |
55 @keyparam parent reference to the parent widget (QWidget) |
|
56 @type QWebEngineDownloadItem |
55 @type QWebEngineDownloadItem |
|
56 @param pageUrl URL of the calling page |
|
57 @type QUrl |
|
58 @param parent reference to the parent widget |
|
59 @type QWidget |
57 """ |
60 """ |
58 super(DownloadItem, self).__init__(parent) |
61 super(DownloadItem, self).__init__(parent) |
59 self.setupUi(self) |
62 self.setupUi(self) |
60 |
63 |
61 p = self.infoLabel.palette() |
64 p = self.infoLabel.palette() |
78 |
81 |
79 icon = self.style().standardIcon(QStyle.SP_FileIcon) |
82 icon = self.style().standardIcon(QStyle.SP_FileIcon) |
80 self.fileIcon.setPixmap(icon.pixmap(48, 48)) |
83 self.fileIcon.setPixmap(icon.pixmap(48, 48)) |
81 |
84 |
82 self.__downloadItem = downloadItem |
85 self.__downloadItem = downloadItem |
83 self.__pageUrl = \ |
86 self.__pageUrl = pageUrl |
84 WebBrowserWindow.mainWindow().getWindow().currentBrowser().url() |
|
85 self.__bytesReceived = 0 |
87 self.__bytesReceived = 0 |
86 self.__bytesTotal = -1 |
88 self.__bytesTotal = -1 |
87 self.__downloadTime = QTime() |
89 self.__downloadTime = QTime() |
88 self.__fileName = "" |
90 self.__fileName = "" |
89 self.__originalFileName = "" |
91 self.__originalFileName = "" |