Originally, the AdjustSync class always saved to disk, even in edit mode.

In edit mode, though, AdjustSync should only save to memory, giving the
user a chance to save later.  This change adds a SongChanged message
to the MessageManager.  Making the ScreenEdit class listen to this
message allows the AdjustSync class to mark a song as dirty rather than
saving it to disk when in edit mode.

R=steve chekoway
This commit is contained in:
John Bauer
2006-11-02 05:30:02 +00:00
parent db38f88c39
commit 592c27996d
5 changed files with 27 additions and 5 deletions
+11
View File
@@ -763,6 +763,8 @@ void ScreenEdit::Init()
this->HandleScreenMessage( SM_UpdateTextInfo );
m_bTextInfoNeedsUpdate = true;
SubscribeToMessage( Message_SongChanged );
}
ScreenEdit::~ScreenEdit()
@@ -2365,6 +2367,15 @@ void ScreenEdit::ScrollTo( float fDestinationBeat )
m_soundChangeLine.Play();
}
void ScreenEdit::HandleMessage( const RString &sMessage )
{
if( sMessage == MessageToString( Message_SongChanged ) )
{
SetDirty( true );
}
Screen::HandleMessage( sMessage );
}
static LocalizedString SAVE_SUCCESSFUL ( "ScreenEdit", "Save successful." );
void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )