eric6/WebBrowser/WebBrowserWindow.py

changeset 7959
44e15eda6506
parent 7955
567f2ec958c3
child 7960
e8fc383322f7
equal deleted inserted replaced
7958:a70ebfad3d0e 7959:44e15eda6506
45 import Globals 45 import Globals
46 46
47 import UI.PixmapCache 47 import UI.PixmapCache
48 import UI.Config 48 import UI.Config
49 from UI.Info import Version 49 from UI.Info import Version
50 from UI.NotificationWidget import NotificationTypes
50 51
51 from .Tools import Scripts, WebBrowserTools, WebIconProvider 52 from .Tools import Scripts, WebBrowserTools, WebIconProvider
52 53
53 from .ZoomManager import ZoomManager 54 from .ZoomManager import ZoomManager
54 55
4716 ########################################## 4717 ##########################################
4717 ## Support for desktop notifications below 4718 ## Support for desktop notifications below
4718 ########################################## 4719 ##########################################
4719 4720
4720 @classmethod 4721 @classmethod
4721 def showNotification(cls, icon, heading, text, timeout=None): 4722 def showNotification(cls, icon, heading, text,
4723 kind=NotificationTypes.Information, timeout=None):
4722 """ 4724 """
4723 Class method to show a desktop notification. 4725 Class method to show a desktop notification.
4724 4726
4725 @param icon icon to be shown in the notification 4727 @param icon icon to be shown in the notification
4726 @type QPixmap 4728 @type QPixmap
4727 @param heading heading of the notification 4729 @param heading heading of the notification
4728 @type str 4730 @type str
4729 @param text text of the notification 4731 @param text text of the notification
4730 @type str 4732 @type str
4733 @param kind kind of notification to be shown
4734 @type NotificationTypes
4731 @param timeout time in seconds the notification should be shown 4735 @param timeout time in seconds the notification should be shown
4732 (None = use configured timeout, 0 = indefinitely) 4736 (None = use configured timeout, 0 = indefinitely)
4733 @type int 4737 @type int
4734 """ 4738 """
4735 if cls._notification is None: 4739 if cls._notification is None:
4737 cls._notification = NotificationWidget() 4741 cls._notification = NotificationWidget()
4738 4742
4739 if timeout is None: 4743 if timeout is None:
4740 timeout = Preferences.getUI("NotificationTimeout") 4744 timeout = Preferences.getUI("NotificationTimeout")
4741 cls._notification.showNotification( 4745 cls._notification.showNotification(
4742 icon, heading, text, timeout=timeout) 4746 icon, heading, text, kind=kind, timeout=timeout)
4743 4747
4744 ###################################### 4748 ######################################
4745 ## Support for global status bar below 4749 ## Support for global status bar below
4746 ###################################### 4750 ######################################
4747 4751

eric ide

mercurial