27 ) |
27 ) |
28 from PyQt6.QtWebEngineCore import ( |
28 from PyQt6.QtWebEngineCore import ( |
29 QWebEngineSettings, QWebEnginePage, QWebEngineProfile, QWebEngineScript |
29 QWebEngineSettings, QWebEnginePage, QWebEngineProfile, QWebEngineScript |
30 ) |
30 ) |
31 try: |
31 try: |
32 from PyQt6.QtHelp import QHelpEngine, QHelpEngineCore, QHelpFilterData |
32 from PyQt6.QtHelp import QHelpEngine |
33 QTHELP_AVAILABLE = True |
33 QTHELP_AVAILABLE = True |
34 except ImportError: |
34 except ImportError: |
35 QTHELP_AVAILABLE = False |
35 QTHELP_AVAILABLE = False |
36 |
36 |
37 from EricGui.EricAction import EricAction |
37 from EricGui.EricAction import EricAction |
195 |
195 |
196 if WebBrowserWindow._useQtHelp: |
196 if WebBrowserWindow._useQtHelp: |
197 self.__helpEngine = QHelpEngine( |
197 self.__helpEngine = QHelpEngine( |
198 WebBrowserWindow.getQtHelpCollectionFileName(), |
198 WebBrowserWindow.getQtHelpCollectionFileName(), |
199 self) |
199 self) |
|
200 self.__helpEngine.setReadOnly(False) |
|
201 self.__helpEngine.setupData() |
200 self.__helpEngine.setUsesFilterEngine(True) |
202 self.__helpEngine.setUsesFilterEngine(True) |
201 self.__removeOldDocumentation() |
203 self.__removeOldDocumentation() |
202 self.__helpEngine.warning.connect(self.__warning) |
204 self.__helpEngine.warning.connect(self.__warning) |
203 else: |
205 else: |
204 self.__helpEngine = None |
206 self.__helpEngine = None |
269 self.__indexDock.setWidget(self.__indexWindow) |
271 self.__indexDock.setWidget(self.__indexWindow) |
270 self.addDockWidget(Qt.DockWidgetArea.LeftDockWidgetArea, |
272 self.addDockWidget(Qt.DockWidgetArea.LeftDockWidgetArea, |
271 self.__indexDock) |
273 self.__indexDock) |
272 |
274 |
273 # setup the search widget |
275 # setup the search widget |
274 self.__searchWord = searchWord |
|
275 self.__indexing = False |
276 self.__indexing = False |
276 self.__indexingProgress = None |
277 self.__indexingProgress = None |
277 self.__searchEngine = self.__helpEngine.searchEngine() |
278 self.__searchEngine = self.__helpEngine.searchEngine() |
278 self.__searchEngine.indexingStarted.connect( |
279 self.__searchEngine.indexingStarted.connect( |
279 self.__indexingStarted) |
280 self.__indexingStarted) |
435 self.__searchWindow.newWindow.connect(self.openUrlNewWindow) |
436 self.__searchWindow.newWindow.connect(self.openUrlNewWindow) |
436 |
437 |
437 state = Preferences.getWebBrowser("WebBrowserState") |
438 state = Preferences.getWebBrowser("WebBrowserState") |
438 self.restoreState(state) |
439 self.restoreState(state) |
439 |
440 |
440 self.__initHelpDb() |
|
441 |
|
442 self.__virusTotal = VirusTotalAPI(self) |
441 self.__virusTotal = VirusTotalAPI(self) |
443 self.__virusTotal.submitUrlError.connect( |
442 self.__virusTotal.submitUrlError.connect( |
444 self.__virusTotalSubmitUrlError) |
443 self.__virusTotalSubmitUrlError) |
445 self.__virusTotal.urlScanReport.connect( |
444 self.__virusTotal.urlScanReport.connect( |
446 self.__virusTotalUrlScanReport) |
445 self.__virusTotalUrlScanReport) |
2309 "ComboBoxWithEnoughWidth") |
2308 "ComboBoxWithEnoughWidth") |
2310 self.filterCombo.setMinimumWidth(comboWidth) |
2309 self.filterCombo.setMinimumWidth(comboWidth) |
2311 filtertb.addWidget(QLabel(self.tr("Filtered by: "))) |
2310 filtertb.addWidget(QLabel(self.tr("Filtered by: "))) |
2312 filtertb.addWidget(self.filterCombo) |
2311 filtertb.addWidget(self.filterCombo) |
2313 self.__helpEngine.setupFinished.connect(self.__setupFilterCombo) |
2312 self.__helpEngine.setupFinished.connect(self.__setupFilterCombo) |
2314 self.filterCombo.currentTextChanged.connect( |
2313 self.filterCombo.currentIndexChanged.connect( |
2315 self.__filterQtHelpDocumentation) |
2314 self.__filterQtHelpDocumentation) |
2316 self.__setupFilterCombo() |
2315 self.__setupFilterCombo() |
2317 self.__toolbars["filter"] = (filtertb.windowTitle(), filtertb) |
2316 self.__toolbars["filter"] = (filtertb.windowTitle(), filtertb) |
2318 |
2317 |
2319 settingstb = self.addToolBar(self.tr("Settings")) |
2318 settingstb = self.addToolBar(self.tr("Settings")) |
2350 vttb.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonTextBesideIcon) |
2349 vttb.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonTextBesideIcon) |
2351 vttb.addAction(self.virustotalScanCurrentAct) |
2350 vttb.addAction(self.virustotalScanCurrentAct) |
2352 vttb.addAction(self.virustotalIpReportAct) |
2351 vttb.addAction(self.virustotalIpReportAct) |
2353 vttb.addAction(self.virustotalDomainReportAct) |
2352 vttb.addAction(self.virustotalDomainReportAct) |
2354 self.__toolbars["virustotal"] = (vttb.windowTitle(), vttb) |
2353 self.__toolbars["virustotal"] = (vttb.windowTitle(), vttb) |
2355 |
2354 |
|
2355 @pyqtSlot() |
2356 def __nextTab(self): |
2356 def __nextTab(self): |
2357 """ |
2357 """ |
2358 Private slot used to show the next tab. |
2358 Private slot used to show the next tab. |
2359 """ |
2359 """ |
2360 fwidget = QApplication.focusWidget() |
2360 fwidget = QApplication.focusWidget() |
2361 while fwidget and not hasattr(fwidget, 'nextTab'): |
2361 while fwidget and not hasattr(fwidget, 'nextTab'): |
2362 fwidget = fwidget.parent() |
2362 fwidget = fwidget.parent() |
2363 if fwidget: |
2363 if fwidget: |
2364 fwidget.nextTab() |
2364 fwidget.nextTab() |
2365 |
2365 |
|
2366 @pyqtSlot() |
2366 def __prevTab(self): |
2367 def __prevTab(self): |
2367 """ |
2368 """ |
2368 Private slot used to show the previous tab. |
2369 Private slot used to show the previous tab. |
2369 """ |
2370 """ |
2370 fwidget = QApplication.focusWidget() |
2371 fwidget = QApplication.focusWidget() |
2371 while fwidget and not hasattr(fwidget, 'prevTab'): |
2372 while fwidget and not hasattr(fwidget, 'prevTab'): |
2372 fwidget = fwidget.parent() |
2373 fwidget = fwidget.parent() |
2373 if fwidget: |
2374 if fwidget: |
2374 fwidget.prevTab() |
2375 fwidget.prevTab() |
2375 |
2376 |
|
2377 @pyqtSlot() |
2376 def __switchTab(self): |
2378 def __switchTab(self): |
2377 """ |
2379 """ |
2378 Private slot used to switch between the current and the previous |
2380 Private slot used to switch between the current and the previous |
2379 current tab. |
2381 current tab. |
2380 """ |
2382 """ |
2381 fwidget = QApplication.focusWidget() |
2383 fwidget = QApplication.focusWidget() |
2382 while fwidget and not hasattr(fwidget, 'switchTab'): |
2384 while fwidget and not hasattr(fwidget, 'switchTab'): |
2383 fwidget = fwidget.parent() |
2385 fwidget = fwidget.parent() |
2384 if fwidget: |
2386 if fwidget: |
2385 fwidget.switchTab() |
2387 fwidget.switchTab() |
2386 |
2388 |
|
2389 @pyqtSlot() |
2387 def __whatsThis(self): |
2390 def __whatsThis(self): |
2388 """ |
2391 """ |
2389 Private slot called in to enter Whats This mode. |
2392 Private slot called in to enter Whats This mode. |
2390 """ |
2393 """ |
2391 QWhatsThis.enterWhatsThisMode() |
2394 QWhatsThis.enterWhatsThisMode() |
2392 |
2395 |
2393 def __titleChanged(self, browser, title): |
2396 def __titleChanged(self, browser, title): |
2394 """ |
2397 """ |
2395 Private slot called to handle a change of a browser's title. |
2398 Private slot called to handle a change of a browser's title. |
2396 |
2399 |
2397 @param browser reference to the browser (WebBrowserView) |
2400 @param browser reference to the browser |
2398 @param title new title (string) |
2401 @type WebBrowserView |
|
2402 @param title new title |
|
2403 @type str |
2399 """ |
2404 """ |
2400 self.historyManager().updateHistoryEntry( |
2405 self.historyManager().updateHistoryEntry( |
2401 browser.url().toString(), title) |
2406 browser.url().toString(), title) |
2402 |
2407 |
2403 @pyqtSlot() |
2408 @pyqtSlot() |
2557 """<p>The eric Web Browser is a combined help file and HTML""" |
2566 """<p>The eric Web Browser is a combined help file and HTML""" |
2558 """ browser. It is part of the eric development""" |
2567 """ browser. It is part of the eric development""" |
2559 """ toolset.</p>""" |
2568 """ toolset.</p>""" |
2560 """<p>It is based on QtWebEngine {1} and Chrome {2}.</p>""" |
2569 """<p>It is based on QtWebEngine {1} and Chrome {2}.</p>""" |
2561 ).format(Version, webengineVersion, chromeVersion)) |
2570 ).format(Version, webengineVersion, chromeVersion)) |
2562 |
2571 |
|
2572 @pyqtSlot() |
2563 def __aboutQt(self): |
2573 def __aboutQt(self): |
2564 """ |
2574 """ |
2565 Private slot to show info about Qt. |
2575 Private slot to show info about Qt. |
2566 """ |
2576 """ |
2567 EricMessageBox.aboutQt(self, self.tr("eric Web Browser")) |
2577 EricMessageBox.aboutQt(self, self.tr("eric Web Browser")) |
2568 |
2578 |
|
2579 @pyqtSlot(bool) |
2569 def setBackwardAvailable(self, b): |
2580 def setBackwardAvailable(self, b): |
2570 """ |
2581 """ |
2571 Public slot called when backward references are available. |
2582 Public slot called when backward references are available. |
2572 |
2583 |
2573 @param b flag indicating availability of the backwards action (boolean) |
2584 @param b flag indicating availability of the backwards action |
|
2585 @type bool |
2574 """ |
2586 """ |
2575 self.backAct.setEnabled(b) |
2587 self.backAct.setEnabled(b) |
2576 self.__navigationBar.backButton().setEnabled(b) |
2588 self.__navigationBar.backButton().setEnabled(b) |
2577 |
2589 |
|
2590 @pyqtSlot(bool) |
2578 def setForwardAvailable(self, b): |
2591 def setForwardAvailable(self, b): |
2579 """ |
2592 """ |
2580 Public slot called when forward references are available. |
2593 Public slot called when forward references are available. |
2581 |
2594 |
2582 @param b flag indicating the availability of the forwards action |
2595 @param b flag indicating the availability of the forwards action |
2583 (boolean) |
2596 @type bool |
2584 """ |
2597 """ |
2585 self.forwardAct.setEnabled(b) |
2598 self.forwardAct.setEnabled(b) |
2586 self.__navigationBar.forwardButton().setEnabled(b) |
2599 self.__navigationBar.forwardButton().setEnabled(b) |
2587 |
2600 |
|
2601 @pyqtSlot(bool) |
2588 def setLoadingActions(self, b): |
2602 def setLoadingActions(self, b): |
2589 """ |
2603 """ |
2590 Public slot to set the loading dependent actions. |
2604 Public slot to set the loading dependent actions. |
2591 |
2605 |
2592 @param b flag indicating the loading state to consider (boolean) |
2606 @param b flag indicating the loading state to consider |
|
2607 @type bool |
2593 """ |
2608 """ |
2594 self.reloadAct.setEnabled(not b) |
2609 self.reloadAct.setEnabled(not b) |
2595 self.stopAct.setEnabled(b) |
2610 self.stopAct.setEnabled(b) |
2596 |
2611 |
2597 self.__navigationBar.reloadStopButton().setLoading(b) |
2612 self.__navigationBar.reloadStopButton().setLoading(b) |
2598 |
2613 |
|
2614 @pyqtSlot() |
2599 def __addBookmark(self): |
2615 def __addBookmark(self): |
2600 """ |
2616 """ |
2601 Private slot called to add the displayed file to the bookmarks. |
2617 Private slot called to add the displayed file to the bookmarks. |
2602 """ |
2618 """ |
2603 from .WebBrowserPage import WebBrowserPage |
2619 from .WebBrowserPage import WebBrowserPage |
2660 self.__bookmarksDialog.openUrl.connect(self.openUrl) |
2678 self.__bookmarksDialog.openUrl.connect(self.openUrl) |
2661 self.__bookmarksDialog.newTab.connect(self.openUrlNewTab) |
2679 self.__bookmarksDialog.newTab.connect(self.openUrlNewTab) |
2662 self.__bookmarksDialog.newBackgroundTab.connect( |
2680 self.__bookmarksDialog.newBackgroundTab.connect( |
2663 self.openUrlNewBackgroundTab) |
2681 self.openUrlNewBackgroundTab) |
2664 self.__bookmarksDialog.show() |
2682 self.__bookmarksDialog.show() |
2665 |
2683 |
|
2684 @pyqtSlot() |
2666 def bookmarkAll(self): |
2685 def bookmarkAll(self): |
2667 """ |
2686 """ |
2668 Public slot to bookmark all open tabs. |
2687 Public slot to bookmark all open tabs. |
2669 """ |
2688 """ |
2670 from .WebBrowserPage import WebBrowserPage |
2689 from .WebBrowserPage import WebBrowserPage |
2924 if browser != self: |
2945 if browser != self: |
2925 browser.close() |
2946 browser.close() |
2926 self.close() |
2947 self.close() |
2927 |
2948 |
2928 return True |
2949 return True |
2929 |
2950 |
|
2951 @pyqtSlot() |
2930 def __backward(self): |
2952 def __backward(self): |
2931 """ |
2953 """ |
2932 Private slot called to handle the backward action. |
2954 Private slot called to handle the backward action. |
2933 """ |
2955 """ |
2934 self.currentBrowser().backward() |
2956 self.currentBrowser().backward() |
2935 |
2957 |
|
2958 @pyqtSlot() |
2936 def __forward(self): |
2959 def __forward(self): |
2937 """ |
2960 """ |
2938 Private slot called to handle the forward action. |
2961 Private slot called to handle the forward action. |
2939 """ |
2962 """ |
2940 self.currentBrowser().forward() |
2963 self.currentBrowser().forward() |
2941 |
2964 |
|
2965 @pyqtSlot() |
2942 def __home(self): |
2966 def __home(self): |
2943 """ |
2967 """ |
2944 Private slot called to handle the home action. |
2968 Private slot called to handle the home action. |
2945 """ |
2969 """ |
2946 self.currentBrowser().home() |
2970 self.currentBrowser().home() |
2947 |
2971 |
|
2972 @pyqtSlot() |
2948 def __reload(self): |
2973 def __reload(self): |
2949 """ |
2974 """ |
2950 Private slot called to handle the reload action. |
2975 Private slot called to handle the reload action. |
2951 """ |
2976 """ |
2952 self.currentBrowser().reloadBypassingCache() |
2977 self.currentBrowser().reloadBypassingCache() |
2953 |
2978 |
|
2979 @pyqtSlot() |
2954 def __stopLoading(self): |
2980 def __stopLoading(self): |
2955 """ |
2981 """ |
2956 Private slot called to handle loading of the current page. |
2982 Private slot called to handle loading of the current page. |
2957 """ |
2983 """ |
2958 self.currentBrowser().stop() |
2984 self.currentBrowser().stop() |
2959 |
2985 |
|
2986 @pyqtSlot(int) |
2960 def __zoomValueChanged(self, value): |
2987 def __zoomValueChanged(self, value): |
2961 """ |
2988 """ |
2962 Private slot to handle value changes of the zoom widget. |
2989 Private slot to handle value changes of the zoom widget. |
2963 |
2990 |
2964 @param value zoom value (integer) |
2991 @param value zoom value |
|
2992 @type int |
2965 """ |
2993 """ |
2966 self.currentBrowser().setZoomValue(value) |
2994 self.currentBrowser().setZoomValue(value) |
2967 |
2995 |
|
2996 @pyqtSlot() |
2968 def __zoomIn(self): |
2997 def __zoomIn(self): |
2969 """ |
2998 """ |
2970 Private slot called to handle the zoom in action. |
2999 Private slot called to handle the zoom in action. |
2971 """ |
3000 """ |
2972 self.currentBrowser().zoomIn() |
3001 self.currentBrowser().zoomIn() |
2973 self.__zoomWidget.setValue(self.currentBrowser().zoomValue()) |
3002 self.__zoomWidget.setValue(self.currentBrowser().zoomValue()) |
2974 |
3003 |
|
3004 @pyqtSlot() |
2975 def __zoomOut(self): |
3005 def __zoomOut(self): |
2976 """ |
3006 """ |
2977 Private slot called to handle the zoom out action. |
3007 Private slot called to handle the zoom out action. |
2978 """ |
3008 """ |
2979 self.currentBrowser().zoomOut() |
3009 self.currentBrowser().zoomOut() |
2980 self.__zoomWidget.setValue(self.currentBrowser().zoomValue()) |
3010 self.__zoomWidget.setValue(self.currentBrowser().zoomValue()) |
2981 |
3011 |
|
3012 @pyqtSlot() |
2982 def __zoomReset(self): |
3013 def __zoomReset(self): |
2983 """ |
3014 """ |
2984 Private slot called to handle the zoom reset action. |
3015 Private slot called to handle the zoom reset action. |
2985 """ |
3016 """ |
2986 self.currentBrowser().zoomReset() |
3017 self.currentBrowser().zoomReset() |
2987 self.__zoomWidget.setValue(self.currentBrowser().zoomValue()) |
3018 self.__zoomWidget.setValue(self.currentBrowser().zoomValue()) |
2988 |
3019 |
|
3020 @pyqtSlot() |
2989 def toggleFullScreen(self): |
3021 def toggleFullScreen(self): |
2990 """ |
3022 """ |
2991 Public slot called to toggle the full screen mode. |
3023 Public slot called to toggle the full screen mode. |
2992 """ |
3024 """ |
2993 if self.__htmlFullScreen: |
3025 if self.__htmlFullScreen: |
3031 self.__hideNavigationTimer.stop() |
3064 self.__hideNavigationTimer.stop() |
3032 |
3065 |
3033 self.__navigationContainer.show() |
3066 self.__navigationContainer.show() |
3034 self.__tabWidget.tabBar().show() |
3067 self.__tabWidget.tabBar().show() |
3035 |
3068 |
|
3069 @pyqtSlot() |
3036 def hideFullScreenNavigation(self): |
3070 def hideFullScreenNavigation(self): |
3037 """ |
3071 """ |
3038 Public slot to hide full screen navigation. |
3072 Public slot to hide full screen navigation. |
3039 """ |
3073 """ |
3040 if not self.__hideNavigationTimer.isActive(): |
3074 if not self.__hideNavigationTimer.isActive(): |
3041 self.__hideNavigationTimer.start() |
3075 self.__hideNavigationTimer.start() |
3042 |
3076 |
|
3077 @pyqtSlot() |
3043 def __hideNavigation(self): |
3078 def __hideNavigation(self): |
3044 """ |
3079 """ |
3045 Private slot to hide full screen navigation by timer. |
3080 Private slot to hide full screen navigation by timer. |
3046 """ |
3081 """ |
3047 browser = self.currentBrowser() |
3082 browser = self.currentBrowser() |
3049 |
3084 |
3050 if self.isFullScreen() and mouseInBrowser: |
3085 if self.isFullScreen() and mouseInBrowser: |
3051 self.__navigationContainer.hide() |
3086 self.__navigationContainer.hide() |
3052 self.__tabWidget.tabBar().hide() |
3087 self.__tabWidget.tabBar().hide() |
3053 |
3088 |
|
3089 @pyqtSlot() |
3054 def __copy(self): |
3090 def __copy(self): |
3055 """ |
3091 """ |
3056 Private slot called to handle the copy action. |
3092 Private slot called to handle the copy action. |
3057 """ |
3093 """ |
3058 self.currentBrowser().copy() |
3094 self.currentBrowser().copy() |
3059 |
3095 |
|
3096 @pyqtSlot() |
3060 def __cut(self): |
3097 def __cut(self): |
3061 """ |
3098 """ |
3062 Private slot called to handle the cut action. |
3099 Private slot called to handle the cut action. |
3063 """ |
3100 """ |
3064 self.currentBrowser().cut() |
3101 self.currentBrowser().cut() |
3065 |
3102 |
|
3103 @pyqtSlot() |
3066 def __paste(self): |
3104 def __paste(self): |
3067 """ |
3105 """ |
3068 Private slot called to handle the paste action. |
3106 Private slot called to handle the paste action. |
3069 """ |
3107 """ |
3070 self.currentBrowser().paste() |
3108 self.currentBrowser().paste() |
3071 |
3109 |
|
3110 @pyqtSlot() |
3072 def __undo(self): |
3111 def __undo(self): |
3073 """ |
3112 """ |
3074 Private slot to handle the undo action. |
3113 Private slot to handle the undo action. |
3075 """ |
3114 """ |
3076 self.currentBrowser().undo() |
3115 self.currentBrowser().undo() |
3077 |
3116 |
|
3117 @pyqtSlot() |
3078 def __redo(self): |
3118 def __redo(self): |
3079 """ |
3119 """ |
3080 Private slot to handle the redo action. |
3120 Private slot to handle the redo action. |
3081 """ |
3121 """ |
3082 self.currentBrowser().redo() |
3122 self.currentBrowser().redo() |
3083 |
3123 |
|
3124 @pyqtSlot() |
3084 def __selectAll(self): |
3125 def __selectAll(self): |
3085 """ |
3126 """ |
3086 Private slot to handle the select all action. |
3127 Private slot to handle the select all action. |
3087 """ |
3128 """ |
3088 self.currentBrowser().selectAll() |
3129 self.currentBrowser().selectAll() |
3089 |
3130 |
|
3131 @pyqtSlot() |
3090 def __unselect(self): |
3132 def __unselect(self): |
3091 """ |
3133 """ |
3092 Private slot to clear the selection of the current browser. |
3134 Private slot to clear the selection of the current browser. |
3093 """ |
3135 """ |
3094 self.currentBrowser().unselect() |
3136 self.currentBrowser().unselect() |
3142 |
3184 |
3143 @return list of references to web browsers (list of WebBrowserView) |
3185 @return list of references to web browsers (list of WebBrowserView) |
3144 """ |
3186 """ |
3145 return self.__tabWidget.browsers() |
3187 return self.__tabWidget.browsers() |
3146 |
3188 |
|
3189 @pyqtSlot(int) |
3147 def __currentChanged(self, index): |
3190 def __currentChanged(self, index): |
3148 """ |
3191 """ |
3149 Private slot to handle the currentChanged signal. |
3192 Private slot to handle the currentChanged signal. |
3150 |
3193 |
3151 @param index index of the current tab (integer) |
3194 @param index index of the current tab |
|
3195 @type int |
3152 """ |
3196 """ |
3153 if index > -1: |
3197 if index > -1: |
3154 cb = self.currentBrowser() |
3198 cb = self.currentBrowser() |
3155 if cb is not None: |
3199 if cb is not None: |
3156 self.setForwardAvailable(cb.isForwardAvailable()) |
3200 self.setForwardAvailable(cb.isForwardAvailable()) |
3184 dlg.setPreferences() |
3229 dlg.setPreferences() |
3185 Preferences.syncPreferences() |
3230 Preferences.syncPreferences() |
3186 self.preferencesChanged() |
3231 self.preferencesChanged() |
3187 self.__lastConfigurationPageName = dlg.getConfigurationPageName() |
3232 self.__lastConfigurationPageName = dlg.getConfigurationPageName() |
3188 |
3233 |
|
3234 @pyqtSlot() |
3189 def preferencesChanged(self): |
3235 def preferencesChanged(self): |
3190 """ |
3236 """ |
3191 Public slot to handle a change of preferences. |
3237 Public slot to handle a change of preferences. |
3192 """ |
3238 """ |
3193 self.setStyle(Preferences.getUI("Style"), |
3239 self.setStyle(Preferences.getUI("Style"), |
3257 if local: |
3303 if local: |
3258 # we were called from our local configuration dialog |
3304 # we were called from our local configuration dialog |
3259 Preferences.convertPasswords(oldPassword, newPassword) |
3305 Preferences.convertPasswords(oldPassword, newPassword) |
3260 Utilities.crypto.changeRememberedMaster(newPassword) |
3306 Utilities.crypto.changeRememberedMaster(newPassword) |
3261 |
3307 |
|
3308 @pyqtSlot() |
3262 def __showAcceptedLanguages(self): |
3309 def __showAcceptedLanguages(self): |
3263 """ |
3310 """ |
3264 Private slot to configure the accepted languages for web pages. |
3311 Private slot to configure the accepted languages for web pages. |
3265 """ |
3312 """ |
3266 from .WebBrowserLanguagesDialog import WebBrowserLanguagesDialog |
3313 from .WebBrowserLanguagesDialog import WebBrowserLanguagesDialog |
3267 dlg = WebBrowserLanguagesDialog(self) |
3314 dlg = WebBrowserLanguagesDialog(self) |
3268 dlg.exec() |
3315 dlg.exec() |
3269 self.networkManager().languagesChanged() |
3316 self.networkManager().languagesChanged() |
3270 |
3317 |
|
3318 @pyqtSlot() |
3271 def __showCookiesConfiguration(self): |
3319 def __showCookiesConfiguration(self): |
3272 """ |
3320 """ |
3273 Private slot to configure the cookies handling. |
3321 Private slot to configure the cookies handling. |
3274 """ |
3322 """ |
3275 from .CookieJar.CookiesConfigurationDialog import ( |
3323 from .CookieJar.CookiesConfigurationDialog import ( |
3342 if cls._cookieJar is None: |
3390 if cls._cookieJar is None: |
3343 from .CookieJar.CookieJar import CookieJar |
3391 from .CookieJar.CookieJar import CookieJar |
3344 cls._cookieJar = CookieJar() |
3392 cls._cookieJar = CookieJar() |
3345 |
3393 |
3346 return cls._cookieJar |
3394 return cls._cookieJar |
3347 |
3395 |
|
3396 @pyqtSlot() |
3348 def __clearIconsDatabase(self): |
3397 def __clearIconsDatabase(self): |
3349 """ |
3398 """ |
3350 Private slot to clear the favicons databse. |
3399 Private slot to clear the favicons databse. |
3351 """ |
3400 """ |
3352 WebIconProvider.instance().clear() |
3401 WebIconProvider.instance().clear() |
3353 |
3402 |
|
3403 @pyqtSlot() |
3354 def __showWebIconsDialog(self): |
3404 def __showWebIconsDialog(self): |
3355 """ |
3405 """ |
3356 Private slot to show a dialog to manage the favicons database. |
3406 Private slot to show a dialog to manage the favicons database. |
3357 """ |
3407 """ |
3358 WebIconProvider.instance().showWebIconDialog() |
3408 WebIconProvider.instance().showWebIconDialog() |
3382 self.newTab(url) |
3432 self.newTab(url) |
3383 else: |
3433 else: |
3384 cb.setUrl(url) |
3434 cb.setUrl(url) |
3385 self.__activating = False |
3435 self.__activating = False |
3386 |
3436 |
|
3437 @pyqtSlot() |
3387 def __activateCurrentBrowser(self): |
3438 def __activateCurrentBrowser(self): |
3388 """ |
3439 """ |
3389 Private slot to activate the current browser. |
3440 Private slot to activate the current browser. |
3390 """ |
3441 """ |
3391 self.currentBrowser().setFocus() |
3442 self.currentBrowser().setFocus() |
3392 |
3443 |
|
3444 @pyqtSlot() |
3393 def __syncTOC(self): |
3445 def __syncTOC(self): |
3394 """ |
3446 """ |
3395 Private slot to synchronize the TOC with the currently shown page. |
3447 Private slot to synchronize the TOC with the currently shown page. |
3396 """ |
3448 """ |
3397 if WebBrowserWindow._useQtHelp: |
3449 if WebBrowserWindow._useQtHelp: |
3398 with EricOverrideCursor(): |
3450 with EricOverrideCursor(): |
3399 url = self.currentBrowser().source() |
3451 url = self.currentBrowser().source() |
3400 self.__showTocWindow() |
3452 self.__showTocWindow() |
3401 if not self.__tocWindow.syncToContent(url): |
3453 if not self.__tocWindow.syncToContent(url): |
3402 self.statusBar().showMessage( |
3454 self.statusBar().showMessage( |
3403 self.tr("Could not find an associated content."), 5000) |
3455 self.tr("Could not find any associated content."), |
|
3456 5000) |
3404 |
3457 |
3405 def __showTocWindow(self): |
3458 def __showTocWindow(self): |
3406 """ |
3459 """ |
3407 Private method to show the table of contents window. |
3460 Private method to show the table of contents window. |
3408 """ |
3461 """ |
3430 @param widget reference to the widget to be activated (QWidget) |
3483 @param widget reference to the widget to be activated (QWidget) |
3431 """ |
3484 """ |
3432 widget.parent().show() |
3485 widget.parent().show() |
3433 widget.parent().raise_() |
3486 widget.parent().raise_() |
3434 widget.setFocus() |
3487 widget.setFocus() |
3435 |
3488 |
|
3489 @pyqtSlot() |
3436 def __setupFilterCombo(self): |
3490 def __setupFilterCombo(self): |
3437 """ |
3491 """ |
3438 Private slot to setup the filter combo box. |
3492 Private slot to setup the filter combo box. |
3439 """ |
3493 """ |
3440 if WebBrowserWindow._useQtHelp: |
3494 if WebBrowserWindow._useQtHelp: |
3441 activeFilter = self.filterCombo.currentText() |
3495 activeFilter = self.filterCombo.currentText() |
3442 if not activeFilter: |
3496 if not activeFilter: |
3443 activeFilter = self.__helpEngine.filterEngine().activeFilter() |
3497 activeFilter = self.__helpEngine.filterEngine().activeFilter() |
|
3498 allFilters = self.__helpEngine.filterEngine().filters() |
3444 self.filterCombo.clear() |
3499 self.filterCombo.clear() |
3445 self.filterCombo.addItems(sorted( |
3500 self.filterCombo.addItem(self.tr("Unfiltered")) |
3446 self.__helpEngine.filterEngine().filters())) |
3501 if allFilters: |
|
3502 self.filterCombo.insertSeparator(1) |
|
3503 for helpFilter in sorted(allFilters): |
|
3504 self.filterCombo.addItem(helpFilter, helpFilter) |
3447 self.filterCombo.setCurrentText(activeFilter) |
3505 self.filterCombo.setCurrentText(activeFilter) |
3448 |
3506 |
3449 def __filterQtHelpDocumentation(self, activeFilter): |
3507 @pyqtSlot(int) |
|
3508 def __filterQtHelpDocumentation(self, index): |
3450 """ |
3509 """ |
3451 Private slot to filter the QtHelp documentation. |
3510 Private slot to filter the QtHelp documentation. |
3452 |
3511 |
3453 @param activeFilter current text of the filter combobox |
3512 @param index index of the selected QtHelp documentation filter |
3454 @type str |
3513 @type int |
3455 """ |
3514 """ |
3456 if self.__helpEngine: |
3515 if self.__helpEngine: |
3457 self.__helpEngine.filterEngine().setActiveFilter(activeFilter) |
3516 helpFilter = self.filterCombo.itemData(index) |
3458 |
3517 self.__helpEngine.filterEngine().setActiveFilter(helpFilter) |
|
3518 |
|
3519 @pyqtSlot() |
3459 def __manageQtHelpDocumentation(self): |
3520 def __manageQtHelpDocumentation(self): |
3460 """ |
3521 """ |
3461 Private slot to manage the QtHelp documentation database. |
3522 Private slot to manage the QtHelp documentation database. |
3462 """ |
3523 """ |
3463 if WebBrowserWindow._useQtHelp: |
3524 if WebBrowserWindow._useQtHelp: |
3500 progressBar.setSizePolicy(sizePolicy) |
3562 progressBar.setSizePolicy(sizePolicy) |
3501 layout.addWidget(progressBar) |
3563 layout.addWidget(progressBar) |
3502 |
3564 |
3503 self.statusBar().insertPermanentWidget( |
3565 self.statusBar().insertPermanentWidget( |
3504 0, self.__indexingProgress) |
3566 0, self.__indexingProgress) |
3505 |
3567 |
|
3568 @pyqtSlot() |
3506 def __indexingFinished(self): |
3569 def __indexingFinished(self): |
3507 """ |
3570 """ |
3508 Private slot to handle the start of the indexing process. |
3571 Private slot to handle the start of the indexing process. |
3509 """ |
3572 """ |
3510 if WebBrowserWindow._useQtHelp: |
3573 if WebBrowserWindow._useQtHelp: |
3511 self.statusBar().removeWidget(self.__indexingProgress) |
3574 self.statusBar().removeWidget(self.__indexingProgress) |
3512 self.__indexingProgress = None |
3575 self.__indexingProgress = None |
3513 self.__indexing = False |
3576 self.__indexing = False |
3514 if self.__searchWord is not None: |
3577 |
3515 self.__searchForWord() |
3578 @pyqtSlot(str) |
3516 |
3579 def __searchForWord(self, searchWord): |
3517 def __searchForWord(self): |
|
3518 """ |
3580 """ |
3519 Private slot to search for a word. |
3581 Private slot to search for a word. |
3520 """ |
3582 |
3521 if ( |
3583 @param searchWord word to search for |
3522 WebBrowserWindow._useQtHelp and |
3584 @type str |
3523 not self.__indexing and |
3585 """ |
3524 self.__searchWord is not None |
3586 if WebBrowserWindow._useQtHelp and searchWord: |
3525 ): |
3587 if self.__indexing: |
3526 self.__searchDock.show() |
3588 # Try again a second later |
3527 self.__searchDock.raise_() |
3589 QTimer.singleShot( |
3528 self.__searchEngine.search(self.__searchWord) |
3590 1000, |
3529 self.__searchWord = None |
3591 lambda: self.__searchForWord(searchWord) |
|
3592 ) |
|
3593 else: |
|
3594 self.__searchDock.show() |
|
3595 self.__searchDock.raise_() |
|
3596 self.__searchEngine.search(searchWord) |
3530 |
3597 |
3531 def search(self, word): |
3598 def search(self, word): |
3532 """ |
3599 """ |
3533 Public method to search for a word. |
3600 Public method to search for a word. |
3534 |
3601 |
3535 @param word word to search for (string) |
3602 @param word word to search for |
|
3603 @type str |
3536 """ |
3604 """ |
3537 if WebBrowserWindow._useQtHelp: |
3605 if WebBrowserWindow._useQtHelp: |
3538 self.__searchWord = word |
3606 self.__searchForWord(word) |
3539 self.__searchForWord() |
3607 |
3540 |
3608 @pyqtSlot() |
3541 def __removeOldDocumentation(self): |
3609 def __removeOldDocumentation(self): |
3542 """ |
3610 """ |
3543 Private slot to remove non-existing documentation from the help engine. |
3611 Private slot to remove non-existing documentation from the help engine. |
3544 """ |
3612 """ |
3545 if WebBrowserWindow._useQtHelp: |
3613 if WebBrowserWindow._useQtHelp: |
3546 for namespace in self.__helpEngine.registeredDocumentations(): |
3614 for namespace in self.__helpEngine.registeredDocumentations(): |
3547 docFile = self.__helpEngine.documentationFileName(namespace) |
3615 docFile = self.__helpEngine.documentationFileName(namespace) |
3548 if not os.path.exists(docFile): |
3616 if not os.path.exists(docFile): |
3549 self.__helpEngine.unregisterDocumentation(namespace) |
3617 self.__helpEngine.unregisterDocumentation(namespace) |
3550 |
3618 |
|
3619 @pyqtSlot() |
3551 def __lookForNewDocumentation(self): |
3620 def __lookForNewDocumentation(self): |
3552 """ |
3621 """ |
3553 Private slot to look for new documentation to be loaded into the |
3622 Private slot to look for new documentation to be loaded into the |
3554 help database. |
3623 help database. |
3555 """ |
3624 """ |
3562 self.__helpInstaller.docsInstalled.connect(self.__docsInstalled) |
3631 self.__helpInstaller.docsInstalled.connect(self.__docsInstalled) |
3563 |
3632 |
3564 self.statusBar().showMessage( |
3633 self.statusBar().showMessage( |
3565 self.tr("Looking for Documentation...")) |
3634 self.tr("Looking for Documentation...")) |
3566 self.__helpInstaller.installDocs() |
3635 self.__helpInstaller.installDocs() |
3567 |
3636 |
|
3637 @pyqtSlot(str) |
3568 def __showInstallationError(self, message): |
3638 def __showInstallationError(self, message): |
3569 """ |
3639 """ |
3570 Private slot to show installation errors. |
3640 Private slot to show installation errors. |
3571 |
3641 |
3572 @param message message to be shown (string) |
3642 @param message message to be shown |
|
3643 @type str |
3573 """ |
3644 """ |
3574 EricMessageBox.warning( |
3645 EricMessageBox.warning( |
3575 self, |
3646 self, |
3576 self.tr("eric Web Browser"), |
3647 self.tr("eric Web Browser"), |
3577 message) |
3648 message) |
3578 |
3649 |
|
3650 @pyqtSlot(bool) |
3579 def __docsInstalled(self, installed): |
3651 def __docsInstalled(self, installed): |
3580 """ |
3652 """ |
3581 Private slot handling the end of documentation installation. |
3653 Private slot handling the end of documentation installation. |
3582 |
3654 |
3583 @param installed flag indicating that documents were installed |
3655 @param installed flag indicating that documents were installed |
3584 (boolean) |
3656 @type bool |
3585 """ |
3657 """ |
3586 if WebBrowserWindow._useQtHelp: |
3658 if WebBrowserWindow._useQtHelp: |
3587 self.statusBar().clearMessage() |
3659 self.statusBar().clearMessage() |
3588 |
3660 self.__helpEngine.setupData() |
3589 def __initHelpDb(self): |
3661 |
3590 """ |
3662 @pyqtSlot(str) |
3591 Private slot to initialize the documentation database. |
|
3592 """ |
|
3593 if WebBrowserWindow._useQtHelp: |
|
3594 unfiltered = self.tr("Unfiltered") |
|
3595 filterEngine = self.__helpEngine.filterEngine() |
|
3596 if unfiltered not in filterEngine.filters(): |
|
3597 filterEngine.setFilterData(unfiltered, QHelpFilterData()) |
|
3598 |
|
3599 self.__helpEngine.blockSignals(True) |
|
3600 filterEngine.setActiveFilter(unfiltered) |
|
3601 self.__helpEngine.blockSignals(False) |
|
3602 |
|
3603 def __warning(self, msg): |
3663 def __warning(self, msg): |
3604 """ |
3664 """ |
3605 Private slot handling warnings from the help engine. |
3665 Private slot handling warnings from the help engine. |
3606 |
3666 |
3607 @param msg message sent by the help engine (string) |
3667 @param msg message sent by the help engine |
|
3668 @type str |
3608 """ |
3669 """ |
3609 EricMessageBox.warning( |
3670 EricMessageBox.warning( |
3610 self, |
3671 self, |
3611 self.tr("Help Engine"), msg) |
3672 self.tr("Help Engine"), msg) |
3612 |
3673 |
|
3674 @pyqtSlot() |
3613 def __aboutToShowSettingsMenu(self): |
3675 def __aboutToShowSettingsMenu(self): |
3614 """ |
3676 """ |
3615 Private slot to show the Settings menu. |
3677 Private slot to show the Settings menu. |
3616 """ |
3678 """ |
3617 self.editMessageFilterAct.setEnabled( |
3679 self.editMessageFilterAct.setEnabled( |
3618 EricErrorMessage.messageHandlerInstalled()) |
3680 EricErrorMessage.messageHandlerInstalled()) |
3619 |
3681 |
|
3682 @pyqtSlot() |
3620 def __clearPrivateData(self): |
3683 def __clearPrivateData(self): |
3621 """ |
3684 """ |
3622 Private slot to clear the private data. |
3685 Private slot to clear the private data. |
3623 """ |
3686 """ |
3624 from .WebBrowserClearPrivateDataDialog import ( |
3687 from .WebBrowserClearPrivateDataDialog import ( |
3675 action. |
3739 action. |
3676 |
3740 |
3677 @return reference to the search engines configuration action (QAction) |
3741 @return reference to the search engines configuration action (QAction) |
3678 """ |
3742 """ |
3679 return self.searchEnginesAct |
3743 return self.searchEnginesAct |
3680 |
3744 |
|
3745 @pyqtSlot() |
3681 def __showPasswordsDialog(self): |
3746 def __showPasswordsDialog(self): |
3682 """ |
3747 """ |
3683 Private slot to show the passwords management dialog. |
3748 Private slot to show the passwords management dialog. |
3684 """ |
3749 """ |
3685 from .Passwords.PasswordsDialog import PasswordsDialog |
3750 from .Passwords.PasswordsDialog import PasswordsDialog |
3686 |
3751 |
3687 dlg = PasswordsDialog(self) |
3752 dlg = PasswordsDialog(self) |
3688 dlg.exec() |
3753 dlg.exec() |
3689 |
3754 |
|
3755 @pyqtSlot() |
3690 def __showCertificateErrorsDialog(self): |
3756 def __showCertificateErrorsDialog(self): |
3691 """ |
3757 """ |
3692 Private slot to show the certificate errors management dialog. |
3758 Private slot to show the certificate errors management dialog. |
3693 """ |
3759 """ |
3694 self.networkManager().showSslErrorExceptionsDialog() |
3760 self.networkManager().showSslErrorExceptionsDialog() |
3695 |
3761 |
|
3762 @pyqtSlot() |
3696 def __showAdBlockDialog(self): |
3763 def __showAdBlockDialog(self): |
3697 """ |
3764 """ |
3698 Private slot to show the AdBlock configuration dialog. |
3765 Private slot to show the AdBlock configuration dialog. |
3699 """ |
3766 """ |
3700 self.adBlockManager().showDialog() |
3767 self.adBlockManager().showDialog() |
3701 |
3768 |
|
3769 @pyqtSlot() |
3702 def __showPersonalInformationDialog(self): |
3770 def __showPersonalInformationDialog(self): |
3703 """ |
3771 """ |
3704 Private slot to show the Personal Information configuration dialog. |
3772 Private slot to show the Personal Information configuration dialog. |
3705 """ |
3773 """ |
3706 self.personalInformationManager().showConfigurationDialog() |
3774 self.personalInformationManager().showConfigurationDialog() |
3707 |
3775 |
|
3776 @pyqtSlot() |
3708 def __showGreaseMonkeyConfigDialog(self): |
3777 def __showGreaseMonkeyConfigDialog(self): |
3709 """ |
3778 """ |
3710 Private slot to show the GreaseMonkey scripts configuration dialog. |
3779 Private slot to show the GreaseMonkey scripts configuration dialog. |
3711 """ |
3780 """ |
3712 self.greaseMonkeyManager().showConfigurationDialog() |
3781 self.greaseMonkeyManager().showConfigurationDialog() |
3713 |
3782 |
|
3783 @pyqtSlot() |
3714 def __showFeaturePermissionDialog(self): |
3784 def __showFeaturePermissionDialog(self): |
3715 """ |
3785 """ |
3716 Private slot to show the feature permission dialog. |
3786 Private slot to show the feature permission dialog. |
3717 """ |
3787 """ |
3718 self.featurePermissionManager().showFeaturePermissionsDialog() |
3788 self.featurePermissionManager().showFeaturePermissionsDialog() |
3719 |
3789 |
|
3790 @pyqtSlot() |
3720 def __showZoomValuesDialog(self): |
3791 def __showZoomValuesDialog(self): |
3721 """ |
3792 """ |
3722 Private slot to show the zoom values management dialog. |
3793 Private slot to show the zoom values management dialog. |
3723 """ |
3794 """ |
3724 from .ZoomManager.ZoomValuesDialog import ZoomValuesDialog |
3795 from .ZoomManager.ZoomValuesDialog import ZoomValuesDialog |
3725 |
3796 |
3726 dlg = ZoomValuesDialog(self) |
3797 dlg = ZoomValuesDialog(self) |
3727 dlg.exec() |
3798 dlg.exec() |
3728 |
3799 |
|
3800 @pyqtSlot() |
3729 def __showDownloadsWindow(self): |
3801 def __showDownloadsWindow(self): |
3730 """ |
3802 """ |
3731 Private slot to show the downloads dialog. |
3803 Private slot to show the downloads dialog. |
3732 """ |
3804 """ |
3733 self.downloadManager().show() |
3805 self.downloadManager().show() |
3734 |
3806 |
|
3807 @pyqtSlot() |
3735 def __showPageSource(self): |
3808 def __showPageSource(self): |
3736 """ |
3809 """ |
3737 Private slot to show the source of the current page in an editor. |
3810 Private slot to show the source of the current page in an editor. |
3738 """ |
3811 """ |
3739 self.currentBrowser().page().toHtml(self.__showPageSourceCallback) |
3812 self.currentBrowser().page().toHtml(self.__showPageSourceCallback) |
3790 from .Bookmarks.BookmarksManager import BookmarksManager |
3864 from .Bookmarks.BookmarksManager import BookmarksManager |
3791 cls._bookmarksManager = BookmarksManager() |
3865 cls._bookmarksManager = BookmarksManager() |
3792 |
3866 |
3793 return cls._bookmarksManager |
3867 return cls._bookmarksManager |
3794 |
3868 |
|
3869 @pyqtSlot(QUrl) |
|
3870 @pyqtSlot(QUrl, str) |
3795 def openUrl(self, url, title=None): |
3871 def openUrl(self, url, title=None): |
3796 """ |
3872 """ |
3797 Public slot to load a URL in the current tab. |
3873 Public slot to load a URL in the current tab. |
3798 |
3874 |
3799 @param url URL to be opened (QUrl) |
3875 @param url URL to be opened |
3800 @param title title of the bookmark (string) |
3876 @type QUrl |
|
3877 @param title title of the bookmark |
|
3878 @type str |
3801 """ |
3879 """ |
3802 self.__linkActivated(url) |
3880 self.__linkActivated(url) |
3803 |
3881 |
|
3882 @pyqtSlot(QUrl) |
|
3883 @pyqtSlot(QUrl, str) |
3804 def openUrlNewTab(self, url, title=None): |
3884 def openUrlNewTab(self, url, title=None): |
3805 """ |
3885 """ |
3806 Public slot to load a URL in a new tab. |
3886 Public slot to load a URL in a new tab. |
3807 |
3887 |
3808 @param url URL to be opened (QUrl) |
3888 @param url URL to be opened |
3809 @param title title of the bookmark (string) |
3889 @type QUrl |
|
3890 @param title title of the bookmark |
|
3891 @type str |
3810 """ |
3892 """ |
3811 self.newTab(url) |
3893 self.newTab(url) |
3812 |
3894 |
|
3895 @pyqtSlot(QUrl) |
|
3896 @pyqtSlot(QUrl, str) |
3813 def openUrlNewBackgroundTab(self, url, title=None): |
3897 def openUrlNewBackgroundTab(self, url, title=None): |
3814 """ |
3898 """ |
3815 Public slot to load a URL in a new background tab. |
3899 Public slot to load a URL in a new background tab. |
3816 |
3900 |
3817 @param url URL to be opened (QUrl) |
3901 @param url URL to be opened |
3818 @param title title of the bookmark (string) |
3902 @type QUrl |
|
3903 @param title title of the bookmark |
|
3904 @type str |
3819 """ |
3905 """ |
3820 self.newTab(url, background=True) |
3906 self.newTab(url, background=True) |
3821 |
3907 |
|
3908 @pyqtSlot(QUrl) |
|
3909 @pyqtSlot(QUrl, str) |
3822 def openUrlNewWindow(self, url, title=None): |
3910 def openUrlNewWindow(self, url, title=None): |
3823 """ |
3911 """ |
3824 Public slot to load a URL in a new window. |
3912 Public slot to load a URL in a new window. |
3825 |
3913 |
3826 @param url URL to be opened (QUrl) |
3914 @param url URL to be opened |
3827 @param title title of the bookmark (string) |
3915 @type QUrl |
|
3916 @param title title of the bookmark |
|
3917 @type str |
3828 """ |
3918 """ |
3829 self.newWindow(url) |
3919 self.newWindow(url) |
3830 |
3920 |
|
3921 @pyqtSlot(QUrl) |
|
3922 @pyqtSlot(QUrl, str) |
3831 def openUrlNewPrivateWindow(self, url, title=None): |
3923 def openUrlNewPrivateWindow(self, url, title=None): |
3832 """ |
3924 """ |
3833 Public slot to load a URL in a new private window. |
3925 Public slot to load a URL in a new private window. |
3834 |
3926 |
3835 @param url URL to be opened (QUrl) |
3927 @param url URL to be opened |
3836 @param title title of the bookmark (string) |
3928 @type QUrl |
|
3929 @param title title of the bookmark |
|
3930 @type str |
3837 """ |
3931 """ |
3838 self.newPrivateWindow(url) |
3932 self.newPrivateWindow(url) |
3839 |
3933 |
|
3934 @pyqtSlot() |
3840 def __sendPageLink(self): |
3935 def __sendPageLink(self): |
3841 """ |
3936 """ |
3842 Private slot to send the link of the current page via email. |
3937 Private slot to send the link of the current page via email. |
3843 """ |
3938 """ |
3844 url = self.currentBrowser().url() |
3939 url = self.currentBrowser().url() |
4152 self.__createTextEncodingSubmenu(self.tr("Apple"), macCodecs, |
4248 self.__createTextEncodingSubmenu(self.tr("Apple"), macCodecs, |
4153 self.__textEncodingMenu) |
4249 self.__textEncodingMenu) |
4154 self.__createTextEncodingSubmenu(self.tr("Other"), otherCodecs, |
4250 self.__createTextEncodingSubmenu(self.tr("Other"), otherCodecs, |
4155 self.__textEncodingMenu) |
4251 self.__textEncodingMenu) |
4156 |
4252 |
|
4253 @pyqtSlot(QAction) |
4157 def __setTextEncoding(self, act): |
4254 def __setTextEncoding(self, act): |
4158 """ |
4255 """ |
4159 Private slot to set the selected text encoding as the default for |
4256 Private slot to set the selected text encoding as the default for |
4160 this session. |
4257 this session. |
4161 |
4258 |
4162 @param act reference to the selected action (QAction) |
4259 @param act reference to the selected action |
|
4260 @type QAction |
4163 """ |
4261 """ |
4164 codec = act.data() |
4262 codec = act.data() |
4165 if codec == "": |
4263 if codec == "": |
4166 self.webSettings().setDefaultTextEncoding("") |
4264 self.webSettings().setDefaultTextEncoding("") |
4167 else: |
4265 else: |
4390 feedsManager.newBackgroundTab.disconnect(self.openUrlNewBackgroundTab) |
4490 feedsManager.newBackgroundTab.disconnect(self.openUrlNewBackgroundTab) |
4391 feedsManager.newWindow.disconnect(self.openUrlNewWindow) |
4491 feedsManager.newWindow.disconnect(self.openUrlNewWindow) |
4392 feedsManager.newPrivateWindow.disconnect(self.openUrlNewPrivateWindow) |
4492 feedsManager.newPrivateWindow.disconnect(self.openUrlNewPrivateWindow) |
4393 feedsManager.rejected.disconnect() |
4493 feedsManager.rejected.disconnect() |
4394 |
4494 |
|
4495 @pyqtSlot() |
4395 def __showSiteinfoDialog(self): |
4496 def __showSiteinfoDialog(self): |
4396 """ |
4497 """ |
4397 Private slot to show the site info dialog. |
4498 Private slot to show the site info dialog. |
4398 """ |
4499 """ |
4399 from .SiteInfo.SiteInfoDialog import SiteInfoDialog |
4500 from .SiteInfo.SiteInfoDialog import SiteInfoDialog |
4569 |
4673 |
4570 @param url URL to be scanned (QUrl) |
4674 @param url URL to be scanned (QUrl) |
4571 """ |
4675 """ |
4572 self.__virusTotal.submitUrl(url) |
4676 self.__virusTotal.submitUrl(url) |
4573 |
4677 |
|
4678 @pyqtSlot(str) |
4574 def __virusTotalSubmitUrlError(self, msg): |
4679 def __virusTotalSubmitUrlError(self, msg): |
4575 """ |
4680 """ |
4576 Private slot to handle an URL scan submission error. |
4681 Private slot to handle an URL scan submission error. |
4577 |
4682 |
4578 @param msg error message (str) |
4683 @param msg error message |
|
4684 @type str |
4579 """ |
4685 """ |
4580 EricMessageBox.critical( |
4686 EricMessageBox.critical( |
4581 self, |
4687 self, |
4582 self.tr("VirusTotal Scan"), |
4688 self.tr("VirusTotal Scan"), |
4583 self.tr("""<p>The VirusTotal scan could not be""" |
4689 self.tr("""<p>The VirusTotal scan could not be""" |
4584 """ scheduled.<p>\n<p>Reason: {0}</p>""").format(msg)) |
4690 """ scheduled.<p>\n<p>Reason: {0}</p>""").format(msg)) |
4585 |
4691 |
|
4692 @pyqtSlot(str) |
4586 def __virusTotalUrlScanReport(self, url): |
4693 def __virusTotalUrlScanReport(self, url): |
4587 """ |
4694 """ |
4588 Private slot to initiate the display of the URL scan report page. |
4695 Private slot to initiate the display of the URL scan report page. |
4589 |
4696 |
4590 @param url URL of the URL scan report page (string) |
4697 @param url URL of the URL scan report page |
|
4698 @type str |
4591 """ |
4699 """ |
4592 self.newTab(url) |
4700 self.newTab(url) |
4593 |
4701 |
|
4702 @pyqtSlot(str) |
4594 def __virusTotalFileScanReport(self, url): |
4703 def __virusTotalFileScanReport(self, url): |
4595 """ |
4704 """ |
4596 Private slot to initiate the display of the file scan report page. |
4705 Private slot to initiate the display of the file scan report page. |
4597 |
4706 |
4598 @param url URL of the file scan report page (string) |
4707 @param url URL of the file scan report page |
|
4708 @type str |
4599 """ |
4709 """ |
4600 self.newTab(url) |
4710 self.newTab(url) |
4601 |
4711 |
|
4712 @pyqtSlot() |
4602 def __virusTotalIpAddressReport(self): |
4713 def __virusTotalIpAddressReport(self): |
4603 """ |
4714 """ |
4604 Private slot to retrieve an IP address report. |
4715 Private slot to retrieve an IP address report. |
4605 """ |
4716 """ |
4606 ip, ok = QInputDialog.getText( |
4717 ip, ok = QInputDialog.getText( |
4947 |
5062 |
4948 @param word word to be searched for |
5063 @param word word to be searched for |
4949 @type str |
5064 @type str |
4950 """ |
5065 """ |
4951 if WebBrowserWindow._useQtHelp: |
5066 if WebBrowserWindow._useQtHelp: |
4952 self.__searchWord = word |
5067 self.__searchForWord(word) |
4953 self.__searchForWord() |
|
4954 |
5068 |
4955 self.raise_() |
5069 self.raise_() |
4956 self.activateWindow() |
5070 self.activateWindow() |
4957 |
5071 |
4958 ###################################################### |
5072 ###################################################### |
4959 ## Methods below implement shortcuts related functions |
5073 ## Methods below implement shortcuts related functions |
4960 ###################################################### |
5074 ###################################################### |
4961 |
5075 |
|
5076 @pyqtSlot() |
4962 def __configShortcuts(self): |
5077 def __configShortcuts(self): |
4963 """ |
5078 """ |
4964 Private slot to configure the keyboard shortcuts. |
5079 Private slot to configure the keyboard shortcuts. |
4965 """ |
5080 """ |
4966 if self.__shortcutsDialog is None: |
5081 if self.__shortcutsDialog is None: |
4967 from Preferences.ShortcutsDialog import ShortcutsDialog |
5082 from Preferences.ShortcutsDialog import ShortcutsDialog |
4968 self.__shortcutsDialog = ShortcutsDialog(self) |
5083 self.__shortcutsDialog = ShortcutsDialog(self) |
4969 self.__shortcutsDialog.populate(helpViewer=self) |
5084 self.__shortcutsDialog.populate(helpViewer=self) |
4970 self.__shortcutsDialog.show() |
5085 self.__shortcutsDialog.show() |
4971 |
5086 |
|
5087 @pyqtSlot() |
4972 def __exportShortcuts(self): |
5088 def __exportShortcuts(self): |
4973 """ |
5089 """ |
4974 Private slot to export the keyboard shortcuts. |
5090 Private slot to export the keyboard shortcuts. |
4975 """ |
5091 """ |
4976 fn, selectedFilter = EricFileDialog.getSaveFileNameAndFilter( |
5092 fn, selectedFilter = EricFileDialog.getSaveFileNameAndFilter( |