diff --git a/Source/Core/DolphinQt/GCMemcardManager.cpp b/Source/Core/DolphinQt/GCMemcardManager.cpp index d763d01ebb..138bf7c162 100644 --- a/Source/Core/DolphinQt/GCMemcardManager.cpp +++ b/Source/Core/DolphinQt/GCMemcardManager.cpp @@ -20,10 +20,12 @@ #include #include +#include "Common/Config/Config.h" #include "Common/FileUtil.h" #include "Common/MsgHandler.h" #include "Common/StringUtil.h" +#include "Core/Config/MainSettings.h" #include "Core/HW/GCMemcard/GCMemcard.h" #include "DolphinQt/QtUtils/ModalMessageBox.h" @@ -47,6 +49,8 @@ GCMemcardManager::GCMemcardManager(QWidget* parent) : QDialog(parent) m_timer->start(1000 / 8); + LoadDefaultMemcards(); + // Make the dimensions more reasonable on startup resize(650, 500); @@ -135,6 +139,22 @@ void GCMemcardManager::ConnectWidgets() } } +void GCMemcardManager::LoadDefaultMemcards() +{ + for (int i = 0; i < SLOT_COUNT; i++) + { + if (Config::Get(i == 0 ? Config::MAIN_SLOT_A : Config::MAIN_SLOT_B) != + ExpansionInterface::EXIDEVICE_MEMORYCARD) + { + continue; + } + + const QString path = QString::fromStdString( + Config::Get(i == 0 ? Config::MAIN_MEMCARD_A_PATH : Config::MAIN_MEMCARD_B_PATH)); + SetSlotFile(i, path); + } +} + void GCMemcardManager::SetActiveSlot(int slot) { for (int i = 0; i < SLOT_COUNT; i++) diff --git a/Source/Core/DolphinQt/GCMemcardManager.h b/Source/Core/DolphinQt/GCMemcardManager.h index e1579abe11..e26ef13b69 100644 --- a/Source/Core/DolphinQt/GCMemcardManager.h +++ b/Source/Core/DolphinQt/GCMemcardManager.h @@ -32,6 +32,7 @@ public: private: void CreateWidgets(); void ConnectWidgets(); + void LoadDefaultMemcards(); void UpdateActions(); void UpdateSlotTable(int slot);