Update bitcoingui.cpp #3811

pull thegreatnegel wants to merge 5 commits into bitcoin:master from thegreatnegel:patch-1 changing 1 files +12 −2
  1. thegreatnegel commented at 2:06 AM on March 7, 2014: none

    Just a simple nicety in the first blockchain download dialog that abbreviates weeks into months, and months into years. It's not perfect, but it is slightly cleaner.

  2. Update bitcoingui.cpp
    Just a simple nicety in the first blockchain download dialog that abbreviates weeks into months, and months into years, taking into account the 28 days in February and the extra day from Leap Years. It's not perfect, but it is slightly cleaner.
    1b9f854696
  3. Update bitcoingui.cpp
    Fixed the missing digits, my bad.
    70271a4b39
  4. Update bitcoingui.cpp
    Fixed the decimal to be a simple int.
    fe1009b19b
  5. Update bitcoingui.cpp 8c2c709fc9
  6. in src/qt/bitcoingui.cpp:None in 8c2c709fc9 outdated
     688 |          }
     689 | -
     690 | +        //Set Months in Human Readables
     691 | +        else if(secs < 52*7*24*60*60)
     692 | +        {
     693 | +            timeBehindTxt = tr("%n month(s)","",secs/(30*24*60*60));
    


    laanwj commented at 7:11 AM on March 7, 2014:

    The average number of seconds in a month, taking into account leap years, is 2629800 (=(365+365+365+366) * 24 * 60 * 60 / 4 / 12)

  7. laanwj commented at 7:15 AM on March 7, 2014: member

    The drawback is that years/months have very large granularity, ie you cannot see progress in the beginning. Months also don't seem to be a good measure of time to me as they vary wildly in length.

    What about:

    • "%n week(s)" if <=1 year
    • "%n year(s) and %n week(s)" if >1year
  8. in src/qt/bitcoingui.cpp:None in 8c2c709fc9 outdated
     693 | +            timeBehindTxt = tr("%n month(s)","",secs/(30*24*60*60));
     694 | +        }
     695 | +        //Set Years in Human Readables
     696 | +        else
     697 | +        {   
     698 | +            timeBehindTxt = tr("%n year(s)","",secs/(52*7*24*60*60));
    


    laanwj commented at 7:19 AM on March 7, 2014:

    The average number of seconds in a year is closer to (365+365+365+366) * 24 * 60 * 60 / 4 = 31557600 (which is still not entirely precise due to handling of leap years around the centuries, but it's better than just '52 weeks')

  9. thegreatnegel commented at 7:35 AM on March 7, 2014: none

    That's fair, I'll add a more sentient line of code tomorrow to take into account the granularity of months and years (i.e %years == months + years)

  10. Update bitcoingui.cpp
    Appended the Years ++ Months code. Cheers!
    c1b9b41422
  11. BitcoinPullTester commented at 8:09 AM on March 7, 2014: none

    Automatic sanity-testing: FAILED BUILD/TEST, see http://jenkins.bluematt.me/pull-tester/c1b9b414228c2d78ee109cdd0d92f4c4a1e8cc37 for binaries and test log.

    This could happen for one of several reasons:

    1. It chanages paths in makefile.linux-mingw or otherwise changes build scripts in a way that made them incompatible with the automated testing scripts (please tweak those patches in qa/pull-tester)
    2. It adds/modifies tests which test network rules (thanks for doing that), which conflicts with a patch applied at test time
    3. It does not build on either Linux i386 or Win32 (via MinGW cross compile)
    4. The test suite fails on either Linux i386 or Win32
    5. The block test-cases failed (lookup the first bNN identifier which failed in https://github.com/TheBlueMatt/test-scripts/blob/master/FullBlockTestGenerator.java)

    If you believe this to be in error, please ping BlueMatt on freenode or TheBlueMatt here.

    This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  12. laanwj commented at 9:05 AM on March 7, 2014: member

    I'd still prefer weeks and years, and leaving out the months.

  13. laanwj referenced this in commit a1465ac8e6 on Mar 15, 2014
  14. laanwj commented at 9:18 AM on March 15, 2014: member

    See #3876

  15. laanwj closed this on Mar 15, 2014

  16. thegreatnegel commented at 7:32 AM on March 17, 2014: none

    Thanks for the update! I was wondering why mine failed the sanity test, I missed updating the qt locales file. Muchos gracias!

    On Sat, Mar 15, 2014 at 2:18 AM, Wladimir J. van der Laan < notifications@github.com> wrote:

    See #3876 #3876

    Reply to this email directly or view it on GitHubhttps://github.com/bitcoin/bitcoin/pull/3811#issuecomment-37721309 .

  17. MathyV referenced this in commit 65894924de on Oct 27, 2014
  18. 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-13 18:16 UTC

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