mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-23 13:51:12 -05:00
Merge pull request #2552 from csoler/v0.6-FriendServer2
added a msg in console when FS is ready
This commit is contained in:
commit
2548ef29fb
@ -1 +1 @@
|
||||
Subproject commit f708e893a0cc7d195a53566342bd213973c70176
|
||||
Subproject commit a7a430008b76e53727598c4d13106e7ce95221d7
|
@ -98,6 +98,14 @@ int main(int argc, char* argv[])
|
||||
FriendServer fs(base_directory,service_target_address,target_port);
|
||||
fs.start();
|
||||
|
||||
RsDbg() << "";
|
||||
RsDbg() << "================== Retroshare Friend Server has properly started =====================" ;
|
||||
RsDbg() << "= =";
|
||||
RsDbg() << "= Address:Port " << onion_address << ":" << service_port << ((service_port<10000)?" ":"") << " =";
|
||||
RsDbg() << "= =";
|
||||
RsDbg() << "======================================================================================" ;
|
||||
RsDbg() << "";
|
||||
|
||||
while(fs.isRunning())
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
|
||||
|
@ -61,6 +61,7 @@ FriendServerControl::FriendServerControl(QWidget *parent)
|
||||
QObject::connect(friendServerOnOff_CB,SIGNAL(toggled(bool)),this,SLOT(onOnOffClick(bool)));
|
||||
QObject::connect(torServerFriendsToRequest_SB,SIGNAL(valueChanged(int)),this,SLOT(onFriendsToRequestChanged(int)));
|
||||
QObject::connect(torServerAddress_LE,SIGNAL(textChanged(const QString&)),this,SLOT(onOnionAddressEdit(const QString&)));
|
||||
QObject::connect(torServerPort_SB,SIGNAL(valueChanged(int)),this,SLOT(onOnionPortEdit(int)));
|
||||
|
||||
QObject::connect(mConnectionCheckTimer,SIGNAL(timeout()),this,SLOT(checkServerAddress()));
|
||||
|
||||
@ -97,50 +98,46 @@ void FriendServerControl::onOnOffClick(bool b)
|
||||
}
|
||||
void FriendServerControl::onOnionPortEdit(int)
|
||||
{
|
||||
#warning TODO
|
||||
// // Setup timer to auto-check the friend server address
|
||||
//
|
||||
// mConnectionCheckTimer->setSingleShot(true);
|
||||
// mConnectionCheckTimer->setInterval(5000); // check in 5 secs unless something is changed in the mean time.
|
||||
//
|
||||
// mConnectionCheckTimer->start();
|
||||
//
|
||||
// if(mCheckingServerMovie->fileName() != QString(":/images/loader/circleball-16.gif" ))
|
||||
// {
|
||||
// mCheckingServerMovie->setFileName(":/images/loader/circleball-16.gif");
|
||||
// mCheckingServerMovie->start();
|
||||
// }
|
||||
rsFriendServer->setServerAddress(torServerAddress_LE->text().toStdString(),torServerPort_SB->value());
|
||||
rsFriendServer->setProxyAddress(torProxyAddress_LE->text().toStdString(),torProxyPort_SB->value());
|
||||
// Setup timer to auto-check the friend server address
|
||||
|
||||
mConnectionCheckTimer->stop();
|
||||
mConnectionCheckTimer->setSingleShot(true);
|
||||
mConnectionCheckTimer->setInterval(5000); // check in 5 secs unless something is changed in the mean time.
|
||||
|
||||
mConnectionCheckTimer->start();
|
||||
|
||||
if(mCheckingServerMovie->fileName() != QString(":/images/loader/circleball-16.gif" ))
|
||||
{
|
||||
mCheckingServerMovie->setFileName(":/images/loader/circleball-16.gif");
|
||||
mCheckingServerMovie->start();
|
||||
}
|
||||
}
|
||||
|
||||
void FriendServerControl::onOnionAddressEdit(const QString&)
|
||||
{
|
||||
// Setup timer to auto-check the friend server address
|
||||
mConnectionCheckTimer->stop();
|
||||
mConnectionCheckTimer->setSingleShot(true);
|
||||
mConnectionCheckTimer->setInterval(5000); // check in 5 secs unless something is changed in the mean time.
|
||||
|
||||
// mConnectionCheckTimer->setSingleShot(true);
|
||||
// mConnectionCheckTimer->setInterval(5000); // check in 5 secs unless something is changed in the mean time.
|
||||
//
|
||||
// mConnectionCheckTimer->start();
|
||||
//
|
||||
// if(mCheckingServerMovie->fileName() != QString(":/images/loader/circleball-16.gif" ))
|
||||
// {
|
||||
// mCheckingServerMovie->setFileName(":/images/loader/circleball-16.gif");
|
||||
// mCheckingServerMovie->start();
|
||||
// }
|
||||
rsFriendServer->setServerAddress(torServerAddress_LE->text().toStdString(),torServerPort_SB->value());
|
||||
rsFriendServer->setProxyAddress(torProxyAddress_LE->text().toStdString(),torProxyPort_SB->value());
|
||||
mConnectionCheckTimer->start();
|
||||
|
||||
if(mCheckingServerMovie->fileName() != QString(":/images/loader/circleball-16.gif" ))
|
||||
{
|
||||
mCheckingServerMovie->setFileName(":/images/loader/circleball-16.gif");
|
||||
mCheckingServerMovie->start();
|
||||
}
|
||||
}
|
||||
|
||||
void FriendServerControl::checkServerAddress()
|
||||
{
|
||||
rsFriendServer->checkServerAddress_async(torServerAddress_LE->text().toStdString(),torServerPort_SB->value(),
|
||||
[this](const std::string& address,bool test_result)
|
||||
rsFriendServer->checkServerAddress_async(torServerAddress_LE->text().toStdString(),torServerPort_SB->value(),5000,
|
||||
[this](const std::string& address,uint16_t port,bool test_result)
|
||||
{
|
||||
if(test_result)
|
||||
rsFriendServer->setServerAddress(address,1729);
|
||||
rsFriendServer->setServerAddress(address,port);
|
||||
|
||||
RsQThreadUtils::postToObject( [=]() { updateFriendServerStatusIcon(test_result); },this);
|
||||
RsQThreadUtils::postToObject( [=]() { updateFriendServerStatusIcon(test_result); },this);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -38,9 +38,9 @@ protected slots:
|
||||
void onOnionPortEdit(int);
|
||||
void onNbFriendsToRequestsChanged(int n);
|
||||
void updateTorProxyInfo();
|
||||
void checkServerAddress();
|
||||
|
||||
private:
|
||||
void checkServerAddress();
|
||||
void updateFriendServerStatusIcon(bool ok);
|
||||
|
||||
QTimer *mConnectionCheckTimer;
|
||||
|
@ -1088,6 +1088,7 @@ DEFINES *= CHANNELS_FRAME_CATCHER
|
||||
# Embedded Friend Server
|
||||
|
||||
rs_efs {
|
||||
DEFINES *= RS_EMBEDED_FRIEND_SERVER
|
||||
SOURCES += gui/FriendServerControl.cpp
|
||||
HEADERS += gui/FriendServerControl.h
|
||||
FORMS += gui/FriendServerControl.ui
|
||||
|
Loading…
Reference in New Issue
Block a user