4 # |
4 # |
5 |
5 |
6 """ |
6 """ |
7 Module implementing a Notification widget. |
7 Module implementing a Notification widget. |
8 """ |
8 """ |
|
9 |
|
10 from __future__ import unicode_literals # __IGNORE_WARNING__ |
9 |
11 |
10 from PyQt4.QtCore import Qt, QTimer, QPoint |
12 from PyQt4.QtCore import Qt, QTimer, QPoint |
11 from PyQt4.QtGui import QWidget, QPixmap |
13 from PyQt4.QtGui import QWidget, QPixmap |
12 |
14 |
13 from .Ui_NotificationWidget import Ui_NotificationWidget |
15 from .Ui_NotificationWidget import Ui_NotificationWidget |
25 |
27 |
26 @param parent reference to the parent widget (QWidget) |
28 @param parent reference to the parent widget (QWidget) |
27 @param setPosition flag indicating to set the display |
29 @param setPosition flag indicating to set the display |
28 position interactively (boolean) |
30 position interactively (boolean) |
29 """ |
31 """ |
30 super().__init__(parent) |
32 super(NotificationWidget, self).__init__(parent) |
31 self.setupUi(self) |
33 self.setupUi(self) |
32 |
34 |
33 self.__timeout = 5000 |
35 self.__timeout = 5000 |
34 self.__icon = QPixmap() |
36 self.__icon = QPixmap() |
35 self.__heading = "" |
37 self.__heading = "" |
96 if not self.__settingPosition: |
98 if not self.__settingPosition: |
97 self.__timer.stop() |
99 self.__timer.stop() |
98 self.__timer.setInterval(self.__timeout) |
100 self.__timer.setInterval(self.__timeout) |
99 self.__timer.start() |
101 self.__timer.start() |
100 |
102 |
101 super().show() |
103 super(NotificationWidget, self).show() |
102 |
104 |
103 def mousePressEvent(self, evt): |
105 def mousePressEvent(self, evt): |
104 """ |
106 """ |
105 Protected method to handle presses of a mouse button. |
107 Protected method to handle presses of a mouse button. |
106 |
108 |