Files
o3de/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.h
T
Benjamin Jillich 1586c00fc8 [LYN-4929] Correct gems not showing as enabled for a template (#1722)
* When there are multiple project templates present, we re-gather the gems when changing the selected the project template.
* In case the user enabled or disabled any gem and they select a new project template, we show a warning dialog where users can either cancel the operation or proceed to the new project template. The warning dialog will only appear in case the enabled gems actually differ from the currently used template's default.
* New helper function to select the used project template.
* Storing the currently used project template index and only update the template details and emitting the changed event in case the user has actually chosen another template. This avoids emitting signals in case the user clicks on the already selected template.

Signed-off-by: Benjamin Jillich <jillich@amazon.com>
2021-07-01 18:53:17 +02:00

58 lines
1.7 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#if !defined(Q_MOC_RUN)
#include <ProjectSettingsScreen.h>
#include <ProjectTemplateInfo.h>
#include <QVector>
#endif
QT_FORWARD_DECLARE_CLASS(QButtonGroup)
QT_FORWARD_DECLARE_CLASS(QLabel)
QT_FORWARD_DECLARE_CLASS(QFrame)
namespace O3DE::ProjectManager
{
QT_FORWARD_DECLARE_CLASS(TagContainerWidget)
class NewProjectSettingsScreen
: public ProjectSettingsScreen
{
Q_OBJECT
public:
explicit NewProjectSettingsScreen(QWidget* parent = nullptr);
~NewProjectSettingsScreen() = default;
ProjectManagerScreen GetScreenEnum() override;
QString GetProjectTemplatePath();
void NotifyCurrentScreen() override;
void SelectProjectTemplate(int index, bool blockSignals = false);
signals:
void OnTemplateSelectionChanged(int oldIndex, int newIndex);
private:
QString GetDefaultProjectPath();
QFrame* CreateTemplateDetails(int margin);
void UpdateTemplateDetails(const ProjectTemplateInfo& templateInfo);
QButtonGroup* m_projectTemplateButtonGroup;
QLabel* m_templateDisplayName;
QLabel* m_templateSummary;
TagContainerWidget* m_templateIncludedGems;
QVector<ProjectTemplateInfo> m_templates;
int m_selectedTemplateIndex = -1;
inline constexpr static int s_spacerSize = 20;
inline constexpr static int s_templateDetailsContentMargin = 20;
};
} // namespace O3DE::ProjectManager