37 super(SafeBrowsingDialog, self).__init__(parent) |
37 super(SafeBrowsingDialog, self).__init__(parent) |
38 self.setupUi(self) |
38 self.setupUi(self) |
39 self.setWindowFlags(Qt.Window) |
39 self.setWindowFlags(Qt.Window) |
40 |
40 |
41 self.__manager = manager |
41 self.__manager = manager |
|
42 self.__manager.progressMessage.connect(self.__setProgressMessage) |
|
43 self.__manager.progress.connect(self.__setProgress) |
42 |
44 |
43 self.__saveButton = self.buttonBox.addButton( |
45 self.__saveButton = self.buttonBox.addButton( |
44 self.tr("Save"), QDialogButtonBox.ActionRole) |
46 self.tr("Save"), QDialogButtonBox.ActionRole) |
45 |
47 |
46 self.iconLabel.setPixmap( |
48 self.iconLabel.setPixmap( |
171 """ |
173 """ |
172 Private slot to update the local cache database. |
174 Private slot to update the local cache database. |
173 """ |
175 """ |
174 QApplication.setOverrideCursor(Qt.WaitCursor) |
176 QApplication.setOverrideCursor(Qt.WaitCursor) |
175 ok, error = self.__manager.updateHashPrefixCache() |
177 ok, error = self.__manager.updateHashPrefixCache() |
|
178 self.__resetProgress() |
176 QApplication.restoreOverrideCursor() |
179 QApplication.restoreOverrideCursor() |
177 ## QApplication.processEvents() |
|
178 if not ok: |
180 if not ok: |
179 if error: |
181 if error: |
180 E5MessageBox.critical( |
182 E5MessageBox.critical( |
181 self, |
183 self, |
182 self.tr("Update Safe Browsing Cache"), |
184 self.tr("Update Safe Browsing Cache"), |
193 def on_clearCacheButton_clicked(self): |
195 def on_clearCacheButton_clicked(self): |
194 """ |
196 """ |
195 Private slot to clear the local cache database. |
197 Private slot to clear the local cache database. |
196 """ |
198 """ |
197 self.__manager.fullCacheCleanup() |
199 self.__manager.fullCacheCleanup() |
|
200 |
|
201 @pyqtSlot(str, int) |
|
202 def __setProgressMessage(self, message, maximum): |
|
203 """ |
|
204 Private slot to set the progress message and the maximum value. |
|
205 |
|
206 @param message progress message to be set |
|
207 @type str |
|
208 @param maximum maximum value to be set |
|
209 @type int |
|
210 """ |
|
211 self.progressLabel.setText(message) |
|
212 self.progressBar.setMaximum(maximum) |
|
213 self.progressBar.setValue(0) |
|
214 |
|
215 @pyqtSlot(int) |
|
216 def __setProgress(self, value): |
|
217 """ |
|
218 Private slot to set the progress value. |
|
219 |
|
220 @param value progress value to be set |
|
221 @type int |
|
222 """ |
|
223 self.progressBar.setValue(value) |
|
224 |
|
225 def __resetProgress(self): |
|
226 """ |
|
227 Private method to reset the progress info. |
|
228 """ |
|
229 self.progressLabel.clear() |
|
230 self.progressBar.setMaximum(100) |
|
231 self.progressBar.setValue(0) |