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 |