1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-19 14:17:41 +02:00

Theme Preferences, Save Files overwrites all components after asking

This commit is contained in:
Paul Licameli 2016-05-30 16:30:39 -04:00
parent 8da61cdbb1
commit efc0e67934

View File

@ -960,8 +960,32 @@ void ThemeBase::SaveComponents()
if( (mBitmapFlags[i] & resFlagInternal)==0)
{
FileName = FileNames::ThemeComponent( mBitmapNames[i] );
if( !wxFileExists( FileName ))
if( wxFileExists( FileName ))
{
++n;
break;
}
}
}
if (n > 0)
{
auto result =
wxMessageBox(
wxString::Format(
_("Some required files in:\n %s\nwere already present. Overwrite?"),
FileNames::ThemeComponentsDir().c_str()),
wxMessageBoxCaptionStr,
wxYES_NO | wxNO_DEFAULT);
if(result == wxNO)
return;
}
for(i=0;i<(int)mImages.GetCount();i++)
{
if( (mBitmapFlags[i] & resFlagInternal)==0)
{
FileName = FileNames::ThemeComponent( mBitmapNames[i] );
if( !mImages[i].SaveFile( FileName, wxBITMAP_TYPE_PNG ))
{
wxMessageBox(
@ -970,18 +994,8 @@ void ThemeBase::SaveComponents()
FileName.c_str() ));
return;
}
n++;
}
}
}
if( n==0 )
{
wxMessageBox(
wxString::Format(
_("All required files in:\n %s\nwere already present."),
FileNames::ThemeComponentsDir().c_str() ));
return;
}
wxMessageBox(
wxString::Format(
wxT("Theme written to:\n %s."),