return ID of the created profile
This commit is contained in:
@@ -322,7 +322,7 @@ Profile &ProfileManager::GetLocalProfile( const CString &sProfileID )
|
|||||||
return *iter->second;
|
return *iter->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProfileManager::CreateLocalProfile( CString sName )
|
bool ProfileManager::CreateLocalProfile( CString sName, CString &sProfileIDOut )
|
||||||
{
|
{
|
||||||
ASSERT( !sName.empty() );
|
ASSERT( !sName.empty() );
|
||||||
|
|
||||||
@@ -343,6 +343,10 @@ bool ProfileManager::CreateLocalProfile( CString sName )
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool bResult = Profile::CreateNewProfile( sProfileDir, sName );
|
bool bResult = Profile::CreateNewProfile( sProfileDir, sName );
|
||||||
|
if( bResult )
|
||||||
|
sProfileIDOut = sProfileID;
|
||||||
|
else
|
||||||
|
sProfileIDOut = "";
|
||||||
RefreshLocalProfilesFromDisk();
|
RefreshLocalProfilesFromDisk();
|
||||||
return bResult;
|
return bResult;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public:
|
|||||||
void RefreshLocalProfilesFromDisk();
|
void RefreshLocalProfilesFromDisk();
|
||||||
Profile &GetLocalProfile( const CString &sProfileID );
|
Profile &GetLocalProfile( const CString &sProfileID );
|
||||||
|
|
||||||
bool CreateLocalProfile( CString sName );
|
bool CreateLocalProfile( CString sName, CString &sProfileIDOut );
|
||||||
bool RenameLocalProfile( CString sProfileID, CString sNewName );
|
bool RenameLocalProfile( CString sProfileID, CString sNewName );
|
||||||
bool DeleteLocalProfile( CString sProfileID );
|
bool DeleteLocalProfile( CString sProfileID );
|
||||||
CString GetNewLocalProfileDefaultName() const;
|
CString GetNewLocalProfileDefaultName() const;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ void ScreenSelectProfile::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
ASSERT( GAMESTATE->m_sLastSelectedProfileID.empty() )
|
ASSERT( GAMESTATE->m_sLastSelectedProfileID.empty() )
|
||||||
|
|
||||||
// create
|
// create
|
||||||
bool bResult = PROFILEMAN->CreateLocalProfile( sNewName );
|
bool bResult = PROFILEMAN->CreateLocalProfile( sNewName, GAMESTATE->m_sLastSelectedProfileID );
|
||||||
if( bResult )
|
if( bResult )
|
||||||
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user