eric7/WebBrowser/WebBrowserWindow.py

branch
eric7
changeset 8565
207b47c2eed9
parent 8564
c48137b0d7ba
child 8580
e91b276e0771
--- a/eric7/WebBrowser/WebBrowserWindow.py	Tue Aug 31 19:56:40 2021 +0200
+++ b/eric7/WebBrowser/WebBrowserWindow.py	Wed Sep 01 18:11:31 2021 +0200
@@ -29,7 +29,7 @@
     QWebEngineSettings, QWebEnginePage, QWebEngineProfile, QWebEngineScript
 )
 try:
-    from PyQt6.QtHelp import QHelpEngine, QHelpEngineCore, QHelpFilterData
+    from PyQt6.QtHelp import QHelpEngine
     QTHELP_AVAILABLE = True
 except ImportError:
     QTHELP_AVAILABLE = False
@@ -197,6 +197,8 @@
             self.__helpEngine = QHelpEngine(
                 WebBrowserWindow.getQtHelpCollectionFileName(),
                 self)
+            self.__helpEngine.setReadOnly(False)
+            self.__helpEngine.setupData()
             self.__helpEngine.setUsesFilterEngine(True)
             self.__removeOldDocumentation()
             self.__helpEngine.warning.connect(self.__warning)
@@ -271,7 +273,6 @@
                                self.__indexDock)
             
             # setup the search widget
-            self.__searchWord = searchWord
             self.__indexing = False
             self.__indexingProgress = None
             self.__searchEngine = self.__helpEngine.searchEngine()
@@ -437,8 +438,6 @@
         state = Preferences.getWebBrowser("WebBrowserState")
         self.restoreState(state)
         
-        self.__initHelpDb()
-        
         self.__virusTotal = VirusTotalAPI(self)
         self.__virusTotal.submitUrlError.connect(
             self.__virusTotalSubmitUrlError)
@@ -478,8 +477,8 @@
         
         if WebBrowserWindow._useQtHelp:
             QTimer.singleShot(50, self.__lookForNewDocumentation)
-            if self.__searchWord is not None:
-                QTimer.singleShot(0, self.__searchForWord)
+            if searchWord:
+                QTimer.singleShot(0, lambda: self.__searchForWord(searchWord))
     
     def __del__(self):
         """
@@ -2311,7 +2310,7 @@
             filtertb.addWidget(QLabel(self.tr("Filtered by: ")))
             filtertb.addWidget(self.filterCombo)
             self.__helpEngine.setupFinished.connect(self.__setupFilterCombo)
-            self.filterCombo.currentTextChanged.connect(
+            self.filterCombo.currentIndexChanged.connect(
                 self.__filterQtHelpDocumentation)
             self.__setupFilterCombo()
             self.__toolbars["filter"] = (filtertb.windowTitle(), filtertb)
@@ -2352,7 +2351,8 @@
         vttb.addAction(self.virustotalIpReportAct)
         vttb.addAction(self.virustotalDomainReportAct)
         self.__toolbars["virustotal"] = (vttb.windowTitle(), vttb)
-        
+    
+    @pyqtSlot()
     def __nextTab(self):
         """
         Private slot used to show the next tab.
@@ -2362,7 +2362,8 @@
             fwidget = fwidget.parent()
         if fwidget:
             fwidget.nextTab()
-        
+    
+    @pyqtSlot()
     def __prevTab(self):
         """
         Private slot used to show the previous tab.
@@ -2372,7 +2373,8 @@
             fwidget = fwidget.parent()
         if fwidget:
             fwidget.prevTab()
-        
+    
+    @pyqtSlot()
     def __switchTab(self):
         """
         Private slot used to switch between the current and the previous
@@ -2383,19 +2385,22 @@
             fwidget = fwidget.parent()
         if fwidget:
             fwidget.switchTab()
-        
+    
+    @pyqtSlot()
     def __whatsThis(self):
         """
         Private slot called in to enter Whats This mode.
         """
         QWhatsThis.enterWhatsThisMode()
