Various improvements to the GUI.

* Switched ServerPage to use netMode, rather than tryNetMode. This fixes the Network Status.
 * Added "Advanced Mode" to Settings GeneralPage.
 * Store / Set Advanced Mode via rsConfig::get/setConfigurationOptions.
 * removed %0D%0A from Linux / OSX emails - made it Windows Only.
 * updated GetStartedDialog text.
 * updated Dht and Nat Indicators to accurately reflect Network status. Roughly:
   - DHT. Off:     gray, ERROR:   red, NO RS PEERS:           yellow, GOOD: green.
   - NAT. Offline: gray, BAD NET: red, NO DHT, or FIREWALLED: yellow, GOOD: green
 * disable GetStartedDialog is AdvancedMode is set.
 


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4502 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2011-07-30 17:13:08 +00:00
parent 31ec7a074b
commit 1cb0a9dc21
8 changed files with 230 additions and 57 deletions

View File

@ -528,7 +528,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-241</y> <y>0</y>
<width>666</width> <width>666</width>
<height>746</height> <height>746</height>
</rect> </rect>
@ -738,11 +738,12 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Be Online at the same time, and Retroshare will automatically connect you!&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Be Online at the same time, and Retroshare will automatically connect you!&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Your client needs to find the Retroshare Network before it can make connections.&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Your client needs to find the Retroshare Network before it can make connections.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;This can take up to 30 minutes the first time, so please have some patience.&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;This takes 5-30 minutes the first time you startup Retroshare&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;The number at the bottom of the GUI indicates the number of Retroshare peers you have found.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;If you don't connect, check your News Feed (on the Friends Tab).&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;The DHT indicator (in the Status Bar) turnsGreen when it can make connections.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;If your friend rejected your connection - you will be notified here.&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;After a couple of minutes, the NAT indicator (also in the Status Bar) switch to Yellow or Green.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;If it remains Red, then you have a Nasty Firewall, that Retroshare struggles to connect through.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Look in the Further Help section for more advice about connecting.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Look in the Further Help section for more advice about connecting.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
@ -812,7 +813,7 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;This will speed up connections and allow more people to connect with you &lt;/span&gt;&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;This will speed up connections and allow more people to connect with you &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;The easiest way to do this is by enabling UPnP on your Wireless Box or Router.&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;The easiest way to do this is by enabling UPnP on your Wireless Box or Router.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;As each router is different. Google &amp;quot;Upnp setup [ YOUR ROUTER TYPE ]&amp;quot; for instructions.&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;As each router is different, you need to find out your Router Model and Google for instructions.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;If none of this makes sense, don't worry about it Retroshare will still work.&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;If none of this makes sense, don't worry about it Retroshare will still work.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;/p&gt;

View File

@ -33,6 +33,8 @@
#endif #endif
#include <retroshare/rsplugin.h> #include <retroshare/rsplugin.h>
#include <retroshare/rsconfig.h>
#include "rshare.h" #include "rshare.h"
#include "MainWindow.h" #include "MainWindow.h"
#include "MessengerWindow.h" #include "MessengerWindow.h"
@ -192,6 +194,17 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
setWindowTitle(tr("RetroShare %1 a secure decentralised communication platform").arg(retroshareVersion()) + " - " + nameAndLocation); setWindowTitle(tr("RetroShare %1 a secure decentralised communication platform").arg(retroshareVersion()) + " - " + nameAndLocation);
/* WORK OUT IF WE"RE IN ADVANCED MODE OR NOT */
bool advancedMode = false;
std::string advsetting;
if (rsConfig->getConfigurationOption(RS_CONFIG_ADVANCED, advsetting) && (advsetting == "YES"))
{
advancedMode = true;
}
/* add url handler for RetroShare links */ /* add url handler for RetroShare links */
QDesktopServices::setUrlHandler(RSLINK_SCHEME, this, "linkActivated"); QDesktopServices::setUrlHandler(RSLINK_SCHEME, this, "linkActivated");
@ -294,8 +307,12 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
#ifdef GETSTARTED_GUI #ifdef GETSTARTED_GUI
MainPage *getStartedPage = NULL; MainPage *getStartedPage = NULL;
ui.stackPages->add(getStartedPage = new GetStartedDialog(ui.stackPages),
if (!advancedMode)
{
ui.stackPages->add(getStartedPage = new GetStartedDialog(ui.stackPages),
createPageAction(QIcon(IMG_HELP), tr("Getting Started"), grp)); createPageAction(QIcon(IMG_HELP), tr("Getting Started"), grp));
}
#endif #endif

