Permalink
Browse files

Merge pull request #7169 from Techjar/qt-memcard-creation

Qt/GameCubePane: Fix inability to create new memory card file
  • Loading branch information...
spycrab committed Jun 29, 2018
2 parents 9b00045 + 2491c53 commit a595ac6b27d01eef0cad2c7981d9206c29890d6b
Showing with 15 additions and 12 deletions.
  1. +15 −12 Source/Core/DolphinQt2/Settings/GameCubePane.cpp
@@ -167,28 +167,31 @@ void GameCubePane::OnConfigPressed(int slot)
return;
}
QString filename =
QFileDialog::getOpenFileName(this, tr("Choose a file to open"),
QString::fromStdString(File::GetUserPath(D_GCUSER_IDX)), filter);
QString filename = QFileDialog::getSaveFileName(
this, tr("Choose a file to open"), QString::fromStdString(File::GetUserPath(D_GCUSER_IDX)),
filter, 0, QFileDialog::DontConfirmOverwrite);
if (filename.isEmpty() || !File::Exists(filename.toStdString()))
if (filename.isEmpty())
return;
QString path_abs = QFileInfo(filename).absoluteFilePath();
// Memcard validity checks
if (memcard)
{
GCMemcard mc(filename.toStdString());
if (!mc.IsValid())
if (File::Exists(filename.toStdString()))
{
QMessageBox::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));
GCMemcard mc(filename.toStdString());
if (!mc.IsValid())
{
QMessageBox::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));
return;
return;
}
}
bool other_slot_memcard =

0 comments on commit a595ac6

Please sign in to comment.