-        
+    
     def __titleChanged(self, browser, title):
         """
         Private slot called to handle a change of a browser's title.
         
-        @param browser reference to the browser (WebBrowserView)
-        @param title new title (string)
+        @param browser reference to the browser
+        @type WebBrowserView
+        @param title new title
+        @type str
         """
         self.historyManager().updateHistoryEntry(
             browser.url().toString(), title)
@@ -2484,6 +2489,7 @@
                 ).format(applPath),
                 self.tr('OK'))
     
+    @pyqtSlot()
     def __openFile(self):
         """
         Private slot called to open a file.
@@ -2503,7 +2509,8 @@
             else:
                 url = "file://" + fn
             self.currentBrowser().setSource(QUrl(url))
-        
+    
+    @pyqtSlot()
     def __openFileNewTab(self):
         """
         Private slot called to open a file in a new tab.
@@ -2523,7 +2530,8 @@
             else:
                 url = "file://" + fn
             self.newTab(url)
-        
+    
+    @pyqtSlot()
     def __savePageAs(self):
         """
         Private slot to save the current page.
@@ -2541,7 +2549,8 @@
         from .PageScreenDialog import PageScreenDialog
         self.__pageScreen = PageScreenDialog(self.currentBrowser())
         self.__pageScreen.show()
-        
+    
+    @pyqtSlot()
     def __about(self):
         """
         Private slot to show the about information.
@@ -2559,43 +2568,50 @@
                 """ toolset.</p>"""
                 """<p>It is based on QtWebEngine {1} and Chrome {2}.</p>"""
             ).format(Version, webengineVersion, chromeVersion))
-        
+    
+    @pyqtSlot()
     def __aboutQt(self):
         """
         Private slot to show info about Qt.
         """
         EricMessageBox.aboutQt(self, self.tr("eric Web Browser"))
-
+    
+    @pyqtSlot(bool)
     def setBackwardAvailable(self, b):
         """
         Public slot called when backward references are available.
         
-        @param b flag indicating availability of the backwards action (boolean)
+        @param b flag indicating availability of the backwards action
+        @type bool
         """
         self.backAct.setEnabled(b)
         self.__navigationBar.backButton().setEnabled(b)
-        
+    
+    @pyqtSlot(bool)
     def setForwardAvailable(self, b):
         """
         Public slot called when forward references are available.
         
         @param b flag indicating the availability of the forwards action
-            (boolean)
+        @type bool
         """
         self.forwardAct.setEnabled(b)
         self.__navigationBar.forwardButton().setEnabled(b)
-        
+    
+    @pyqtSlot(bool)
     def setLoadingActions(self, b):
         """
         Public slot to set the loading dependent actions.
         
-        @param b flag indicating the loading state to consider (boolean)
+        @param b flag indicating the loading state to consider
+        @type bool
         """
         self.reloadAct.setEnabled(not b)
         self.stopAct.setEnabled(b)
         
         self.__navigationBar.reloadStopButton().setLoading(b)
-        
+    
+    @pyqtSlot()
     def __addBookmark(self):
         """
         Private slot called to add the displayed file to the bookmarks.
@@ -2638,7 +2654,8 @@
         idx = self.bookmarksManager().bookmarksModel().nodeIndex(menu)
         dlg.setCurrentIndex(idx)
         dlg.exec()
-        
+    
+    @pyqtSlot()
     def __addBookmarkFolder(self):
         """
         Private slot to add a new bookmarks folder.
@@ -2650,7 +2667,8 @@
         dlg.setCurrentIndex(idx)
         dlg.setFolder(True)
         dlg.exec()
-        
+    
+    @pyqtSlot()
     def __showBookmarksDialog(self):
         """
         Private slot to show the bookmarks dialog.
@@ -2662,7 +2680,8 @@
         self.__bookmarksDialog.newBackgroundTab.connect(
             self.openUrlNewBackgroundTab)
         self.__bookmarksDialog.show()
-        
+    
+    @pyqtSlot()
     def bookmarkAll(self):
         """
         Public slot to bookmark all open tabs.
