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);

View File

@ -46,6 +46,8 @@ public:
void showpeerdetails(std::string id);
void load();
public slots:
void insertConnect();
std::string loadneighbour();
@ -72,6 +74,7 @@ private slots:
void displayInfoLogMenu(const QPoint& pos);
void getNetworkStatus();
void updateNetworkStatus();
void on_actionTabsright_activated();
void on_actionTabsnorth_activated();

View File

@ -5,7 +5,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>582</width>
<width>549</width>
<height>444</height>
</rect>
</property>
@ -221,6 +221,103 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
<widget class="QWidget" name="networkstatus" >
<attribute name="title" >
<string>Network Status</string>
</attribute>
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" >
<layout class="QHBoxLayout" name="_2" >
<item>
<layout class="QVBoxLayout" name="_3" >
<item>
<widget class="QRadioButton" name="radio_nonet" >
<property name="text" >
<string>No Conectivity</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radio_netLimited" >
<property name="text" >
<string>Limited</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radio_netUdp" >
<property name="text" >
<string>Udp</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radio_netServer" >
<property name="text" >
<string>Retroshare Server</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="_4" >
<item>
<widget class="QCheckBox" name="check_udp" >
<property name="text" >
<string>UDP Connections</string>
</property>
<property name="checkable" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_ext" >
<property name="text" >
<string>Stable External IP Addrress</string>
</property>
<property name="checkable" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_dht" >
<property name="text" >
<string>DHT Okay</string>
</property>
<property name="checkable" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_upnp" >
<property name="text" >
<string>UPnP Active</string>
</property>
<property name="checkable" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_tcp" >
<property name="text" >
<string>TCP server</string>
</property>
<property name="checkable" >
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>

View File

@ -39,7 +39,7 @@ ServerDialog::ServerDialog(QWidget *parent)
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
/* Create RshareSettings object */
/* Create RshareSettings object */
_settings = new RshareSettings();
connect( ui.netModeComboBox, SIGNAL( activated ( int ) ), this, SLOT( toggleUPnP( ) ) );
@ -156,25 +156,7 @@ void ServerDialog::load()
toggleUPnP();
//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);
/* Addresses must be set here - otherwise can't edit it */
/* set local address */
@ -284,40 +266,7 @@ void ServerDialog::updateStatus()
ui.netStatusBox ->setReadOnly(true);
#endif
rsiface->lockData(); /* Lock Interface */
/* now the extra bit .... switch on check boxes */
const RsConfig &config = rsiface->getConfig();
//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 */
}

View File

@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>409</width>
<height>406</height>
<width>405</width>
<height>357</height>
</rect>
</property>
<property name="sizePolicy" >
@ -672,6 +672,35 @@
</layout>
</item>
<item>
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2" >
<attribute name="title" >
<string>IP Service</string>
</attribute>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QGroupBox" name="groupBox_4" >
<property name="title" >
<string>IP check service</string>
</property>
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" >
<widget class="QCheckBox" name="allowIpDeterminationCB" >
<property name="toolTip" >
<string>If you unckeck this, RetroShare can only determine your IP
@ -687,7 +716,7 @@ behind a firewall or a VPN.</string>
</property>
</widget>
</item>
<item>
<item row="1" column="0" >
<widget class="QListWidget" name="IPServersLV" >
<property name="editTriggers" >
<set>QAbstractItemView::NoEditTriggers</set>
@ -699,103 +728,6 @@ behind a firewall or a VPN.</string>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2" >
<attribute name="title" >
<string>Network Status</string>
</attribute>
<layout class="QGridLayout" >
<item row="0" column="0" >
<layout class="QHBoxLayout" >
<item>
<layout class="QVBoxLayout" >
<item>
<widget class="QRadioButton" name="radio_nonet" >
<property name="text" >
<string>No Conectivity</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radio_netLimited" >
<property name="text" >
<string>Limited</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radio_netUdp" >
<property name="text" >
<string>Udp</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radio_netServer" >
<property name="text" >
<string>Retroshare Server</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" >
<item>
<widget class="QCheckBox" name="check_udp" >
<property name="text" >
<string>UDP Connections</string>
</property>
<property name="checkable" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_ext" >
<property name="text" >
<string>Stable External IP Addrress</string>
</property>
<property name="checkable" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_dht" >
<property name="text" >
<string>DHT Okay</string>
</property>
<property name="checkable" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_upnp" >
<property name="text" >
<string>UPnP Active</string>
</property>
<property name="checkable" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_tcp" >
<property name="text" >
<string>TCP server</string>
</property>
<property name="checkable" >
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
<item row="2" column="0" >