OTHER: enable I button in clutterbar

This commit is contained in:
Thomas Frauendorfer 2010-03-20 03:19:49 +01:00
parent 9b595af753
commit 7614e9ed81
5 changed files with 31 additions and 11 deletions

View file

@ -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 ();

View file

@ -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)
{

View file

@ -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 <QApplication>
#include <QPointer>
#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<EntryInfo> m_entry_info;
};
#endif

View file

@ -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));

View file

@ -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);
}
}