eric6/WebBrowser/SpeedDial/SpeedDial.py

changeset 7269
0c63ea7f94bd
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7268:a28338eaf694 7269:0c63ea7f94bd
8 """ 8 """
9 9
10 10
11 import os 11 import os
12 12
13 from PyQt5.QtCore import pyqtSignal, pyqtSlot, QObject, QCryptographicHash, \ 13 from PyQt5.QtCore import (
14 QByteArray, QUrl, qWarning 14 pyqtSignal, pyqtSlot, QObject, QCryptographicHash, QByteArray, QUrl,
15 qWarning
16 )
15 from PyQt5.QtGui import QPixmap 17 from PyQt5.QtGui import QPixmap
16 18
17 from E5Gui import E5MessageBox 19 from E5Gui import E5MessageBox
18 20
19 from ..Tools.WebBrowserTools import pixmapToDataUrl 21 from ..Tools.WebBrowserTools import pixmapToDataUrl
125 imgSource = "qrc:icons/loading.gif" 127 imgSource = "qrc:icons/loading.gif"
126 128
127 if not page.url: 129 if not page.url:
128 imgSource = "" 130 imgSource = ""
129 else: 131 else:
130 imgSource = \ 132 imgSource = pixmapToDataUrl(
131 pixmapToDataUrl(QPixmap(imgSource)).toString() 133 QPixmap(imgSource)).toString()
132 134
133 self.__initialScript += \ 135 self.__initialScript += (
134 "addBox('{0}', '{1}', '{2}');\n".format( 136 "addBox('{0}', '{1}', '{2}');\n").format(
135 page.url, Utilities.html_uencode(page.title), 137 page.url, Utilities.html_uencode(page.title),
136 imgSource) 138 imgSource)
137 139
138 return self.__initialScript 140 return self.__initialScript
139 141
181 183
182 if allPages: 184 if allPages:
183 self.__webPages = allPages 185 self.__webPages = allPages
184 self.pagesChanged.emit() 186 self.pagesChanged.emit()
185 else: 187 else:
186 allPages = \ 188 allPages = (
187 'url:"https://eric-ide.python-projects.org/"|'\ 189 'url:"https://eric-ide.python-projects.org/"|'
188 'title:"Eric Web Site";'\ 190 'title:"Eric Web Site";'
189 'url:"https://www.riverbankcomputing.com/"|'\ 191 'url:"https://www.riverbankcomputing.com/"|'
190 'title:"PyQt Web Site";'\ 192 'title:"PyQt Web Site";'
191 'url:"http://www.qt.io/"|title:"Qt Web Site";'\ 193 'url:"http://www.qt.io/"|title:"Qt Web Site";'
192 'url:"http://blog.qt.io/"|title:"Qt Blog";'\ 194 'url:"http://blog.qt.io/"|title:"Qt Blog";'
193 'url:"https://www.python.org"|'\ 195 'url:"https://www.python.org"|'
194 'title:"Python Language Website";'\ 196 'title:"Python Language Website";'
195 'url:"http://www.google.com"|title:"Google";' 197 'url:"http://www.google.com"|title:"Google";'
198 )
196 self.changed(allPages) 199 self.changed(allPages)
197 200
198 def save(self): 201 def save(self):
199 """ 202 """
200 Public method to save the speed dial configuration. 203 Public method to save the speed dial configuration.

eric ide

mercurial