mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
partly fixed TOR status page (patch from Sehraf)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8109 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
65da6090fe
commit
e9c6b3da73
@ -234,16 +234,7 @@ void ServerPage::load()
|
||||
ui.torpage_proxyAddress -> setText(QString::fromStdString(proxyaddr));
|
||||
ui.torpage_proxyPort -> setValue(proxyport);
|
||||
|
||||
if(status & RS_NET_PROXY_STATUS_OK)
|
||||
{
|
||||
ui.iconlabel_tor_outgoing->setPixmap(QPixmap(ICON_STATUS_OK)) ;
|
||||
ui.iconlabel_tor_outgoing->setToolTip(tr("TOR proxy is working correctly")) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.iconlabel_tor_outgoing->setPixmap(QPixmap(ICON_STATUS_UNKNOWN)) ;
|
||||
ui.iconlabel_tor_outgoing->setToolTip(tr("TOR status unknown")) ;
|
||||
}
|
||||
updateTorOutProxyIndicator();
|
||||
}
|
||||
|
||||
void ServerPage::toggleTurtleRouting(bool b)
|
||||
@ -314,24 +305,7 @@ void ServerPage::updateStatus()
|
||||
ui.iconlabel_ext->setPixmap(QPixmap(":/images/ledoff1.png"));
|
||||
|
||||
// check for TOR
|
||||
|
||||
QTcpSocket socket ;
|
||||
socket.connectToHost(ui.torpage_proxyAddress->text(),ui.torpage_proxyPort->text().toInt());
|
||||
|
||||
if(socket.waitForConnected(500))
|
||||
{
|
||||
std::cerr << "connected !" << std::endl;
|
||||
|
||||
socket.disconnectFromHost();
|
||||
|
||||
ui.iconlabel_tor_outgoing->setPixmap(QPixmap(ICON_STATUS_OK)) ;
|
||||
ui.iconlabel_tor_outgoing->setToolTip(tr("Proxy seems to work.")) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.iconlabel_tor_outgoing->setPixmap(QPixmap(ICON_STATUS_UNKNOWN)) ;
|
||||
ui.iconlabel_tor_outgoing->setToolTip(tr("TOR proxy is not enabled")) ;
|
||||
}
|
||||
updateTorOutProxyIndicator();
|
||||
}
|
||||
|
||||
void ServerPage::toggleUPnP()
|
||||
@ -572,6 +546,8 @@ void ServerPage::loadHiddenNode()
|
||||
ui.torpage_proxyAddress -> setText(QString::fromStdString(proxyaddr));
|
||||
ui.torpage_proxyPort -> setValue(proxyport);
|
||||
|
||||
updateTorOutProxyIndicator();
|
||||
|
||||
QString expected = "HiddenServiceDir </your/path/to/hidden/directory/service>\n";
|
||||
expected += "HiddenServicePort ";
|
||||
expected += QString::number(detail.hiddenNodePort);
|
||||
@ -636,6 +612,7 @@ void ServerPage::updateStatusHiddenNode()
|
||||
|
||||
#endif
|
||||
|
||||
updateTorOutProxyIndicator();
|
||||
}
|
||||
|
||||
void ServerPage::saveAddressesHiddenNode()
|
||||
@ -697,3 +674,24 @@ void ServerPage::saveAddressesHiddenNode()
|
||||
load();
|
||||
}
|
||||
|
||||
void ServerPage::updateTorOutProxyIndicator()
|
||||
{
|
||||
QTcpSocket socket ;
|
||||
socket.connectToHost(ui.torpage_proxyAddress->text(),ui.torpage_proxyPort->text().toInt());
|
||||
|
||||
if(socket.waitForConnected(500))
|
||||
{
|
||||
std::cerr << "connected !" << std::endl;
|
||||
|
||||
socket.disconnectFromHost();
|
||||
|
||||
ui.iconlabel_tor_outgoing->setPixmap(QPixmap(ICON_STATUS_OK)) ;
|
||||
ui.iconlabel_tor_outgoing->setToolTip(tr("Proxy seems to work.")) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.iconlabel_tor_outgoing->setPixmap(QPixmap(ICON_STATUS_UNKNOWN)) ;
|
||||
ui.iconlabel_tor_outgoing->setToolTip(tr("TOR proxy is not enabled")) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,6 +61,7 @@ private:
|
||||
void loadHiddenNode();
|
||||
void updateStatusHiddenNode();
|
||||
void saveAddressesHiddenNode();
|
||||
void updateTorOutProxyIndicator();
|
||||
|
||||
|
||||
Ui::ServerPage ui;
|
||||
|
Loading…
Reference in New Issue
Block a user