mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 23:49:35 -05:00
Merge pull request #2655 from RetroPooh/tor-status-fix
tor status fix for unconfigured, add update on settings change; fix i2p out led status
This commit is contained in:
commit
b3dba19b72
@ -1628,6 +1628,10 @@ NATStatus *MainWindow::natstatusInstance()
|
||||
return natstatus;
|
||||
}
|
||||
|
||||
void MainWindow::torstatusReset()
|
||||
{
|
||||
torstatus->reset();
|
||||
}
|
||||
DHTStatus *MainWindow::dhtstatusInstance()
|
||||
{
|
||||
return dhtstatus;
|
||||
|
@ -187,6 +187,7 @@ public:
|
||||
RSComboBox *statusComboBoxInstance();
|
||||
PeerStatus *peerstatusInstance();
|
||||
NATStatus *natstatusInstance();
|
||||
void torstatusReset();
|
||||
DHTStatus *dhtstatusInstance();
|
||||
HashingStatus *hashingstatusInstance();
|
||||
DiscStatus *discstatusInstance();
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "ServerPage.h"
|
||||
|
||||
#include <gui/notifyqt.h>
|
||||
#include "gui/MainWindow.h"
|
||||
#include "rshare.h"
|
||||
#include "rsharesettings.h"
|
||||
#include "util/i2pcommon.h"
|
||||
@ -1366,6 +1367,7 @@ void ServerPage::saveAddressesHiddenNode()
|
||||
|
||||
void ServerPage::updateOutProxyIndicator()
|
||||
{
|
||||
MainWindow::getInstance()->torstatusReset();
|
||||
QTcpSocket socket ;
|
||||
|
||||
// Tor
|
||||
@ -1382,22 +1384,39 @@ void ServerPage::updateOutProxyIndicator()
|
||||
ui.iconlabel_tor_outgoing->setToolTip(tr("Tor proxy is not enabled")) ;
|
||||
}
|
||||
|
||||
// I2P - SAM
|
||||
// Note: there is only "the SAM port", there is no additional proxy port!
|
||||
samStatus ss;
|
||||
rsAutoProxyMonitor::taskSync(autoProxyType::I2PSAM3, autoProxyTask::status, &ss);
|
||||
if(ss.state == samStatus::samState::online)
|
||||
if (mHiddenType == RS_HIDDEN_TYPE_I2P && mSamSettings.enable)
|
||||
{
|
||||
socket.disconnectFromHost();
|
||||
ui.iconlabel_i2p_outgoing->setPixmap(FilesDefs::getPixmapFromQtResourcePath(ICON_STATUS_OK)) ;
|
||||
ui.iconlabel_i2p_outgoing->setToolTip(tr("Proxy seems to work.")) ;
|
||||
// I2P - SAM
|
||||
// Note: there is only "the SAM port", there is no additional proxy port!
|
||||
samStatus ss;
|
||||
rsAutoProxyMonitor::taskSync(autoProxyType::I2PSAM3, autoProxyTask::status, &ss);
|
||||
if(ss.state == samStatus::samState::online)
|
||||
{
|
||||
socket.disconnectFromHost();
|
||||
ui.iconlabel_i2p_outgoing->setPixmap(FilesDefs::getPixmapFromQtResourcePath(ICON_STATUS_OK)) ;
|
||||
ui.iconlabel_i2p_outgoing->setToolTip(tr("Proxy seems to work.")) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.iconlabel_i2p_outgoing->setPixmap(FilesDefs::getPixmapFromQtResourcePath(ICON_STATUS_UNKNOWN)) ;
|
||||
ui.iconlabel_i2p_outgoing->setToolTip(tr("I2P proxy is not enabled")) ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.iconlabel_i2p_outgoing->setPixmap(FilesDefs::getPixmapFromQtResourcePath(ICON_STATUS_UNKNOWN)) ;
|
||||
ui.iconlabel_i2p_outgoing->setToolTip(tr("I2P proxy is not enabled")) ;
|
||||
socket.connectToHost(ui.hiddenpage_proxyAddress_i2p->text(),ui.hiddenpage_proxyPort_i2p->text().toInt());
|
||||
if(socket.waitForConnected(500))
|
||||
{
|
||||
socket.disconnectFromHost();
|
||||
ui.iconlabel_i2p_outgoing->setPixmap(FilesDefs::getPixmapFromQtResourcePath(ICON_STATUS_OK)) ;
|
||||
ui.iconlabel_i2p_outgoing->setToolTip(tr("Proxy seems to work.")) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.iconlabel_i2p_outgoing->setPixmap(FilesDefs::getPixmapFromQtResourcePath(ICON_STATUS_UNKNOWN)) ;
|
||||
ui.iconlabel_i2p_outgoing->setToolTip(tr("I2P proxy is not enabled")) ;
|
||||
}
|
||||
}
|
||||
|
||||
socket.connectToHost(ui.hiddenpage_proxyAddress_i2p_2->text(), 7656);
|
||||
if(true == (mSamAccessible = socket.waitForConnected(1000)))
|
||||
{
|
||||
|
@ -168,7 +168,7 @@ void TorStatus::getTorStatus()
|
||||
torstatusLabel->setToolTip( text + tr("Tor proxy is not available"));
|
||||
}
|
||||
}
|
||||
if(hiddentype == RS_HIDDEN_TYPE_I2P)
|
||||
else if(hiddentype == RS_HIDDEN_TYPE_I2P)
|
||||
{
|
||||
statusTor->setText("<strong>" + tr("I2P") + ":</strong>");
|
||||
rsPeers->getProxyServer(RS_HIDDEN_TYPE_I2P, proxyaddr, proxyport, status);
|
||||
@ -185,6 +185,11 @@ void TorStatus::getTorStatus()
|
||||
torstatusLabel->setToolTip( text + tr("i2p proxy is not available"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
torstatusLabel->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":/icons/tile_inactive_48.png").scaledToHeight(S,Qt::SmoothTransformation));
|
||||
torstatusLabel->setToolTip(tr("No tor configuration"));
|
||||
}
|
||||
_updated = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user