Use "Locate In Library / Track" (etc) for locate actions in shortcut

setting page
This commit is contained in:
Craig Drummond
2017-10-15 16:41:08 +01:00
parent 96fc791f10
commit 00ad77bb49
2 changed files with 12 additions and 2 deletions

View File

@@ -330,6 +330,13 @@ void MainWindow::init()
locateArtistAction = ActionCollection::get()->createAction("locateartist", tr("Artist"));
locateAlbumAction = ActionCollection::get()->createAction("locatealbum", tr("Album"));
locateTrackAction = ActionCollection::get()->createAction("locatetrack", tr("Track"));
locateArtistAction->setToolTip(tr("Locate In Library / Artist"));
locateAlbumAction->setToolTip(tr("Locate In Library / Album"));
locateTrackAction->setToolTip(tr("Locate In Library / Track"));
locateArtistAction->setProperty(Action::constTtForSettings, true);
locateAlbumAction->setProperty(Action::constTtForSettings, true);
locateTrackAction->setProperty(Action::constTtForSettings, true);
addAction(locateAction);
QMenu *locateMenu=new QMenu();
locateMenu->addAction(locateArtistAction);

View File

@@ -70,8 +70,11 @@ void Action::updateToolTip(QAction *act)
}
QKeySequence sc=act->shortcut();
if (sc.isEmpty()) {
act->setToolTip(act->property(constPlainToolTipProperty).toString());
act->setProperty(constPlainToolTipProperty, QString());
QString tt=act->property(constPlainToolTipProperty).toString();
if (!tt.isEmpty()) {
act->setToolTip(tt);
act->setProperty(constPlainToolTipProperty, QString());
}
} else {
QString tt=act->property(constPlainToolTipProperty).toString();
if (tt.isEmpty()) {