Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CrateFeature: add popup to avoid accidental remove of Crate #4700

Merged
merged 1 commit into from
Mar 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/library/trackset/crate/cratefeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,17 @@ void CrateFeature::slotDeleteCrate() {
// Store sibling id to restore selection after crate was deleted
// to avoid the scroll position being reset to Crate root item.
storePrevSiblingCrateId(crateId);
if (m_pTrackCollection->deleteCrate(crateId)) {
qDebug() << "Deleted crate" << crate;
QMessageBox::StandardButton btn = QMessageBox::question(nullptr,
tr("Confirm Deletion"),
tr("Do you really want to delete this crate?"),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No);
if (btn == QMessageBox::Yes) {
if (m_pTrackCollection->deleteCrate(crateId)) {
qDebug() << "Deleted crate" << crate;
return;
}
} else {
return;
}
}
Expand Down