ThomasV 10 years ago
parent
commit
fd651709b8
  1. 3
      gui/qt/main_window.py
  2. 9
      gui/qt/util.py

3
gui/qt/main_window.py

@ -1193,8 +1193,6 @@ class ElectrumWindow(QMainWindow):
self.payment_request = None self.payment_request = None
return return
self.payto_help.show()
self.payto_help.set_alt(lambda: self.show_pr_details(pr))
if not pr.has_expired(): if not pr.has_expired():
self.payto_e.setGreen() self.payto_e.setGreen()
else: else:
@ -1261,7 +1259,6 @@ class ElectrumWindow(QMainWindow):
e.setText('') e.setText('')
e.setFrozen(False) e.setFrozen(False)
self.payto_help.set_alt(None)
self.set_pay_from([]) self.set_pay_from([])
self.update_status() self.update_status()
run_hook('do_clear') run_hook('do_clear')

9
gui/qt/util.py

@ -126,17 +126,10 @@ class HelpButton(QPushButton):
self.help_text = text self.help_text = text
self.setFocusPolicy(Qt.NoFocus) self.setFocusPolicy(Qt.NoFocus)
self.setFixedWidth(20) self.setFixedWidth(20)
self.alt = None
self.clicked.connect(self.onclick) self.clicked.connect(self.onclick)
def set_alt(self, func):
self.alt = func
def onclick(self): def onclick(self):
if self.alt: QMessageBox.information(self, 'Help', self.help_text, 'OK')
apply(self.alt)
else:
QMessageBox.information(self, 'Help', self.help_text, 'OK')
class Buttons(QHBoxLayout): class Buttons(QHBoxLayout):
def __init__(self, *buttons): def __init__(self, *buttons):

Loading…
Cancel
Save