ui: save and load view layout
* QtMainWindow now saves and loads its layout parameters.
This commit is contained in:
@@ -27,6 +27,7 @@ std::shared_ptr<Application> Application::create(GuiFactory* guiFactory)
|
||||
guiFactory, ptr->m_mainView.get(), ptr->m_graphAccessProxy.get(), ptr->m_locationAccessProxy.get());
|
||||
|
||||
ptr->m_componentManager->setup();
|
||||
ptr->m_mainView->loadLayout();
|
||||
|
||||
return ptr;
|
||||
}
|
||||
@@ -39,6 +40,7 @@ Application::Application()
|
||||
Application::~Application()
|
||||
{
|
||||
MessageQueue::getInstance()->stopMessageLoop();
|
||||
m_mainView->saveLayout();
|
||||
}
|
||||
|
||||
void Application::loadProject(const std::string& projectSettingsFilePath)
|
||||
|
||||
@@ -22,12 +22,6 @@ ComponentManager::~ComponentManager()
|
||||
void ComponentManager::setup()
|
||||
{
|
||||
std::shared_ptr<Component> graphComponent = m_componentFactory->createGraphComponent();
|
||||
|
||||
GraphView* graphView = graphComponent->getView<GraphView>();
|
||||
/*std::weak_ptr<GraphNode> node0 = graphView->addNode(Vec2i(-50, -50), "foo");
|
||||
graphView->addEdge(node0, graphView->addNode(Vec2i(100, 100), "bar"));
|
||||
graphView->addEdge(node0, graphView->addNode(Vec2i(50, -50), "war production co-ordinating commitee"));*/
|
||||
|
||||
m_components.push_back(graphComponent);
|
||||
|
||||
std::shared_ptr<Component> codeComponent = m_componentFactory->createCodeComponent();
|
||||
|
||||
@@ -11,6 +11,9 @@ public:
|
||||
|
||||
virtual void addView(View* view) = 0;
|
||||
virtual void removeView(View* view) = 0;
|
||||
|
||||
virtual void loadLayout() = 0;
|
||||
virtual void saveLayout() = 0;
|
||||
};
|
||||
|
||||
#endif // VIEW_LAYOUT_H
|
||||
|
||||
Reference in New Issue
Block a user