eric6/WebBrowser/Sync/SyncCheckPage.py

changeset 7514
0960c7c1f497
parent 7360
9190402e4505
child 7533
88261c96484b
--- a/eric6/WebBrowser/Sync/SyncCheckPage.py	Thu Apr 09 17:59:24 2020 +0200
+++ b/eric6/WebBrowser/Sync/SyncCheckPage.py	Thu Apr 09 18:00:40 2020 +0200
@@ -7,11 +7,7 @@
 Module implementing the synchronization status wizard page.
 """
 
-
-import os
-
-from PyQt5.QtCore import QByteArray, QTimer
-from PyQt5.QtGui import QMovie
+from PyQt5.QtCore import QTimer
 from PyQt5.QtWidgets import QWizardPage
 
 from . import SyncGlobals
@@ -21,8 +17,6 @@
 import Preferences
 import UI.PixmapCache
 
-from eric6config import getConfig
-
 
 class SyncCheckPage(QWizardPage, Ui_SyncCheckPage):
     """
@@ -86,38 +80,36 @@
                 UI.PixmapCache.getPixmap("syncNo.png"))
             return
         
-        animationFile = os.path.join(getConfig("ericPixDir"), "loading.gif")
-        
         # bookmarks
         if Preferences.getWebBrowser("SyncBookmarks"):
-            self.__makeAnimatedLabel(animationFile, self.bookmarkLabel)
+            self.__makeAnimatedLabel("loadingAnimation", self.bookmarkLabel)
         else:
             self.bookmarkLabel.setPixmap(
                 UI.PixmapCache.getPixmap("syncNo.png"))
         
         # history
         if Preferences.getWebBrowser("SyncHistory"):
-            self.__makeAnimatedLabel(animationFile, self.historyLabel)
+            self.__makeAnimatedLabel("loadingAnimation", self.historyLabel)
         else:
             self.historyLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo.png"))
         
         # Passwords
         if Preferences.getWebBrowser("SyncPasswords"):
-            self.__makeAnimatedLabel(animationFile, self.passwordsLabel)
+            self.__makeAnimatedLabel("loadingAnimation", self.passwordsLabel)
         else:
             self.passwordsLabel.setPixmap(
                 UI.PixmapCache.getPixmap("syncNo.png"))
         
         # user agent settings
         if Preferences.getWebBrowser("SyncUserAgents"):
-            self.__makeAnimatedLabel(animationFile, self.userAgentsLabel)
+            self.__makeAnimatedLabel("loadingAnimation", self.userAgentsLabel)
         else:
             self.userAgentsLabel.setPixmap(
                 UI.PixmapCache.getPixmap("syncNo.png"))
         
         # speed dial settings
         if Preferences.getWebBrowser("SyncSpeedDial"):
-            self.__makeAnimatedLabel(animationFile, self.speedDialLabel)
+            self.__makeAnimatedLabel("loadingAnimation", self.speedDialLabel)
         else:
             self.speedDialLabel.setPixmap(
                 UI.PixmapCache.getPixmap("syncNo.png"))
@@ -129,13 +121,14 @@
         """
         Private slot to create an animated label.
         
-        @param fileName name of the file containing the animation (string)
-        @param label reference to the label to be animated (QLabel)
+        @param fileName name of the file containing the animation
+        @type str
+        @param label reference to the label to be animated
+        @type E5AnimatedLabel
         """
-        movie = QMovie(fileName, QByteArray(), label)
-        movie.setSpeed(100)
-        label.setMovie(movie)
-        movie.start()
+        label.setInterval(40)
+        label.setAnimationFile(fileName)
+        label.start()
     
     def __updateMessages(self, type_, msg):
         """

eric ide

mercurial