diff --git a/Code/Tools/ProjectManager/CMakeLists.txt b/Code/Tools/ProjectManager/CMakeLists.txt index 8315ef831c..0961acd354 100644 --- a/Code/Tools/ProjectManager/CMakeLists.txt +++ b/Code/Tools/ProjectManager/CMakeLists.txt @@ -38,4 +38,4 @@ ly_add_target( AZ::AzFramework AZ::AzToolsFramework AZ::AzQtComponents -) +) \ No newline at end of file diff --git a/Code/Tools/ProjectManager/Qt/ProjectManagerWindow.cpp b/Code/Tools/ProjectManager/Qt/ProjectManagerWindow.cpp deleted file mode 100644 index 4a8486f877..0000000000 --- a/Code/Tools/ProjectManager/Qt/ProjectManagerWindow.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - * its licensors. - * - * For complete copyright and license terms please see the LICENSE at the root of this - * distribution (the "License"). All use of this software is governed by the License, - * or, if provided, by the license below or the license accompanying this file. Do not - * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * - */ - -#include -#include - -#include -#include - -#include - -#include - -namespace ProjectManager -{ - ProjectManagerWindow::ProjectManagerWindow(QWidget* parent, const AZ::IO::PathView& engineRootPath) - : QMainWindow(parent) - , m_ui(new Ui::ProjectManagerWindowClass()) - { - m_ui->setupUi(this); - - QDir rootDir = QString::fromUtf8(engineRootPath.Native().data(), aznumeric_cast(engineRootPath.Native().size())); - const auto pathOnDisk = rootDir.absoluteFilePath("Code/Tools/ProjectManager/Resources"); - const auto qrcPath = QStringLiteral(":/ProjectManagerWindow"); - AzQtComponents::StyleManager::addSearchPaths("projectmanagerwindow", pathOnDisk, qrcPath, engineRootPath); - - AzQtComponents::StyleManager::setStyleSheet(this, QStringLiteral("projectlauncherwindow:ProjectManagerWindow.qss")); - - - FirstTimeUse* firstTimeUse = new FirstTimeUse(m_ui->centralwidget); - - firstTimeUse->show(); - } - - ProjectManagerWindow::~ProjectManagerWindow() - { - } - - //#include -} // namespace ProjectManager diff --git a/Code/Tools/ProjectManager/project_manager_files.cmake b/Code/Tools/ProjectManager/project_manager_files.cmake index 4d36550e56..0616b28e1e 100644 --- a/Code/Tools/ProjectManager/project_manager_files.cmake +++ b/Code/Tools/ProjectManager/project_manager_files.cmake @@ -12,10 +12,29 @@ set(FILES project_manager.qrc source/main.cpp - Qt/FirstTimeUse.h - Qt/FirstTimeUse.cpp - Qt/FirstTimeUse.ui - Qt/ProjectManagerWindow.h - Qt/ProjectManagerWindow.cpp - Qt/ProjectManagerWindow.ui -) + source/ScreenDefs.h + source/ScreenFactory.h + source/ScreenFactory.cpp + source/Qt/ScreenWidget.h + source/Qt/FirstTimeUse.h + source/Qt/FirstTimeUse.cpp + source/Qt/FirstTimeUse.ui + source/Qt/ProjectManagerWindow.h + source/Qt/ProjectManagerWindow.cpp + source/Qt/ProjectManagerWindow.ui + source/Qt/NewProjectSettings.h + source/Qt/NewProjectSettings.cpp + source/Qt/NewProjectSettings.ui + source/Qt/GemCatalog.h + source/Qt/GemCatalog.cpp + source/Qt/GemCatalog.ui + source/Qt/ProjectsHome.h + source/Qt/ProjectsHome.cpp + source/Qt/ProjectsHome.ui + source/Qt/ProjectSettings.h + source/Qt/ProjectSettings.cpp + source/Qt/ProjectSettings.ui + source/Qt/EngineSettings.h + source/Qt/EngineSettings.cpp + source/Qt/EngineSettings.ui +) \ No newline at end of file diff --git a/Code/Tools/ProjectManager/source/Qt/EngineSettings.cpp b/Code/Tools/ProjectManager/source/Qt/EngineSettings.cpp new file mode 100644 index 0000000000..03040781f7 --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/EngineSettings.cpp @@ -0,0 +1,35 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include + +#include + +namespace O3DE::ProjectManager +{ + EngineSettings::EngineSettings(ProjectManagerWindow* window) + : ScreenWidget(window) + , m_ui(new Ui::EngineSettingsClass()) + { + m_ui->setupUi(this); + } + + EngineSettings::~EngineSettings() + { + } + + void EngineSettings::ConnectSlotsAndSignals() + { + // Do nothing for now + } + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/source/Qt/EngineSettings.h b/Code/Tools/ProjectManager/source/Qt/EngineSettings.h new file mode 100644 index 0000000000..5f2aa5310a --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/EngineSettings.h @@ -0,0 +1,39 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ +#pragma once + +#if !defined(Q_MOC_RUN) +#include +#endif + +namespace Ui +{ + class EngineSettingsClass; +} + +namespace O3DE::ProjectManager +{ + class EngineSettings + : public ScreenWidget + { + public: + explicit EngineSettings(ProjectManagerWindow* window); + ~EngineSettings(); + + protected: + void ConnectSlotsAndSignals() override; + + private: + QScopedPointer m_ui; + }; + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/source/Qt/EngineSettings.ui b/Code/Tools/ProjectManager/source/Qt/EngineSettings.ui new file mode 100644 index 0000000000..c8fda8bfd7 --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/EngineSettings.ui @@ -0,0 +1,82 @@ + + + EngineSettingsClass + + + + 0 + 0 + 839 + 597 + + + + Form + + + + + + O3DE Settings + + + + + + + Engine Version + + + + + + + v1.01 + + + + + + + 3rd Party Software Folder + + + + + + + + + + Restricted Folder + + + + + + + + + + Default Gems Folder + + + + + + + + + + Default Project Templates Folder + + + + + + + + + + + diff --git a/Code/Tools/ProjectManager/source/Qt/FirstTimeUse.cpp b/Code/Tools/ProjectManager/source/Qt/FirstTimeUse.cpp new file mode 100644 index 0000000000..9ba4eba2a6 --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/FirstTimeUse.cpp @@ -0,0 +1,47 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include + +#include + +namespace O3DE::ProjectManager +{ + FirstTimeUse::FirstTimeUse(ProjectManagerWindow* window) + : ScreenWidget(window) + , m_ui(new Ui::FirstTimeUseClass()) + { + m_ui->setupUi(this); + + ConnectSlotsAndSignals(); + } + + FirstTimeUse::~FirstTimeUse() + { + } + + void FirstTimeUse::ConnectSlotsAndSignals() + { + QObject::connect(m_ui->createProjectButton, &QPushButton::pressed, this, &FirstTimeUse::HandleNewProjectButton); + QObject::connect(m_ui->openProjectButton, &QPushButton::pressed, this, &FirstTimeUse::HandleOpenProjectButton); + } + + void FirstTimeUse::HandleNewProjectButton() + { + m_projectManagerWindow->ChangeToScreen(ProjectManagerScreen::NewProjectSettings); + } + void FirstTimeUse::HandleOpenProjectButton() + { + m_projectManagerWindow->ChangeToScreen(ProjectManagerScreen::ProjectsHome); + } + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Qt/FirstTimeUse.h b/Code/Tools/ProjectManager/source/Qt/FirstTimeUse.h similarity index 66% rename from Code/Tools/ProjectManager/Qt/FirstTimeUse.h rename to Code/Tools/ProjectManager/source/Qt/FirstTimeUse.h index 85f344f3fe..677ca398fa 100644 --- a/Code/Tools/ProjectManager/Qt/FirstTimeUse.h +++ b/Code/Tools/ProjectManager/source/Qt/FirstTimeUse.h @@ -12,7 +12,7 @@ #pragma once #if !defined(Q_MOC_RUN) -#include +#include #endif namespace Ui @@ -20,17 +20,24 @@ namespace Ui class FirstTimeUseClass; } -namespace ProjectManager +namespace O3DE::ProjectManager { - class FirstTimeUse : public QWidget + class FirstTimeUse + : public ScreenWidget { - public: - explicit FirstTimeUse(QWidget* parent); + explicit FirstTimeUse(ProjectManagerWindow* window); ~FirstTimeUse(); + protected: + void ConnectSlotsAndSignals() override; + + protected slots: + void HandleNewProjectButton(); + void HandleOpenProjectButton(); + private: QScopedPointer m_ui; }; -} // namespace ProjectManager +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Qt/FirstTimeUse.ui b/Code/Tools/ProjectManager/source/Qt/FirstTimeUse.ui similarity index 100% rename from Code/Tools/ProjectManager/Qt/FirstTimeUse.ui rename to Code/Tools/ProjectManager/source/Qt/FirstTimeUse.ui diff --git a/Code/Tools/ProjectManager/source/Qt/GemCatalog.cpp b/Code/Tools/ProjectManager/source/Qt/GemCatalog.cpp new file mode 100644 index 0000000000..6377eb5c8d --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/GemCatalog.cpp @@ -0,0 +1,47 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include + +#include + +namespace O3DE::ProjectManager +{ + GemCatalog::GemCatalog(ProjectManagerWindow* window) + : ScreenWidget(window) + , m_ui(new Ui::GemCatalogClass()) + { + m_ui->setupUi(this); + + ConnectSlotsAndSignals(); + } + + GemCatalog::~GemCatalog() + { + } + + void GemCatalog::ConnectSlotsAndSignals() + { + QObject::connect(m_ui->backButton, &QPushButton::pressed, this, &GemCatalog::HandleBackButton); + QObject::connect(m_ui->confirmButton, &QPushButton::pressed, this, &GemCatalog::HandleConfirmButton); + } + + void GemCatalog::HandleBackButton() + { + m_projectManagerWindow->ChangeToScreen(ProjectManagerScreen::NewProjectSettings); + } + void GemCatalog::HandleConfirmButton() + { + m_projectManagerWindow->ChangeToScreen(ProjectManagerScreen::ProjectsHome); + } + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/source/Qt/GemCatalog.h b/Code/Tools/ProjectManager/source/Qt/GemCatalog.h new file mode 100644 index 0000000000..aee7b3a988 --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/GemCatalog.h @@ -0,0 +1,44 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ +#pragma once + +#if !defined(Q_MOC_RUN) +#include +#endif + +namespace Ui +{ + class GemCatalogClass; +} + +namespace O3DE::ProjectManager +{ + class GemCatalog + : public ScreenWidget + { + + public: + explicit GemCatalog(ProjectManagerWindow* window); + ~GemCatalog(); + + protected: + void ConnectSlotsAndSignals() override; + + protected slots: + void HandleBackButton(); + void HandleConfirmButton(); + + private: + QScopedPointer m_ui; + }; + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/source/Qt/GemCatalog.ui b/Code/Tools/ProjectManager/source/Qt/GemCatalog.ui new file mode 100644 index 0000000000..acc2ea80a1 --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/GemCatalog.ui @@ -0,0 +1,231 @@ + + + GemCatalogClass + + + + 0 + 0 + 806 + 566 + + + + Form + + + + + + + + Gem Catalog + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Cart + + + + + + + Hamburger Menu + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + Qt::Horizontal + + + + + + + TextLabel + + + + + + + CheckBox + + + + + + + CheckBox + + + + + + + CheckBox + + + + + + + + + + 0 + 0 + + + + + + + + + + TextLabel + + + + + + + + 0 + 0 + + + + + Atom + + + + + Audio + + + + + Camera + + + + + PhysX + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Back + + + + + + + Create Project + + + + + + + + + + diff --git a/Code/Tools/ProjectManager/source/Qt/NewProjectSettings.cpp b/Code/Tools/ProjectManager/source/Qt/NewProjectSettings.cpp new file mode 100644 index 0000000000..7289c73329 --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/NewProjectSettings.cpp @@ -0,0 +1,47 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include + +#include + +namespace O3DE::ProjectManager +{ + NewProjectSettings::NewProjectSettings(ProjectManagerWindow* window) + : ScreenWidget(window) + , m_ui(new Ui::NewProjectSettingsClass()) + { + m_ui->setupUi(this); + + ConnectSlotsAndSignals(); + } + + NewProjectSettings::~NewProjectSettings() + { + } + + void NewProjectSettings::ConnectSlotsAndSignals() + { + QObject::connect(m_ui->backButton, &QPushButton::pressed, this, &NewProjectSettings::HandleBackButton); + QObject::connect(m_ui->nextButton, &QPushButton::pressed, this, &NewProjectSettings::HandleNextButton); + } + + void NewProjectSettings::HandleBackButton() + { + m_projectManagerWindow->ChangeToScreen(ProjectManagerScreen::FirstTimeUse); + } + void NewProjectSettings::HandleNextButton() + { + m_projectManagerWindow->ChangeToScreen(ProjectManagerScreen::GemCatalog); + } + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/source/Qt/NewProjectSettings.h b/Code/Tools/ProjectManager/source/Qt/NewProjectSettings.h new file mode 100644 index 0000000000..5790772a0c --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/NewProjectSettings.h @@ -0,0 +1,43 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ +#pragma once + +#if !defined(Q_MOC_RUN) +#include +#endif + +namespace Ui +{ + class NewProjectSettingsClass; +} + +namespace O3DE::ProjectManager +{ + class NewProjectSettings + : public ScreenWidget + { + public: + explicit NewProjectSettings(ProjectManagerWindow* window); + ~NewProjectSettings(); + + protected: + void ConnectSlotsAndSignals() override; + + protected slots: + void HandleBackButton(); + void HandleNextButton(); + + private: + QScopedPointer m_ui; + }; + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/source/Qt/NewProjectSettings.ui b/Code/Tools/ProjectManager/source/Qt/NewProjectSettings.ui new file mode 100644 index 0000000000..98db10338e --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/NewProjectSettings.ui @@ -0,0 +1,97 @@ + + + NewProjectSettingsClass + + + + 0 + 0 + 880 + 546 + + + + Form + + + + + + Project Name + + + + + + + + + + Project Path + + + + + + + + + + Project Template + + + + + + + + + Standard (Recommened) + + + + + + + Empty + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Back + + + + + + + Next + + + + + + + + + + diff --git a/Code/Tools/ProjectManager/source/Qt/ProjectManagerWindow.cpp b/Code/Tools/ProjectManager/source/Qt/ProjectManagerWindow.cpp new file mode 100644 index 0000000000..b37f73a0c5 --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/ProjectManagerWindow.cpp @@ -0,0 +1,106 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include +#include + +#include +#include + +#include + +#include + +namespace O3DE::ProjectManager +{ + ProjectManagerWindow::ProjectManagerWindow(QWidget* parent, const AZ::IO::PathView& engineRootPath) + : QMainWindow(parent) + , m_ui(new Ui::ProjectManagerWindowClass()) + { + m_ui->setupUi(this); + + ConnectSlotsAndSignals(); + + QDir rootDir = QString::fromUtf8(engineRootPath.Native().data(), aznumeric_cast(engineRootPath.Native().size())); + const auto pathOnDisk = rootDir.absoluteFilePath("Code/Tools/ProjectManager/Resources"); + const auto qrcPath = QStringLiteral(":/ProjectManagerWindow"); + AzQtComponents::StyleManager::addSearchPaths("projectmanagerwindow", pathOnDisk, qrcPath, engineRootPath); + + AzQtComponents::StyleManager::setStyleSheet(this, QStringLiteral("projectlauncherwindow:ProjectManagerWindow.qss")); + + BuildScreens(); + + ChangeToScreen(ProjectManagerScreen::FirstTimeUse); + } + + ProjectManagerWindow::~ProjectManagerWindow() + { + } + + void ProjectManagerWindow::BuildScreens() + { + // Basically just iterate over the ProjectManagerScreen enum creating each screen + // Could add some fancy to do this but there are few screens right now + + ResetScreen(ProjectManagerScreen::FirstTimeUse); + ResetScreen(ProjectManagerScreen::NewProjectSettings); + ResetScreen(ProjectManagerScreen::GemCatalog); + ResetScreen(ProjectManagerScreen::ProjectsHome); + ResetScreen(ProjectManagerScreen::ProjectSettings); + ResetScreen(ProjectManagerScreen::EngineSettings); + } + + QStackedWidget* ProjectManagerWindow::GetScreenStack() + { + return m_ui->stackedScreens; + } + + void ProjectManagerWindow::ChangeToScreen(ProjectManagerScreen screen) + { + int index = aznumeric_cast(screen); + m_ui->stackedScreens->setCurrentIndex(index); + } + + void ProjectManagerWindow::ResetScreen(ProjectManagerScreen screen) + { + int index = aznumeric_cast(screen); + + // Fine the old screen if it exists and get rid of it so we can start fresh + QWidget* oldScreen = m_ui->stackedScreens->widget(index); + + if (oldScreen) + { + m_ui->stackedScreens->removeWidget(oldScreen); + oldScreen->deleteLater(); + } + + // Add new screen + QWidget* newScreen = BuildScreen(this, screen); + m_ui->stackedScreens->insertWidget(index, newScreen); + } + + void ProjectManagerWindow::ConnectSlotsAndSignals() + { + QObject::connect(m_ui->projectsMenu, &QMenu::aboutToShow, this, &ProjectManagerWindow::HandleProjectsMenu); + QObject::connect(m_ui->engineMenu, &QMenu::aboutToShow, this, &ProjectManagerWindow::HandleEngineMenu); + } + + void ProjectManagerWindow::HandleProjectsMenu() + { + ChangeToScreen(ProjectManagerScreen::ProjectsHome); + } + void ProjectManagerWindow::HandleEngineMenu() + { + ChangeToScreen(ProjectManagerScreen::EngineSettings); + } + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Qt/ProjectManagerWindow.h b/Code/Tools/ProjectManager/source/Qt/ProjectManagerWindow.h similarity index 63% rename from Code/Tools/ProjectManager/Qt/ProjectManagerWindow.h rename to Code/Tools/ProjectManager/source/Qt/ProjectManagerWindow.h index a62e823a92..9e5761fbd2 100644 --- a/Code/Tools/ProjectManager/Qt/ProjectManagerWindow.h +++ b/Code/Tools/ProjectManager/source/Qt/ProjectManagerWindow.h @@ -12,7 +12,10 @@ #pragma once #if !defined(Q_MOC_RUN) +#include + #include +#include #include #endif @@ -22,17 +25,33 @@ namespace Ui class ProjectManagerWindowClass; } -namespace ProjectManager +namespace O3DE::ProjectManager { - class ProjectManagerWindow : public QMainWindow + class ProjectManagerWindow + : public QMainWindow { + Q_OBJECT public: explicit ProjectManagerWindow(QWidget* parent, const AZ::IO::PathView& engineRootPath); ~ProjectManagerWindow(); + void BuildScreens(); + QStackedWidget* GetScreenStack(); + + public slots: + void ChangeToScreen(ProjectManagerScreen screen); + void ResetScreen(ProjectManagerScreen screen); + + protected: + void ConnectSlotsAndSignals(); + + protected slots: + void HandleProjectsMenu(); + void HandleEngineMenu(); + private: QScopedPointer m_ui; }; -} // namespace ProjectManager +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Qt/ProjectManagerWindow.ui b/Code/Tools/ProjectManager/source/Qt/ProjectManagerWindow.ui similarity index 74% rename from Code/Tools/ProjectManager/Qt/ProjectManagerWindow.ui rename to Code/Tools/ProjectManager/source/Qt/ProjectManagerWindow.ui index 60ec2dd674..704e74e38e 100644 --- a/Code/Tools/ProjectManager/Qt/ProjectManagerWindow.ui +++ b/Code/Tools/ProjectManager/source/Qt/ProjectManagerWindow.ui @@ -13,8 +13,12 @@ O3DE Project Manager - - + + + + + + @@ -30,7 +34,7 @@ 16 - + Icon @@ -39,19 +43,19 @@ :/Resources/o3de_editor.ico:/Resources/o3de_editor.ico - + Projects - + Engine - - - + + + diff --git a/Code/Tools/ProjectManager/source/Qt/ProjectSettings.cpp b/Code/Tools/ProjectManager/source/Qt/ProjectSettings.cpp new file mode 100644 index 0000000000..56b27f5fe3 --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/ProjectSettings.cpp @@ -0,0 +1,42 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include + +#include + +namespace O3DE::ProjectManager +{ + ProjectSettings::ProjectSettings(ProjectManagerWindow* window) + : ScreenWidget(window) + , m_ui(new Ui::ProjectSettingsClass()) + { + m_ui->setupUi(this); + + ConnectSlotsAndSignals(); + } + + ProjectSettings::~ProjectSettings() + { + } + + void ProjectSettings::ConnectSlotsAndSignals() + { + QObject::connect(m_ui->gemsButton, &QPushButton::pressed, this, &ProjectSettings::HandleGemsButton); + } + + void ProjectSettings::HandleGemsButton() + { + m_projectManagerWindow->ChangeToScreen(ProjectManagerScreen::GemCatalog); + } + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/source/Qt/ProjectSettings.h b/Code/Tools/ProjectManager/source/Qt/ProjectSettings.h new file mode 100644 index 0000000000..c9356db9bf --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/ProjectSettings.h @@ -0,0 +1,42 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ +#pragma once + +#if !defined(Q_MOC_RUN) +#include +#endif + +namespace Ui +{ + class ProjectSettingsClass; +} + +namespace O3DE::ProjectManager +{ + class ProjectSettings + : public ScreenWidget + { + public: + explicit ProjectSettings(ProjectManagerWindow* window); + ~ProjectSettings(); + + protected: + void ConnectSlotsAndSignals() override; + + protected slots: + void HandleGemsButton(); + + private: + QScopedPointer m_ui; + }; + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/source/Qt/ProjectSettings.ui b/Code/Tools/ProjectManager/source/Qt/ProjectSettings.ui new file mode 100644 index 0000000000..934238a257 --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/ProjectSettings.ui @@ -0,0 +1,113 @@ + + + ProjectSettingsClass + + + + 0 + 0 + 782 + 579 + + + + Form + + + + + + + + Project Settings + + + + + + + Gems + + + + + + + Qt::Horizontal + + + + 761 + 20 + + + + + + + + + + + + + + Project Name + + + + + + + + + + Project Location + + + + + + + + + + Project Image Location + + + + + + + + + + Project Background Image Location + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + diff --git a/Code/Tools/ProjectManager/source/Qt/ProjectsHome.cpp b/Code/Tools/ProjectManager/source/Qt/ProjectsHome.cpp new file mode 100644 index 0000000000..ef85d71950 --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/ProjectsHome.cpp @@ -0,0 +1,52 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include + +#include + +namespace O3DE::ProjectManager +{ + ProjectsHome::ProjectsHome(ProjectManagerWindow* window) + : ScreenWidget(window) + , m_ui(new Ui::ProjectsHomeClass()) + { + m_ui->setupUi(this); + + ConnectSlotsAndSignals(); + } + + ProjectsHome::~ProjectsHome() + { + } + + void ProjectsHome::ConnectSlotsAndSignals() + { + QObject::connect(m_ui->newProjectButton, &QPushButton::pressed, this, &ProjectsHome::HandleNewProjectButton); + QObject::connect(m_ui->addProjectButton, &QPushButton::pressed, this, &ProjectsHome::HandleAddProjectButton); + QObject::connect(m_ui->editProjectButton, &QPushButton::pressed, this, &ProjectsHome::HandleEditProjectButton); + } + + void ProjectsHome::HandleNewProjectButton() + { + m_projectManagerWindow->ChangeToScreen(ProjectManagerScreen::NewProjectSettings); + } + void ProjectsHome::HandleAddProjectButton() + { + //Do nothing for now + } + void ProjectsHome::HandleEditProjectButton() + { + m_projectManagerWindow->ChangeToScreen(ProjectManagerScreen::ProjectSettings); + } + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/source/Qt/ProjectsHome.h b/Code/Tools/ProjectManager/source/Qt/ProjectsHome.h new file mode 100644 index 0000000000..b5a062f2dd --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/ProjectsHome.h @@ -0,0 +1,45 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ +#pragma once + +#if !defined(Q_MOC_RUN) +#include +#endif + +namespace Ui +{ + class ProjectsHomeClass; +} + +namespace O3DE::ProjectManager +{ + class ProjectsHome + : public ScreenWidget + { + + public: + explicit ProjectsHome(ProjectManagerWindow* window); + ~ProjectsHome(); + + protected: + void ConnectSlotsAndSignals() override; + + protected slots: + void HandleNewProjectButton(); + void HandleAddProjectButton(); + void HandleEditProjectButton(); + + private: + QScopedPointer m_ui; + }; + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/source/Qt/ProjectsHome.ui b/Code/Tools/ProjectManager/source/Qt/ProjectsHome.ui new file mode 100644 index 0000000000..ea3e34d84b --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/ProjectsHome.ui @@ -0,0 +1,137 @@ + + + ProjectsHomeClass + + + + 0 + 0 + 826 + 585 + + + + Form + + + + + + My Projects + + + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + + + + :/Resources/Add.svg:/Resources/Add.svg + + + + + + + + 0 + 0 + + + + + + + + :/Resources/Select_Folder.svg:/Resources/Select_Folder.svg + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + + + Edit Project + + + + + + + Open a Project + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + diff --git a/Code/Tools/ProjectManager/source/Qt/ScreenWidget.h b/Code/Tools/ProjectManager/source/Qt/ScreenWidget.h new file mode 100644 index 0000000000..0cec4bed03 --- /dev/null +++ b/Code/Tools/ProjectManager/source/Qt/ScreenWidget.h @@ -0,0 +1,38 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ +#pragma once + +#if !defined(Q_MOC_RUN) +#include + +#include +#endif + +namespace O3DE::ProjectManager +{ + class ScreenWidget + : public QWidget + { + public: + explicit ScreenWidget(ProjectManagerWindow* window) + : QWidget(window->GetScreenStack()) + , m_projectManagerWindow(window) + { + } + + protected: + virtual void ConnectSlotsAndSignals() = 0; + + ProjectManagerWindow* m_projectManagerWindow; + }; + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Qt/FirstTimeUse.cpp b/Code/Tools/ProjectManager/source/ScreenDefs.h similarity index 60% rename from Code/Tools/ProjectManager/Qt/FirstTimeUse.cpp rename to Code/Tools/ProjectManager/source/ScreenDefs.h index 640849740e..f02b1de1b8 100644 --- a/Code/Tools/ProjectManager/Qt/FirstTimeUse.cpp +++ b/Code/Tools/ProjectManager/source/ScreenDefs.h @@ -9,23 +9,17 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ +#pragma once -#include - -#include - -namespace ProjectManager +namespace O3DE::ProjectManager { - FirstTimeUse::FirstTimeUse(QWidget* parent) - : QWidget(parent) - , m_ui(new Ui::FirstTimeUseClass()) + enum class ProjectManagerScreen { - m_ui->setupUi(this); - } - - FirstTimeUse::~FirstTimeUse() - { - } - - //#include -} // namespace ProjectManager + FirstTimeUse, + NewProjectSettings, + GemCatalog, + ProjectsHome, + ProjectSettings, + EngineSettings + }; +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/source/ScreenFactory.cpp b/Code/Tools/ProjectManager/source/ScreenFactory.cpp new file mode 100644 index 0000000000..e29994d162 --- /dev/null +++ b/Code/Tools/ProjectManager/source/ScreenFactory.cpp @@ -0,0 +1,43 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ +#include + +#include +#include +#include +#include +#include +#include + +namespace O3DE::ProjectManager +{ + QWidget* BuildScreen(ProjectManagerWindow* window, ProjectManagerScreen screen) + { + switch(screen) + { + case (ProjectManagerScreen::FirstTimeUse): + return new FirstTimeUse(window); + case (ProjectManagerScreen::NewProjectSettings): + return new NewProjectSettings(window); + case (ProjectManagerScreen::GemCatalog): + return new GemCatalog(window); + case (ProjectManagerScreen::ProjectsHome): + return new ProjectsHome(window); + case (ProjectManagerScreen::ProjectSettings): + return new ProjectSettings(window); + case (ProjectManagerScreen::EngineSettings): + return new EngineSettings(window); + default: + return new QWidget(window->GetScreenStack()); + } + } +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/source/ScreenFactory.h b/Code/Tools/ProjectManager/source/ScreenFactory.h new file mode 100644 index 0000000000..addc868dfa --- /dev/null +++ b/Code/Tools/ProjectManager/source/ScreenFactory.h @@ -0,0 +1,24 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ +#pragma once + +#include + +#include + +#include + + +namespace O3DE::ProjectManager +{ + QWidget* BuildScreen(ProjectManagerWindow* window, ProjectManagerScreen screen); +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/source/main.cpp b/Code/Tools/ProjectManager/source/main.cpp index ecfae3b28e..7ae977818b 100644 --- a/Code/Tools/ProjectManager/source/main.cpp +++ b/Code/Tools/ProjectManager/source/main.cpp @@ -48,7 +48,7 @@ int main(int argc, char* argv[]) AzQtComponents::StyleManager styleManager(&app); styleManager.initialize(&app, engineRootPath); - ProjectManager::ProjectManagerWindow window(nullptr, engineRootPath); + O3DE::ProjectManager::ProjectManagerWindow window(nullptr, engineRootPath); window.show(); return app.exec();