improved GUI layout. changed filtering strategy: now all is collected but only a subset is banned, according to user input. Default is to only ban IP ranges auto-generated and home-made ranges.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8375 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-06-04 20:26:57 +00:00
parent 1541a2a0ad
commit 6c7d86d659
5 changed files with 144 additions and 66 deletions

View file

@ -440,15 +440,13 @@ void ServerPage::addPeerToIPTable(QTableWidget *table,int row,const BanListPeer&
else
table->setItem(row,COLUMN_STATUS,new QTableWidgetItem(QString(""))) ;
table->item(row,COLUMN_STATUS)->setData(Qt::UserRole,QVariant( blp.state )) ;
switch(blp.level)
{
case RSBANLIST_ORIGIN_FOF: table->setItem(row,COLUMN_ORIGIN,new QTableWidgetItem(QString("From friend of a friend"))) ;
break ;
case RSBANLIST_ORIGIN_FRIEND: table->setItem(row,COLUMN_ORIGIN,new QTableWidgetItem(QString("From friend"))) ;
break ;
case RSBANLIST_ORIGIN_SELF: table->setItem(row,COLUMN_ORIGIN,new QTableWidgetItem(QString("From you"))) ;
case RSBANLIST_ORIGIN_SELF: table->setItem(row,COLUMN_ORIGIN,new QTableWidgetItem(QString("Local"))) ;
break ;
default:
case RSBANLIST_ORIGIN_UNKNOWN: table->setItem(row,COLUMN_ORIGIN,new QTableWidgetItem(QString("Unknown"))) ;
@ -457,7 +455,7 @@ void ServerPage::addPeerToIPTable(QTableWidget *table,int row,const BanListPeer&
switch( blp.reason )
{
case RSBANLIST_REASON_DHT: table->setItem(row,COLUMN_REASON,new QTableWidgetItem(QString("Bad peer (DHT)"))) ;
case RSBANLIST_REASON_DHT: table->setItem(row,COLUMN_REASON,new QTableWidgetItem(QString("Masquerading peer"))) ;
table->setItem(row,COLUMN_COMMENT,new QTableWidgetItem(tr("Reported by DHT for IP masquerading"))) ;
break ;
case RSBANLIST_REASON_USER: table->setItem(row,COLUMN_REASON,new QTableWidgetItem(QString("Home-made rule"))) ;
@ -471,6 +469,10 @@ void ServerPage::addPeerToIPTable(QTableWidget *table,int row,const BanListPeer&
table->setItem(row,COLUMN_COMMENT,new QTableWidgetItem(QString::fromStdString(blp.comment))) ;
break ;
}
table->item(row,COLUMN_STATUS)->setData(Qt::UserRole,QVariant( blp.state )) ;
table->item(row,COLUMN_REASON)->setData(Qt::UserRole,QVariant( blp.reason )) ;
table->item(row,COLUMN_ORIGIN)->setData(Qt::UserRole,QVariant( blp.level )) ;
}

View file

@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -503,19 +503,19 @@ behind a firewall or a VPN.</string>
<string>IP Filters</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<widget class="QCheckBox" name="denyAll_CB">
<property name="text">
<string>activate IP filtering</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>IP blacklist</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QCheckBox" name="denyAll_CB">
<property name="text">
<string>Deny all connections from the following IP ranges:</string>
</property>
</widget>
</item>
<item>
<widget class="QTableWidget" name="filteredIpsTable">
<property name="contextMenuPolicy">
@ -566,7 +566,14 @@ behind a firewall or a VPN.</string>
<item>
<widget class="QCheckBox" name="includeFromFriends_CB">
<property name="text">
<string>Include the IPs reported by your friends</string>
<string>Ban all IPs reported by your friends</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="includeFromDHT_CB">
<property name="text">
<string>Ban every masquerading IP reported by your DHT</string>
</property>
</widget>
</item>
@ -575,7 +582,7 @@ behind a firewall or a VPN.</string>
<item>
<widget class="QCheckBox" name="groupIPRanges_CB">
<property name="text">
<string>Auto-group IPs by ranges when at least :</string>
<string>Automatically ban IP of DHT masquerading IPs starting at</string>
</property>
</widget>
</item>
@ -607,13 +614,6 @@ behind a firewall or a VPN.</string>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="includeFromDHT_CB">
<property name="text">
<string>Automatically include masquerading IPs reported by DHT</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>