Do not truncate node flag strings in debugwindow peers details tab #6

pull Saibato wants to merge 1 commits into bitcoin-core:master from Saibato:fix-qt-disp-flags changing 1 files +0 −6
  1. Saibato commented at 9:32 am on June 19, 2020: contributor

    Fix: When fiddling around with new node flags other than the usual.

    I saw that not all possible node flag strings i.e. the UNKNOWN[..] where visible in peers details tab. Since v18.2 fixed size was set to 300 and sliding is thereby limited.

    A fix on my old linux cruft and small screen was to set minimumSize width to -1 or 0. Qt will then autosize the slider to the max string length.

    Thereby i had full display of all flags inclusive sliding without to fullscreen the window.

    Not sure if this is even an issue for those who can afford big screens or high res macs? Feedback welcome.

    BTW: nice side effect now again easy to scroll trough long version names of the node. can’t wait to see strings like /Satoshi:0.23.99/NOX2NOX4NOX32 or what ever fits in the version string.

  2. hebasto commented at 9:36 am on June 19, 2020: member
    Welcome @Saibato! Mind attaching some screenshots?
  3. Saibato commented at 10:40 am on June 19, 2020: contributor

    Welcome @Saibato! Mind attaching some screenshots? @hebasto here some screenshots. :+1: hope that new slider visible in maximize and full left shift of details in second picture is visible on github . Pls ping me for more pictures. The string was Services NETWORK & GETUTXO & BLOOM & WITNESS & UNKNOWN[2^6] & UNKNOWN[2^7] & NETWORK_LIMITED Before the change after the & it stopped.

    Before change ( we had no slider on bottom since max 300) impossible to see all strings

    Screenshot from 2020-06-19 09-54-49

    **After change ( we have now 2 sliders on bottom) second for detail You now can slide through the details strings **.

    Screenshot from 2020-06-19 09-57-07

    Now even there in small window, full scroll is possible.

    Here some more pictures with small size window. Now even there full scroll is possible.

    Screenshot from 2020-06-19 09-58-24

    Screenshot from 2020-06-19 09-59-06

    Screenshot from 2020-06-19 09-59-06

  4. hebasto commented at 10:46 am on June 19, 2020: member
    Concept ACK.
  5. hebasto commented at 10:58 am on June 19, 2020: member

    It seems the PR title (and the commit message) is misleading a bit as the horizontal slider is not disabled on master (dbd7a91fdf3ff801fe5e4107e8346d0d6d11a899):

    DeepinScreenshot_bitcoin-qt_20200619135707

  6. Saibato commented at 11:21 am on June 19, 2020: contributor

    It seems the PR title (and the commit message) is misleading a bit as the horizontal slider is not disabled on master

    … when set fixed sliding is thereby limited. In small windows the string is truncated at some point and no further sliding is possible. And in full size window, the slider vanish and the rest of the string is truncated.

    The topic i saw was discussed in https://github.com/bitcoin/bitcoin/pull/15136

    … you can adjust a view by moving QSplitter bar (marked by a dot on your screenshot) and window borders:

    But that fall short with long strings.

    The tile .. autosize display .. I used to reflect the fact that with this change the size is adapted to the string and not fixed to a maximum depending on the whole window size-400 AFAICT

    How about “qt;Adapt debugwindow peers details slider view to the peers actual used flags list string size” ?

    Please hint to me alternative wording, to reflect the full impact of this one-liner

    missing s

  7. Saibato renamed this:
    qt: Allow horizontal slider in debugwindow peers tab to autosize display
    qt: Do not truncate node flag strings in debugwindow peers details tab.
    on Jun 19, 2020
  8. Saibato force-pushed on Jun 19, 2020
  9. MarcoFalke renamed this:
    qt: Do not truncate node flag strings in debugwindow peers details tab.
    Do not truncate node flag strings in debugwindow peers details tab
    on Jun 19, 2020
  10. in src/qt/forms/debugwindow.ui:1083 in 099defc589 outdated
    1079@@ -1080,7 +1080,7 @@
    1080               </property>
    1081               <property name="minimumSize">
    1082                <size>
    1083-                <width>300</width>
    1084+                <width>0</width>
    


    hebasto commented at 5:24 pm on June 21, 2020:

    Moreover, for the detailWidget the default values of properties geometry and minimumSize are ok, i.e., a bunch of lines could be just removed:

     0--- a/src/qt/forms/debugwindow.ui
     1+++ b/src/qt/forms/debugwindow.ui
     2@@ -1070,20 +1070,6 @@
     3               <bool>true</bool>
     4              </property>
     5              <widget class="QWidget" name="detailWidget">
     6-              <property name="geometry">
     7-               <rect>
     8-                <x>0</x>
     9-                <y>0</y>
    10-                <width>300</width>
    11-                <height>426</height>
    12-               </rect>
    13-              </property>
    14-              <property name="minimumSize">
    15-               <size>
    16-                <width>300</width>
    17-                <height>0</height>
    18-               </size>
    19-              </property>
    20               <layout class="QGridLayout" name="gridLayout_2" columnstretch="0,1">
    21                <item row="0" column="0">
    22                 <widget class="QLabel" name="label_30">
    

    Saibato commented at 8:16 pm on June 21, 2020:

    Hmm works too ,,, but a i kinda like short changes. and b when edit with Qt designer the ui file, the default is to have at least a <property name="geometry"> So for now i like to stay a bit conservative, since i can not test easy outside my cruft. so how about this?

     0diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui
     1index 8b7080083..1217ca3e2 100644
     2--- a/src/qt/forms/debugwindow.ui
     3+++ b/src/qt/forms/debugwindow.ui
     4@@ -1078,12 +1078,6 @@
     5                 <height>426</height>
     6                </rect>
     7               </property>
     8-              <property name="minimumSize">
     9-               <size>
    10-                <width>300</width>
    11-                <height>0</height>
    12-               </size>
    13-              </property>
    14               <layout class="QGridLayout" name="gridLayout_2" columnstretch="0,1">
    15                <item row="0" column="0">
    16                 <widget class="QLabel" name="label_30">
    17
    18
    19I have written a shorty test script to test long flag lists, by spawn up 2 connected
    20 regtest nodes. 
    21
    22``` bash
    23#!/bin/bash
    24params="-regtest -debug=1"
    25makeflags=-j4 
    26dir=/tmp/bitcoin-test
    27baseport=1234
    28testfix=0 #if 1 auto git pull the gui fix from Saibato PR [#6](/bitcoin-core-gui/6/) https://github.com/bitcoin-core/gui/commit/099defc58975e2ec0e8069b84cf852f7673122dd
    29
    30if [ $testfix = 1 ]; then git pull --no-edit https://github.com/Saibato/gui fix-qt-disp-flags ;fi
    31
    32t=$(echo "")
    33for i in {1..8} # number of flags to set active ( max 64 )
    34 do t+=$(echo "|(1<<$i)")
    35done
    36
    37#Next change init.cpp to set many flags 
    38 
    39sed -i "s/ServiceFlags(NODE_NETWORK | NODE_NETWORK_LIMITED);/ServiceFlags(NODE_NETWORK | NODE_NETWORK_LIMITED $t);/g" ./src/init.cpp
    40#Now recompile the the code
    41make $makeflags
    42
    43printf "######\n\n now wait for-torcontrol=127.0.0.1:9151 the nodes to spun up ...\ntest with window>Network Traffic>Peers\n######"
    44
    45# now revert the set many node flags in init.cpp 
    46sed -i "s/ServiceFlags(NODE_NETWORK | NODE_NETWORK_LIMITED $t)/ServiceFlags(NODE_NETWORK | NODE_NETWORK_LIMITED)/g" ./src/init.cpp
    47if [ $testfix = 1 ]; then git reset --hard HEAD~1 ;fi
    48
    49for i in 1 2
    50do port2=$((3-$i))
    51 rm -rf $dir$i && mkdir $dir$i
    52 ./src/qt/bitcoin-qt $params  -bind=127.0.0.1 $(if [ $i = 1 ]; then echo -server;fi) -wallet=test -listen -port=$(echo $baseport$i) -datadir=$dir$i -connect=127.0.0.1:$(echo $baseport$port2) &
    53done
    
  11. Saibato force-pushed on Jun 21, 2020
  12. hebasto commented at 7:58 am on June 22, 2020: member

    1ed063c56a6f7f85f0c249bc89953456a2cf8ad9 LGTM

    Mind squashing commits before the final review?

  13. qt: Do not truncate node flag strings in debugwindow.ui peers details tab.
    Not all possible node flags are visible in details of peers tab since v18.2.
    qt will now autoadapt the slider to the full string size.
    
    Signed-off-by: saibato <saibato.naga@pm.me>
    0ac09c9793
  14. Saibato force-pushed on Jun 22, 2020
  15. hebasto approved
  16. hebasto commented at 5:15 am on June 23, 2020: member
    ACK 0ac09c9793cd6d25ef6df14d74fb960529e1b4e3, tested on Linux Mint 20 (x86_64, Qt 5.12.8).
  17. hebasto commented at 3:54 pm on June 25, 2020: member
    @promag @fanquake Mind reviewing this PR?
  18. flack commented at 7:37 pm on June 26, 2020: contributor

    Another idea might be to split the node flags into multiple lines, i.e.

    0NETWORK &
    1GETUTXO &
    2BLOOM &
    3...etc..
    

    Then you could make the whole right panel smaller and have more space for the table

  19. hebasto commented at 8:26 pm on June 26, 2020: member

    @flack

    Another idea might be to split the node flags into multiple lines, i.e.

    0NETWORK &
    1GETUTXO &
    2BLOOM &
    3...etc..
    

    Then you could make the whole right panel smaller and have more space for the table

    Your idea looks good, and I will happy to review the relevant PR.

    This PR fixes widget layout and is an improvement.

  20. promag commented at 10:03 am on June 27, 2020: contributor
    Tested ACK 0ac09c9793cd6d25ef6df14d74fb960529e1b4e3 on macos.
  21. MarcoFalke merged this on Jun 27, 2020
  22. MarcoFalke closed this on Jun 27, 2020

  23. sidhujag referenced this in commit 10ecde243d on Jul 8, 2020
  24. laanwj referenced this in commit 31bdd86631 on Jul 15, 2020
  25. laanwj referenced this in commit 924a4ff7eb on Oct 29, 2020
  26. jonasschnelli referenced this in commit c33662a0ea on Dec 2, 2020
  27. apoelstra referenced this in commit e741801790 on Dec 3, 2020
  28. laanwj referenced this in commit e520e091db on Jan 6, 2021
  29. gwillen referenced this in commit 1d8262b7e5 on Mar 19, 2021
  30. MarcoFalke referenced this in commit 590e49ccf2 on Apr 4, 2021
  31. MarcoFalke referenced this in commit bce09da122 on Apr 28, 2021
  32. fanquake referenced this in commit fa00bb2c5c on Apr 29, 2021
  33. MarcoFalke referenced this in commit eb9a1fe037 on May 7, 2021
  34. laanwj referenced this in commit ee9befe8b4 on May 12, 2021
  35. MarcoFalke referenced this in commit c857148636 on May 15, 2021
  36. MarcoFalke referenced this in commit 444b6b342d on Feb 15, 2022
  37. bitcoin-core locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-23 04:20 UTC

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