From a5d79d608a6fdfac0734d26070d388ceea3925ec Mon Sep 17 00:00:00 2001 From: ReevesAk Date: Fri, 11 Jun 2021 22:21:38 +0100 Subject: [PATCH 1/2] change dcrd connection message on button togggle --- tinywallet/tinywallet/screens.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tinywallet/tinywallet/screens.py b/tinywallet/tinywallet/screens.py index 2ff81441..386f8b98 100644 --- a/tinywallet/tinywallet/screens.py +++ b/tinywallet/tinywallet/screens.py @@ -1649,9 +1649,12 @@ def withDCRD(node): self.ctl.connectNode(withDCRD) + self.connectedLbl.setText("Connected to dcrd") + else: node.close() self.ctl.setNode(None) + self.connectedLbl.setText("Connection to dcrd is currently off") def fieldEdited(self, s): """ From 5875a53b6b39015b3114003792fad97a240e9c1a Mon Sep 17 00:00:00 2001 From: ReevesAk Date: Sun, 13 Jun 2021 17:56:34 +0100 Subject: [PATCH 2/2] bind dcrd connection message into DCRDConfigScreen methods --- tinywallet/tinywallet/screens.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tinywallet/tinywallet/screens.py b/tinywallet/tinywallet/screens.py index 386f8b98..d0527613 100644 --- a/tinywallet/tinywallet/screens.py +++ b/tinywallet/tinywallet/screens.py @@ -1606,6 +1606,21 @@ def showLive(self, show): self.submitBttn.setVisible(not show) self.useTmpBttn.setVisible(show) + def setDcrdLabelOn(self): + """ + Prints message when dcrd connection is on + """ + + self.connectedLbl.setText("Connected to dcrd") + + def setDcrdLabelOff(self): + """ + Prints message when dcrd connection is off + """ + + self.connectedLbl.setText("Connection to dcrd is currently off") + + def readConfig(self): """ Shows the configuration form if dcrd is not configured, else the @@ -1623,9 +1638,9 @@ def readConfig(self): self.connectedWgt.setVisible(True) self.hostLbl.setText(ctl.settings[DB.rpchost].decode()) if node and node.connected(): - self.connectedLbl.setText("Connected to dcrd") + self.setDcrdLabelOn() else: - self.connectedLbl.setText("Connection to dcrd is currently off") + self.setDcrdLabelOff() else: self.remoteForm.setVisible(True) self.connectedWgt.setVisible(False) @@ -1649,12 +1664,12 @@ def withDCRD(node): self.ctl.connectNode(withDCRD) - self.connectedLbl.setText("Connected to dcrd") + self.setDcrdLabelOn() else: node.close() self.ctl.setNode(None) - self.connectedLbl.setText("Connection to dcrd is currently off") + self.setDcrdLabelOff() def fieldEdited(self, s): """