Add Project Manager File menu options to Editor

This commit is contained in:
Alex Peterson
2021-06-01 15:30:14 -07:00
committed by GitHub
parent 9e3b7b45d9
commit afe20906db
14 changed files with 147 additions and 17 deletions
+27 -1
View File
@@ -15,13 +15,17 @@
#include <AzCore/Component/ComponentApplication.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/IO/Path/Path.h>
#include <AzFramework/CommandLine/CommandLine.h>
#include <ProjectManagerWindow.h>
#include <ProjectUtils.h>
#include <QApplication>
#include <QCoreApplication>
#include <QGuiApplication>
using namespace O3DE::ProjectManager;
int main(int argc, char* argv[])
{
QApplication::setOrganizationName("O3DE");
@@ -51,7 +55,29 @@ int main(int argc, char* argv[])
AzQtComponents::StyleManager styleManager(&app);
styleManager.initialize(&app, engineRootPath);
O3DE::ProjectManager::ProjectManagerWindow window(nullptr, engineRootPath);
// Get the initial start screen if one is provided via command line
constexpr char optionPrefix[] = "--";
AZ::CommandLine commandLine(optionPrefix);
commandLine.Parse(argc, argv);
ProjectManagerScreen startScreen = ProjectManagerScreen::Projects;
if(commandLine.HasSwitch("screen"))
{
QString screenOption = commandLine.GetSwitchValue("screen", 0).c_str();
ProjectManagerScreen screen = ProjectUtils::GetProjectManagerScreen(screenOption);
if (screen != ProjectManagerScreen::Invalid)
{
startScreen = screen;
}
}
AZ::IO::FixedMaxPath projectPath;
if (commandLine.HasSwitch("project-path"))
{
projectPath = commandLine.GetSwitchValue("project-path", 0).c_str();
}
ProjectManagerWindow window(nullptr, engineRootPath, projectPath, startScreen);
window.show();
// somethings is preventing us from moving the window to the center of the