ui: Added plugin ports to preferences
bug id = 145
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "component/view/DialogView.h"
|
||||
#include "component/view/GraphViewStyle.h"
|
||||
#include "component/controller/NetworkFactory.h"
|
||||
#include "component/controller/IDECommunicationController.h"
|
||||
#include "component/view/MainView.h"
|
||||
#include "component/view/ViewFactory.h"
|
||||
#include "data/StorageCache.h"
|
||||
@@ -55,6 +56,7 @@ void Application::createInstance(
|
||||
{
|
||||
s_instance->m_ideCommunicationController =
|
||||
networkFactory->createIDECommunicationController(s_instance->m_storageCache.get());
|
||||
s_instance->m_ideCommunicationController->startListening();
|
||||
}
|
||||
|
||||
s_instance->startMessagingAndScheduling();
|
||||
|
||||
@@ -271,6 +271,7 @@ add_files(
|
||||
utility/messaging/type/MessageInterruptTasks.h
|
||||
utility/messaging/type/MessageLoadProject.h
|
||||
utility/messaging/type/MessageMoveIDECursor.h
|
||||
utility/messaging/type/MessagePluginPortChange.h
|
||||
utility/messaging/type/MessageProjectEdit.h
|
||||
utility/messaging/type/MessageProjectNew.h
|
||||
utility/messaging/type/MessageRedo.h
|
||||
|
||||
@@ -152,3 +152,9 @@ void IDECommunicationController::handleMessage(MessageMoveIDECursor* message)
|
||||
|
||||
sendMessage(networkMessage);
|
||||
}
|
||||
|
||||
void IDECommunicationController::handleMessage(MessagePluginPortChange* message)
|
||||
{
|
||||
stopListening();
|
||||
startListening();
|
||||
}
|
||||
|
||||
@@ -4,17 +4,18 @@
|
||||
#include <string>
|
||||
|
||||
#include "component/controller/Controller.h"
|
||||
|
||||
#include "component/controller/helper/NetworkProtocolHelper.h"
|
||||
|
||||
#include "utility/messaging/MessageListener.h"
|
||||
#include "utility/messaging/type/MessageMoveIDECursor.h"
|
||||
#include "utility/messaging/type/MessagePluginPortChange.h"
|
||||
|
||||
class StorageAccess;
|
||||
|
||||
class IDECommunicationController
|
||||
: public Controller
|
||||
, public MessageListener<MessageMoveIDECursor>
|
||||
, public MessageListener<MessagePluginPortChange>
|
||||
{
|
||||
public:
|
||||
IDECommunicationController(StorageAccess* storageAccess);
|
||||
@@ -22,18 +23,21 @@ public:
|
||||
|
||||
virtual void clear();
|
||||
|
||||
virtual void startListening() = 0;
|
||||
virtual void stopListening() = 0;
|
||||
virtual bool isListening() const = 0;
|
||||
|
||||
void handleIncomingMessage(const std::string& message);
|
||||
|
||||
bool getEnabled() const;
|
||||
void setEnabled(const bool enabled);
|
||||
|
||||
virtual bool isListening() const = 0;
|
||||
|
||||
private:
|
||||
void handleSetActiveTokenMessage(const NetworkProtocolHelper::SetActiveTokenMessage& message);
|
||||
void handleCreateProjectMessage(const NetworkProtocolHelper::CreateProjectMessage& message);
|
||||
|
||||
virtual void handleMessage(MessageMoveIDECursor* message);
|
||||
virtual void handleMessage(MessagePluginPortChange* message);
|
||||
virtual void sendMessage(const std::string& message) const = 0;
|
||||
|
||||
StorageAccess* m_storageAccess;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef MESSAGE_PLUGIN_PORT_CHANGE_H
|
||||
#define MESSAGE_PLUGIN_PORT_CHANGE_H
|
||||
|
||||
#include "utility/messaging/Message.h"
|
||||
|
||||
class MessagePluginPortChange
|
||||
: public Message<MessagePluginPortChange>
|
||||
{
|
||||
public:
|
||||
MessagePluginPortChange()
|
||||
{
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessagePluginPortChange";
|
||||
}
|
||||
};
|
||||
|
||||
#endif // MESSAGE_PLUGIN_PORT_CHANGE_H
|
||||
Reference in New Issue
Block a user