Commit Graph

92 Commits

Author SHA1 Message Date
Neil Booth 5be16ad5ca Clean up exchange handling in FX plugin 2015-09-02 18:53:23 +09:00
Neil Booth a5e0265010 Make exchange rate plugin a network thread job
This fixes a lot of thread error noise when closing down electrum.
2015-08-31 20:33:39 +09:00
Neil Booth f5a8da43e9 Have fields update as exchange rates do
Currently the exchange rates plugin shows the converted
rate at the time of last user input.  If the fx rate
changes the send and receive tabs do not update.

This makes them update.  It also means that when enabling
the plugin, if the user had input a BTC amount in the send
or receive, the other fields will refresh.  This didn't
used to happen - they stayed blank.
2015-08-31 20:14:44 +09:00
ThomasV 486d181b0b fix for #1408 exchange rates plugin 2015-08-23 19:22:52 +02:00
ThomasV 2515fc9b6a use blue color to denote auto-filled values (fee, exchange rates plugin) 2015-08-06 12:56:48 +02:00
Neil Booth aa6de86c27 Once a user inputs a fee, retain it.
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.
2015-07-03 20:14:12 +09:00
ThomasV f70a996619 fix trezor initialiation hook (pass window in load_wallet) 2015-06-09 09:58:40 +02:00
Neil Booth 03e53a5e01 Create a constant for 100000000 and use it
Use same name as is in bitcoind.
Note that one of the constants in text.py had the wrong number
of zeroes previously...
2015-06-01 14:53:36 +09:00
ThomasV 8f98ea4aca make plugins available without the GUI 2015-05-23 10:38:19 +02:00
ThomasV 617fb36b06 minor fix: index 2015-05-02 11:21:19 +02:00
ThomasV afa814a444 small fix exchange_rates 2015-05-02 11:08:35 +02:00
pooler bc95b0b4db Fix variable reference in Exchange Rates plugin 2015-04-30 19:41:33 +02:00
ThomasV 30b189f68a fix #1179 2015-04-30 18:04:27 +02:00
ThomasV 77648c284f exchange_rates: use requests module 2015-04-28 06:28:20 +02:00
ThomasV 2bec9711cc decimal.Decimal -> Decimal 2015-04-28 04:50:41 +02:00
ThomasV 576e9be02b exchange_rates: more simplifications 2015-04-28 04:42:25 +02:00
ThomasV 4f3dd51885 factorize more 2015-04-28 04:24:10 +02:00
ThomasV 0b0fb45f62 exchange rates: factorize getter functions 2015-04-28 03:55:55 +02:00
ThomasV a42743ca2d always request exchange rates over https 2015-04-28 03:28:43 +02:00
ThomasV 89338fa7bd revert 0cd63d19f4 2015-04-23 17:58:29 +02:00
ThomasV dd6fd46913 set daemon thread in exchange rates plugin 2015-04-23 17:43:18 +02:00
ThomasV b9537b0885 Merge pull request #1152 from chiguireitor/master
Fixed a missing import in exchange_rate.py that caused program hangs and...
2015-04-23 17:40:10 +02:00
John Miguel Villar Zavatti 0cd63d19f4 Fixed a missing import in exchange_rate.py that caused program hangs and wallet corruption
Signed-off-by: John Miguel Villar Zavatti <johnvillarzavatti@gmail.com>
2015-04-23 11:05:55 -04:30
ThomasV 697d8b7750 follow up 8e415d0f2a 2015-04-20 12:16:42 +02:00
ThomasV 8e415d0f2a exchange_rates plugin: hide widgets on close 2015-04-20 01:27:17 +02:00
ThomasV d70c9d1ab7 stretch column instead of storing width 2015-04-02 17:45:44 +02:00
ThomasV ec11e58add handle pruning in wallet.txi/txo 2015-03-30 14:10:46 +02:00
ThomasV e3de121be9 store deserialized tx in/out in wallet file for fast computation 2015-03-30 14:10:46 +02:00
ThomasV 38e4eeef95 add rate conversion to receive tab 2015-03-14 19:47:57 +01:00
ThomasV 44b44279e7 import SSLError 2015-02-27 23:10:45 +01:00
ThomasV bc3013caf0 fix exchange_rate plugin behavior when typing amounts 2015-02-27 21:13:17 +01:00
ThomasV f302c90649 set self.wallet to None in plugin constructor 2015-02-17 11:39:06 +01:00
John Miguel Villar Zavatti ea4bf4e91f * Added BTCParalelo price index for Venezuelan Bolivar VEF
* Fixed all of the update_* functions on the exchange_rate.py plugin to indicate when there are SSL errors, there was a horrorous try-except-pass block that was drowning all the exceptions
* Added get_json_insecure to allow exchange rates over HTTP

