kivy: minor fixes

This commit is contained in:
ThomasV 2016-02-18 18:52:49 +01:00
parent 43b78ab0e1
commit b68e3608c9
4 changed files with 14 additions and 10 deletions

View File

@ -681,6 +681,14 @@ class ElectrumWindow(App):
d = TxDialog(self, tx)
d.open()
def broadcast(self, tx):
if self.network and self.network.is_connected():
self.show_info(_('Sending'))
ok, txid = self.wallet.sendtx(self.tx)
self.show_info(txid)
else:
self.show_info(_('Cannot broadcast transaction') + '\n' + _('Not connected'))
def address_dialog(self, screen):
pass

View File

@ -61,15 +61,15 @@ Builder.load_string('''
BoxLayout:
orientation: 'vertical' if self.width < self.height else 'horizontal'
padding:
min(dp(42), self.width/16), min(dp(60), self.height/16),\
min(dp(42), self.width/16), min(dp(72), self.height/16)
spacing: '27dp'
min(dp(27), self.width/32), min(dp(27), self.height/32),\
min(dp(27), self.width/32), min(dp(27), self.height/32)
spacing: '10dp'
GridLayout:
id: grid_logo
cols: 1
pos_hint: {'center_y': .5}
size_hint: 1, None
#height: self.minimum_height
height: self.minimum_height
Label:
color: root.text_color
text: 'ELECTRUM'

View File

@ -154,9 +154,7 @@ class TxDialog(Factory.Popup):
self.update()
def do_broadcast(self):
self.app.show_info(_('Broadcasting'))
ok, txid = self.app.wallet.sendtx(self.tx)
self.app.show_info(txid)
self.app.broadcast(self.tx)
def show_qr(self):
from electrum.bitcoin import base_encode

View File

@ -301,9 +301,7 @@ class SendScreen(CScreen):
self.app.tx_dialog(tx)
return
# broadcast
self.app.show_info("Sending...")
ok, txid = self.app.wallet.sendtx(tx)
self.app.show_info(txid)
self.app.broadcast(tx)
class ReceiveScreen(CScreen):