@@ -2715,7 +2734,8 @@
         bookmark.desc = description
         
         self.bookmarksManager().addBookmark(folder, bookmark)
-        
+    
+    @pyqtSlot()
     def __find(self):
         """
         Private slot to handle the find action.
@@ -2872,7 +2892,8 @@
         """
         Public method to shut down the web browser.
         
-        @return flag indicating successful shutdown (boolean)
+        @return flag indicating successful shutdown
+        @rtype bool
         """
         if not self.__shallShutDown():
             return False
@@ -2926,45 +2947,53 @@
         self.close()
         
         return True
-
+    
+    @pyqtSlot()
     def __backward(self):
         """
         Private slot called to handle the backward action.
         """
         self.currentBrowser().backward()
     
+    @pyqtSlot()
     def __forward(self):
         """
         Private slot called to handle the forward action.
         """
         self.currentBrowser().forward()
     
+    @pyqtSlot()
     def __home(self):
         """
         Private slot called to handle the home action.
         """
         self.currentBrowser().home()
     
+    @pyqtSlot()
     def __reload(self):
         """
         Private slot called to handle the reload action.
         """
         self.currentBrowser().reloadBypassingCache()
     
+    @pyqtSlot()
     def __stopLoading(self):
         """
         Private slot called to handle loading of the current page.
         """
         self.currentBrowser().stop()
     
+    @pyqtSlot(int)
     def __zoomValueChanged(self, value):
         """
         Private slot to handle value changes of the zoom widget.
         
-        @param value zoom value (integer)
+        @param value zoom value
+        @type int
         """
         self.currentBrowser().setZoomValue(value)
     
+    @pyqtSlot()
     def __zoomIn(self):
         """
         Private slot called to handle the zoom in action.
@@ -2972,6 +3001,7 @@
         self.currentBrowser().zoomIn()
         self.__zoomWidget.setValue(self.currentBrowser().zoomValue())
     
+    @pyqtSlot()
     def __zoomOut(self):
         """
         Private slot called to handle the zoom out action.
@@ -2979,6 +3009,7 @@
         self.currentBrowser().zoomOut()
         self.__zoomWidget.setValue(self.currentBrowser().zoomValue())
     
+    @pyqtSlot()
     def __zoomReset(self):
         """
         Private slot called to handle the zoom reset action.
@@ -2986,6 +3017,7 @@
         self.currentBrowser().zoomReset()
         self.__zoomWidget.setValue(self.currentBrowser().zoomValue())
     
+    @pyqtSlot()
     def toggleFullScreen(self):
         """
         Public slot called to toggle the full screen mode.
@@ -3020,6 +3052,7 @@
         """
         return self.isFullScreen() and self.__navigationContainer.isVisible()
     
+    @pyqtSlot()
     def showFullScreenNavigation(self):
         """
         Public slot to show full screen navigation.
@@ -3033,6 +3066,7 @@
         self.__navigationContainer.show()
         self.__tabWidget.tabBar().show()
     
+    @pyqtSlot()
     def hideFullScreenNavigation(self):
         """
         Public slot to hide full screen navigation.
@@ -3040,6 +3074,7 @@
         if not self.__hideNavigationTimer.isActive():
             self.__hideNavigationTimer.start()
     
+    @pyqtSlot()
     def __hideNavigation(self):
         """
         Private slot to hide full screen navigation by timer.
@@ -3051,42 +3086,49 @@
             self.__navigationContainer.hide()
             self.__tabWidget.tabBar().hide()
     
+    @pyqtSlot()
     def __copy(self):
         """
         Private slot called to handle the copy action.
         """
         self.currentBrowser().copy()
     
+    @pyqtSlot()
     def __cut(self):
         """
         Private slot called to handle the cut action.
         """
         self.currentBrowser().cut()
     
+    @pyqtSlot()
     def __paste(self):
         """
         Private slot called to handle the paste action.
         """
         self.currentBrowser().paste()
     
+    @pyqtSlot()
     def __undo(self):
         """
         Private slot to handle the undo action.
         """
         self.currentBrowser().undo()
     
+    @pyqtSlot()
     def __redo(self):
         """
         Private slot to handle the redo action.
         """
         self.currentBrowser().redo()
     
+    @pyqtSlot()
     def __selectAll(self):
         """
         Private slot to handle the select all action.
         """
         self.currentBrowser().selectAll()
     
+    @pyqtSlot()
     def __unselect(self):
         """
         Private slot to clear the selection of the current browser.
