Added a notify in SecurityIpItem when the ip address was added to the whitelist.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8355 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2015-06-03 15:14:26 +00:00
parent d959d27e41
commit fb28284be3
7 changed files with 45 additions and 19 deletions

View file

@ -153,13 +153,18 @@ void RsBanListToolButton::applyIp()
}
masked_bytes = action->data().toUInt();
bool changed = false;
switch (mMode) {
case MODE_ADD:
rsBanList->addIpRange(addr, masked_bytes, list_type, "");
changed = rsBanList->addIpRange(addr, masked_bytes, list_type, "");
break;
case MODE_REMOVE:
rsBanList->removeIpRange(addr, masked_bytes, list_type);
changed = rsBanList->removeIpRange(addr, masked_bytes, list_type);
break;
}
if (changed) {
emit banListChanged();
}
}

View file

@ -46,6 +46,9 @@ public:
void setMode(List list, Mode mode);
bool setIpAddress(const QString &ipAddress);
signals:
void banListChanged();
private:
void updateUi();

View file

@ -67,9 +67,11 @@ void SecurityIpItem::setup()
/* specific ones */
connect(ui->peerDetailsButton, SIGNAL(clicked()), this, SLOT(peerDetails()));
connect(ui->rsBanListButton, SIGNAL(banListChanged()), ui->rsBanListChangedLabel, SLOT(show()));
ui->avatar->setId(ChatId(mSslId));
ui->rsBanListButton->setMode(RsBanListToolButton::LIST_WHITELIST, RsBanListToolButton::MODE_ADD);
ui->rsBanListChangedLabel->hide();
ui->expandFrame->hide();

View file

@ -159,6 +159,9 @@
</item>
<item row="1" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QToolButton" name="peerDetailsButton">
<property name="focusPolicy">
@ -204,6 +207,13 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="rsBanListChangedLabel">
<property name="text">
<string>IP addres was added to the whitelist</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
@ -468,15 +478,6 @@
</widget>
</item>
</layout>
<action name="actionNew_Message">
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/mail_send.png</normaloff>:/images/mail_send.png</iconset>
</property>
<property name="text">
<string>Write Message</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>