Signed-off-by: John Miguel Villar Zavatti <johnvillarzavatti@gmail.com>
2015-02-16 15:24:26 -04:30
wozz 29cf811858 Fix currency type for bitcoinvenezuela history
update exchange rate history for bitcoinvenezuela exchange
2014-11-23 14:41:20 -05:00
Gergely Imreh 3c3d064cad Fix "Invalid Fee" issue when start with fiat in send (exchange rate plugin)
Problem:

Using the exchange rate plugin in the send dialog one can start with
entering a fiat amount, e.g. 5 USD, and the BTC amount is updated,
but no fee is calculated.

In this case can get "Invalid fee" error until the BTC amount is
touched manually and fee is calculated. This can cause confusion
when "set transaction fees manually" is disabled.

Reproducing:

* enable exchange rate plugin
* start Electrum
* in send dialog fill out any receive address
* add a value (e.g. 5) into the fiat dialog and see the BTC value filled out
* fee is not filled out, or if disabled the manual transaction fees then directly
  get "Invalid Fee" error

Expectation:

* Fees are calculated just as it would be by filling out the BTC field

Fix:

Fixed by triggering a fee setting the same way as it is done when
the BTC field is edited, by calling `textEdited.emit("")` of the relevant
`BTCAmountEdit` element. One problematic  thing is that this also triggers
a change on the fiat we just edited, and thus cursor positions need to be saved
and restored. This is not ideal, there should be a way to avoid such cascades
and trigger fee calculation directly instead of by proxy.

Editing the fiat field with these changes is more or less okay, there can be
some strange steps when the decimal point is edited, but IMHO not worse
than the BTC field when the decimal point is edited there.
2014-09-30 11:28:42 +08:00
ThomasV fd1f083958 simplify names 2014-09-19 13:48:49 +02:00
ThomasV 6cd00eb36b request history rates asynchronously 2014-09-19 13:36:30 +02:00
Michael Wozniak a996659225 Update itbit/coindesk exchange rate api
itbit/coindesk exchange rate requires separate API calls per currency
Moved the calls to when the exchange rate plugin updates and when the
user modifies a selection instead of every time the program needs to
query the current exchange rate

This fixes an issue with slow response time in the send tab with the
exchange rate plugin turned on and set to coindesk or itbit
2014-09-05 19:58:54 -04:00
ThomasV caf4adff49 add missing @hook in exch plugin 2014-09-05 19:43:27 +02:00
ThomasV 6101abda5d call init_qt everytime a plugin is enabled 2014-09-04 15:45:03 +02:00
ThomasV 79588eb4da init plugins before gui. register wallet types in plugin constructor 2014-08-31 15:33:20 +02:00
ThomasV a3790372d8 @hook decorator for plugins 2014-08-31 11:42:40 +02:00
Michael Wozniak 27ddfcdd36 Add itbit exchange to exchange rate plugin 2014-07-26 13:58:55 -04:00
Michael Wozniak 9ae30533ca update historical winkdex api 2014-07-22 17:28:37 -04:00
Michael Wozniak a72bc5a44a Update exchange rate plugin for Winkdex
updated exchange rate BTC price for Winkdex API that was officially published
2014-07-22 17:06:23 -04:00
ThomasV f4dfec4565 define frozen signal for exchange rate plugin 2014-06-24 17:44:31 +02:00
ThomasV f4a0a90010 catch exceptions raised by fiat amount conversion to decimal 2014-06-24 17:06:04 +02:00
ThomasV 96017fe530 fiat_e: set precision to 0.01 2014-06-11 18:20:25 +02:00
ThomasV cff3d6ce31 exchange rate plugin: bi-directional conversion 2014-06-11 18:10:21 +02:00
ThomasV efa35d9ec2 setAmount: convert to int 2014-06-11 15:36:40 +02:00