7 Module implementing the speed dial. |
7 Module implementing the speed dial. |
8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 try: |
11 try: |
12 str = unicode # __IGNORE_WARNING__ |
12 str = unicode |
13 except (NameError): |
13 except NameError: |
14 pass |
14 pass |
15 |
15 |
16 import os |
16 import os |
17 |
17 |
18 from PyQt4.QtCore import pyqtSignal, pyqtSlot, QObject, QCryptographicHash, \ |
18 from PyQt4.QtCore import pyqtSignal, pyqtSlot, QObject, QCryptographicHash, \ |
208 writer = SpeedDialWriter() |
208 writer = SpeedDialWriter() |
209 if not writer.write(speedDialFile, self.__webPages, |
209 if not writer.write(speedDialFile, self.__webPages, |
210 self.__pagesPerRow, self.__speedDialSize): |
210 self.__pagesPerRow, self.__speedDialSize): |
211 E5MessageBox.critical( |
211 E5MessageBox.critical( |
212 None, |
212 None, |
213 self.trUtf8("Saving Speed Dial data"), |
213 self.tr("Saving Speed Dial data"), |
214 self.trUtf8( |
214 self.tr( |
215 """<p>Speed Dial data could not be saved to""" |
215 """<p>Speed Dial data could not be saved to""" |
216 """ <b>{0}</b></p>""").format(speedDialFile)) |
216 """ <b>{0}</b></p>""").format(speedDialFile)) |
217 else: |
217 else: |
218 self.speedDialSaved.emit() |
218 self.speedDialSaved.emit() |
219 |
219 |
377 url = thumbnailer.url().toString() |
377 url = thumbnailer.url().toString() |
378 fileName = self.__imageFileName(url) |
378 fileName = self.__imageFileName(url) |
379 |
379 |
380 if image.isNull(): |
380 if image.isNull(): |
381 fileName = "qrc:icons/brokenPage.png" |
381 fileName = "qrc:icons/brokenPage.png" |
382 title = self.trUtf8("Unable to load") |
382 title = self.tr("Unable to load") |
383 loadTitle = True |
383 loadTitle = True |
384 page = self.pageForUrl(thumbnailer.url()) |
384 page = self.pageForUrl(thumbnailer.url()) |
385 page.broken = True |
385 page.broken = True |
386 else: |
386 else: |
387 if not image.save(fileName): |
387 if not image.save(fileName): |