This change puts the initial project loading into a MessageLoadProject so that the UI thread is still responding. Also the StatusBar is now responding to more Messages and it's MessageListeners get added to the MessageQueue in front of other listeners so that the StatusBar UI can announce actions.
52 lines
1.5 KiB
C++
52 lines
1.5 KiB
C++
#ifndef APPLICATION_H
|
|
#define APPLICATION_H
|
|
|
|
#include <memory>
|
|
|
|
#include "component/ComponentManager.h"
|
|
#include "Project.h"
|
|
#include "utility/messaging/MessageListener.h"
|
|
#include "utility/messaging/type/MessageLoadProject.h"
|
|
#include "utility/messaging/type/MessageLoadSource.h"
|
|
#include "utility/messaging/type/MessageRefresh.h"
|
|
#include "utility/messaging/type/MessageSaveProject.h"
|
|
|
|
class ViewFactory;
|
|
class MainView;
|
|
class GraphAccessProxy;
|
|
class LocationAccessProxy;
|
|
|
|
class Application
|
|
: public MessageListener<MessageLoadProject>
|
|
, public MessageListener<MessageLoadSource>
|
|
, public MessageListener<MessageRefresh>
|
|
, public MessageListener<MessageSaveProject>
|
|
{
|
|
public:
|
|
static std::shared_ptr<Application> create(ViewFactory* viewFactory);
|
|
|
|
~Application();
|
|
|
|
void loadProject(const std::string& projectSettingsFilePath);
|
|
void loadSource(const std::string& sourceDirectoryPath);
|
|
void saveProject(const std::string& projectSettingsFilePath);
|
|
void reloadProject();
|
|
|
|
private:
|
|
Application();
|
|
|
|
virtual void handleMessage(MessageLoadProject* message);
|
|
virtual void handleMessage(MessageLoadSource* message);
|
|
virtual void handleMessage(MessageRefresh* message);
|
|
virtual void handleMessage(MessageSaveProject* message);
|
|
|
|
std::shared_ptr<Project> m_project;
|
|
std::shared_ptr<GraphAccessProxy> m_graphAccessProxy;
|
|
std::shared_ptr<LocationAccessProxy> m_locationAccessProxy;
|
|
|
|
std::shared_ptr<MainView> m_mainView;
|
|
std::shared_ptr<ComponentManager> m_componentManager;
|
|
};
|
|
|
|
#endif // APPLICATION_H
|