summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorConnor McLaughlin <stenzek@gmail.com>2019-08-03 01:26:07 +1000
committerGitHub <noreply@github.com>2019-08-03 01:26:07 +1000
commit7afba6776f187a1bb9f445b806e7fd52adc3dd6a (patch)
tree31e4f34434a506d4c189a1b82755252caf6bc049 /Source/Core
parentb01cacb27ed7976619d98391ecf2b7b92edeba30 (diff)
parent04764f8b7f631384f890b870d0280278de86498f (diff)
Merge pull request #8279 from spycrab/fix_save_state_wait
Fix saving states freezing up emulation
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/State.cpp2
-rw-r--r--Source/Core/DolphinQt/MainWindow.cpp6
-rw-r--r--Source/Core/DolphinQt/MenuBar.cpp3
-rw-r--r--Source/Core/DolphinQt/MenuBar.h3
4 files changed, 8 insertions, 6 deletions
diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp
index cd4544b8f1..8a45b2f277 100644
--- a/Source/Core/Core/State.cpp
+++ b/Source/Core/Core/State.cpp
@@ -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");
}
diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp
index b7ce9d5206..00a1bf6576 100644
--- a/Source/Core/DolphinQt/MainWindow.cpp
+++ b/Source/Core/DolphinQt/MainWindow.cpp
@@ -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()
diff --git a/Source/Core/DolphinQt/MenuBar.cpp b/Source/Core/DolphinQt/MenuBar.cpp
index 67dcc4d172..f890742f5e 100644
--- a/Source/Core/DolphinQt/MenuBar.cpp
+++ b/Source/Core/DolphinQt/MenuBar.cpp
@@ -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)
diff --git a/Source/Core/DolphinQt/MenuBar.h b/Source/Core/DolphinQt/MenuBar.h
index 1140f7168f..8d4681928f 100644
--- a/Source/Core/DolphinQt/MenuBar.h
+++ b/Source/Core/DolphinQt/MenuBar.h
@@ -37,7 +37,6 @@ public:
explicit MenuBar(QWidget* parent = nullptr);
- void UpdateStateSlotMenu();
void UpdateToolsMenu(bool emulation_started);
QMenu* GetListColumnsMenu() const { return m_cols_menu; }
@@ -140,6 +139,8 @@ private:
void AddJITMenu();
void AddSymbolsMenu();
+ void UpdateStateSlotMenu();
+
void InstallWAD();
void ImportWiiSave();
void ExportWiiSaves();