diff options
| author | 2019-05-29 02:24:29 -0400 | |
|---|---|---|
| committer | 2019-06-03 15:34:32 -0400 | |
| commit | 77ce85f51d54f96472e1c9797a71c36f2ace72f3 (patch) | |
| tree | cca50186def158cb97fa2f364104e6f88ffbe7db /src | |
| parent | yuzu/bootmanager: Treat the resolution factor as a u32 (diff) | |
| download | yuzu-77ce85f51d54f96472e1c9797a71c36f2ace72f3.tar.gz yuzu-77ce85f51d54f96472e1c9797a71c36f2ace72f3.tar.xz yuzu-77ce85f51d54f96472e1c9797a71c36f2ace72f3.zip | |
yuzu/bootmanager: Log out screenshot destination path
We can make this message more meaningful by indicating the location the
screenshot has been saved to. We can also log out whenever a screenshot
could not be saved (e.g. due to filesystem permissions or some other
reason).
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/bootmanager.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 7818b141f..afec33b61 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp | |||
| @@ -435,12 +435,17 @@ void GRenderWindow::CaptureScreenshot(u32 res_scale, const QString& screenshot_p | |||
| 435 | 435 | ||
| 436 | const Layout::FramebufferLayout layout{Layout::FrameLayoutFromResolutionScale(res_scale)}; | 436 | const Layout::FramebufferLayout layout{Layout::FrameLayoutFromResolutionScale(res_scale)}; |
| 437 | screenshot_image = QImage(QSize(layout.width, layout.height), QImage::Format_RGB32); | 437 | screenshot_image = QImage(QSize(layout.width, layout.height), QImage::Format_RGB32); |
| 438 | renderer.RequestScreenshot(screenshot_image.bits(), | 438 | renderer.RequestScreenshot( |
| 439 | [=] { | 439 | screenshot_image.bits(), |
| 440 | screenshot_image.mirrored(false, true).save(screenshot_path); | 440 | [=] { |
| 441 | LOG_INFO(Frontend, "The screenshot is saved."); | 441 | const std::string std_screenshot_path = screenshot_path.toStdString(); |
| 442 | }, | 442 | if (screenshot_image.mirrored(false, true).save(screenshot_path)) { |
| 443 | layout); | 443 | LOG_INFO(Frontend, "Screenshot saved to \"{}\"", std_screenshot_path); |
| 444 | } else { | ||
| 445 | LOG_ERROR(Frontend, "Failed to save screenshot to \"{}\"", std_screenshot_path); | ||
| 446 | } | ||
| 447 | }, | ||
| 448 | layout); | ||
| 444 | } | 449 | } |
| 445 | 450 | ||
| 446 | void GRenderWindow::OnMinimalClientAreaChangeRequest(std::pair<u32, u32> minimal_size) { | 451 | void GRenderWindow::OnMinimalClientAreaChangeRequest(std::pair<u32, u32> minimal_size) { |