@@ -3144,11 +3186,13 @@
         """
         return self.__tabWidget.browsers()
     
+    @pyqtSlot(int)
     def __currentChanged(self, index):
         """
         Private slot to handle the currentChanged signal.
         
-        @param index index of the current tab (integer)
+        @param index index of the current tab
+        @type int
         """
         if index > -1:
             cb = self.currentBrowser()
@@ -3160,6 +3204,7 @@
                 # set value of zoom widget
                 self.__zoomWidget.setValue(cb.zoomValue())
     
+    @pyqtSlot()
     def __showPreferences(self):
         """
         Private slot to set the preferences.
@@ -3186,6 +3231,7 @@
             self.preferencesChanged()
         self.__lastConfigurationPageName = dlg.getConfigurationPageName()
     
+    @pyqtSlot()
     def preferencesChanged(self):
         """
         Public slot to handle a change of preferences.
@@ -3259,6 +3305,7 @@
             Preferences.convertPasswords(oldPassword, newPassword)
             Utilities.crypto.changeRememberedMaster(newPassword)
     
+    @pyqtSlot()
     def __showAcceptedLanguages(self):
         """
         Private slot to configure the accepted languages for web pages.
@@ -3268,6 +3315,7 @@
         dlg.exec()
         self.networkManager().languagesChanged()
     
+    @pyqtSlot()
     def __showCookiesConfiguration(self):
         """
         Private slot to configure the cookies handling.
@@ -3344,13 +3392,15 @@
             cls._cookieJar = CookieJar()
         
         return cls._cookieJar
-        
+    
+    @pyqtSlot()
     def __clearIconsDatabase(self):
         """
         Private slot to clear the favicons databse.
         """
         WebIconProvider.instance().clear()
     
+    @pyqtSlot()
     def __showWebIconsDialog(self):
         """
         Private slot to show a dialog to manage the favicons database.
@@ -3384,12 +3434,14 @@
                 cb.setUrl(url)
             self.__activating = False
     
+    @pyqtSlot()
     def __activateCurrentBrowser(self):
         """
         Private slot to activate the current browser.
         """
         self.currentBrowser().setFocus()
         
+    @pyqtSlot()
     def __syncTOC(self):
         """
         Private slot to synchronize the TOC with the currently shown page.
@@ -3400,7 +3452,8 @@
                 self.__showTocWindow()
                 if not self.__tocWindow.syncToContent(url):
                     self.statusBar().showMessage(
-                        self.tr("Could not find an associated content."), 5000)
+                        self.tr("Could not find any associated content."),
+                        5000)
         
     def __showTocWindow(self):
         """
@@ -3432,7 +3485,8 @@
         widget.parent().show()
         widget.parent().raise_()
         widget.setFocus()
-        
+    
+    @pyqtSlot()
     def __setupFilterCombo(self):
         """
         Private slot to setup the filter combo box.
@@ -3441,21 +3495,28 @@
             activeFilter = self.filterCombo.currentText()
             if not activeFilter:
                 activeFilter = self.__helpEngine.filterEngine().activeFilter()
+            allFilters = self.__helpEngine.filterEngine().filters()
             self.filterCombo.clear()
-            self.filterCombo.addItems(sorted(
-                self.__helpEngine.filterEngine().filters()))
+            self.filterCombo.addItem(self.tr("Unfiltered"))
+            if allFilters:
+                self.filterCombo.insertSeparator(1)
+                for helpFilter in sorted(allFilters):
+                    self.filterCombo.addItem(helpFilter, helpFilter)
             self.filterCombo.setCurrentText(activeFilter)
-        
-    def __filterQtHelpDocumentation(self, activeFilter):
+    
+    @pyqtSlot(int)
+    def __filterQtHelpDocumentation(self, index):
         """
         Private slot to filter the QtHelp documentation.
         
