Helpviewer/SpeedDial/SpeedDial.py

branch
5_5_x
changeset 3796
242c02148f00
parent 3484
645c12de6b0c
child 3872
f6c8fa48a703
equal deleted inserted replaced
3791:65dd3f34e0b2 3796:242c02148f00
136 else: 136 else:
137 imgSource = QUrl.fromLocalFile(imgSource).toString() 137 imgSource = QUrl.fromLocalFile(imgSource).toString()
138 138
139 self.__initialScript += \ 139 self.__initialScript += \
140 "addBox('{0}', '{1}', '{2}');\n".format( 140 "addBox('{0}', '{1}', '{2}');\n".format(
141 page.url, page.title, imgSource) 141 page.url, Utilities.html_uencode(page.title),
142 imgSource)
142 143
143 return self.__initialScript 144 return self.__initialScript
144 145
145 def getFileName(self): 146 def getFileName(self):
146 """ 147 """
321 322
322 @param url URL entered by the user (string) 323 @param url URL entered by the user (string)
323 @return sanitized URL (string) 324 @return sanitized URL (string)
324 """ 325 """
325 return QUrl.fromUserInput(url).toString() 326 return QUrl.fromUserInput(url).toString()
327
328 @pyqtSlot(str, result=str)
329 def unescapeTitle(self, title):
330 """
331 Public slot to unescape the titel string.
332
333 @param title escaped title (string)
334 @return un-escaped title (string)
335 """
336 return Utilities.html_udecode(title)
326 337
327 @pyqtSlot(int) 338 @pyqtSlot(int)
328 def setPagesInRow(self, count): 339 def setPagesInRow(self, count):
329 """ 340 """
330 Public slot to set the number of pages per row. 341 Public slot to set the number of pages per row.
396 for frame in self.__cleanFrames(): 407 for frame in self.__cleanFrames():
397 frame.evaluateJavaScript("setImageToUrl('{0}', '{1}');".format( 408 frame.evaluateJavaScript("setImageToUrl('{0}', '{1}');".format(
398 url, fileName)) 409 url, fileName))
399 if loadTitle: 410 if loadTitle:
400 frame.evaluateJavaScript("setTitleToUrl('{0}', '{1}');".format( 411 frame.evaluateJavaScript("setTitleToUrl('{0}', '{1}');".format(
401 url, title)) 412 url, Utilities.html_uencode(title)))
402 413
403 thumbnailer.deleteLater() 414 thumbnailer.deleteLater()
404 self.__thumbnailers.remove(thumbnailer) 415 self.__thumbnailers.remove(thumbnailer)
405 416
406 def __cleanFrames(self): 417 def __cleanFrames(self):

eric ide

mercurial