View File

@ -356,11 +356,13 @@ void TextPage::updateOwnCert()
static void sendMail (std::string sAddress, std::string sSubject, std::string sBody) static void sendMail (std::string sAddress, std::string sSubject, std::string sBody)
{ {
#ifdef Q_WS_WIN
/* search and replace the end of lines with: "%0D%0A" */ /* search and replace the end of lines with: "%0D%0A" */
size_t loc; size_t loc;
while ((loc = sBody.find("\n")) != sBody.npos) { while ((loc = sBody.find("\n")) != sBody.npos) {
sBody.replace(loc, 1, "%0D%0A"); sBody.replace(loc, 1, "%0D%0A");
} }
#endif
std::string mailstr = "mailto:" + sAddress; std::string mailstr = "mailto:" + sAddress;
mailstr += "?subject=" + sSubject; mailstr += "?subject=" + sSubject;

View File

@ -21,7 +21,9 @@
#include <iostream> #include <iostream>
#include <rshare.h> #include <rshare.h>
#include <retroshare/rsinit.h> #include "retroshare/rsinit.h"
#include "retroshare/rsconfig.h"
#include "GeneralPage.h" #include "GeneralPage.h"
#include <util/stringutil.h> #include <util/stringutil.h>
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
@ -66,6 +68,17 @@ bool GeneralPage::save(QString &errmsg)
RsInit::setAutoLogin(ui.autoLogin->isChecked()); RsInit::setAutoLogin(ui.autoLogin->isChecked());
if (ui.checkAdvanced->isChecked())
{
std::string opt("YES");
rsConfig->setConfigurationOption(RS_CONFIG_ADVANCED, opt);
}
else
{
std::string opt("NO");
rsConfig->setConfigurationOption(RS_CONFIG_ADVANCED, opt);
}
return true; return true;
} }
@ -88,4 +101,13 @@ void GeneralPage::load()
ui.spinBox->setValue(Settings->getMaxTimeBeforeIdle()); ui.spinBox->setValue(Settings->getMaxTimeBeforeIdle());
ui.autoLogin->setChecked(RsInit::getAutoLogin()); ui.autoLogin->setChecked(RsInit::getAutoLogin());
bool advancedmode = false;
std::string advsetting;
if (rsConfig->getConfigurationOption(RS_CONFIG_ADVANCED, advsetting) && (advsetting == "YES"))
{
advancedmode = true;
}
ui.checkAdvanced->setChecked(advancedmode);
} }

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>413</width> <width>362</width>
<height>314</height> <height>400</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
@ -499,8 +499,8 @@
<property name="contextMenuPolicy"> <property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum> <enum>Qt::NoContextMenu</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QVBoxLayout" name="verticalLayout">
<item row="0" column="0"> <item>
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="groupBox_2">
<property name="title"> <property name="title">
<string>Startup</string> <string>Startup</string>
@ -553,7 +553,23 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>For Advanced Users </string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="checkAdvanced">
<property name="text">
<string>Enable Advanced Mode (Restart Required)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Misc</string> <string>Misc</string>
@ -593,20 +609,7 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>178</width>
<height>95</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="groupBox_3"> <widget class="QGroupBox" name="groupBox_3">
<property name="title"> <property name="title">
<string>Idle</string> <string>Idle</string>
@ -635,6 +638,19 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>178</width>
<height>95</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>

