Skip to content

Commit

Permalink
ui fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Gretzke committed Sep 8, 2019
1 parent 4d82201 commit 0b191df
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plug_py/plug.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ def acceptWindow(self, show):
self.updateInfo(
'Price for ' + str(int(self.ws_thread.maxSeconds / 3600)) + 'h: %.2f€' % round(euroValue, 2))
self.ui.acceptPriceButton.setVisible(True)
self.ui.disconnectButton.setVisible(True)
self.ui.rejectButton.setVisible(True)
else:
self.updateInfo('')
self.ui.acceptPriceButton.setVisible(False)
self.ui.disconnectButton.setVisible(False)
self.ui.rejectButton.setVisible(False)

def resetToStart(self):
self.updateInfo('')
Expand All @@ -209,12 +209,14 @@ def resetToStart(self):
self.ui.infoCenterLabel.setVisible(False)
self.ui.selectButton.setVisible(False)
self.ui.disconnectButton.setVisible(False)
self.ui.rejectButton.setVisible(False)
self.ui.acceptPriceButton.setVisible(False)
self.ui.ampsLabel.setVisible(False)
self.ui.pcClosedButton.setVisible(False)
self.ui.startButton.setVisible(True)

def disconnect(self):
self.ui.disconnectButton.setVisible(False)
self.ws_thread.paymentState = State.closed

def closeEvent(self, event):
Expand Down Expand Up @@ -566,6 +568,7 @@ async def active_P(self):
window.cm_thread = measureCurrent()
window.cm_thread.start()
self.startTimestamp = time()
window.ui.disconnectButton.setVisible(True)
return
else:
# if current measurement thread not running, set up
Expand Down

0 comments on commit 0b191df

Please sign in to comment.