From 50f090884ccd29e439720aeb83fcd293fae34921 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Fri, 19 Jun 2015 13:24:34 +0200 Subject: [Qt] add ban functions to peers window add ban option for peer context menu (1h, 24h, 7d, 1y). --- src/qt/rpcconsole.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/qt/rpcconsole.h') diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 1409fca525..3218a635d7 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -80,6 +80,8 @@ public Q_SLOTS: void peerLayoutChanged(); /** Disconnect a selected node on the Peers tab */ void disconnectSelectedNode(); + /** Ban a selected node on the Peers tab */ + void banSelectedNode(int bantime); Q_SIGNALS: // For RPC command executor -- cgit v1.2.3 From 770ca79aa02964f56610ffaf15b16297634fa065 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Sat, 20 Jun 2015 20:55:21 +0200 Subject: [Qt] add context menu with unban option to ban table --- src/qt/rpcconsole.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/qt/rpcconsole.h') diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 3218a635d7..db1f3d433d 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -61,7 +61,9 @@ private Q_SLOTS: void showEvent(QShowEvent *event); void hideEvent(QHideEvent *event); /** Show custom context menu on Peers tab */ - void showMenu(const QPoint& point); + void showPeersTableContextMenu(const QPoint& point); + /** Show custom context menu on Bans tab */ + void showBanTableContextMenu(const QPoint& point); public Q_SLOTS: void clear(); @@ -82,6 +84,8 @@ public Q_SLOTS: void disconnectSelectedNode(); /** Ban a selected node on the Peers tab */ void banSelectedNode(int bantime); + /** Unban a selected node on the Bans tab */ + void unbanSelectedNode(); Q_SIGNALS: // For RPC command executor @@ -109,9 +113,10 @@ private: QStringList history; int historyPtr; NodeId cachedNodeid; - QMenu *contextMenu; const PlatformStyle *platformStyle; RPCTimerInterface *rpcTimerInterface; + QMenu *peersTableContextMenu; + QMenu *banTableContextMenu; }; #endif // BITCOIN_QT_RPCCONSOLE_H -- cgit v1.2.3 From 6135309816208740888b25bc27ea123c1c825a04 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Sat, 20 Jun 2015 21:48:10 +0200 Subject: [Qt] banlist, UI optimizing and better signal handling --- src/qt/rpcconsole.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/qt/rpcconsole.h') diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index db1f3d433d..9674cc5275 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -64,6 +64,8 @@ private Q_SLOTS: void showPeersTableContextMenu(const QPoint& point); /** Show custom context menu on Bans tab */ void showBanTableContextMenu(const QPoint& point); + /** Hides ban table if no bans are present */ + void showOrHideBanTableIfRequired(); public Q_SLOTS: void clear(); @@ -105,7 +107,10 @@ private: { ADDRESS_COLUMN_WIDTH = 200, SUBVERSION_COLUMN_WIDTH = 100, - PING_COLUMN_WIDTH = 80 + PING_COLUMN_WIDTH = 80, + BANSUBNET_COLUMN_WIDTH = 300, + BANTIME_COLUMN_WIDTH = 150 + }; Ui::RPCConsole *ui; -- cgit v1.2.3 From 53caec66cc43e1f16ba26e16147b77f5cfba22bb Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Sun, 21 Jun 2015 10:44:48 +0200 Subject: [Qt] bantable overhaul - some code cleanups - fix date formatting - reduce header includes --- src/qt/rpcconsole.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qt/rpcconsole.h') diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 9674cc5275..3f4d1834f6 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -108,8 +108,8 @@ private: ADDRESS_COLUMN_WIDTH = 200, SUBVERSION_COLUMN_WIDTH = 100, PING_COLUMN_WIDTH = 80, - BANSUBNET_COLUMN_WIDTH = 300, - BANTIME_COLUMN_WIDTH = 150 + BANSUBNET_COLUMN_WIDTH = 250, + BANTIME_COLUMN_WIDTH = 200 }; -- cgit v1.2.3 From cdd72cd5fbc2b287559f7230d1616339e9ff2d6d Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 26 Jun 2015 10:23:51 +0200 Subject: [Qt] simplify ban list signal handling - remove banListChanged signal from client model - directly call clientModel->getBanTableModel()->refresh() without the way over clientModel->updateBanlist() - also fix clearing peer detail window, when selecting (clicking) peers in the ban list --- src/qt/rpcconsole.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qt/rpcconsole.h') diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 3f4d1834f6..d5a769ae72 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -66,6 +66,8 @@ private Q_SLOTS: void showBanTableContextMenu(const QPoint& point); /** Hides ban table if no bans are present */ void showOrHideBanTableIfRequired(); + /** clear the selected node */ + void clearSelectedNode(); public Q_SLOTS: void clear(); @@ -100,8 +102,6 @@ private: void setTrafficGraphRange(int mins); /** show detailed information on ui about selected node */ void updateNodeDetail(const CNodeCombinedStats *stats); - /** clear the selected node */ - void clearSelectedNode(); enum ColumnWidths { -- cgit v1.2.3 From 51654deff2661732c5e2a2aa8ac1f632f5880f45 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 26 Jun 2015 14:55:52 +0200 Subject: [Qt] bantable polish - add missing NULL pointer checks - add better comments and reorder some code in rpcconsole.cpp - remove unneeded leftovers in bantable.cpp - update bantable column sizes to prevent cutting of banned until --- src/qt/rpcconsole.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qt/rpcconsole.h') diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index d5a769ae72..b86f776786 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -108,8 +108,8 @@ private: ADDRESS_COLUMN_WIDTH = 200, SUBVERSION_COLUMN_WIDTH = 100, PING_COLUMN_WIDTH = 80, - BANSUBNET_COLUMN_WIDTH = 250, - BANTIME_COLUMN_WIDTH = 200 + BANSUBNET_COLUMN_WIDTH = 200, + BANTIME_COLUMN_WIDTH = 250 }; -- cgit v1.2.3