-
Notifications
You must be signed in to change notification settings - Fork 4
Connection Status #12
Description
Had an idea about putting a connection status in the top right of the display, so if the app disconnects from the ProPresenter service or cannot reach it, you get an error instead of a blank screen. Then when the connection is good again, the message disappears. Check it out - not much modification was needed.
` def connected(self, data):
print "ProPresenter Connected"
self.updateStatus("")
def connectFailed(self, error):
self.tryReconnect = True
if self.disconnectTime == 0:
self.disconnectTime = time.time()
print "ProPresenter Connect Failed", error
self.updateStatus("NO CONNECTION")
def disconnected(self, error):
self.tryReconnect = True
if self.disconnectTime == 0:
self.disconnectTime = time.time()
print "ProPresenter Disconnected", error
self.updateStatus("DISCONNECTED")`
and then the object:
self.labelStatus = tk.Label( self, text = "", font = (self.fontName, self.fontSizeClock, self.fontStyle), background = self.backgroundColour, foreground = self.errorColour, wraplength = self.wordWrapLength, anchor = tk.SE, justify = tk.LEFT ) self.labelStatus.grid( column = 1, row = 0, sticky = tk.E+tk.N+tk.S, padx = self.padX, pady = self.padY )
and the function:
` def updateStatus(self, data):
if self.labelStatus is None:
return False
self.labelTimer.config(text = "")
self.labelStatus.config(text = data)`
It doesn't need a new column or row since it shares it with the Timer status.
Just needs a parameter in the JSON file like so:
"TextColourError": "#FF0000",