WebBrowser/WebBrowserWindow.py

changeset 4917
682750cc7bd5
parent 4913
e16573640cb8
child 4956
1496516b0f2c
equal deleted inserted replaced
4915:8081031061a2 4917:682750cc7bd5
2590 self.currentBrowser().selectAll() 2590 self.currentBrowser().selectAll()
2591 2591
2592 @classmethod 2592 @classmethod
2593 def isPrivate(cls): 2593 def isPrivate(cls):
2594 """ 2594 """
2595 Public method to check the private browsing mode. 2595 Class method to check the private browsing mode.
2596 2596
2597 @return flag indicating private browsing mode 2597 @return flag indicating private browsing mode
2598 @rtype bool 2598 @rtype bool
2599 """ 2599 """
2600 return cls._isPrivate 2600 return cls._isPrivate
3767 if not bool(evt.oldState() & Qt.WindowFullScreen) and \ 3767 if not bool(evt.oldState() & Qt.WindowFullScreen) and \
3768 bool(self.windowState() & Qt.WindowFullScreen): 3768 bool(self.windowState() & Qt.WindowFullScreen):
3769 # enter full screen mode 3769 # enter full screen mode
3770 self.__windowStates = evt.oldState() 3770 self.__windowStates = evt.oldState()
3771 elif bool(evt.oldState() & Qt.WindowFullScreen) and \ 3771 elif bool(evt.oldState() & Qt.WindowFullScreen) and \
3772 not bool(self.windowState() & Qt.WindowFullScreen): 3772 not bool(self.windowState() & Qt.WindowFullScreen):
3773 # leave full screen mode 3773 # leave full screen mode
3774 self.setWindowState(self.__windowStates) 3774 self.setWindowState(self.__windowStates)
3775 self.__htmlFullScreen = False 3775 self.__htmlFullScreen = False
3776 3776
3777 return super(WebBrowserWindow, self).event(evt) 3777 return super(WebBrowserWindow, self).event(evt)
3940 ################################### 3940 ###################################
3941 ## Support for download files below 3941 ## Support for download files below
3942 ################################### 3942 ###################################
3943 3943
3944 @classmethod 3944 @classmethod
3945 def downloadRequested(self, download): 3945 def downloadRequested(cls, download):
3946 """ 3946 """
3947 Class method to handle a download request. 3947 Class method to handle a download request.
3948 3948
3949 @param download reference to the download data 3949 @param download reference to the download data
3950 @type QWebEngineDownloadItem 3950 @type QWebEngineDownloadItem
3951 """ 3951 """
3952 self.downloadManager().download(download) 3952 cls.downloadManager().download(download)
3953 3953
3954 ######################################## 3954 ########################################
3955 ## Support for web engine profiles below 3955 ## Support for web engine profiles below
3956 ######################################## 3956 ########################################
3957 3957
3980 if not private: 3980 if not private:
3981 if Preferences.getWebBrowser("DiskCacheEnabled"): 3981 if Preferences.getWebBrowser("DiskCacheEnabled"):
3982 cls._webProfile.setHttpCacheType( 3982 cls._webProfile.setHttpCacheType(
3983 QWebEngineProfile.DiskHttpCache) 3983 QWebEngineProfile.DiskHttpCache)
3984 cls._webProfile.setHttpCacheMaximumSize( 3984 cls._webProfile.setHttpCacheMaximumSize(
3985 Preferences.getWebBrowser("DiskCacheSize") 3985 Preferences.getWebBrowser("DiskCacheSize") *
3986 * 1024 * 1024) 3986 1024 * 1024)
3987 cls._webProfile.setCachePath(os.path.join( 3987 cls._webProfile.setCachePath(os.path.join(
3988 Utilities.getConfigDir(), "web_browser")) 3988 Utilities.getConfigDir(), "web_browser"))
3989 else: 3989 else:
3990 cls._webProfile.setHttpCacheType( 3990 cls._webProfile.setHttpCacheType(
3991 QWebEngineProfile.MemoryHttpCache) 3991 QWebEngineProfile.MemoryHttpCache)

eric ide

mercurial