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

Qt/GameCubePane: Fix inability to create new memory card file
This commit is contained in:
spycrab 2018-06-29 11:07:56 +02:00 committed by GitHub
commit a595ac6b27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,17 +167,19 @@ 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)
{
if (File::Exists(filename.toStdString()))
{
GCMemcard mc(filename.toStdString());
@ -190,6 +192,7 @@ void GameCubePane::OnConfigPressed(int slot)
return;
}
}
bool other_slot_memcard =
m_slot_combos[slot == 0 ? SLOT_B_INDEX : SLOT_A_INDEX]->currentIndex() == EXP_MEMORYCARD;