From df5d69540a08bd06f5b79579d76e25416120a558 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Wed, 3 Jun 2015 17:16:06 +0000 Subject: [PATCH] Added ip address to the info in SecurityIpItem git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8357 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/common/RsBanListToolButton.cpp | 4 ++-- retroshare-gui/src/gui/common/RsBanListToolButton.h | 2 +- retroshare-gui/src/gui/feeds/SecurityIpItem.cpp | 8 +++++++- retroshare-gui/src/gui/feeds/SecurityIpItem.h | 1 + retroshare-gui/src/gui/feeds/SecurityIpItem.ui | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/common/RsBanListToolButton.cpp b/retroshare-gui/src/gui/common/RsBanListToolButton.cpp index 2a6bf9aac..e29bcf96e 100644 --- a/retroshare-gui/src/gui/common/RsBanListToolButton.cpp +++ b/retroshare-gui/src/gui/common/RsBanListToolButton.cpp @@ -135,7 +135,7 @@ void RsBanListToolButton::applyIp() return; } - sockaddr_storage addr ; + sockaddr_storage addr; int masked_bytes; if (!RsNetUtil::parseAddrFromQString(mIpAddress, addr, masked_bytes)) { @@ -165,6 +165,6 @@ void RsBanListToolButton::applyIp() } if (changed) { - emit banListChanged(); + emit banListChanged(RsNetUtil::printAddrRange(addr, masked_bytes)); } } diff --git a/retroshare-gui/src/gui/common/RsBanListToolButton.h b/retroshare-gui/src/gui/common/RsBanListToolButton.h index 752018be5..8a6080eda 100644 --- a/retroshare-gui/src/gui/common/RsBanListToolButton.h +++ b/retroshare-gui/src/gui/common/RsBanListToolButton.h @@ -47,7 +47,7 @@ public: bool setIpAddress(const QString &ipAddress); signals: - void banListChanged(); + void banListChanged(const QString &ipAddress); private: void updateUi(); diff --git a/retroshare-gui/src/gui/feeds/SecurityIpItem.cpp b/retroshare-gui/src/gui/feeds/SecurityIpItem.cpp index fa3557744..319e751b2 100644 --- a/retroshare-gui/src/gui/feeds/SecurityIpItem.cpp +++ b/retroshare-gui/src/gui/feeds/SecurityIpItem.cpp @@ -67,7 +67,7 @@ void SecurityIpItem::setup() /* specific ones */ connect(ui->peerDetailsButton, SIGNAL(clicked()), this, SLOT(peerDetails())); - connect(ui->rsBanListButton, SIGNAL(banListChanged()), ui->rsBanListChangedLabel, SLOT(show())); + connect(ui->rsBanListButton, SIGNAL(banListChanged(QString)), this, SLOT(banIpListChanged(QString))); ui->avatar->setId(ChatId(mSslId)); ui->rsBanListButton->setMode(RsBanListToolButton::LIST_WHITELIST, RsBanListToolButton::MODE_ADD); @@ -250,3 +250,9 @@ void SecurityIpItem::peerDetails() ConfCertDialog::showIt(mSslId, ConfCertDialog::PageDetails); } } + +void SecurityIpItem::banIpListChanged(const QString &ipAddress) +{ + ui->rsBanListChangedLabel->setText(tr("IP address %1 was added to the whitelist").arg(ipAddress)); + ui->rsBanListChangedLabel->show(); +} diff --git a/retroshare-gui/src/gui/feeds/SecurityIpItem.h b/retroshare-gui/src/gui/feeds/SecurityIpItem.h index 6db9d5595..9c834ca55 100644 --- a/retroshare-gui/src/gui/feeds/SecurityIpItem.h +++ b/retroshare-gui/src/gui/feeds/SecurityIpItem.h @@ -58,6 +58,7 @@ private slots: void toggle(); void peerDetails(); void updateItem(); + void banIpListChanged(const QString &ipAddress); private: FeedHolder *mParent; diff --git a/retroshare-gui/src/gui/feeds/SecurityIpItem.ui b/retroshare-gui/src/gui/feeds/SecurityIpItem.ui index a895d3cc1..80299b86f 100644 --- a/retroshare-gui/src/gui/feeds/SecurityIpItem.ui +++ b/retroshare-gui/src/gui/feeds/SecurityIpItem.ui @@ -210,7 +210,7 @@ - IP address was added to the whitelist + IP address was added to the whitelist