mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-06 12:40:24 +00:00
Merge pull request #7884 from JosJuice/save-movie-on-exit
DolphinQt: Save movie when closing emulation
This commit is contained in:
commit
08ca9ec21f
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user