SmartPlaylistsViewContainer: Ask for confirmation before resetting smart playlists

This commit is contained in:
Jonas Kvinge
2025-12-19 01:03:46 +01:00
parent 4a5afbeb1e
commit 527ccd212a

View File

@@ -23,6 +23,7 @@
#include <QMenu>
#include <QSettings>
#include <QShowEvent>
#include <QMessageBox>
#include "core/iconloader.h"
#include "core/mimedata.h"
@@ -319,6 +320,9 @@ void SmartPlaylistsViewContainer::RestoreDefaultsFromContext() {
void SmartPlaylistsViewContainer::RestoreDefaults() {
model_->RestoreDefaults();
const QMessageBox::StandardButton messagebox_answer = QMessageBox::question(this, tr("Restore defaults"), tr("Are you sure you want to restore the default smart playlists? This will remove all custom smart playlists"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
if (messagebox_answer == QMessageBox::Yes) {
model_->RestoreDefaults();
}
}