From 7a2f698bbc301914ee218357e6e772b0f8876a11 Mon Sep 17 00:00:00 2001 From: AMZN-nggieber <52797929+AMZN-nggieber@users.noreply.github.com> Date: Fri, 30 Apr 2021 17:11:40 -0700 Subject: [PATCH] Create the Project Manager project (#320) * Created the Project Manager project with a barebone styled window and rough sketch of first screen * Renamed to Project Manager, ect. * Corrected string name for projectmanager and added comments on getting engine path * Changed output name for Project Manager to lowercase o3de * Added header guards --- Code/Tools/CMakeLists.txt | 1 + Code/Tools/ProjectManager/CMakeLists.txt | 41 ++++++++ .../Platform/Android/PAL_android.cmake | 10 ++ .../Platform/Linux/PAL_linux.cmake | 10 ++ .../ProjectManager/Platform/Mac/PAL_mac.cmake | 10 ++ .../Platform/Windows/PAL_windows.cmake | 10 ++ .../ProjectManager/Platform/iOS/PAL_ios.cmake | 10 ++ Code/Tools/ProjectManager/Qt/FirstTimeUse.cpp | 31 +++++++ Code/Tools/ProjectManager/Qt/FirstTimeUse.h | 36 +++++++ Code/Tools/ProjectManager/Qt/FirstTimeUse.ui | 93 +++++++++++++++++++ .../Qt/ProjectManagerWindow.cpp | 49 ++++++++++ .../ProjectManager/Qt/ProjectManagerWindow.h | 38 ++++++++ .../ProjectManager/Qt/ProjectManagerWindow.ui | 61 ++++++++++++ Code/Tools/ProjectManager/Resources/Add.svg | 4 + .../Resources/ProjectManager.qss | 0 .../Resources/Select_Folder.svg | 4 + .../ProjectManager/Resources/o3de_editor.ico | 3 + Code/Tools/ProjectManager/project_manager.qrc | 8 ++ .../project_manager_files.cmake | 21 +++++ Code/Tools/ProjectManager/source/main.cpp | 55 +++++++++++ 20 files changed, 495 insertions(+) create mode 100644 Code/Tools/ProjectManager/CMakeLists.txt create mode 100644 Code/Tools/ProjectManager/Platform/Android/PAL_android.cmake create mode 100644 Code/Tools/ProjectManager/Platform/Linux/PAL_linux.cmake create mode 100644 Code/Tools/ProjectManager/Platform/Mac/PAL_mac.cmake create mode 100644 Code/Tools/ProjectManager/Platform/Windows/PAL_windows.cmake create mode 100644 Code/Tools/ProjectManager/Platform/iOS/PAL_ios.cmake create mode 100644 Code/Tools/ProjectManager/Qt/FirstTimeUse.cpp create mode 100644 Code/Tools/ProjectManager/Qt/FirstTimeUse.h create mode 100644 Code/Tools/ProjectManager/Qt/FirstTimeUse.ui create mode 100644 Code/Tools/ProjectManager/Qt/ProjectManagerWindow.cpp create mode 100644 Code/Tools/ProjectManager/Qt/ProjectManagerWindow.h create mode 100644 Code/Tools/ProjectManager/Qt/ProjectManagerWindow.ui create mode 100644 Code/Tools/ProjectManager/Resources/Add.svg create mode 100644 Code/Tools/ProjectManager/Resources/ProjectManager.qss create mode 100644 Code/Tools/ProjectManager/Resources/Select_Folder.svg create mode 100644 Code/Tools/ProjectManager/Resources/o3de_editor.ico create mode 100644 Code/Tools/ProjectManager/project_manager.qrc create mode 100644 Code/Tools/ProjectManager/project_manager_files.cmake create mode 100644 Code/Tools/ProjectManager/source/main.cpp diff --git a/Code/Tools/CMakeLists.txt b/Code/Tools/CMakeLists.txt index 65a1bf85ce..db5476756b 100644 --- a/Code/Tools/CMakeLists.txt +++ b/Code/Tools/CMakeLists.txt @@ -25,3 +25,4 @@ add_subdirectory(AssetBundler) add_subdirectory(GridHub) add_subdirectory(Standalone) add_subdirectory(TestImpactFramework) +add_subdirectory(ProjectManager) diff --git a/Code/Tools/ProjectManager/CMakeLists.txt b/Code/Tools/ProjectManager/CMakeLists.txt new file mode 100644 index 0000000000..8315ef831c --- /dev/null +++ b/Code/Tools/ProjectManager/CMakeLists.txt @@ -0,0 +1,41 @@ +# +# 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. +# + +if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) + return() +endif() + +ly_add_target( + NAME ProjectManager APPLICATION + OUTPUT_NAME o3de + NAMESPACE AZ + AUTOMOC + AUTOUIC + AUTORCC + FILES_CMAKE + project_manager_files.cmake + Platform/${PAL_PLATFORM_NAME}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake + INCLUDE_DIRECTORIES + PUBLIC + . + PRIVATE + source + + BUILD_DEPENDENCIES + PRIVATE + 3rdParty::Qt::Core + 3rdParty::Qt::Concurrent + 3rdParty::Qt::Widgets + AZ::AzCore + AZ::AzFramework + AZ::AzToolsFramework + AZ::AzQtComponents +) diff --git a/Code/Tools/ProjectManager/Platform/Android/PAL_android.cmake b/Code/Tools/ProjectManager/Platform/Android/PAL_android.cmake new file mode 100644 index 0000000000..4d5680a30d --- /dev/null +++ b/Code/Tools/ProjectManager/Platform/Android/PAL_android.cmake @@ -0,0 +1,10 @@ +# +# 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. +# diff --git a/Code/Tools/ProjectManager/Platform/Linux/PAL_linux.cmake b/Code/Tools/ProjectManager/Platform/Linux/PAL_linux.cmake new file mode 100644 index 0000000000..4d5680a30d --- /dev/null +++ b/Code/Tools/ProjectManager/Platform/Linux/PAL_linux.cmake @@ -0,0 +1,10 @@ +# +# 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. +# diff --git a/Code/Tools/ProjectManager/Platform/Mac/PAL_mac.cmake b/Code/Tools/ProjectManager/Platform/Mac/PAL_mac.cmake new file mode 100644 index 0000000000..4d5680a30d --- /dev/null +++ b/Code/Tools/ProjectManager/Platform/Mac/PAL_mac.cmake @@ -0,0 +1,10 @@ +# +# 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. +# diff --git a/Code/Tools/ProjectManager/Platform/Windows/PAL_windows.cmake b/Code/Tools/ProjectManager/Platform/Windows/PAL_windows.cmake new file mode 100644 index 0000000000..4d5680a30d --- /dev/null +++ b/Code/Tools/ProjectManager/Platform/Windows/PAL_windows.cmake @@ -0,0 +1,10 @@ +# +# 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. +# diff --git a/Code/Tools/ProjectManager/Platform/iOS/PAL_ios.cmake b/Code/Tools/ProjectManager/Platform/iOS/PAL_ios.cmake new file mode 100644 index 0000000000..4d5680a30d --- /dev/null +++ b/Code/Tools/ProjectManager/Platform/iOS/PAL_ios.cmake @@ -0,0 +1,10 @@ +# +# 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. +# diff --git a/Code/Tools/ProjectManager/Qt/FirstTimeUse.cpp b/Code/Tools/ProjectManager/Qt/FirstTimeUse.cpp new file mode 100644 index 0000000000..640849740e --- /dev/null +++ b/Code/Tools/ProjectManager/Qt/FirstTimeUse.cpp @@ -0,0 +1,31 @@ +/* + * 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 ProjectManager +{ + FirstTimeUse::FirstTimeUse(QWidget* parent) + : QWidget(parent) + , m_ui(new Ui::FirstTimeUseClass()) + { + m_ui->setupUi(this); + } + + FirstTimeUse::~FirstTimeUse() + { + } + + //#include +} // namespace ProjectManager diff --git a/Code/Tools/ProjectManager/Qt/FirstTimeUse.h b/Code/Tools/ProjectManager/Qt/FirstTimeUse.h new file mode 100644 index 0000000000..85f344f3fe --- /dev/null +++ b/Code/Tools/ProjectManager/Qt/FirstTimeUse.h @@ -0,0 +1,36 @@ +/* + * 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 FirstTimeUseClass; +} + +namespace ProjectManager +{ + class FirstTimeUse : public QWidget + { + + public: + explicit FirstTimeUse(QWidget* parent); + ~FirstTimeUse(); + + private: + QScopedPointer m_ui; + }; + +} // namespace ProjectManager diff --git a/Code/Tools/ProjectManager/Qt/FirstTimeUse.ui b/Code/Tools/ProjectManager/Qt/FirstTimeUse.ui new file mode 100644 index 0000000000..fdc195731f --- /dev/null +++ b/Code/Tools/ProjectManager/Qt/FirstTimeUse.ui @@ -0,0 +1,93 @@ + + + FirstTimeUseClass + + + + 0 + 0 + 881 + 555 + + + + Form + + + + + + + + + 30 + + + + READY. SET. CREATE! + + + + + + + <html><head/><body><p>Welcome to O3DE! Start something new by creating a project. Not sure what to create? </p><p>Explore what’s available by downloading our sample project.</p></body></html> + + + Qt::AutoText + + + + + + + + + + + + 0 + 0 + + + + Create Project + + + + :/Resources/Add.svg:/Resources/Add.svg + + + + 16 + 16 + + + + + + + + + 0 + 0 + + + + Open a Project + + + + :/Resources/Select_Folder.svg:/Resources/Select_Folder.svg + + + + + + + + + + + + diff --git a/Code/Tools/ProjectManager/Qt/ProjectManagerWindow.cpp b/Code/Tools/ProjectManager/Qt/ProjectManagerWindow.cpp new file mode 100644 index 0000000000..4a8486f877 --- /dev/null +++ b/Code/Tools/ProjectManager/Qt/ProjectManagerWindow.cpp @@ -0,0 +1,49 @@ +/* + * 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/Qt/ProjectManagerWindow.h b/Code/Tools/ProjectManager/Qt/ProjectManagerWindow.h new file mode 100644 index 0000000000..a62e823a92 --- /dev/null +++ b/Code/Tools/ProjectManager/Qt/ProjectManagerWindow.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 Ui +{ + class ProjectManagerWindowClass; +} + +namespace ProjectManager +{ + class ProjectManagerWindow : public QMainWindow + { + + public: + explicit ProjectManagerWindow(QWidget* parent, const AZ::IO::PathView& engineRootPath); + ~ProjectManagerWindow(); + + private: + QScopedPointer m_ui; + }; + +} // namespace ProjectManager diff --git a/Code/Tools/ProjectManager/Qt/ProjectManagerWindow.ui b/Code/Tools/ProjectManager/Qt/ProjectManagerWindow.ui new file mode 100644 index 0000000000..60ec2dd674 --- /dev/null +++ b/Code/Tools/ProjectManager/Qt/ProjectManagerWindow.ui @@ -0,0 +1,61 @@ + + + ProjectManagerWindowClass + + + + 0 + 0 + 800 + 600 + + + + O3DE Project Manager + + + + + + + + 0 + 0 + 800 + 36 + + + + + 16 + + + + + Icon + + + + :/Resources/o3de_editor.ico:/Resources/o3de_editor.ico + + + + + Projects + + + + + Engine + + + + + + + + + + + + diff --git a/Code/Tools/ProjectManager/Resources/Add.svg b/Code/Tools/ProjectManager/Resources/Add.svg new file mode 100644 index 0000000000..d2b9b2e0a6 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/Add.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Code/Tools/ProjectManager/Resources/ProjectManager.qss b/Code/Tools/ProjectManager/Resources/ProjectManager.qss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Code/Tools/ProjectManager/Resources/Select_Folder.svg b/Code/Tools/ProjectManager/Resources/Select_Folder.svg new file mode 100644 index 0000000000..72dcd3385e --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/Select_Folder.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Code/Tools/ProjectManager/Resources/o3de_editor.ico b/Code/Tools/ProjectManager/Resources/o3de_editor.ico new file mode 100644 index 0000000000..0680ceea19 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/o3de_editor.ico @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c042fce57915fc749abc7b37de765fd697c3c4d7de045a3d44805aa0ce29901a +size 107016 diff --git a/Code/Tools/ProjectManager/project_manager.qrc b/Code/Tools/ProjectManager/project_manager.qrc new file mode 100644 index 0000000000..408398584b --- /dev/null +++ b/Code/Tools/ProjectManager/project_manager.qrc @@ -0,0 +1,8 @@ + + + Resources/ProjectManager.qss + Resources/Add.svg + Resources/Select_Folder.svg + Resources/o3de_editor.ico + + \ No newline at end of file diff --git a/Code/Tools/ProjectManager/project_manager_files.cmake b/Code/Tools/ProjectManager/project_manager_files.cmake new file mode 100644 index 0000000000..4d36550e56 --- /dev/null +++ b/Code/Tools/ProjectManager/project_manager_files.cmake @@ -0,0 +1,21 @@ +# +# 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. +# + +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 +) diff --git a/Code/Tools/ProjectManager/source/main.cpp b/Code/Tools/ProjectManager/source/main.cpp new file mode 100644 index 0000000000..ecfae3b28e --- /dev/null +++ b/Code/Tools/ProjectManager/source/main.cpp @@ -0,0 +1,55 @@ +/* +* 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 +#include +#include + +int main(int argc, char* argv[]) +{ + QApplication::setOrganizationName("O3DE"); + QApplication::setOrganizationDomain("o3de.org"); + QCoreApplication::setApplicationName("ProjectManager"); + QCoreApplication::setApplicationVersion("1.0"); + + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); + QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); + AzQtComponents::Utilities::HandleDpiAwareness(AzQtComponents::Utilities::SystemDpiAware); + + QApplication app(argc, argv); + + // Need to use settings registry to get EngineRootFolder + AZ::IO::FixedMaxPath engineRootPath; + { + AZ::ComponentApplication componentApplication; + auto settingsRegistry = AZ::SettingsRegistry::Get(); + settingsRegistry->Get(engineRootPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_EngineRootFolder); + } + + AzQtComponents::StyleManager styleManager(&app); + styleManager.initialize(&app, engineRootPath); + + ProjectManager::ProjectManagerWindow window(nullptr, engineRootPath); + window.show(); + + return app.exec(); +}