--- a/Helpviewer/HelpWindow.py Sun May 13 12:55:08 2018 +0200 +++ b/Helpviewer/HelpWindow.py Sun May 13 12:57:00 2018 +0200 @@ -256,8 +256,11 @@ self.networkIcon = E5NetworkIcon(self) self.statusBar().addPermanentWidget(self.networkIcon) - QDesktopServices.setUrlHandler("http", self.__linkActivated) - QDesktopServices.setUrlHandler("https", self.__linkActivated) + if not self.fromEric and len(HelpWindow.helpwindows): + QDesktopServices.setUrlHandler( + "http", HelpWindow.helpwindows[0].urlHandler) + QDesktopServices.setUrlHandler( + "https", HelpWindow.helpwindows[0].urlHandler) # setup connections self.__activating = False @@ -2285,9 +2288,22 @@ Preferences.setGeometry("HelpViewerGeometry", QByteArray()) try: - if self.fromEric or len(self.__class__.helpwindows) > 1: - del self.__class__.helpwindows[ - self.__class__.helpwindows.index(self)] + browserIndex = HelpWindow.helpwindows.index(self) + if not self.__fromEric and len(HelpWindow.helpwindows): + if browserIndex == 0: + if len(HelpWindow.helpwindows) > 1: + # first window will be deleted + QDesktopServices.setUrlHandler( + "http", + HelpWindow.helpwindows[1].urlHandler) + QDesktopServices.setUrlHandler( + "https", + HelpWindow.helpwindows[1].urlHandler) + else: + QDesktopServices.unsetUrlHandler("http") + QDesktopServices.unsetUrlHandler("https") + if self.fromEric or len(HelpWindow.helpwindows) > 0: + del HelpWindow.helpwindows[browserIndex] except ValueError: pass @@ -2658,11 +2674,22 @@ QWebSettings.clearIconDatabase() @pyqtSlot(QUrl) + def urlHandler(self, url): + """ + Private slot used as desktop URL handler. + + @param url URL to be handled + @type QUrl + """ + self.__linkActivated(url) + + @pyqtSlot(QUrl) def __linkActivated(self, url): """ Private slot to handle the selection of a link in the TOC window. - @param url URL to be shown (QUrl) + @param url URL to be shown + @type QUrl """ if not self.__activating: self.__activating = True