From c8bc60eff4b431bfe9a0e76181dd301034d4382e Mon Sep 17 00:00:00 2001 From: martynshaw99 Date: Mon, 26 Nov 2012 00:15:39 +0000 Subject: [PATCH] Fix bug #599 where we didn't do something sensible when somebody has a corrupt .xml EQ file. Also improve the error message so they can see which file is corrupt. --- src/effects/Equalization.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/effects/Equalization.cpp b/src/effects/Equalization.cpp index 8956877c9..ae6022055 100644 --- a/src/effects/Equalization.cpp +++ b/src/effects/Equalization.cpp @@ -1023,12 +1023,16 @@ void EqualizationDialog::LoadCurves(wxString fileName, bool append) XMLFileReader reader; if( !reader.Parse( this, fn.GetFullPath() ) ) { - // Inform user of load failure - wxMessageBox( reader.GetErrorStr(), + wxString msg; /* i18n-hint: EQ stands for 'Equalization'.*/ - _("Error Loading EQ Curve"), + msg.Printf(_("Error Loading EQ Curves from file:\n%s\nError message says:\n%s"), fn.GetFullPath(), reader.GetErrorStr()); + // Inform user of load failure + wxMessageBox( msg, + _("Error Loading EQ Curves"), wxOK | wxCENTRE, this ); + mCurves.Add( _("unnamed") ); // we always need a default curve to use + return; } if( mCurves.Last().Name != _("unnamed") ) mCurves.Add( _("unnamed") ); // we always need a default curve to use