From 4b9f3492b06c83bb982495db714a6768f6dedb55 Mon Sep 17 00:00:00 2001 From: shaavan Date: Sat, 2 Jul 2022 18:07:47 +0530 Subject: [PATCH 1/2] qt, refactor: Group banHeading and banlistWidget in debugwindow.ui - This is a pure refactoring change and is done so that the table splitter can be added between peerTable and banTable in the following commit. --- src/qt/forms/debugwindow.ui | 128 ++++++++++++++++++++---------------- src/qt/rpcconsole.cpp | 3 +- 2 files changed, 74 insertions(+), 57 deletions(-) diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index ead977296a2..efc1f2729d4 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -6,8 +6,8 @@ 0 0 - 740 - 430 + 744 + 531 @@ -36,7 +36,7 @@ - 0 + 3 @@ -887,9 +887,15 @@ 0 - + + + + 0 + 1 + + false @@ -911,61 +917,73 @@ - + 0 0 - - - 0 - 32 - - - - - 16777215 - 32 - - - - - 12 - - - - IBeamCursor - - - Banned peers - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - true - - - Qt::NoTextInteraction - - - - - - - false - - - true - - - true - - - false - + + + + + + 0 + 0 + + + + + 0 + 32 + + + + + 16777215 + 32 + + + + + 12 + + + + IBeamCursor + + + Banned peers + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + true + + + Qt::NoTextInteraction + + + + + + + false + + + true + + + true + + + false + + + + @@ -1030,8 +1048,8 @@ 0 0 - 300 - 426 + 266 + 656 diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index b791fd30c4e..237746b98bd 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -1331,8 +1331,7 @@ void RPCConsole::showOrHideBanTableIfRequired() return; bool visible = clientModel->getBanTableModel()->shouldShow(); - ui->banlistWidget->setVisible(visible); - ui->banHeading->setVisible(visible); + ui->banTable->setVisible(visible); } void RPCConsole::setTabFocus(enum TabTypes tabType) From 5a9bdce0ad753919522b8bc627c1c12d92d7cae8 Mon Sep 17 00:00:00 2001 From: shaavan Date: Sat, 2 Jul 2022 18:49:36 +0530 Subject: [PATCH 2/2] qt: Add ability to resize Peer and Ban table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds a splitter between the peerWidget and the banTable widget. This adds the ability to resize these windows to the user’s needs. --- src/qt/forms/debugwindow.ui | 191 +++++++++++++++++++----------------- src/qt/rpcconsole.cpp | 4 + 2 files changed, 104 insertions(+), 91 deletions(-) diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index efc1f2729d4..c16ceb5e6da 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -889,101 +889,110 @@ - - - - 0 - 1 - - - - false - - - true - - - Qt::ElideMiddle - - - true + + + Qt::Vertical - - false + + 4 - + false - - - - - - - - 0 - 0 - - - - - - - 0 - 0 - - - - - 0 - 32 - - - - - 16777215 - 32 - - - - - 12 - - - - IBeamCursor - - - Banned peers - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - true - - - Qt::NoTextInteraction - - - - - - - false - - - true - - - true - - - false - - - - + + + + 0 + 1 + + + + false + + + true + + + Qt::ElideMiddle + + + true + + + false + + + false + + + + + + 0 + 0 + + + + + + + + 0 + 0 + + + + + 0 + 32 + + + + + 16777215 + 32 + + + + + 12 + + + + IBeamCursor + + + Banned peers + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + true + + + Qt::NoTextInteraction + + + + + + + false + + + true + + + true + + + false + + + + + diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 237746b98bd..6e9729ac7f1 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -480,11 +480,13 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center()); } ui->splitter->restoreState(settings.value("RPCConsoleWindowPeersTabSplitterSizes").toByteArray()); + ui->tableSplitter->restoreState(settings.value("RPCConsoleWindowPeersBanTableSplitterSizes").toByteArray()); } else #endif // ENABLE_WALLET { // RPCConsole is a child widget. ui->splitter->restoreState(settings.value("RPCConsoleWidgetPeersTabSplitterSizes").toByteArray()); + ui->tableSplitter->restoreState(settings.value("RPCConsoleWindowPeersBanTableSplitterSizes").toByteArray()); } m_peer_widget_header_state = settings.value("PeersTabPeerHeaderState").toByteArray(); @@ -582,11 +584,13 @@ RPCConsole::~RPCConsole() // RPCConsole widget is a window. settings.setValue("RPCConsoleWindowGeometry", saveGeometry()); settings.setValue("RPCConsoleWindowPeersTabSplitterSizes", ui->splitter->saveState()); + settings.setValue("RPCConsoleWindowPeersBanTableSplitterSizes", ui->tableSplitter->saveState()); } else #endif // ENABLE_WALLET { // RPCConsole is a child widget. settings.setValue("RPCConsoleWidgetPeersTabSplitterSizes", ui->splitter->saveState()); + settings.setValue("RPCConsoleWindowPeersBanTableSplitterSizes", ui->tableSplitter->saveState()); } settings.setValue("PeersTabPeerHeaderState", m_peer_widget_header_state);