5211 timeout = Preferences.getUI("NotificationTimeout") |
5218 timeout = Preferences.getUI("NotificationTimeout") |
5212 cls._notification.showNotification( |
5219 cls._notification.showNotification( |
5213 icon, heading, text, kind=kind, timeout=timeout |
5220 icon, heading, text, kind=kind, timeout=timeout |
5214 ) |
5221 ) |
5215 |
5222 |
|
5223 @classmethod |
|
5224 def __showWebNotification(cls, webNotification): |
|
5225 """ |
|
5226 Class method to show a notification sent by Chromium. |
|
5227 |
|
5228 @param webNotification notification sent by Chromium |
|
5229 @type QWebEngineNotification |
|
5230 """ |
|
5231 cls.showNotification( |
|
5232 QPixmap.fromImage(webNotification.icon()), |
|
5233 webNotification.title(), |
|
5234 webNotification.message(), |
|
5235 kind=NotificationTypes.OTHER, |
|
5236 timeout=0, |
|
5237 ) |
|
5238 |
5216 ###################################### |
5239 ###################################### |
5217 ## Support for global status bar below |
5240 ## Support for global status bar below |
5218 ###################################### |
5241 ###################################### |
5219 |
5242 |
5220 @classmethod |
5243 @classmethod |
5306 ) |
5329 ) |
5307 cls._webProfile.setSpellCheckLanguages( |
5330 cls._webProfile.setSpellCheckLanguages( |
5308 Preferences.getWebBrowser("SpellCheckLanguages") |
5331 Preferences.getWebBrowser("SpellCheckLanguages") |
5309 ) |
5332 ) |
5310 |
5333 |
|
5334 # configure notifications |
|
5335 cls._webProfile.setNotificationPresenter(cls.__showWebNotification) |
|
5336 |
5311 # Setup QWebChannel user scripts |
5337 # Setup QWebChannel user scripts |
5312 # WebChannel for SafeJsWorld |
5338 # WebChannel for SafeJsWorld |
5313 script = QWebEngineScript() |
5339 script = QWebEngineScript() |
5314 script.setName("_eric_webchannel") |
5340 script.setName("_eric_webchannel") |
5315 script.setInjectionPoint(QWebEngineScript.InjectionPoint.DocumentCreation) |
5341 script.setInjectionPoint(QWebEngineScript.InjectionPoint.DocumentCreation) |