Merge pull request #4583 from xperia64/screenshot_fix

citra_qt: Fix saving screenshot when no file extension is provided
This commit is contained in:
Weiyi Wang 2019-02-01 10:49:28 -05:00 committed by GitHub
commit 2731437a17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1561,12 +1561,16 @@ void GMainWindow::OnStopRecordingPlayback() {
void GMainWindow::OnCaptureScreenshot() { void GMainWindow::OnCaptureScreenshot() {
OnPauseGame(); OnPauseGame();
const QString path = QFileDialog png_dialog(this, tr("Capture Screenshot"), UISettings::values.screenshot_path,
QFileDialog::getSaveFileName(this, tr("Capture Screenshot"), tr("PNG Image (*.png)"));
UISettings::values.screenshot_path, tr("PNG Image (*.png)")); png_dialog.setAcceptMode(QFileDialog::AcceptSave);
if (!path.isEmpty()) { png_dialog.setDefaultSuffix("png");
UISettings::values.screenshot_path = QFileInfo(path).path(); if (png_dialog.exec()) {
render_window->CaptureScreenshot(UISettings::values.screenshot_resolution_factor, path); 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(); OnStartGame();
} }