fixed CQ for bitmessageqt.statusbar module
This commit is contained in:
parent
95fc981ae2
commit
1571176082
|
@ -1,8 +1,12 @@
|
||||||
from PyQt4 import QtCore, QtGui
|
# pylint: disable=unused-argument
|
||||||
from Queue import Queue
|
"""Status bar Module"""
|
||||||
|
|
||||||
from time import time
|
from time import time
|
||||||
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
|
|
||||||
class BMStatusBar(QtGui.QStatusBar):
|
class BMStatusBar(QtGui.QStatusBar):
|
||||||
|
"""Status bar with queue and priorities"""
|
||||||
duration = 10000
|
duration = 10000
|
||||||
deleteAfter = 60
|
deleteAfter = 60
|
||||||
|
|
||||||
|
@ -13,6 +17,9 @@ class BMStatusBar(QtGui.QStatusBar):
|
||||||
self.iterator = 0
|
self.iterator = 0
|
||||||
|
|
||||||
def timerEvent(self, event):
|
def timerEvent(self, event):
|
||||||
|
"""an event handler which allows to queue and prioritise messages to
|
||||||
|
show in the status bar, for example if many messages come very quickly
|
||||||
|
after one another, it adds delays and so on"""
|
||||||
while len(self.important) > 0:
|
while len(self.important) > 0:
|
||||||
self.iterator += 1
|
self.iterator += 1
|
||||||
try:
|
try:
|
||||||
|
@ -30,9 +37,3 @@ class BMStatusBar(QtGui.QStatusBar):
|
||||||
self.important.append([message, time()])
|
self.important.append([message, time()])
|
||||||
self.iterator = len(self.important) - 2
|
self.iterator = len(self.important) - 2
|
||||||
self.timerEvent(None)
|
self.timerEvent(None)
|
||||||
|
|
||||||
def showMessage(self, message, timeout=0):
|
|
||||||
super(BMStatusBar, self).showMessage(message, timeout)
|
|
||||||
|
|
||||||
def clearMessage(self):
|
|
||||||
super(BMStatusBar, self).clearMessage()
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user