Skip to content
Closed
Show file tree
Hide file tree
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
52 changes: 30 additions & 22 deletions src/widget/wtrackmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ void WTrackMenu::popup(const QPoint& pos, QAction* at) {
}

void WTrackMenu::createMenus() {
if (featureIsEnabled(Feature::AutoDJ)) {
m_pAutoDJMenu = new QMenu(this);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This submenu does not work for me ... we have already discussed better options, that why I request a change.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure. I considered that option off the table by now anyway, the QWigetAction with 3 buttons is much better if we can make it work.
I made a prototype earlier, it works nicely with only minor changes to the AutoDJ slots. Didn't check the focus behavior and styling, yet. Should be manageable though

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already had a working prototype with the [↑] [↓] [!] buttons, even some focus/navigation issues solved ~90%.
and now I can't find it anymore... carelessly cleaned up git stash or local branches?
meeeh.....

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does

git reflog 

reveal the old commits? Normally they a still there if you have at least committed them.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this didn't point to any usable commit, just [sha1] HEAD@{xxxx}: checkout: moving from trackmenu-autodj-buttons to search-date-span logs, but at least that revealed the branch name.

What helped was creating .git/lost-found.txt with

git fsck --full --no-reflogs --unreachable --lost-found | grep commit | cut -d\  -f3 | xargs -n 1 git log -n 1 --pretty=oneline > .git/lost-found.txt

in there I found the last commit, git checkout [sha1]
et voilà, back ontrack!

Thanks for the hint @daschuer

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m_pAutoDJMenu->setTitle(tr("Add to Auto DJ queue"));
}

if (featureIsEnabled(Feature::LoadTo)) {
m_pLoadToMenu = new QMenu(this);
m_pLoadToMenu->setTitle(tr("Load to"));
Expand Down Expand Up @@ -185,9 +190,10 @@ void WTrackMenu::createMenus() {
});
}

if (featureIsEnabled(Feature::RemoveFromDisk)) {
m_pRemoveFromDiskMenu = new QMenu(this);
m_pRemoveFromDiskMenu->setTitle(tr("Delete Track Files"));
if (featureIsEnabled(Feature::RemoveFromDisk) ||
featureIsEnabled(Feature::FileBrowser)) {
m_pFileMenu = new QMenu(this);
m_pFileMenu->setTitle(tr("Track Files"));
}
}

Expand All @@ -198,13 +204,13 @@ void WTrackMenu::createActions() {
kPropertiesShortcutKey);

if (featureIsEnabled(Feature::AutoDJ)) {
m_pAutoDJBottomAct = new QAction(tr("Add to Auto DJ Queue (bottom)"), this);
m_pAutoDJBottomAct = new QAction(tr("Add to Auto DJ Queue (bottom)"), m_pAutoDJMenu);
connect(m_pAutoDJBottomAct, &QAction::triggered, this, &WTrackMenu::slotAddToAutoDJBottom);

m_pAutoDJTopAct = new QAction(tr("Add to Auto DJ Queue (top)"), this);
m_pAutoDJTopAct = new QAction(tr("Add to Auto DJ Queue (top)"), m_pAutoDJMenu);
connect(m_pAutoDJTopAct, &QAction::triggered, this, &WTrackMenu::slotAddToAutoDJTop);

m_pAutoDJReplaceAct = new QAction(tr("Add to Auto DJ Queue (replace)"), this);
m_pAutoDJReplaceAct = new QAction(tr("Add to Auto DJ Queue (replace)"), m_pAutoDJMenu);
connect(m_pAutoDJReplaceAct, &QAction::triggered, this, &WTrackMenu::slotAddToAutoDJReplace);
}

Expand Down Expand Up @@ -245,8 +251,13 @@ void WTrackMenu::createActions() {
connect(m_pPurgeAct, &QAction::triggered, this, &WTrackMenu::slotPurge);
}

if (featureIsEnabled(Feature::FileBrowser)) {
m_pFileBrowserAct = new QAction(tr("Open in File Browser"), m_pFileMenu);
connect(m_pFileBrowserAct, &QAction::triggered, this, &WTrackMenu::slotOpenInFileBrowser);
}

if (featureIsEnabled(Feature::RemoveFromDisk)) {
m_pRemoveFromDiskAct = new QAction(tr("Delete Files from Disk"), m_pRemoveFromDiskMenu);
m_pRemoveFromDiskAct = new QAction(tr("Delete Files from Disk"), m_pFileMenu);
connect(m_pRemoveFromDiskAct,
&QAction::triggered,
this,
Expand All @@ -268,11 +279,6 @@ void WTrackMenu::createActions() {
connect(m_pPropertiesAct, &QAction::triggered, this, &WTrackMenu::slotShowDlgTrackInfo);
}

if (featureIsEnabled(Feature::FileBrowser)) {
m_pFileBrowserAct = new QAction(tr("Open in File Browser"), this);
connect(m_pFileBrowserAct, &QAction::triggered, this, &WTrackMenu::slotOpenInFileBrowser);
}

if (featureIsEnabled(Feature::SelectInLibrary)) {
m_pSelectInLibraryAct = new QAction(tr("Select in Library"), this);
connect(m_pSelectInLibraryAct, &QAction::triggered, this, &WTrackMenu::slotSelectInLibrary);
Expand Down Expand Up @@ -450,9 +456,10 @@ void WTrackMenu::setupActions() {
}

if (featureIsEnabled(Feature::AutoDJ)) {
addAction(m_pAutoDJBottomAct);
addAction(m_pAutoDJTopAct);
addAction(m_pAutoDJReplaceAct);
m_pAutoDJMenu->addAction(m_pAutoDJBottomAct);
m_pAutoDJMenu->addAction(m_pAutoDJTopAct);
m_pAutoDJMenu->addAction(m_pAutoDJReplaceAct);
addMenu(m_pAutoDJMenu);
addSeparator();
}

Expand Down Expand Up @@ -589,13 +596,14 @@ void WTrackMenu::setupActions() {
}
}

if (featureIsEnabled(Feature::RemoveFromDisk)) {
m_pRemoveFromDiskMenu->addAction(m_pRemoveFromDiskAct);
addMenu(m_pRemoveFromDiskMenu);
}

if (featureIsEnabled(Feature::FileBrowser)) {
addAction(m_pFileBrowserAct);
if (m_pFileMenu) {
if (featureIsEnabled(Feature::FileBrowser)) {
m_pFileMenu->addAction(m_pFileBrowserAct);
}
if (featureIsEnabled(Feature::RemoveFromDisk)) {
m_pFileMenu->addAction(m_pRemoveFromDiskAct);
}
addMenu(m_pFileMenu);
}

if (featureIsEnabled(Feature::Properties)) {
Expand Down
3 changes: 2 additions & 1 deletion src/widget/wtrackmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ class WTrackMenu : public QMenu {
const ControlProxy* m_pNumPreviewDecks{};

// Submenus
QMenu* m_pAutoDJMenu{};
QMenu* m_pLoadToMenu{};
QMenu* m_pDeckMenu{};
QMenu* m_pSamplerMenu{};
Expand All @@ -228,7 +229,7 @@ class WTrackMenu : public QMenu {
QMenu* m_pColorMenu{};
WCoverArtMenu* m_pCoverMenu{};
parented_ptr<WSearchRelatedTracksMenu> m_pSearchRelatedMenu;
QMenu* m_pRemoveFromDiskMenu{};
QMenu* m_pFileMenu{};

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