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
1 changed files with 9 additions and 13 deletions

View File

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