-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
frontend: Improve UX around recording paths #12395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -114,7 +114,7 @@ void OBSBasic::OutputPathInvalidMessage() | |||||
| { | ||||||
| blog(LOG_ERROR, "Recording stopped because of bad output path"); | ||||||
|
|
||||||
| OBSMessageBox::critical(this, QTStr("Output.BadPath.Title"), QTStr("Output.BadPath.Text")); | ||||||
| OBSMessageBox::critical(this, QTStr("Output.Error.Title"), QTStr("Output.PathError.Text")); | ||||||
| } | ||||||
|
|
||||||
| bool OBSBasic::IsFFmpegOutputToURL() const | ||||||
|
|
@@ -140,3 +140,27 @@ bool OBSBasic::OutputPathValid() | |||||
| const char *path = GetCurrentOutputPath(); | ||||||
| return path && *path && QDir(path).exists(); | ||||||
| } | ||||||
|
|
||||||
| bool OBSBasic::promptCreateOutputPath() | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
It's probably irrelevant to the calling code how this is ensured, but it only cares that it is ensured.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not ensured in this case since the user could click no. Would that still be appropriate here?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO it's fine if the function that is supposed to ensure this path exists tells you it "couldn't do it", because then you know it wasn't able to fulfil its job. It also makes sense that the code will not continue, because a precondition isn't true. |
||||||
| { | ||||||
| const char *path = GetCurrentOutputPath(); | ||||||
|
|
||||||
| if (!path || !*path) { | ||||||
| return false; | ||||||
| } | ||||||
|
|
||||||
| auto result = OBSMessageBox::question(this, QTStr("Output.BadPath.Title"), | ||||||
| QTStr("Output.BadPath.Text").arg(path), | ||||||
| QMessageBox::Yes | QMessageBox::No); | ||||||
|
|
||||||
| if (result == QMessageBox::No) { | ||||||
| return false; | ||||||
| } | ||||||
|
|
||||||
| auto makeDirectory = os_mkdir(path); | ||||||
| if (makeDirectory == MKDIR_ERROR) { | ||||||
| OBSMessageBox::critical(this, QTStr("Error"), QTStr("Failed to create directory '%1'").arg(path)); | ||||||
| } | ||||||
|
|
||||||
| return makeDirectory != MKDIR_ERROR; | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successby itself is ambiguous - did it successfully render the texture? Generate the image data? Store it to disk?The only way to understand this is to go backwards from the
Basic.StatusBar.ScreenshotSavedTostring being generated uponsuccessbut parsing the code that far shouldn't be necessary.