diff --git a/src/core/mainwindow.cpp b/src/core/mainwindow.cpp index 0195f2c0..5130cdff 100644 --- a/src/core/mainwindow.cpp +++ b/src/core/mainwindow.cpp @@ -204,6 +204,8 @@ #include "smartplaylists/smartplaylistsviewcontainer.h" +#include "organize/organizeerrordialog.h" + #ifdef Q_OS_WIN # include "windows7thumbbar.h" #endif @@ -3239,11 +3241,21 @@ void MainWindow::PlaylistDelete() { SharedPtr storage = make_shared(Song::Source::LocalFile, "/"); DeleteFiles *delete_files = new DeleteFiles(app_->task_manager(), storage, true); - //QObject::connect(delete_files, &DeleteFiles::Finished, this, &MainWindow::DeleteFinished); + QObject::connect(delete_files, &DeleteFiles::Finished, this, &MainWindow::DeleteFilesFinished); delete_files->Start(selected_songs); } +void MainWindow::DeleteFilesFinished(const SongList &songs_with_errors) { + + if (songs_with_errors.isEmpty()) return; + + OrganizeErrorDialog *dialog = new OrganizeErrorDialog(this); + dialog->Show(OrganizeErrorDialog::OperationType::Delete, songs_with_errors); + // It deletes itself when the user closes it + +} + void MainWindow::FocusSearchField() { if (ui_->tabs->currentIndex() == ui_->tabs->IndexOfTab(collection_view_) && !collection_view_->filter_widget()->SearchFieldHasFocus()) { diff --git a/src/core/mainwindow.h b/src/core/mainwindow.h index 6053f92e..05bda24b 100644 --- a/src/core/mainwindow.h +++ b/src/core/mainwindow.h @@ -270,6 +270,8 @@ class MainWindow : public QMainWindow, public PlatformInterface { void FocusSearchField(); + void DeleteFilesFinished(const SongList &songs_with_errors); + public slots: void CommandlineOptionsReceived(const QByteArray &string_options); void Raise();