22 WEBENGINE_AVAILABLE = True |
22 WEBENGINE_AVAILABLE = True |
23 except ImportError: |
23 except ImportError: |
24 WEBENGINE_AVAILABLE = False |
24 WEBENGINE_AVAILABLE = False |
25 |
25 |
26 from EricWidgets import EricFileDialog, EricMessageBox |
26 from EricWidgets import EricFileDialog, EricMessageBox |
|
27 from EricWidgets.EricApplication import ericApp |
27 from EricWidgets.EricTextEditSearchWidget import ( |
28 from EricWidgets.EricTextEditSearchWidget import ( |
28 EricTextEditSearchWidget, EricTextEditType |
29 EricTextEditSearchWidget, EricTextEditType |
29 ) |
30 ) |
30 |
31 |
31 import UI.PixmapCache |
32 import UI.PixmapCache |
44 """ |
45 """ |
45 Class implementing an embedded viewer for QtHelp and local HTML files. |
46 Class implementing an embedded viewer for QtHelp and local HTML files. |
46 """ |
47 """ |
47 MaxHistoryItems = 20 # max. number of history items to be shown |
48 MaxHistoryItems = 20 # max. number of history items to be shown |
48 |
49 |
|
50 EmpytDocument_Light = ( |
|
51 '''<!DOCTYPE html>\n''' |
|
52 '''<html lang="EN">\n''' |
|
53 '''<head>\n''' |
|
54 '''<style type="text/css">\n''' |
|
55 '''html {background-color: #ffffff;}\n''' |
|
56 '''body {background-color: #ffffff;\n''' |
|
57 ''' color: #000000;\n''' |
|
58 ''' margin: 10px 10px 10px 10px;\n''' |
|
59 '''}\n''' |
|
60 '''</style''' |
|
61 '''</head>\n''' |
|
62 '''<body>\n''' |
|
63 '''</body>\n''' |
|
64 '''</html>''' |
|
65 ) |
|
66 EmpytDocument_Dark = ( |
|
67 '''<!DOCTYPE html>\n''' |
|
68 '''<html lang="EN">\n''' |
|
69 '''<head>\n''' |
|
70 '''<style type="text/css">\n''' |
|
71 '''html {background-color: #262626;}\n''' |
|
72 '''body {background-color: #262626;\n''' |
|
73 ''' color: #ffffff;\n''' |
|
74 ''' margin: 10px 10px 10px 10px;\n''' |
|
75 '''}\n''' |
|
76 '''</style''' |
|
77 '''</head>\n''' |
|
78 '''<body>\n''' |
|
79 '''</body>\n''' |
|
80 '''</html>''' |
|
81 ) |
|
82 |
49 def __init__(self, parent=None): |
83 def __init__(self, parent=None): |
50 """ |
84 """ |
51 Constructor |
85 Constructor |
52 |
86 |
53 @param parent reference to the parent widget (defaults to None) |
87 @param parent reference to the parent widget (defaults to None) |
479 @pyqtSlot() |
515 @pyqtSlot() |
480 def __addNewPage(self): |
516 def __addNewPage(self): |
481 """ |
517 """ |
482 Private slot to add a new empty page. |
518 Private slot to add a new empty page. |
483 """ |
519 """ |
484 self.addPage() |
520 urlStr = self.__helpSelector.currentData() |
|
521 url = QUrl(urlStr) if bool(urlStr) else None |
|
522 self.addPage(url=url) |
485 |
523 |
486 def addPage(self, url=None, background=False): |
524 def addPage(self, url=None, background=False): |
487 """ |
525 """ |
488 Public method to add a new help page with the given URL. |
526 Public method to add a new help page with the given URL. |
489 |
527 |