mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-17 16:50:26 +02:00
User visible message when there are errors importing labels
This commit is contained in:
parent
52f0f750d9
commit
da28a45d67
@ -2163,14 +2163,17 @@ void LabelTrack::Import(wxTextFile & in)
|
|||||||
//Currently, we expect a tag file to have two values and a label
|
//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
|
//on each line. If the second token is not a number, we treat
|
||||||
//it as a single-value label.
|
//it as a single-value label.
|
||||||
|
bool error = false;
|
||||||
for (int index = 0; index < lines;) {
|
for (int index = 0; index < lines;) {
|
||||||
try {
|
try {
|
||||||
// Let LabelStruct::Import advance index
|
// Let LabelStruct::Import advance index
|
||||||
LabelStruct l { LabelStruct::Import(in, index) };
|
LabelStruct l { LabelStruct::Import(in, index) };
|
||||||
mLabels.push_back(l);
|
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();
|
SortLabels();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user