ProjectManagerWindow.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <ProjectManagerWindow.h>
  9. #include <ScreensCtrl.h>
  10. #include <DownloadController.h>
  11. namespace O3DE::ProjectManager
  12. {
  13. ProjectManagerWindow::ProjectManagerWindow(QWidget* parent, const AZ::IO::PathView& projectPath, ProjectManagerScreen startScreen)
  14. : QMainWindow(parent)
  15. {
  16. setWindowTitle(tr("O3DE Project Manager"));
  17. m_downloadController = new DownloadController();
  18. ScreensCtrl* screensCtrl = new ScreensCtrl(nullptr, m_downloadController);
  19. // currently the tab order on the home page is based on the order of this list
  20. QVector<ProjectManagerScreen> screenEnums =
  21. {
  22. ProjectManagerScreen::Projects,
  23. ProjectManagerScreen::GemCatalog,
  24. ProjectManagerScreen::Engine,
  25. ProjectManagerScreen::CreateProject,
  26. ProjectManagerScreen::UpdateProject,
  27. ProjectManagerScreen::GemsGemRepos
  28. };
  29. screensCtrl->BuildScreens(screenEnums);
  30. setCentralWidget(screensCtrl);
  31. // always push the projects screen first so we have something to come back to
  32. if (startScreen != ProjectManagerScreen::Projects)
  33. {
  34. screensCtrl->ForceChangeToScreen(ProjectManagerScreen::Projects);
  35. }
  36. screensCtrl->ForceChangeToScreen(startScreen);
  37. if (!projectPath.empty())
  38. {
  39. const QString path = QString::fromUtf8(projectPath.Native().data(), aznumeric_cast<int>(projectPath.Native().size()));
  40. emit screensCtrl->NotifyCurrentProject(path);
  41. }
  42. }
  43. } // namespace O3DE::ProjectManager