Skip to content

Commit

Permalink
fix delete
Browse files Browse the repository at this point in the history
  • Loading branch information
benkuper committed Jun 22, 2024
1 parent ec22be1 commit e21d29f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/Prop/PropManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,21 +287,22 @@ void PropManager::onControllableFeedbackUpdate(ControllableContainer* cc, Contro
}
else if (c == deleteAllPlayback || c == deleteAllScripts)
{
bool isPlayback = c == deleteAllPlayback;
AlertWindow::showAsync(
MessageBoxOptions().withIconType(AlertWindow::WarningIcon)
.withTitle("Delete All files")
.withMessage("Are you sure you want to delete all the files on all the props ?")
.withButton("Yes")
.withButton("No"),
[&](int result)
[&, isPlayback](int result)
{
if (result)
{
for (auto& p : items)
{
if (BentoProp* bp = dynamic_cast<BentoProp*>(p))
{
bp->deleteFolder(c == deleteAllPlayback ? "/playback" : "/scripts");
bp->deleteFolder(isPlayback ? "/playback" : "/scripts");
}
}
}
Expand Down

0 comments on commit e21d29f

Please sign in to comment.