src/eric7/WebBrowser/WebBrowserWindow.py

branch
eric7
changeset 11102
ceabb30155b8
parent 11090
f5f5f5803935
child 11103
382e5c9a43f0
equal deleted inserted replaced
11101:33079db9e5ba 11102:ceabb30155b8
4292 @pyqtSlot() 4292 @pyqtSlot()
4293 def __showFeaturePermissionDialog(self): 4293 def __showFeaturePermissionDialog(self):
4294 """ 4294 """
4295 Private slot to show the feature permission dialog. 4295 Private slot to show the feature permission dialog.
4296 """ 4296 """
4297 self.featurePermissionManager().showFeaturePermissionsDialog(self) 4297 if QtUtilities.qVersionTuple() >= (6, 8, 0):
4298 # Qt 6.8+
4299 from .FeaturePermissions.FeaturePermissionsDialog import FeaturePermissionsDialog
4300
4301 dlg = FeaturePermissionsDialog(self.webProfile().listAllPermissions(), parent=self)
4302 if dlg.exec() == QDialog.DialogCode.Accepted:
4303 dlg.persistChanges()
4304 else:
4305 # Qt <6.8
4306 self.featurePermissionManager().showFeaturePermissionsDialog(self)
4298 4307
4299 @pyqtSlot() 4308 @pyqtSlot()
4300 def __showZoomValuesDialog(self): 4309 def __showZoomValuesDialog(self):
4301 """ 4310 """
4302 Private slot to show the zoom values management dialog. 4311 Private slot to show the zoom values management dialog.
5390 """ 5399 """
5391 from .WebBrowserPage import WebBrowserPage 5400 from .WebBrowserPage import WebBrowserPage
5392 5401
5393 if cls._webProfile is None: 5402 if cls._webProfile is None:
5394 if private: 5403 if private:
5395 cls._webProfile = QWebEngineProfile() 5404 cls._webProfile = QWebEngineProfile.defaultProfile()
5396 else: 5405 else:
5397 cls._webProfile = QWebEngineProfile.defaultProfile() 5406 cls._webProfile = QWebEngineProfile("eric7")
5398 cls._webProfile.downloadRequested.connect(cls.downloadRequested) 5407 cls._webProfile.downloadRequested.connect(cls.downloadRequested)
5399 5408
5400 # add the default user agent string 5409 # add the default user agent string
5401 userAgent = cls._webProfile.httpUserAgent() 5410 userAgent = cls._webProfile.httpUserAgent()
5402 cls._webProfile.defaultUserAgent = userAgent 5411 cls._webProfile.defaultUserAgent = userAgent
5437 ) 5446 )
5438 cls._webProfile.setSpellCheckLanguages( 5447 cls._webProfile.setSpellCheckLanguages(
5439 Preferences.getWebBrowser("SpellCheckLanguages") 5448 Preferences.getWebBrowser("SpellCheckLanguages")
5440 ) 5449 )
5441 5450
5451 # TODO: setPersistentPermissionPolicy for Qt 6.8+
5452 # setting key: "NoPersistentPermissions" for non-private only
5453
5442 # configure notifications 5454 # configure notifications
5443 cls._webProfile.setNotificationPresenter(cls.__showWebNotification) 5455 cls._webProfile.setNotificationPresenter(cls.__showWebNotification)
5444 5456
5445 # Setup QWebChannel user scripts 5457 # Setup QWebChannel user scripts
5446 # WebChannel for SafeJsWorld 5458 # WebChannel for SafeJsWorld

eric ide

mercurial