fix exporting all songs once per row

This commit is contained in:
Chris Danford
2008-02-24 01:11:22 +00:00
parent f0c0a76238
commit e4c6b872e1
+10 -10
View File
@@ -44,24 +44,24 @@ void ScreenOptionsToggleSongs::BeginScreen()
void ScreenOptionsToggleSongs::ImportOptions( int iRow, const vector<PlayerNumber> &vpns ) void ScreenOptionsToggleSongs::ImportOptions( int iRow, const vector<PlayerNumber> &vpns )
{ {
for( int i = 0; i < (int) m_apSongs.size(); ++i ) if( iRow >= (int)m_apSongs.size() ) // exit row
{ return;
OptionRow &row = *m_pRows[i];
bool bEnable = m_apSongs[i]->GetEnabled(); OptionRow &row = *m_pRows[iRow];
bool bEnable = m_apSongs[iRow]->GetEnabled();
int iSelection = bEnable? 0:1; int iSelection = bEnable? 0:1;
row.SetOneSharedSelection( iSelection ); row.SetOneSharedSelection( iSelection );
} }
}
void ScreenOptionsToggleSongs::ExportOptions( int iRow, const vector<PlayerNumber> &vpns ) void ScreenOptionsToggleSongs::ExportOptions( int iRow, const vector<PlayerNumber> &vpns )
{ {
for( int i = 0; i < (int) m_apSongs.size(); ++i ) if( iRow >= (int)m_apSongs.size() ) // exit row
{ return;
const OptionRow &row = *m_pRows[i];
const OptionRow &row = *m_pRows[iRow];
int iSelection = row.GetOneSharedSelection(); int iSelection = row.GetOneSharedSelection();
bool bEnable = (iSelection == 0); bool bEnable = (iSelection == 0);
m_apSongs[i]->SetEnabled( bEnable ); m_apSongs[iRow]->SetEnabled( bEnable );
}
SONGMAN->SaveEnabledSongsToPref(); SONGMAN->SaveEnabledSongsToPref();
PREFSMAN->SavePrefsToDisk(); PREFSMAN->SavePrefsToDisk();