QRCodeDialog::getURI formatting of btc #1506

issue xanatos opened this issue on June 23, 2012
  1. xanatos commented at 6:12 AM on June 23, 2012: none

    I think the lnReqAmount should be formatted as the the other fields that accept bitcoin amounts, so with an up-and-down field that autocorrects "." and "," (or even better with a BitcoinAmountField so that you can choose the unit). As is you can insert spaces in the lnReqAmount and the spaces will be used to calc the QR Code (because the lnReqAmount.text() is used directly)

  2. Diapolo commented at 10:11 AM on June 23, 2012: none

    Seems like a pretty good idea, will look into this :).

  3. Diapolo commented at 4:29 PM on June 23, 2012: none

    Working on this, I currently only have a small problem with updating the unit, as we don't have WalletModell or OptionsModell available in the qrcodedialog code.

  4. Diapolo commented at 4:35 PM on June 24, 2012: none

    @xanatos Can you try our my patch #1518 and give some feedback.

  5. xanatos commented at 4:38 PM on June 24, 2012: none

    @Diapolo I don't have a C++ environment :-) In the last 5 years I have programmed only C#. And even when I was a C++ programmer, I was a Visual C++ programmer, not a QT/gcc/g++ programmer.

  6. Diapolo commented at 4:39 PM on June 24, 2012: none

    @xanatos Too bad :). But I guess at least you could take a quick look at the code.

  7. xanatos commented at 5:12 PM on June 24, 2012: none

    @Diapolo My only problem is with the BitcoinAmount::validate()... It does two different things... It checks for non-zero value and checks for "textual" correctness and number-of-digits validation (the last two checks in the parse() call). I do think the non-zero value test isn't correct to be put there (and, for example, the MainOptionsPage doesn't use the validate() method probably for this reason, because 0.00 commissions are ok). Considering the BitcoinAmount::validate() does a "textual" validation and a number-of-digits validation, I would stop the QR code from being generated if it isn't valid.

    I'll note that there is even a minor bug in the save-as button. If you put too many letters in a field the QR code on the screen will disappear, but the save button will save the last correctly generated QR code.

  8. Diapolo commented at 9:40 PM on June 24, 2012: none

    @xanatos Thanks for your feedback, I updated my patch to reflect your suggestions. The save button is now only enabled, when the QR Code was successfully generated. Perhaps you can take another look.

  9. Diapolo commented at 1:51 PM on July 12, 2012: none

    @xanatos As #1518 got merged, you can close this now. That's the new look of the QR Code dialog:

    updated QRCodeDialog

  10. xanatos closed this on Jul 13, 2012

  11. suprnurd referenced this in commit d787fe4ab6 on Dec 5, 2017
  12. lateminer referenced this in commit 8dd66ed4d8 on Jan 22, 2019
  13. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me