moved Network Status Tab from Preferences to NetworkDialog as second tab after Log tab.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1162 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2009-05-04 00:30:24 +00:00
parent 5affea57ae
commit dbd5b6de39
5 changed files with 205 additions and 155 deletions

View file

@ -141,7 +141,13 @@ NetworkDialog::NetworkDialog(QWidget *parent)
timer->connect(timer, SIGNAL(timeout()), this, SLOT(getNetworkStatus()));
timer->start(100000);
//getNetworkStatus();
QTimer *timer2 = new QTimer(this);
timer2->connect(timer, SIGNAL(timeout()), this, SLOT(updateNetworkStatus()));
timer2->start(1000);
getNetworkStatus();
updateNetworkStatus();
load();
/* Hide platform specific features */
@ -608,6 +614,7 @@ void NetworkDialog::getNetworkStatus()
/* now the extra bit .... switch on check boxes */
const RsConfig &config = rsiface->getConfig();
/****** Log Tab **************************/
if(config.netUpnpOk)
{
setLogInfo(tr("UPNP is active."), QString::fromUtf8("blue"));
@ -673,10 +680,72 @@ void NetworkDialog::getNetworkStatus()
{
setLogInfo(tr("No Conectivity"), QString::fromUtf8("red"));
}
rsiface->unlockData(); /* UnLock Interface */
}
void NetworkDialog::updateNetworkStatus()
{
rsiface->lockData(); /* Lock Interface */
/* now the extra bit .... switch on check boxes */
const RsConfig &config = rsiface->getConfig();
/******* Network Status Tab *******/
//ui.check_net->setChecked(config.netOk);
ui.check_upnp->setChecked(config.netUpnpOk);
ui.check_dht->setChecked(config.netDhtOk);
ui.check_ext->setChecked(config.netExtOk);
ui.check_udp->setChecked(config.netUdpOk);
ui.check_tcp->setChecked(config.netTcpOk);
if (config.netExtOk)
{
if (config.netUpnpOk || config.netTcpOk)
{
ui.radio_netServer->setChecked(true);
}
else
{
ui.radio_netUdp->setChecked(true);
}
}
else if (config.netOk)
{
ui.radio_netLimited->setChecked(true);
}
else
{
ui.radio_nonet->setChecked(true);
}
rsiface->unlockData(); /* UnLock Interface */
}
void NetworkDialog::load()
{
//ui.check_net->setCheckable(true);
ui.check_upnp->setCheckable(true);
ui.check_dht->setCheckable(true);
ui.check_ext->setCheckable(true);
ui.check_udp->setCheckable(true);
ui.check_tcp->setCheckable(true);
//ui.check_net->setEnabled(false);
ui.check_upnp->setEnabled(false);
ui.check_dht->setEnabled(false);
ui.check_ext->setEnabled(false);
ui.check_udp->setEnabled(false);
ui.check_tcp->setEnabled(false);
ui.radio_nonet->setEnabled(false);
ui.radio_netLimited->setEnabled(false);
ui.radio_netUdp->setEnabled(false);
ui.radio_netServer->setEnabled(false);
}
void NetworkDialog::on_actionTabsright_activated()
{
ui.networkTab->setTabPosition(QTabWidget::East);