Merge pull request #8279 from spycrab/fix_save_state_wait

Fix saving states freezing up emulation
This commit is contained in:
Connor McLaughlin 2019-08-03 01:26:07 +10:00 committed by GitHub
commit 7afba6776f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 6 deletions

View File

@ -323,7 +323,7 @@ static void CompressAndDumpState(CompressAndDumpState_args save_args)
if (!File::Rename(filename, File::GetUserPath(D_STATESAVES_IDX) + "lastState.sav")) if (!File::Rename(filename, File::GetUserPath(D_STATESAVES_IDX) + "lastState.sav"))
Core::DisplayMessage("Failed to move previous state to state undo backup", 1000); 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"); File::Rename(filename + ".dtm", File::GetUserPath(D_STATESAVES_IDX) + "lastState.sav.dtm");
} }

View File

@ -1183,8 +1183,7 @@ void MainWindow::StateLoadSlot()
void MainWindow::StateSaveSlot() void MainWindow::StateSaveSlot()
{ {
State::Save(m_state_slot, true); State::Save(m_state_slot);
m_menu_bar->UpdateStateSlotMenu();
} }
void MainWindow::StateLoadSlotAt(int slot) void MainWindow::StateLoadSlotAt(int slot)
@ -1199,8 +1198,7 @@ void MainWindow::StateLoadLastSavedAt(int slot)
void MainWindow::StateSaveSlotAt(int slot) void MainWindow::StateSaveSlotAt(int slot)
{ {
State::Save(slot, true); State::Save(slot);
m_menu_bar->UpdateStateSlotMenu();
} }
void MainWindow::StateLoadUndo() void MainWindow::StateLoadUndo()

View File

@ -313,6 +313,9 @@ void MenuBar::AddEmulationMenu()
AddStateSaveMenu(emu_menu); AddStateSaveMenu(emu_menu);
AddStateSlotMenu(emu_menu); AddStateSlotMenu(emu_menu);
UpdateStateSlotMenu(); 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) void MenuBar::AddStateLoadMenu(QMenu* emu_menu)

View File

@ -37,7 +37,6 @@ public:
explicit MenuBar(QWidget* parent = nullptr); explicit MenuBar(QWidget* parent = nullptr);
void UpdateStateSlotMenu();
void UpdateToolsMenu(bool emulation_started); void UpdateToolsMenu(bool emulation_started);
QMenu* GetListColumnsMenu() const { return m_cols_menu; } QMenu* GetListColumnsMenu() const { return m_cols_menu; }
@ -140,6 +139,8 @@ private:
void AddJITMenu(); void AddJITMenu();
void AddSymbolsMenu(); void AddSymbolsMenu();
void UpdateStateSlotMenu();
void InstallWAD(); void InstallWAD();
void ImportWiiSave(); void ImportWiiSave();
void ExportWiiSaves(); void ExportWiiSaves();