Added Project Preview to Project Settings and Fixed Issues with Moving Projects (#1380)

* Updated Project Settings Screen with preview and fixed moving projects

* Tests for some Project Utils

* Remove old defined consts

* Update UX to use display name when avaliable where appropriate

* Use newPreviewImagePath for temp changing preview.png otherwise use iconPath for preview in UX

* Removed use of newPreviewImagePath in ProjectButton
This commit is contained in:
AMZN-nggieber
2021-06-22 17:24:48 -07:00
committed by GitHub
parent 2323cdd9e4
commit e21443b5d6
27 changed files with 679 additions and 143 deletions
@@ -10,33 +10,74 @@
*
*/
#include "ProjectInfo.h"
#include <ProjectInfo.h>
#include <ProjectManagerDefs.h>
#include <QDir>
namespace O3DE::ProjectManager
{
ProjectInfo::ProjectInfo(const QString& path, const QString& projectName, const QString& displayName,
const QString& origin, const QString& summary, const QString& imagePath, const QString& backgroundImagePath,
ProjectInfo::ProjectInfo(
const QString& path,
const QString& projectName,
const QString& displayName,
const QString& origin,
const QString& summary,
const QString& iconPath,
const QString& newPreviewImagePath,
const QString& newBackgroundImagePath,
bool needsBuild)
: m_path(path)
, m_projectName(projectName)
, m_displayName(displayName)
, m_origin(origin)
, m_summary(summary)
, m_imagePath(imagePath)
, m_backgroundImagePath(backgroundImagePath)
, m_iconPath(iconPath)
, m_newPreviewImagePath(newPreviewImagePath)
, m_newBackgroundImagePath(newBackgroundImagePath)
, m_needsBuild(needsBuild)
{
}
bool ProjectInfo::operator==(const ProjectInfo& rhs)
bool ProjectInfo::operator==(const ProjectInfo& rhs) const
{
return m_path == rhs.m_path
&& m_projectName == rhs.m_projectName
&& m_imagePath == rhs.m_imagePath
&& m_backgroundImagePath == rhs.m_backgroundImagePath;
if (m_path != rhs.m_path)
{
return false;
}
if (m_projectName != rhs.m_projectName)
{
return false;
}
if (m_displayName != rhs.m_displayName)
{
return false;
}
if (m_origin != rhs.m_origin)
{
return false;
}
if (m_summary != rhs.m_summary)
{
return false;
}
if (m_iconPath != rhs.m_iconPath)
{
return false;
}
if (m_newPreviewImagePath != rhs.m_newPreviewImagePath)
{
return false;
}
if (m_newBackgroundImagePath != rhs.m_newBackgroundImagePath)
{
return false;
}
return true;
}
bool ProjectInfo::operator!=(const ProjectInfo& rhs)
bool ProjectInfo::operator!=(const ProjectInfo& rhs) const
{
return !operator==(rhs);
}
@@ -45,4 +86,16 @@ namespace O3DE::ProjectManager
{
return !m_path.isEmpty() && !m_projectName.isEmpty();
}
const QString& ProjectInfo::GetProjectDisplayName() const
{
if (!m_displayName.isEmpty())
{
return m_displayName;
}
else
{
return m_projectName;
}
}
} // namespace O3DE::ProjectManager