UI: Properly inform user if recording path is invalid
This commit is contained in:
parent
95faa461ba
commit
046464884a
@ -5416,6 +5416,12 @@ void OBSBasic::StartRecording()
|
|||||||
if (disableOutputsRef)
|
if (disableOutputsRef)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!OutputPathValid()) {
|
||||||
|
OutputPathInvalidMessage();
|
||||||
|
ui->recordButton->setChecked(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (LowDiskSpace()) {
|
if (LowDiskSpace()) {
|
||||||
DiskSpaceMessage();
|
DiskSpaceMessage();
|
||||||
ui->recordButton->setChecked(false);
|
ui->recordButton->setChecked(false);
|
||||||
@ -7655,6 +7661,20 @@ const char *OBSBasic::GetCurrentOutputPath()
|
|||||||
return path;
|
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()
|
void OBSBasic::DiskSpaceMessage()
|
||||||
{
|
{
|
||||||
blog(LOG_ERROR, "Recording stopped because of low disk space");
|
blog(LOG_ERROR, "Recording stopped because of low disk space");
|
||||||
|
@ -683,6 +683,9 @@ private:
|
|||||||
void UpdatePause(bool activate = true);
|
void UpdatePause(bool activate = true);
|
||||||
void UpdateReplayBuffer(bool activate = true);
|
void UpdateReplayBuffer(bool activate = true);
|
||||||
|
|
||||||
|
bool OutputPathValid();
|
||||||
|
void OutputPathInvalidMessage();
|
||||||
|
|
||||||
bool LowDiskSpace();
|
bool LowDiskSpace();
|
||||||
void DiskSpaceMessage();
|
void DiskSpaceMessage();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user