-        @param activeFilter current text of the filter combobox
-        @type str
+        @param index index of the selected QtHelp documentation filter
+        @type int
         """
         if self.__helpEngine:
-            self.__helpEngine.filterEngine().setActiveFilter(activeFilter)
-        
+            helpFilter = self.filterCombo.itemData(index)
+            self.__helpEngine.filterEngine().setActiveFilter(helpFilter)
+    
+    @pyqtSlot()
     def __manageQtHelpDocumentation(self):
         """
         Private slot to manage the QtHelp documentation database.
@@ -3476,6 +3537,7 @@
         """
         return self.__tabWidget.getSourceFileList()
     
+    @pyqtSlot()
     def __indexingStarted(self):
         """
         Private slot to handle the start of the indexing process.
@@ -3502,7 +3564,8 @@
                 
                 self.statusBar().insertPermanentWidget(
                     0, self.__indexingProgress)
-        
+    
+    @pyqtSlot()
     def __indexingFinished(self):
         """
         Private slot to handle the start of the indexing process.
@@ -3511,33 +3574,38 @@
             self.statusBar().removeWidget(self.__indexingProgress)
             self.__indexingProgress = None
             self.__indexing = False
-            if self.__searchWord is not None:
-                self.__searchForWord()
-        
-    def __searchForWord(self):
+    
+    @pyqtSlot(str)
+    def __searchForWord(self, searchWord):
         """
         Private slot to search for a word.
-        """
-        if (
-            WebBrowserWindow._useQtHelp and
-            not self.__indexing and
-            self.__searchWord is not None
-        ):
-            self.__searchDock.show()
-            self.__searchDock.raise_()
-            self.__searchEngine.search(self.__searchWord)
-            self.__searchWord = None
+        
+        @param searchWord word to search for
+        @type str
+        """
+        if WebBrowserWindow._useQtHelp and searchWord:
+            if self.__indexing:
+                # Try again a second later
+                QTimer.singleShot(
+                    1000,
+                    lambda: self.__searchForWord(searchWord)
+                )
+            else:
+                self.__searchDock.show()
+                self.__searchDock.raise_()
+                self.__searchEngine.search(searchWord)
         
     def search(self, word):
         """
         Public method to search for a word.
         
-        @param word word to search for (string)
+        @param word word to search for
+        @type str
         """
         if WebBrowserWindow._useQtHelp:
-            self.__searchWord = word
-            self.__searchForWord()
-        
+            self.__searchForWord(word)
+    
+    @pyqtSlot()
     def __removeOldDocumentation(self):
         """
         Private slot to remove non-existing documentation from the help engine.
@@ -3547,7 +3615,8 @@
                 docFile = self.__helpEngine.documentationFileName(namespace)
                 if not os.path.exists(docFile):
                     self.__helpEngine.unregisterDocumentation(namespace)
-        
+    
+    @pyqtSlot()
     def __lookForNewDocumentation(self):
         """
         Private slot to look for new documentation to be loaded into the
@@ -3564,59 +3633,53 @@
             self.statusBar().showMessage(
                 self.tr("Looking for Documentation..."))
             self.__helpInstaller.installDocs()
-        
+    
+    @pyqtSlot(str)
     def __showInstallationError(self, message):
         """
         Private slot to show installation errors.
         
-        @param message message to be shown (string)
+        @param message message to be shown
+        @type str
         """
         EricMessageBox.warning(
             self,
             self.tr("eric Web Browser"),
             message)
