eric6/WebBrowser/Download/DownloadItem.py

branch
maintenance
changeset 8176
31965986ecd1
parent 8043
0acf98cd089a
parent 8143
2c730d5fd177
child 8273
698ae46f40a4
diff -r e01ae92db699 -r 31965986ecd1 eric6/WebBrowser/Download/DownloadItem.py
--- a/eric6/WebBrowser/Download/DownloadItem.py	Sat Mar 06 10:00:52 2021 +0100
+++ b/eric6/WebBrowser/Download/DownloadItem.py	Sun Mar 28 15:00:11 2021 +0200
@@ -59,7 +59,7 @@
         self.setupUi(self)
         
         p = self.infoLabel.palette()
-        p.setColor(QPalette.Text, Qt.darkGray)
+        p.setColor(QPalette.ColorRole.Text, Qt.GlobalColor.darkGray)
         self.infoLabel.setPalette(p)
         
         self.progressBar.setMaximum(0)
@@ -76,7 +76,7 @@
         
         self.__state = DownloadItem.Downloading
         
-        icon = self.style().standardIcon(QStyle.SP_FileIcon)
+        icon = self.style().standardIcon(QStyle.StandardPixmap.SP_FileIcon)
         self.fileIcon.setPixmap(icon.pixmap(48, 48))
         
         self.__downloadItem = downloadItem
@@ -123,7 +123,7 @@
         self.progressBar.setValue(0)
         if (
             self.__downloadItem.state() ==
-            QWebEngineDownloadItem.DownloadRequested
+            QWebEngineDownloadItem.DownloadState.DownloadRequested
         ):
             self.__getFileName()
             if not self.__fileName:
@@ -143,11 +143,11 @@
             return
         
         savePage = self.__downloadItem.type() == (
-            QWebEngineDownloadItem.SavePage
+            QWebEngineDownloadItem.DownloadType.SavePage
         )
         
         documentLocation = QStandardPaths.writableLocation(
-            QStandardPaths.DocumentsLocation)
+            QStandardPaths.StandardLocation.DocumentsLocation)
         downloadDirectory = (
             WebBrowserWindow.downloadManager().downloadDirectory()
         )
@@ -175,7 +175,10 @@
                 "{0}://{1}".format(url.scheme(), url.authority()),
                 self)
             
-            if dlg.exec() == QDialog.Rejected or dlg.getAction() == "cancel":
+            if (
+                dlg.exec() == QDialog.DialogCode.Rejected or
+                dlg.getAction() == "cancel"
+            ):
                 self.progressBar.setVisible(False)
                 self.on_stopButton_clicked()
                 self.filenameLabel.setText(
@@ -199,7 +202,7 @@
             self.__autoOpen = dlg.getAction() == "open"
             
             tempLocation = QStandardPaths.writableLocation(
-                QStandardPaths.TempLocation)
+                QStandardPaths.StandardLocation.TempLocation)
             fileName = (
                 tempLocation + '/' +
                 QFileInfo(fileName).completeBaseName()
@@ -486,7 +489,7 @@
         self.__finishedDownloading = True
         
         noError = (self.__downloadItem.state() ==
-                   QWebEngineDownloadItem.DownloadCompleted)
+                   QWebEngineDownloadItem.DownloadState.DownloadCompleted)
         
         self.progressBar.setVisible(False)
         self.pauseButton.setEnabled(False)

eric ide

mercurial