Helpviewer/Sync/SyncCheckPage.py

changeset 1673
06eeffc8c97d
parent 1626
a77c8ea8582c
child 1680
28e57079dab5
equal deleted inserted replaced
1672:782c5f5b912c 1673:06eeffc8c97d
66 66
67 animationFile = os.path.join(getConfig("ericPixDir"), "loading.gif") 67 animationFile = os.path.join(getConfig("ericPixDir"), "loading.gif")
68 68
69 # bookmarks 69 # bookmarks
70 if Preferences.getHelp("SyncBookmarks"): 70 if Preferences.getHelp("SyncBookmarks"):
71 movie = QMovie(animationFile, QByteArray(), self.bookmarkLabel) 71 self.__makeAnimatedLabel(animationFile, self.bookmarkLabel)
72 movie.setSpeed(50)
73 self.bookmarkLabel.setMovie(movie)
74 movie.start()
75 else: 72 else:
76 self.bookmarkLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo.png")) 73 self.bookmarkLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo.png"))
77 74
78 # history 75 # history
79 if Preferences.getHelp("SyncHistory"): 76 if Preferences.getHelp("SyncHistory"):
80 movie = QMovie(animationFile, QByteArray(), self.historyLabel) 77 self.__makeAnimatedLabel(animationFile, self.historyLabel)
81 movie.setSpeed(50)
82 self.historyLabel.setMovie(movie)
83 movie.start()
84 else: 78 else:
85 self.historyLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo.png")) 79 self.historyLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo.png"))
86 80
87 # Passwords 81 # Passwords
88 if Preferences.getHelp("SyncPasswords"): 82 if Preferences.getHelp("SyncPasswords"):
89 movie = QMovie(animationFile, QByteArray(), self.passwordsLabel) 83 self.__makeAnimatedLabel(animationFile, self.passwordsLabel)
90 movie.setSpeed(50)
91 self.passwordsLabel.setMovie(movie)
92 movie.start()
93 else: 84 else:
94 self.passwordsLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo.png")) 85 self.passwordsLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo.png"))
95 86
96 # user agent settings 87 # user agent settings
97 if Preferences.getHelp("SyncUserAgents"): 88 if Preferences.getHelp("SyncUserAgents"):
98 movie = QMovie(animationFile, QByteArray(), self.userAgentsLabel) 89 self.__makeAnimatedLabel(animationFile, self.userAgentsLabel)
99 movie.setSpeed(50)
100 self.userAgentsLabel.setMovie(movie)
101 movie.start()
102 else: 90 else:
103 self.userAgentsLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo.png")) 91 self.userAgentsLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo.png"))
104 92
105 handler = syncMgr.handler() 93 handler = syncMgr.handler()
106 handler.syncStatus.connect(self.__updatePage) 94 handler.syncStatus.connect(self.__updatePage)
95
96 def __makeAnimatedLabel(self, fileName, label):
97 """
98 Private slot to create an animated label.
99
100 @param fileName name of the file containing the animation (string)
101 @param label reference to the label to be animated (QLabel)
102 """
103 movie = QMovie(fileName, QByteArray(), label)
104 movie.setSpeed(100)
105 label.setMovie(movie)
106 movie.start()
107 107
108 def __updatePage(self, type_, done, msg): 108 def __updatePage(self, type_, done, msg):
109 """ 109 """
110 Private slot to update the synchronization status info. 110 Private slot to update the synchronization status info.
111 111

eric ide

mercurial