Password requests from the tx dialog box are now centred on the
tx dialog. Similarly for error messages if misentering the password.
Also, "Signing transaction..." and "Broadcasting transaction..." are
centred on the appropriate tx dialog.
Finally restore the old "Sign" button enabling / disabling, as we
can now tell if the user cancelled the password request.
Doesn't require any particular argument order of the wrapped
function.
Caller can tell if the user cancelled the request or not.
Optionally handles parent window hints.
It has long been a minor annoyance that this isn't the
default behaviour. Semantics are as follows:
- Fees are calculated automatically, as usual, and shown
in black
- If the user inputs a fee, it is retained, and shown in
blue to indicate it is user-overridden
- The user can switch back to automatic fee calculation mode
in two ways: press Clear, or blank out the fee field
- User fees are also cleared by do_clear(), for instance when
the payment is sent
I have checked all usage combinations I could think of, including
the ! case, and all work in a sensible and natural fashion.
This also fixes issue #995.
Show-before-send currently asks for the password
and creates a signed tx before showing anything.
This is a little unnerving as you can't see what
you're being asked to sign.
This patch does a few things:
- Adds a description label to the TX dialog
- You see the tx before being asked for password;
that is only requested on pressing Sign
- in show-before-broadcast mode, the Send button
text is instead "Show...". Hook up this button
text change to the prefs dialog too.
- Remove many redundant imports. In particular
PyQ4 is checked in main_window.py so no need
in tx_dialog too.
Note I had to remove disabling of the Sign button,
because if the user presses "cancel" nothing will
re-enable it.
This is working towards showing transactions before asking for passwords.
I think it also means the transaction dialog now interacts properly with
plugins, whereas it didn't before.
send_tx now takes a callback instead of a label, and does not decide
on whether to broadast itself; that is left to its caller.
broadcast_transaction() takes care of adding the description of the
successfully broadcast transaction to the wallet. Previously labels
could be added to the wallet even if the broadcast was cancelled by
the user or unsuccessful, which doesn't seem right.
Lengthen the dialog messages a little, as some window managers lose the
"Please Wait" title bar owing to window decorations if the message
is too short.
Two callers of get_spendable_coins were removing frozen addrs
before calling. Put that functionality in the function.
We shouldn't be able to send_from a frozen address. This was
possible in the current release because logic assumed a two-element
tuple was returned when it is now three-element. Fix that too.
Command line options listunspent and createrawtransaction currently
ignore frozen addresses. I'm not sure that's right but I've preserved
that behaviour.
With this patch only the wallet class refers to self.frozen_addresses;
other clients use is_frozen() now.
Speedup mainly from writing to storage only once.
Make frozen_addresses a set in memory, as sets give cleaner
code and are more efficient.
Minor change in behaviour: command line freezing used to return
False if the address isn't in the wallet OR the address was already
frozen. Now it returns more like a success code: it returns False
only if the address isn't in the wallet regardless of frozen state.
Similarly for unfreezing.
Fees should be recalculated when send_from changes.
Fees should be recalculated when editing fee preference, but
only save to storage when leaving the fee per kb widget.
No need to emit a textEdited signal; the widget does that already
(with the effect that we used to call update_fee() twice).