1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-01 16:39:30 +02:00

User visible message when there are errors importing labels

This commit is contained in:
Paul Licameli 2017-04-03 23:12:24 -04:00
parent 52f0f750d9
commit da28a45d67

View File

@ -2163,14 +2163,17 @@ void LabelTrack::Import(wxTextFile & in)
//Currently, we expect a tag file to have two values and a label
//on each line. If the second token is not a number, we treat
//it as a single-value label.
bool error = false;
for (int index = 0; index < lines;) {
try {
// Let LabelStruct::Import advance index
LabelStruct l { LabelStruct::Import(in, index) };
mLabels.push_back(l);
}
catch(const LabelStruct::BadFormatException&) {}
catch(const LabelStruct::BadFormatException&) { error = true; }
}
if (error)
::wxMessageBox( _("One or more saved labels could not be read.") );
SortLabels();
}