mirror of
https://github.com/cookiengineer/audacity
synced 2026-02-16 07:47:58 +01:00
User visible message when there are errors importing labels
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user