38 """ |
38 """ |
39 self.syncErrorLabel.hide() |
39 self.syncErrorLabel.hide() |
40 |
40 |
41 forceUpload = self.field("ReencryptData") |
41 forceUpload = self.field("ReencryptData") |
42 |
42 |
43 from WebBrowser.WebBrowserWindow import WebBrowserWindow |
43 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow |
44 |
44 |
45 syncMgr = WebBrowserWindow.syncManager() |
45 syncMgr = WebBrowserWindow.syncManager() |
46 syncMgr.syncError.connect(self.__syncError) |
46 syncMgr.syncError.connect(self.__syncError) |
47 syncMgr.syncStatus.connect(self.__updateMessages) |
47 syncMgr.syncStatus.connect(self.__updateMessages) |
48 syncMgr.syncFinished.connect(self.__updateLabels) |
48 syncMgr.syncFinished.connect(self.__updateLabels) |
64 self.passwordsMsgLabel.setText("") |
64 self.passwordsMsgLabel.setText("") |
65 self.userAgentsMsgLabel.setText("") |
65 self.userAgentsMsgLabel.setText("") |
66 self.speedDialMsgLabel.setText("") |
66 self.speedDialMsgLabel.setText("") |
67 |
67 |
68 if not syncMgr.syncEnabled(): |
68 if not syncMgr.syncEnabled(): |
69 self.bookmarkLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo")) |
69 self.bookmarkLabel.setPixmap(EricPixmapCache.getPixmap("syncNo")) |
70 self.historyLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo")) |
70 self.historyLabel.setPixmap(EricPixmapCache.getPixmap("syncNo")) |
71 self.passwordsLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo")) |
71 self.passwordsLabel.setPixmap(EricPixmapCache.getPixmap("syncNo")) |
72 self.userAgentsLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo")) |
72 self.userAgentsLabel.setPixmap(EricPixmapCache.getPixmap("syncNo")) |
73 self.speedDialLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo")) |
73 self.speedDialLabel.setPixmap(EricPixmapCache.getPixmap("syncNo")) |
74 return |
74 return |
75 |
75 |
76 # bookmarks |
76 # bookmarks |
77 if Preferences.getWebBrowser("SyncBookmarks"): |
77 if Preferences.getWebBrowser("SyncBookmarks"): |
78 self.__makeAnimatedLabel("loadingAnimation", self.bookmarkLabel) |
78 self.__makeAnimatedLabel("loadingAnimation", self.bookmarkLabel) |
79 else: |
79 else: |
80 self.bookmarkLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo")) |
80 self.bookmarkLabel.setPixmap(EricPixmapCache.getPixmap("syncNo")) |
81 |
81 |
82 # history |
82 # history |
83 if Preferences.getWebBrowser("SyncHistory"): |
83 if Preferences.getWebBrowser("SyncHistory"): |
84 self.__makeAnimatedLabel("loadingAnimation", self.historyLabel) |
84 self.__makeAnimatedLabel("loadingAnimation", self.historyLabel) |
85 else: |
85 else: |
86 self.historyLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo")) |
86 self.historyLabel.setPixmap(EricPixmapCache.getPixmap("syncNo")) |
87 |
87 |
88 # Passwords |
88 # Passwords |
89 if Preferences.getWebBrowser("SyncPasswords"): |
89 if Preferences.getWebBrowser("SyncPasswords"): |
90 self.__makeAnimatedLabel("loadingAnimation", self.passwordsLabel) |
90 self.__makeAnimatedLabel("loadingAnimation", self.passwordsLabel) |
91 else: |
91 else: |
92 self.passwordsLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo")) |
92 self.passwordsLabel.setPixmap(EricPixmapCache.getPixmap("syncNo")) |
93 |
93 |
94 # user agent settings |
94 # user agent settings |
95 if Preferences.getWebBrowser("SyncUserAgents"): |
95 if Preferences.getWebBrowser("SyncUserAgents"): |
96 self.__makeAnimatedLabel("loadingAnimation", self.userAgentsLabel) |
96 self.__makeAnimatedLabel("loadingAnimation", self.userAgentsLabel) |
97 else: |
97 else: |
98 self.userAgentsLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo")) |
98 self.userAgentsLabel.setPixmap(EricPixmapCache.getPixmap("syncNo")) |
99 |
99 |
100 # speed dial settings |
100 # speed dial settings |
101 if Preferences.getWebBrowser("SyncSpeedDial"): |
101 if Preferences.getWebBrowser("SyncSpeedDial"): |
102 self.__makeAnimatedLabel("loadingAnimation", self.speedDialLabel) |
102 self.__makeAnimatedLabel("loadingAnimation", self.speedDialLabel) |
103 else: |
103 else: |
104 self.speedDialLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo")) |
104 self.speedDialLabel.setPixmap(EricPixmapCache.getPixmap("syncNo")) |
105 |
105 |
106 QTimer.singleShot(0, lambda: syncMgr.loadSettings(forceUpload=forceUpload)) |
106 QTimer.singleShot(0, lambda: syncMgr.loadSettings(forceUpload=forceUpload)) |
107 |
107 |
108 def __makeAnimatedLabel(self, fileName, label): |
108 def __makeAnimatedLabel(self, fileName, label): |
109 """ |
109 """ |
146 @param status flag indicating success (boolean) |
146 @param status flag indicating success (boolean) |
147 @param download flag indicating a download of a file (boolean) |
147 @param download flag indicating a download of a file (boolean) |
148 """ |
148 """ |
149 if type_ == "bookmarks": |
149 if type_ == "bookmarks": |
150 if status: |
150 if status: |
151 self.bookmarkLabel.setPixmap(UI.PixmapCache.getPixmap("syncCompleted")) |
151 self.bookmarkLabel.setPixmap(EricPixmapCache.getPixmap("syncCompleted")) |
152 else: |
152 else: |
153 self.bookmarkLabel.setPixmap(UI.PixmapCache.getPixmap("syncFailed")) |
153 self.bookmarkLabel.setPixmap(EricPixmapCache.getPixmap("syncFailed")) |
154 elif type_ == "history": |
154 elif type_ == "history": |
155 if status: |
155 if status: |
156 self.historyLabel.setPixmap(UI.PixmapCache.getPixmap("syncCompleted")) |
156 self.historyLabel.setPixmap(EricPixmapCache.getPixmap("syncCompleted")) |
157 else: |
157 else: |
158 self.historyLabel.setPixmap(UI.PixmapCache.getPixmap("syncFailed")) |
158 self.historyLabel.setPixmap(EricPixmapCache.getPixmap("syncFailed")) |
159 elif type_ == "passwords": |
159 elif type_ == "passwords": |
160 if status: |
160 if status: |
161 self.passwordsLabel.setPixmap(UI.PixmapCache.getPixmap("syncCompleted")) |
161 self.passwordsLabel.setPixmap( |
|
162 EricPixmapCache.getPixmap("syncCompleted") |
|
163 ) |
162 else: |
164 else: |
163 self.passwordsLabel.setPixmap(UI.PixmapCache.getPixmap("syncFailed")) |
165 self.passwordsLabel.setPixmap(EricPixmapCache.getPixmap("syncFailed")) |
164 elif type_ == "useragents": |
166 elif type_ == "useragents": |
165 if status: |
167 if status: |
166 self.userAgentsLabel.setPixmap( |
168 self.userAgentsLabel.setPixmap( |
167 UI.PixmapCache.getPixmap("syncCompleted") |
169 EricPixmapCache.getPixmap("syncCompleted") |
168 ) |
170 ) |
169 else: |
171 else: |
170 self.userAgentsLabel.setPixmap(UI.PixmapCache.getPixmap("syncFailed")) |
172 self.userAgentsLabel.setPixmap(EricPixmapCache.getPixmap("syncFailed")) |
171 elif type_ == "speeddial": |
173 elif type_ == "speeddial": |
172 if status: |
174 if status: |
173 self.speedDialLabel.setPixmap(UI.PixmapCache.getPixmap("syncCompleted")) |
175 self.speedDialLabel.setPixmap( |
|
176 EricPixmapCache.getPixmap("syncCompleted") |
|
177 ) |
174 else: |
178 else: |
175 self.speedDialLabel.setPixmap(UI.PixmapCache.getPixmap("syncFailed")) |
179 self.speedDialLabel.setPixmap(EricPixmapCache.getPixmap("syncFailed")) |
176 |
180 |
177 def __syncError(self, message): |
181 def __syncError(self, message): |
178 """ |
182 """ |
179 Private slot to handle general synchronization issues. |
183 Private slot to handle general synchronization issues. |
180 |
184 |