From d33f1d13926f4aa2afebad31775222cdd278411c Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 2 Feb 2020 16:05:27 -0800 Subject: [PATCH] Qt: Fix GIF view not allowing manual filename entry --- CHANGES | 1 + src/platform/qt/GIFView.cpp | 18 ++++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 593f75088..73c8314e8 100644 --- a/CHANGES +++ b/CHANGES @@ -27,6 +27,7 @@ Other fixes: - Qt: Fix toggled actions on gamepads (fixes mgba.io/i/1650) - Qt: Fix extraneous dialog (fixes mgba.io/i/1654) - Qt: Fix window title not updating after shutting down game + - Qt: Fix GIF view not allowing manual filename entry - Util: Fix crash reading invalid ELFs Misc: - Qt: Renderer can be changed while a game is running diff --git a/src/platform/qt/GIFView.cpp b/src/platform/qt/GIFView.cpp index 8a6d47fc7..eda022538 100644 --- a/src/platform/qt/GIFView.cpp +++ b/src/platform/qt/GIFView.cpp @@ -59,22 +59,20 @@ void GIFView::stopRecording() { emit recordingStopped(); FFmpegEncoderClose(&m_encoder); m_ui.stop->setEnabled(false); - m_ui.start->setEnabled(true); + m_ui.start->setEnabled(!m_filename.isEmpty()); m_ui.frameskip->setEnabled(true); } void GIFView::selectFile() { QString filename = GBAApp::app()->getSaveFileName(this, tr("Select output file"), tr("Graphics Interchange Format (*.gif)")); - if (!filename.isEmpty()) { - m_ui.filename->setText(filename); - if (!FFmpegEncoderIsOpen(&m_encoder)) { - m_ui.start->setEnabled(true); - } + m_ui.filename->setText(filename); +} + +void GIFView::setFilename(const QString& filename) { + m_filename = filename; + if (!FFmpegEncoderIsOpen(&m_encoder)) { + m_ui.start->setEnabled(!filename.isEmpty()); } } -void GIFView::setFilename(const QString& fname) { - m_filename = fname; -} - #endif