ui: Prevent network message handling without valid licence

Message by the ide com. controller are now caught by the licence checker to prevent them from causing trouble when waiting for the licence.

bug id = 45
This commit is contained in:
Manuel Dobusch
2016-03-02 18:50:20 +01:00
parent 612e12b35f
commit 8b4b4bb027
4 changed files with 235 additions and 1 deletions
@@ -15,6 +15,7 @@
IDECommunicationController::IDECommunicationController(StorageAccess* storageAccess)
: m_storageAccess(storageAccess)
, m_enabled(true)
{
}
@@ -24,6 +25,11 @@ IDECommunicationController::~IDECommunicationController()
void IDECommunicationController::handleIncomingMessage(const std::string& message)
{
if (m_enabled == false)
{
return;
}
NetworkProtocolHelper::MESSAGE_TYPE type = NetworkProtocolHelper::getMessageType(message);
if (type == NetworkProtocolHelper::MESSAGE_TYPE::UNKNOWN)
@@ -40,6 +46,16 @@ void IDECommunicationController::handleIncomingMessage(const std::string& messag
}
}
bool IDECommunicationController::getEnabled() const
{
return m_enabled;
}
void IDECommunicationController::setEnabled(const bool enabled)
{
m_enabled = enabled;
}
void IDECommunicationController::handleSetActiveTokenMessage(const NetworkProtocolHelper::SetActiveTokenMessage& message)
{
if (message.valid)