View File

@ -116,7 +116,7 @@ void ServerPage::load()
/* set net mode */ /* set net mode */
int netIndex = 0; int netIndex = 0;
switch(detail.tryNetMode) switch(detail.netMode)
{ {
case RS_NETMODE_EXT: case RS_NETMODE_EXT:
netIndex = 2; netIndex = 2;
@ -267,7 +267,7 @@ void ServerPage::saveAddresses()
break; break;
} }
if (detail.tryNetMode != netMode) if (detail.netMode != netMode)
rsPeers->setNetworkMode(ownId, netMode); rsPeers->setNetworkMode(ownId, netMode);
uint32_t visState = 0; uint32_t visState = 0;

View File

@ -67,35 +67,72 @@ DHTStatus::DHTStatus(QWidget *parent)
void DHTStatus::getDHTStatus() void DHTStatus::getDHTStatus()
{ {
rsiface->lockData(); /* Lock Interface */ rsiface->lockData(); /* Lock Interface */
/* now the extra bit .... switch on check boxes */ /* now the extra bit .... switch on check boxes */
const RsConfig &config = rsiface->getConfig(); const RsConfig &config = rsiface->getConfig();
if (config.netDhtOk) if (!(config.DHTActive))
{ {
dhtstatusLabel->setPixmap(QPixmap(":/images/greenled.png")); // GRAY.
dhtstatusLabel->setToolTip(tr("DHT On")); dhtstatusLabel->setPixmap(QPixmap(":/images/grayled.png"));
dhtstatusLabel->setToolTip(tr("DHT Off"));
spaceLabel->setVisible(true); spaceLabel->setVisible(false);
dhtnetworkLabel->setVisible(true); dhtnetworkLabel->setVisible(false);
dhtnetworksizeLabel->setVisible(true); dhtnetworksizeLabel->setVisible(false);
dhtnetworksizeLabel->setText(QString("%1 (%2)").arg(misc::userFriendlyUnit(config.netDhtRsNetSize, 1)).arg(misc::userFriendlyUnit(config.netDhtNetSize, 1))); dhtnetworksizeLabel->setText("");
dhtnetworksizeLabel->setToolTip(tr("RetroShare users in DHT (Total DHT users)") ); dhtnetworksizeLabel->setToolTip("");
} }
else else
{ {
dhtstatusLabel->setPixmap(QPixmap(":/images/redled.png")); if (config.netDhtOk)
dhtstatusLabel->setToolTip(tr("DHT Off")); {
#define MIN_RS_NET_SIZE 10
// YELLOW or GREEN.
if (config.netDhtRsNetSize < MIN_RS_NET_SIZE)
{
dhtstatusLabel->setPixmap(QPixmap(":/images/yellowled.png"));
dhtstatusLabel->setToolTip(tr("DHT Searching for Retroshare Peers"));
spaceLabel->setVisible(false); spaceLabel->setVisible(true);
dhtnetworkLabel->setVisible(false); dhtnetworkLabel->setVisible(true);
dhtnetworksizeLabel->setVisible(false); dhtnetworksizeLabel->setVisible(true);
dhtnetworksizeLabel->setText(""); dhtnetworksizeLabel->setText(QString("%1 (%2)").arg(misc::userFriendlyUnit(config.netDhtRsNetSize, 1)).arg(misc::userFriendlyUnit(config.netDhtNetSize, 1)));
dhtnetworksizeLabel->setToolTip(""); dhtnetworksizeLabel->setToolTip(tr("RetroShare users in DHT (Total DHT users)") );
} }
else
{
dhtstatusLabel->setPixmap(QPixmap(":/images/greenled.png"));
dhtstatusLabel->setToolTip(tr("DHT Good"));
spaceLabel->setVisible(true);
dhtnetworkLabel->setVisible(true);
dhtnetworksizeLabel->setVisible(true);
dhtnetworksizeLabel->setText(QString("%1 (%2)").arg(misc::userFriendlyUnit(config.netDhtRsNetSize, 1)).arg(misc::userFriendlyUnit(config.netDhtNetSize, 1)));
dhtnetworksizeLabel->setToolTip(tr("RetroShare users in DHT (Total DHT users)") );
}
}
else
{
// RED - some issue.
dhtstatusLabel->setPixmap(QPixmap(":/images/redled.png"));
dhtstatusLabel->setToolTip(tr("DHT Error"));
spaceLabel->setVisible(false);
dhtnetworkLabel->setVisible(false);
dhtnetworksizeLabel->setVisible(false);
dhtnetworksizeLabel->setText("");
dhtnetworksizeLabel->setToolTip("");
}
}
rsiface->unlockData(); /* UnLock Interface */
rsiface->unlockData(); /* UnLock Interface */
} }

