diff options
author | bunnei <bunneidev@gmail.com> | 2019-02-06 12:33:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-06 12:33:35 -0500 |
commit | b34ae2235d15dd015c99ce41a672fe9ae08816bb (patch) | |
tree | 014ca489d2930cf08e267575b9fc7b793b5cfb0e | |
parent | 40cd299f01d7c77b98ceaad2867aafacca42131d (diff) | |
parent | f598490b57163680b0029bcb8f0077012b962498 (diff) |
Merge pull request #2086 from FearlessTobi/port-4583
Port citra-emu/citra#4583: "citra_qt: Fix saving screenshot when no file extension is provided"
-rw-r--r-- | src/yuzu/main.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index ab403b3ac5..485e29de20 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1682,12 +1682,16 @@ void GMainWindow::OnToggleFilterBar() { void GMainWindow::OnCaptureScreenshot() { OnPauseGame(); - const QString path = - QFileDialog::getSaveFileName(this, tr("Capture Screenshot"), - UISettings::values.screenshot_path, tr("PNG Image (*.png)")); - if (!path.isEmpty()) { - UISettings::values.screenshot_path = QFileInfo(path).path(); - render_window->CaptureScreenshot(UISettings::values.screenshot_resolution_factor, path); + QFileDialog png_dialog(this, tr("Capture Screenshot"), UISettings::values.screenshot_path, + tr("PNG Image (*.png)")); + png_dialog.setAcceptMode(QFileDialog::AcceptSave); + png_dialog.setDefaultSuffix("png"); + if (png_dialog.exec()) { + const QString path = png_dialog.selectedFiles().first(); + if (!path.isEmpty()) { + UISettings::values.screenshot_path = QFileInfo(path).path(); + render_window->CaptureScreenshot(UISettings::values.screenshot_resolution_factor, path); + } } OnStartGame(); } |