Merge pull request #2279 from Lqlsoftware/Lqlsoftware-UI-patch

UI: Properly inform user if recording path is invalid
master
Jim 2019-12-30 18:18:18 -08:00 committed by GitHub
commit e5871483ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View File

@ -5416,6 +5416,12 @@ void OBSBasic::StartRecording()
if (disableOutputsRef)
return;
if (!OutputPathValid()) {
OutputPathInvalidMessage();
ui->recordButton->setChecked(false);
return;
}
if (LowDiskSpace()) {
DiskSpaceMessage();
ui->recordButton->setChecked(false);
@ -7655,6 +7661,20 @@ const char *OBSBasic::GetCurrentOutputPath()
return path;
}
void OBSBasic::OutputPathInvalidMessage()
{
blog(LOG_ERROR, "Recording stopped because of bad output path");
OBSMessageBox::critical(this, QTStr("Output.BadPath.Title"),
QTStr("Output.BadPath.Text"));
}
bool OBSBasic::OutputPathValid()
{
const char *path = GetCurrentOutputPath();
return path && *path && QDir(path).exists();
}
void OBSBasic::DiskSpaceMessage()
{
blog(LOG_ERROR, "Recording stopped because of low disk space");

View File

@ -683,6 +683,9 @@ private:
void UpdatePause(bool activate = true);
void UpdateReplayBuffer(bool activate = true);
bool OutputPathValid();
void OutputPathInvalidMessage();
bool LowDiskSpace();
void DiskSpaceMessage();