-        
+    
+    @pyqtSlot(bool)
     def __docsInstalled(self, installed):
         """
         Private slot handling the end of documentation installation.
         
         @param installed flag indicating that documents were installed
-            (boolean)
+        @type bool
         """
         if WebBrowserWindow._useQtHelp:
             self.statusBar().clearMessage()
-        
-    def __initHelpDb(self):
-        """
-        Private slot to initialize the documentation database.
-        """
-        if WebBrowserWindow._useQtHelp:
-            unfiltered = self.tr("Unfiltered")
-            filterEngine = self.__helpEngine.filterEngine()
-            if unfiltered not in filterEngine.filters():
-                filterEngine.setFilterData(unfiltered, QHelpFilterData())
-                
-                self.__helpEngine.blockSignals(True)
-                filterEngine.setActiveFilter(unfiltered)
-                self.__helpEngine.blockSignals(False)
-        
+            self.__helpEngine.setupData()
+    
+    @pyqtSlot(str)
     def __warning(self, msg):
         """
         Private slot handling warnings from the help engine.
         
-        @param msg message sent by the help  engine (string)
+        @param msg message sent by the help  engine
+        @type str
         """
         EricMessageBox.warning(
             self,
             self.tr("Help Engine"), msg)
-        
+    
+    @pyqtSlot()
     def __aboutToShowSettingsMenu(self):
         """
         Private slot to show the Settings menu.
         """
         self.editMessageFilterAct.setEnabled(
             EricErrorMessage.messageHandlerInstalled())
-        
+    
+    @pyqtSlot()
     def __clearPrivateData(self):
         """
         Private slot to clear the private data.
@@ -3659,7 +3722,8 @@
                 ZoomManager.instance().clear()
             if sslExceptions:
                 self.networkManager().clearSslExceptions()
-        
+    
+    @pyqtSlot()
     def __showEnginesConfigurationDialog(self):
         """
         Private slot to show the search engines configuration dialog.
@@ -3677,7 +3741,8 @@
         @return reference to the search engines configuration action (QAction)
         """
         return self.searchEnginesAct
-        
+    
+    @pyqtSlot()
     def __showPasswordsDialog(self):
         """
         Private slot to show the passwords management dialog.
@@ -3687,36 +3752,42 @@
         dlg = PasswordsDialog(self)
         dlg.exec()
     
+    @pyqtSlot()
     def __showCertificateErrorsDialog(self):
         """
         Private slot to show the certificate errors management dialog.
         """
         self.networkManager().showSslErrorExceptionsDialog()
     
+    @pyqtSlot()
     def __showAdBlockDialog(self):
         """
         Private slot to show the AdBlock configuration dialog.
         """
         self.adBlockManager().showDialog()
-        
+    
+    @pyqtSlot()
     def __showPersonalInformationDialog(self):
         """
         Private slot to show the Personal Information configuration dialog.
         """
         self.personalInformationManager().showConfigurationDialog()
-        
+    
+    @pyqtSlot()
     def __showGreaseMonkeyConfigDialog(self):
         """
         Private slot to show the GreaseMonkey scripts configuration dialog.
         """
         self.greaseMonkeyManager().showConfigurationDialog()
-        
+    
+    @pyqtSlot()
     def __showFeaturePermissionDialog(self):
         """
         Private slot to show the feature permission dialog.
         """
         self.featurePermissionManager().showFeaturePermissionsDialog()
-        
+    
+    @pyqtSlot()
     def __showZoomValuesDialog(self):
         """
         Private slot to show the zoom values management dialog.
@@ -3726,12 +3797,14 @@
         dlg = ZoomValuesDialog(self)
         dlg.exec()
     
+    @pyqtSlot()
     def __showDownloadsWindow(self):
         """
         Private slot to show the downloads dialog.
         """
         self.downloadManager().show()
-        
+    
+    @pyqtSlot()
     def __showPageSource(self):
         """
         Private slot to show the source of the current page in an editor.
@@ -3751,6 +3824,7 @@
         editor.setLanguage("dummy.html")
         editor.show()
     
