Skip to content

Commit 8f5d485

Browse files
committed
Added AcceptBit integration.
1 parent fd8af94 commit 8f5d485

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

lib/gui_lite.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import sys
1212
import time
1313
import wallet
14+
import webbrowser
1415

1516
try:
1617
import lib.gui_qt as gui_qt
@@ -118,12 +119,15 @@ def __init__(self, actuator, expand_callback):
118119
interact_button.setObjectName("interact_button")
119120

120121
app_menu = QMenu(interact_button)
122+
acceptbit_action = app_menu.addAction(_("A&cceptBit"))
121123
report_action = app_menu.addAction(_("&Report Bug"))
122124
about_action = app_menu.addAction(_("&About Electrum"))
123125
app_menu.addSeparator()
124126
quit_action = app_menu.addAction(_("&Quit"))
125127
interact_button.setMenu(app_menu)
126128

129+
self.connect(acceptbit_action, SIGNAL("triggered()"),
130+
self.acceptbit)
127131
self.connect(report_action, SIGNAL("triggered()"),
128132
self.show_report_bug)
129133
self.connect(about_action, SIGNAL("triggered()"), self.show_about)
@@ -309,6 +313,9 @@ def copy_address(self):
309313
def update_completions(self, completions):
310314
self.address_completions.setStringList(completions)
311315

316+
def acceptbit(self):
317+
self.actuator.acceptbit(self.quote_currencies[0])
318+
312319
def show_about(self):
313320
QMessageBox.about(self, "Electrum",
314321
_("Electrum's focus is speed, with low resource usage and simplifying Bitcoin. You do not need to perform regular backups, because your wallet can be recovered from a secret phrase that you can memorize or write on paper. Startup times are instant because it operates in conjuction with high-performance servers that handle the most complicated parts of the Bitcoin system."))
@@ -553,6 +560,11 @@ def fetch_destination(self, address):
553560
def is_valid(self, address):
554561
return self.wallet.is_valid(address)
555562

563+
def acceptbit(self, currency):
564+
master_pubkey = self.wallet.master_public_key.encode("hex")
565+
url = "http://acceptbit.com/mpk/%s/%s" % (master_pubkey, currency)
566+
webbrowser.open(url)
567+
556568
class MiniDriver(QObject):
557569

558570
INITIALIZING = 0

0 commit comments

Comments
 (0)