From 0b191df2ddc3cc0fa0146203227f09c23cf38673 Mon Sep 17 00:00:00 2001 From: Daniel Gretzke Date: Sun, 8 Sep 2019 21:29:11 +0200 Subject: [PATCH] ui fix --- plug_py/plug.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plug_py/plug.py b/plug_py/plug.py index 3ad383a..7344c5e 100644 --- a/plug_py/plug.py +++ b/plug_py/plug.py @@ -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('') @@ -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): @@ -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