diff --git a/backend_xmmsclient++/xclientcache.h b/backend_xmmsclient++/xclientcache.h index d381379..c4b2c4d 100644 --- a/backend_xmmsclient++/xclientcache.h +++ b/backend_xmmsclient++/xclientcache.h @@ -1,7 +1,7 @@ /** * This file is a part of Esperanza, an XMMS2 Client. * - * Copyright (C) 2005-2007 XMMS2 Team + * Copyright (C) 2005-2010 XMMS2 Team * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -61,6 +61,8 @@ class XClientCache : public QObject QPixmap get_pixmap (uint32_t id); QVariant extra_info_get (uint32_t, const QString &); + int get_current_id () { return m_current_id; } + void extra_info_set (uint32_t, const QString &, const QVariant &); void invalidate (uint32_t); void invalidate_all (); diff --git a/src/application.cpp b/src/application.cpp index 3fb1061..7f7c41e 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -14,6 +14,7 @@ */ #include "xclient.h" +#include "xclientcache.h" #include "application.h" @@ -107,6 +108,24 @@ Application::handleDisconnected () } } +void +Application::showEntryInfo (int id) +{ + if (id <= 0) { + id = m_xmms2_client->cache ()->get_current_id (); + } + if (id <= 0) + return; + + if (!m_entry_info) { + m_entry_info = new EntryInfo (NULL, m_xmms2_client->cache (), id); + } else { + m_entry_info->raise (); + m_entry_info->setId (id); + } + m_entry_info->show (); +} + int main (int argc, char **argv) { diff --git a/src/application.h b/src/application.h index 2bbc4f5..1463ef5 100644 --- a/src/application.h +++ b/src/application.h @@ -1,7 +1,7 @@ /** * This file is a part of Promoe, an XMMS2 Client. * - * Copyright (C) 2005-2008 XMMS2 Team + * Copyright (C) 2005-2010 XMMS2 Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,6 +17,9 @@ #define __APPLICATION__ #include +#include + +#include "entryinfo.h" class XClient; @@ -53,9 +56,11 @@ class Application : public QApplication public slots: void toggleTime () {m_timemode_reverse = !m_timemode_reverse;} + void showEntryInfo (int id = 0); private: bool m_timemode_reverse; + QPointer m_entry_info; }; #endif diff --git a/src/mainwindow/maindisplay.cpp b/src/mainwindow/maindisplay.cpp index 6140b4f..2b69c79 100644 --- a/src/mainwindow/maindisplay.cpp +++ b/src/mainwindow/maindisplay.cpp @@ -87,6 +87,8 @@ MainDisplay::MainDisplay (MainWindow *parent) : SkinDisplay(parent) m_clutterbar = new ClutterBar (this); m_clutterbar->move (10, 22); + connect (m_clutterbar, SIGNAL (clicked_i ()), + App, SLOT (showEntryInfo ())); m_posbar = new PosBar (this); m_posbar->move (skin->getPos (Skin::SLIDER_POSBAR_BGS)); diff --git a/src/playlist/playlistview.cpp b/src/playlist/playlistview.cpp index b43ac76..3a25d91 100644 --- a/src/playlist/playlistview.cpp +++ b/src/playlist/playlistview.cpp @@ -320,15 +320,7 @@ PlaylistView::showEntryInfo (void) if (current.isValid ()) { uint32_t id = model ()->data (current, PlaylistModel::MedialibIdRole) .toUInt (); - // If no infodialog exists, create one, else set the selected Item as - // displayed item - if (!m_entry_info) { - m_entry_info = new EntryInfo (this, client->cache (), id); - } else { - m_entry_info->raise (); - m_entry_info->setId (id); - } - m_entry_info->show (); + App->showEntryInfo (id); } }