CmEditorApplication.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include "CmEditorApplication.h"
  2. #include "CmLayoutManager.h"
  3. #include "CmEditorPrefs.h"
  4. #include "CmQtEditor.h"
  5. #include "CmQtProjectSelection.h"
  6. #include <QtWidgets/QApplication>
  7. namespace CamelotEditor
  8. {
  9. void EditorApplication::startUp()
  10. {
  11. EditorPrefs::startUp(new EditorPrefs());
  12. LayoutManager::startUp(new LayoutManager());
  13. }
  14. void EditorApplication::run()
  15. {
  16. int argc = 0;
  17. QApplication a(argc, nullptr);
  18. QtEditor w;
  19. w.show();
  20. QtProjectSelection projSelection;
  21. projSelection.onProjectSelected.connect(boost::bind(&EditorApplication::loadProject, this, _1));
  22. projSelection.exec();
  23. a.exec();
  24. }
  25. void EditorApplication::shutDown()
  26. {
  27. LayoutManager::shutDown();
  28. EditorPrefs::shutDown();
  29. }
  30. void EditorApplication::loadProject(const QString& projPath)
  31. {
  32. // TODO
  33. }
  34. void EditorApplication::createProject(const QString& projPath)
  35. {
  36. // TODO
  37. }
  38. bool EditorApplication::isValidProjectDirectory(const QString& projPath)
  39. {
  40. // TODO
  41. return true;
  42. }
  43. EditorApplication& gEditorApp()
  44. {
  45. static EditorApplication application;
  46. return application;
  47. }
  48. }