Merge pull request #2086 from FearlessTobi/port-4583

Port citra-emu/citra#4583: "citra_qt: Fix saving screenshot when no file extension is provided"
This commit is contained in:
bunnei 2019-02-06 12:33:35 -05:00 committed by GitHub
commit b34ae2235d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 6 deletions

View File

@ -1682,13 +1682,17 @@ void GMainWindow::OnToggleFilterBar() {
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);
png_dialog.setDefaultSuffix("png");
if (png_dialog.exec()) {
const QString path = png_dialog.selectedFiles().first();
if (!path.isEmpty()) { if (!path.isEmpty()) {
UISettings::values.screenshot_path = QFileInfo(path).path(); UISettings::values.screenshot_path = QFileInfo(path).path();
render_window->CaptureScreenshot(UISettings::values.screenshot_resolution_factor, path); render_window->CaptureScreenshot(UISettings::values.screenshot_resolution_factor, path);
} }
}
OnStartGame(); OnStartGame();
} }