Skip to content
This repository was archived by the owner on Jul 23, 2020. It is now read-only.
This repository was archived by the owner on Jul 23, 2020. It is now read-only.

Connection Status #12

@thejame

Description

@thejame

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",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions