mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
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:
parent
31ec7a074b
commit
1cb0a9dc21
@ -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; }
|
|||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">Be Online at the same time, and Retroshare will automatically connect you!</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">Be Online at the same time, and Retroshare will automatically connect you!</span></p>
|
||||||
<p style="-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;"></p>
|
<p style="-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;"></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">Your client needs to find the Retroshare Network before it can make connections.</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">Your client needs to find the Retroshare Network before it can make connections.</span></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">This can take up to 30 minutes the first time, so please have some patience.</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">This takes 5-30 minutes the first time you startup Retroshare</span></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">The number at the bottom of the GUI indicates the number of Retroshare peers you have found.</span></p>
|
|
||||||
<p style="-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;"></p>
|
<p style="-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;"></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">If you don't connect, check your News Feed (on the Friends Tab).</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">The DHT indicator (in the Status Bar) turnsGreen when it can make connections.</span></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">If your friend rejected your connection - you will be notified here.</span></p>
|
<p style="-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;"></p>
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">After a couple of minutes, the NAT indicator (also in the Status Bar) switch to Yellow or Green.</span></p>
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">If it remains Red, then you have a Nasty Firewall, that Retroshare struggles to connect through.</span></p>
|
||||||
<p style="-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;"></p>
|
<p style="-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;"></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">Look in the Further Help section for more advice about connecting.</span></p></body></html></string>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">Look in the Further Help section for more advice about connecting.</span></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
@ -812,7 +813,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">This will speed up connections and allow more people to connect with you </span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">This will speed up connections and allow more people to connect with you </span></p>
|
||||||
<p style="-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;"></p>
|
<p style="-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;"></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">The easiest way to do this is by enabling UPnP on your Wireless Box or Router.</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">The easiest way to do this is by enabling UPnP on your Wireless Box or Router.</span></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">As each router is different. Google &quot;Upnp setup [ YOUR ROUTER TYPE ]&quot; for instructions.</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">As each router is different, you need to find out your Router Model and Google for instructions.</span></p>
|
||||||
<p style="-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;"></p>
|
<p style="-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;"></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">If none of this makes sense, don't worry about it Retroshare will still work.</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">If none of this makes sense, don't worry about it Retroshare will still work.</span></p>
|
||||||
<p style="-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;"></p>
|
<p style="-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;"></p>
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
if (!advancedMode)
|
||||||
|
{
|
||||||
ui.stackPages->add(getStartedPage = new GetStartedDialog(ui.stackPages),
|
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
|
||||||
|
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
@ -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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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/>
|
||||||
|
@ -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;
|
||||||
|
@ -72,10 +72,29 @@ void DHTStatus::getDHTStatus()
|
|||||||
/* 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.DHTActive))
|
||||||
|
{
|
||||||
|
// GRAY.
|
||||||
|
dhtstatusLabel->setPixmap(QPixmap(":/images/grayled.png"));
|
||||||
|
dhtstatusLabel->setToolTip(tr("DHT Off"));
|
||||||
|
|
||||||
|
spaceLabel->setVisible(false);
|
||||||
|
dhtnetworkLabel->setVisible(false);
|
||||||
|
dhtnetworksizeLabel->setVisible(false);
|
||||||
|
|
||||||
|
dhtnetworksizeLabel->setText("");
|
||||||
|
dhtnetworksizeLabel->setToolTip("");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (config.netDhtOk)
|
if (config.netDhtOk)
|
||||||
{
|
{
|
||||||
dhtstatusLabel->setPixmap(QPixmap(":/images/greenled.png"));
|
#define MIN_RS_NET_SIZE 10
|
||||||
dhtstatusLabel->setToolTip(tr("DHT On"));
|
// 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(true);
|
spaceLabel->setVisible(true);
|
||||||
dhtnetworkLabel->setVisible(true);
|
dhtnetworkLabel->setVisible(true);
|
||||||
@ -86,8 +105,25 @@ void DHTStatus::getDHTStatus()
|
|||||||
}
|
}
|
||||||
else
|
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->setPixmap(QPixmap(":/images/redled.png"));
|
||||||
dhtstatusLabel->setToolTip(tr("DHT Off"));
|
dhtstatusLabel->setToolTip(tr("DHT Error"));
|
||||||
|
|
||||||
spaceLabel->setVisible(false);
|
spaceLabel->setVisible(false);
|
||||||
dhtnetworkLabel->setVisible(false);
|
dhtnetworkLabel->setVisible(false);
|
||||||
@ -96,6 +132,7 @@ void DHTStatus::getDHTStatus()
|
|||||||
dhtnetworksizeLabel->setText("");
|
dhtnetworksizeLabel->setText("");
|
||||||
dhtnetworksizeLabel->setToolTip("");
|
dhtnetworksizeLabel->setToolTip("");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
rsiface->unlockData(); /* UnLock Interface */
|
rsiface->unlockData(); /* UnLock Interface */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user