eric6/WebBrowser/Sync/SyncCheckPage.py

changeset 7533
88261c96484b
parent 7514
0960c7c1f497
child 7923
91e843545d9a
equal deleted inserted replaced
7532:1358e9d67a1c 7533:88261c96484b
68 self.userAgentsMsgLabel.setText("") 68 self.userAgentsMsgLabel.setText("")
69 self.speedDialMsgLabel.setText("") 69 self.speedDialMsgLabel.setText("")
70 70
71 if not syncMgr.syncEnabled(): 71 if not syncMgr.syncEnabled():
72 self.bookmarkLabel.setPixmap( 72 self.bookmarkLabel.setPixmap(
73 UI.PixmapCache.getPixmap("syncNo.png")) 73 UI.PixmapCache.getPixmap("syncNo"))
74 self.historyLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo.png")) 74 self.historyLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo"))
75 self.passwordsLabel.setPixmap( 75 self.passwordsLabel.setPixmap(
76 UI.PixmapCache.getPixmap("syncNo.png")) 76 UI.PixmapCache.getPixmap("syncNo"))
77 self.userAgentsLabel.setPixmap( 77 self.userAgentsLabel.setPixmap(
78 UI.PixmapCache.getPixmap("syncNo.png")) 78 UI.PixmapCache.getPixmap("syncNo"))
79 self.speedDialLabel.setPixmap( 79 self.speedDialLabel.setPixmap(
80 UI.PixmapCache.getPixmap("syncNo.png")) 80 UI.PixmapCache.getPixmap("syncNo"))
81 return 81 return
82 82
83 # bookmarks 83 # bookmarks
84 if Preferences.getWebBrowser("SyncBookmarks"): 84 if Preferences.getWebBrowser("SyncBookmarks"):
85 self.__makeAnimatedLabel("loadingAnimation", self.bookmarkLabel) 85 self.__makeAnimatedLabel("loadingAnimation", self.bookmarkLabel)
86 else: 86 else:
87 self.bookmarkLabel.setPixmap( 87 self.bookmarkLabel.setPixmap(
88 UI.PixmapCache.getPixmap("syncNo.png")) 88 UI.PixmapCache.getPixmap("syncNo"))
89 89
90 # history 90 # history
91 if Preferences.getWebBrowser("SyncHistory"): 91 if Preferences.getWebBrowser("SyncHistory"):
92 self.__makeAnimatedLabel("loadingAnimation", self.historyLabel) 92 self.__makeAnimatedLabel("loadingAnimation", self.historyLabel)
93 else: 93 else:
94 self.historyLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo.png")) 94 self.historyLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo"))
95 95
96 # Passwords 96 # Passwords
97 if Preferences.getWebBrowser("SyncPasswords"): 97 if Preferences.getWebBrowser("SyncPasswords"):
98 self.__makeAnimatedLabel("loadingAnimation", self.passwordsLabel) 98 self.__makeAnimatedLabel("loadingAnimation", self.passwordsLabel)
99 else: 99 else:
100 self.passwordsLabel.setPixmap( 100 self.passwordsLabel.setPixmap(
101 UI.PixmapCache.getPixmap("syncNo.png")) 101 UI.PixmapCache.getPixmap("syncNo"))
102 102
103 # user agent settings 103 # user agent settings
104 if Preferences.getWebBrowser("SyncUserAgents"): 104 if Preferences.getWebBrowser("SyncUserAgents"):
105 self.__makeAnimatedLabel("loadingAnimation", self.userAgentsLabel) 105 self.__makeAnimatedLabel("loadingAnimation", self.userAgentsLabel)
106 else: 106 else:
107 self.userAgentsLabel.setPixmap( 107 self.userAgentsLabel.setPixmap(
108 UI.PixmapCache.getPixmap("syncNo.png")) 108 UI.PixmapCache.getPixmap("syncNo"))
109 109
110 # speed dial settings 110 # speed dial settings
111 if Preferences.getWebBrowser("SyncSpeedDial"): 111 if Preferences.getWebBrowser("SyncSpeedDial"):
112 self.__makeAnimatedLabel("loadingAnimation", self.speedDialLabel) 112 self.__makeAnimatedLabel("loadingAnimation", self.speedDialLabel)
113 else: 113 else:
114 self.speedDialLabel.setPixmap( 114 self.speedDialLabel.setPixmap(
115 UI.PixmapCache.getPixmap("syncNo.png")) 115 UI.PixmapCache.getPixmap("syncNo"))
116 116
117 QTimer.singleShot( 117 QTimer.singleShot(
118 0, lambda: syncMgr.loadSettings(forceUpload=forceUpload)) 118 0, lambda: syncMgr.loadSettings(forceUpload=forceUpload))
119 119
120 def __makeAnimatedLabel(self, fileName, label): 120 def __makeAnimatedLabel(self, fileName, label):
159 @param download flag indicating a download of a file (boolean) 159 @param download flag indicating a download of a file (boolean)
160 """ 160 """
161 if type_ == "bookmarks": 161 if type_ == "bookmarks":
162 if status: 162 if status:
163 self.bookmarkLabel.setPixmap( 163 self.bookmarkLabel.setPixmap(
164 UI.PixmapCache.getPixmap("syncCompleted.png")) 164 UI.PixmapCache.getPixmap("syncCompleted"))
165 else: 165 else:
166 self.bookmarkLabel.setPixmap( 166 self.bookmarkLabel.setPixmap(
167 UI.PixmapCache.getPixmap("syncFailed.png")) 167 UI.PixmapCache.getPixmap("syncFailed"))
168 elif type_ == "history": 168 elif type_ == "history":
169 if status: 169 if status:
170 self.historyLabel.setPixmap( 170 self.historyLabel.setPixmap(
171 UI.PixmapCache.getPixmap("syncCompleted.png")) 171 UI.PixmapCache.getPixmap("syncCompleted"))
172 else: 172 else:
173 self.historyLabel.setPixmap( 173 self.historyLabel.setPixmap(
174 UI.PixmapCache.getPixmap("syncFailed.png")) 174 UI.PixmapCache.getPixmap("syncFailed"))
175 elif type_ == "passwords": 175 elif type_ == "passwords":
176 if status: 176 if status:
177 self.passwordsLabel.setPixmap( 177 self.passwordsLabel.setPixmap(
178 UI.PixmapCache.getPixmap("syncCompleted.png")) 178 UI.PixmapCache.getPixmap("syncCompleted"))
179 else: 179 else:
180 self.passwordsLabel.setPixmap( 180 self.passwordsLabel.setPixmap(
181 UI.PixmapCache.getPixmap("syncFailed.png")) 181 UI.PixmapCache.getPixmap("syncFailed"))
182 elif type_ == "useragents": 182 elif type_ == "useragents":
183 if status: 183 if status:
184 self.userAgentsLabel.setPixmap( 184 self.userAgentsLabel.setPixmap(
185 UI.PixmapCache.getPixmap("syncCompleted.png")) 185 UI.PixmapCache.getPixmap("syncCompleted"))
186 else: 186 else:
187 self.userAgentsLabel.setPixmap( 187 self.userAgentsLabel.setPixmap(
188 UI.PixmapCache.getPixmap("syncFailed.png")) 188 UI.PixmapCache.getPixmap("syncFailed"))
189 elif type_ == "speeddial": 189 elif type_ == "speeddial":
190 if status: 190 if status:
191 self.speedDialLabel.setPixmap( 191 self.speedDialLabel.setPixmap(
192 UI.PixmapCache.getPixmap("syncCompleted.png")) 192 UI.PixmapCache.getPixmap("syncCompleted"))
193 else: 193 else:
194 self.speedDialLabel.setPixmap( 194 self.speedDialLabel.setPixmap(
195 UI.PixmapCache.getPixmap("syncFailed.png")) 195 UI.PixmapCache.getPixmap("syncFailed"))
196 196
197 def __syncError(self, message): 197 def __syncError(self, message):
198 """ 198 """
199 Private slot to handle general synchronization issues. 199 Private slot to handle general synchronization issues.
200 200

eric ide

mercurial