Skip to content

Commit

Permalink
Restore "Yes to All" feature in save importer.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpd002 committed Dec 18, 2023
1 parent 55178b6 commit b2b86f9
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions Source/ui_qt/memorycardmanagerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,22 @@ CSaveImporterBase::OVERWRITE_PROMPT_RETURN MemoryCardManagerDialog::OnImportOver
{
std::string fileName = filePath.filename().string();
QString msg("File %1 already exists.\n\nOverwrite?");
QMessageBox::StandardButton resBtn = QMessageBox::question(this, "Overwrite?",
msg.arg(fileName.c_str()),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::Yes);
return (resBtn == QMessageBox::Yes) ? CSaveImporterBase::OVERWRITE_YES : CSaveImporterBase::OVERWRITE_NO;
auto resBtn = QMessageBox::question(this, "Overwrite?",
msg.arg(fileName.c_str()),
QMessageBox::Yes | QMessageBox::No | QMessageBox::YesToAll,
QMessageBox::Yes);
switch(resBtn)
{
default:
assert(false);
[[fallthrough]];
case QMessageBox::No:
return CSaveImporterBase::OVERWRITE_NO;
case QMessageBox::Yes:
return CSaveImporterBase::OVERWRITE_YES;
case QMessageBox::YesToAll:
return CSaveImporterBase::OVERWRITE_YESTOALL;
}
}

void MemoryCardManagerDialog::on_comboBox_currentIndexChanged(int index)
Expand Down

0 comments on commit b2b86f9

Please sign in to comment.