22 from eric7 import Utilities |
22 from eric7 import Utilities |
23 from eric7.EricWidgets import EricMessageBox |
23 from eric7.EricWidgets import EricMessageBox |
24 from eric7.Utilities.AutoSaver import AutoSaver |
24 from eric7.Utilities.AutoSaver import AutoSaver |
25 |
25 |
26 from ..Tools.WebBrowserTools import pixmapFileToDataUrl |
26 from ..Tools.WebBrowserTools import pixmapFileToDataUrl |
|
27 from .Page import Page |
27 |
28 |
28 |
29 |
29 class SpeedDial(QObject): |
30 class SpeedDial(QObject): |
30 """ |
31 """ |
31 Class implementing the speed dial. |
32 Class implementing the speed dial. |
70 @param url URL of the page (QUrl) |
71 @param url URL of the page (QUrl) |
71 @param title title of the page (string) |
72 @param title title of the page (string) |
72 """ |
73 """ |
73 if url.isEmpty(): |
74 if url.isEmpty(): |
74 return |
75 return |
75 |
|
76 from .Page import Page |
|
77 |
76 |
78 page = Page(self.__escapeUrl(url.toString()), self.__escapeTitle(title)) |
77 page = Page(self.__escapeUrl(url.toString()), self.__escapeTitle(title)) |
79 self.__webPages.append(page) |
78 self.__webPages.append(page) |
80 self.__regenerateScript = True |
79 self.__regenerateScript = True |
81 |
80 |
174 |
173 |
175 def __load(self): |
174 def __load(self): |
176 """ |
175 """ |
177 Private method to load the speed dial configuration. |
176 Private method to load the speed dial configuration. |
178 """ |
177 """ |
|
178 from .SpeedDialReader import SpeedDialReader |
|
179 |
179 allPages, pagesPerRow, speedDialSize = [], 0, 0 |
180 allPages, pagesPerRow, speedDialSize = [], 0, 0 |
180 |
181 |
181 speedDialFile = self.getFileName() |
182 speedDialFile = self.getFileName() |
182 if os.path.exists(speedDialFile): |
183 if os.path.exists(speedDialFile): |
183 from .SpeedDialReader import SpeedDialReader |
|
184 |
|
185 reader = SpeedDialReader() |
184 reader = SpeedDialReader() |
186 allPages, pagesPerRow, speedDialSize = reader.read(speedDialFile) |
185 allPages, pagesPerRow, speedDialSize = reader.read(speedDialFile) |
187 |
186 |
188 self.__pagesPerRow = pagesPerRow if pagesPerRow else 4 |
187 self.__pagesPerRow = pagesPerRow if pagesPerRow else 4 |
189 self.__speedDialSize = speedDialSize if speedDialSize else 231 |
188 self.__speedDialSize = speedDialSize if speedDialSize else 231 |
327 |
322 |
328 @param url URL of the thumbnail (string) |
323 @param url URL of the thumbnail (string) |
329 @param loadTitle flag indicating to get the title for the thumbnail |
324 @param loadTitle flag indicating to get the title for the thumbnail |
330 from the site (boolean) |
325 from the site (boolean) |
331 """ |
326 """ |
|
327 from .PageThumbnailer import PageThumbnailer |
|
328 |
332 if not url: |
329 if not url: |
333 return |
330 return |
334 |
|
335 from .PageThumbnailer import PageThumbnailer |
|
336 |
331 |
337 thumbnailer = PageThumbnailer(self) |
332 thumbnailer = PageThumbnailer(self) |
338 thumbnailer.setUrl(QUrl.fromEncoded(url.encode("utf-8"))) |
333 thumbnailer.setUrl(QUrl.fromEncoded(url.encode("utf-8"))) |
339 thumbnailer.setLoadTitle(loadTitle) |
334 thumbnailer.setLoadTitle(loadTitle) |
340 thumbnailer.thumbnailCreated.connect( |
335 thumbnailer.thumbnailCreated.connect( |