update QRCodeDialog #1518

pull Diapolo wants to merge 1 commits into bitcoin:master from Diapolo:qrcodedialog changing 7 files +215 −152
  1. Diapolo commented at 4:34 PM on June 24, 2012: none

    updated QRCodeDialog

    • remove unused #include <QDebug> and lblBTC label
    • update Bitcoin input field to a BitcoinAmountField to allow Bitcoin unit selection
    • use BitcoinUnits::format for the resulting amount parameter in the generated URI (always use BTC as per BIP21)
    • move MAX_URI_LENGTH and EXPORT_IMAGE_SIZE to guiconstants.h
    • add OptionsModel in AddressBookPage and use it in on_showQRCode_clicked() to pass it to QRCodeDialog
    • add OptionsModel in QRCodeDialog to enable display unit updates
    • add updateDisplayUnit() slot to be able to imediately update currently set bitcoin unit
    • make all labels in the UI-file plain text
    • resize dialog to match for an updated layout (fields are now stacked and new field)
    • remove unused parameters from private slots
    • only enable save button, when QR Code was generated
    • show message when entered amound is invalid
    • add read-only QPlainTextEdit field to output generated URI

    Fixes: #1506

  2. laanwj commented at 9:34 AM on June 30, 2012: member

    There's another thing that might eventually be useful in the QR code dialog: showing the constructed bitcoin: URL (above the image?), so it can be copy/pasted into mails and such.

  3. Diapolo commented at 10:33 AM on June 30, 2012: none

    That is rather easy to achieve, are you ok with the code and changes thus far? I can integrate your suggestion here or create another pull on top ... just as you like.

  4. laanwj commented at 11:11 AM on June 30, 2012: member

    It was just a random idea, doesn't have to be in this pull.

    Am I right that QRCodeDialog::setModel is never called? Did you test it? Looks like addressBookPage needs a setOptionsModel to pass on to QRCodeDialog.

  5. Diapolo commented at 11:31 AM on June 30, 2012: none

    I'm working on your idea right now :). setModel() is unused, because I didn't know, how to get easy access to the options model :-/. Any hint / idea?

  6. Diapolo commented at 1:29 PM on June 30, 2012: none

    Updated:

    • add read-only QPlainTextEdit field to output generated URI

    I chose an TextEdit to be able to use word-wrap and see the whole URI, drawback is, that I was unable to implement a working EventFilter to select all text without messing up other behaviour of the TextEdit field. A copy URI button could be added before the "Save As..." one though.

  7. laanwj commented at 2:22 PM on July 1, 2012: member

    Nice!

    I'd add a setOptionsModel method (called from BitcoinGUI::setClientModel) to AddressBookPage, which stores the options model. Then when creating the QRCodeDialog you can pass it.

  8. Diapolo commented at 3:14 PM on July 1, 2012: none

    @laanwj Thanks mate :). I'll update to integrate your suggestion and do this as seperate commit, so you can see easily what was changed. After your final ACK I can merge that commit, so we only have one if you want.

  9. Diapolo commented at 4:34 PM on July 1, 2012: none

    Updated:

    • add OptionsModel in AddressBookPage and use it in on_showQRCode_clicked() to pass it to QRCodeDialog

    I verified this to work.

  10. Diapolo commented at 8:13 AM on July 6, 2012: none

    @laanwj Same here, is it possible to get this into 0.7, before the RC phase? Any further things I need to fix, suggestions or such stuff?

  11. laanwj commented at 9:00 AM on July 6, 2012: member

    ACK

  12. update QRCodeDialog
    - remove unused #include <QDebug> and lblBTC label
    - update Bitcoin input field to a BitcoinAmountField to allow Bitcoin unit selection
    - use BitcoinUnits::format for the resulting amount parameter in the generated URI (always use BTC as per BIP21)
    - move MAX_URI_LENGTH and EXPORT_IMAGE_SIZE to guiconstants.h
    - add OptionsModel in AddressBookPage and use it in on_showQRCode_clicked() to pass it to QRCodeDialog
    - add OptionsModel in QRCodeDialog to enable display unit updates
    - add updateDisplayUnit() slot to be able to imediately update currently set bitcoin unit
    - make all labels in the UI-file plain text
    - resize dialog to match for an updated layout (fields are now stacked and new field)
    - remove unused parameters from private slots
    - only enable save button, when QR Code was generated
    - show message when entered amound is invalid
    - add read-only QPlainTextEdit field to output generated URI
    5c83f797c5
  13. Diapolo commented at 4:53 PM on July 6, 2012: none

    Rebased and merged both commits into one, no code changes.

  14. laanwj referenced this in commit 520198138a on Jul 7, 2012
  15. laanwj merged this on Jul 7, 2012
  16. laanwj closed this on Jul 7, 2012

  17. nifgraup referenced this in commit 06050df256 on Mar 30, 2014
  18. suprnurd referenced this in commit 9a8a290b87 on Dec 5, 2017
  19. lateminer referenced this in commit 0684673773 on Jan 22, 2019
  20. DrahtBot 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