Compare commits
1 Commits
master
...
olderVersi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e423e34c72 |
@ -911,6 +911,14 @@ class ElectrumWindow(App):
|
|||||||
d = LabelDialog(_('Enter description'), text, callback)
|
d = LabelDialog(_('Enter description'), text, callback)
|
||||||
d.open()
|
d.open()
|
||||||
|
|
||||||
|
def flodata_dialog(self, screen):
|
||||||
|
from .uix.dialogs.label_dialog import LabelDialog
|
||||||
|
text = screen.flodata
|
||||||
|
def callback(text):
|
||||||
|
screen.flodata = text
|
||||||
|
d = LabelDialog(_('Enter FLO data'), text, callback)
|
||||||
|
d.open()
|
||||||
|
|
||||||
def amount_dialog(self, screen, show_max):
|
def amount_dialog(self, screen, show_max):
|
||||||
from .uix.dialogs.amount_dialog import AmountDialog
|
from .uix.dialogs.amount_dialog import AmountDialog
|
||||||
amount = screen.amount
|
amount = screen.amount
|
||||||
|
|||||||
BIN
electrum/gui/kivy/theming/light-1.png
Normal file
BIN
electrum/gui/kivy/theming/light-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
BIN
electrum/gui/kivy/theming/light/script.png
Normal file
BIN
electrum/gui/kivy/theming/light/script.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
@ -184,6 +184,7 @@ class SendScreen(CScreen):
|
|||||||
self.screen.amount = self.app.format_amount_and_units(amount) if amount else ''
|
self.screen.amount = self.app.format_amount_and_units(amount) if amount else ''
|
||||||
self.payment_request = None
|
self.payment_request = None
|
||||||
self.screen.is_pr = False
|
self.screen.is_pr = False
|
||||||
|
self.screen.flodata = uri.get('flodata', '')
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
if self.app.wallet and self.payment_request_queued:
|
if self.app.wallet and self.payment_request_queued:
|
||||||
@ -196,6 +197,7 @@ class SendScreen(CScreen):
|
|||||||
self.screen.address = ''
|
self.screen.address = ''
|
||||||
self.payment_request = None
|
self.payment_request = None
|
||||||
self.screen.is_pr = False
|
self.screen.is_pr = False
|
||||||
|
self.screen.flodata = ''
|
||||||
|
|
||||||
def set_request(self, pr):
|
def set_request(self, pr):
|
||||||
self.screen.address = pr.get_requestor()
|
self.screen.address = pr.get_requestor()
|
||||||
@ -260,19 +262,20 @@ class SendScreen(CScreen):
|
|||||||
outputs = [TxOutput(bitcoin.TYPE_ADDRESS, address, amount)]
|
outputs = [TxOutput(bitcoin.TYPE_ADDRESS, address, amount)]
|
||||||
message = self.screen.message
|
message = self.screen.message
|
||||||
amount = sum(map(lambda x:x[2], outputs))
|
amount = sum(map(lambda x:x[2], outputs))
|
||||||
|
flodata = str(self.screen.flodata)
|
||||||
if self.app.electrum_config.get('use_rbf'):
|
if self.app.electrum_config.get('use_rbf'):
|
||||||
from .dialogs.question import Question
|
from .dialogs.question import Question
|
||||||
d = Question(_('Should this transaction be replaceable?'), lambda b: self._do_send(amount, message, outputs, b))
|
d = Question(_('Should this transaction be replaceable?'), lambda b: self._do_send(amount, message, outputs, flodata, b))
|
||||||
d.open()
|
d.open()
|
||||||
else:
|
else:
|
||||||
self._do_send(amount, message, outputs, False)
|
self._do_send(amount, message, outputs, False)
|
||||||
|
|
||||||
def _do_send(self, amount, message, outputs, rbf):
|
def _do_send(self, amount, message, outputs, flodata, rbf):
|
||||||
# make unsigned transaction
|
# make unsigned transaction
|
||||||
config = self.app.electrum_config
|
config = self.app.electrum_config
|
||||||
coins = self.app.wallet.get_spendable_coins(None, config)
|
coins = self.app.wallet.get_spendable_coins(None, config)
|
||||||
try:
|
try:
|
||||||
tx = self.app.wallet.make_unsigned_transaction(coins, outputs, config, None)
|
tx = self.app.wallet.make_unsigned_transaction(coins, outputs, config, None, txcomment=flodata)
|
||||||
except NotEnoughFunds:
|
except NotEnoughFunds:
|
||||||
self.app.show_error(_("Not enough funds"))
|
self.app.show_error(_("Not enough funds"))
|
||||||
return
|
return
|
||||||
|
|||||||
@ -12,6 +12,7 @@ SendScreen:
|
|||||||
amount: ''
|
amount: ''
|
||||||
message: ''
|
message: ''
|
||||||
is_pr: False
|
is_pr: False
|
||||||
|
flodata: ''
|
||||||
BoxLayout
|
BoxLayout
|
||||||
padding: '12dp', '12dp', '12dp', '12dp'
|
padding: '12dp', '12dp', '12dp', '12dp'
|
||||||
spacing: '12dp'
|
spacing: '12dp'
|
||||||
@ -90,6 +91,24 @@ SendScreen:
|
|||||||
default_text: _('Fee')
|
default_text: _('Fee')
|
||||||
text: app.fee_status
|
text: app.fee_status
|
||||||
on_release: Clock.schedule_once(lambda dt: app.fee_dialog(s, True))
|
on_release: Clock.schedule_once(lambda dt: app.fee_dialog(s, True))
|
||||||
|
CardSeparator:
|
||||||
|
opacity: int(not root.is_pr)
|
||||||
|
color: blue_bottom.foreground_color
|
||||||
|
BoxLayout:
|
||||||
|
id: flodata_selection
|
||||||
|
size_hint: 1, None
|
||||||
|
height: blue_bottom.item_height
|
||||||
|
spacing: '5dp'
|
||||||
|
Image:
|
||||||
|
source: 'atlas://electrum/gui/kivy/theming/light/script'
|
||||||
|
size_hint: None, None
|
||||||
|
size: '22dp', '22dp'
|
||||||
|
pos_hint: {'center_y': .5}
|
||||||
|
BlueButton:
|
||||||
|
id: flodata
|
||||||
|
text: s.flodata if s.flodata else (_('No FLO data') if root.is_pr else _('FLO data'))
|
||||||
|
disabled: root.is_pr
|
||||||
|
on_release: Clock.schedule_once(lambda dt: app.flodata_dialog(s))
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
size_hint: 1, None
|
size_hint: 1, None
|
||||||
height: '48dp'
|
height: '48dp'
|
||||||
|
|||||||
@ -544,7 +544,7 @@ class Abstract_Wallet(AddressSynchronizer):
|
|||||||
return dust_threshold(self.network)
|
return dust_threshold(self.network)
|
||||||
|
|
||||||
def make_unsigned_transaction(self, inputs, outputs, config, fixed_fee=None,
|
def make_unsigned_transaction(self, inputs, outputs, config, fixed_fee=None,
|
||||||
change_addr=None, is_sweep=False, txcomment = ""):
|
change_addr=None, is_sweep=False, txcomment=None ):
|
||||||
# check outputs
|
# check outputs
|
||||||
i_max = None
|
i_max = None
|
||||||
for i, o in enumerate(outputs):
|
for i, o in enumerate(outputs):
|
||||||
@ -563,6 +563,9 @@ class Abstract_Wallet(AddressSynchronizer):
|
|||||||
if fixed_fee is None and config.fee_per_kb() is None:
|
if fixed_fee is None and config.fee_per_kb() is None:
|
||||||
raise NoDynamicFeeEstimates()
|
raise NoDynamicFeeEstimates()
|
||||||
|
|
||||||
|
if txcomment is None:
|
||||||
|
txcomment = ''
|
||||||
|
|
||||||
for item in inputs:
|
for item in inputs:
|
||||||
self.add_input_info(item)
|
self.add_input_info(item)
|
||||||
|
|
||||||
|
|||||||
@ -362,7 +362,8 @@ if __name__ == '__main__':
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# config is an object passed to the various constructors (wallet, interface, gui)
|
# config is an object passed to the various constructors (wallet, interface, gui)
|
||||||
if is_android:
|
#if is_android:
|
||||||
|
if False:
|
||||||
config_options = {
|
config_options = {
|
||||||
'verbosity': '',
|
'verbosity': '',
|
||||||
'cmd': 'gui',
|
'cmd': 'gui',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user