Skip to content

Commit

Permalink
added method to delete ID3-Tags from selected files in editor, when u…
Browse files Browse the repository at this point in the history
…sing the context menu
  • Loading branch information
pfedick committed Jul 2, 2024
1 parent 5708400 commit 3754145
Show file tree
Hide file tree
Showing 7 changed files with 371 additions and 290 deletions.
4 changes: 2 additions & 2 deletions gui/include/version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef VERSION_H_
#define VERSION_H_
#define WM_VERSION "3.7.2"
#define WM_REVISION "1019"
#define WM_RELEASEDATE 20240701
#define WM_REVISION "1024"
#define WM_RELEASEDATE 20240702
#endif
28 changes: 28 additions & 0 deletions gui/src/editor/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2302,6 +2302,7 @@ void Edit::on_trackList_customContextMenuRequested(const QPoint& pos)
m->addSeparator();
m->addAction(QIcon(":/icons/resources/edit.png"), tr("Read BPM and Key from ID3-Tag", "trackList Context Menue"), this, SLOT(on_contextReadBpmAndKey_triggered()));
}
m->addAction(QIcon(":/icons/resources/eraser.png"), tr("Delete ID3-Tags from file", "trackList Context Menue"), this, SLOT(on_contextDeleteID3Tags_triggered()));
}
m->popup(p, a);
//FixFocus();
Expand Down Expand Up @@ -2768,3 +2769,30 @@ void Edit::on_displayMusicKey_currentIndexChanged(int)
UpdateTrackListing();
FixFocus();
}

void Edit::on_contextDeleteID3Tags_triggered()
{
QList<QTreeWidgetItem*> Items=trackList->selectedItems();
if (Items.count() < 1) return;
//ppl7::PrintDebug("Edit::on_contextDeleteID3Tags_triggered\n");
if (QMessageBox::question(this, tr("WinMusik: delete ID3-Tags"),
tr("Do you want to delete all ID3-Tags from the selected files?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
== QMessageBox::No) return;
for (int i=0;i < Items.size();i++) {
WMTreeItem* item=(WMTreeItem*)Items[i];
ppl7::String Filename=wm->GetAudioFilename(DeviceType, DeviceId, Page, item->Track);
if (Filename.notEmpty()) {
//ppl7::PrintDebug("File: %s\n", (const char*)Filename);
ppl7::ID3Tag Tag;
try {
Tag.load(Filename);
Tag.clearTags();
Tag.save();

} catch (...) {

}
}
}

}
1 change: 1 addition & 0 deletions gui/src/editor/edit.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ public slots:
void on_contextInsertTrack_triggered();
void on_contextSynchronizeKeys_triggered();
void on_contextMusicKeyVerified_triggered();
void on_contextDeleteID3Tags_triggered();

void on_contextShowCover_triggered();
void on_contextLoadCoverAllTracks_triggered();
Expand Down
Binary file modified gui/winmusik_de.qm
Binary file not shown.
Loading

0 comments on commit 3754145

Please sign in to comment.