From da28a45d675bc6c485fac2b253b3c3938fa92828 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Mon, 3 Apr 2017 23:12:24 -0400 Subject: [PATCH] User visible message when there are errors importing labels --- src/LabelTrack.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/LabelTrack.cpp b/src/LabelTrack.cpp index 53922ac64..2c5cf8398 100644 --- a/src/LabelTrack.cpp +++ b/src/LabelTrack.cpp @@ -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(); }