aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/lyrics/lyrics.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-05-11 11:32:20 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-05-11 11:32:20 +0000
commitf12c647031485d06eb2eb46b74a10f097f141fca (patch)
tree88deff28de85f80c6ec34fc27b16cffcba739a49 /src/plugins/General/lyrics/lyrics.cpp
parent08de867fc96c121b518523fb2e832f9c80539f01 (diff)
downloadqmmp-f12c647031485d06eb2eb46b74a10f097f141fca.tar.gz
qmmp-f12c647031485d06eb2eb46b74a10f097f141fca.tar.bz2
qmmp-f12c647031485d06eb2eb46b74a10f097f141fca.zip
lyrics plugin: added hotkey
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@935 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/lyrics/lyrics.cpp')
-rw-r--r--src/plugins/General/lyrics/lyrics.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/plugins/General/lyrics/lyrics.cpp b/src/plugins/General/lyrics/lyrics.cpp
index fc5589165..e0492cbf5 100644
--- a/src/plugins/General/lyrics/lyrics.cpp
+++ b/src/plugins/General/lyrics/lyrics.cpp
@@ -33,6 +33,7 @@ Lyrics::Lyrics(QObject *parent)
: General(parent)
{
m_action = new QAction(tr("View Lyrics"), this);
+ m_action->setShortcut(tr("Ctrl+L"));
GeneralHandler::instance()->addAction(m_action, GeneralHandler::PLAYLIST_MENU);
connect (m_action, SIGNAL(triggered ()), SLOT(showLyrics()));
}
@@ -42,15 +43,12 @@ Lyrics::~Lyrics()
void Lyrics::showLyrics()
{
- foreach (PlayListItem *item, MediaPlayer::instance()->playListModel()->items())
+ QList <PlayListItem *> items = MediaPlayer::instance()->playListModel()->getSelectedItems();
+ if (!items.isEmpty())
{
- if (item->isSelected())
- {
- if (item->artist().isEmpty() || item->title().isEmpty())
- break;
- LyricsWindow *w = new LyricsWindow(item->artist(), item->title(), qApp->activeWindow ());
+ if (items.at(0)->artist().isEmpty() || items.at(0)->title().isEmpty())
+ return;
+ LyricsWindow *w = new LyricsWindow(items.at(0)->artist(), items.at(0)->title(), qApp->activeWindow ());
w->show();
- break;
- }
}
}