forget to commit this, for the Search Filter DHT IPs

This commit is contained in:
defnax 2015-08-10 18:27:29 +02:00
parent 13e77fb7e5
commit 783465bc89
2 changed files with 22 additions and 8 deletions

View File

@ -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());
}
}
}

View File

@ -467,6 +467,12 @@
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0">
<widget class="QTreeWidget" name="dhtTreeWidget">
<property name="defaultDropAction">
<enum>Qt::CopyAction</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>