4734 """ |
4734 """ |
4735 if Preferences.getUI("NotificationsEnabled"): |
4735 if Preferences.getUI("NotificationsEnabled"): |
4736 if cls._notification is None: |
4736 if cls._notification is None: |
4737 from UI.NotificationWidget import NotificationWidget |
4737 from UI.NotificationWidget import NotificationWidget |
4738 cls._notification = NotificationWidget() |
4738 cls._notification = NotificationWidget() |
4739 cls._notification.setPixmap(icon) |
|
4740 cls._notification.setHeading(heading) |
|
4741 cls._notification.setText(text) |
|
4742 if timeout is None: |
4739 if timeout is None: |
4743 timeout = Preferences.getUI("NotificationTimeout") |
4740 timeout = Preferences.getUI("NotificationTimeout") |
4744 cls._notification.setTimeout(timeout) |
4741 cls._notification.showNotification(icon, heading, text, |
4745 cls._notification.move( |
4742 timeout=timeout) |
4746 Preferences.getUI("NotificationPosition")) |
|
4747 cls._notification.show() |
|
4748 |
4743 |
4749 @classmethod |
4744 @classmethod |
4750 def notificationsEnabled(cls): |
4745 def notificationsEnabled(cls): |
4751 """ |
4746 """ |
4752 Class method to check, if notifications are enabled. |
4747 Class method to check, if notifications are enabled. |