[Qt] don't allow amount changes when AmountSpinBox is read-only #5637

pull Diapolo wants to merge 2 commits into bitcoin:master from Diapolo:amountspinbox changing 1 files +22 −17
  1. Diapolo commented at 2:06 PM on January 10, 2015: none
    • before it was possible to use the steps to change e.g. amouns of authenticated or unauthenticated payment requests (AmountSpinBox is already set to read-only here) - this is now fixed
    • also move the reimplemented stepEnabled() function to the protected section of our class, where it belongs (see Qt doc)
  2. [Qt] don't allow amount changes when AmountSpinBox is read-only
    - before it was possible to use the steps to change e.g. amouns of
      authenticated or unauthenticated payment requests (AmountSpinBox is
      already set to read-only here) - this is now fixed
    - also move the reimplemented stepEnabled() function to the
      protected section of our class, where it belongs (see Qt doc)
    0fd9e2bf43
  3. laanwj added the label GUI on Jan 11, 2015
  4. Diapolo commented at 7:06 PM on January 11, 2015: none

    @jonasschnelli Mind testing this :)?

  5. jonasschnelli commented at 7:14 PM on January 11, 2015: contributor

    @Diapolo Yes. Will test this soon (tomorrow).

  6. jonasschnelli commented at 9:30 AM on January 12, 2015: contributor

    Tested ACK. bildschirmfoto 2015-01-12 um 10 26 08

    The only strange thing is, that StepEnabled stepEnabled() const gets called basically every second in serval app states. But i assume that's Qt internal. Check: http://jonasschnelli.ch/vid_5637.mov

  7. [Qt] group variables below initial if-clauses in AmountSpinBox::stepEnabled 80dd50ccba
  8. in src/qt/bitcoinamountfield.cpp:None in 0fd9e2bf43 outdated
     163 | @@ -179,6 +164,25 @@ class AmountSpinBox: public QAbstractSpinBox
     164 |          return QAbstractSpinBox::event(event);
     165 |      }
     166 |  
     167 | +    StepEnabled stepEnabled() const
     168 | +    {
     169 | +        StepEnabled rv = 0;
     170 | +        if (isReadOnly()) // Disable steps when AmountSpinBox is read-only
     171 | +            return StepNone;
     172 | +        if(text().isEmpty()) // Allow step-up with empty field
    


    jonasschnelli commented at 9:31 AM on January 12, 2015:

    some spaced after if nits but i assume we discussed that... but i was looking forward to once 'nit' you. :)


    Diapolo commented at 9:35 AM on January 12, 2015:

    Haha :), got me. Well the only reason I did not add a space was because the surrounding if clauses also have the wrong style ^^.


    Diapolo commented at 10:54 AM on January 13, 2015:

    @jonasschnelli As I picked up a small suggestion, I also fixed your nit ^^. Can you Re-ACK this now?

  9. jonasschnelli commented at 11:09 AM on January 13, 2015: contributor

    ACK

  10. laanwj merged this on Jan 14, 2015
  11. laanwj closed this on Jan 14, 2015

  12. laanwj referenced this in commit eec81cbb80 on Jan 14, 2015
  13. Diapolo deleted the branch on Jan 15, 2015
  14. laanwj referenced this in commit 6a02ef8bdb on Jan 30, 2015
  15. reddink referenced this in commit a54d5d02bf on May 27, 2020
  16. DrahtBot locked this on Sep 8, 2021
Labels

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:15 UTC

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