Skip to content
Permalink
Browse files

Merge pull request #8279 from spycrab/fix_save_state_wait

Fix saving states freezing up emulation
  • Loading branch information...
stenzek committed Aug 2, 2019
2 parents b01cacb + 04764f8 commit 7afba6776f187a1bb9f445b806e7fd52adc3dd6a
@@ -323,7 +323,7 @@ static void CompressAndDumpState(CompressAndDumpState_args save_args)

if (!File::Rename(filename, File::GetUserPath(D_STATESAVES_IDX) + "lastState.sav"))
Core::DisplayMessage("Failed to move previous state to state undo backup", 1000);
else
else if (File::Exists(filename + ".dtm"))
File::Rename(filename + ".dtm", File::GetUserPath(D_STATESAVES_IDX) + "lastState.sav.dtm");
}

@@ -1183,8 +1183,7 @@ void MainWindow::StateLoadSlot()

void MainWindow::StateSaveSlot()
{
State::Save(m_state_slot, true);
m_menu_bar->UpdateStateSlotMenu();
State::Save(m_state_slot);
}

void MainWindow::StateLoadSlotAt(int slot)
@@ -1199,8 +1198,7 @@ void MainWindow::StateLoadLastSavedAt(int slot)

void MainWindow::StateSaveSlotAt(int slot)
{
State::Save(slot, true);
m_menu_bar->UpdateStateSlotMenu();
State::Save(slot);
}

void MainWindow::StateLoadUndo()
@@ -313,6 +313,9 @@ void MenuBar::AddEmulationMenu()
AddStateSaveMenu(emu_menu);
AddStateSlotMenu(emu_menu);
UpdateStateSlotMenu();

for (QMenu* menu : {m_state_load_menu, m_state_save_menu, m_state_slot_menu})
connect(menu, &QMenu::aboutToShow, this, &MenuBar::UpdateStateSlotMenu);
}

void MenuBar::AddStateLoadMenu(QMenu* emu_menu)
@@ -37,7 +37,6 @@ class MenuBar final : public QMenuBar

explicit MenuBar(QWidget* parent = nullptr);

void UpdateStateSlotMenu();
void UpdateToolsMenu(bool emulation_started);

QMenu* GetListColumnsMenu() const { return m_cols_menu; }
@@ -140,6 +139,8 @@ class MenuBar final : public QMenuBar
void AddJITMenu();
void AddSymbolsMenu();

void UpdateStateSlotMenu();

void InstallWAD();
void ImportWiiSave();
void ExportWiiSaves();

0 comments on commit 7afba67

Please sign in to comment.
You can’t perform that action at this time.