logic: iterated on license checking

- moved LicenseChecker from App to Lib project
- added MessageDispatchWhenLicenseValid. This message takes another message as an argument which is dispatched once the LicenseChecher confirms the current license key or (if the key is invalid) once the user entered a valid key. This message is used when messages are sent that should not be working when no license key has been entered (LoadProject or ActivateTokenLocation via the IDE communication).
- added MessageShowStartScreen which makes the MainView display this screen. This message is also sent via the MessageDispatchWhenLicenseValid.
- removed startup project from appsettings.
This commit is contained in:
malte_langkabel
2016-04-14 15:25:40 +02:00
parent a2cba0b94f
commit 73ee3a27d9
29 changed files with 406 additions and 333 deletions
@@ -6,6 +6,7 @@
#include "utility/messaging/type/MessageActivateTokenLocations.h"
#include "utility/messaging/type/MessageActivateWindow.h"
#include "utility/messaging/type/MessageDispatchWhenLicenseValid.h"
#include "utility/messaging/type/MessageLoadProject.h"
#include "utility/messaging/type/MessageProjectNew.h"
#include "utility/messaging/type/MessageStatus.h"
@@ -83,14 +84,14 @@ void IDECommunicationController::handleSetActiveTokenMessage(const NetworkProtoc
if (selectedLocationIds.size() > 0)
{
MessageStatus("Activating a source location from external succeeded.").dispatch();
MessageActivateTokenLocations(selectedLocationIds).dispatch();
MessageDispatchWhenLicenseValid(std::make_shared<MessageActivateTokenLocations>(selectedLocationIds)).dispatch();
MessageActivateWindow().dispatch();
}
else
{
MessageStatus(
"Activating a source location from external failed. No symbol(s) have been found at the selected location."
).dispatch();
).dispatch();
}
}
}
@@ -101,10 +102,10 @@ void IDECommunicationController::handleCreateProjectMessage(const NetworkProtoco
{
if (message.ideId == "vs")
{
MessageProjectNew msg;
msg.setSolutionPath(message.solutionFileLocation);
msg.ideId = message.ideId;
msg.dispatch();
std::shared_ptr<MessageProjectNew> msg = std::make_shared<MessageProjectNew>();
msg->setSolutionPath(message.solutionFileLocation);
msg->ideId = message.ideId;
MessageDispatchWhenLicenseValid(msg).dispatch();
}
else
{
@@ -125,4 +126,4 @@ void IDECommunicationController::handleMessage(MessageMoveIDECursor* message)
).dispatch();
sendMessage(networkMessage);
}
}