OTHER: enable I button in clutterbar
This commit is contained in:
parent
9b595af753
commit
7614e9ed81
5 changed files with 31 additions and 11 deletions
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* This file is a part of Esperanza, an XMMS2 Client.
|
* 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
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* 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);
|
QPixmap get_pixmap (uint32_t id);
|
||||||
QVariant extra_info_get (uint32_t, const QString &);
|
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 extra_info_set (uint32_t, const QString &, const QVariant &);
|
||||||
void invalidate (uint32_t);
|
void invalidate (uint32_t);
|
||||||
void invalidate_all ();
|
void invalidate_all ();
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "xclient.h"
|
#include "xclient.h"
|
||||||
|
#include "xclientcache.h"
|
||||||
|
|
||||||
#include "application.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
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* This file is a part of Promoe, an XMMS2 Client.
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -17,6 +17,9 @@
|
||||||
#define __APPLICATION__
|
#define __APPLICATION__
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
|
#include "entryinfo.h"
|
||||||
|
|
||||||
class XClient;
|
class XClient;
|
||||||
|
|
||||||
|
@ -53,9 +56,11 @@ class Application : public QApplication
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void toggleTime () {m_timemode_reverse = !m_timemode_reverse;}
|
void toggleTime () {m_timemode_reverse = !m_timemode_reverse;}
|
||||||
|
void showEntryInfo (int id = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_timemode_reverse;
|
bool m_timemode_reverse;
|
||||||
|
QPointer<EntryInfo> m_entry_info;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -87,6 +87,8 @@ MainDisplay::MainDisplay (MainWindow *parent) : SkinDisplay(parent)
|
||||||
|
|
||||||
m_clutterbar = new ClutterBar (this);
|
m_clutterbar = new ClutterBar (this);
|
||||||
m_clutterbar->move (10, 22);
|
m_clutterbar->move (10, 22);
|
||||||
|
connect (m_clutterbar, SIGNAL (clicked_i ()),
|
||||||
|
App, SLOT (showEntryInfo ()));
|
||||||
|
|
||||||
m_posbar = new PosBar (this);
|
m_posbar = new PosBar (this);
|
||||||
m_posbar->move (skin->getPos (Skin::SLIDER_POSBAR_BGS));
|
m_posbar->move (skin->getPos (Skin::SLIDER_POSBAR_BGS));
|
||||||
|
|
|
@ -320,15 +320,7 @@ PlaylistView::showEntryInfo (void)
|
||||||
if (current.isValid ()) {
|
if (current.isValid ()) {
|
||||||
uint32_t id = model ()->data (current, PlaylistModel::MedialibIdRole)
|
uint32_t id = model ()->data (current, PlaylistModel::MedialibIdRole)
|
||||||
.toUInt ();
|
.toUInt ();
|
||||||
// If no infodialog exists, create one, else set the selected Item as
|
App->showEntryInfo (id);
|
||||||
// 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 ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue