105 Private method to generate the image file name for a URL. |
105 Private method to generate the image file name for a URL. |
106 |
106 |
107 @param url URL to generate the file name from (string) |
107 @param url URL to generate the file name from (string) |
108 @return name of the image file (string) |
108 @return name of the image file (string) |
109 """ |
109 """ |
110 return os.path.join(self.__thumbnailsDirectory, |
110 return os.path.join( |
|
111 self.__thumbnailsDirectory, |
111 str(QCryptographicHash.hash(QByteArray(url.encode("utf-8")), |
112 str(QCryptographicHash.hash(QByteArray(url.encode("utf-8")), |
112 QCryptographicHash.Md5).toHex(), encoding="utf-8") + ".png") |
113 QCryptographicHash.Md5).toHex(), encoding="utf-8") + ".png") |
113 |
114 |
114 def initialScript(self): |
115 def initialScript(self): |
115 """ |
116 """ |
203 Public method to save the speed dial configuration. |
204 Public method to save the speed dial configuration. |
204 """ |
205 """ |
205 from .SpeedDialWriter import SpeedDialWriter |
206 from .SpeedDialWriter import SpeedDialWriter |
206 speedDialFile = self.getFileName() |
207 speedDialFile = self.getFileName() |
207 writer = SpeedDialWriter() |
208 writer = SpeedDialWriter() |
208 if not writer.write(speedDialFile, |
209 if not writer.write(speedDialFile, self.__webPages, |
209 self.__webPages, self.__pagesPerRow, self.__speedDialSize): |
210 self.__pagesPerRow, self.__speedDialSize): |
210 E5MessageBox.critical(None, |
211 E5MessageBox.critical( |
|
212 None, |
211 self.trUtf8("Saving Speed Dial data"), |
213 self.trUtf8("Saving Speed Dial data"), |
212 self.trUtf8( |
214 self.trUtf8( |
213 """<p>Speed Dial data could not be saved to""" |
215 """<p>Speed Dial data could not be saved to""" |
214 """ <b>{0}</b></p>""").format(speedDialFile)) |
216 """ <b>{0}</b></p>""").format(speedDialFile)) |
215 else: |
217 else: |