summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-02-06 18:33:35 +0100
committerGitHub <noreply@github.com>2019-02-06 18:33:35 +0100
commitb34ae2235d15dd015c99ce41a672fe9ae08816bb (patch)
tree014ca489d2930cf08e267575b9fc7b793b5cfb0e
parentMerge pull request #2087 from lioncash/const (diff)
parentFix crash when no files are selected (diff)
downloadyuzu-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.cpp16
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();
}