mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Merge pull request #8300 from AdmiralCurtiss/gcmemcard-construction
GCMemcard: Rework construction logic.
This commit is contained in:
@ -28,6 +28,7 @@
|
||||
#include "Core/HW/GCMemcard/GCMemcard.h"
|
||||
|
||||
#include "DolphinQt/Config/Mapping/MappingWindow.h"
|
||||
#include "DolphinQt/GCMemcardManager.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
|
||||
enum
|
||||
@ -212,15 +213,15 @@ void GameCubePane::OnConfigPressed(int slot)
|
||||
{
|
||||
if (File::Exists(filename.toStdString()))
|
||||
{
|
||||
GCMemcard mc(filename.toStdString());
|
||||
auto [error_code, mc] = GCMemcard::Open(filename.toStdString());
|
||||
|
||||
if (!mc.IsValid())
|
||||
if (error_code.HasCriticalErrors() || !mc || !mc->IsValid())
|
||||
{
|
||||
ModalMessageBox::critical(this, tr("Error"),
|
||||
tr("Cannot use that file as a memory card.\n%1\n"
|
||||
"is not a valid GameCube memory card file")
|
||||
.arg(filename));
|
||||
|
||||
ModalMessageBox::critical(
|
||||
this, tr("Error"),
|
||||
tr("The file\n%1\nis either corrupted or not a GameCube memory card file.\n%2")
|
||||
.arg(filename)
|
||||
.arg(GCMemcardManager::GetErrorMessagesForErrorCode(error_code)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user