Merge pull request #7884 from JosJuice/save-movie-on-exit

DolphinQt: Save movie when closing emulation
This commit is contained in:
JosJuice 2019-03-16 14:58:16 +01:00 committed by GitHub
commit 08ca9ec21f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -776,7 +776,7 @@ bool MainWindow::RequestStop()
} }
} }
// TODO: Add Movie shutdown OnStopRecording();
// TODO: Add Debugger shutdown // TODO: Add Debugger shutdown
if (!m_stop_requested && UICommon::TriggerSTMPowerEvent()) if (!m_stop_requested && UICommon::TriggerSTMPowerEvent())
@ -1565,30 +1565,26 @@ void MainWindow::OnStopRecording()
{ {
if (Movie::IsRecordingInput()) if (Movie::IsRecordingInput())
OnExportRecording(); OnExportRecording();
if (Movie::IsMovieActive())
Movie::EndPlayInput(false); Movie::EndPlayInput(false);
emit RecordingStatusChanged(true); emit RecordingStatusChanged(false);
} }
void MainWindow::OnExportRecording() void MainWindow::OnExportRecording()
{ {
bool was_paused = Core::GetState() == Core::State::Paused; bool was_paused = Core::GetState() == Core::State::Paused;
if (was_paused) if (!was_paused)
Core::SetState(Core::State::Paused); Core::SetState(Core::State::Paused);
QString dtm_file = QFileDialog::getSaveFileName(this, tr("Select the Recording File"), QString(), QString dtm_file = QFileDialog::getSaveFileName(this, tr("Select the Recording File"), QString(),
tr("Dolphin TAS Movies (*.dtm)")); tr("Dolphin TAS Movies (*.dtm)"));
if (was_paused) if (!dtm_file.isEmpty())
Core::SetState(Core::State::Running);
if (dtm_file.isEmpty())
return;
Core::SetState(Core::State::Running);
Movie::SaveRecording(dtm_file.toStdString()); Movie::SaveRecording(dtm_file.toStdString());
if (!was_paused)
Core::SetState(Core::State::Running);
} }
void MainWindow::ShowTASInput() void MainWindow::ShowTASInput()