Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracks: use clicked column to focus property editor in Track Info dialog #14036

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

ronso0
Copy link
Member

@ronso0 ronso0 commented Dec 19, 2024

follow-up for #13841
and a small tweak for DlgTrackInfo (single track)

@ronso0 ronso0 force-pushed the trackmenu-trackinfo-focus branch from 95d3905 to 7024184 Compare December 19, 2024 10:36
Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

That was quick. Thank you. I have found one readibility issue.

@@ -2567,6 +2569,7 @@ void WTrackMenu::slotShowDlgTrackInfo() {
[this]() {
if (m_pDlgTrackInfo.get() == sender()) {
m_pDlgTrackInfo.release()->deleteLater();
setTrackPropertyName();
Copy link
Member

Choose a reason for hiding this comment

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

This one was not obvious for me. How about clearTrackPropertyName();?

It is a bit of an odd logic that the user of m_trackProperty needs to clean up. Did you consider to pass the property along with loadTrack()? This way every caller has to descide about the property to focus.
I have not checked how big this change would be, so it is just a suggestion.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just didn't want to introduce yet another method.
We could also simply reset it directly:
m_trackproperty = QString();

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you think the cleanup is an issue if it's done close to where we call setFocus()?

Did you consider to pass the property along with loadTrack()?

Then we'd need to override QDialog::show() and call setFocus() there.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could also not reset it, so it'll be reused in case no property is specified?
Might be unexpected if it was "bpm" before (BPM tab would be selected).

Copy link
Member

Choose a reason for hiding this comment

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

m_trackproperty = QString(); is just fine for a quick merge. If my other idea is not a short thing, just drop it.

@ronso0 ronso0 force-pushed the trackmenu-trackinfo-focus branch from 7024184 to 4a22d6d Compare December 19, 2024 16:54
Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

LGTM, thank you.

@daschuer daschuer merged commit 16fb1cb into mixxxdj:2.5 Dec 19, 2024
13 checks passed
@ronso0 ronso0 deleted the trackmenu-trackinfo-focus branch December 20, 2024 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants