Add warnings when using invalid (Replay Buffer) File Path(s)
parent
f7cab29172
commit
c8b7f3eab4
|
@ -75,8 +75,20 @@ void SettingsPublish::DestroyPane()
|
|||
|
||||
void SettingsPublish::ApplySettings()
|
||||
{
|
||||
auto check_expanded_dir = [&](String path, String err, String errCaption)
|
||||
{
|
||||
String expanded = GetExpandedRecordingDirectoryBase(path);
|
||||
if (OSFileExists(expanded))
|
||||
return true;
|
||||
|
||||
return OBSMessageBox(hwnd, err.FindReplace(L"$1", expanded), errCaption, MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2 ) != IDNO;
|
||||
};
|
||||
|
||||
//------------------------------------------
|
||||
|
||||
String strSavePath = GetEditText(GetDlgItem(hwnd, IDC_SAVEPATH));
|
||||
String defaultPath = OSGetDefaultVideoSavePath(L"\\.flv");
|
||||
String actualPath = strSavePath;
|
||||
if (!strSavePath.IsValid() && defaultPath.IsValid())
|
||||
{
|
||||
String text = Str("Settings.Publish.InvalidSavePath");
|
||||
|
@ -87,12 +99,17 @@ void SettingsPublish::ApplySettings()
|
|||
return;
|
||||
}
|
||||
SetWindowText(GetDlgItem(hwnd, IDC_SAVEPATH), defaultPath.Array());
|
||||
actualPath = defaultPath;
|
||||
}
|
||||
|
||||
if (!check_expanded_dir(actualPath, Str("Settings.Publish.SavePathDoesNotExist"), Str("Settings.Publish.SavePathDoesNotExistCaption")))
|
||||
return SetAbortApplySettings(true);
|
||||
|
||||
//------------------------------------------
|
||||
|
||||
String replaySavePath = GetEditText(GetDlgItem(hwnd, IDC_REPLAYBUFFERSAVEPATH));
|
||||
defaultPath = OSGetDefaultVideoSavePath(L"\\Replay-$T.flv");
|
||||
actualPath = replaySavePath;
|
||||
if (!replaySavePath.IsValid() && defaultPath.IsValid())
|
||||
{
|
||||
String text = Str("Settings.Publish.InvalidReplayBufferSavePath");
|
||||
|
@ -103,8 +120,12 @@ void SettingsPublish::ApplySettings()
|
|||
return;
|
||||
}
|
||||
SetWindowText(GetDlgItem(hwnd, IDC_REPLAYBUFFERSAVEPATH), defaultPath.Array());
|
||||
actualPath = defaultPath;
|
||||
}
|
||||
|
||||
if (!check_expanded_dir(actualPath, Str("Settings.Publish.ReplayBufferSavePathDoesNotExist"), Str("Settings.Publish.ReplayBufferSavePathDoesNotExistCaption")))
|
||||
return SetAbortApplySettings(true);
|
||||
|
||||
//------------------------------------------
|
||||
|
||||
int curSel = (int)SendMessage(GetDlgItem(hwnd, IDC_MODE), CB_GETCURSEL, 0, 0);
|
||||
|
|
|
@ -3337,9 +3337,20 @@ LRESULT CALLBACK OBS::OBSProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||
case ID_RECORDINGSFOLDER:
|
||||
case ID_SAVEDREPLAYBUFFERS:
|
||||
{
|
||||
bool replayBuffer = LOWORD(wParam) == ID_SAVEDREPLAYBUFFERS;
|
||||
String path = OSGetDefaultVideoSavePath();
|
||||
path = AppConfig->GetString(L"Publish", LOWORD(wParam) == ID_SAVEDREPLAYBUFFERS ? L"ReplayBufferSavePath" : L"SavePath", path.Array());
|
||||
path = GetExpandedRecordingDirectoryBase(path).FindReplace(L"/", L"\\");
|
||||
path = AppConfig->GetString(L"Publish", replayBuffer ? L"ReplayBufferSavePath" : L"SavePath", path.Array());
|
||||
path = GetExpandedRecordingDirectoryBase(path);
|
||||
|
||||
if (!OSFileExists(path))
|
||||
{
|
||||
String message = replayBuffer ? Str("MainMenu.File.ShowSavedReplayBuffers.DoesNotExist") : Str("MainMenu.File.OpenRecordingsFolder.DoesNotExist");
|
||||
message.FindReplace(L"$1", path);
|
||||
OBSMessageBox(hwnd, message, Str("MainMenu.File.DirectoryDoesNotExistCaption"), MB_ICONWARNING | MB_OK);
|
||||
break;
|
||||
}
|
||||
|
||||
path.FindReplace(L"/", L"\\");
|
||||
String lastFile = App->lastOutputFile.FindReplace(L"/", L"\\");
|
||||
|
||||
LPITEMIDLIST item = nullptr;
|
||||
|
|
|
@ -112,6 +112,10 @@ MainMenu.File.OpenRecordingsFolder="Open &Recordings Folder"
|
|||
MainMenu.File.ShowSavedReplayBuffers="Show Saved Replay &Buffers"
|
||||
MainMenu.File.Save="&Save"
|
||||
|
||||
MainMenu.File.OpenRecordingsFolder.DoesNotExist="The directory '$1' does not exist. Check your File Path in Broadcast Settings."
|
||||
MainMenu.File.ShowSavedReplayBuffers.DoesNotExist="The directory '$1' does not exist. Check your Replay Buffer File Path in Broadcast Settings"
|
||||
MainMenu.File.DirectoryDoesNotExistCaption="Directory does not exist"
|
||||
|
||||
MainMenu.Help.OpenHelp="Open Help Page"
|
||||
MainMenu.Help.VisitWebsite="Visit Website"
|
||||
MainMenu.Help.CheckForUpdates="Check for &updates"
|
||||
|
@ -311,8 +315,12 @@ Settings.Publish.StopReplayBufferHotkey="Stop Replay Buffer:"
|
|||
Settings.Publish.Username="User Name (if any):"
|
||||
Settings.Publish.InvalidSavePath="The File Path is invalid, the default Path '$1' will be used instead"
|
||||
Settings.Publish.InvalidSavePathCaption="Invalid File Path"
|
||||
Settings.Publish.SavePathDoesNotExist="File Path '$1' does not exist, recording (from Replay Buffer) won't work.\n\nAre you sure you want use '$1' as File Path?"
|
||||
Settings.Publish.SavePathDoesNotExistCaption="File Path does not exist"
|
||||
Settings.Publish.InvalidReplayBufferSavePath="The Replay Buffer File Path is invalid, the default Path '$1' will be used instead"
|
||||
Settings.Publish.InvalidReplayBufferSavePathCaption="Invalid Replay Buffer File Path"
|
||||
Settings.Publish.ReplayBufferSavePathDoesNotExist="Replay Buffer File Path '$1' does not exist, saving Replay Buffers won't work.\n\nAre you sure you want to use '$1' as Replay Buffer File Path?"
|
||||
Settings.Publish.ReplayBufferSavePathDoesNotExistCaption="Replay Buffer File Path does not exist"
|
||||
|
||||
Settings.Publish.ReplayBufferMemory="Estimated Replay Buffer memory usage (MB):"
|
||||
Settings.Publish.ReplayBufferLength="Replay Buffer length (seconds):"
|
||||
|
|
Loading…
Reference in New Issue