added logic to stop/start FriendServer from GUI

This commit is contained in:
csoler 2021-10-29 21:44:30 +02:00
parent 19e42663a0
commit d948086b5e
7 changed files with 105 additions and 17 deletions

View file

@ -31,8 +31,6 @@
#include <iostream>
RsFriendServer *rsFriendServer = new RsFriendServer;
#define ICON_STATUS_UNKNOWN ":/images/ledoff1.png"
#define ICON_STATUS_OK ":/images/ledon1.png"
@ -44,6 +42,7 @@ FriendServerControl::FriendServerControl(QWidget *parent)
mConnectionCheckTimer = new QTimer;
QObject::connect(friendServerOnOff_CB,SIGNAL(toggled(bool)),this,SLOT(onOnOffClick(bool)));
QObject::connect(mConnectionCheckTimer,SIGNAL(timeout()),this,SLOT(checkServerAddress()));
QObject::connect(torServerAddress_LE,SIGNAL(textChanged(const QString&)),this,SLOT(onOnionAddressEdit(const QString&)));
@ -62,9 +61,9 @@ FriendServerControl::~FriendServerControl()
void FriendServerControl::onOnOffClick(bool b)
{
if(b)
rsFriendServer->start();
rsFriendServer->startServer();
else
rsFriendServer->stop();
rsFriendServer->stopServer();
}
void FriendServerControl::onOnionAddressEdit(const QString&)

View file

@ -12,7 +12,7 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="torServerOnOff_CB">
<widget class="QCheckBox" name="friendServerOnOff_CB">
<property name="text">
<string>On/Off</string>
</property>