summaryrefslogtreecommitdiffstats
path: root/kicker-applets/mediacontrol/mediacontrol.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
commit7346aee26bf190a7e70333c40fab4caca847cd27 (patch)
tree4b019b434f88dcc3eeaafe1d3f26240b4c4718e8 /kicker-applets/mediacontrol/mediacontrol.cpp
parent23a3d3aa5b44cbdf305495919866d9dbf4f6da54 (diff)
downloadtdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.tar.gz
tdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1157634 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kicker-applets/mediacontrol/mediacontrol.cpp')
-rw-r--r--kicker-applets/mediacontrol/mediacontrol.cpp128
1 files changed, 64 insertions, 64 deletions
diff --git a/kicker-applets/mediacontrol/mediacontrol.cpp b/kicker-applets/mediacontrol/mediacontrol.cpp
index e69e0e0..433f52d 100644
--- a/kicker-applets/mediacontrol/mediacontrol.cpp
+++ b/kicker-applets/mediacontrol/mediacontrol.cpp
@@ -35,13 +35,13 @@
#include "mcslider.h"
-#include <qfile.h>
-#include <qdragobject.h>
-#include <qtooltip.h>
-#include <qstyle.h>
-#include <qslider.h>
-#include <qpainter.h>
-#include <qiconset.h>
+#include <tqfile.h>
+#include <tqdragobject.h>
+#include <tqtooltip.h>
+#include <tqstyle.h>
+#include <tqslider.h>
+#include <tqpainter.h>
+#include <tqiconset.h>
#include <kpopupmenu.h>
#include <kapplication.h>
@@ -57,7 +57,7 @@ const int NO_BUTTONS = 4;
extern "C"
{
- KDE_EXPORT KPanelApplet *init( QWidget *parent, const QString &configFile)
+ KDE_EXPORT KPanelApplet *init( TQWidget *parent, const TQString &configFile)
{
KGlobal::locale()->insertCatalogue("mediacontrol");
return new MediaControl(configFile, KPanelApplet::Normal,
@@ -71,27 +71,27 @@ extern "C"
class MediaControlToolTip : public QToolTip
{
public:
- MediaControlToolTip(QWidget *widget, PlayerInterface *pl_obj) :
- QToolTip(widget), mWidget(widget), mPlayer(pl_obj) {}
+ MediaControlToolTip(TQWidget *widget, PlayerInterface *pl_obj) :
+ TQToolTip(widget), mWidget(widget), mPlayer(pl_obj) {}
protected:
- virtual void maybeTip(const QPoint &pt)
+ virtual void maybeTip(const TQPoint &pt)
{
- QRect rc( mWidget->rect());
+ TQRect rc( mWidget->rect());
if (rc.contains(pt))
{
tip ( rc, mPlayer->getTrackTitle() );
}
}
private:
- QWidget *mWidget;
+ TQWidget *mWidget;
PlayerInterface *mPlayer;
};
// =============================================================================
-MediaControl::MediaControl(const QString &configFile, Type t, int actions,
- QWidget *parent, const char *name)
+MediaControl::MediaControl(const TQString &configFile, Type t, int actions,
+ TQWidget *parent, const char *name)
: DCOPObject("MediaControl"),
KPanelApplet(configFile, t, actions, parent, name),
mInstance(new KInstance("mediacontrol")),
@@ -139,7 +139,7 @@ MediaControl::MediaControl(const QString &configFile, Type t, int actions,
playpause_button = new TrayButton (this, "PLAYPAUSE");
stop_button = new TrayButton (this, "STOP");
next_button = new TrayButton (this, "NEXT");
- time_slider = new MCSlider (QSlider::Horizontal, this, "time_slider" );
+ time_slider = new MCSlider (TQSlider::Horizontal, this, "time_slider" );
time_slider->setRange(0,0);
time_slider->setValue(0);
time_slider->setTracking( false );
@@ -147,15 +147,15 @@ MediaControl::MediaControl(const QString &configFile, Type t, int actions,
// request notification of changes in icon style
kapp->addKipcEventMask(KIPC::IconChanged);
- connect(kapp, SIGNAL(iconChanged(int)), this, SLOT(slotIconChanged()));
+ connect(kapp, TQT_SIGNAL(iconChanged(int)), this, TQT_SLOT(slotIconChanged()));
reparseConfig();
rmbMenu = new KPopupMenu(this, "RMBMenu");
rmbMenu->insertTitle(i18n("MediaControl"), 0, 0);
rmbMenu->insertItem(SmallIcon("configure"), i18n("Configure MediaControl..."),
- this, SLOT(preferences()));
- rmbMenu->insertItem(i18n("About MediaControl"), this, SLOT(about()));
+ this, TQT_SLOT(preferences()));
+ rmbMenu->insertItem(i18n("About MediaControl"), this, TQT_SLOT(about()));
}
MediaControl::~MediaControl()
@@ -168,12 +168,12 @@ MediaControl::~MediaControl()
// Drag-n-Drop stuff ===========================================================
-void MediaControl::dragEnterEvent(QDragEnterEvent* event)
+void MediaControl::dragEnterEvent(TQDragEnterEvent* event)
{
_player->dragEnterEvent(event); // Just pass dnd to the playerInterface
}
-void MediaControl::dropEvent(QDropEvent* event)
+void MediaControl::dropEvent(TQDropEvent* event)
{
_player->dropEvent(event); // Just pass dnd to the playerInterface
}
@@ -202,7 +202,7 @@ void MediaControl::enableAll()
{
prev_button->setDisabled(false);
playpause_button->setDisabled(false);
- QToolTip::remove(playpause_button);
+ TQToolTip::remove(playpause_button);
stop_button->setDisabled(false);
next_button->setDisabled(false);
time_slider->setDisabled(false);
@@ -212,12 +212,12 @@ void MediaControl::disableAll()
{
prev_button->setDisabled(true);
playpause_button->setDisabled(false);
- QToolTip::add(playpause_button, i18n("Start the player"));
+ TQToolTip::add(playpause_button, i18n("Start the player"));
stop_button->setDisabled(true);
next_button->setDisabled(true);
time_slider->setDisabled(true);
if(_configFrontend->useCustomTheme()) {
- QString skindir = locate("data", "mediacontrol/"+_configFrontend->theme()+"/");
+ TQString skindir = locate("data", "mediacontrol/"+_configFrontend->theme()+"/");
playpause_button->setIconSet(SmallIconSet(locate("data",skindir+"play.png")));
}
else
@@ -230,7 +230,7 @@ void MediaControl::slotPlayingStatusChanged(int status)
return;
mLastStatus = status;
- QString skindir = locate("data", "mediacontrol/"+_configFrontend->theme()+"/");
+ TQString skindir = locate("data", "mediacontrol/"+_configFrontend->theme()+"/");
switch (status)
{
@@ -275,12 +275,12 @@ void MediaControl::preferences()
else
{
_prefsDialog = new MediaControlConfig ( _configFrontend );
- connect ( _prefsDialog, SIGNAL(closing()),
- this, SLOT(slotClosePrefsDialog()) );
- connect ( _prefsDialog, SIGNAL(destroyed()),
- this, SLOT(slotPrefsDialogClosing()) );
- connect ( _prefsDialog, SIGNAL(configChanged()),
- this, SLOT(slotConfigChanged()) );
+ connect ( _prefsDialog, TQT_SIGNAL(closing()),
+ this, TQT_SLOT(slotClosePrefsDialog()) );
+ connect ( _prefsDialog, TQT_SIGNAL(destroyed()),
+ this, TQT_SLOT(slotPrefsDialogClosing()) );
+ connect ( _prefsDialog, TQT_SIGNAL(configChanged()),
+ this, TQT_SLOT(slotConfigChanged()) );
}
}
@@ -352,7 +352,7 @@ void MediaControl::reparseConfig()
mLastTime = -1;
mLastStatus = -1;
- QString playerString = _configFrontend->player();
+ TQString playerString = _configFrontend->player();
#ifdef HAVE_XMMS
@@ -396,21 +396,21 @@ void MediaControl::reparseConfig()
}
// this signal gets emitted by a playerInterface when the player's playtime changed
- connect(_player, SIGNAL(newSliderPosition(int,int)),
- this, SLOT(setSliderPosition(int,int)));
+ connect(_player, TQT_SIGNAL(newSliderPosition(int,int)),
+ this, TQT_SLOT(setSliderPosition(int,int)));
- connect(_player, SIGNAL(playerStarted()), SLOT(enableAll()));
- connect(_player, SIGNAL(playerStopped()), SLOT(disableAll()));
- connect(_player, SIGNAL(playingStatusChanged(int)), SLOT(slotPlayingStatusChanged(int)));
+ connect(_player, TQT_SIGNAL(playerStarted()), TQT_SLOT(enableAll()));
+ connect(_player, TQT_SIGNAL(playerStopped()), TQT_SLOT(disableAll()));
+ connect(_player, TQT_SIGNAL(playingStatusChanged(int)), TQT_SLOT(slotPlayingStatusChanged(int)));
// do we use our icons or the default ones from KDE?
if(_configFrontend->useCustomTheme())
{
// load theme
- QString skindir = locate("data", "mediacontrol/"+_configFrontend->theme()+"/");
+ TQString skindir = locate("data", "mediacontrol/"+_configFrontend->theme()+"/");
// the user has to take care if all pixmaps are there, we only check for one of them
- if (QFile(skindir+"play.png").exists())
+ if (TQFile(skindir+"play.png").exists())
{
prev_button->setIconSet(SmallIconSet(locate("data",skindir+"prev.png")));
if (_player->playingStatus() == PlayerInterface::Playing)
@@ -441,17 +441,17 @@ void MediaControl::reparseConfig()
slider_tooltip = new MediaControlToolTip(time_slider, _player);
- connect(prev_button, SIGNAL(clicked()), _player, SLOT(prev()));
- connect(playpause_button, SIGNAL(clicked()), _player, SLOT(playpause()));
- connect(stop_button, SIGNAL(clicked()), _player, SLOT(stop()));
- connect(next_button, SIGNAL(clicked()), _player, SLOT(next()));
-
- connect(time_slider, SIGNAL(sliderPressed()), _player, SLOT(sliderStartDrag()));
- connect(time_slider, SIGNAL(sliderReleased()), _player, SLOT(sliderStopDrag()));
- connect(time_slider, SIGNAL(valueChanged(int)), this, SLOT(adjustTime(int)));
- connect(time_slider, SIGNAL(volumeUp()), _player, SLOT(volumeUp()));
- connect(time_slider, SIGNAL(volumeDown()), _player, SLOT(volumeDown()));
- connect(this, SIGNAL(newJumpToTime(int)), _player, SLOT(jumpToTime(int)));
+ connect(prev_button, TQT_SIGNAL(clicked()), _player, TQT_SLOT(prev()));
+ connect(playpause_button, TQT_SIGNAL(clicked()), _player, TQT_SLOT(playpause()));
+ connect(stop_button, TQT_SIGNAL(clicked()), _player, TQT_SLOT(stop()));
+ connect(next_button, TQT_SIGNAL(clicked()), _player, TQT_SLOT(next()));
+
+ connect(time_slider, TQT_SIGNAL(sliderPressed()), _player, TQT_SLOT(sliderStartDrag()));
+ connect(time_slider, TQT_SIGNAL(sliderReleased()), _player, TQT_SLOT(sliderStopDrag()));
+ connect(time_slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(adjustTime(int)));
+ connect(time_slider, TQT_SIGNAL(volumeUp()), _player, TQT_SLOT(volumeUp()));
+ connect(time_slider, TQT_SIGNAL(volumeDown()), _player, TQT_SLOT(volumeDown()));
+ connect(this, TQT_SIGNAL(newJumpToTime(int)), _player, TQT_SLOT(jumpToTime(int)));
}
// Widget Placement ===================================================================
@@ -496,18 +496,18 @@ int MediaControl::heightForWidth(int width) const
}
}
-void MediaControl::mousePressEvent(QMouseEvent* e)
+void MediaControl::mousePressEvent(TQMouseEvent* e)
{
- if (e->button() == QMouseEvent::RightButton)
+ if (e->button() == TQMouseEvent::RightButton)
rmbMenu->popup(e->globalPos());
}
-bool MediaControl::eventFilter(QObject *, QEvent *e)
+bool MediaControl::eventFilter(TQObject *, TQEvent *e)
{
- if (e->type() == QEvent::MouseButtonPress)
+ if (e->type() == TQEvent::MouseButtonPress)
{
- QMouseEvent *me = static_cast<QMouseEvent *>(e);
- if (me->button() == QMouseEvent::RightButton)
+ TQMouseEvent *me = static_cast<TQMouseEvent *>(e);
+ if (me->button() == TQMouseEvent::RightButton)
{
rmbMenu->popup(me->globalPos());
return true;
@@ -516,25 +516,25 @@ bool MediaControl::eventFilter(QObject *, QEvent *e)
return false;
}
-void MediaControl::paletteChange( const QPalette& )
+void MediaControl::paletteChange( const TQPalette& )
{
time_slider->setBackground();
}
-void MediaControl::moveEvent( QMoveEvent* )
+void MediaControl::moveEvent( TQMoveEvent* )
{
time_slider->setBackground();
}
// Danger: Weird Code ahead! ;))
-void MediaControl::resizeEvent( QResizeEvent* )
+void MediaControl::resizeEvent( TQResizeEvent* )
{
// kdDebug(90200) << "resizeEvent()" << endl;
int w = width();
int h = height();
if ( orientation() == Vertical )
{ // ====== VERTICAL =================================================
- time_slider->setOrientation(QSlider::Vertical);
+ time_slider->setOrientation(TQSlider::Vertical);
int slider_width = time_slider->minimumSizeHint().width();
// some styles need more space for sliders than avilable in very small panels :(
if ( slider_width > w ) slider_width = w;
@@ -566,7 +566,7 @@ void MediaControl::resizeEvent( QResizeEvent* )
}
else // ====== HORIZONTAL ===============================================
{
- time_slider->setOrientation(QSlider::Horizontal);
+ time_slider->setOrientation(TQSlider::Horizontal);
int slider_height = time_slider->minimumSizeHint().height();
// some styles need more space for sliders than avilable in very small panels :(
if ( slider_height > h ) slider_height = h;
@@ -600,15 +600,15 @@ void MediaControl::resizeEvent( QResizeEvent* )
// Our Button ========================================================================
-TrayButton::TrayButton(QWidget* parent, const char* name)
+TrayButton::TrayButton(TQWidget* parent, const char* name)
: SimpleButton (parent, name)
{
setBackgroundMode(PaletteBackground);
setBackgroundOrigin(AncestorOrigin);
}
-void TrayButton::setIconSet(const QIconSet &iconSet)
+void TrayButton::setIconSet(const TQIconSet &iconSet)
{
- setPixmap(iconSet.pixmap(QIconSet::Automatic, QIconSet::Normal, QIconSet::On));
+ setPixmap(iconSet.pixmap(TQIconSet::Automatic, TQIconSet::Normal, TQIconSet::On));
}