+    @pyqtSlot()
     def __toggleJavaScriptConsole(self):
         """
         Private slot to toggle the JavaScript console.
@@ -3792,51 +3866,72 @@
         
         return cls._bookmarksManager
     
+    @pyqtSlot(QUrl)
+    @pyqtSlot(QUrl, str)
     def openUrl(self, url, title=None):
         """
         Public slot to load a URL in the current tab.
         
-        @param url URL to be opened (QUrl)
-        @param title title of the bookmark (string)
+        @param url URL to be opened
+        @type QUrl
+        @param title title of the bookmark
+        @type str
         """
         self.__linkActivated(url)
     
+    @pyqtSlot(QUrl)
+    @pyqtSlot(QUrl, str)
     def openUrlNewTab(self, url, title=None):
         """
         Public slot to load a URL in a new tab.
         
-        @param url URL to be opened (QUrl)
-        @param title title of the bookmark (string)
+        @param url URL to be opened
+        @type QUrl
+        @param title title of the bookmark
+        @type str
         """
         self.newTab(url)
     
+    @pyqtSlot(QUrl)
+    @pyqtSlot(QUrl, str)
     def openUrlNewBackgroundTab(self, url, title=None):
         """
         Public slot to load a URL in a new background tab.
         
-        @param url URL to be opened (QUrl)
-        @param title title of the bookmark (string)
+        @param url URL to be opened
+        @type QUrl
+        @param title title of the bookmark
+        @type str
         """
         self.newTab(url, background=True)
     
+    @pyqtSlot(QUrl)
+    @pyqtSlot(QUrl, str)
     def openUrlNewWindow(self, url, title=None):
         """
         Public slot to load a URL in a new window.
         
-        @param url URL to be opened (QUrl)
-        @param title title of the bookmark (string)
+        @param url URL to be opened
+        @type QUrl
+        @param title title of the bookmark
+        @type str
         """
         self.newWindow(url)
     
+    @pyqtSlot(QUrl)
+    @pyqtSlot(QUrl, str)
     def openUrlNewPrivateWindow(self, url, title=None):
         """
         Public slot to load a URL in a new private window.
         
-        @param url URL to be opened (QUrl)
-        @param title title of the bookmark (string)
+        @param url URL to be opened
+        @type QUrl
+        @param title title of the bookmark
+        @type str
         """
         self.newPrivateWindow(url)
     
+    @pyqtSlot()
     def __sendPageLink(self):
         """
         Private slot to send the link of the current page via email.
@@ -4104,6 +4199,7 @@
             
             parentMenu.addMenu(menu)
     
+    @pyqtSlot()
     def __aboutToShowTextEncodingMenu(self):
         """
         Private slot to populate the text encoding menu.
@@ -4154,12 +4250,14 @@
         self.__createTextEncodingSubmenu(self.tr("Other"), otherCodecs,
                                          self.__textEncodingMenu)
     
+    @pyqtSlot(QAction)
     def __setTextEncoding(self, act):
         """
         Private slot to set the selected text encoding as the default for
         this session.
         
-        @param act reference to the selected action (QAction)
+        @param act reference to the selected action
+        @type QAction
         """
         codec = act.data()
         if codec == "":
@@ -4218,7 +4316,8 @@
         self.__populateToolbarsMenu(menu)
         
         return menu
-
+    
+    @pyqtSlot()
     def __showToolbarsMenu(self):
         """
         Private slot to display the Toolbars menu.
@@ -4364,6 +4463,7 @@
         
         return cls._feedsManager
     
+    @pyqtSlot()
     def __showFeedsManager(self):
         """
         Private slot to show the feeds manager dialog.
@@ -4392,6 +4492,7 @@
         feedsManager.newPrivateWindow.disconnect(self.openUrlNewPrivateWindow)
         feedsManager.rejected.disconnect()
     
+    @pyqtSlot()
     def __showSiteinfoDialog(self):
         """
         Private slot to show the site info dialog.
