Streamline UI ↔ Core interface #1019

pull laanwj wants to merge 10 commits into bitcoin:master from laanwj:2012_03_uirefactor changing 31 files +323 −375
  1. laanwj commented at 2:03 PM on March 31, 2012: member

    This is a grab-bag of commits designed to streamline the UI↔Core interface. It contains various small improvements as well as code cleanups:

    Improvements:

    • Allow other threads to queue shutdown in UI thread (functionality in case of bitcoind is unchanged). RPC stop and encryptwallet will now work with UI, and this also fixes segfault part of #999.
    • update UI only when needed, instead of polling with a timer (core notifies UI using AddressBookRepaint / MainFrameRepaint functions)
      • This fixes the issue with address created using RPC 'getnewaddress' not appearing in UI address book
    • use a messagebox to display the error when -server is provided without providing rpcpassword, this doesn't get lost like a message to the console (functionality in case of bitcoind is unchanged)
    • allow threads to request a modal dialog box for fatal errors, so that they can wait with shutting down until the user clicked OK (disk space error, etc)

    Code cleanups:

    • move QT_PLUGINS stuff to qt main file, where it belongs
    • move dummy translation function _ to qtui.h/noui.h instead of util.h
    • remove dependency for SecureString on serialize.h and util.h (and the rest of the knot of .h files) by moving allocators to new include file allocators.h
    • remove broken and/or unnecessary functions from qtui.h/noui.h, clarify names, and leave only one MessageBox function that can be used both from AppInit2 and other threads

    In principle, these commits are fairly independent and could be separate pull requests if necessary.

  2. sipa commented at 3:06 PM on April 1, 2012: member

    It looks all sane and functional to me.

  3. laanwj commented at 6:47 AM on April 2, 2012: member

    I have to think about point 2 a bit more though: do changes in statistics like the # of connections or the number of blocks trigger a MainFrameRepaint? I don't think so, and doing that could potentially result in a deluge of cross-thread notifications.

    It does make sense to poll those statistics with a timer, just not the well-delineated updates to the transaction list (and balance), address book.

  4. laanwj commented at 5:03 PM on April 2, 2012: member

    To answer my own question: yes, MainFrameRepaint is called when the number of connections changes / number of blocks count. This is safe.

  5. sipa commented at 7:59 PM on April 3, 2012: member

    ACK on the code changes to core, but needs rebasing.

  6. move QT_PLUGINS stuff to qt main file, where it belongs 55f69a4700
  7. Code deduplication: make function in GUIUtil to get connection type to call object slot in GUI thread
    with invokeMethod.
    7e7bcce2d9
  8. laanwj commented at 7:30 AM on April 4, 2012: member

    Ok, this is all rebased and ready now.

  9. Update UI through async calls MainFrameRepaint and AddressBookRepaint instead of a timer.
    - Overall, this is better design
    - This fixes problems with the address book UI not updating when the address book is changed through RPC
    - Move Statusbar change detection responsibility to ClientModel
    98e6175874
  10. remove unused CalledSetStatusBar and UIThreadCall notifications f0b5e9e116
  11. remove dependency on serialize.h and util.h for SecureString 6cb6d62347
  12. move translation function _ to qtui.h/noui.h instead of util.h 5d7cebdadc
  13. support RPC stop and encryptwallet with UI 1a3f0da922
  14. qtui.h/noui.h interface cleanup
    - rename wxMessageBox, remove redundant arguments to noui/qtui calls
    - also, add flag to force blocking, modal dialog box for disk space warning etc
    - clarify function naming
    - no more special MessageBox needed from AppInit2, as window object is created before calling AppInit2
    7cfbe1fee4
  15. Use a messagebox to display the error when -server is provided without providing a rpc password 5a60b66a9d
  16. Diapolo commented at 8:11 AM on April 4, 2012: none

    Small question in qtgui.h and nogui.h I saw "#define wxMessageBox MyMessageBox" , is there some old wx code in, that can be removed, too?

    Edit: Ah you removed that already :), nice and ACK!

  17. laanwj commented at 8:29 AM on April 4, 2012: member

    Yep! the only wx* definitions left are the flags to signal the message kind. They can be renamed, and a lot of can go, too, but I haven't determined yet which ones are useful (also in the future) and what to rename them to. Let's leave that to a later decision.

    Edit: and can also be deduplicated and defined in a common header; there is no need to define them differently in qtui/noui.h. Edit.2: thinking about it, there is no need for separate qtui.h / noui.h headers at all if we don't define implementations in the headers, which would be a sane thing to do anyway. The distinction could be made by linking bitcoind against a different implementation file.

  18. Diapolo commented at 8:37 AM on April 4, 2012: none

    Sounds pretty good.

  19. Move from noui.h / ui.h to one ui_interface.h with dummy implementation for the daemon. 5cccb13dad
  20. laanwj commented at 11:26 AM on April 4, 2012: member

    I've added another code cleanup / deduplication commit: Move from noui.h / qtui.h to one ui_interface.h with dummy implementation for the daemon.

  21. sipa referenced this in commit b0a7e05a45 on Apr 4, 2012
  22. sipa merged this on Apr 4, 2012
  23. sipa closed this on Apr 4, 2012

  24. coblee referenced this in commit b22129d97a on Jul 17, 2012
  25. laanwj deleted the branch on Apr 9, 2014
  26. suprnurd referenced this in commit a3ffedba7c on Dec 5, 2017
  27. ptschip referenced this in commit 35ceb25cef on Apr 8, 2018
  28. Bushstar referenced this in commit c62f258888 on Oct 8, 2019
  29. DrahtBot locked this on Sep 8, 2021
  30. DrahtBot added the label CI failed on Apr 11, 2023
  31. MarcoFalke removed the label CI failed on Apr 11, 2023

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

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