Skip to content
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
66 changes: 33 additions & 33 deletions src/widget/wtrackmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,7 @@ void WTrackMenu::slotRemoveFromDisk() {
QListWidget* delListWidget = new QListWidget();
delListWidget->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,
QSizePolicy::MinimumExpanding));
delListWidget->setFocusPolicy(Qt::ClickFocus);
delListWidget->addItems(locations);
mixxx::widgethelper::growListWidget(*delListWidget, *this);
// Warning text
Expand Down Expand Up @@ -1795,41 +1796,40 @@ void WTrackMenu::slotRemoveFromDisk() {
}

const QList<QString> tracksToKeep(trackOperator.getTracksToKeep());
if (!tracksToKeep.isEmpty()) {
if (tracksToKeep.isEmpty()) {
// All selected tracks could be processed. Finish!
Comment thread
uklotzde marked this conversation as resolved.
return;
}

{
// Else show a message with a list of tracks that could not be deleted.
QLabel* notDeletedLabel = new QLabel;
notDeletedLabel->setText(
tr("The following %1 files could not be deleted from disk")
.arg(QString::number(
tracksToKeep.length())));
notDeletedLabel->setTextFormat(Qt::RichText);

QListWidget* notDeletedListWidget = new QListWidget;
notDeletedListWidget->addItems(tracksToKeep);
mixxx::widgethelper::growListWidget(*notDeletedListWidget, *this);

QDialogButtonBox* notDeletedButtons = new QDialogButtonBox();
QPushButton* closeBtn = notDeletedButtons->addButton(
tr("Close"),
QDialogButtonBox::AcceptRole);

QVBoxLayout* notDeletedLayout = new QVBoxLayout;
notDeletedLayout->addWidget(notDeletedLabel);
notDeletedLayout->addWidget(notDeletedListWidget);
notDeletedLayout->addWidget(notDeletedButtons);

QDialog dlgNotDeleted;
dlgNotDeleted.setModal(true);
dlgNotDeleted.setWindowTitle(tr("Remaining Track Files"));
dlgNotDeleted.setLayout(notDeletedLayout);
// Required for being able to close the dialog
connect(closeBtn, &QPushButton::clicked, &dlgNotDeleted, &QDialog::close);
dlgNotDeleted.exec();
}
// Else show a message with a list of tracks that could not be deleted.
QLabel* notDeletedLabel = new QLabel;
notDeletedLabel->setText(
tr("The following %1 files could not be deleted from disk")
.arg(QString::number(
tracksToKeep.length())));
notDeletedLabel->setTextFormat(Qt::RichText);

QListWidget* notDeletedListWidget = new QListWidget;
notDeletedListWidget->setFocusPolicy(Qt::ClickFocus);
notDeletedListWidget->addItems(tracksToKeep);
mixxx::widgethelper::growListWidget(*notDeletedListWidget, *this);

QDialogButtonBox* notDeletedButtons = new QDialogButtonBox();
QPushButton* closeBtn = notDeletedButtons->addButton(
tr("Close"),
QDialogButtonBox::AcceptRole);

QVBoxLayout* notDeletedLayout = new QVBoxLayout;
notDeletedLayout->addWidget(notDeletedLabel);
notDeletedLayout->addWidget(notDeletedListWidget);
notDeletedLayout->addWidget(notDeletedButtons);

QDialog dlgNotDeleted;
dlgNotDeleted.setModal(true);
dlgNotDeleted.setWindowTitle(tr("Remaining Track Files"));
dlgNotDeleted.setLayout(notDeletedLayout);
// Required for being able to close the dialog
connect(closeBtn, &QPushButton::clicked, &dlgNotDeleted, &QDialog::close);
dlgNotDeleted.exec();
}

void WTrackMenu::slotShowDlgTrackInfo() {
Expand Down