From 193a3956d26bc0c97ac884850b080d988e1bd66e Mon Sep 17 00:00:00 2001 From: Humdinger Date: Sun, 12 Jan 2014 17:39:23 +0100 Subject: [PATCH] Improved error message ...in case a single drag&dropped file isn't an audio file. --- src/apps/soundrecorder/RecorderWindow.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/apps/soundrecorder/RecorderWindow.cpp b/src/apps/soundrecorder/RecorderWindow.cpp index 91f9ea4b63..f2fb731f93 100644 --- a/src/apps/soundrecorder/RecorderWindow.cpp +++ b/src/apps/soundrecorder/RecorderWindow.cpp @@ -1335,16 +1335,22 @@ RecorderWindow::RefsReceived(BMessage *msg) countBad++; } - if (countBad > 0 && countGood == 0) { + if (countBad == 1 && countGood == 0) { BAlert* alert = new BAlert(B_TRANSLATE("Nothing to play"), - B_TRANSLATE("None of the files appear to be audio files"), + B_TRANSLATE("The file doesn't appear to be an audio file."), + B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); + alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); + alert->Go(); + } else if (countBad > 0 && countGood == 0) { + BAlert* alert = new BAlert(B_TRANSLATE("Nothing to play"), + B_TRANSLATE("None of the files appear to be audio files."), B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); alert->Go(); } else if (countGood > 0) { if (countBad > 0) { BAlert* alert = new BAlert(B_TRANSLATE("Invalid audio files"), - B_TRANSLATE("Some of the files don't appear to be audio files"), + B_TRANSLATE("Some of the files don't appear to be audio files."), B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);