@@ -4413,6 +4514,7 @@
         
         return cls._userAgentsManager
     
+    @pyqtSlot()
     def __showUserAgentsDialog(self):
         """
         Private slot to show the user agents management dialog.
@@ -4435,6 +4537,7 @@
         
         return cls._syncManager
     
+    @pyqtSlot()
     def __showSyncDialog(self):
         """
         Private slot to show the synchronization dialog.
@@ -4552,6 +4655,7 @@
     ## Interface to VirusTotal below                                         ##
     ###########################################################################
     
+    @pyqtSlot()
     def __virusTotalScanCurrentSite(self):
         """
         Private slot to ask VirusTotal for a scan of the URL of the current
@@ -4571,11 +4675,13 @@
         """
         self.__virusTotal.submitUrl(url)
     
+    @pyqtSlot(str)
     def __virusTotalSubmitUrlError(self, msg):
         """
         Private slot to handle an URL scan submission error.
         
-        @param msg error message (str)
+        @param msg error message
+        @type str
         """
         EricMessageBox.critical(
             self,
@@ -4583,22 +4689,27 @@
             self.tr("""<p>The VirusTotal scan could not be"""
                     """ scheduled.<p>\n<p>Reason: {0}</p>""").format(msg))
     
+    @pyqtSlot(str)
     def __virusTotalUrlScanReport(self, url):
         """
         Private slot to initiate the display of the URL scan report page.
         
-        @param url URL of the URL scan report page (string)
+        @param url URL of the URL scan report page
+        @type str
         """
         self.newTab(url)
     
+    @pyqtSlot(str)
     def __virusTotalFileScanReport(self, url):
         """
         Private slot to initiate the display of the file scan report page.
         
-        @param url URL of the file scan report page (string)
+        @param url URL of the file scan report page
+        @type str
         """
         self.newTab(url)
     
+    @pyqtSlot()
     def __virusTotalIpAddressReport(self):
         """
         Private slot to retrieve an IP address report.
@@ -4618,6 +4729,7 @@
                     self.tr("""The given IP address is not in dotted quad"""
                             """ notation."""))
     
+    @pyqtSlot()
     def __virusTotalDomainReport(self):
         """
         Private slot to retrieve a domain report.
@@ -4852,6 +4964,7 @@
         
         return cls._sessionManager
     
+    @pyqtSlot()
     def __showSessionManagerDialog(self):
         """
         Private slot to show the session manager dialog.
@@ -4876,6 +4989,7 @@
         
         return cls._safeBrowsingManager
     
+    @pyqtSlot()
     def __showSafeBrowsingDialog(self):
         """
         Private slot to show the safe browsing management dialog.
@@ -4900,6 +5014,7 @@
         
         return cls._protocolHandlerManager
     
+    @pyqtSlot()
     def __showProtocolHandlerManagerDialog(self):
         """
         Private slot to show the protocol handler manager dialog.
@@ -4949,8 +5064,7 @@
         @type str
         """
         if WebBrowserWindow._useQtHelp:
-            self.__searchWord = word
-            self.__searchForWord()
+            self.__searchForWord(word)
         
         self.raise_()
         self.activateWindow()
@@ -4959,6 +5073,7 @@
     ## Methods below implement shortcuts related functions
     ######################################################
     
+    @pyqtSlot()
     def __configShortcuts(self):
         """
         Private slot to configure the keyboard shortcuts.
@@ -4969,6 +5084,7 @@
         self.__shortcutsDialog.populate(helpViewer=self)
         self.__shortcutsDialog.show()
     
+    @pyqtSlot()
     def __exportShortcuts(self):
         """
         Private slot to export the keyboard shortcuts.
@@ -5003,7 +5119,8 @@
         if ok:
             from Preferences import Shortcuts
             Shortcuts.exportShortcuts(fn, helpViewer=self)
-
+    
+    @pyqtSlot()
     def __importShortcuts(self):
         """
         Private slot to import the keyboard shortcuts.

eric ide

mercurial