5 |
5 |
6 """ |
6 """ |
7 Module implementing the synchronization status wizard page. |
7 Module implementing the synchronization status wizard page. |
8 """ |
8 """ |
9 |
9 |
10 |
10 from PyQt5.QtCore import QTimer |
11 import os |
|
12 |
|
13 from PyQt5.QtCore import QByteArray, QTimer |
|
14 from PyQt5.QtGui import QMovie |
|
15 from PyQt5.QtWidgets import QWizardPage |
11 from PyQt5.QtWidgets import QWizardPage |
16 |
12 |
17 from . import SyncGlobals |
13 from . import SyncGlobals |
18 |
14 |
19 from .Ui_SyncCheckPage import Ui_SyncCheckPage |
15 from .Ui_SyncCheckPage import Ui_SyncCheckPage |
20 |
16 |
21 import Preferences |
17 import Preferences |
22 import UI.PixmapCache |
18 import UI.PixmapCache |
23 |
|
24 from eric6config import getConfig |
|
25 |
19 |
26 |
20 |
27 class SyncCheckPage(QWizardPage, Ui_SyncCheckPage): |
21 class SyncCheckPage(QWizardPage, Ui_SyncCheckPage): |
28 """ |
22 """ |
29 Class implementing the synchronization status wizard page. |
23 Class implementing the synchronization status wizard page. |
84 UI.PixmapCache.getPixmap("syncNo.png")) |
78 UI.PixmapCache.getPixmap("syncNo.png")) |
85 self.speedDialLabel.setPixmap( |
79 self.speedDialLabel.setPixmap( |
86 UI.PixmapCache.getPixmap("syncNo.png")) |
80 UI.PixmapCache.getPixmap("syncNo.png")) |
87 return |
81 return |
88 |
82 |
89 animationFile = os.path.join(getConfig("ericPixDir"), "loading.gif") |
|
90 |
|
91 # bookmarks |
83 # bookmarks |
92 if Preferences.getWebBrowser("SyncBookmarks"): |
84 if Preferences.getWebBrowser("SyncBookmarks"): |
93 self.__makeAnimatedLabel(animationFile, self.bookmarkLabel) |
85 self.__makeAnimatedLabel("loadingAnimation", self.bookmarkLabel) |
94 else: |
86 else: |
95 self.bookmarkLabel.setPixmap( |
87 self.bookmarkLabel.setPixmap( |
96 UI.PixmapCache.getPixmap("syncNo.png")) |
88 UI.PixmapCache.getPixmap("syncNo.png")) |
97 |
89 |
98 # history |
90 # history |
99 if Preferences.getWebBrowser("SyncHistory"): |
91 if Preferences.getWebBrowser("SyncHistory"): |
100 self.__makeAnimatedLabel(animationFile, self.historyLabel) |
92 self.__makeAnimatedLabel("loadingAnimation", self.historyLabel) |
101 else: |
93 else: |
102 self.historyLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo.png")) |
94 self.historyLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo.png")) |
103 |
95 |
104 # Passwords |
96 # Passwords |
105 if Preferences.getWebBrowser("SyncPasswords"): |
97 if Preferences.getWebBrowser("SyncPasswords"): |
106 self.__makeAnimatedLabel(animationFile, self.passwordsLabel) |
98 self.__makeAnimatedLabel("loadingAnimation", self.passwordsLabel) |
107 else: |
99 else: |
108 self.passwordsLabel.setPixmap( |
100 self.passwordsLabel.setPixmap( |
109 UI.PixmapCache.getPixmap("syncNo.png")) |
101 UI.PixmapCache.getPixmap("syncNo.png")) |
110 |
102 |
111 # user agent settings |
103 # user agent settings |
112 if Preferences.getWebBrowser("SyncUserAgents"): |
104 if Preferences.getWebBrowser("SyncUserAgents"): |
113 self.__makeAnimatedLabel(animationFile, self.userAgentsLabel) |
105 self.__makeAnimatedLabel("loadingAnimation", self.userAgentsLabel) |
114 else: |
106 else: |
115 self.userAgentsLabel.setPixmap( |
107 self.userAgentsLabel.setPixmap( |
116 UI.PixmapCache.getPixmap("syncNo.png")) |
108 UI.PixmapCache.getPixmap("syncNo.png")) |
117 |
109 |
118 # speed dial settings |
110 # speed dial settings |
119 if Preferences.getWebBrowser("SyncSpeedDial"): |
111 if Preferences.getWebBrowser("SyncSpeedDial"): |
120 self.__makeAnimatedLabel(animationFile, self.speedDialLabel) |
112 self.__makeAnimatedLabel("loadingAnimation", self.speedDialLabel) |
121 else: |
113 else: |
122 self.speedDialLabel.setPixmap( |
114 self.speedDialLabel.setPixmap( |
123 UI.PixmapCache.getPixmap("syncNo.png")) |
115 UI.PixmapCache.getPixmap("syncNo.png")) |
124 |
116 |
125 QTimer.singleShot( |
117 QTimer.singleShot( |
127 |
119 |
128 def __makeAnimatedLabel(self, fileName, label): |
120 def __makeAnimatedLabel(self, fileName, label): |
129 """ |
121 """ |
130 Private slot to create an animated label. |
122 Private slot to create an animated label. |
131 |
123 |
132 @param fileName name of the file containing the animation (string) |
124 @param fileName name of the file containing the animation |
133 @param label reference to the label to be animated (QLabel) |
125 @type str |
134 """ |
126 @param label reference to the label to be animated |
135 movie = QMovie(fileName, QByteArray(), label) |
127 @type E5AnimatedLabel |
136 movie.setSpeed(100) |
128 """ |
137 label.setMovie(movie) |
129 label.setInterval(40) |
138 movie.start() |
130 label.setAnimationFile(fileName) |
|
131 label.start() |
139 |
132 |
140 def __updateMessages(self, type_, msg): |
133 def __updateMessages(self, type_, msg): |
141 """ |
134 """ |
142 Private slot to update the synchronization status info. |
135 Private slot to update the synchronization status info. |
143 |
136 |