From 783465bc897a7d1d05982781f8dcbe7239dbf469 Mon Sep 17 00:00:00 2001 From: defnax Date: Mon, 10 Aug 2015 18:27:29 +0200 Subject: [PATCH] forget to commit this, for the Search Filter DHT IPs --- .../src/gui/statistics/DhtWindow.cpp | 24 ++++++++++++------- .../src/gui/statistics/DhtWindow.ui | 6 +++++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/retroshare-gui/src/gui/statistics/DhtWindow.cpp b/retroshare-gui/src/gui/statistics/DhtWindow.cpp index 7827f296e..5a971c010 100644 --- a/retroshare-gui/src/gui/statistics/DhtWindow.cpp +++ b/retroshare-gui/src/gui/statistics/DhtWindow.cpp @@ -36,6 +36,14 @@ #include "retroshare/rsconfig.h" #include "retroshare/rspeers.h" +#define DTW_COL_BUCKET 0 +#define DTW_COL_IPADDR 1 +#define DTW_COL_PEERID 2 +#define DTW_COL_FLAGS 3 +#define DTW_COL_FOUND 4 +#define DTW_COL_SEND 5 +#define DTW_COL_RECV 6 + DhtWindow::DhtWindow(QWidget *parent) : RsAutoUpdatePage(1000,parent) { @@ -43,6 +51,10 @@ DhtWindow::DhtWindow(QWidget *parent) connect( ui.filterLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(filterItems(QString))); connect( ui.filterLineEdit, SIGNAL(filterChanged(int)), this, SLOT(filterColumnChanged(int))); + + /* add filter actions */ + ui.filterLineEdit->addFilter(QIcon(), tr("IP"), DTW_COL_IPADDR, tr("Search IP")); + ui.filterLineEdit->setCurrentFilter(DTW_COL_IPADDR); } DhtWindow::~DhtWindow() @@ -577,14 +589,6 @@ void DhtWindow::updateRelays() /****************************/ -#define DTW_COL_BUCKET 0 -#define DTW_COL_IPADDR 1 -#define DTW_COL_PEERID 2 -#define DTW_COL_FLAGS 3 -#define DTW_COL_FOUND 4 -#define DTW_COL_SEND 5 -#define DTW_COL_RECV 6 - class DhtTreeWidgetItem : public QTreeWidgetItem { public: @@ -666,6 +670,10 @@ void DhtWindow::updateDhtPeers() dht_item -> setData(DTW_COL_RECV, Qt::DisplayRole, lastrecvstr); ui.dhtTreeWidget->addTopLevelItem(dht_item); + + if (ui.filterLineEdit->text().isEmpty() == false) { + filterItems(ui.filterLineEdit->text()); + } } } diff --git a/retroshare-gui/src/gui/statistics/DhtWindow.ui b/retroshare-gui/src/gui/statistics/DhtWindow.ui index dac79743d..b2dfd8237 100644 --- a/retroshare-gui/src/gui/statistics/DhtWindow.ui +++ b/retroshare-gui/src/gui/statistics/DhtWindow.ui @@ -467,6 +467,12 @@ + + Qt::CopyAction + + + QAbstractItemView::MultiSelection + true