After starting to use Qt6.10 the following (trivial) steps caused
the application to crash with a backtrace 100% inside of Qt.
a. scroll the list of transactions down a bit.
b. select a different wallet.
c. boom
The bug seems to be that changing the model of a Listview crashes
if the view is not positioned at the top.
This new code positions the view at the top prior to changing the model.
This fixes the weird dialog not getting a press but just closing problem
which seems to stem from the horizontal listview getting its current
index set. So we just avoid doing that.
This fixes the bug in the last release where not having the payments tab
visible meant we didn't see the tabbar at all. The logic is now fixed to
include the fact that we can have a tokens tab too.
This makes the spacing between them equal, making the checkbox take more
space (making fat fingered people happier) and the radio button takes
half the space because frankly it was ugly empty.
This adds a lot of plumbing in the TokensManager and MetadataRepository
to parse the data we have and extract what we need.
The actual visual display is rather simple, this is expected to evolve
as this becomes more nature. For now this works and that is the
important part.
We take into account the server thinking this is a scam token and avoid
downloads based on that.
The image and bcmrs are downloaded from the caching server, based on the
information from the main (info) json.
The idea of sending a transaction as a background process is a bit risky
when the OS can decide at any moment to kill the process. Following
yesterdays code this adds to the security where we make sure we store
the new transaction on disk before we (async) broadcast it to the world.
Making a restart later have the right information to continue without
problems.
This makes the process a bit more mature where we now take
care to only start the repeat payment sending when a wallet
has reached the chain-tip.
We also double check that the payment hasn't already been sent
in order to make extra sure we don't create duplicates (don't trust
that the OS won't kill us at an inconvenient time).
And last we patiently wait for the subsystem that monitors the
transaction broadcast status to give the all clear before shutting
down the application.
This avoids problems with needing to tap it twice to show and allows for
better reuse of our own components and makes sizing and positioning not
black magic.
When a repeat payment is detected to soon be eligable for sending, but
the user has not approve it yet, we show a notification from the
background process to entice the users to go and approve it.
This popup now also carries a 'disable' text which disables the repeat
payment, effectively shutting up this and further notifications.
The tricky part to make this work is that the notification is showing
while the application is (likely) not actually active.
This takes the strategy that the notification carries some extra
details. Among others a newly introduced unique id for a notification
itself, and also some text to show on actually processing the disable
action.
The processing just writes a file, to avoid complexity and side-effects.
The file will then be read on start up (either foreground of background)
to action on the lines in there. So the item will be disabled on first
load.