4730 @type str |
4730 @type str |
4731 @param timeout time in seconds the notification should be shown |
4731 @param timeout time in seconds the notification should be shown |
4732 (None = use configured timeout, 0 = indefinitely) |
4732 (None = use configured timeout, 0 = indefinitely) |
4733 @type int |
4733 @type int |
4734 """ |
4734 """ |
4735 if Preferences.getUI("NotificationsEnabled"): |
4735 if cls._notification is None: |
4736 if cls._notification is None: |
4736 from UI.NotificationWidget import NotificationWidget |
4737 from UI.NotificationWidget import NotificationWidget |
4737 cls._notification = NotificationWidget() |
4738 cls._notification = NotificationWidget() |
4738 |
4739 if timeout is None: |
4739 if timeout is None: |
4740 timeout = Preferences.getUI("NotificationTimeout") |
4740 timeout = Preferences.getUI("NotificationTimeout") |
4741 cls._notification.showNotification(icon, heading, text, |
4741 cls._notification.showNotification( |
4742 timeout=timeout) |
4742 icon, heading, text, timeout=timeout) |
4743 |
|
4744 @classmethod |
|
4745 def notificationsEnabled(cls): |
|
4746 """ |
|
4747 Class method to check, if notifications are enabled. |
|
4748 |
|
4749 @return flag indicating, if notifications are enabled (boolean) |
|
4750 """ |
|
4751 return Preferences.getUI("NotificationsEnabled") |
|
4752 |
4743 |
4753 ###################################### |
4744 ###################################### |
4754 ## Support for global status bar below |
4745 ## Support for global status bar below |
4755 ###################################### |
4746 ###################################### |
4756 |
4747 |