Package client :: Module StatusBar
[hide private]
[frames] | no frames]

Source Code for Module client.StatusBar

 1  """ 
 2  Overview 
 3  ======== 
 4  This modules provides a Status Bar for the Basin Client Interface.  It has a much simpler 
 5  interface than its parent class, QStatusBar, since it needs to do far less. 
 6  """ 
 7   
 8  import PyQt4.QtGui 
 9   
10 -class StatusBar (PyQt4.QtGui.QStatusBar):
11 """ 12 Overview 13 ======== 14 This class acts as a mere facade for the PyQt status bar interface. All we need it to ever do is show text 15 with or without a timer on them. 16 """ 17
18 - def __init__ (self, parent, bridge):
19 """ 20 Overview 21 ======== 22 This constructor will set itself (a QStatusBar) to the parent, and will connect itself to the 23 bridge. This object will essentially just sit and wait for messages to be sent to it. 24 25 @param parent: The main window which the status bar will be inserted into. 26 @type parent: QMainWindow 27 28 @param bridge: The bridge object which connects all interactive components together. 29 @type bridge: L{Bridge<client.Bridge.Bridge>} 30 """ 31 32 PyQt4.QtGui.QStatusBar.__init__ (self, parent) 33 34 # Connect to bridge & parent 35 bridge.setStatusBar (self) 36 parent.setStatusBar (self)
37
38 - def show (self, text):
39 """ 40 Overview 41 ======== 42 This will show a message on the status bar for an indefinite amount of time. As soon as this 43 method is called again, or the showTimed method, the message in 'text' will be taken down and 44 replaced with the new message. 45 46 @param text: The message you want displayed in the status bar. 47 @type text: string 48 """ 49 50 self.showMessage (str (text))
51
52 - def showTimed (self, text, seconds):
53 """ 54 Overview 55 ======== 56 This will show a message on the status bar for a specified time in seconds (a float). The 57 message in 'text' may come down sooner, if this method, or the show method is called before the 58 time has elapsed. 59 60 @param text: The message you want displayed in the status bar. 61 @type text: string 62 63 @param seconds: The number of seconds you want the message to be displayed for. 64 @type seconds: int or float 65 """ 66 67 self.showMessage (str (text), seconds * 1000.0)
68