diff --git a/src/apps/mediaconverter/MediaConverterApp.cpp b/src/apps/mediaconverter/MediaConverterApp.cpp index e3949d3543..5fc41d0b5f 100644 --- a/src/apps/mediaconverter/MediaConverterApp.cpp +++ b/src/apps/mediaconverter/MediaConverterApp.cpp @@ -204,6 +204,18 @@ MediaConverterApp::_CreateOutputFile(BDirectory directory, name.Append(outputFormat->file_extension); + BEntry directoryEntry; + directory.GetEntry(&directoryEntry); + if (!directoryEntry.Exists()) { + BAlert* alert = new BAlert(B_TRANSLATE("Error"), + B_TRANSLATE("Selected directory not found. " + "Defaulting to /boot/home"), + B_TRANSLATE("OK")); + alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); + alert->Go(); + directory.SetTo("/boot/home"); + } + BEntry inEntry(ref); BEntry outEntry; @@ -318,6 +330,11 @@ MediaConverterApp::_RunConvert() } else { + srcIndex++; + BString error( + B_TRANSLATE("Error converting '%filename'")); + error.ReplaceAll("%filename", inRef.name); + fWin->SetStatusMessage(error.String()); fWin->Unlock(); break; } @@ -391,6 +408,9 @@ MediaConverterApp::_ConvertFile(BMediaFile* inFile, BMediaFile* outFile, B_TRANSLATE("Audio quality not supported")); fWin->Unlock(); } + } else { + fWin->SetStatusMessage( + B_TRANSLATE("Error creating track.")); } } else if (inFormat.IsVideo() && (videoCodec != NULL)) { @@ -465,9 +485,14 @@ MediaConverterApp::_ConvertFile(BMediaFile* inFile, BMediaFile* outFile, fWin->SetVideoQualityLabel(videoQualitySupport); fWin->Unlock(); } + } else { + fWin->SetStatusMessage( + B_TRANSLATE("Error creating video.")); } } else { // didn't do anything with the track + fWin->SetStatusMessage( + B_TRANSLATE("Input file not recognized as Audio or Video")); inFile->ReleaseTrack(inTrack); } } diff --git a/src/apps/mediaconverter/MediaConverterWindow.cpp b/src/apps/mediaconverter/MediaConverterWindow.cpp index 7fee41fa76..7cf8336c84 100644 --- a/src/apps/mediaconverter/MediaConverterWindow.cpp +++ b/src/apps/mediaconverter/MediaConverterWindow.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -1005,6 +1006,19 @@ MediaConverterWindow::_CreateMenu() void MediaConverterWindow::_SetOutputFolder(BEntry entry) { - fOutputDir.SetTo(&entry); + BPath path; + entry.GetPath(&path); + if (access(path.Path(), W_OK) != -1) { + fOutputDir.SetTo(&entry); + } else { + BString errorString(B_TRANSLATE("Error writing to location: %strPath%." + " Defaulting to location: /boot/home")); + errorString.ReplaceFirst("%strPath%", path.Path()); + BAlert* alert = new BAlert(B_TRANSLATE("Error"), + errorString.String(), B_TRANSLATE("OK")); + alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); + alert->Go(); + fOutputDir.SetTo("/boot/home"); + } TruncateOutputFolderPath(); }