View File

@ -24,7 +24,8 @@
#include "natstatus.h" #include "natstatus.h"
#include <retroshare/rsiface.h> #include "retroshare/rsiface.h"
#include "retroshare/rsconfig.h"
NATStatus::NATStatus(QWidget *parent) NATStatus::NATStatus(QWidget *parent)
: QWidget(parent) : QWidget(parent)
@ -49,6 +50,81 @@ NATStatus::NATStatus(QWidget *parent)
void NATStatus::getNATStatus() void NATStatus::getNATStatus()
{ {
uint32_t netState = rsConfig -> getNetState();
switch(netState)
{
default:
case RSNET_NETSTATE_BAD_UNKNOWN:
{
iconLabel->setPixmap(QPixmap(":/images/yellowled.png"));
iconLabel->setToolTip(tr("Network Status Unknown"));
}
break;
case RSNET_NETSTATE_BAD_OFFLINE:
{
iconLabel->setPixmap(QPixmap(":/images/grayled.png"));
iconLabel->setToolTip(tr("Offline"));
}
break;
// BAD. (RED)
case RSNET_NETSTATE_BAD_NATSYM:
{
iconLabel->setPixmap(QPixmap(":/images/redled.png"));
iconLabel->setToolTip(tr("Nasty Firewall"));
}
break;
case RSNET_NETSTATE_BAD_NODHT_NAT:
{
iconLabel->setPixmap(QPixmap(":/images/redled.png"));
iconLabel->setToolTip(tr("DHT Disabled and Firewalled"));
}
break;
// CAUTION. (ORANGE)
case RSNET_NETSTATE_WARNING_RESTART:
{
iconLabel->setPixmap(QPixmap(":/images/yellowled.png"));
iconLabel->setToolTip(tr("Network Restarting"));
}
break;
case RSNET_NETSTATE_WARNING_NATTED:
{
iconLabel->setPixmap(QPixmap(":/images/yellowled.png"));
iconLabel->setToolTip(tr("Behind Firewall"));
}
break;
case RSNET_NETSTATE_WARNING_NODHT:
{
iconLabel->setPixmap(QPixmap(":/images/yellowled.png"));
iconLabel->setToolTip(tr("DHT Disabled"));
}
break;
// GOOD (GREEN)
case RSNET_NETSTATE_GOOD:
{
iconLabel->setPixmap(QPixmap(":/images/greenled.png"));
iconLabel->setToolTip(tr("OK | RetroShare Server"));
}
break;
}
}
#if 0
void NATStatus::getNATStatus()
{
uint32_t netMode = rsConfig -> getNetworkMode();
uint32_t natType = rsConfig -> getNatTypeMode();
uint32_t natHole = rsConfig -> getNatHoleMode();
rsiface->lockData(); /* Lock Interface */ rsiface->lockData(); /* Lock Interface */
/* now the extra bit .... switch on check boxes */ /* now the extra bit .... switch on check boxes */
@ -111,3 +187,5 @@ void NATStatus::getNATStatus()
rsiface->unlockData(); /* UnLock Interface */ rsiface->unlockData(); /* UnLock Interface */
} }
#endif