ProjectManagerWindow.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
  3. * its licensors.
  4. *
  5. * For complete copyright and license terms please see the LICENSE at the root of this
  6. * distribution (the "License"). All use of this software is governed by the License,
  7. * or, if provided, by the license below or the license accompanying this file. Do not
  8. * remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
  9. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. *
  11. */
  12. #include <ProjectManagerWindow.h>
  13. #include <ScreensCtrl.h>
  14. namespace O3DE::ProjectManager
  15. {
  16. ProjectManagerWindow::ProjectManagerWindow(QWidget* parent, const AZ::IO::PathView& projectPath, ProjectManagerScreen startScreen)
  17. : QMainWindow(parent)
  18. {
  19. setWindowTitle(tr("O3DE Project Manager"));
  20. ScreensCtrl* screensCtrl = new ScreensCtrl();
  21. // currently the tab order on the home page is based on the order of this list
  22. QVector<ProjectManagerScreen> screenEnums =
  23. {
  24. ProjectManagerScreen::Projects,
  25. ProjectManagerScreen::EngineSettings,
  26. ProjectManagerScreen::CreateProject,
  27. ProjectManagerScreen::UpdateProject
  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