Skip to content

Commit

Permalink
WTrackMenu: Filtering: Promote m_pAddToNewCrateAct to member variable
Browse files Browse the repository at this point in the history
  • Loading branch information
cr7pt0gr4ph7 committed Oct 16, 2024
1 parent cc07b49 commit dfe7bc9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/widget/wtrackmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,14 @@ void WTrackMenu::createActions() {
connect(m_pSelectInLibraryAct, &QAction::triggered, this, &WTrackMenu::slotSelectInLibrary);
}

if (featureIsEnabled(Feature::Crate)) {
m_pAddToNewCrateAct = new QAction(tr("Add to New Crate"), this);
connect(m_pAddToNewCrateAct,
&QAction::triggered,
this,
&WTrackMenu::addSelectionToNewCrate);
}

if (featureIsEnabled(Feature::Metadata)) {
m_pImportMetadataFromFileAct =
new QAction(tr("Import From File Tags"), m_pMetadataMenu);
Expand Down Expand Up @@ -1543,9 +1551,7 @@ void WTrackMenu::slotPopulateCrateMenu() {
connect(pCheckBox.get(), &QCheckBox::stateChanged, this, [this, pCheckBox{pCheckBox.get()}] { updateSelectionCrates(pCheckBox); });
}
m_pCrateMenu->addSeparator();
QAction* newCrateAction = new QAction(tr("Add to New Crate"), m_pCrateMenu);
m_pCrateMenu->addAction(newCrateAction);
connect(newCrateAction, &QAction::triggered, this, &WTrackMenu::addSelectionToNewCrate);
m_pCrateMenu->addAction(m_pAddToNewCrateAct);
m_bCrateMenuLoaded = true;
}

Expand Down
3 changes: 3 additions & 0 deletions src/widget/wtrackmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ class WTrackMenu : public QMenu {
QMenu* m_pRemoveFromDiskMenu{};
#endif

// Crate Submenu Actions
QAction* m_pAddToNewCrateAct{};

// Update ReplayGain from Track
QAction* m_pUpdateReplayGainAct{};

Expand Down

0 comments on commit dfe7bc9

Please sign in to comment.