Qt: Add status message for rewinding being disabled

This commit is contained in:
Vicki Pfau 2022-02-16 23:06:10 -08:00
parent 4312ce14ff
commit 5d6349338a
1 changed files with 17 additions and 9 deletions

View File

@ -500,6 +500,9 @@ void CoreController::showResetInfo(bool enable) {
void CoreController::setRewinding(bool rewind) {
if (!m_threadContext.core->opts.rewindEnable) {
if (rewind) {
emit statusPosted(tr("Rewinding not currently enabled"));
}
return;
}
if (rewind && m_multiplayer && m_multiplayer->attached() > 1) {
@ -514,7 +517,12 @@ void CoreController::setRewinding(bool rewind) {
}
void CoreController::rewind(int states) {
{
if (!states) {
return;
}
if (!m_threadContext.core->opts.rewindEnable) {
emit statusPosted(tr("Rewinding not currently enabled"));
}
Interrupter interrupter(this);
if (!states) {
states = INT_MAX;
@ -524,7 +532,7 @@ void CoreController::rewind(int states) {
break;
}
}
}
interrupter.resume();
emit frameAvailable();
emit rewound();
}