Bug 2326 - Export settings from one effect can be attempted to be imported into another effect - silent fail, with no error message
This commit is contained in:
parent
3545097fe9
commit
64811e49f9
|
@ -665,6 +665,7 @@ void Effect::ExportPresets()
|
||||||
{
|
{
|
||||||
wxString params;
|
wxString params;
|
||||||
GetAutomationParameters(params);
|
GetAutomationParameters(params);
|
||||||
|
params = GetSymbol().Internal() + ":" + params;
|
||||||
|
|
||||||
wxFileName path;
|
wxFileName path;
|
||||||
|
|
||||||
|
@ -740,6 +741,27 @@ void Effect::ImportPresets()
|
||||||
wxFFile f(path.GetFullPath());
|
wxFFile f(path.GetFullPath());
|
||||||
if (f.IsOpened()) {
|
if (f.IsOpened()) {
|
||||||
if (f.ReadAll(¶ms)) {
|
if (f.ReadAll(¶ms)) {
|
||||||
|
wxString ident = params.BeforeFirst(':');
|
||||||
|
params = params.AfterFirst(':');
|
||||||
|
if (ident != GetSymbol().Internal()) {
|
||||||
|
// effect identifiers are a sensible length!
|
||||||
|
// must also have some params.
|
||||||
|
if ((params.Length() < 2 ) || (ident.Length() < 2) || (ident.Length() > 30))
|
||||||
|
{
|
||||||
|
Effect::MessageBox(
|
||||||
|
/* i18n-hint %s will be replaced by a file name */
|
||||||
|
XO("%s: Was not a valid presets file.\n")
|
||||||
|
.Format(path.GetFullName()));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Effect::MessageBox(
|
||||||
|
/* i18n-hint %s will be replaced by a file name */
|
||||||
|
XO("%s: Was not for this effect.\n")
|
||||||
|
.Format(path.GetFullName()));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
SetAutomationParameters(params);
|
SetAutomationParameters(params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user