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
+14 -14
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];
int iSelection = bEnable? 0:1; bool bEnable = m_apSongs[iRow]->GetEnabled();
row.SetOneSharedSelection( iSelection ); int iSelection = bEnable? 0:1;
} 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];
int iSelection = row.GetOneSharedSelection(); const OptionRow &row = *m_pRows[iRow];
bool bEnable = (iSelection == 0); int iSelection = row.GetOneSharedSelection();
m_apSongs[i]->SetEnabled( bEnable ); bool bEnable = (iSelection == 0);
} m_apSongs[iRow]->SetEnabled( bEnable );
SONGMAN->SaveEnabledSongsToPref(); SONGMAN->SaveEnabledSongsToPref();
PREFSMAN->SavePrefsToDisk(); PREFSMAN->SavePrefsToDisk();