Add UI RPC console / debug window #1075

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2012_04_consoleui changing 10 files +833 −79
  1. laanwj commented at 8:13 PM on April 10, 2012: member

    This pull request adds a debug window to the UI (can be opened through Help → Debug window). This includes:

    • Various information (version, number of blocks, number of connections etc)
    • Console for RPC commands (local, not really RPC, also works when not running with -server)
  2. sipa commented at 8:22 PM on April 10, 2012: member

    Wow, nice!

    Small request: make responses copy-pastable.

  3. laanwj commented at 8:31 PM on April 10, 2012: member

    They are (though not really intuitively), you can click on the table cell and press ctrl-c

  4. Diapolo commented at 8:48 PM on April 10, 2012: none

    I really like the idea, but would place the function under help and add a seperator line. It simply is no setting or option :). Is there a way export to a text file? Would be consistent to offer such a function, as this is possible "all over the GUI".

  5. laanwj commented at 8:59 PM on April 10, 2012: member

    It's not help either, nor file. We really need a "tools" menu like other programs. Maybe the settings menu could be renamed "tools", then it makes more sense.

    Exporting the console contents to a file could be useful. I'll keep that in mind for a future update.

  6. Diapolo commented at 9:04 PM on April 10, 2012: none

    Sign message would be a tool, too then ;). So why not create a new tools point, which holds your console and the sign message dialog?

  7. laanwj commented at 6:17 AM on April 11, 2012: member

    Rebased, added build date to info window

  8. laanwj commented at 5:08 PM on April 11, 2012: member

    New commit moved the option to the "Help" menu (until we have something better) and adds explicit "Copy" context menu to console.

  9. gavinandresen commented at 5:20 PM on April 11, 2012: contributor

    Nifty. Tagged for 0.7.

  10. laanwj commented at 8:58 AM on April 22, 2012: member

    Rebased, I've been able to structure the code better because of the recent RPC refactorings:

    • Added a execute() method to CRPCTable.
    • Factored out function RPCConvertValues() to convert parameter values for RPC call from list of strings to command-specific JSON objects.
    • LocalRPC is completely gone (and with it, most changes to the core), no more code additions to bitcoinrpc.cpp. This is now integrated into the Qt code, making use of CRPCTable::execute.
  11. Add UI RPC console / debug window 460c51fdad
  12. in src/qt/rpcconsole.h:None in 4c5a9b2c43 outdated
      18 | +    ~RPCConsole();
      19 | +
      20 | +    void setClientModel(ClientModel *model);
      21 | +
      22 | +    enum MessageClass {
      23 | +        ERROR,
    


    luke-jr commented at 7:47 PM on May 1, 2012:

    This (and probably the next one) are #defined somewhere on Windows, breaking the build. Perhaps call it MC_ERROR, if there's really a need for 2 different ERROR values (this and CMD_ERROR). eg, a0031e5


    laanwj commented at 6:52 AM on May 2, 2012:

    Right... Is there a list of the namespace-polluting crap macros that windows dumps into programs somewhere?

    And yes, ERROR and REQ_ERROR are different, the first category is meant for general critical errors the other is simply a failed RPC command.

  13. gmaxwell commented at 10:48 PM on May 5, 2012: contributor

    Pretty awesome. Should this go under a tools menu or should it really be burried under help->debug window->console tab?

    Does everyone else really like the nested scrollbars you get? (type help a couple times) I'm concerned that this might confuse users that I'm trying to support "scroll down and you'll see it" "I'm scrolled all the way down!". It's also a bit annoying if you're running a command over and over again to see if something changes to have to scroll internally to the entry to see it. (e.g. run getinfo over and over looking for connections changing)

    Also, the fact that you can't copy large chunks of commands is bad from a support perspective. Its helpful if people can say "I ran all these commands and got all these results".

    Sending the stop RPC makes the UI lockup for a long time (30 seconds?) before eventually shutting down.

    When I first bring up the console focus doesn't move to the text entry box. I have to click it. But it has a blinking cursor even before I do, I think the focus is on the output box.. so it doesn't seem responsive. This only happens the first time after startup. After that it seems to remember.

    The green and grey boxes don't seem all that intuitive to me. I'd personally just put [request] [reply]. But I admit this this is mostly taste and you should probably ignore me.

    Copy works differently in single element responses vs multi-element responses. E.g. type "getblockhash 5" copy the hash, then "getblock [paste]" and copy the first txn hash. If you do something that has the second behavior first you may believe that it's not possible to copy in the first case, because you don't get any incremental selection. I think ideally incremental selection should always work.

  14. laanwj commented at 5:54 AM on May 6, 2012: member
    • Eventually it makes sense to add a tools menu where Sign message and verify message should also go. However, it's hidden in the second tab for a good reason. Users should not stumble too easy on it so it's now a second tab of a dangerous-looking window.
    • I don't like the nested scrollbars either. However, the Qt QTableWidget doesn't like rows that are too tall (they break scrolling, as the y offset can only start at a whole cell). That's why tall cells get them.
    • Selecting and copying multiple cells could be added.
    • Yes it should probably focus the input box when the tab is selected.
    • Typing the "stop" RPC command hangs the UI for as long as it takes to shutdown: seems that the UI is not hidden in this case when it leaves the main loop (could be easily fixed, this problem is not related to the console but happens also when you shut down some other way). (fixed by #1209)
    • The green and grey boxes are categories, they should go together with filtering. I intend to add buttons at the top with the same boxes to hide/show them (I also want to add normal debug/error messages). I'm open to suggestions as to the colors, or even icons (boxes are placeholders), but I don't want to much discussion about this.

    IMO given that there are no critical issues we should merge this as soon as possible. It's better to have something, and it is functionality only a very small part of people will use, so perfecting it is not the foremost priority.

  15. gmaxwell commented at 5:59 AM on May 6, 2012: contributor

    ha. I didn't mean to imply it shouldn't be pulled because of any of that. I just sat down and ran through it and what I wrote is just a braindump what I found. Considering that its a GUI feature, the fact that I actually tried to break it shows how excited I am to get it in. :)

    However, it shouldn't be pulled this second because we may cut a 0.6.2 to take the addrman crash fix.

  16. laanwj commented at 7:44 AM on May 6, 2012: member

    I agree, thanks for testing!

  17. luke-jr commented at 7:10 PM on May 6, 2012: member

    Object::connect: No such signal ClientModel::numBlocksChanged(int) in src/qt/rpcconsole.cpp:161 Object::connect: (receiver name: 'RPCConsole')

    (this is with next-test, so maybe an undetected merge conflict)

  18. laanwj commented at 8:49 PM on May 6, 2012: member

    Yes, that's an undetected merge conflict. numBlocksChanged changed from one to two arguments in #1205.

  19. grue0 commented at 12:19 AM on May 7, 2012: none

    DO WANT!

    On a side note, does it show all debug messages, or just RPC requests?

  20. gmaxwell commented at 1:11 AM on May 7, 2012: contributor

    Oh, gruez has a nice point. This needs a debug log viewer tab too. :) Getting random windows users to find the debug log is an amazing PITA.

  21. Diapolo commented at 4:57 AM on May 7, 2012: none

    Windows users are ticking a little different, don't blame them ^^. But ACK to the debug viewer idea, perhaps in a seperate commit, to not bloat this one?

  22. gmaxwell commented at 5:02 AM on May 7, 2012: contributor

    I don't blame them— I'm very happy they use Bitcoin. But finding files in the file system and viewing them with wordpad isn't something most windows apps ask people to do, so they don't know how to do it. And because I know nothing about windows its very hard for me to talk them through it. A log viewer in bitcoin is something I could bring up locally. :) And sure, if I'm not doing the work I'm in no position to ask about which commits it gets placed in. ;)

  23. laanwj commented at 5:23 AM on May 7, 2012: member

    I'm not going to add a full log viewer. There's zillions of those. That problem has been solved by grumpy system admins way before my time. Better to just implement logging to the OS log, if you want that, so you can use your operating system's log viewer.

    However, it was my intention to show the last N debug and error messages for debugging, eventually (not necessarily in this commit).

  24. laanwj commented at 7:37 AM on May 7, 2012: member

    Maybe we're thinking too difficult: on windows, we could just add a button to the debug window that opens debug.log in a wordpad?

  25. gmaxwell commented at 7:46 AM on May 7, 2012: contributor

    ::facepalm:: "The Russians Used a Pencil"

  26. gmaxwell referenced this in commit fa8cc47c4f on May 8, 2012
  27. gmaxwell merged this on May 8, 2012
  28. gmaxwell closed this on May 8, 2012

  29. coblee referenced this in commit ce83f2448c on Jul 17, 2012
  30. laanwj deleted the branch on Apr 9, 2014
  31. msgilligan referenced this in commit 5aa48eebb9 on Oct 31, 2014
  32. sanch0panza referenced this in commit a96db9580d on May 17, 2018
  33. lateminer referenced this in commit 31e9f0fbde on Dec 25, 2019
  34. 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 15:16 UTC

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