diff -r b108ff4d845c -r 8438a5a0437f eric7/HelpViewer/HelpViewerWidget.py --- a/eric7/HelpViewer/HelpViewerWidget.py Mon Oct 18 16:43:02 2021 +0200 +++ b/eric7/HelpViewer/HelpViewerWidget.py Mon Oct 18 16:44:29 2021 +0200 @@ -21,7 +21,7 @@ from PyQt6.QtWebEngineCore import QWebEngineProfile, QWebEngineSettings WEBENGINE_AVAILABLE = True except ImportError: - WEBENGINE_AVAILABLE = True + WEBENGINE_AVAILABLE = False from EricWidgets import EricFileDialog, EricMessageBox @@ -148,8 +148,26 @@ self.__buttonLine2.setFrameShadow(QFrame.Shadow.Sunken) self.__navButtonsLayout.addWidget(self.__buttonLine2) - # TODO: add plus button to open a new page (about:blank) - # TODO: add minus button to close the current page + self.__addPageButton = QToolButton(self) + self.__addPageButton.setIcon(UI.PixmapCache.getIcon("plus")) + self.__addPageButton.setToolTip( + self.tr("Add a new empty page")) + self.__addPageButton.clicked.connect(self.__addNewPage) + self.__navButtonsLayout.addWidget(self.__addPageButton) + + self.__closePageButton = QToolButton(self) + self.__closePageButton.setIcon(UI.PixmapCache.getIcon("minus")) + self.__closePageButton.setToolTip( + self.tr("Close the current page")) + self.__closePageButton.clicked.connect(self.closeCurrentPage) + self.__navButtonsLayout.addWidget(self.__closePageButton) + + self.__buttonLine3 = QFrame(self) + self.__buttonLine3.setFrameShape(QFrame.Shape.VLine) + self.__buttonLine3.setFrameShadow(QFrame.Shadow.Sunken) + self.__navButtonsLayout.addWidget(self.__buttonLine3) + + # TODO: add find button to show the find widget self.__navButtonsLayout.addStretch() @@ -396,6 +414,13 @@ if htmlFile: self.currentViewer().setLink(QUrl.fromLocalFile(htmlFile)) + @pyqtSlot() + def __addNewPage(self): + """ + Private slot to add a new empty page. + """ + self.addPage() + def addPage(self, url=None, background=False): """ Public method to add a new help page with the given URL. @@ -412,7 +437,7 @@ url = QUrl("about:blank") viewer = self.__newViewer() - viewer.setUrl(url) + viewer.setLink(url) cv = self.currentViewer() if background and bool(cv):