summaryrefslogtreecommitdiffstats
path: root/juk/nowplaying.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'juk/nowplaying.cpp')
-rw-r--r--juk/nowplaying.cpp78
1 files changed, 39 insertions, 39 deletions
diff --git a/juk/nowplaying.cpp b/juk/nowplaying.cpp
index 4256ecff..ebf03b94 100644
--- a/juk/nowplaying.cpp
+++ b/juk/nowplaying.cpp
@@ -39,17 +39,17 @@
static const int imageSize = 64;
-struct Line : public QFrame
+struct Line : public TQFrame
{
- Line(TQWidget *parent) : TQFrame(parent) { setFrameShape(VLine); }
+ Line(TQWidget *tqparent) : TQFrame(tqparent) { setFrameShape(VLine); }
};
////////////////////////////////////////////////////////////////////////////////
// NowPlaying
////////////////////////////////////////////////////////////////////////////////
-NowPlaying::NowPlaying(TQWidget *parent, PlaylistCollection *collection, const char *name) :
- TQHBox(parent, name),
+NowPlaying::NowPlaying(TQWidget *tqparent, PlaylistCollection *collection, const char *name) :
+ TQHBox(tqparent, name),
m_observer(this, collection),
m_collection(collection)
{
@@ -58,9 +58,9 @@ NowPlaying::NowPlaying(TQWidget *parent, PlaylistCollection *collection, const c
CollectionList::instance()->addObserver(&m_observer);
- layout()->setMargin(5);
- layout()->setSpacing(3);
- setFixedHeight(imageSize + 2 + layout()->margin() * 2);
+ tqlayout()->setMargin(5);
+ tqlayout()->setSpacing(3);
+ setFixedHeight(imageSize + 2 + tqlayout()->margin() * 2);
setStretchFactor(new CoverItem(this), 0);
setStretchFactor(new TrackItem(this), 2);
@@ -105,11 +105,11 @@ void NowPlaying::slotUpdate()
// CoverItem
////////////////////////////////////////////////////////////////////////////////
-CoverItem::CoverItem(NowPlaying *parent) :
- TQLabel(parent, "CoverItem"),
- NowPlayingItem(parent)
+CoverItem::CoverItem(NowPlaying *tqparent) :
+ TQLabel(tqparent, "CoverItem"),
+ NowPlayingItem(tqparent)
{
- setFixedHeight(parent->height() - parent->layout()->margin() * 2);
+ setFixedHeight(tqparent->height() - tqparent->tqlayout()->margin() * 2);
setFrameStyle(Box | Plain);
setLineWidth(1);
setMargin(1);
@@ -123,7 +123,7 @@ void CoverItem::update(const FileHandle &file)
if(file.coverInfo()->hasCover()) {
show();
TQImage image = file.coverInfo()->pixmap(CoverInfo::Thumbnail).convertToImage();
- setPixmap(image.smoothScale(imageSize, imageSize, TQImage::ScaleMin));
+ setPixmap(image.smoothScale(imageSize, imageSize, TQ_ScaleMin));
}
else
hide();
@@ -138,7 +138,7 @@ void CoverItem::mouseReleaseEvent(TQMouseEvent *event)
if(event->x() >= 0 && event->y() >= 0 &&
event->x() < width() && event->y() < height() &&
- event->button() == LeftButton &&
+ event->button() == Qt::LeftButton &&
m_file.coverInfo()->hasCover())
{
m_file.coverInfo()->popup();
@@ -159,7 +159,7 @@ void CoverItem::mouseMoveEvent(TQMouseEvent *e)
return;
TQPoint diff = m_dragStart - e->globalPos();
- if(QABS(diff.x()) > 1 || QABS(diff.y()) > 1) {
+ if(TQABS(diff.x()) > 1 || TQABS(diff.y()) > 1) {
// Start a drag.
@@ -214,21 +214,21 @@ void CoverItem::dropEvent(TQDropEvent *e)
// TrackItem
////////////////////////////////////////////////////////////////////////////////
-TrackItem::TrackItem(NowPlaying *parent) :
- TQWidget(parent, "TrackItem"),
- NowPlayingItem(parent)
+TrackItem::TrackItem(NowPlaying *tqparent) :
+ TQWidget(tqparent, "TrackItem"),
+ NowPlayingItem(tqparent)
{
- setFixedHeight(parent->height() - parent->layout()->margin() * 2);
- setSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed);
+ setFixedHeight(tqparent->height() - tqparent->tqlayout()->margin() * 2);
+ tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed);
- TQVBoxLayout *layout = new TQVBoxLayout(this);
+ TQVBoxLayout *tqlayout = new TQVBoxLayout(this);
m_label = new LinkLabel(this);
m_label->setLinkUnderline(false);
- layout->addStretch();
- layout->addWidget(m_label);
- layout->addStretch();
+ tqlayout->addStretch();
+ tqlayout->addWidget(m_label);
+ tqlayout->addStretch();
connect(m_label, TQT_SIGNAL(linkClicked(const TQString &)), this,
TQT_SLOT(slotOpenLink(const TQString &)));
@@ -242,7 +242,7 @@ void TrackItem::update(const FileHandle &file)
void TrackItem::slotOpenLink(const TQString &link)
{
- PlaylistCollection *collection = NowPlayingItem::parent()->collection();
+ PlaylistCollection *collection = NowPlayingItem::tqparent()->collection();
if(link == "artist")
collection->showMore(m_file.tag()->artist());
@@ -259,7 +259,7 @@ void TrackItem::slotUpdate()
TQString title = TQStyleSheet::escape(m_file.tag()->title());
TQString artist = TQStyleSheet::escape(m_file.tag()->artist());
TQString album = TQStyleSheet::escape(m_file.tag()->album());
- TQString separator = (artist.isNull() || album.isNull()) ? TQString::null : TQString(" - ");
+ TQString separator = (artist.isNull() || album.isNull()) ? TQString() : TQString(" - ");
// This block-o-nastiness makes the font smaller and smaller until it actually fits.
@@ -269,32 +269,32 @@ void TrackItem::slotUpdate()
"<br />"
"<font size=\"+%3\"><b><a href=\"artist\">%4</a>%5<a href=\"album\">%6</a></b>";
- if(NowPlayingItem::parent()->collection()->showMoreActive())
- format.append(TQString(" (<a href=\"clear\">%1</a>)").arg(i18n("back to playlist")));
+ if(NowPlayingItem::tqparent()->collection()->showMoreActive())
+ format.append(TQString(" (<a href=\"clear\">%1</a>)").tqarg(i18n("back to playlist")));
format.append("</font>");
do {
- m_label->setText(format.arg(size).arg(title).arg(size - 2)
- .arg(artist).arg(separator).arg(album));
+ m_label->setText(format.tqarg(size).tqarg(title).tqarg(size - 2)
+ .tqarg(artist).tqarg(separator).tqarg(album));
--size;
} while(m_label->heightForWidth(m_label->width()) > imageSize && size >= 0);
- m_label->setFixedHeight(QMIN(imageSize, m_label->heightForWidth(m_label->width())));
+ m_label->setFixedHeight(TQMIN(imageSize, m_label->heightForWidth(m_label->width())));
}
////////////////////////////////////////////////////////////////////////////////
// HistoryItem
////////////////////////////////////////////////////////////////////////////////
-HistoryItem::HistoryItem(NowPlaying *parent) :
- LinkLabel(parent, "HistoryItem"),
- NowPlayingItem(parent)
+HistoryItem::HistoryItem(NowPlaying *tqparent) :
+ LinkLabel(tqparent, "HistoryItem"),
+ NowPlayingItem(tqparent)
{
- setFixedHeight(parent->height() - parent->layout()->margin() * 2);
- setSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed);
+ setFixedHeight(tqparent->height() - tqparent->tqlayout()->margin() * 2);
+ tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed);
setLinkUnderline(false);
- setText(TQString("<b>%1</b>").arg(i18n("History")));
+ setText(TQString("<b>%1</b>").tqarg(i18n("History")));
m_timer = new TQTimer(this);
connect(m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotAddPlaying()));
@@ -309,14 +309,14 @@ void HistoryItem::update(const FileHandle &file)
m_history.remove(m_history.fromLast());
TQString format = "<br /><a href=\"%1\"><font size=\"-1\">%2</font></a>";
- TQString current = TQString("<b>%1</b>").arg(i18n("History"));
+ TQString current = TQString("<b>%1</b>").tqarg(i18n("History"));
TQString previous;
for(TQValueList<Item>::ConstIterator it = m_history.begin();
it != m_history.end(); ++it)
{
previous = current;
- current.append(format.arg((*it).anchor).arg(TQStyleSheet::escape((*it).file.tag()->title())));
+ current.append(format.tqarg((*it).anchor).tqarg(TQStyleSheet::escape((*it).file.tag()->title())));
setText(current);
if(heightForWidth(width()) > imageSize) {
setText(previous);
@@ -342,7 +342,7 @@ void HistoryItem::openLink(const TQString &link)
(*it).playlist->clearSelection();
(*it).playlist->setSelected(item, true);
(*it).playlist->ensureItemVisible(item);
- NowPlayingItem::parent()->collection()->raise((*it).playlist);
+ NowPlayingItem::tqparent()->collection()->raise((*it).playlist);
}
break;
}