FIX: [STUDIO-2768] delete file confirm

Change-Id: I0e4c81d7a4b312e5b1c339c5652ac4a68298910e
This commit is contained in:
chunmao.guo 2023-04-24 13:13:42 +08:00 committed by Lane.Wei
parent 14836c5f4a
commit 1483d75848

View file

@ -424,10 +424,16 @@ void Slic3r::GUI::MediaFilePanel::doAction(size_t index, int action)
if (action == 0) { if (action == 0) {
if (fs->GetSelectCount() > 1) { if (fs->GetSelectCount() > 1) {
MessageDialog dlg(this, MessageDialog dlg(this,
wxString::Format(_L("You are going to delete %u files. Are you sure to continue?"), fs->GetSelectCount()), wxString::Format(_L("You are going to delete %u files from printer. Are you sure to continue?"), fs->GetSelectCount()),
_L("Delete files"), wxYES_NO | wxICON_WARNING); _L("Delete files"), wxYES_NO | wxICON_WARNING);
if (dlg.ShowModal() != wxID_YES) if (dlg.ShowModal() != wxID_YES)
return; return;
} else if (index >= 0) {
MessageDialog dlg(this,
wxString::Format(_L("Do you want to delete the file '%s' from printer?"), fs->GetSelectCount()),
_L("Delete file"), wxYES_NO | wxICON_WARNING);
if (dlg.ShowModal() != wxID_YES)
return;
} }
fs->DeleteFiles(index); fs->DeleteFiles(index);
} else if (action == 1) { } else if (action == 1) {