summaryrefslogtreecommitdiffstats
path: root/src/kmplayervdr.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 06:10:56 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 06:10:56 +0000
commit769e63d24adf5c844137484f06a972fcce732d6a (patch)
tree5185797dcb3ff4b1b3cb71d367123bf89eb2410f /src/kmplayervdr.cpp
parent0a8af92185eac74d48da1225e6053a0d66c078f5 (diff)
downloadkmplayer-769e63d24adf5c844137484f06a972fcce732d6a.tar.gz
kmplayer-769e63d24adf5c844137484f06a972fcce732d6a.zip
TQt4 port kmplayer
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmplayer@1238840 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kmplayervdr.cpp')
-rw-r--r--src/kmplayervdr.cpp300
1 files changed, 150 insertions, 150 deletions
diff --git a/src/kmplayervdr.cpp b/src/kmplayervdr.cpp
index 14a57ec..955eb90 100644
--- a/src/kmplayervdr.cpp
+++ b/src/kmplayervdr.cpp
@@ -20,25 +20,25 @@
#include <math.h>
#include <unistd.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qmap.h>
-#include <qtimer.h>
-#include <qpushbutton.h>
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
-#include <qtable.h>
-#include <qstringlist.h>
-#include <qcombobox.h>
-#include <qlineedit.h>
-#include <qgroupbox.h>
-#include <qwhatsthis.h>
-#include <qtabwidget.h>
-#include <qradiobutton.h>
-#include <qmessagebox.h>
-#include <qpopupmenu.h>
-#include <qsocket.h>
-#include <qeventloop.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqmap.h>
+#include <tqtimer.h>
+#include <tqpushbutton.h>
+#include <tqbuttongroup.h>
+#include <tqcheckbox.h>
+#include <tqtable.h>
+#include <tqstringlist.h>
+#include <tqcombobox.h>
+#include <tqlineedit.h>
+#include <tqgroupbox.h>
+#include <tqwhatsthis.h>
+#include <tqtabwidget.h>
+#include <tqradiobutton.h>
+#include <tqmessagebox.h>
+#include <tqpopupmenu.h>
+#include <tqsocket.h>
+#include <tqeventloop.h>
#include <klocale.h>
#include <kdebug.h>
@@ -75,39 +75,39 @@ static const char * strXVPort = "XV Port";
static const char * strXVEncoding = "XV Encoding";
static const char * strXVScale = "XV Scale";
-KDE_NO_CDTOR_EXPORT KMPlayerPrefSourcePageVDR::KMPlayerPrefSourcePageVDR (QWidget * parent, KMPlayer::PartBase * player)
- : QFrame (parent), m_player (player) {
+KDE_NO_CDTOR_EXPORT KMPlayerPrefSourcePageVDR::KMPlayerPrefSourcePageVDR (TQWidget * tqparent, KMPlayer::PartBase * player)
+ : TQFrame (tqparent), m_player (player) {
//KURLRequester * v4ldevice;
- QVBoxLayout *layout = new QVBoxLayout (this, 5, 2);
- QGridLayout *gridlayout = new QGridLayout (1, 2);
+ TQVBoxLayout *tqlayout = new TQVBoxLayout (this, 5, 2);
+ TQGridLayout *gridtqlayout = new TQGridLayout (1, 2);
xv_port = new KListView (this);
- xv_port->addColumn (QString());
+ xv_port->addColumn (TQString());
xv_port->header()->hide ();
xv_port->setTreeStepSize (15);
//xv_port->setRootIsDecorated (true);
//xv_port->setSorting (-1);
- QListViewItem * vitem = new QListViewItem (xv_port, i18n ("XVideo port"));
+ TQListViewItem * vitem = new TQListViewItem (xv_port, i18n ("XVideo port"));
vitem->setOpen (true);
- QWhatsThis::add (xv_port, i18n ("Port base of the X Video extension.\nIf left to default (0), the first available port will be used. However if you have multiple XVideo instances, you might have to provide the port to use here.\nSee the output from 'xvinfo' for more information"));
- QLabel * label = new QLabel (i18n ("Communication port:"), this);
- gridlayout->addWidget (label, 0, 0);
- tcp_port = new QLineEdit ("", this);
- QWhatsThis::add (tcp_port, i18n ("Communication port with VDR. Default is port 2001.\nIf you use another port, with the '-p' option of 'vdr', you must set it here too."));
- gridlayout->addWidget (tcp_port, 0, 1);
- layout->addWidget (xv_port);
- layout->addLayout (gridlayout);
- scale = new QButtonGroup (2, Qt::Vertical, i18n ("Scale"), this);
- new QRadioButton (i18n ("4:3"), scale);
- new QRadioButton (i18n ("16:9"), scale);
- QWhatsThis::add (scale, i18n ("Aspects to use when viewing VDR"));
+ TQWhatsThis::add (xv_port, i18n ("Port base of the X Video extension.\nIf left to default (0), the first available port will be used. However if you have multiple XVideo instances, you might have to provide the port to use here.\nSee the output from 'xvinfo' for more information"));
+ TQLabel * label = new TQLabel (i18n ("Communication port:"), this);
+ gridtqlayout->addWidget (label, 0, 0);
+ tcp_port = new TQLineEdit ("", this);
+ TQWhatsThis::add (tcp_port, i18n ("Communication port with VDR. Default is port 2001.\nIf you use another port, with the '-p' option of 'vdr', you must set it here too."));
+ gridtqlayout->addWidget (tcp_port, 0, 1);
+ tqlayout->addWidget (xv_port);
+ tqlayout->addLayout (gridtqlayout);
+ scale = new TQButtonGroup (2, Qt::Vertical, i18n ("Scale"), this);
+ new TQRadioButton (i18n ("4:3"), scale);
+ new TQRadioButton (i18n ("16:9"), scale);
+ TQWhatsThis::add (scale, i18n ("Aspects to use when viewing VDR"));
scale->setButton (0);
- layout->addWidget (scale);
- layout->addItem (new QSpacerItem (5, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
+ tqlayout->addWidget (scale);
+ tqlayout->addItem (new TQSpacerItem (5, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
}
KDE_NO_CDTOR_EXPORT KMPlayerPrefSourcePageVDR::~KMPlayerPrefSourcePageVDR () {}
-KDE_NO_EXPORT void KMPlayerPrefSourcePageVDR::showEvent (QShowEvent *) {
+KDE_NO_EXPORT void KMPlayerPrefSourcePageVDR::showEvent (TQShowEvent *) {
XVideo * xvideo = static_cast<XVideo *>(m_player->players()["xvideo"]);
if (!xvideo->configDocument ())
xvideo->getConfigData ();
@@ -130,10 +130,10 @@ public:
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT KMPlayerVDRSource::KMPlayerVDRSource (KMPlayerApp * app)
- : KMPlayer::Source (QString ("VDR"), app->player (), "vdrsource"),
+ : KMPlayer::Source (TQString ("VDR"), app->player (), "vdrsource"),
m_app (app),
m_configpage (0),
- m_socket (new QSocket (this)),
+ m_socket (new TQSocket (this)),
commands (0L),
channel_timer (0),
timeout_timer (0),
@@ -142,10 +142,10 @@ KDE_NO_CDTOR_EXPORT KMPlayerVDRSource::KMPlayerVDRSource (KMPlayerApp * app)
m_stored_volume (0) {
memset (m_actions, 0, sizeof (KAction *) * int (act_last));
m_player->settings ()->addPage (this);
- connect (m_socket, SIGNAL (connectionClosed()), this, SLOT(disconnected()));
- connect (m_socket, SIGNAL (connected ()), this, SLOT (connected ()));
- connect (m_socket, SIGNAL (readyRead ()), this, SLOT (readyRead ()));
- connect (m_socket, SIGNAL (error (int)), this, SLOT (socketError (int)));
+ connect (m_socket, TQT_SIGNAL (connectionClosed()), this, TQT_SLOT(disconnected()));
+ connect (m_socket, TQT_SIGNAL (connected ()), this, TQT_SLOT (connected ()));
+ connect (m_socket, TQT_SIGNAL (readyRead ()), this, TQT_SLOT (readyRead ()));
+ connect (m_socket, TQT_SIGNAL (error (int)), this, TQT_SLOT (socketError (int)));
}
KDE_NO_CDTOR_EXPORT KMPlayerVDRSource::~KMPlayerVDRSource () {}
@@ -154,8 +154,8 @@ KDE_NO_CDTOR_EXPORT void KMPlayerVDRSource::waitForConnectionClose () {
if (timeout_timer) {
finish_timer = startTimer (500);
kdDebug () << "VDR connection not yet closed" << endl;
- QApplication::eventLoop ()->enterLoop ();
- kdDebug () << "VDR connection:" << (m_socket->state () == QSocket::Connected) << endl;
+ TQApplication::eventLoop ()->enterLoop ();
+ kdDebug () << "VDR connection:" << (m_socket->state () == TQSocket::Connected) << endl;
timeout_timer = 0;
}
}
@@ -168,14 +168,14 @@ KDE_NO_EXPORT bool KMPlayerVDRSource::isSeekable () {
return true;
}
-KDE_NO_EXPORT QString KMPlayerVDRSource::prettyName () {
+KDE_NO_EXPORT TQString KMPlayerVDRSource::prettyName () {
return i18n ("VDR");
}
KDE_NO_EXPORT void KMPlayerVDRSource::activate () {
last_channel = 0;
- connect (this, SIGNAL (startPlaying ()), this, SLOT (processStarted()));
- connect (this, SIGNAL (stopPlaying ()), this, SLOT (processStopped ()));
+ connect (this, TQT_SIGNAL (startPlaying ()), this, TQT_SLOT (processStarted()));
+ connect (this, TQT_SIGNAL (stopPlaying ()), this, TQT_SLOT (processStopped ()));
KMPlayer::ControlPanel * panel = m_app->view()->controlPanel ();
panel->button (KMPlayer::ControlPanel::button_red)->show ();
panel->button (KMPlayer::ControlPanel::button_green)->show ();
@@ -183,29 +183,29 @@ KDE_NO_EXPORT void KMPlayerVDRSource::activate () {
panel->button (KMPlayer::ControlPanel::button_blue)->show ();
panel->button (KMPlayer::ControlPanel::button_pause)->hide ();
panel->button (KMPlayer::ControlPanel::button_record)->hide ();
- connect (panel->volumeBar (), SIGNAL (volumeChanged (int)), this, SLOT (volumeChanged (int)));
- connect (panel->button (KMPlayer::ControlPanel::button_red), SIGNAL (clicked ()), this, SLOT (keyRed ()));
- connect (panel->button (KMPlayer::ControlPanel::button_green), SIGNAL (clicked ()), this, SLOT (keyGreen ()));
- connect (panel->button (KMPlayer::ControlPanel::button_yellow), SIGNAL (clicked ()), this, SLOT (keyYellow ()));
- connect (panel->button (KMPlayer::ControlPanel::button_blue), SIGNAL (clicked ()), this, SLOT (keyBlue ()));
+ connect (panel->volumeBar (), TQT_SIGNAL (volumeChanged (int)), this, TQT_SLOT (volumeChanged (int)));
+ connect (panel->button (KMPlayer::ControlPanel::button_red), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyRed ()));
+ connect (panel->button (KMPlayer::ControlPanel::button_green), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyGreen ()));
+ connect (panel->button (KMPlayer::ControlPanel::button_yellow), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyYellow ()));
+ connect (panel->button (KMPlayer::ControlPanel::button_blue), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyBlue ()));
setAspect (m_document, scale ? 16.0/9 : 1.33);
if (!m_url.protocol ().compare ("kmplayer"))
m_request_jump = KURL::decode_string (m_url.path ()).mid (1);
- setURL (KURL (QString ("vdr://localhost:%1").arg (tcp_port)));
- QTimer::singleShot (0, m_player, SLOT (play ()));
+ setURL (KURL (TQString ("vdr://localhost:%1").arg (tcp_port)));
+ TQTimer::singleShot (0, m_player, TQT_SLOT (play ()));
}
KDE_NO_EXPORT void KMPlayerVDRSource::deactivate () {
- disconnect (m_socket, SIGNAL (error (int)), this, SLOT (socketError (int)));
+ disconnect (m_socket, TQT_SIGNAL (error (int)), this, TQT_SLOT (socketError (int)));
if (m_player->view ()) {
- disconnect (this, SIGNAL(startPlaying()), this, SLOT(processStarted()));
- disconnect (this, SIGNAL (stopPlaying()), this, SLOT(processStopped()));
+ disconnect (this, TQT_SIGNAL(startPlaying()), this, TQT_SLOT(processStarted()));
+ disconnect (this, TQT_SIGNAL (stopPlaying()), this, TQT_SLOT(processStopped()));
KMPlayer::ControlPanel * panel = m_app->view()->controlPanel ();
- disconnect (panel->volumeBar (), SIGNAL (volumeChanged (int)), this, SLOT (volumeChanged (int)));
- disconnect (panel->button (KMPlayer::ControlPanel::button_red), SIGNAL (clicked ()), this, SLOT (keyRed ()));
- disconnect (panel->button (KMPlayer::ControlPanel::button_green), SIGNAL (clicked ()), this, SLOT (keyGreen ()));
- disconnect (panel->button (KMPlayer::ControlPanel::button_yellow), SIGNAL (clicked ()), this, SLOT (keyYellow ()));
- disconnect (panel->button (KMPlayer::ControlPanel::button_blue), SIGNAL (clicked ()), this, SLOT (keyBlue ()));
+ disconnect (panel->volumeBar (), TQT_SIGNAL (volumeChanged (int)), this, TQT_SLOT (volumeChanged (int)));
+ disconnect (panel->button (KMPlayer::ControlPanel::button_red), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyRed ()));
+ disconnect (panel->button (KMPlayer::ControlPanel::button_green), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyGreen ()));
+ disconnect (panel->button (KMPlayer::ControlPanel::button_yellow), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyYellow ()));
+ disconnect (panel->button (KMPlayer::ControlPanel::button_blue), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyBlue ()));
}
processStopped ();
m_request_jump.truncate (0);
@@ -217,9 +217,9 @@ KDE_NO_EXPORT void KMPlayerVDRSource::playCurrent () {
}
KDE_NO_EXPORT void KMPlayerVDRSource::processStopped () {
- if (m_socket->state () == QSocket::Connected) {
- queueCommand (QString ("VOLU %1\n").arg (m_stored_volume).ascii ());
- queueCommand ("QUIT\n");
+ if (m_socket->state () == TQSocket::Connected) {
+ queueCommand (TQString ("VOLU %1\n").tqarg (m_stored_volume).ascii ());
+ queueCommand ("TQUIT\n");
}
}
@@ -229,7 +229,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::processStarted () {
}
#define DEF_ACT(i,text,pix,scut,slot,name) \
- m_actions [i] = new KAction (text, QString (pix), KShortcut (scut), this, slot, m_app->actionCollection (), name); \
+ m_actions [i] = new KAction (text, TQString (pix), KShortcut (scut), this, slot, m_app->actionCollection (), name); \
m_fullscreen_actions [i] = new KAction (text, KShortcut (scut), this, slot, m_app->view ()->viewArea ()->actionCollection (), name)
KDE_NO_EXPORT void KMPlayerVDRSource::connected () {
@@ -238,33 +238,33 @@ KDE_NO_EXPORT void KMPlayerVDRSource::connected () {
killTimer (channel_timer);
channel_timer = startTimer (3000);
KAction * action = m_app->actionCollection ()->action ("vdr_connect");
- action->setIcon (QString ("connect_no"));
+ action->setIcon (TQString ("connect_no"));
action->setText (i18n ("Dis&connect"));
- DEF_ACT (act_up, i18n ("VDR Key Up"), "up", , SLOT (keyUp ()), "vdr_key_up");
- DEF_ACT (act_down, i18n ("VDR Key Down"), "down", , SLOT (keyDown ()), "vdr_key_down");
- DEF_ACT (act_back, i18n ("VDR Key Back"), "back", , SLOT (keyBack ()), "vdr_key_back");
- DEF_ACT (act_ok, i18n ("VDR Key Ok"), "ok", , SLOT (keyOk ()), "vdr_key_ok");
- DEF_ACT (act_setup, i18n ("VDR Key Setup"), "configure", , SLOT (keySetup ()), "vdr_key_setup");
- DEF_ACT (act_channels, i18n ("VDR Key Channels"), "player_playlist", , SLOT (keyChannels ()), "vdr_key_channels");
- DEF_ACT (act_menu, i18n ("VDR Key Menu"), "showmenu", , SLOT (keyMenu ()), "vdr_key_menu");
- DEF_ACT (act_red, i18n ("VDR Key Red"), "red", , SLOT (keyRed ()), "vdr_key_red");
- DEF_ACT (act_green, i18n ("VDR Key Green"), "green", , SLOT (keyGreen ()), "vdr_key_green");
- DEF_ACT (act_yellow, i18n ("VDR Key Yellow"), "yellow", , SLOT (keyYellow ()), "vdr_key_yellow");
- DEF_ACT (act_blue, i18n ("VDR Key Blue"), "blue", , SLOT (keyBlue ()), "vdr_key_blue");
+ DEF_ACT (act_up, i18n ("VDR Key Up"), "up", , TQT_SLOT (keyUp ()), "vdr_key_up");
+ DEF_ACT (act_down, i18n ("VDR Key Down"), "down", , TQT_SLOT (keyDown ()), "vdr_key_down");
+ DEF_ACT (act_back, i18n ("VDR Key Back"), "back", , TQT_SLOT (keyBack ()), "vdr_key_back");
+ DEF_ACT (act_ok, i18n ("VDR Key Ok"), "ok", , TQT_SLOT (keyOk ()), "vdr_key_ok");
+ DEF_ACT (act_setup, i18n ("VDR Key Setup"), "configure", , TQT_SLOT (keySetup ()), "vdr_key_setup");
+ DEF_ACT (act_channels, i18n ("VDR Key Channels"), "player_playlist", , TQT_SLOT (keyChannels ()), "vdr_key_channels");
+ DEF_ACT (act_menu, i18n ("VDR Key Menu"), "showmenu", , TQT_SLOT (keyMenu ()), "vdr_key_menu");
+ DEF_ACT (act_red, i18n ("VDR Key Red"), "red", , TQT_SLOT (keyRed ()), "vdr_key_red");
+ DEF_ACT (act_green, i18n ("VDR Key Green"), "green", , TQT_SLOT (keyGreen ()), "vdr_key_green");
+ DEF_ACT (act_yellow, i18n ("VDR Key Yellow"), "yellow", , TQT_SLOT (keyYellow ()), "vdr_key_yellow");
+ DEF_ACT (act_blue, i18n ("VDR Key Blue"), "blue", , TQT_SLOT (keyBlue ()), "vdr_key_blue");
#if KDE_IS_VERSION(3, 1, 90)
- DEF_ACT (act_custom, "VDR Custom Command", "exec", , SLOT (customCmd ()), "vdr_key_custom");
+ DEF_ACT (act_custom, "VDR Custom Command", "exec", , TQT_SLOT (customCmd ()), "vdr_key_custom");
#endif
m_app->initMenu (); // update menu and toolbar
- DEF_ACT (act_0, i18n ("VDR Key 0"), "0", Qt::Key_0, SLOT (key0 ()), "vdr_key_0");
- DEF_ACT (act_1, i18n ("VDR Key 1"), "1", Qt::Key_1, SLOT (key1 ()), "vdr_key_1");
- DEF_ACT (act_2, i18n ("VDR Key 2"), "2", Qt::Key_2, SLOT (key2 ()), "vdr_key_2");
- DEF_ACT (act_3, i18n ("VDR Key 3"), "3", Qt::Key_3, SLOT (key3 ()), "vdr_key_3");
- DEF_ACT (act_4, i18n ("VDR Key 4"), "4", Qt::Key_4, SLOT (key4 ()), "vdr_key_4");
- DEF_ACT (act_5, i18n ("VDR Key 5"), "5", Qt::Key_5, SLOT (key5 ()), "vdr_key_5");
- DEF_ACT (act_6, i18n ("VDR Key 6"), "6", Qt::Key_6, SLOT (key6 ()), "vdr_key_6");
- DEF_ACT (act_7, i18n ("VDR Key 7"), "7", Qt::Key_7, SLOT (key7 ()), "vdr_key_7");
- DEF_ACT (act_8, i18n ("VDR Key 8"), "8", Qt::Key_8, SLOT (key8 ()), "vdr_key_8");
- DEF_ACT (act_9, i18n ("VDR Key 9"), "9", Qt::Key_9, SLOT (key9 ()), "vdr_key_9");
+ DEF_ACT (act_0, i18n ("VDR Key 0"), "0", TQt::Key_0, TQT_SLOT (key0 ()), "vdr_key_0");
+ DEF_ACT (act_1, i18n ("VDR Key 1"), "1", TQt::Key_1, TQT_SLOT (key1 ()), "vdr_key_1");
+ DEF_ACT (act_2, i18n ("VDR Key 2"), "2", TQt::Key_2, TQT_SLOT (key2 ()), "vdr_key_2");
+ DEF_ACT (act_3, i18n ("VDR Key 3"), "3", TQt::Key_3, TQT_SLOT (key3 ()), "vdr_key_3");
+ DEF_ACT (act_4, i18n ("VDR Key 4"), "4", TQt::Key_4, TQT_SLOT (key4 ()), "vdr_key_4");
+ DEF_ACT (act_5, i18n ("VDR Key 5"), "5", TQt::Key_5, TQT_SLOT (key5 ()), "vdr_key_5");
+ DEF_ACT (act_6, i18n ("VDR Key 6"), "6", TQt::Key_6, TQT_SLOT (key6 ()), "vdr_key_6");
+ DEF_ACT (act_7, i18n ("VDR Key 7"), "7", TQt::Key_7, TQT_SLOT (key7 ()), "vdr_key_7");
+ DEF_ACT (act_8, i18n ("VDR Key 8"), "8", TQt::Key_8, TQT_SLOT (key8 ()), "vdr_key_8");
+ DEF_ACT (act_9, i18n ("VDR Key 9"), "9", TQt::Key_9, TQT_SLOT (key9 ()), "vdr_key_9");
//KMPlayer::ViewLayer * layer = m_app->view ()->viewArea ();
for (int i = 0; i < int (act_last); ++i)
// somehow, the configured shortcuts only show up after createGUI() call
@@ -280,12 +280,12 @@ KDE_NO_EXPORT void KMPlayerVDRSource::disconnected () {
deleteCommands ();
return;
}
- setURL (KURL (QString ("vdr://localhost:%1").arg (tcp_port)));
+ setURL (KURL (TQString ("vdr://localhost:%1").arg (tcp_port)));
if (channel_timer && m_player->source () == this)
m_player->process ()->quit ();
deleteCommands ();
KAction * action = m_app->actionCollection ()->action ("vdr_connect");
- action->setIcon (QString ("connect_established"));
+ action->setIcon (TQString ("connect_established"));
action->setText (i18n ("&Connect"));
m_app->guiFactory ()->removeClient (m_app);// crash w/ m_actions[i]->unplugAll (); in for loop below
for (int i = 0; i < int (act_last); ++i)
@@ -298,8 +298,8 @@ KDE_NO_EXPORT void KMPlayerVDRSource::disconnected () {
}
KDE_NO_EXPORT void KMPlayerVDRSource::toggleConnected () {
- if (m_socket->state () == QSocket::Connected) {
- queueCommand ("QUIT\n");
+ if (m_socket->state () == TQSocket::Connected) {
+ queueCommand ("TQUIT\n");
killTimer (channel_timer);
channel_timer = 0;
} else {
@@ -309,7 +309,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::toggleConnected () {
}
KDE_NO_EXPORT void KMPlayerVDRSource::volumeChanged (int val) {
- queueCommand (QString ("VOLU %1\n").arg (int (sqrt (255 * 255 * val / 100))).ascii ());
+ queueCommand (TQString ("VOLU %1\n").tqarg (int (sqrt (255 * 255 * val / 100))).ascii ());
}
static struct ReadBuf {
@@ -329,13 +329,13 @@ static struct ReadBuf {
delete buf;
buf = b;
}
- KDE_NO_EXPORT QCString mid (int p) {
- return QCString (buf + p);
+ KDE_NO_EXPORT TQCString mid (int p) {
+ return TQCString (buf + p);
}
- KDE_NO_EXPORT QCString left (int p) {
- return QCString (buf, p);
+ KDE_NO_EXPORT TQCString left (int p) {
+ return TQCString (buf, p);
}
- KDE_NO_EXPORT QCString getReadLine ();
+ KDE_NO_EXPORT TQCString getReadLine ();
KDE_NO_EXPORT void clear () {
delete [] buf;
buf = 0;
@@ -343,8 +343,8 @@ static struct ReadBuf {
}
} readbuf;
-KDE_NO_EXPORT QCString ReadBuf::getReadLine () {
- QCString out;
+KDE_NO_EXPORT TQCString ReadBuf::getReadLine () {
+ TQCString out;
if (!length)
return out;
int p = strcspn (buf, "\r\n");
@@ -365,7 +365,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
m_socket->readBlock (data, nr);
data [nr] = 0;
readbuf += data;
- QCString line = readbuf.getReadLine ();
+ TQCString line = readbuf.getReadLine ();
if (commands) {
bool cmd_done = false;
while (!line.isEmpty ()) {
@@ -373,14 +373,14 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
cmd_done = (line.length () > 3 && line[3] == ' '); // from svdrpsend.pl
// kdDebug () << "readyRead " << cmd_done << " " << commands->command << endl;
if (!strcmp (commands->command, cmd_list_channels) && m_document) {
- int p = line.find (';');
- int q = line.find (':');
+ int p = line.tqfind (';');
+ int q = line.tqfind (':');
if (q > 0 && (p < 0 || q < p))
p = q;
if (p > 0)
line.truncate (p);
- QString channel_name = line.mid (4);
- m_document->appendChild (new KMPlayer::GenericMrl (m_document, QString ("kmplayer://vdrsource/%1").arg(channel_name), channel_name));
+ TQString channel_name = line.mid (4);
+ m_document->appendChild (new KMPlayer::GenericMrl (m_document, TQString ("kmplayer://vdrsource/%1").tqarg(channel_name), channel_name));
if (cmd_done) {
m_player->updateTree ();
if (!m_request_jump.isEmpty ()) {
@@ -391,9 +391,9 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
toconsole = false;
} else if (!strcmp (commands->command, cmd_chan_query)) {
if (v && line.length () > 4) {
- QString ch = line.mid (4);
+ TQString ch = line.mid (4);
setTitle (ch);
- KMPlayer::PlayListItem * lvi = static_cast <KMPlayer::PlayListItem *> (v->playList ()->findItem (ch, 0));
+ KMPlayer::PlayListItem * lvi = static_cast <KMPlayer::PlayListItem *> (v->playList ()->tqfindItem (ch, 0));
if (lvi && lvi->node != m_last_channel) {
KMPlayer::PlayListItem * si = static_cast <KMPlayer::PlayListItem *> (v->playList ()->selectedItem ());
bool jump_selection = (si && (si->node == m_document || si->node == m_last_channel));
@@ -412,14 +412,14 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
int c = strtol(ch.ascii(), 0L, 10);
if (c != last_channel) {
last_channel = c;
- m_app->statusBar ()->changeItem (QString::number (c),
+ m_app->statusBar ()->changeItem (TQString::number (c),
id_status_timer);
}
}
} else if (cmd_done && !strcmp(commands->command,cmd_volume_query)){
- int pos = line.findRev (QChar (' '));
+ int pos = line.tqfindRev (TQChar (' '));
if (pos > 0) {
- QString vol = line.mid (pos + 1);
+ TQString vol = line.mid (pos + 1);
if (!vol.compare ("mute"))
m_stored_volume = 0;
else
@@ -429,7 +429,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
}
}
if (v && toconsole)
- v->addText (QString (line), true);
+ v->addText (TQString (line), true);
line = readbuf.getReadLine ();
}
if (cmd_done) {
@@ -448,9 +448,9 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
}
KDE_NO_EXPORT void KMPlayerVDRSource::socketError (int code) {
- if (code == QSocket::ErrHostNotFound) {
+ if (code == TQSocket::ErrHostNotFound) {
KMessageBox::error (m_configpage, i18n ("Host not found"), i18n ("Error"));
- } else if (code == QSocket::ErrConnectionRefused) {
+ } else if (code == TQSocket::ErrConnectionRefused) {
KMessageBox::error (m_configpage, i18n ("Connection refused"), i18n ("Error"));
}
}
@@ -461,7 +461,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::queueCommand (const char * cmd) {
if (!commands) {
readbuf.clear ();
commands = new VDRCommand (cmd);
- if (m_socket->state () == QSocket::Connected) {
+ if (m_socket->state () == TQSocket::Connected) {
sendCommand ();
} else {
m_socket->connectToHost ("127.0.0.1", tcp_port);
@@ -493,13 +493,13 @@ KDE_NO_EXPORT void KMPlayerVDRSource::sendCommand () {
KDE_NO_EXPORT void KMPlayerVDRSource::customCmd () {
#if KDE_IS_VERSION(3, 1, 90)
- QString cmd = KInputDialog::getText (i18n ("Custom VDR command"), i18n ("You can pass commands to VDR.\nEnter 'HELP' to see a list of available commands.\nYou can see VDR response in the console window.\n\nVDR Command:"), QString(), 0, m_player->view ());
+ TQString cmd = KInputDialog::getText (i18n ("Custom VDR command"), i18n ("You can pass commands to VDR.\nEnter 'HELP' to see a list of available commands.\nYou can see VDR response in the console window.\n\nVDR Command:"), TQString(), 0, m_player->view ());
if (!cmd.isEmpty ())
- queueCommand (QString (cmd + QChar ('\n')).local8Bit ());
+ queueCommand (TQString (cmd + TQChar ('\n')).local8Bit ());
#endif
}
-KDE_NO_EXPORT void KMPlayerVDRSource::timerEvent (QTimerEvent * e) {
+KDE_NO_EXPORT void KMPlayerVDRSource::timerEvent (TQTimerEvent * e) {
if (e->timerId () == timeout_timer || e->timerId () == finish_timer) {
deleteCommands ();
} else if (e->timerId () == channel_timer) {
@@ -521,7 +521,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::deleteCommands () {
readbuf.clear ();
if (finish_timer) {
killTimer (finish_timer);
- QApplication::eventLoop ()->exitLoop ();
+ TQApplication::eventLoop ()->exitLoop ();
}
}
@@ -531,10 +531,10 @@ KDE_NO_EXPORT void KMPlayerVDRSource::jump (KMPlayer::NodePtr e) {
jump (e->mrl ()->pretty_name);
}
-KDE_NO_EXPORT void KMPlayerVDRSource::jump (const QString & channel) {
- QCString c ("CHAN ");
- QCString ch = channel.local8Bit ();
- int p = ch.find (' ');
+KDE_NO_EXPORT void KMPlayerVDRSource::jump (const TQString & channel) {
+ TQCString c ("CHAN ");
+ TQCString ch = channel.local8Bit ();
+ int p = ch.tqfind (' ');
if (p > 0)
c += ch.left (p);
else
@@ -651,9 +651,9 @@ KDE_NO_EXPORT void KMPlayerVDRSource::read (KConfig * m_config) {
scale = m_config->readNumEntry (strXVScale, 0);
}
-struct XVTreeItem : public QListViewItem {
- XVTreeItem (QListViewItem *parent, const QString & t, int p, int e)
- : QListViewItem (parent, t), port (p), encoding (e) {}
+struct XVTreeItem : public TQListViewItem {
+ XVTreeItem (TQListViewItem *tqparent, const TQString & t, int p, int e)
+ : TQListViewItem (tqparent, t), port (p), encoding (e) {}
int port;
int encoding;
};
@@ -670,12 +670,12 @@ KDE_NO_EXPORT void KMPlayerVDRSource::sync (bool fromUI) {
m_xvencoding = vitem->encoding;
}
} else {
- m_configpage->tcp_port->setText (QString::number (tcp_port));
+ m_configpage->tcp_port->setText (TQString::number (tcp_port));
m_configpage->scale->setButton (scale);
- QListViewItem * vitem = m_configpage->xv_port->firstChild ();
+ TQListViewItem * vitem = m_configpage->xv_port->firstChild ();
NodePtr configdoc = xvideo->configDocument ();
if (configdoc && configdoc->firstChild ()) {
- for (QListViewItem *i=vitem->firstChild(); i; i=vitem->firstChild())
+ for (TQListViewItem *i=vitem->firstChild(); i; i=vitem->firstChild())
delete i;
NodePtr node = configdoc->firstChild ();
for (node = node->firstChild (); node; node = node->nextSibling()) {
@@ -683,27 +683,27 @@ KDE_NO_EXPORT void KMPlayerVDRSource::sync (bool fromUI) {
continue; // some text sneaked in ?
Element * elm = convertNode <Element> (node);
if (elm->getAttribute (KMPlayer::StringPool::attr_type) !=
- QString ("tree"))
+ TQString ("tree"))
continue;
for (NodePtr n = elm->firstChild (); n; n = n->nextSibling ()) {
if (!n->isElementNode () || strcmp (n->nodeName (), "Port"))
continue;
Element * e = convertNode <Element> (n);
- QString portatt = e->getAttribute (
+ TQString portatt = e->getAttribute (
KMPlayer::StringPool::attr_value);
int port;
- QListViewItem *pi = new QListViewItem (vitem, i18n ("Port ") + portatt);
+ TQListViewItem *pi = new TQListViewItem (vitem, i18n ("Port ") + portatt);
port = portatt.toInt ();
for (NodePtr in=e->firstChild(); in; in=in->nextSibling()) {
if (!in->isElementNode () ||
strcmp (in->nodeName (), "Input"))
continue;
Element * i = convertNode <Element> (in);
- QString inp = i->getAttribute (
+ TQString inp = i->getAttribute (
KMPlayer::StringPool::attr_name);
int enc = i->getAttribute (
KMPlayer::StringPool::attr_value).toInt ();
- QListViewItem * ii = new XVTreeItem(pi, inp, port, enc);
+ TQListViewItem * ii = new XVTreeItem(pi, inp, port, enc);
if (m_xvport == port && enc == m_xvencoding) {
ii->setSelected (true);
m_configpage->xv_port->ensureItemVisible (ii);
@@ -712,25 +712,25 @@ KDE_NO_EXPORT void KMPlayerVDRSource::sync (bool fromUI) {
}
}
} else // wait for showEvent
- connect (xvideo, SIGNAL (configReceived()), this, SLOT (configReceived()));
+ connect (xvideo, TQT_SIGNAL (configReceived()), this, TQT_SLOT (configReceived()));
}
}
KDE_NO_EXPORT void KMPlayerVDRSource::configReceived () {
XVideo * xvideo = static_cast<XVideo *>(m_player->players()["xvideo"]);
- disconnect (xvideo, SIGNAL (configReceived()), this, SLOT (configReceived()));
+ disconnect (xvideo, TQT_SIGNAL (configReceived()), this, TQT_SLOT (configReceived()));
sync (false);
}
-KDE_NO_EXPORT void KMPlayerVDRSource::prefLocation (QString & item, QString & icon, QString & tab) {
+KDE_NO_EXPORT void KMPlayerVDRSource::prefLocation (TQString & item, TQString & icon, TQString & tab) {
item = i18n ("Source");
- icon = QString ("source");
+ icon = TQString ("source");
tab = i18n ("VDR");
}
-KDE_NO_EXPORT QFrame * KMPlayerVDRSource::prefPage (QWidget * parent) {
+KDE_NO_EXPORT TQFrame * KMPlayerVDRSource::prefPage (TQWidget * tqparent) {
if (!m_configpage)
- m_configpage = new KMPlayerPrefSourcePageVDR (parent, m_player);
+ m_configpage = new KMPlayerPrefSourcePageVDR (tqparent, m_player);
return m_configpage;
}
@@ -747,8 +747,8 @@ static const char * xv_supported [] = {
"tvsource", "vdrsource", 0L
};
-KDE_NO_CDTOR_EXPORT XVideo::XVideo (QObject * parent, Settings * settings)
- : KMPlayer::CallbackProcess (parent, settings, "xvideo", i18n ("X&Video")) {
+KDE_NO_CDTOR_EXPORT XVideo::XVideo (TQObject * tqparent, Settings * settings)
+ : KMPlayer::CallbackProcess (tqparent, settings, "xvideo", i18n ("X&Video")) {
m_supported_sources = xv_supported;
//m_player->settings ()->addPage (m_configpage);
}
@@ -760,16 +760,16 @@ KDE_NO_EXPORT bool XVideo::ready (KMPlayer::Viewer * v) {
return true;
}
initProcess (v);
- QString cmd = QString ("kxvplayer -wid %3 -cb %4").arg (viewer ()->embeddedWinId ()).arg (dcopName ());
+ TQString cmd = TQString ("kxvplayer -wid %3 -cb %4").arg (viewer ()->embeddedWinId ()).arg (dcopName ());
if (m_have_config == config_unknown || m_have_config == config_probe)
- cmd += QString (" -c");
+ cmd += TQString (" -c");
if (m_source) {
int xv_port = m_source->xvPort ();
int xv_encoding = m_source->xvEncoding ();
int freq = m_source->frequency ();
- cmd += QString (" -port %1 -enc %2 -norm \"%3\"").arg (xv_port).arg (xv_encoding).arg (m_source->videoNorm ());
+ cmd += TQString (" -port %1 -enc %2 -norm \"%3\"").arg (xv_port).arg (xv_encoding).arg (m_source->videoNorm ());
if (freq > 0)
- cmd += QString (" -freq %1").arg (freq);
+ cmd += TQString (" -freq %1").arg (freq);
}
fprintf (stderr, "%s\n", cmd.latin1 ());
*m_process << cmd;