mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-13 15:59:23 +01:00
Merge pull request #8185 from Techjar/memcard-manager-auto
Qt/GCMemcardManager: Load configured memory cards by default
This commit is contained in:
commit
c167543eb3
@ -22,10 +22,12 @@
|
|||||||
#include <QTableWidget>
|
#include <QTableWidget>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
|
#include "Common/Config/Config.h"
|
||||||
#include "Common/FileUtil.h"
|
#include "Common/FileUtil.h"
|
||||||
#include "Common/MsgHandler.h"
|
#include "Common/MsgHandler.h"
|
||||||
#include "Common/StringUtil.h"
|
#include "Common/StringUtil.h"
|
||||||
|
|
||||||
|
#include "Core/Config/MainSettings.h"
|
||||||
#include "Core/HW/GCMemcard/GCMemcard.h"
|
#include "Core/HW/GCMemcard/GCMemcard.h"
|
||||||
|
|
||||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||||
@ -62,6 +64,8 @@ GCMemcardManager::GCMemcardManager(QWidget* parent) : QDialog(parent)
|
|||||||
// which means the fastest animation and common denominator is 15 FPS or 66 milliseconds per frame
|
// which means the fastest animation and common denominator is 15 FPS or 66 milliseconds per frame
|
||||||
m_timer->start(1000 / 15);
|
m_timer->start(1000 / 15);
|
||||||
|
|
||||||
|
LoadDefaultMemcards();
|
||||||
|
|
||||||
// Make the dimensions more reasonable on startup
|
// Make the dimensions more reasonable on startup
|
||||||
resize(650, 500);
|
resize(650, 500);
|
||||||
|
|
||||||
@ -150,6 +154,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)
|
void GCMemcardManager::SetActiveSlot(int slot)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < SLOT_COUNT; i++)
|
for (int i = 0; i < SLOT_COUNT; i++)
|
||||||
|
@ -40,6 +40,7 @@ private:
|
|||||||
|
|
||||||
void CreateWidgets();
|
void CreateWidgets();
|
||||||
void ConnectWidgets();
|
void ConnectWidgets();
|
||||||
|
void LoadDefaultMemcards();
|
||||||
|
|
||||||
void UpdateActions();
|
void UpdateActions();
|
||||||
void UpdateSlotTable(int slot);
|
void UpdateSlotTable(int slot);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user