Skip to content

Conversation

@daschuer
Copy link
Member

I was annoyed form by the Discogs lookup burried to deep in the track menu. The fix is to ad a "Last used" entry that is two levels above. Now the menu looks like this:

image

I have also removed the literal title and artist form the menu. That feels like clutter when using it.
I had an intermediate version with a tooltip instead but that was also disturbing.

What's next:
All these URL land on a ranked search result page. This requires an unnecessary extra click if there is a full match. Instead of going there we may do an API call and check if we have a full match and than proceed to the result immediately.

Now that a overpopulated "Find on Web" menu is mitigated, I am also tempted to add Youtube Music and Spotfy to it, because I am using it on regular basis. Is this OK do we want a plug in interface?

Genius, Shazam and Spotalike are also candidatures.


namespace {
const QString kLibraryGroup = QStringLiteral("[Library]");
const QString kFindOnWebLastActionKey = QStringLiteral("FindOnWebLastAction");
Copy link
Member

Choose a reason for hiding this comment

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

Should we use snake_case here, as this appears to be a newly introduced key?

void FindOnWebLast::openInBrowser(const QUrl& url) {
if (!mixxx::DesktopHelper::openUrl(url)) {
qWarning() << "DesktopHelper::openUrl() failed for " << url;
DEBUG_ASSERT(false);
Copy link
Member

Choose a reason for hiding this comment

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

In other place, we have the pattern DEBUG_ASSERT(!"An assert message");. It is pretty useful if you are running a debug build with assert without a debugger attached to it, as it will show a message directly, which you can search for (or even debug from the message itself).
This is nit tho, as the file+line is displayed as well.

const QString& actionId,
const QString& actionText,
const QUrl& serviceUrl) {
qDebug() << "init()" << m_lastActionKey << actionId;
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to keep this debug message? If yes, let's prefix with the class name to help identifying the message, as init is quite generic

Suggested change
qDebug() << "init()" << m_lastActionKey << actionId;
qDebug() << "FindOnWebLast::init()" << m_lastActionKey << actionId;

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a debug leftover. Removed.

}

QStringView service = QStringView(actionId).left(firstCommaPos);
setText(tr("Find on %1: %2").arg(service, actionText));
Copy link
Member

Choose a reason for hiding this comment

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

suggestion

Suggested change
setText(tr("Find on %1: %2").arg(service, actionText));
setText(tr("Find %1 on %2").arg(actionText, service));

QStringView service = QStringView(actionId).left(firstCommaPos);
setText(tr("Find on %1: %2").arg(service, actionText));
disconnect();
connect(this, &QAction::triggered, this, [this, actionId, actionText, serviceUrl] {
Copy link
Member

Choose a reason for hiding this comment

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

you shouldn't need to capture those AFAIS

Suggested change
connect(this, &QAction::triggered, this, [this, actionId, actionText, serviceUrl] {
connect(this, &QAction::triggered, this, [this, serviceUrl] {

QString m_lastActionKey;
};

#pragma once
Copy link
Member

Choose a reason for hiding this comment

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

Copy paste left over?

Suggested change
#pragma once


void createFindOnWebSubmenus(QMenu* pFindOnWebMenu, const Track& track);
void createFindOnWebSubmenus(QMenu* pFindOnWebMenu,
FindOnWebLast* pFindOnWebLast,
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if this should be a shared_ptr case - I assume you kept a fat pointer because Qt parented owned?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I have changed it to QPointer<>. At one point we have decided to use that, to pass a parented pointer around.

void WCoverArtMenu::createActions() {
m_pChange = new QAction(tr("Choose new cover",
"change cover art location"), this);
m_pChange = new QAction(tr("Choose file", "change cover art location"), this);
Copy link
Member

Choose a reason for hiding this comment

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

What's the rational for changing this? Feels like this will invalidate many translation but I'm not sure if the form is any better. Did we have some confusion with the previous wording?

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 the old translation my expectation was to have a chooser dialog and not a file browser. The new text should avoid this. Since we are her in the main branch, optimizing texts is allowed.

@daschuer
Copy link
Member Author

Done

@daschuer
Copy link
Member Author

daschuer commented Nov 1, 2025

Code style fixed.

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