diff options
Diffstat (limited to 'juk/nowplaying.cpp')
-rw-r--r-- | juk/nowplaying.cpp | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/juk/nowplaying.cpp b/juk/nowplaying.cpp index 2336faac..4256ecff 100644 --- a/juk/nowplaying.cpp +++ b/juk/nowplaying.cpp @@ -19,13 +19,13 @@ #include <kurldrag.h> #include <kio/netaccess.h> -#include <qimage.h> -#include <qlayout.h> -#include <qevent.h> -#include <qdragobject.h> -#include <qimage.h> -#include <qtimer.h> -#include <qpoint.h> +#include <tqimage.h> +#include <tqlayout.h> +#include <tqevent.h> +#include <tqdragobject.h> +#include <tqimage.h> +#include <tqtimer.h> +#include <tqpoint.h> #include "nowplaying.h" #include "playlistcollection.h" @@ -41,15 +41,15 @@ static const int imageSize = 64; struct Line : public QFrame { - Line(QWidget *parent) : QFrame(parent) { setFrameShape(VLine); } + Line(TQWidget *parent) : TQFrame(parent) { setFrameShape(VLine); } }; //////////////////////////////////////////////////////////////////////////////// // NowPlaying //////////////////////////////////////////////////////////////////////////////// -NowPlaying::NowPlaying(QWidget *parent, PlaylistCollection *collection, const char *name) : - QHBox(parent, name), +NowPlaying::NowPlaying(TQWidget *parent, PlaylistCollection *collection, const char *name) : + TQHBox(parent, name), m_observer(this, collection), m_collection(collection) { @@ -67,8 +67,8 @@ NowPlaying::NowPlaying(QWidget *parent, PlaylistCollection *collection, const ch setStretchFactor(new Line(this), 0); setStretchFactor(new HistoryItem(this), 1); - connect(PlayerManager::instance(), SIGNAL(signalPlay()), this, SLOT(slotUpdate())); - connect(PlayerManager::instance(), SIGNAL(signalStop()), this, SLOT(slotUpdate())); + connect(PlayerManager::instance(), TQT_SIGNAL(signalPlay()), this, TQT_SLOT(slotUpdate())); + connect(PlayerManager::instance(), TQT_SIGNAL(signalStop()), this, TQT_SLOT(slotUpdate())); hide(); } @@ -94,7 +94,7 @@ void NowPlaying::slotUpdate() else show(); - for(QValueList<NowPlayingItem *>::Iterator it = m_items.begin(); + for(TQValueList<NowPlayingItem *>::Iterator it = m_items.begin(); it != m_items.end(); ++it) { (*it)->update(file); @@ -106,7 +106,7 @@ void NowPlaying::slotUpdate() //////////////////////////////////////////////////////////////////////////////// CoverItem::CoverItem(NowPlaying *parent) : - QLabel(parent, "CoverItem"), + TQLabel(parent, "CoverItem"), NowPlayingItem(parent) { setFixedHeight(parent->height() - parent->layout()->margin() * 2); @@ -122,14 +122,14 @@ void CoverItem::update(const FileHandle &file) if(file.coverInfo()->hasCover()) { show(); - QImage image = file.coverInfo()->pixmap(CoverInfo::Thumbnail).convertToImage(); - setPixmap(image.smoothScale(imageSize, imageSize, QImage::ScaleMin)); + TQImage image = file.coverInfo()->pixmap(CoverInfo::Thumbnail).convertToImage(); + setPixmap(image.smoothScale(imageSize, imageSize, TQImage::ScaleMin)); } else hide(); } -void CoverItem::mouseReleaseEvent(QMouseEvent *event) +void CoverItem::mouseReleaseEvent(TQMouseEvent *event) { if(m_dragging) { m_dragging = false; @@ -144,21 +144,21 @@ void CoverItem::mouseReleaseEvent(QMouseEvent *event) m_file.coverInfo()->popup(); } - QLabel::mousePressEvent(event); + TQLabel::mousePressEvent(event); } -void CoverItem::mousePressEvent(QMouseEvent *e) +void CoverItem::mousePressEvent(TQMouseEvent *e) { m_dragging = false; m_dragStart = e->globalPos(); } -void CoverItem::mouseMoveEvent(QMouseEvent *e) +void CoverItem::mouseMoveEvent(TQMouseEvent *e) { if(m_dragging) return; - QPoint diff = m_dragStart - e->globalPos(); + TQPoint diff = m_dragStart - e->globalPos(); if(QABS(diff.x()) > 1 || QABS(diff.y()) > 1) { // Start a drag. @@ -170,21 +170,21 @@ void CoverItem::mouseMoveEvent(QMouseEvent *e) } } -void CoverItem::dragEnterEvent(QDragEnterEvent *e) +void CoverItem::dragEnterEvent(TQDragEnterEvent *e) { - e->accept(QImageDrag::canDecode(e) || KURLDrag::canDecode(e) || CoverDrag::canDecode(e)); + e->accept(TQImageDrag::canDecode(e) || KURLDrag::canDecode(e) || CoverDrag::canDecode(e)); } -void CoverItem::dropEvent(QDropEvent *e) +void CoverItem::dropEvent(TQDropEvent *e) { - QImage image; + TQImage image; KURL::List urls; coverKey key; if(e->source() == this) return; - if(QImageDrag::decode(e, image)) { + if(TQImageDrag::decode(e, image)) { m_file.coverInfo()->setCover(image); update(m_file); } @@ -193,7 +193,7 @@ void CoverItem::dropEvent(QDropEvent *e) update(m_file); } else if(KURLDrag::decode(e, urls)) { - QString fileName; + TQString fileName; if(KIO::NetAccess::download(urls.front(), fileName, this)) { if(image.load(fileName)) { @@ -215,13 +215,13 @@ void CoverItem::dropEvent(QDropEvent *e) //////////////////////////////////////////////////////////////////////////////// TrackItem::TrackItem(NowPlaying *parent) : - QWidget(parent, "TrackItem"), + TQWidget(parent, "TrackItem"), NowPlayingItem(parent) { setFixedHeight(parent->height() - parent->layout()->margin() * 2); - setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + setSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed); - QVBoxLayout *layout = new QVBoxLayout(this); + TQVBoxLayout *layout = new TQVBoxLayout(this); m_label = new LinkLabel(this); m_label->setLinkUnderline(false); @@ -230,17 +230,17 @@ TrackItem::TrackItem(NowPlaying *parent) : layout->addWidget(m_label); layout->addStretch(); - connect(m_label, SIGNAL(linkClicked(const QString &)), this, - SLOT(slotOpenLink(const QString &))); + connect(m_label, TQT_SIGNAL(linkClicked(const TQString &)), this, + TQT_SLOT(slotOpenLink(const TQString &))); } void TrackItem::update(const FileHandle &file) { m_file = file; - QTimer::singleShot(0, this, SLOT(slotUpdate())); + TQTimer::singleShot(0, this, TQT_SLOT(slotUpdate())); } -void TrackItem::slotOpenLink(const QString &link) +void TrackItem::slotOpenLink(const TQString &link) { PlaylistCollection *collection = NowPlayingItem::parent()->collection(); @@ -256,21 +256,21 @@ void TrackItem::slotOpenLink(const QString &link) void TrackItem::slotUpdate() { - QString title = QStyleSheet::escape(m_file.tag()->title()); - QString artist = QStyleSheet::escape(m_file.tag()->artist()); - QString album = QStyleSheet::escape(m_file.tag()->album()); - QString separator = (artist.isNull() || album.isNull()) ? QString::null : QString(" - "); + 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(" - "); // This block-o-nastiness makes the font smaller and smaller until it actually fits. int size = 4; - QString format = + TQString format = "<font size=\"+%1\"><b>%2</b></font>" "<br />" "<font size=\"+%3\"><b><a href=\"artist\">%4</a>%5<a href=\"album\">%6</a></b>"; if(NowPlayingItem::parent()->collection()->showMoreActive()) - format.append(QString(" (<a href=\"clear\">%1</a>)").arg(i18n("back to playlist"))); + format.append(TQString(" (<a href=\"clear\">%1</a>)").arg(i18n("back to playlist"))); format.append("</font>"); @@ -292,12 +292,12 @@ HistoryItem::HistoryItem(NowPlaying *parent) : NowPlayingItem(parent) { setFixedHeight(parent->height() - parent->layout()->margin() * 2); - setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + setSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed); setLinkUnderline(false); - setText(QString("<b>%1</b>").arg(i18n("History"))); + setText(TQString("<b>%1</b>").arg(i18n("History"))); - m_timer = new QTimer(this); - connect(m_timer, SIGNAL(timeout()), this, SLOT(slotAddPlaying())); + m_timer = new TQTimer(this); + connect(m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotAddPlaying())); } void HistoryItem::update(const FileHandle &file) @@ -308,15 +308,15 @@ void HistoryItem::update(const FileHandle &file) if(m_history.count() >= 10) m_history.remove(m_history.fromLast()); - QString format = "<br /><a href=\"%1\"><font size=\"-1\">%2</font></a>"; - QString current = QString("<b>%1</b>").arg(i18n("History")); - QString previous; + TQString format = "<br /><a href=\"%1\"><font size=\"-1\">%2</font></a>"; + TQString current = TQString("<b>%1</b>").arg(i18n("History")); + TQString previous; - for(QValueList<Item>::ConstIterator it = m_history.begin(); + for(TQValueList<Item>::ConstIterator it = m_history.begin(); it != m_history.end(); ++it) { previous = current; - current.append(format.arg((*it).anchor).arg(QStyleSheet::escape((*it).file.tag()->title()))); + current.append(format.arg((*it).anchor).arg(TQStyleSheet::escape((*it).file.tag()->title()))); setText(current); if(heightForWidth(width()) > imageSize) { setText(previous); @@ -329,9 +329,9 @@ void HistoryItem::update(const FileHandle &file) m_timer->start(HistoryPlaylist::delay(), true); } -void HistoryItem::openLink(const QString &link) +void HistoryItem::openLink(const TQString &link) { - for(QValueList<Item>::ConstIterator it = m_history.begin(); + for(TQValueList<Item>::ConstIterator it = m_history.begin(); it != m_history.end(); ++it) { if((*it).anchor == link) { |