@ -65,6 +65,16 @@ namespace O3DE::ProjectManager
vLayout - > addWidget ( m_stack ) ;
vLayout - > addWidget ( m_stack ) ;
connect ( reinterpret_cast < ScreensCtrl * > ( parent ) , & ScreensCtrl : : NotifyBuildProject , this , & ProjectsScreen : : SuggestBuildProject ) ;
connect ( reinterpret_cast < ScreensCtrl * > ( parent ) , & ScreensCtrl : : NotifyBuildProject , this , & ProjectsScreen : : SuggestBuildProject ) ;
// Will focus whatever button it finds so the Project tab is not focused on start-up
QTimer : : singleShot ( 0 , this , [ this ]
{
QPushButton * foundButton = m_stack - > currentWidget ( ) - > findChild < QPushButton * > ( ) ;
if ( foundButton )
{
foundButton - > setFocus ( ) ;
}
} ) ;
}
}
ProjectsScreen : : ~ ProjectsScreen ( )
ProjectsScreen : : ~ ProjectsScreen ( )
@ -166,7 +176,7 @@ namespace O3DE::ProjectManager
ProjectButton * ProjectsScreen : : CreateProjectButton ( const ProjectInfo & project )
ProjectButton * ProjectsScreen : : CreateProjectButton ( const ProjectInfo & project )
{
{
ProjectButton * projectButton = new ProjectButton ( project , this ) ;
ProjectButton * projectButton = new ProjectButton ( project , this ) ;
m_projectButtons . insert ( project. m_path , projectButton ) ;
m_projectButtons . insert ( QDir: : toNativeSeparators ( project. m_path ) , projectButton ) ;
m_projectsFlowLayout - > addWidget ( projectButton ) ;
m_projectsFlowLayout - > addWidget ( projectButton ) ;
connect ( projectButton , & ProjectButton : : OpenProject , this , & ProjectsScreen : : HandleOpenProject ) ;
connect ( projectButton , & ProjectButton : : OpenProject , this , & ProjectsScreen : : HandleOpenProject ) ;
@ -193,7 +203,7 @@ namespace O3DE::ProjectManager
QSet < QString > keepProject ;
QSet < QString > keepProject ;
for ( const ProjectInfo & project : projectsVector )
for ( const ProjectInfo & project : projectsVector )
{
{
keepProject . insert ( project. m_path ) ;
keepProject . insert ( QDir: : toNativeSeparators ( project. m_path ) ) ;
}
}
// Clear flow and delete buttons for removed projects
// Clear flow and delete buttons for removed projects
@ -204,6 +214,7 @@ namespace O3DE::ProjectManager
if ( ! keepProject . contains ( projectButtonsIter . key ( ) ) )
if ( ! keepProject . contains ( projectButtonsIter . key ( ) ) )
{
{
projectButtonsIter . value ( ) - > deleteLater ( ) ;
projectButtonsIter = m_projectButtons . erase ( projectButtonsIter ) ;
projectButtonsIter = m_projectButtons . erase ( projectButtonsIter ) ;
}
}
else
else
@ -215,7 +226,7 @@ namespace O3DE::ProjectManager
QString buildProjectPath = " " ;
QString buildProjectPath = " " ;
if ( m_currentBuilder )
if ( m_currentBuilder )
{
{
buildProjectPath = m_currentBuilder- > GetProjectInfo ( ) . m_path ;
buildProjectPath = QDir: : toNativeSeparators ( m_currentBuilder- > GetProjectInfo ( ) . m_path ) ;
}
}
// Put currently building project in front, then queued projects, then sorts alphabetically
// Put currently building project in front, then queued projects, then sorts alphabetically
@ -249,13 +260,13 @@ namespace O3DE::ProjectManager
// Add any missing project buttons and restore buttons to default state
// Add any missing project buttons and restore buttons to default state
for ( const ProjectInfo & project : projectsVector )
for ( const ProjectInfo & project : projectsVector )
{
{
if ( ! m_projectButtons . contains ( project. m_path ) )
if ( ! m_projectButtons . contains ( QDir: : toNativeSeparators ( project. m_path ) ) )
{
{
m_projectButtons . insert ( project. m_path , CreateProjectButton ( project ) ) ;
m_projectButtons . insert ( QDir: : toNativeSeparators ( project. m_path ) , CreateProjectButton ( project ) ) ;
}
}
else
else
{
{
auto projectButtonIter = m_projectButtons . find ( project. m_path ) ;
auto projectButtonIter = m_projectButtons . find ( QDir: : toNativeSeparators ( project. m_path ) ) ;
if ( projectButtonIter ! = m_projectButtons . end ( ) )
if ( projectButtonIter ! = m_projectButtons . end ( ) )
{
{
projectButtonIter . value ( ) - > RestoreDefaultState ( ) ;
projectButtonIter . value ( ) - > RestoreDefaultState ( ) ;
@ -273,7 +284,7 @@ namespace O3DE::ProjectManager
for ( const ProjectInfo & project : m_buildQueue )
for ( const ProjectInfo & project : m_buildQueue )
{
{
auto projectIter = m_projectButtons . find ( project. m_path ) ;
auto projectIter = m_projectButtons . find ( QDir: : toNativeSeparators ( project. m_path ) ) ;
if ( projectIter ! = m_projectButtons . end ( ) )
if ( projectIter ! = m_projectButtons . end ( ) )
{
{
projectIter . value ( ) - > SetProjectButtonAction (
projectIter . value ( ) - > SetProjectButtonAction (
@ -288,7 +299,7 @@ namespace O3DE::ProjectManager
for ( const ProjectInfo & project : m_requiresBuild )
for ( const ProjectInfo & project : m_requiresBuild )
{
{
auto projectIter = m_projectButtons . find ( project. m_path ) ;
auto projectIter = m_projectButtons . find ( QDir: : toNativeSeparators ( project. m_path ) ) ;
if ( projectIter ! = m_projectButtons . end ( ) )
if ( projectIter ! = m_projectButtons . end ( ) )
{
{
if ( project . m_buildFailed )
if ( project . m_buildFailed )