From bfbdd7e140965d374ac1f33ac9f6b45eae5b9d65 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Sat, 24 Jun 2017 12:14:23 +0200 Subject: [PATCH] Chan address validator button feedback - During validation, the button not only turns gray but also changes label --- src/bitmessageqt/addressvalidator.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/bitmessageqt/addressvalidator.py b/src/bitmessageqt/addressvalidator.py index 56352b72..f9de70a2 100644 --- a/src/bitmessageqt/addressvalidator.py +++ b/src/bitmessageqt/addressvalidator.py @@ -15,6 +15,8 @@ class AddressPassPhraseValidatorMixin(): self.buttonBox = buttonBox self.addressMandatory = addressMandatory self.isValid = False + # save default text + self.okButtonLabel = self.buttonBox.button(QtGui.QDialogButtonBox.Ok).text() def setError(self, string): if string is not None and self.feedBackObject is not None: @@ -26,6 +28,10 @@ class AddressPassPhraseValidatorMixin(): self.isValid = False if self.buttonBox: self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(False) + if string is not None and self.feedBackObject is not None: + self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setText(_translate("AddressValidator", "Invalid")) + else: + self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setText(_translate("AddressValidator", "Validating...")) def setOK(self, string): if string is not None and self.feedBackObject is not None: @@ -37,6 +43,7 @@ class AddressPassPhraseValidatorMixin(): self.isValid = True if self.buttonBox: self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True) + self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setText(self.okButtonLabel) def checkQueue(self): gotOne = False