Commit Graph

321 Commits

Author SHA1 Message Date
tomFlowee 9daefb38d2 Start work on the destination edit page 2023-03-11 22:05:15 +01:00
tomFlowee 0659c99b37 Make 'price then' use accurate prices.
If we don't have price info near the mining date, don't show an
inaccurate version.
2023-03-09 22:53:56 +01:00
tomFlowee 784ccfbf38 Allow historical date to be accurate
The backend has the historical prices in its database, we ask for it by
timestamp the by default it returns the nearest value. Typically within
24 hours.

But if the database doesn't have the data, or its very inaccurate, this
may casue confusion.
So we now have a new API call that returns zero instead of an inaccurate
historical price. Allowing us to prefer not showing anything over plain
false data.
2023-03-09 22:46:03 +01:00
tomFlowee fa225772e8 New version 2023-02-25 19:04:47 +01:00
tomFlowee b13f7d353e Make brand new wallets behave better on initial sync
We now skip building (and sending) of the bloom filter until we have
finished the initial blockheader sync. (only relevant for newly created
wallets).

Additionally we update the WalletInfo with our inital blockheight as
soon as we know about it.
2023-02-24 19:45:12 +01:00
tomFlowee e664b033e4 Move shutdown of app singleton to be earlier
The downside of having the application singleton be the owner of the
wallets is that the destructor won't get called until after main() has
been completed.
And that means that globals deletion order becomes an issue, which is
messy and should be avoided.

This change splits out the saving and deletion of wallets & p2p layer,
making use of the Qt application object signal to delete wallets just
before the QtGuiApplication object destructs. Which is _inside_ of
main().
2023-02-24 19:03:22 +01:00
tomFlowee c93dbbeb2e Update amounts in UI 2023-02-22 20:53:15 +01:00
tomFlowee 457edc20b4 Simplify the payment and amounts getters
This merges the paymentAmount and effectiveBchAmount methods because they
did 99% the same.
Same with the paymentAmountFiat and effectiveFiatAmount.

This removes the 'effective*' set of properties.
2023-02-22 15:28:06 +01:00
tomFlowee 63033ab153 Forward the user owned property being changed.
This is useful to see if a default wallet got an incoming transaction.
2023-02-22 15:05:29 +01:00
tomFlowee 0fd3465c7d new version 2023-02-21 20:31:58 +01:00
tomFlowee fadf247838 Add context to translation 2023-02-21 15:52:16 +01:00
tomFlowee a00f21e4e2 Move calculation of fees to c++
Add a property 'fees' to the TransactionInfo class and use it.

This also changes the GUI behavior of the 'sent' field a little.
In the GUI we now show the amount actually meant to arrive on the other
address(es) instead of the amount our wallet became more empty.

This makes a lot of sense if you look at your transaction and compare to
an invoice, now the 'sent' field will match that invoice and it will
match what the receiver actually received.
2023-02-20 18:10:35 +01:00
tomFlowee 5e2e4c1bc4 Fix historical pricing data-state. 2023-02-20 16:20:43 +01:00
tomFlowee 5e2976e803 When we load historical price, emit that change
So the QML that was already loaded can use it.
2023-02-20 10:54:21 +01:00
tomFlowee 44131aa4df Remove no longer used 'mock' method. 2023-02-20 10:52:58 +01:00
tomFlowee aa0a505f8f Add price details popup
Show the current price, historical price-differences and a button to
change the currency.
2023-02-19 18:42:33 +01:00
tomFlowee a8264538c0 Payment::reset() should not delete the exchange rate
to reset the payment removes all user set properties, giving you a clean
payment object.
Since the exchange rate is both not user-set and also not something that
is expected to change between one payment and the next, it is now no
longer cleared on reset().
2023-02-18 16:25:33 +01:00
tomFlowee 155647d7ac Add docs and make input selector work again
Document various of the Payment properties better and make the input
selector use the multi-detail getter for price.
2023-02-17 19:22:24 +01:00
tomFlowee 9f39a9f54f Make the logic simpler
Move the logic for fiat to the payment object too and simplify the need
for code by defining this can only be called in the single-output mode.
2023-02-08 20:55:24 +01:00
tomFlowee f1f0f113d7 Remove some of the camera work arounds
Since we have seen a lot of bugfixes in the multimedia library, we can
make this all faster and simpler.
2023-02-08 18:23:18 +01:00
tomFlowee 9b87590bd9 Fixes in currency number construction
Now tested with more currencies.
2023-02-08 18:23:18 +01:00
tomFlowee a2969750c9 Fully switch currency on failure.
Also add some logging and add an emit on the new currency being set
because sometimes the fetch from server takes very long.
2023-02-08 14:29:02 +01:00
tomFlowee a475a99371 Add feature: autoprepare
For the payment object it now is possible to insta-commit to changes and
as such always prepare a transaction ready to be sent with the latest of
the settings.

This is enabled with a boolean property 'autoPrepare' (default off).
2023-02-08 14:14:06 +01:00
tomFlowee 7b1333862c Make the non-detailed payment API use 'max'.
The Payment::paymentAmount() method is for the usecase where the GUI
doesn't care about the input/output details.
Its unused in the desktop GUI.

