diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:43:15 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:43:15 +0000 |
commit | e654398e46e37abf457b2b1122ab898d2c51c49f (patch) | |
tree | d39ee6440f3c3663c3ead84a2d4cc2d034667e96 /juk/statuslabel.cpp | |
parent | e4f29b18e19394b9352f52a6c0d0d0e3932cf511 (diff) | |
download | tdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.tar.gz tdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1157644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'juk/statuslabel.cpp')
-rw-r--r-- | juk/statuslabel.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/juk/statuslabel.cpp b/juk/statuslabel.cpp index fa8dfb38..81f066ea 100644 --- a/juk/statuslabel.cpp +++ b/juk/statuslabel.cpp @@ -20,8 +20,8 @@ #include <klocale.h> #include <kdebug.h> -#include <qtooltip.h> -#include <qlayout.h> +#include <tqtooltip.h> +#include <tqlayout.h> #include "statuslabel.h" #include "filehandle.h" @@ -35,57 +35,57 @@ using namespace ActionCollection; // public methods //////////////////////////////////////////////////////////////////////////////// -StatusLabel::StatusLabel(PlaylistInterface *playlist, QWidget *parent, const char *name) : - QHBox(parent, name), +StatusLabel::StatusLabel(PlaylistInterface *playlist, TQWidget *parent, const char *name) : + TQHBox(parent, name), PlaylistObserver(playlist), m_showTimeRemaining(false) { - QFrame *trackAndPlaylist = new QFrame(this); + TQFrame *trackAndPlaylist = new TQFrame(this); trackAndPlaylist->setFrameStyle(Box | Sunken); - trackAndPlaylist->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + trackAndPlaylist->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); // Make sure that we have enough of a margin to suffice for the borders, // hence the "lineWidth() * 2" - QHBoxLayout *trackAndPlaylistLayout = new QHBoxLayout(trackAndPlaylist, + TQHBoxLayout *trackAndPlaylistLayout = new TQHBoxLayout(trackAndPlaylist, trackAndPlaylist->lineWidth() * 2, 5, "trackAndPlaylistLayout"); trackAndPlaylistLayout->addSpacing(5); m_playlistLabel = new KSqueezedTextLabel(trackAndPlaylist, "playlistLabel"); trackAndPlaylistLayout->addWidget(m_playlistLabel); - m_playlistLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + m_playlistLabel->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); m_playlistLabel->setTextFormat(PlainText); m_playlistLabel->setAlignment(AlignLeft | AlignVCenter); m_trackLabel = new KSqueezedTextLabel(trackAndPlaylist, "trackLabel"); trackAndPlaylistLayout->addWidget(m_trackLabel); m_trackLabel->setAlignment(AlignRight | AlignVCenter); - m_trackLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + m_trackLabel->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); m_trackLabel->setTextFormat(PlainText); trackAndPlaylistLayout->addSpacing(5); - m_itemTimeLabel = new QLabel(this); - QFontMetrics fontMetrics(font()); + m_itemTimeLabel = new TQLabel(this); + TQFontMetrics fontMetrics(font()); m_itemTimeLabel->setAlignment(AlignCenter); m_itemTimeLabel->setMinimumWidth(fontMetrics.boundingRect("000:00 / 000:00").width()); - m_itemTimeLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); + m_itemTimeLabel->setSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding); m_itemTimeLabel->setFrameStyle(Box | Sunken); m_itemTimeLabel->installEventFilter(this); setItemTotalTime(0); setItemCurrentTime(0); - QHBox *jumpBox = new QHBox(this); + TQHBox *jumpBox = new TQHBox(this); jumpBox->setFrameStyle(Box | Sunken); - jumpBox->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum); + jumpBox->setSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::Minimum); - QPushButton *jumpButton = new QPushButton(jumpBox); + TQPushButton *jumpButton = new TQPushButton(jumpBox); jumpButton->setPixmap(SmallIcon("up")); jumpButton->setFlat(true); - QToolTip::add(jumpButton, i18n("Jump to the currently playing item")); - connect(jumpButton, SIGNAL(clicked()), action("showPlaying"), SLOT(activate())); + TQToolTip::add(jumpButton, i18n("Jump to the currently playing item")); + connect(jumpButton, TQT_SIGNAL(clicked()), action("showPlaying"), TQT_SLOT(activate())); installEventFilter(this); @@ -102,10 +102,10 @@ void StatusLabel::updateCurrent() if(playlist()->playing()) { FileHandle file = playlist()->currentFile(); - QString mid = file.tag()->artist().isEmpty() || file.tag()->title().isEmpty() - ? QString::null : QString(" - "); + TQString mid = file.tag()->artist().isEmpty() || file.tag()->title().isEmpty() + ? TQString::null : TQString(" - "); - QString text = file.tag()->artist() + mid + file.tag()->title(); + TQString text = file.tag()->artist() + mid + file.tag()->title(); m_trackLabel->setText(text); m_playlistLabel->setText(playlist()->name().simplifyWhiteSpace()); @@ -127,7 +127,7 @@ void StatusLabel::updateData() int minutes = time / 60 % 60; int seconds = time % 60; - QString timeString; + TQString timeString; if(days > 0) { timeString = i18n("1 day", "%n days", days); @@ -135,9 +135,9 @@ void StatusLabel::updateData() } if(days > 0 || hours > 0) - timeString.append(QString().sprintf("%1d:%02d:%02d", hours, minutes, seconds)); + timeString.append(TQString().sprintf("%1d:%02d:%02d", hours, minutes, seconds)); else - timeString.append(QString().sprintf("%1d:%02d", minutes, seconds)); + timeString.append(TQString().sprintf("%1d:%02d", minutes, seconds)); m_playlistLabel->setText(playlist()->name()); m_trackLabel->setText(i18n("1 item", "%n items", playlist()->count()) + " - " + timeString); @@ -165,18 +165,18 @@ void StatusLabel::updateTime() int totalMinutes = int(m_itemTotalTime / 60); int totalSeconds = m_itemTotalTime % 60; - QString timeString = formatTime(minutes, seconds) + " / " + + TQString timeString = formatTime(minutes, seconds) + " / " + formatTime(totalMinutes, totalSeconds); m_itemTimeLabel->setText(timeString); } -bool StatusLabel::eventFilter(QObject *o, QEvent *e) +bool StatusLabel::eventFilter(TQObject *o, TQEvent *e) { if(!o || !e) return false; - QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(e); - if(e->type() == QEvent::MouseButtonRelease && + TQMouseEvent *mouseEvent = static_cast<TQMouseEvent *>(e); + if(e->type() == TQEvent::MouseButtonRelease && mouseEvent->button() == LeftButton) { if(o == m_itemTimeLabel) { @@ -191,12 +191,12 @@ bool StatusLabel::eventFilter(QObject *o, QEvent *e) return false; } -QString StatusLabel::formatTime(int minutes, int seconds) // static +TQString StatusLabel::formatTime(int minutes, int seconds) // static { - QString m = QString::number(minutes); + TQString m = TQString::number(minutes); if(m.length() == 1) m = "0" + m; - QString s = QString::number(seconds); + TQString s = TQString::number(seconds); if(s.length() == 1) s = "0" + s; return m + ":" + s; |