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:
parent
8da61cdbb1
commit
efc0e67934
@ -960,27 +960,41 @@ void ThemeBase::SaveComponents()
|
|||||||
if( (mBitmapFlags[i] & resFlagInternal)==0)
|
if( (mBitmapFlags[i] & resFlagInternal)==0)
|
||||||
{
|
{
|
||||||
FileName = FileNames::ThemeComponent( mBitmapNames[i] );
|
FileName = FileNames::ThemeComponent( mBitmapNames[i] );
|
||||||
if( !wxFileExists( FileName ))
|
if( wxFileExists( FileName ))
|
||||||
{
|
{
|
||||||
if( !mImages[i].SaveFile( FileName, wxBITMAP_TYPE_PNG ))
|
++n;
|
||||||
{
|
break;
|
||||||
wxMessageBox(
|
|
||||||
wxString::Format(
|
|
||||||
_("Audacity could not save file:\n %s"),
|
|
||||||
FileName.c_str() ));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
n++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( n==0 )
|
|
||||||
|
if (n > 0)
|
||||||
{
|
{
|
||||||
wxMessageBox(
|
auto result =
|
||||||
wxString::Format(
|
wxMessageBox(
|
||||||
_("All required files in:\n %s\nwere already present."),
|
wxString::Format(
|
||||||
FileNames::ThemeComponentsDir().c_str() ));
|
_("Some required files in:\n %s\nwere already present. Overwrite?"),
|
||||||
return;
|
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(
|
||||||
|
wxString::Format(
|
||||||
|
_("Audacity could not save file:\n %s"),
|
||||||
|
FileName.c_str() ));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
wxMessageBox(
|
wxMessageBox(
|
||||||
wxString::Format(
|
wxString::Format(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user