fix exporting all songs once per row
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user