ui: save and load view layout

* QtMainWindow now saves and loads its layout parameters.
This commit is contained in:
malte_langkabel
2014-07-16 13:48:40 +02:00
parent 810ed7c064
commit 886171cb2a
8 changed files with 78 additions and 6 deletions
+2
View File
@@ -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)
-6
View File
@@ -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();
+3
View File
@@ -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