This method now takes into account the concept of 'max', returning the
full wallet amount if its set.
2023-02-08 10:23:28 +01:00
tomFlowee 6c95cd3c09 Make currency changes persist between restarts. 2023-02-07 17:51:29 +01:00
tomFlowee 00dae95023 Allow changing of the currently used currency.
Provide a QML point where a different locale can be given for a different
currency. This then swaps out the historical file to the new one and
fetches from the online stream in that currency.
2023-02-07 14:38:33 +01:00
tomFlowee 69b82238ec New main year. 2023-02-05 22:42:37 +01:00
tomFlowee 8ae25cbf64 Refactor Fiat and historical.
Move the historical fiat prices to share the API with the current ones
and avoid complicating the code in the GUI layer (one less object).
2023-02-03 19:59:02 +01:00
tomFlowee 0fad45975b Cleanup 2023-02-03 19:57:40 +01:00
tomFlowee 9b1ec8e271 Make coinbase maturation smarter.
Instead of recalculating every single block, we now use the existing
locking of UTXOs feature to lock coinbase outputs to a certain
maturation height.
This is the traditional trade-off where we store some more data to
avoid work in the common codepath.
2023-02-02 12:49:18 +01:00
tomFlowee 8b4e264c1d Make grammar of comment easier to understand. 2023-02-02 12:48:57 +01:00
tomFlowee 28d787b9c1 On app shutdown, unsubscribe listeners. 2023-01-31 20:36:40 +01:00
tomFlowee caa340768f Make 'chainHeight' property on Pay work better
We now show the estimated tip until the headers chain has been synched.

This follows p2pnet listener interfaces changes.
This uses the nicer interfaces setup to make available for FloweePay
the signal that we have reached the tip of the headerChain
2023-01-31 20:36:12 +01:00
tomFlowee 50e2176efd Remove unused property 2023-01-31 16:25:48 +01:00
tomFlowee ca1cd4a998 Avoid possible deadlock. 2023-01-31 14:06:10 +01:00
tomFlowee 7d9be8026b Update 'behind' text to make progress clearer.
We now update per day instead of per week. Nice for old imports.
2023-01-30 19:11:23 +01:00
tomFlowee 8a72fd1e6a Fix first blockheight property value on AccountInfo
Now we correctly have the first blockheight for wallets on creation.
2023-01-30 17:42:27 +01:00
tomFlowee 90cdfd8059 Add some comments on state 2023-01-30 17:12:22 +01:00
tomFlowee f80540b7e9 Another cleanup, like parent commit. 2023-01-30 17:11:35 +01:00
tomFlowee aea1ba28f7 Cleanup
After introduction of pay_mobile, we now have a static lib of all
classes that get linked to the unit tests, as such we can remove
optimizations that tried to keep the set of files to compile in tests
smaller.
2023-01-30 16:47:54 +01:00
tomFlowee 57cae42300 Add freeze of model feature.
This is a bit of a violation of layers, as a result of the ListView not
having any way to do this. Even in a hacky way.

The usecase is that we need to stop the listview scrolling and showing
new items that are being inserted at the top in some cases.
Specifically when the user taps on a single transaction in order to get
more information about it, at that point the popup should be displayed
next to the item we tapped on and that item should not move due to
there being new transactions found.

The freezeModel property accomplishes that by simply not telling the
model new data has been found as long as the property is true.
Afterwards all the updates that have accumulate are flushed.
2023-01-18 19:15:52 +01:00
tomFlowee 15cf4732e3 Fix initial save of private wallet data
This makes sure that after initial setup of the wallet we save the
private data and the wallet that was not owned by the user is stored as
such.

On Android the destructor often is not properly called, which leads to
us not saving this on shutdown and that showed this bug.
2023-01-15 18:31:39 +01:00
tomFlowee 051e21ef60 Fix testnet4 support 2023-01-06 00:47:13 +01:00
tomFlowee f45408163a Avoid iterator on container that is being modified.
Setting the wallet to null calls us again to remove it from our list, as
such it is better to not work on that live list but on a copy.
2023-01-06 00:45:12 +01:00
tomFlowee 0b38d38176 Fix updating price when max is set. 2023-01-05 14:27:24 +01:00
tomFlowee d2213194d4 Add delay on camera init
Move to the next eventloop event the usage of the camera (finding out
resolutions etc) which looks to help stability.

Also remove the init-on-startup again, which had the nasty side-effect of
turning on the camera for a very brief time due to some Qt bug that
ignores the 'active' boolean on the camera object.
2022-12-21 13:46:14 +01:00
tomFlowee 4259eede23 Keep working on Linux
QtMultimedia on Linux has the nasty bug that stopping the camera doens't
allow us to start it afterwards. So for now, while Qt is still buggy, lets
simply not stop it.
Notice that this is Linux only, where I expect this class to have very low
usage.
Android doesn't have this specific issue.
2022-12-21 13:17:34 +01:00
tomFlowee 3112912c57 New version. 2022-12-21 13:15:55 +01:00
tomFlowee 56d3b4fc36 Fill price from historical on startup.
On mobile its more visible that it takes a couple of seconds to fetch
the price from the network. The result is that no prices are visible on
unconfirmed transactions and wallet balances for that time.

This instead uses the last known correct price from the historical
database as the price, so in that couple of seconds we are showing the
mostly correct data instead of no data.
When the price feed comes in, all values on screen get automatically
updated.
2022-12-21 12:58:01 +01:00
tomFlowee e78bfe1c8a Fix lastSyncIndicator when there are unconfirmed TXs 2022-12-21 12:49:51 +01:00