This takes the camera feed and pipes it through the ZXing (pronounced
zebra-crossing) library which detects the barcodes in the image.
When we find it, we pluck out the text.
This makes it possible for the mobile app on Android to use the camera.
We only ask for permission when the user actively goes to the 'QR-Scan'
tab, and we show a simple preview of the camera feed.
Notice that the permissions stuff is quite ugly right now due to Qt
having that module in development and the public APIs are simply not
available yet. But at least it works, which is all that matters.
When the next minor Qt release comes out we can hopefully clean this
up and use a version that needs no ifdefs.
We moved the initial-sync-height from the view to the model, which gives
a more logical progress update when switching between accounts.
Also added a button on the listview to instantly jump to the top of the
list.
Instead of storing the internet data in reverse, we now simply take the
view-requests and revert those.
This makes the amount of places where we have to account for the
reversal much less (now just one) which helps maintainability.
Additionally, bring back the section-is-an-enum idea to avoid a
string-malloc for each row when one per section is enough.
This improves the TextButton to be more re-usable and have an arrow to
make it clear it actually is a button.
Added a sub-text as well.
This made it really easy to make an About page with some subpages or
external links.
Also increased the top-header from 40 to 50 'pixels'.
Importing a key as private as possible means we don't check some central
indexing server for the first time an imported key or seed is used.
But, to avoid scanning the entire blockchain, we go back only as far
as the first usage that the user remembers.
Now, instead of asking a blockheight (which most users have no clue
about) we now ask for a year / month combo and start scanning from
the block at the beginning of that timespan.
As most of our app will be based on Pages pushed to the stack,
a simple structure to move focus forcefully to the new child
has been added.
Children would basically only need to mark the first item as
taking focus.
This approach works great for touch events, not so wonderful for mouse
events as it stops me being able to swipe on lists with the mouse.
So disable this on platforms that don't use touch primarily.
The usage of the big application singleton for enums is not the best for
linkage.
See, in QML you like to use enums, but you need to register the object
it is defined on with QML. So, you ideally have one object with loads of
enums. Easy to maintain, less to learn for the QML author.
Using the application-wide singleton made kind of sense, but this
creates a dependency requirement for all users of these enums that
doesn't jibe well with maintainable code.
So, introduce a simple enums-only class that can be used from QML and is
cheap to include from any using classes.
We now hardcode the style and I needed to override the Label
in order to explicitly use the palette from the mainWindow. Not
sure why the one on Android behaved different than on Linux.
On the mainscreen have some big tab-buttons for the main features
then we have a menu overlay which can hold various other screens
and features. Those screens will be placed on top of the main
tabbed screen using a stack-view which is common on touch-interfaces.
This works around an inconsistency in the QML language.
Inside a file variables are preferred local, hiding the global
ones that may have the same name.
The same is not true for named QML files (classes). An imported
is used before one of the same name in the same directory.
To avoid future additions to Qt Controls breaking our code, and
to generally avoid surprises with common names, lets standardize
using namespacing for Qt-Quick-Controls classes.