Skip to content

Commit

Permalink
Added a setAutoReconnect method
Browse files Browse the repository at this point in the history
Fixed the example script
  • Loading branch information
Sven Gijsen committed Dec 7, 2015
1 parent 32a206b commit 9f17396
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/QScriptExample_TBVExchangerPlugin.qs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function KeyCaptureDetectFunction(keyCode)
{
KeyBoardCaptureObj.StopCaptureThread();
CleanupScript();//escape key
}
}
}

function CleanupScript() //Cleanup the script
Expand Down
10 changes: 10 additions & 0 deletions tbvexchanger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,14 @@ bool TBVExchanger::activateAutoConnection()
bool TBVExchanger::deactivateAutoConnection()
{
return tbvNetwIntFace->setAutoConnection(false);
}

bool TBVExchanger::activateAutoReconnect()
{
return tbvNetwIntFace->setAutoReconnect(true);
}

bool TBVExchanger::deactivateAutoReconnect()
{
return tbvNetwIntFace->setAutoReconnect(false);
}
11 changes: 11 additions & 0 deletions tbvexchanger.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,17 @@ public slots:
Deactivates the automatic connect functionality.
*/
bool deactivateAutoConnection();
//! activateAutoConnection slot.
/*!
Activates the automatic Reconnect functionality to connect to a TBV server if available and accessible.
*/
bool activateAutoReconnect();
//! deactivateAutoReconnect slot.
/*!
Deactivates the automatic Reconnect functionality.
*/
bool deactivateAutoReconnect();


private:
bool initialize(bool autoConnect, bool autoReconnect);
Expand Down
6 changes: 6 additions & 0 deletions tbvnetworkinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,3 +1007,9 @@ void TBVNetworkInterface::writeError(QAbstractSocket::SocketError Error)
}

}

bool TBVNetworkInterface::setAutoReconnect(bool setting)
{
reConnect = setting;
return true;
}
1 change: 1 addition & 0 deletions tbvnetworkinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class TBVNetworkInterface : public QThread
bool isConnected();

bool setAutoConnection(bool setting);
bool setAutoReconnect(bool setting);

private:
quint16 nDefaultPort;
Expand Down

0 comments on commit 9f17396

Please sign in to comment.