UI/NotificationWidget.py

changeset 5842
c3f41b959a65
parent 5389
9b1c800daff3
child 6048
82ad8ec9548c
equal deleted inserted replaced
5841:f227183ae1df 5842:c3f41b959a65
85 85
86 def setTimeout(self, timeout): 86 def setTimeout(self, timeout):
87 """ 87 """
88 Public method to set the timeout for the notification. 88 Public method to set the timeout for the notification.
89 89
90 @param timeout timeout to be used in seconds (integer) 90 @param timeout timeout to be used in seconds (0 = indefinitely)
91 @type int
91 """ 92 """
92 self.__timeout = timeout * 1000 93 self.__timeout = timeout * 1000
93 94
94 def show(self): 95 def show(self):
95 """ 96 """
99 self.heading.setText(self.__heading) 100 self.heading.setText(self.__heading)
100 self.text.setText(self.__text) 101 self.text.setText(self.__text)
101 102
102 if not self.__settingPosition: 103 if not self.__settingPosition:
103 self.__timer.stop() 104 self.__timer.stop()
104 self.__timer.setInterval(self.__timeout) 105 if self.__timeout > 0:
105 self.__timer.start() 106 self.__timer.setInterval(self.__timeout)
107 self.__timer.start()
106 108
107 super(NotificationWidget, self).show() 109 super(NotificationWidget, self).show()
108 110
109 sh = self.sizeHint() 111 sh = self.sizeHint()
110 self.resize(max(self.width(), sh.width()), sh.height()) 112 self.resize(max(self.width(), sh.width()), sh.height())

eric ide

mercurial