96 @param home the URL to be shown (string) |
96 @param home the URL to be shown (string) |
97 @param path the path of the working dir (usually '.') (string) |
97 @param path the path of the working dir (usually '.') (string) |
98 @param parent parent widget of this window (QWidget) |
98 @param parent parent widget of this window (QWidget) |
99 @param name name of this window (string) |
99 @param name name of this window (string) |
100 @param fromEric flag indicating whether it was called from within |
100 @param fromEric flag indicating whether it was called from within |
101 eric5 (boolean) |
101 eric6 (boolean) |
102 @keyparam initShortcutsOnly flag indicating to just initialize the |
102 @keyparam initShortcutsOnly flag indicating to just initialize the |
103 keyboard shortcuts (boolean) |
103 keyboard shortcuts (boolean) |
104 @keyparam searchWord word to search for (string) |
104 @keyparam searchWord word to search for (string) |
105 """ |
105 """ |
106 super(HelpWindow, self).__init__(parent) |
106 super(HelpWindow, self).__init__(parent) |
107 self.setObjectName(name) |
107 self.setObjectName(name) |
108 self.setWindowTitle(self.tr("eric5 Web Browser")) |
108 self.setWindowTitle(self.tr("eric6 Web Browser")) |
109 |
109 |
110 self.fromEric = fromEric |
110 self.fromEric = fromEric |
111 self.__class__._fromEric = fromEric |
111 self.__class__._fromEric = fromEric |
112 self.initShortcutsOnly = initShortcutsOnly |
112 self.initShortcutsOnly = initShortcutsOnly |
113 self.setWindowIcon(UI.PixmapCache.getIcon("ericWeb.png")) |
113 self.setWindowIcon(UI.PixmapCache.getIcon("ericWeb.png")) |
137 Preferences.getUI("StyleSheet")) |
137 Preferences.getUI("StyleSheet")) |
138 |
138 |
139 if self.useQtHelp: |
139 if self.useQtHelp: |
140 self.__helpEngine = \ |
140 self.__helpEngine = \ |
141 QHelpEngine(os.path.join(Utilities.getConfigDir(), |
141 QHelpEngine(os.path.join(Utilities.getConfigDir(), |
142 "browser", "eric5help.qhc"), self) |
142 "browser", "eric6help.qhc"), self) |
143 self.__removeOldDocumentation() |
143 self.__removeOldDocumentation() |
144 self.__helpEngine.warning.connect(self.__warning) |
144 self.__helpEngine.warning.connect(self.__warning) |
145 else: |
145 else: |
146 self.__helpEngine = None |
146 self.__helpEngine = None |
147 self.__helpInstaller = None |
147 self.__helpInstaller = None |
678 self.tr('Quit'), |
678 self.tr('Quit'), |
679 UI.PixmapCache.getIcon("exit.png"), |
679 UI.PixmapCache.getIcon("exit.png"), |
680 self.tr('&Quit'), |
680 self.tr('&Quit'), |
681 QKeySequence(self.tr("Ctrl+Q", "File|Quit")), |
681 QKeySequence(self.tr("Ctrl+Q", "File|Quit")), |
682 0, self, 'help_file_quit') |
682 0, self, 'help_file_quit') |
683 self.exitAct.setStatusTip(self.tr('Quit the eric5 Web Browser')) |
683 self.exitAct.setStatusTip(self.tr('Quit the eric6 Web Browser')) |
684 self.exitAct.setWhatsThis(self.tr( |
684 self.exitAct.setWhatsThis(self.tr( |
685 """<b>Quit</b>""" |
685 """<b>Quit</b>""" |
686 """<p>Quit the eric5 Web Browser.</p>""" |
686 """<p>Quit the eric6 Web Browser.</p>""" |
687 )) |
687 )) |
688 if not self.initShortcutsOnly: |
688 if not self.initShortcutsOnly: |
689 if self.fromEric: |
689 if self.fromEric: |
690 self.exitAct.triggered.connect(self.close) |
690 self.exitAct.triggered.connect(self.close) |
691 else: |
691 else: |
2069 """ |
2069 """ |
2070 Private slot to show the about information. |
2070 Private slot to show the about information. |
2071 """ |
2071 """ |
2072 E5MessageBox.about( |
2072 E5MessageBox.about( |
2073 self, |
2073 self, |
2074 self.tr("eric5 Web Browser"), |
2074 self.tr("eric6 Web Browser"), |
2075 self.tr( |
2075 self.tr( |
2076 """<b>eric5 Web Browser - {0}</b>""" |
2076 """<b>eric6 Web Browser - {0}</b>""" |
2077 """<p>The eric5 Web Browser is a combined help file and HTML""" |
2077 """<p>The eric6 Web Browser is a combined help file and HTML""" |
2078 """ browser. It is part of the eric5 development""" |
2078 """ browser. It is part of the eric6 development""" |
2079 """ toolset.</p>""" |
2079 """ toolset.</p>""" |
2080 ).format(Version)) |
2080 ).format(Version)) |
2081 |
2081 |
2082 def __aboutQt(self): |
2082 def __aboutQt(self): |
2083 """ |
2083 """ |
2084 Private slot to show info about Qt. |
2084 Private slot to show info about Qt. |
2085 """ |
2085 """ |
2086 E5MessageBox.aboutQt(self, self.tr("eric5 Web Browser")) |
2086 E5MessageBox.aboutQt(self, self.tr("eric6 Web Browser")) |
2087 |
2087 |
2088 def setBackwardAvailable(self, b): |
2088 def setBackwardAvailable(self, b): |
2089 """ |
2089 """ |
2090 Public slot called when backward references are available. |
2090 Public slot called when backward references are available. |
2091 |
2091 |
2628 @param url URL to be shown (QUrl) |
2628 @param url URL to be shown (QUrl) |
2629 """ |
2629 """ |
2630 if not self.__activating: |
2630 if not self.__activating: |
2631 self.__activating = True |
2631 self.__activating = True |
2632 req = QNetworkRequest(url) |
2632 req = QNetworkRequest(url) |
2633 req.setRawHeader("X-Eric5-UserLoadAction", b"1") |
2633 req.setRawHeader("X-Eric6-UserLoadAction", b"1") |
2634 self.currentBrowser().setSource( |
2634 self.currentBrowser().setSource( |
2635 None, (req, QNetworkAccessManager.GetOperation, b"")) |
2635 None, (req, QNetworkAccessManager.GetOperation, b"")) |
2636 self.__activating = False |
2636 self.__activating = False |
2637 |
2637 |
2638 def __linksActivated(self, links, keyword): |
2638 def __linksActivated(self, links, keyword): |
2869 |
2869 |
2870 @param message message to be shown (string) |
2870 @param message message to be shown (string) |
2871 """ |
2871 """ |
2872 E5MessageBox.warning( |
2872 E5MessageBox.warning( |
2873 self, |
2873 self, |
2874 self.tr("eric5 Web Browser"), |
2874 self.tr("eric6 Web Browser"), |
2875 message) |
2875 message) |
2876 |
2876 |
2877 def __docsInstalled(self, installed): |
2877 def __docsInstalled(self, installed): |
2878 """ |
2878 """ |
2879 Private slot handling the end of documentation installation. |
2879 Private slot handling the end of documentation installation. |
3202 |
3202 |
3203 @param url url to be opened (QUrl) |
3203 @param url url to be opened (QUrl) |
3204 @param title title of the bookmark (string) |
3204 @param title title of the bookmark (string) |
3205 """ |
3205 """ |
3206 req = QNetworkRequest(url) |
3206 req = QNetworkRequest(url) |
3207 req.setRawHeader("X-Eric5-UserLoadAction", b"1") |
3207 req.setRawHeader("X-Eric6-UserLoadAction", b"1") |
3208 self.newTab(None, (req, QNetworkAccessManager.GetOperation, b"")) |
3208 self.newTab(None, (req, QNetworkAccessManager.GetOperation, b"")) |
3209 |
3209 |
3210 @classmethod |
3210 @classmethod |
3211 def historyManager(cls): |
3211 def historyManager(cls): |
3212 """ |
3212 """ |