11 Commits

Author SHA1 Message Date
tomFlowee 0bb6bb0bf5 Fix includes
Avoid the includes of whole modules, which is expensive and
unpredictable.
2025-03-07 23:27:08 +01:00
tomFlowee 1deccd9226 Make fiat mode an actual bool on BitcoinValue
The CPP now does more of the (heavy) lifting and the UI layer can
ignore
most of the details with regards to there being digits behind the
separator for fiat at all.

The internal change is that the fiat based values are always processed
in cents, even if the cents are not displayed. This solves incorrect
display and generally removes special cases.
2023-10-18 11:43:23 +02:00
tomFlowee 7e375f50b5 Bugfix how we handle numbers from user input
This is a long overdue cleanup around the ideas of entering
numbers in Flowee Pay.

The core dataclass BitcoinValue now keeps track where the number
came from, either user input or some calculation. This allows
us to have the Fiat and the Coin price stay in sync without weird
problems.
The one we type uses a string, the price field that we are not typing in
is then a slave and we follow the auto-generated number as the
source.

This solves a host of known issues:

* Editing of value objects is much more consistnnt and predictable now.
* Switching to a different fiat type now properly re-calculates the
  values that are slaved. So if the primary is a BCH value then the fiat
  value gets the new exhange rate instantly applied.
* Switching to a different fiat type properly applies having a separator
  So if you go from euro to Japanese yen, we now remove the separator
  and the numbers behind it.
* Changing the app setting from BCH to mBCH now properly updates all
  amounts. Notice that the user-typed string wins, if you typed 2 and
  then change to mBCH we assume you wanted 2, not 2000.
* Paste now works more logcally.
* Cursor is no longer sometimes invisible, requiring backspace to make
  it show up.

And last we now protect against too large numbers. It is seen as an
error to type a number above 21 million BCH.

Fixes #19
2023-06-23 10:35:35 +02:00
tomFlowee 1220a3839c Start a setup for modules.
This sets up a basic system for creating modules on top of the flowee
pay static lib in a way that is ensured to be isolated (modules can't
accidentally use each other's classes)

The setup is made such that the buildsystem does the hard work on
plugging in a new module, making it so that all you need to do is create
a new dir and a "{something}ModuleInfo.h" file and it will get compiled
in.
The point there is to make it not have any merge conflicts and just make
it dead easy to get started.
2023-06-13 15:59:37 +02:00
tomFlowee 163e615613 Move sources into the src subdir
Slowly the amount of cpp sources has been growing to the point
where its just too much to store in the root of the project.
I think they are more happy in a subdir as well, getting an elevated
position for themselves.
2022-12-13 11:54:03 +01:00
tomFlowee f25b4a716c Allow the 'BitcoinValue' to easier editable
This new allows a value to be set as a number, for instance from the
user reading a QR code, and the "typed-value" is created from this
in order to allow the user to edit it instead of overwrite it.
2022-12-06 22:09:28 +01:00
tomFlowee e643a7749b Port to Qt6 2022-08-20 18:23:51 +02:00
tomFlowee 4a184fc5c2 Make a static lib pay_lib
To avoid recompiles and such generally to simplify stuff, this
moves all the code into a static lib that is then linked with
by the various apps (including tests).
2021-11-20 22:20:08 +01:00
tomFlowee 61eb8ef1ec Fix one more usecase. 2021-11-03 22:00:58 +01:00
tomFlowee 941757f6cb Make entering Bitcoin Values much more native.
This also starts a FiatValueField widget and related logic in the send
screen, but this is still unfinished.
2021-11-03 19:26:50 +01:00
tomFlowee 6a708726a1 Rework BitcoinValue class
We now have a unit test and it supports cursor position for a much more
intuitive editing experience.
2021-11-03 18:29:31 +01:00