Browse Source

Merge branch 'master' into feature/raw_tx

283
Maran 12 years ago
parent
commit
65e257a537
  1. 2
      README
  2. 19
      gui/gui_lite.py
  3. 7
      lib/interface.py

2
README

@ -26,7 +26,7 @@ https://en.bitcoin.it/wiki/Electrum
== HOW OFFICIAL PACKAGES ARE CREATED ==
python mki18n.py
pyrcc4 icons.qrc -o lib/icons_rc.py
pyrcc4 icons.qrc -o gui/icons_rc.py
python setup.py sdist --format=zip,gztar
On Mac OS X:

19
gui/gui_lite.py

@ -17,6 +17,7 @@ from electrum.bitcoin import is_valid
from i18n import _
import decimal
import exchange_rate
import json
import os.path
import random
import re
@ -293,7 +294,11 @@ class MiniWindow(QDialog):
self.amount_input.setAttribute(Qt.WA_MacShowFocusRect, 0)
self.amount_input.textChanged.connect(self.amount_input_changed)
if self.actuator.wallet.seed:
self.send_button = QPushButton(_("&Send"))
else:
self.send_button = QPushButton(_("&Create"))
self.send_button.setObjectName("send_button")
self.send_button.setDisabled(True);
self.send_button.clicked.connect(self.send)
@ -494,7 +499,7 @@ class MiniWindow(QDialog):
quote_text = self.create_quote_text(btc_balance)
if quote_text:
quote_text = "(%s)" % quote_text
btc_balance = "%.2f" % (btc_balance / bitcoin(1))
btc_balance = "%.4f" % (btc_balance / bitcoin(1))
self.balance_label.set_balance_text(btc_balance, quote_text)
self.setWindowTitle("Electrum %s - %s BTC" % (electrum_version, btc_balance))
@ -856,6 +861,7 @@ class MiniActuator:
QMessageBox.warning(parent_window, _('Error'), str(error), _('OK'))
return False
if tx.is_complete:
h = self.wallet.send_tx(tx)
self.waiting_dialog(lambda: False if self.wallet.tx_event.isSet() else _("Sending transaction, please wait..."))
@ -872,8 +878,15 @@ class MiniActuator:
return False
TransactionWindow(message, self)
# QMessageBox.information(parent_window, '',
# _('Your transaction has been sent.') + '\n' + message, _('OK'))
else:
filename = 'unsigned_tx_%s' % (time.mktime(time.gmtime()))
try:
fileName = QFileDialog.getSaveFileName(QWidget(), _("Select a transaction filename"), os.path.expanduser('~/%s' % (filename)))
with open(fileName,'w') as f:
f.write(json.dumps(tx.as_dict(),indent=4) + '\n')
QMessageBox.information(QWidget(), _('Unsigned transaction created'), _("Unsigned transaction was saved to file:") + " " +fileName, _('OK'))
except BaseException as e:
QMessageBox.warning(QWidget(), _('Error'), _('Could not write transaction to file: %s' % e), _('OK'))
return True
def fetch_destination(self, address):

7
lib/interface.py

@ -470,6 +470,9 @@ class Interface(threading.Thread):
if message not in self.subscriptions[channel]:
self.subscriptions[channel].append(message)
if not self.is_connected:
return
if self.protocol in 'st':
with self.lock:
out = self.send_tcp(messages, channel)
@ -516,14 +519,14 @@ class Interface(threading.Thread):
print "changing server:", server, proxy
self.server = server
self.proxy = proxy
if self.protocol in 'st' and self.s:
if self.is_connected and self.protocol in 'st' and self.s:
self.s.shutdown(socket.SHUT_RDWR)
self.s.close()
self.is_connected = False # this exits the polling loop
self.trigger_callback('disconnecting') # for actively disconnecting
def stop(self):
if self.protocol in 'st' and self.s:
if self.is_connected and self.protocol in 'st' and self.s:
self.s.shutdown(socket.SHUT_RDWR)
self.s.close()

Loading…
Cancel
Save