diff options
author | bunnei <bunneidev@gmail.com> | 2019-02-06 18:33:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-06 18:33:35 +0100 |
commit | b34ae2235d15dd015c99ce41a672fe9ae08816bb (patch) | |
tree | 014ca489d2930cf08e267575b9fc7b793b5cfb0e | |
parent | Merge pull request #2087 from lioncash/const (diff) | |
parent | Fix crash when no files are selected (diff) | |
download | yuzu-b34ae2235d15dd015c99ce41a672fe9ae08816bb.tar yuzu-b34ae2235d15dd015c99ce41a672fe9ae08816bb.tar.gz yuzu-b34ae2235d15dd015c99ce41a672fe9ae08816bb.tar.bz2 yuzu-b34ae2235d15dd015c99ce41a672fe9ae08816bb.tar.lz yuzu-b34ae2235d15dd015c99ce41a672fe9ae08816bb.tar.xz yuzu-b34ae2235d15dd015c99ce41a672fe9ae08816bb.tar.zst yuzu-b34ae2235d15dd015c99ce41a672fe9ae08816bb.zip |
-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 ab403b3ac..485e29de2 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(); } |