mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-09 06:42:19 -04:00
rewrite connection manager
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1769 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a20d09f0f4
commit
2e5130a1da
9 changed files with 409 additions and 437 deletions
|
@ -735,52 +735,40 @@ void NetworkDialog::getNetworkStatus()
|
|||
|
||||
if(config.netDhtOk)
|
||||
{
|
||||
setLogInfo(tr("DHT OK"), QString::fromUtf8("green"));
|
||||
setLogInfo(tr("DHT OK."), QString::fromUtf8("green"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setLogInfo(tr("DHT is not working (down)."), QString::fromUtf8("red"));
|
||||
}
|
||||
|
||||
|
||||
if(config.netExtOk)
|
||||
|
||||
if(config.netStunOk)
|
||||
{
|
||||
setLogInfo(tr("Stable External IP Address"), QString::fromUtf8("green"));
|
||||
setLogInfo(tr("Stun external address detection is working."), QString::fromUtf8("green"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setLogInfo(tr("Not Found External Address"), QString::fromUtf8("red"));
|
||||
setLogInfo(tr("Stun is not working."), QString::fromUtf8("red"));
|
||||
}
|
||||
|
||||
if(config.netUdpOk)
|
||||
if (config.netLocalOk)
|
||||
{
|
||||
setLogInfo(tr("UDP Port is active (UDP Connections)"), QString::fromUtf8("green"));
|
||||
setLogInfo(tr("Local network detected"), QString::fromUtf8("magenta"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setLogInfo(tr("UDP Port is not active"), QString::fromUtf8("red"));
|
||||
setLogInfo(tr("No local network detected"), QString::fromUtf8("red"));
|
||||
}
|
||||
|
||||
if (config.netExtOk)
|
||||
|
||||
if (config.netExtraAddressOk)
|
||||
{
|
||||
if (config.netUpnpOk)
|
||||
{
|
||||
setLogInfo(tr("RetroShare Server"), QString::fromUtf8("green"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setLogInfo(tr("UDP Server"), QString::fromUtf8("green"));
|
||||
}
|
||||
}
|
||||
else if (config.netOk)
|
||||
{
|
||||
setLogInfo(tr("Net Limited"), QString::fromUtf8("magenta"));
|
||||
setLogInfo(tr("ip found via external address finder"), QString::fromUtf8("magenta"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setLogInfo(tr("No Conectivity"), QString::fromUtf8("red"));
|
||||
setLogInfo(tr("external address finder didn't found anything"), QString::fromUtf8("red"));
|
||||
}
|
||||
|
||||
|
||||
rsiface->unlockData(); /* UnLock Interface */
|
||||
}
|
||||
|
||||
|
@ -811,17 +799,8 @@ void NetworkDialog::updateNetworkStatus()
|
|||
{
|
||||
ui.iconlabel_dht->setPixmap(QPixmap::QPixmap(":/images/ledoff1.png"));
|
||||
}
|
||||
|
||||
if(config.netExtOk)
|
||||
{
|
||||
ui.iconlabel_ext->setPixmap(QPixmap::QPixmap(":/images/ledon1.png"));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.iconlabel_ext->setPixmap(QPixmap::QPixmap(":/images/ledoff1.png"));
|
||||
}
|
||||
|
||||
if(config.netUdpOk)
|
||||
|
||||
if(config.netStunOk)
|
||||
{
|
||||
ui.iconlabel_udp->setPixmap(QPixmap::QPixmap(":/images/ledon1.png"));
|
||||
}
|
||||
|
@ -830,31 +809,33 @@ void NetworkDialog::updateNetworkStatus()
|
|||
ui.iconlabel_udp->setPixmap(QPixmap::QPixmap(":/images/ledoff1.png"));
|
||||
}
|
||||
|
||||
if (config.netExtOk)
|
||||
{
|
||||
if (config.netUpnpOk)
|
||||
{
|
||||
ui.iconlabel_netUdp->setPixmap(QPixmap::QPixmap(":/images/ledon1.png"));
|
||||
ui.iconlabel_netLimited->setPixmap(QPixmap::QPixmap(":/images/ledon1.png"));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.iconlabel_netUdp->setPixmap(QPixmap::QPixmap(":/images/ledon1.png"));
|
||||
ui.iconlabel_netLimited->setPixmap(QPixmap::QPixmap(":/images/ledon1.png"));
|
||||
}
|
||||
}
|
||||
else if (config.netOk)
|
||||
if (config.netLocalOk)
|
||||
{
|
||||
ui.iconlabel_netLimited->setPixmap(QPixmap::QPixmap(":/images/ledon1.png"));
|
||||
|
||||
ui.iconlabel_netUdp->setPixmap(QPixmap::QPixmap(":/images/ledoff1.png"));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.iconlabel_netUdp->setPixmap(QPixmap::QPixmap(":/images/ledoff1.png"));
|
||||
ui.iconlabel_netLimited->setPixmap(QPixmap::QPixmap(":/images/ledoff1.png"));
|
||||
}
|
||||
|
||||
|
||||
if (config.netExtraAddressOk)
|
||||
{
|
||||
ui.iconlabel_ext->setPixmap(QPixmap::QPixmap(":/images/ledon1.png"));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.iconlabel_ext->setPixmap(QPixmap::QPixmap(":/images/ledoff1.png"));
|
||||
}
|
||||
|
||||
if (config.netExtraAddressOk || config.netStunOk || config.netUpnpOk)
|
||||
{
|
||||
ui.iconlabel_netInternetConnection->setPixmap(QPixmap::QPixmap(":/images/ledon1.png"));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.iconlabel_netInternetConnection->setPixmap(QPixmap::QPixmap(":/images/ledoff1.png"));
|
||||
}
|
||||
|
||||
rsiface->unlockData(); /* UnLock Interface */
|
||||
}
|
||||
|
||||
|
|
|
@ -212,7 +212,7 @@
|
|||
<item row="1" column="0">
|
||||
<layout class="QGridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="iconlabel_netUdp">
|
||||
<widget class="QLabel" name="iconlabel_netInternetConnection">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
|
@ -228,7 +228,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="textlabel_netUdp">
|
||||
<widget class="QLabel" name="iconlabel_netInternetConnection_2">
|
||||
<property name="text">
|
||||
<string>Internet connection</string>
|
||||
</property>
|
||||
|
@ -315,7 +315,7 @@
|
|||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="textlabel_ext">
|
||||
<property name="text">
|
||||
<string>Stable external IP address</string>
|
||||
<string>External ip adress finder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -103,32 +103,27 @@ void NATStatus::getNATStatus()
|
|||
// iconLabel->setToolTip(tr("UDP Port is not reachable"));
|
||||
// }
|
||||
|
||||
if (config.netExtOk)
|
||||
if (config.netUpnpOk)
|
||||
{
|
||||
if (config.netUpnpOk)
|
||||
{
|
||||
iconLabel->setPixmap(QPixmap::QPixmap(":/images/greenled.png"));
|
||||
iconLabel->setToolTip(tr("OK | RetroShare Server"));
|
||||
}
|
||||
else
|
||||
{
|
||||
iconLabel->setPixmap(QPixmap::QPixmap(":/images/greenled.png"));
|
||||
iconLabel->setToolTip(tr("OK | UDP Server"));
|
||||
}
|
||||
iconLabel->setPixmap(QPixmap::QPixmap(":/images/greenled.png"));
|
||||
iconLabel->setToolTip(tr("OK | RetroShare Server"));
|
||||
}
|
||||
else if (config.netOk)
|
||||
else if (config.netStunOk || config.netExtraAddressOk)
|
||||
{
|
||||
iconLabel->setPixmap(QPixmap::QPixmap(":/images/grayled.png"));
|
||||
iconLabel->setToolTip(tr("Net Limited"));
|
||||
iconLabel->setPixmap(QPixmap::QPixmap(":/images/grayled.png"));
|
||||
iconLabel->setToolTip(tr("Internet connection"));
|
||||
}
|
||||
else if (config.netLocalOk)
|
||||
{
|
||||
iconLabel->setPixmap(QPixmap::QPixmap(":/images/grayled.png"));
|
||||
iconLabel->setToolTip(tr("No internet connection"));
|
||||
}
|
||||
else
|
||||
{
|
||||
iconLabel->setPixmap(QPixmap::QPixmap(":/images/redled.png"));
|
||||
iconLabel->setToolTip(tr("No Conectivity"));
|
||||
iconLabel->setPixmap(QPixmap::QPixmap(":/images/redled.png"));
|
||||
iconLabel->setToolTip(tr("No local network"));
|
||||
}
|
||||
|
||||
rsiface->unlockData(); /* UnLock Interface */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -140,13 +140,11 @@ class RsConfig
|
|||
int DHTPeers;
|
||||
|
||||
/* Flags for Network Status */
|
||||
bool netOk; /* That we've talked to someone! */
|
||||
bool netLocalOk; /* That we've talked to someone! */
|
||||
bool netUpnpOk; /* upnp is enabled and active */
|
||||
bool netDhtOk; /* response from dht */
|
||||
bool netExtOk; /* know our external address */
|
||||
bool netUdpOk; /* recvd stun / udp packets */
|
||||
//bool netTcpOk; /* recvd incoming tcp not implemented */
|
||||
bool netResetReq;
|
||||
bool netStunOk; /* recvd stun / udp packets */
|
||||
bool netExtraAddressOk; /* recvd ip address with external finder*/
|
||||
};
|
||||
|
||||
/********************** For Search Interface *****************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue