summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2019-02-06 12:33:35 -0500
committerGravatar GitHub2019-02-06 12:33:35 -0500
commitb34ae2235d15dd015c99ce41a672fe9ae08816bb (patch)
tree014ca489d2930cf08e267575b9fc7b793b5cfb0e /src
parentMerge pull request #2087 from lioncash/const (diff)
parentFix crash when no files are selected (diff)
downloadyuzu-b34ae2235d15dd015c99ce41a672fe9ae08816bb.tar.gz
yuzu-b34ae2235d15dd015c99ce41a672fe9ae08816bb.tar.xz
yuzu-b34ae2235d15dd015c99ce41a672fe9ae08816bb.zip
Merge pull request #2086 from FearlessTobi/port-4583
Port citra-emu/citra#4583: "citra_qt: Fix saving screenshot when no file extension is provided"
Diffstat (limited to 'src')
-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() {
1682 1682
1683void GMainWindow::OnCaptureScreenshot() { 1683void GMainWindow::OnCaptureScreenshot() {
1684 OnPauseGame(); 1684 OnPauseGame();
1685 const QString path = 1685 QFileDialog png_dialog(this, tr("Capture Screenshot"), UISettings::values.screenshot_path,
1686 QFileDialog::getSaveFileName(this, tr("Capture Screenshot"), 1686 tr("PNG Image (*.png)"));
1687 UISettings::values.screenshot_path, tr("PNG Image (*.png)")); 1687 png_dialog.setAcceptMode(QFileDialog::AcceptSave);
1688 if (!path.isEmpty()) { 1688 png_dialog.setDefaultSuffix("png");
1689 UISettings::values.screenshot_path = QFileInfo(path).path(); 1689 if (png_dialog.exec()) {
1690 render_window->CaptureScreenshot(UISettings::values.screenshot_resolution_factor, path); 1690 const QString path = png_dialog.selectedFiles().first();
1691 if (!path.isEmpty()) {
1692 UISettings::values.screenshot_path = QFileInfo(path).path();
1693 render_window->CaptureScreenshot(UISettings::values.screenshot_resolution_factor, path);
1694 }
1691 } 1695 }
1692 OnStartGame(); 1696 OnStartGame();
1693} 1697}