diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
commit | 576eb4299a00bc053db35414406f46372a0f70f2 (patch) | |
tree | 4c030922d533821db464af566188e7d40cc8848c | |
parent | 0718336b6017d1a4fc1d626544180a5a2a29ddec (diff) | |
download | tdegames-576eb4299a00bc053db35414406f46372a0f70f2.tar.gz tdegames-576eb4299a00bc053db35414406f46372a0f70f2.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
689 files changed, 13174 insertions, 13174 deletions
diff --git a/atlantik/atlanticd/atlanticclient.cpp b/atlantik/atlanticd/atlanticclient.cpp index 0445165d..0e4e3e12 100644 --- a/atlantik/atlanticd/atlanticclient.cpp +++ b/atlantik/atlanticd/atlanticclient.cpp @@ -14,18 +14,18 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qtextstream.h> -#include <qtimer.h> +#include <tqtextstream.h> +#include <tqtimer.h> #include "atlanticclient.h" #include "atlanticclient.moc" -AtlanticClient::AtlanticClient(QObject *parent, const char *name) : QSocket(parent, name) +AtlanticClient::AtlanticClient(TQObject *parent, const char *name) : TQSocket(parent, name) { - connect(this, SIGNAL(readyRead()), this, SLOT(readData())); + connect(this, TQT_SIGNAL(readyRead()), this, TQT_SLOT(readData())); } -void AtlanticClient::sendData(const QString &data) +void AtlanticClient::sendData(const TQString &data) { writeBlock(data.latin1(), data.length()); } @@ -37,7 +37,7 @@ void AtlanticClient::readData() emit clientInput(this, readLine()); // There might be more data - QTimer::singleShot(0, this, SLOT(readData())); + TQTimer::singleShot(0, this, TQT_SLOT(readData())); } else { diff --git a/atlantik/atlanticd/atlanticclient.h b/atlantik/atlanticd/atlanticclient.h index 7b47b0f3..8f63b88c 100644 --- a/atlantik/atlanticd/atlanticclient.h +++ b/atlantik/atlanticd/atlanticclient.h @@ -17,20 +17,20 @@ #ifndef CLIENT_H #define CLIENT_H -#include <qsocket.h> +#include <tqsocket.h> class AtlanticClient : public QSocket { Q_OBJECT public: - AtlanticClient(QObject *parent = 0, const char *name = 0); - void sendData(const QString &data); + AtlanticClient(TQObject *parent = 0, const char *name = 0); + void sendData(const TQString &data); private slots: void readData(); signals: - void clientInput(AtlanticClient *client, const QString &data); + void clientInput(AtlanticClient *client, const TQString &data); }; #endif diff --git a/atlantik/atlanticd/atlanticdaemon.cpp b/atlantik/atlanticd/atlanticdaemon.cpp index 3fb80cf0..84a27925 100644 --- a/atlantik/atlanticd/atlanticdaemon.cpp +++ b/atlantik/atlanticd/atlanticdaemon.cpp @@ -14,9 +14,9 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qtimer.h> -#include <qsocket.h> -#include <qstring.h> +#include <tqtimer.h> +#include <tqsocket.h> +#include <tqstring.h> #include <atlantic_core.h> @@ -28,13 +28,13 @@ AtlanticDaemon::AtlanticDaemon() { m_serverSocket = new ServerSocket(1234, 100); - connect(m_serverSocket, SIGNAL(newClient(AtlanticClient *)), this, SLOT(newClient(AtlanticClient *))); + connect(m_serverSocket, TQT_SIGNAL(newClient(AtlanticClient *)), this, TQT_SLOT(newClient(AtlanticClient *))); m_atlanticCore = new AtlanticCore(this, "atlanticCore"); // Create socket for Monopigator - m_monopigatorSocket = new QSocket(); - connect(m_monopigatorSocket, SIGNAL(connected()), this, SLOT(monopigatorConnected())); + m_monopigatorSocket = new TQSocket(); + connect(m_monopigatorSocket, TQT_SIGNAL(connected()), this, TQT_SLOT(monopigatorConnected())); // Register server monopigatorRegister(); @@ -52,21 +52,21 @@ void AtlanticDaemon::monopigatorRegister() void AtlanticDaemon::monopigatorConnected() { - QString get = "GET /register.php?host=capsi.com&port=1234&version=atlanticd-prototype HTTP/1.1\nHost: gator.monopd.net\n\n"; + TQString get = "GET /register.php?host=capsi.com&port=1234&version=atlanticd-prototype HTTP/1.1\nHost: gator.monopd.net\n\n"; m_monopigatorSocket->writeBlock(get.latin1(), get.length()); m_monopigatorSocket->close(); // Monopigator clears old entries, so keep registering every 180s - QTimer::singleShot(180000, this, SLOT(monopigatorRegister())); + TQTimer::singleShot(180000, this, TQT_SLOT(monopigatorRegister())); } void AtlanticDaemon::newClient(AtlanticClient *client) { m_clients.append(client); - connect(client, SIGNAL(clientInput(AtlanticClient *, const QString &)), this, SLOT(clientInput(AtlanticClient *, const QString &))); + connect(client, TQT_SIGNAL(clientInput(AtlanticClient *, const TQString &)), this, TQT_SLOT(clientInput(AtlanticClient *, const TQString &))); } -void AtlanticDaemon::clientInput(AtlanticClient *client, const QString &data) +void AtlanticDaemon::clientInput(AtlanticClient *client, const TQString &data) { } diff --git a/atlantik/atlanticd/atlanticdaemon.h b/atlantik/atlanticd/atlanticdaemon.h index 729a960e..17e41898 100644 --- a/atlantik/atlanticd/atlanticdaemon.h +++ b/atlantik/atlanticd/atlanticdaemon.h @@ -17,7 +17,7 @@ #ifndef ATLANTIC_ATLANTICDAEMON_H #define ATLANTIC_ATLANTICDAEMON_H -#include <qptrlist.h> +#include <tqptrlist.h> class QSocket; @@ -36,13 +36,13 @@ private slots: void monopigatorRegister(); void monopigatorConnected(); void newClient(AtlanticClient *client); - void clientInput(AtlanticClient *client, const QString &data); + void clientInput(AtlanticClient *client, const TQString &data); private: - QSocket *m_monopigatorSocket; + TQSocket *m_monopigatorSocket; ServerSocket *m_serverSocket; AtlanticCore *m_atlanticCore; - QPtrList<AtlanticClient> m_clients; + TQPtrList<AtlanticClient> m_clients; }; #endif diff --git a/atlantik/atlanticd/main.cpp b/atlantik/atlanticd/main.cpp index 235dcd00..12905df8 100644 --- a/atlantik/atlanticd/main.cpp +++ b/atlantik/atlanticd/main.cpp @@ -14,7 +14,7 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qapplication.h> +#include <tqapplication.h> #include "atlanticdaemon.h" @@ -22,6 +22,6 @@ int main(int argc, char *argv[]) { new AtlanticDaemon(); - QApplication qapplication(argc, argv); + TQApplication qapplication(argc, argv); qapplication.exec(); } diff --git a/atlantik/atlanticd/serversocket.cpp b/atlantik/atlanticd/serversocket.cpp index 2056a754..0ddd4744 100644 --- a/atlantik/atlanticd/serversocket.cpp +++ b/atlantik/atlanticd/serversocket.cpp @@ -17,7 +17,7 @@ #include "atlanticclient.h" #include "serversocket.h" -ServerSocket::ServerSocket(int port, int backlog) : QServerSocket(port, backlog) +ServerSocket::ServerSocket(int port, int backlog) : TQServerSocket(port, backlog) { } diff --git a/atlantik/atlanticd/serversocket.h b/atlantik/atlanticd/serversocket.h index fce347e9..cc31c8ab 100644 --- a/atlantik/atlanticd/serversocket.h +++ b/atlantik/atlanticd/serversocket.h @@ -17,7 +17,7 @@ #ifndef SERVERSOCKET_H #define SERVERSOCKET_H -#include <qserversocket.h> +#include <tqserversocket.h> class AtlanticClient; diff --git a/atlantik/client/atlantik.cpp b/atlantik/client/atlantik.cpp index 56bae64b..f1e24645 100644 --- a/atlantik/client/atlantik.cpp +++ b/atlantik/client/atlantik.cpp @@ -16,11 +16,11 @@ #include <errno.h> -#include <qcolor.h> -#include <qdatetime.h> -#include <qlineedit.h> -#include <qscrollview.h> -#include <qpopupmenu.h> +#include <tqcolor.h> +#include <tqdatetime.h> +#include <tqlineedit.h> +#include <tqscrollview.h> +#include <tqpopupmenu.h> #include <kaboutapplication.h> #include <kaction.h> @@ -64,15 +64,15 @@ #include "selectgame_widget.h" #include "selectconfiguration_widget.h" -LogTextEdit::LogTextEdit( QWidget *parent, const char *name ) : QTextEdit( parent, name ) +LogTextEdit::LogTextEdit( TQWidget *parent, const char *name ) : TQTextEdit( parent, name ) { #ifdef KDE_3_2_FEATURES - m_clear = KStdAction::clear( this, SLOT( clear() ), 0 ); + m_clear = KStdAction::clear( this, TQT_SLOT( clear() ), 0 ); #else - m_clear = new KAction( i18n("Clear"), "clear", NULL, this, SLOT( clear() ), static_cast<KActionCollection *>(0), "clear" ); + m_clear = new KAction( i18n("Clear"), "clear", NULL, this, TQT_SLOT( clear() ), static_cast<KActionCollection *>(0), "clear" ); #endif - m_selectAll = KStdAction::selectAll( this, SLOT( selectAll() ), 0 ); - m_copy = KStdAction::copy( this, SLOT( copy() ), 0 ); + m_selectAll = KStdAction::selectAll( this, TQT_SLOT( selectAll() ), 0 ); + m_copy = KStdAction::copy( this, TQT_SLOT( copy() ), 0 ); } LogTextEdit::~LogTextEdit() @@ -82,9 +82,9 @@ LogTextEdit::~LogTextEdit() delete m_copy; } -QPopupMenu *LogTextEdit::createPopupMenu( const QPoint & ) +TQPopupMenu *LogTextEdit::createPopupMenu( const TQPoint & ) { - QPopupMenu *rmbMenu = new QPopupMenu( this ); + TQPopupMenu *rmbMenu = new TQPopupMenu( this ); m_clear->plug( rmbMenu ); rmbMenu->insertSeparator(); m_copy->setEnabled( hasSelectedText() ); @@ -102,13 +102,13 @@ Atlantik::Atlantik () readConfig(); // Toolbar: Game -// KStdGameAction::gameNew(this, SLOT(slotNewGame()), actionCollection(), "game_new"); - m_showEventLog = new KAction(i18n("Show Event &Log")/*, "atlantik_showeventlog"*/, CTRL+Key_L, this, SLOT(showEventLog()), actionCollection(), "showeventlog"); - KStdGameAction::quit(kapp, SLOT(closeAllWindows()), actionCollection(), "game_quit"); +// KStdGameAction::gameNew(this, TQT_SLOT(slotNewGame()), actionCollection(), "game_new"); + m_showEventLog = new KAction(i18n("Show Event &Log")/*, "atlantik_showeventlog"*/, CTRL+Key_L, this, TQT_SLOT(showEventLog()), actionCollection(), "showeventlog"); + KStdGameAction::quit(kapp, TQT_SLOT(closeAllWindows()), actionCollection(), "game_quit"); // Toolbar: Settings - KStdAction::preferences(this, SLOT(slotConfigure()), actionCollection()); - KStdAction::configureNotifications(this, SLOT(configureNotifications()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(slotConfigure()), actionCollection()); + KStdAction::configureNotifications(this, TQT_SLOT(configureNotifications()), actionCollection()); // Initialize pointers to 0L m_configDialog = 0; @@ -121,78 +121,78 @@ Atlantik::Atlantik () // Game and network core m_atlanticCore = new AtlanticCore(this, "atlanticCore"); - connect(m_atlanticCore, SIGNAL(createGUI(Player *)), this, SLOT(newPlayer(Player *))); - connect(m_atlanticCore, SIGNAL(removeGUI(Player *)), this, SLOT(removeGUI(Player *))); - connect(m_atlanticCore, SIGNAL(createGUI(Trade *)), this, SLOT(newTrade(Trade *))); - connect(m_atlanticCore, SIGNAL(removeGUI(Trade *)), this, SLOT(removeGUI(Trade *))); + connect(m_atlanticCore, TQT_SIGNAL(createGUI(Player *)), this, TQT_SLOT(newPlayer(Player *))); + connect(m_atlanticCore, TQT_SIGNAL(removeGUI(Player *)), this, TQT_SLOT(removeGUI(Player *))); + connect(m_atlanticCore, TQT_SIGNAL(createGUI(Trade *)), this, TQT_SLOT(newTrade(Trade *))); + connect(m_atlanticCore, TQT_SIGNAL(removeGUI(Trade *)), this, TQT_SLOT(removeGUI(Trade *))); initEventLog(); initNetworkObject(); // Menu,toolbar: Move - m_roll = KStdGameAction::roll(this, SIGNAL(rollDice()), actionCollection()); + m_roll = KStdGameAction::roll(this, TQT_SIGNAL(rollDice()), actionCollection()); m_roll->setEnabled(false); - m_buyEstate = new KAction(i18n("&Buy"), "atlantik_buy_estate", CTRL+Key_B, this, SIGNAL(buyEstate()), actionCollection(), "buy_estate"); + m_buyEstate = new KAction(i18n("&Buy"), "atlantik_buy_estate", CTRL+Key_B, this, TQT_SIGNAL(buyEstate()), actionCollection(), "buy_estate"); m_buyEstate->setEnabled(false); - m_auctionEstate = new KAction(i18n("&Auction"), "auction", CTRL+Key_A, this, SIGNAL(auctionEstate()), actionCollection(), "auction"); + m_auctionEstate = new KAction(i18n("&Auction"), "auction", CTRL+Key_A, this, TQT_SIGNAL(auctionEstate()), actionCollection(), "auction"); m_auctionEstate->setEnabled(false); - m_endTurn = KStdGameAction::endTurn(this, SIGNAL(endTurn()), actionCollection()); + m_endTurn = KStdGameAction::endTurn(this, TQT_SIGNAL(endTurn()), actionCollection()); m_endTurn->setEnabled(false); - m_jailCard = new KAction(i18n("Use Card to Leave Jail")/*, "atlantik_move_jail_card"*/, 0, this, SIGNAL(jailCard()), actionCollection(), "move_jailcard"); + m_jailCard = new KAction(i18n("Use Card to Leave Jail")/*, "atlantik_move_jail_card"*/, 0, this, TQT_SIGNAL(jailCard()), actionCollection(), "move_jailcard"); m_jailCard->setEnabled(false); - m_jailPay = new KAction(i18n("&Pay to Leave Jail"), "jail_pay", CTRL+Key_P, this, SIGNAL(jailPay()), actionCollection(), "move_jailpay"); + m_jailPay = new KAction(i18n("&Pay to Leave Jail"), "jail_pay", CTRL+Key_P, this, TQT_SIGNAL(jailPay()), actionCollection(), "move_jailpay"); m_jailPay->setEnabled(false); - m_jailRoll = new KAction(i18n("Roll to Leave &Jail")/*, "atlantik_move_jail_roll"*/, CTRL+Key_J, this, SIGNAL(jailRoll()), actionCollection(), "move_jailroll"); + m_jailRoll = new KAction(i18n("Roll to Leave &Jail")/*, "atlantik_move_jail_roll"*/, CTRL+Key_J, this, TQT_SIGNAL(jailRoll()), actionCollection(), "move_jailroll"); m_jailRoll->setEnabled(false); // Mix code and XML into GUI KMainWindow::createGUI(); applyMainWindowSettings( KGlobal::config(), "AtlantikMainWindow" ); KMainWindow::statusBar()->insertItem("Atlantik " ATLANTIK_VERSION_STRING, 0); - KMainWindow::statusBar()->insertItem(QString::null, 1); - connect(statusBar(), SIGNAL(released(int)), this, SLOT(statusBarClick(int))); + KMainWindow::statusBar()->insertItem(TQString::null, 1); + connect(statusBar(), TQT_SIGNAL(released(int)), this, TQT_SLOT(statusBarClick(int))); // Main widget, containing all others - m_mainWidget = new QWidget(this, "main"); + m_mainWidget = new TQWidget(this, "main"); m_mainWidget->show(); - m_mainLayout = new QGridLayout(m_mainWidget, 3, 2); + m_mainLayout = new TQGridLayout(m_mainWidget, 3, 2); setCentralWidget(m_mainWidget); // Vertical view area for portfolios. - m_portfolioScroll = new QScrollView(m_mainWidget, "pfScroll"); + m_portfolioScroll = new TQScrollView(m_mainWidget, "pfScroll"); m_mainLayout->addWidget( m_portfolioScroll, 0, 0 ); - m_portfolioScroll->setHScrollBarMode( QScrollView::AlwaysOff ); - m_portfolioScroll->setResizePolicy( QScrollView::AutoOneFit ); + m_portfolioScroll->setHScrollBarMode( TQScrollView::AlwaysOff ); + m_portfolioScroll->setResizePolicy( TQScrollView::AutoOneFit ); m_portfolioScroll->setFixedHeight( 200 ); m_portfolioScroll->hide(); - m_portfolioWidget = new QWidget( m_portfolioScroll->viewport(), "pfWidget" ); + m_portfolioWidget = new TQWidget( m_portfolioScroll->viewport(), "pfWidget" ); m_portfolioScroll->addChild( m_portfolioWidget ); m_portfolioWidget->show(); - m_portfolioLayout = new QVBoxLayout(m_portfolioWidget); + m_portfolioLayout = new TQVBoxLayout(m_portfolioWidget); m_portfolioViews.setAutoDelete(true); // Nice label -// m_portfolioLabel = new QLabel(i18n("Players"), m_portfolioWidget, "pfLabel"); +// m_portfolioLabel = new TQLabel(i18n("Players"), m_portfolioWidget, "pfLabel"); // m_portfolioLayout->addWidget(m_portfolioLabel); // m_portfolioLabel->show(); // Text view for chat and status messages from server. m_serverMsgs = new LogTextEdit(m_mainWidget, "serverMsgs"); - m_serverMsgs->setTextFormat(QTextEdit::PlainText); + m_serverMsgs->setTextFormat(TQTextEdit::PlainText); m_serverMsgs->setReadOnly(true); - m_serverMsgs->setHScrollBarMode(QScrollView::AlwaysOff); + m_serverMsgs->setHScrollBarMode(TQScrollView::AlwaysOff); m_serverMsgs->setMinimumWidth(200); m_mainLayout->addWidget(m_serverMsgs, 1, 0); // LineEdit to enter commands and chat messages. - m_input = new QLineEdit(m_mainWidget, "input"); + m_input = new TQLineEdit(m_mainWidget, "input"); m_mainLayout->addWidget(m_input, 2, 0); m_serverMsgs->setFocusProxy(m_input); - connect(m_input, SIGNAL(returnPressed()), this, SLOT(slotSendMsg())); + connect(m_input, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotSendMsg())); // Set stretching where we want it. m_mainLayout->setRowStretch(1, 1); // make m_board+m_serverMsgs stretch vertically, not the rest @@ -201,8 +201,8 @@ Atlantik::Atlantik () // Check command-line args to see if we need to connect or show Monopigator window KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - QCString host = args->getOption("host"); - QCString port = args->getOption("port"); + TQCString host = args->getOption("host"); + TQCString port = args->getOption("port"); if (!host.isNull() && !port.isNull()) m_atlantikNetwork->serverConnect(host, port.toInt()); else @@ -238,7 +238,7 @@ void Atlantik::readConfig() // Portfolio colors config->setGroup("WM"); - QColor activeDefault(204, 204, 204), inactiveDefault(153, 153, 153); + TQColor activeDefault(204, 204, 204), inactiveDefault(153, 153, 153); m_config.activeColor = config->readColorEntry("activeBackground", &activeDefault); m_config.inactiveColor = config->readColorEntry("inactiveBlend", &inactiveDefault); } @@ -253,9 +253,9 @@ void Atlantik::newPlayer(Player *player) // we'd better force an update. playerChanged(player); - connect(player, SIGNAL(changed(Player *)), this, SLOT(playerChanged(Player *))); - connect(player, SIGNAL(gainedTurn()), this, SLOT(gainedTurn())); - connect(player, SIGNAL(changed(Player *)), m_board, SLOT(playerChanged(Player *))); + connect(player, TQT_SIGNAL(changed(Player *)), this, TQT_SLOT(playerChanged(Player *))); + connect(player, TQT_SIGNAL(gainedTurn()), this, TQT_SLOT(gainedTurn())); + connect(player, TQT_SIGNAL(changed(Player *)), m_board, TQT_SLOT(playerChanged(Player *))); KNotifyClient::event(winId(), "newplayer"); } @@ -314,8 +314,8 @@ void Atlantik::showSelectServer() m_atlanticCore->reset(true); initNetworkObject(); - connect(m_selectServer, SIGNAL(serverConnect(const QString, int)), m_atlantikNetwork, SLOT(serverConnect(const QString, int))); - connect(m_selectServer, SIGNAL(msgStatus(const QString &)), this, SLOT(slotMsgStatus(const QString &))); + connect(m_selectServer, TQT_SIGNAL(serverConnect(const TQString, int)), m_atlantikNetwork, TQT_SLOT(serverConnect(const TQString, int))); + connect(m_selectServer, TQT_SIGNAL(msgStatus(const TQString &)), this, TQT_SLOT(slotMsgStatus(const TQString &))); m_selectServer->slotRefresh( m_config.connectOnStart ); } @@ -354,10 +354,10 @@ void Atlantik::showSelectGame() m_selectConfiguration = 0; } - connect(m_selectGame, SIGNAL(joinGame(int)), m_atlantikNetwork, SLOT(joinGame(int))); - connect(m_selectGame, SIGNAL(newGame(const QString &)), m_atlantikNetwork, SLOT(newGame(const QString &))); - connect(m_selectGame, SIGNAL(leaveServer()), this, SLOT(showSelectServer())); - connect(m_selectGame, SIGNAL(msgStatus(const QString &)), this, SLOT(slotMsgStatus(const QString &))); + connect(m_selectGame, TQT_SIGNAL(joinGame(int)), m_atlantikNetwork, TQT_SLOT(joinGame(int))); + connect(m_selectGame, TQT_SIGNAL(newGame(const TQString &)), m_atlantikNetwork, TQT_SLOT(newGame(const TQString &))); + connect(m_selectGame, TQT_SIGNAL(leaveServer()), this, TQT_SLOT(showSelectServer())); + connect(m_selectGame, TQT_SIGNAL(msgStatus(const TQString &)), this, TQT_SLOT(slotMsgStatus(const TQString &))); } void Atlantik::showSelectConfiguration() @@ -375,15 +375,15 @@ void Atlantik::showSelectConfiguration() m_mainLayout->addMultiCellWidget(m_selectConfiguration, 0, 2, 1, 1); m_selectConfiguration->show(); - connect(m_atlanticCore, SIGNAL(createGUI(ConfigOption *)), m_selectConfiguration, SLOT(addConfigOption(ConfigOption *))); - connect(m_atlantikNetwork, SIGNAL(gameOption(QString, QString, QString, QString, QString)), m_selectConfiguration, SLOT(gameOption(QString, QString, QString, QString, QString))); - connect(m_atlantikNetwork, SIGNAL(gameInit()), m_selectConfiguration, SLOT(initGame())); - connect(m_selectConfiguration, SIGNAL(startGame()), m_atlantikNetwork, SLOT(startGame())); - connect(m_selectConfiguration, SIGNAL(leaveGame()), m_atlantikNetwork, SLOT(leaveGame())); - connect(m_selectConfiguration, SIGNAL(changeOption(int, const QString &)), m_atlantikNetwork, SLOT(changeOption(int, const QString &))); - connect(m_selectConfiguration, SIGNAL(buttonCommand(QString)), m_atlantikNetwork, SLOT(writeData(QString))); - connect(m_selectConfiguration, SIGNAL(iconSelected(const QString &)), m_atlantikNetwork, SLOT(setImage(const QString &))); - connect(m_selectConfiguration, SIGNAL(statusMessage(const QString &)), this, SLOT(slotMsgStatus(const QString &))); + connect(m_atlanticCore, TQT_SIGNAL(createGUI(ConfigOption *)), m_selectConfiguration, TQT_SLOT(addConfigOption(ConfigOption *))); + connect(m_atlantikNetwork, TQT_SIGNAL(gameOption(TQString, TQString, TQString, TQString, TQString)), m_selectConfiguration, TQT_SLOT(gameOption(TQString, TQString, TQString, TQString, TQString))); + connect(m_atlantikNetwork, TQT_SIGNAL(gameInit()), m_selectConfiguration, TQT_SLOT(initGame())); + connect(m_selectConfiguration, TQT_SIGNAL(startGame()), m_atlantikNetwork, TQT_SLOT(startGame())); + connect(m_selectConfiguration, TQT_SIGNAL(leaveGame()), m_atlantikNetwork, TQT_SLOT(leaveGame())); + connect(m_selectConfiguration, TQT_SIGNAL(changeOption(int, const TQString &)), m_atlantikNetwork, TQT_SLOT(changeOption(int, const TQString &))); + connect(m_selectConfiguration, TQT_SIGNAL(buttonCommand(TQString)), m_atlantikNetwork, TQT_SLOT(writeData(TQString))); + connect(m_selectConfiguration, TQT_SIGNAL(iconSelected(const TQString &)), m_atlantikNetwork, TQT_SLOT(setImage(const TQString &))); + connect(m_selectConfiguration, TQT_SIGNAL(statusMessage(const TQString &)), this, TQT_SLOT(slotMsgStatus(const TQString &))); } void Atlantik::initBoard() @@ -394,11 +394,11 @@ void Atlantik::initBoard() m_board = new AtlantikBoard(m_atlanticCore, 40, AtlantikBoard::Play, m_mainWidget, "board"); m_board->setViewProperties(m_config.indicateUnowned, m_config.highliteUnowned, m_config.darkenMortgaged, m_config.quartzEffects, m_config.animateTokens); - connect(m_atlantikNetwork, SIGNAL(displayDetails(QString, bool, bool, Estate *)), m_board, SLOT(insertDetails(QString, bool, bool, Estate *))); - connect(m_atlantikNetwork, SIGNAL(addCommandButton(QString, QString, bool)), m_board, SLOT(displayButton(QString, QString, bool))); - connect(m_atlantikNetwork, SIGNAL(addCloseButton()), m_board, SLOT(addCloseButton())); - connect(m_board, SIGNAL(tokenConfirmation(Estate *)), m_atlantikNetwork, SLOT(tokenConfirmation(Estate *))); - connect(m_board, SIGNAL(buttonCommand(QString)), m_atlantikNetwork, SLOT(writeData(QString))); + connect(m_atlantikNetwork, TQT_SIGNAL(displayDetails(TQString, bool, bool, Estate *)), m_board, TQT_SLOT(insertDetails(TQString, bool, bool, Estate *))); + connect(m_atlantikNetwork, TQT_SIGNAL(addCommandButton(TQString, TQString, bool)), m_board, TQT_SLOT(displayButton(TQString, TQString, bool))); + connect(m_atlantikNetwork, TQT_SIGNAL(addCloseButton()), m_board, TQT_SLOT(addCloseButton())); + connect(m_board, TQT_SIGNAL(tokenConfirmation(Estate *)), m_atlantikNetwork, TQT_SLOT(tokenConfirmation(Estate *))); + connect(m_board, TQT_SIGNAL(buttonCommand(TQString)), m_atlantikNetwork, TQT_SLOT(writeData(TQString))); } void Atlantik::showBoard() @@ -425,7 +425,7 @@ void Atlantik::showBoard() m_board->show(); PortfolioView *portfolioView = 0; - for (QPtrListIterator<PortfolioView> it(m_portfolioViews); *it; ++it) + for (TQPtrListIterator<PortfolioView> it(m_portfolioViews); *it; ++it) if ((portfolioView = dynamic_cast<PortfolioView*>(*it))) portfolioView->buildPortfolio(); } @@ -445,7 +445,7 @@ void Atlantik::slotNetworkConnected() void Atlantik::slotNetworkError(int errnum) { - QString errMsg(i18n("Error connecting: ")); + TQString errMsg(i18n("Error connecting: ")); switch (m_atlantikNetwork->status()) { @@ -475,12 +475,12 @@ void Atlantik::networkClosed(int status) switch( status ) { case KBufferedIO::involuntary: - slotMsgStatus( i18n("Connection with server %1:%2 lost.").arg(m_atlantikNetwork->host()).arg(m_atlantikNetwork->port()), QString("connect_no") ); + slotMsgStatus( i18n("Connection with server %1:%2 lost.").arg(m_atlantikNetwork->host()).arg(m_atlantikNetwork->port()), TQString("connect_no") ); showSelectServer(); break; default: if ( !m_atlantikNetwork->host().isEmpty() ) - slotMsgStatus( i18n("Disconnected from %1:%2.").arg(m_atlantikNetwork->host()).arg(m_atlantikNetwork->port()), QString("connect_no") ); + slotMsgStatus( i18n("Disconnected from %1:%2.").arg(m_atlantikNetwork->host()).arg(m_atlantikNetwork->port()), TQString("connect_no") ); break; } } @@ -491,7 +491,7 @@ void Atlantik::slotConfigure() m_configDialog = new ConfigDialog(this); m_configDialog->show(); - connect(m_configDialog, SIGNAL(okClicked()), this, SLOT(slotUpdateConfig())); + connect(m_configDialog, TQT_SIGNAL(okClicked()), this, TQT_SLOT(slotUpdateConfig())); } void Atlantik::showEventLog() @@ -510,7 +510,7 @@ void Atlantik::slotUpdateConfig() { KConfig *config=kapp->config(); bool optBool, configChanged = false; - QString optStr; + TQString optStr; optBool = m_configDialog->chatTimestamps(); if (m_config.chatTimestamps != optBool) @@ -612,38 +612,38 @@ void Atlantik::slotUpdateConfig() void Atlantik::slotSendMsg() { m_atlantikNetwork->cmdChat(m_input->text()); - m_input->setText(QString::null); + m_input->setText(TQString::null); } -void Atlantik::slotMsgInfo(QString msg) +void Atlantik::slotMsgInfo(TQString msg) { serverMsgsAppend(msg); } -void Atlantik::slotMsgError(QString msg) +void Atlantik::slotMsgError(TQString msg) { serverMsgsAppend("Error: " + msg); } -void Atlantik::slotMsgStatus(const QString &message, const QString &icon) +void Atlantik::slotMsgStatus(const TQString &message, const TQString &icon) { KMainWindow::statusBar()->changeItem(message, 1); m_eventLog->addEvent(message, icon); } -void Atlantik::slotMsgChat(QString player, QString msg) +void Atlantik::slotMsgChat(TQString player, TQString msg) { if (m_config.chatTimestamps) { - QTime time = QTime::currentTime(); - serverMsgsAppend(QString("[%1] %2: %3").arg(time.toString("hh:mm")).arg(player).arg(msg)); + TQTime time = TQTime::currentTime(); + serverMsgsAppend(TQString("[%1] %2: %3").arg(time.toString("hh:mm")).arg(player).arg(msg)); } else serverMsgsAppend(player + ": " + msg); KNotifyClient::event(winId(), "chat"); } -void Atlantik::serverMsgsAppend(QString msg) +void Atlantik::serverMsgsAppend(TQString msg) { // Use append, not setText(old+new) because that one doesn't wrap m_serverMsgs->append(msg); @@ -661,7 +661,7 @@ void Atlantik::playerChanged(Player *player) { // We changed ourselves.. PortfolioView *portfolioView = 0; - for (QPtrListIterator<PortfolioView> it(m_portfolioViews); *it; ++it) + for (TQPtrListIterator<PortfolioView> it(m_portfolioViews); *it; ++it) if ((portfolioView = dynamic_cast<PortfolioView*>(*it))) { // Clear all portfolios if we're not in game @@ -728,38 +728,38 @@ void Atlantik::initNetworkObject() } m_atlantikNetwork = new AtlantikNetwork(m_atlanticCore); - connect(m_atlantikNetwork, SIGNAL(msgInfo(QString)), this, SLOT(slotMsgInfo(QString))); - connect(m_atlantikNetwork, SIGNAL(msgError(QString)), this, SLOT(slotMsgError(QString))); - connect(m_atlantikNetwork, SIGNAL(msgStatus(const QString &, const QString &)), this, SLOT(slotMsgStatus(const QString &, const QString &))); - connect(m_atlantikNetwork, SIGNAL(msgChat(QString, QString)), this, SLOT(slotMsgChat(QString, QString))); + connect(m_atlantikNetwork, TQT_SIGNAL(msgInfo(TQString)), this, TQT_SLOT(slotMsgInfo(TQString))); + connect(m_atlantikNetwork, TQT_SIGNAL(msgError(TQString)), this, TQT_SLOT(slotMsgError(TQString))); + connect(m_atlantikNetwork, TQT_SIGNAL(msgStatus(const TQString &, const TQString &)), this, TQT_SLOT(slotMsgStatus(const TQString &, const TQString &))); + connect(m_atlantikNetwork, TQT_SIGNAL(msgChat(TQString, TQString)), this, TQT_SLOT(slotMsgChat(TQString, TQString))); - connect(m_atlantikNetwork, SIGNAL(connectionSuccess()), this, SLOT(slotNetworkConnected())); - connect(m_atlantikNetwork, SIGNAL(connectionFailed(int)), this, SLOT(slotNetworkError(int))); - connect(m_atlantikNetwork, SIGNAL(closed(int)), this, SLOT(networkClosed(int))); + connect(m_atlantikNetwork, TQT_SIGNAL(connectionSuccess()), this, TQT_SLOT(slotNetworkConnected())); + connect(m_atlantikNetwork, TQT_SIGNAL(connectionFailed(int)), this, TQT_SLOT(slotNetworkError(int))); + connect(m_atlantikNetwork, TQT_SIGNAL(closed(int)), this, TQT_SLOT(networkClosed(int))); - connect(m_atlantikNetwork, SIGNAL(receivedHandshake()), this, SLOT(sendHandshake())); + connect(m_atlantikNetwork, TQT_SIGNAL(receivedHandshake()), this, TQT_SLOT(sendHandshake())); - connect(m_atlantikNetwork, SIGNAL(gameConfig()), this, SLOT(showSelectConfiguration())); - connect(m_atlantikNetwork, SIGNAL(gameInit()), this, SLOT(initBoard())); - connect(m_atlantikNetwork, SIGNAL(gameRun()), this, SLOT(showBoard())); - connect(m_atlantikNetwork, SIGNAL(gameEnd()), this, SLOT(freezeBoard())); + connect(m_atlantikNetwork, TQT_SIGNAL(gameConfig()), this, TQT_SLOT(showSelectConfiguration())); + connect(m_atlantikNetwork, TQT_SIGNAL(gameInit()), this, TQT_SLOT(initBoard())); + connect(m_atlantikNetwork, TQT_SIGNAL(gameRun()), this, TQT_SLOT(showBoard())); + connect(m_atlantikNetwork, TQT_SIGNAL(gameEnd()), this, TQT_SLOT(freezeBoard())); - connect(m_atlantikNetwork, SIGNAL(newEstate(Estate *)), this, SLOT(newEstate(Estate *))); - connect(m_atlantikNetwork, SIGNAL(newAuction(Auction *)), this, SLOT(newAuction(Auction *))); + connect(m_atlantikNetwork, TQT_SIGNAL(newEstate(Estate *)), this, TQT_SLOT(newEstate(Estate *))); + connect(m_atlantikNetwork, TQT_SIGNAL(newAuction(Auction *)), this, TQT_SLOT(newAuction(Auction *))); - connect(m_atlantikNetwork, SIGNAL(clientCookie(QString)), this, SLOT(clientCookie(QString))); - connect(m_atlantikNetwork, SIGNAL(networkEvent(const QString &, const QString &)), m_eventLog, SLOT(addEvent(const QString &, const QString &))); + connect(m_atlantikNetwork, TQT_SIGNAL(clientCookie(TQString)), this, TQT_SLOT(clientCookie(TQString))); + connect(m_atlantikNetwork, TQT_SIGNAL(networkEvent(const TQString &, const TQString &)), m_eventLog, TQT_SLOT(addEvent(const TQString &, const TQString &))); - connect(this, SIGNAL(rollDice()), m_atlantikNetwork, SLOT(rollDice())); - connect(this, SIGNAL(buyEstate()), m_atlantikNetwork, SLOT(buyEstate())); - connect(this, SIGNAL(auctionEstate()), m_atlantikNetwork, SLOT(auctionEstate())); - connect(this, SIGNAL(endTurn()), m_atlantikNetwork, SLOT(endTurn())); - connect(this, SIGNAL(jailCard()), m_atlantikNetwork, SLOT(jailCard())); - connect(this, SIGNAL(jailPay()), m_atlantikNetwork, SLOT(jailPay())); - connect(this, SIGNAL(jailRoll()), m_atlantikNetwork, SLOT(jailRoll())); + connect(this, TQT_SIGNAL(rollDice()), m_atlantikNetwork, TQT_SLOT(rollDice())); + connect(this, TQT_SIGNAL(buyEstate()), m_atlantikNetwork, TQT_SLOT(buyEstate())); + connect(this, TQT_SIGNAL(auctionEstate()), m_atlantikNetwork, TQT_SLOT(auctionEstate())); + connect(this, TQT_SIGNAL(endTurn()), m_atlantikNetwork, TQT_SLOT(endTurn())); + connect(this, TQT_SIGNAL(jailCard()), m_atlantikNetwork, TQT_SLOT(jailCard())); + connect(this, TQT_SIGNAL(jailPay()), m_atlantikNetwork, TQT_SLOT(jailPay())); + connect(this, TQT_SIGNAL(jailRoll()), m_atlantikNetwork, TQT_SLOT(jailRoll())); } -void Atlantik::clientCookie(QString cookie) +void Atlantik::clientCookie(TQString cookie) { KConfig *config = kapp->config(); @@ -789,7 +789,7 @@ void Atlantik::sendHandshake() // Check command-line args to see if we need to auto-join KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - QCString game = args->getOption("game"); + TQCString game = args->getOption("game"); if (!game.isNull()) m_atlantikNetwork->joinGame(game.toInt()); } @@ -812,10 +812,10 @@ PortfolioView *Atlantik::addPortfolioView(Player *player) if ( m_portfolioViews.count() > 0 && m_portfolioScroll->isHidden() ) m_portfolioScroll->show(); - connect(player, SIGNAL(changed(Player *)), portfolioView, SLOT(playerChanged())); - connect(portfolioView, SIGNAL(newTrade(Player *)), m_atlantikNetwork, SLOT(newTrade(Player *))); - connect(portfolioView, SIGNAL(kickPlayer(Player *)), m_atlantikNetwork, SLOT(kickPlayer(Player *))); - connect(portfolioView, SIGNAL(estateClicked(Estate *)), m_board, SLOT(prependEstateDetails(Estate *))); + connect(player, TQT_SIGNAL(changed(Player *)), portfolioView, TQT_SLOT(playerChanged())); + connect(portfolioView, TQT_SIGNAL(newTrade(Player *)), m_atlantikNetwork, TQT_SLOT(newTrade(Player *))); + connect(portfolioView, TQT_SIGNAL(kickPlayer(Player *)), m_atlantikNetwork, TQT_SLOT(kickPlayer(Player *))); + connect(portfolioView, TQT_SIGNAL(estateClicked(Estate *)), m_board, TQT_SLOT(prependEstateDetails(Estate *))); m_portfolioLayout->addWidget(portfolioView); portfolioView->show(); @@ -826,14 +826,14 @@ PortfolioView *Atlantik::addPortfolioView(Player *player) PortfolioView *Atlantik::findPortfolioView(Player *player) { PortfolioView *portfolioView = 0; - for (QPtrListIterator<PortfolioView> it(m_portfolioViews); (portfolioView = *it) ; ++it) + for (TQPtrListIterator<PortfolioView> it(m_portfolioViews); (portfolioView = *it) ; ++it) if (player == portfolioView->player()) return portfolioView; return 0; } -void Atlantik::closeEvent(QCloseEvent *e) +void Atlantik::closeEvent(TQCloseEvent *e) { Game *gameSelf = m_atlanticCore->gameSelf(); Player *playerSelf = m_atlanticCore->playerSelf(); diff --git a/atlantik/client/atlantik.h b/atlantik/client/atlantik.h index 94f2ca7c..2a181437 100644 --- a/atlantik/client/atlantik.h +++ b/atlantik/client/atlantik.h @@ -17,11 +17,11 @@ #ifndef ATLANTIK_ATLANTIK_H #define ATLANTIK_ATLANTIK_H -#include <qwidget.h> -#include <qlayout.h> -#include <qtextedit.h> -#include <qlabel.h> -#include <qptrlist.h> +#include <tqwidget.h> +#include <tqlayout.h> +#include <tqtextedit.h> +#include <tqlabel.h> +#include <tqptrlist.h> #include <kmainwindow.h> @@ -40,7 +40,7 @@ struct AtlantikConfig bool chatTimestamps; // Personalization options - QString playerName, playerImage; + TQString playerName, playerImage; // Board options bool indicateUnowned; @@ -54,7 +54,7 @@ struct AtlantikConfig bool hideDevelopmentServers; // Portfolio colors - QColor activeColor, inactiveColor; + TQColor activeColor, inactiveColor; }; class EventLog; @@ -73,10 +73,10 @@ class LogTextEdit : public QTextEdit Q_OBJECT public: - LogTextEdit( QWidget *parent = 0, const char *name = 0 ); + LogTextEdit( TQWidget *parent = 0, const char *name = 0 ); virtual ~LogTextEdit(); - QPopupMenu *createPopupMenu( const QPoint & pos ); + TQPopupMenu *createPopupMenu( const TQPoint & pos ); private: KAction *m_clear, *m_selectAll, *m_copy; @@ -110,7 +110,7 @@ public: * * @param msg Message to be appended. */ - void serverMsgsAppend(QString msg); + void serverMsgsAppend(TQString msg); AtlantikConfig config() { return m_config; } @@ -121,7 +121,7 @@ private slots: void initBoard(); void showBoard(); void freezeBoard(); - void clientCookie(QString cookie); + void clientCookie(TQString cookie); void sendHandshake(); void statusBarClick(int); @@ -138,7 +138,7 @@ public slots: * An error occurred while setting up the network connection. Inform the * user. * - * @param errno See http://doc.trolltech.com/3.0/qsocket.html#Error-enum + * @param errno See http://doc.trolltech.com/3.0/tqsocket.html#Error-enum */ void slotNetworkError(int errnum); @@ -184,9 +184,9 @@ public slots: * * @param msg The message to be appended. */ - void slotMsgInfo(QString msg); + void slotMsgInfo(TQString msg); - void slotMsgStatus(const QString &message, const QString &icon = QString::null); + void slotMsgStatus(const TQString &message, const TQString &icon = TQString::null); /** * Informs serverMsgs() to append an incoming message from the @@ -194,7 +194,7 @@ public slots: * * @param msg The error message to be appended. */ - void slotMsgError(QString msg); + void slotMsgError(TQString msg); /** * Informs serverMsgs() to append an incoming message from the @@ -203,7 +203,7 @@ public slots: * @param player The name of the player chatting. * @param msg The chat message to be appended. */ - void slotMsgChat(QString player, QString msg); + void slotMsgChat(TQString player, TQString msg); void newPlayer(Player *player); void newEstate(Estate *estate); @@ -226,7 +226,7 @@ signals: void jailRoll(); protected: - void closeEvent(QCloseEvent *); + void closeEvent(TQCloseEvent *); private: void initEventLog(); @@ -234,14 +234,14 @@ private: PortfolioView *addPortfolioView(Player *player); PortfolioView *findPortfolioView(Player *player); - QScrollView *m_portfolioScroll; - QWidget *m_mainWidget, *m_portfolioWidget; - QGridLayout *m_mainLayout; - QVBoxLayout *m_portfolioLayout; + TQScrollView *m_portfolioScroll; + TQWidget *m_mainWidget, *m_portfolioWidget; + TQGridLayout *m_mainLayout; + TQVBoxLayout *m_portfolioLayout; - QLabel *m_portfolioLabel; - QLineEdit *m_input; - QTextEdit *m_serverMsgs; + TQLabel *m_portfolioLabel; + TQLineEdit *m_input; + TQTextEdit *m_serverMsgs; KAction *m_roll, *m_buyEstate, *m_auctionEstate, *m_endTurn, *m_jailCard, *m_jailPay, *m_jailRoll, *m_configure, @@ -259,8 +259,8 @@ private: EventLog *m_eventLog; EventLogWidget *m_eventLogWidget; - QPtrList<PortfolioView> m_portfolioViews; - QMap<Trade *, TradeDisplay *> m_tradeGUIMap; + TQPtrList<PortfolioView> m_portfolioViews; + TQMap<Trade *, TradeDisplay *> m_tradeGUIMap; bool m_runningGame; }; diff --git a/atlantik/client/configdlg.cpp b/atlantik/client/configdlg.cpp index a8e152b5..9e936147 100644 --- a/atlantik/client/configdlg.cpp +++ b/atlantik/client/configdlg.cpp @@ -14,10 +14,10 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qlayout.h> -#include <qgroupbox.h> -#include <qwhatsthis.h> -#include <qlabel.h> +#include <tqlayout.h> +#include <tqgroupbox.h> +#include <tqwhatsthis.h> +#include <tqlabel.h> #include <kdeversion.h> #undef KDE_3_1_FEATURES @@ -86,12 +86,12 @@ bool ConfigDialog::quartzEffects() return configBoard->quartzEffects(); } -QString ConfigDialog::playerName() +TQString ConfigDialog::playerName() { return configPlayer->playerName(); } -QString ConfigDialog::playerImage() +TQString ConfigDialog::playerImage() { return configPlayer->playerImage(); } @@ -111,36 +111,36 @@ AtlantikConfig ConfigDialog::config() return m_parent->config(); } -ConfigPlayer::ConfigPlayer(ConfigDialog* configDialog, QWidget *parent, const char *name) : QWidget(parent, name) +ConfigPlayer::ConfigPlayer(ConfigDialog* configDialog, TQWidget *parent, const char *name) : TQWidget(parent, name) { m_configDialog = configDialog; - QVBoxLayout *layout = new QVBoxLayout(parent, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *layout = new TQVBoxLayout(parent, KDialog::marginHint(), KDialog::spacingHint()); - QLabel *label = new QLabel(i18n("Player name:"), parent); + TQLabel *label = new TQLabel(i18n("Player name:"), parent); layout->addWidget(label); - m_playerName = new QLineEdit(parent); + m_playerName = new TQLineEdit(parent); layout->addWidget(m_playerName); - QLabel *label2 = new QLabel(i18n("Player image:"), parent); + TQLabel *label2 = new TQLabel(i18n("Player image:"), parent); layout->addWidget(label2); m_playerIcon = new KPushButton(parent, "playerIcon"); layout->addWidget(m_playerIcon); - connect( m_playerIcon, SIGNAL(clicked()), this, SLOT(chooseImage()) ); + connect( m_playerIcon, TQT_SIGNAL(clicked()), this, TQT_SLOT(chooseImage()) ); layout->addStretch(1); reset(); } -QString ConfigPlayer::playerName() +TQString ConfigPlayer::playerName() { return m_playerName->text(); } -QString ConfigPlayer::playerImage() +TQString ConfigPlayer::playerImage() { return m_playerImage; } @@ -157,12 +157,12 @@ void ConfigPlayer::chooseImage() iconDialog.setup( KIcon::Desktop, KIcon::Application, false, 0, true ); // begin with user icons #endif - QString image = iconDialog.openDialog(); + TQString image = iconDialog.openDialog(); if ( image.isEmpty() ) return; - QStringList splitPath = QStringList::split( '/', image ); + TQStringList splitPath = TQStringList::split( '/', image ); m_playerImage = splitPath[ splitPath.count()-1 ]; setImage(); @@ -170,9 +170,9 @@ void ConfigPlayer::chooseImage() void ConfigPlayer::setImage() { - QString filename = locate("data", "atlantik/themes/default/tokens/" + m_playerImage); + TQString filename = locate("data", "atlantik/themes/default/tokens/" + m_playerImage); if (KStandardDirs::exists(filename)) - m_playerIcon->setPixmap( QPixmap(filename) ); + m_playerIcon->setPixmap( TQPixmap(filename) ); } void ConfigPlayer::reset() @@ -182,27 +182,27 @@ void ConfigPlayer::reset() setImage(); } -ConfigMonopigator::ConfigMonopigator(ConfigDialog *configDialog, QWidget *parent, const char *name) : QWidget(parent, name) +ConfigMonopigator::ConfigMonopigator(ConfigDialog *configDialog, TQWidget *parent, const char *name) : TQWidget(parent, name) { m_configDialog = configDialog; - QVBoxLayout *layout = new QVBoxLayout(parent, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *layout = new TQVBoxLayout(parent, KDialog::marginHint(), KDialog::spacingHint()); - m_connectOnStart = new QCheckBox(i18n("Request list of Internet servers on start-up"), parent); + m_connectOnStart = new TQCheckBox(i18n("Request list of Internet servers on start-up"), parent); layout->addWidget(m_connectOnStart); - QString message=i18n( + TQString message=i18n( "If checked, Atlantik connects to a meta server on start-up to\n" "request a list of Internet servers.\n"); - QWhatsThis::add(m_connectOnStart, message); + TQWhatsThis::add(m_connectOnStart, message); - m_hideDevelopmentServers = new QCheckBox(i18n("Hide development servers"), parent); + m_hideDevelopmentServers = new TQCheckBox(i18n("Hide development servers"), parent); layout->addWidget(m_hideDevelopmentServers); message=i18n( "Some of the Internet servers might be running development\n" "versions of the server software. If checked, Atlantik will not\n" "display these servers.\n"); - QWhatsThis::add(m_hideDevelopmentServers, message); + TQWhatsThis::add(m_hideDevelopmentServers, message); layout->addStretch(1); @@ -225,18 +225,18 @@ void ConfigMonopigator::reset() m_hideDevelopmentServers->setChecked(m_configDialog->config().hideDevelopmentServers); } -ConfigGeneral::ConfigGeneral(ConfigDialog *configDialog, QWidget *parent, const char *name) : QWidget(parent, name) +ConfigGeneral::ConfigGeneral(ConfigDialog *configDialog, TQWidget *parent, const char *name) : TQWidget(parent, name) { m_configDialog = configDialog; - QVBoxLayout *layout = new QVBoxLayout(parent, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *layout = new TQVBoxLayout(parent, KDialog::marginHint(), KDialog::spacingHint()); - m_chatTimestamps = new QCheckBox(i18n("Show timestamps in chat messages"), parent); + m_chatTimestamps = new TQCheckBox(i18n("Show timestamps in chat messages"), parent); layout->addWidget(m_chatTimestamps); - QString message=i18n( + TQString message=i18n( "If checked, Atlantik will add timestamps in front of chat\n" "messages.\n"); - QWhatsThis::add(m_chatTimestamps, message); + TQWhatsThis::add(m_chatTimestamps, message); layout->addStretch(1); @@ -253,45 +253,45 @@ void ConfigGeneral::reset() m_chatTimestamps->setChecked(m_configDialog->config().chatTimestamps); } -ConfigBoard::ConfigBoard(ConfigDialog *configDialog, QWidget *parent, const char *name) : QWidget(parent, name) +ConfigBoard::ConfigBoard(ConfigDialog *configDialog, TQWidget *parent, const char *name) : TQWidget(parent, name) { m_configDialog = configDialog; - QVBoxLayout *layout = new QVBoxLayout(parent, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *layout = new TQVBoxLayout(parent, KDialog::marginHint(), KDialog::spacingHint()); - QGroupBox *box = new QGroupBox(1, Qt::Horizontal, i18n("Game Status Feedback"), parent); + TQGroupBox *box = new TQGroupBox(1, Qt::Horizontal, i18n("Game Status Feedback"), parent); layout->addWidget(box); - m_indicateUnowned = new QCheckBox(i18n("Display title deed card on unowned properties"), box); - QString message=i18n( + m_indicateUnowned = new TQCheckBox(i18n("Display title deed card on unowned properties"), box); + TQString message=i18n( "If checked, unowned properties on the board display an estate\n" "card to indicate the property is for sale.\n"); - QWhatsThis::add(m_indicateUnowned, message); + TQWhatsThis::add(m_indicateUnowned, message); - m_highliteUnowned = new QCheckBox(i18n("Highlight unowned properties"), box); + m_highliteUnowned = new TQCheckBox(i18n("Highlight unowned properties"), box); message=i18n( "If checked, unowned properties on the board are highlighted to\n" "indicate the property is for sale.\n"); - QWhatsThis::add(m_highliteUnowned, message); + TQWhatsThis::add(m_highliteUnowned, message); - m_darkenMortgaged = new QCheckBox(i18n("Darken mortgaged properties"), box); + m_darkenMortgaged = new TQCheckBox(i18n("Darken mortgaged properties"), box); message=i18n( "If checked, mortgaged properties on the board will be colored\n" "darker than of the default color.\n"); - QWhatsThis::add(m_darkenMortgaged, message); + TQWhatsThis::add(m_darkenMortgaged, message); - m_animateToken = new QCheckBox(i18n("Animate token movement"), box); + m_animateToken = new TQCheckBox(i18n("Animate token movement"), box); message=i18n( "If checked, tokens will move across the board\n" "instead of jumping directly to their new location.\n"); - QWhatsThis::add(m_animateToken, message); + TQWhatsThis::add(m_animateToken, message); - m_quartzEffects = new QCheckBox(i18n("Quartz effects"), box); + m_quartzEffects = new TQCheckBox(i18n("Quartz effects"), box); message=i18n( "If checked, the colored headers of street estates on the board " "will have a Quartz effect similar to the Quartz KWin style.\n"); - QWhatsThis::add(m_quartzEffects, message); + TQWhatsThis::add(m_quartzEffects, message); -// box = new QGroupBox(1, Qt::Horizontal, i18n("Size"), parent); +// box = new TQGroupBox(1, Qt::Horizontal, i18n("Size"), parent); // layout->addWidget(box); layout->addStretch(1); diff --git a/atlantik/client/configdlg.h b/atlantik/client/configdlg.h index c1f74294..24b10d78 100644 --- a/atlantik/client/configdlg.h +++ b/atlantik/client/configdlg.h @@ -17,9 +17,9 @@ #ifndef ATLANTIK_CONFIGDLG_H #define ATLANTIK_CONFIGDLG_H -#include <qwidget.h> -#include <qcheckbox.h> -#include <qlineedit.h> +#include <tqwidget.h> +#include <tqcheckbox.h> +#include <tqlineedit.h> #include <kdialogbase.h> @@ -37,10 +37,10 @@ class ConfigPlayer : public QWidget Q_OBJECT public: - ConfigPlayer(ConfigDialog *configDialog, QWidget *parent, const char *name=0); + ConfigPlayer(ConfigDialog *configDialog, TQWidget *parent, const char *name=0); - QString playerName(); - QString playerImage(); + TQString playerName(); + TQString playerImage(); private slots: void chooseImage(); @@ -50,8 +50,8 @@ private: void reset(); ConfigDialog *m_configDialog; - QLineEdit *m_playerName; - QString m_playerImage; + TQLineEdit *m_playerName; + TQString m_playerImage; KPushButton *m_playerIcon; }; @@ -60,7 +60,7 @@ class ConfigBoard : public QWidget Q_OBJECT public: - ConfigBoard(ConfigDialog *configDialog, QWidget *parent, const char *name=0); + ConfigBoard(ConfigDialog *configDialog, TQWidget *parent, const char *name=0); bool indicateUnowned(); bool highliteUnowned(); @@ -72,7 +72,7 @@ private: void reset(); ConfigDialog *m_configDialog; - QCheckBox *m_indicateUnowned, *m_highliteUnowned, *m_darkenMortgaged, *m_animateToken, *m_quartzEffects; + TQCheckBox *m_indicateUnowned, *m_highliteUnowned, *m_darkenMortgaged, *m_animateToken, *m_quartzEffects; }; class ConfigMonopigator : public QWidget @@ -80,7 +80,7 @@ class ConfigMonopigator : public QWidget Q_OBJECT public: - ConfigMonopigator(ConfigDialog *dialog, QWidget *parent, const char *name = 0); + ConfigMonopigator(ConfigDialog *dialog, TQWidget *parent, const char *name = 0); bool connectOnStart(); bool hideDevelopmentServers(); @@ -89,7 +89,7 @@ private: void reset(); ConfigDialog *m_configDialog; - QCheckBox *m_connectOnStart, *m_hideDevelopmentServers; + TQCheckBox *m_connectOnStart, *m_hideDevelopmentServers; }; class ConfigGeneral : public QWidget @@ -97,7 +97,7 @@ class ConfigGeneral : public QWidget Q_OBJECT public: - ConfigGeneral(ConfigDialog *dialog, QWidget *parent, const char *name = 0); + ConfigGeneral(ConfigDialog *dialog, TQWidget *parent, const char *name = 0); bool chatTimestamps(); @@ -105,7 +105,7 @@ private: void reset(); ConfigDialog *m_configDialog; - QCheckBox *m_chatTimestamps; + TQCheckBox *m_chatTimestamps; }; class ConfigDialog : public KDialogBase @@ -122,14 +122,14 @@ public: bool animateToken(); bool quartzEffects(); AtlantikConfig config(); - QString playerName(); - QString playerImage(); + TQString playerName(); + TQString playerImage(); bool connectOnStart(); bool hideDevelopmentServers(); private: Atlantik *m_parent; - QFrame *p_general, *p_p13n, *p_board, *p_monopigator; + TQFrame *p_general, *p_p13n, *p_board, *p_monopigator; ConfigPlayer *configPlayer; ConfigBoard *configBoard; ConfigMonopigator *configMonopigator; diff --git a/atlantik/client/event.cpp b/atlantik/client/event.cpp index 218f6b87..a37c1847 100644 --- a/atlantik/client/event.cpp +++ b/atlantik/client/event.cpp @@ -14,29 +14,29 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qdatetime.h> -#include <qstring.h> +#include <tqdatetime.h> +#include <tqstring.h> #include "event.moc" -Event::Event(const QDateTime &dateTime, const QString &description, const QString &icon) +Event::Event(const TQDateTime &dateTime, const TQString &description, const TQString &icon) { m_dateTime = dateTime; m_description = description; m_icon = icon; } -QDateTime Event::dateTime() const +TQDateTime Event::dateTime() const { return m_dateTime; } -QString Event::description() const +TQString Event::description() const { return m_description; } -QString Event::icon() const +TQString Event::icon() const { return m_icon; } diff --git a/atlantik/client/event.h b/atlantik/client/event.h index f2f56444..0acbd387 100644 --- a/atlantik/client/event.h +++ b/atlantik/client/event.h @@ -17,7 +17,7 @@ #ifndef ATLANTIK_EVENT_H #define ATLANTIK_EVENT_H -#include <qobject.h> +#include <tqobject.h> class QDateTime; class QString; @@ -27,14 +27,14 @@ class Event : public QObject Q_OBJECT public: - Event(const QDateTime &dateTime, const QString &description, const QString &icon = QString::null); - QDateTime dateTime() const; - QString description() const; - QString icon() const; + Event(const TQDateTime &dateTime, const TQString &description, const TQString &icon = TQString::null); + TQDateTime dateTime() const; + TQString description() const; + TQString icon() const; private: - QDateTime m_dateTime; - QString m_description, m_icon; + TQDateTime m_dateTime; + TQString m_description, m_icon; }; #endif diff --git a/atlantik/client/eventlogwidget.cpp b/atlantik/client/eventlogwidget.cpp index b0f77ab8..6bc81b04 100644 --- a/atlantik/client/eventlogwidget.cpp +++ b/atlantik/client/eventlogwidget.cpp @@ -16,9 +16,9 @@ #include <iostream> -#include <qheader.h> -#include <qlayout.h> -#include <qdatetime.h> +#include <tqheader.h> +#include <tqlayout.h> +#include <tqdatetime.h> #include <klocale.h> #include <klistview.h> @@ -35,30 +35,30 @@ EventLog::EventLog() { } -void EventLog::addEvent(const QString &description, const QString &icon) +void EventLog::addEvent(const TQString &description, const TQString &icon) { - Event *event = new Event(QDateTime::currentDateTime(), description, icon); + Event *event = new Event(TQDateTime::currentDateTime(), description, icon); m_events.append(event); emit newEvent(event); } -QPtrList<Event> EventLog::events() +TQPtrList<Event> EventLog::events() { return m_events; } -EventLogWidget::EventLogWidget(EventLog *eventLog, QWidget *parent, const char *name) - : QWidget(parent, name, +EventLogWidget::EventLogWidget(EventLog *eventLog, TQWidget *parent, const char *name) + : TQWidget(parent, name, WType_Dialog | WStyle_Customize | WStyle_DialogBorder | WStyle_Title | WStyle_Minimize | WStyle_ContextHelp ) { m_eventLog = eventLog; - connect(m_eventLog, SIGNAL(newEvent(Event *)), this, SLOT(addEvent(Event *))); + connect(m_eventLog, TQT_SIGNAL(newEvent(Event *)), this, TQT_SLOT(addEvent(Event *))); setCaption(i18n("Event Log")); - QVBoxLayout *listCompBox = new QVBoxLayout(this, KDialog::marginHint()); + TQVBoxLayout *listCompBox = new TQVBoxLayout(this, KDialog::marginHint()); m_eventList = new KListView(this, "eventList"); listCompBox->addWidget(m_eventList); @@ -67,19 +67,19 @@ EventLogWidget::EventLogWidget(EventLog *eventLog, QWidget *parent, const char * m_eventList->addColumn(i18n("Description")); m_eventList->header()->setClickEnabled( false ); - QHBoxLayout *actionBox = new QHBoxLayout(this, 0, KDialog::spacingHint()); + TQHBoxLayout *actionBox = new TQHBoxLayout(this, 0, KDialog::spacingHint()); listCompBox->addItem(actionBox); - actionBox->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); + actionBox->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum)); m_saveButton = new KPushButton(BarIcon("filesave", KIcon::SizeSmall), i18n("&Save As..."), this); actionBox->addWidget(m_saveButton); - connect(m_saveButton, SIGNAL(clicked()), this, SLOT(save())); + connect(m_saveButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(save())); // Populate - QPtrList<Event> events = m_eventLog->events(); - for (QPtrListIterator<Event> it( events ); (*it) ; ++it) + TQPtrList<Event> events = m_eventLog->events(); + for (TQPtrListIterator<Event> it( events ); (*it) ; ++it) addEvent( (*it) ); } @@ -91,32 +91,32 @@ void EventLogWidget::addEvent(Event *event) if ( m_eventList->childCount() >= 25 ) delete m_eventList->firstChild(); - QString description = KStringHandler::rsqueeze( event->description(), 200 ); + TQString description = KStringHandler::rsqueeze( event->description(), 200 ); KListViewItem *item = new KListViewItem(m_eventList, event->dateTime().toString("yyyy-MM-dd hh:mm:ss zzz"), description); if (event->icon().isEmpty()) - item->setPixmap(1, QPixmap(SmallIcon("atlantik"))); + item->setPixmap(1, TQPixmap(SmallIcon("atlantik"))); else - item->setPixmap(1, QPixmap(SmallIcon(event->icon()))); + item->setPixmap(1, TQPixmap(SmallIcon(event->icon()))); m_eventList->ensureItemVisible(item); } -void EventLogWidget::closeEvent(QCloseEvent *e) +void EventLogWidget::closeEvent(TQCloseEvent *e) { e->accept(); } void EventLogWidget::save() { - QFile file( KFileDialog::getSaveFileName() ); + TQFile file( KFileDialog::getSaveFileName() ); if ( file.open( IO_WriteOnly ) ) { - QTextStream stream(&file); + TQTextStream stream(&file); - stream << i18n( "Atlantik log file, saved at %1." ).arg( QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss") ) << endl; + stream << i18n( "Atlantik log file, saved at %1." ).arg( TQDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss") ) << endl; - QPtrList<Event> events = m_eventLog->events(); - for (QPtrListIterator<Event> it( events ); (*it) ; ++it) + TQPtrList<Event> events = m_eventLog->events(); + for (TQPtrListIterator<Event> it( events ); (*it) ; ++it) stream << (*it)->dateTime().toString("yyyy-MM-dd hh:mm:ss") << " " << (*it)->description() << endl; file.close(); } diff --git a/atlantik/client/eventlogwidget.h b/atlantik/client/eventlogwidget.h index 4b925d47..439a8127 100644 --- a/atlantik/client/eventlogwidget.h +++ b/atlantik/client/eventlogwidget.h @@ -17,8 +17,8 @@ #ifndef ATLANTIK_EVENTLOGWIDGET_H #define ATLANTIK_EVENTLOGWIDGET_H -#include <qwidget.h> -#include <qmap.h> +#include <tqwidget.h> +#include <tqmap.h> class QString; @@ -34,16 +34,16 @@ Q_OBJECT public: EventLog(); - QPtrList<Event> events(); + TQPtrList<Event> events(); public slots: - void addEvent(const QString &description, const QString &icon = QString::null); + void addEvent(const TQString &description, const TQString &icon = TQString::null); signals: void newEvent(Event *event); private: - QPtrList<Event> m_events; + TQPtrList<Event> m_events; }; class EventLogWidget : public QWidget @@ -53,13 +53,13 @@ Q_OBJECT public: enum EventLogType { Default, Net_In, Net_Out }; - EventLogWidget(EventLog *eventLog, QWidget *parent=0, const char *name = 0); + EventLogWidget(EventLog *eventLog, TQWidget *parent=0, const char *name = 0); public slots: void addEvent(Event *event); protected: - void closeEvent(QCloseEvent *e); + void closeEvent(TQCloseEvent *e); private slots: void save(); diff --git a/atlantik/client/monopigator.cpp b/atlantik/client/monopigator.cpp index 83ef0d42..7e0a834d 100644 --- a/atlantik/client/monopigator.cpp +++ b/atlantik/client/monopigator.cpp @@ -14,9 +14,9 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qdom.h> -#include <qptrlist.h> -#include <qregexp.h> +#include <tqdom.h> +#include <tqptrlist.h> +#include <tqregexp.h> #include <kextendedsocket.h> @@ -41,25 +41,25 @@ Monopigator::~Monopigator() void Monopigator::loadData(const KURL &url) { delete m_downloadData; - m_downloadData = new QBuffer(); + m_downloadData = new TQBuffer(); m_downloadData->open(IO_WriteOnly); m_downloadData->reset(); m_job = KIO::get(url, true, false); - m_job->addMetaData(QString::fromLatin1("UserAgent"), QString::fromLatin1("Atlantik/" ATLANTIK_VERSION_STRING)); + m_job->addMetaData(TQString::fromLatin1("UserAgent"), TQString::fromLatin1("Atlantik/" ATLANTIK_VERSION_STRING)); if (!m_timer) { - m_timer = new QTimer(this); + m_timer = new TQTimer(this); m_timer->start(10000, true); } - connect(m_job, SIGNAL(data(KIO::Job *, const QByteArray &)), SLOT(slotData(KIO::Job *, const QByteArray &))); - connect(m_job, SIGNAL(result(KIO::Job *)), SLOT(slotResult(KIO::Job *))); - connect(m_timer, SIGNAL(timeout()), SLOT(slotTimeout())); + connect(m_job, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)), TQT_SLOT(slotData(KIO::Job *, const TQByteArray &))); + connect(m_job, TQT_SIGNAL(result(KIO::Job *)), TQT_SLOT(slotResult(KIO::Job *))); + connect(m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout())); } -void Monopigator::slotData(KIO::Job *, const QByteArray &data) +void Monopigator::slotData(KIO::Job *, const TQByteArray &data) { m_timer->stop(); m_downloadData->writeBlock(data.data(), data.size()); @@ -80,26 +80,26 @@ void Monopigator::slotTimeout() emit timeout(); } -void Monopigator::processData(const QByteArray &data, bool okSoFar) +void Monopigator::processData(const TQByteArray &data, bool okSoFar) { if (okSoFar) { - QString xmlData(data); - QDomDocument domDoc; + TQString xmlData(data); + TQDomDocument domDoc; if (domDoc.setContent(xmlData)) { - QDomElement eTop = domDoc.documentElement(); + TQDomElement eTop = domDoc.documentElement(); if (eTop.tagName() != "monopigator") return; - QDomNode n = eTop.firstChild(); + TQDomNode n = eTop.firstChild(); while(!n.isNull()) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if(!e.isNull()) { if (e.tagName() == "server") - emit monopigatorAdd(e.attributeNode(QString("ip")).value(), e.attributeNode(QString("host")).value(), e.attributeNode(QString("port")).value(), e.attributeNode(QString("version")).value(), e.attributeNode(QString("users")).value().toInt()); + emit monopigatorAdd(e.attributeNode(TQString("ip")).value(), e.attributeNode(TQString("host")).value(), e.attributeNode(TQString("port")).value(), e.attributeNode(TQString("version")).value(), e.attributeNode(TQString("users")).value().toInt()); } n = n.nextSibling(); } @@ -108,9 +108,9 @@ void Monopigator::processData(const QByteArray &data, bool okSoFar) } } -MonopigatorEntry::MonopigatorEntry(QListView *parent, QString host, QString latency, QString version, QString users, QString port, QString ip) : QObject(), QListViewItem(parent, host, latency, version, users, port) +MonopigatorEntry::MonopigatorEntry(TQListView *parent, TQString host, TQString latency, TQString version, TQString users, TQString port, TQString ip) : TQObject(), TQListViewItem(parent, host, latency, version, users, port) { - m_isDev = ( version.find( QRegExp("(CVS|-dev)") ) != -1 ) ? true : false; + m_isDev = ( version.find( TQRegExp("(CVS|-dev)") ) != -1 ) ? true : false; setEnabled(false); parent->sort(); @@ -118,8 +118,8 @@ MonopigatorEntry::MonopigatorEntry(QListView *parent, QString host, QString late if ( !ip.isEmpty() ) host = ip; m_latencySocket = new KExtendedSocket( host, port.toInt(), KExtendedSocket::inputBufferedSocket | KExtendedSocket::noResolve ); - connect(m_latencySocket, SIGNAL(lookupFinished(int)), this, SLOT(resolved())); - connect(m_latencySocket, SIGNAL(connectionSuccess()), this, SLOT(connected())); + connect(m_latencySocket, TQT_SIGNAL(lookupFinished(int)), this, TQT_SLOT(resolved())); + connect(m_latencySocket, TQT_SIGNAL(connectionSuccess()), this, TQT_SLOT(connected())); m_latencySocket->startAsyncConnect(); } @@ -130,13 +130,13 @@ void MonopigatorEntry::resolved() void MonopigatorEntry::connected() { - setText( 1, QString::number(time.elapsed()) ); + setText( 1, TQString::number(time.elapsed()) ); setEnabled(true); listView()->sort(); delete m_latencySocket; } -int MonopigatorEntry::compare(QListViewItem *i, int col, bool ascending) const +int MonopigatorEntry::compare(TQListViewItem *i, int col, bool ascending) const { // Colums 1 and 3 are integers (latency and users) if (col == 1 || col == 3) diff --git a/atlantik/client/monopigator.h b/atlantik/client/monopigator.h index 1fd57b1b..b5542fe9 100644 --- a/atlantik/client/monopigator.h +++ b/atlantik/client/monopigator.h @@ -17,10 +17,10 @@ #ifndef ATLANTIK_MONOPIGATOR_H #define ATLANTIK_MONOPIGATOR_H -#include <qobject.h> -#include <qbuffer.h> -#include <qlistview.h> -#include <qtimer.h> +#include <tqobject.h> +#include <tqbuffer.h> +#include <tqlistview.h> +#include <tqtimer.h> #include <kio/job.h> #include <kurl.h> @@ -38,30 +38,30 @@ public: void loadData(const KURL &); signals: - void monopigatorAdd(QString ip, QString host, QString port, QString version, int users); + void monopigatorAdd(TQString ip, TQString host, TQString port, TQString version, int users); void finished(); void timeout(); private slots: - void slotData(KIO::Job *, const QByteArray &); + void slotData(KIO::Job *, const TQByteArray &); void slotResult(KIO::Job *); void slotTimeout(); private: - void processData(const QByteArray &, bool = true); + void processData(const TQByteArray &, bool = true); - QBuffer *m_downloadData; - QTimer *m_timer; + TQBuffer *m_downloadData; + TQTimer *m_timer; KIO::Job *m_job; }; -class MonopigatorEntry : public QObject, public QListViewItem +class MonopigatorEntry : public TQObject, public QListViewItem { Q_OBJECT public: - MonopigatorEntry(QListView *parent, QString host, QString latency, QString version, QString users, QString port, QString ip); - int compare(QListViewItem *i, int col, bool ascending) const; + MonopigatorEntry(TQListView *parent, TQString host, TQString latency, TQString version, TQString users, TQString port, TQString ip); + int compare(TQListViewItem *i, int col, bool ascending) const; bool isDev() const; private slots: @@ -71,8 +71,8 @@ private slots: private: KExtendedSocket *m_latencySocket; - QTime time; - QListView *m_parent; + TQTime time; + TQListView *m_parent; bool m_isDev; }; diff --git a/atlantik/client/selectconfiguration_widget.cpp b/atlantik/client/selectconfiguration_widget.cpp index 0e7d5cdb..b40bdd4f 100644 --- a/atlantik/client/selectconfiguration_widget.cpp +++ b/atlantik/client/selectconfiguration_widget.cpp @@ -16,8 +16,8 @@ #include <iostream> -#include <qcheckbox.h> -#include <qradiobutton.h> +#include <tqcheckbox.h> +#include <tqradiobutton.h> #include <kdebug.h> #include <kdialog.h> @@ -33,47 +33,47 @@ #include "selectconfiguration_widget.moc" -SelectConfiguration::SelectConfiguration(AtlanticCore *atlanticCore, QWidget *parent, const char *name) : QWidget(parent, name) +SelectConfiguration::SelectConfiguration(AtlanticCore *atlanticCore, TQWidget *parent, const char *name) : TQWidget(parent, name) { m_atlanticCore = atlanticCore; m_game = 0; - m_mainLayout = new QVBoxLayout(this, KDialog::marginHint()); + m_mainLayout = new TQVBoxLayout(this, KDialog::marginHint()); Q_CHECK_PTR(m_mainLayout); // Game configuration. - m_configBox = new QVGroupBox(i18n("Game Configuration"), this, "configBox"); + m_configBox = new TQVGroupBox(i18n("Game Configuration"), this, "configBox"); m_mainLayout->addWidget(m_configBox); // Player buttons. - QHBoxLayout *playerButtons = new QHBoxLayout(m_mainLayout, KDialog::spacingHint()); + TQHBoxLayout *playerButtons = new TQHBoxLayout(m_mainLayout, KDialog::spacingHint()); playerButtons->setMargin(0); - playerButtons->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); + playerButtons->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum)); // Vertical spacer. - m_mainLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding)); + m_mainLayout->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding)); // Server buttons. - QHBoxLayout *serverButtons = new QHBoxLayout(m_mainLayout, KDialog::spacingHint()); + TQHBoxLayout *serverButtons = new TQHBoxLayout(m_mainLayout, KDialog::spacingHint()); serverButtons->setMargin(0); m_backButton = new KPushButton(SmallIcon("back"), i18n("Leave Game"), this); serverButtons->addWidget(m_backButton); - connect(m_backButton, SIGNAL(clicked()), this, SIGNAL(leaveGame())); + connect(m_backButton, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(leaveGame())); - serverButtons->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); + serverButtons->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum)); m_startButton = new KPushButton(SmallIconSet("forward"), i18n("Start Game"), this); serverButtons->addWidget(m_startButton); m_startButton->setEnabled(false); - connect(m_startButton, SIGNAL(clicked()), this, SIGNAL(startGame())); + connect(m_startButton, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(startGame())); Player *playerSelf = m_atlanticCore->playerSelf(); playerChanged(playerSelf); - connect(playerSelf, SIGNAL(changed(Player *)), this, SLOT(playerChanged(Player *))); + connect(playerSelf, TQT_SIGNAL(changed(Player *)), this, TQT_SLOT(playerChanged(Player *))); emit statusMessage(i18n("Retrieving configuration list...")); } @@ -86,22 +86,22 @@ void SelectConfiguration::initGame() void SelectConfiguration::addConfigOption(ConfigOption *configOption) { // FIXME: only bool types supported! - QCheckBox *checkBox = new QCheckBox(configOption->description(), m_configBox, "checkbox"); - m_configMap[(QObject *)checkBox] = configOption; + TQCheckBox *checkBox = new TQCheckBox(configOption->description(), m_configBox, "checkbox"); + m_configMap[(TQObject *)checkBox] = configOption; m_configBoxMap[configOption] = checkBox; checkBox->setChecked( configOption->value().toInt() ); checkBox->setEnabled( configOption->edit() && m_atlanticCore->selfIsMaster() ); checkBox->show(); - connect(checkBox, SIGNAL(clicked()), this, SLOT(changeOption())); - connect(configOption, SIGNAL(changed(ConfigOption *)), this, SLOT(optionChanged(ConfigOption *))); + connect(checkBox, TQT_SIGNAL(clicked()), this, TQT_SLOT(changeOption())); + connect(configOption, TQT_SIGNAL(changed(ConfigOption *)), this, TQT_SLOT(optionChanged(ConfigOption *))); } -void SelectConfiguration::gameOption(QString title, QString type, QString value, QString edit, QString command) +void SelectConfiguration::gameOption(TQString title, TQString type, TQString value, TQString edit, TQString command) { // Find if option exists in GUI yet - if (QCheckBox *checkBox = dynamic_cast<QCheckBox *>(m_checkBoxMap[command])) + if (TQCheckBox *checkBox = dynamic_cast<TQCheckBox *>(m_checkBoxMap[command])) { checkBox->setChecked(value.toInt()); checkBox->setEnabled(edit.toInt()); @@ -111,14 +111,14 @@ void SelectConfiguration::gameOption(QString title, QString type, QString value, // Create option if (type == "bool") { - QCheckBox *checkBox = new QCheckBox(title, m_configBox, "checkbox"); - m_optionCommandMap[(QObject *)checkBox] = command; + TQCheckBox *checkBox = new TQCheckBox(title, m_configBox, "checkbox"); + m_optionCommandMap[(TQObject *)checkBox] = command; m_checkBoxMap[command] = checkBox; checkBox->setChecked(value.toInt()); checkBox->setEnabled(edit.toInt()); checkBox->show(); - connect(checkBox, SIGNAL(clicked()), this, SLOT(optionChanged())); + connect(checkBox, TQT_SIGNAL(clicked()), this, TQT_SLOT(optionChanged())); } // TODO: create options other than type=bool @@ -127,17 +127,17 @@ void SelectConfiguration::gameOption(QString title, QString type, QString value, void SelectConfiguration::changeOption() { - ConfigOption *configOption = m_configMap[(QObject *)QObject::sender()]; + ConfigOption *configOption = m_configMap[(TQObject *)TQObject::sender()]; if (configOption) { - kdDebug() << "checked " << ((QCheckBox *)QObject::sender())->isChecked() << endl; - emit changeOption( configOption->id(), QString::number( ((QCheckBox *)QObject::sender())->isChecked() ) ); + kdDebug() << "checked " << ((TQCheckBox *)TQObject::sender())->isChecked() << endl; + emit changeOption( configOption->id(), TQString::number( ((TQCheckBox *)TQObject::sender())->isChecked() ) ); } } void SelectConfiguration::optionChanged(ConfigOption *configOption) { - QCheckBox *checkBox = m_configBoxMap[configOption]; + TQCheckBox *checkBox = m_configBoxMap[configOption]; if (checkBox) { checkBox->setText( configOption->description() ); @@ -148,11 +148,11 @@ void SelectConfiguration::optionChanged(ConfigOption *configOption) void SelectConfiguration::optionChanged() { - QString command = m_optionCommandMap[(QObject *)QObject::sender()]; + TQString command = m_optionCommandMap[(TQObject *)TQObject::sender()]; - if (QCheckBox *checkBox = m_checkBoxMap[command]) + if (TQCheckBox *checkBox = m_checkBoxMap[command]) { - command.append(QString::number(checkBox->isChecked())); + command.append(TQString::number(checkBox->isChecked())); emit buttonCommand(command); } } @@ -171,12 +171,12 @@ void SelectConfiguration::playerChanged(Player *player) kdDebug() << "playerChanged::change" << endl; if (m_game) - disconnect(m_game, SIGNAL(changed(Game *)), this, SLOT(gameChanged(Game *))); + disconnect(m_game, TQT_SIGNAL(changed(Game *)), this, TQT_SLOT(gameChanged(Game *))); m_game = player->game(); if (m_game) - connect(m_game, SIGNAL(changed(Game *)), this, SLOT(gameChanged(Game *))); + connect(m_game, TQT_SIGNAL(changed(Game *)), this, TQT_SLOT(gameChanged(Game *))); } } @@ -184,6 +184,6 @@ void SelectConfiguration::gameChanged(Game *game) { m_startButton->setEnabled( game->master() == m_atlanticCore->playerSelf() ); - for (QMapIterator<ConfigOption *, QCheckBox *> it = m_configBoxMap.begin() ; it != m_configBoxMap.end() ; ++it) + for (TQMapIterator<ConfigOption *, TQCheckBox *> it = m_configBoxMap.begin() ; it != m_configBoxMap.end() ; ++it) (*it)->setEnabled( it.key()->edit() && m_atlanticCore->selfIsMaster() ); } diff --git a/atlantik/client/selectconfiguration_widget.h b/atlantik/client/selectconfiguration_widget.h index 033a0eb0..1bc8c241 100644 --- a/atlantik/client/selectconfiguration_widget.h +++ b/atlantik/client/selectconfiguration_widget.h @@ -17,9 +17,9 @@ #ifndef ATLANTIK_SELECTCONFIGURATION_WIDGET_H #define ATLANTIK_SELECTCONFIGURATION_WIDGET_H -#include <qwidget.h> -#include <qlayout.h> -#include <qvgroupbox.h> +#include <tqwidget.h> +#include <tqlayout.h> +#include <tqvgroupbox.h> #include <klistview.h> #include <kpushbutton.h> @@ -37,16 +37,16 @@ class SelectConfiguration : public QWidget Q_OBJECT public: - SelectConfiguration(AtlanticCore *atlanticCore, QWidget *parent, const char *name=0); + SelectConfiguration(AtlanticCore *atlanticCore, TQWidget *parent, const char *name=0); void setCanStart(const bool &canStart); - QString hostToConnect() const; + TQString hostToConnect() const; int portToConnect(); private slots: void addConfigOption(ConfigOption *configOption); void changeOption(); - void gameOption(QString title, QString type, QString value, QString edit, QString command); + void gameOption(TQString title, TQString type, TQString value, TQString edit, TQString command); void optionChanged(ConfigOption *configOption); void optionChanged(); void slotEndUpdate(); @@ -59,20 +59,20 @@ signals: void leaveGame(); void joinConfiguration(int configurationId); void newConfiguration(); - void changeOption(int configId, const QString &value); - void buttonCommand(QString); - void iconSelected(const QString &); - void statusMessage(const QString &message); + void changeOption(int configId, const TQString &value); + void buttonCommand(TQString); + void iconSelected(const TQString &); + void statusMessage(const TQString &message); private: - QVBoxLayout *m_mainLayout; - QVGroupBox *m_configBox, *m_messageBox; + TQVBoxLayout *m_mainLayout; + TQVGroupBox *m_configBox, *m_messageBox; KPushButton *m_backButton, *m_startButton; - QMap <QObject *, QString> m_optionCommandMap; - QMap <QObject *, ConfigOption *> m_configMap; - QMap <ConfigOption *, QCheckBox *> m_configBoxMap; - QMap <QString, QCheckBox *> m_checkBoxMap; - QMap <Player *, QListViewItem *> m_items; + TQMap <TQObject *, TQString> m_optionCommandMap; + TQMap <TQObject *, ConfigOption *> m_configMap; + TQMap <ConfigOption *, TQCheckBox *> m_configBoxMap; + TQMap <TQString, TQCheckBox *> m_checkBoxMap; + TQMap <Player *, TQListViewItem *> m_items; Game *m_game; AtlanticCore *m_atlanticCore; }; diff --git a/atlantik/client/selectgame_widget.cpp b/atlantik/client/selectgame_widget.cpp index 85d4f886..8f39ff08 100644 --- a/atlantik/client/selectgame_widget.cpp +++ b/atlantik/client/selectgame_widget.cpp @@ -14,8 +14,8 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qvgroupbox.h> -#include <qradiobutton.h> +#include <tqvgroupbox.h> +#include <tqradiobutton.h> #include <kdebug.h> #include <kdialog.h> @@ -29,18 +29,18 @@ #include "selectgame_widget.h" -SelectGame::SelectGame(AtlanticCore *atlanticCore, QWidget *parent, const char *name) : QWidget(parent, name) +SelectGame::SelectGame(AtlanticCore *atlanticCore, TQWidget *parent, const char *name) : TQWidget(parent, name) { m_atlanticCore = atlanticCore; - connect(m_atlanticCore, SIGNAL(createGUI(Game *)), this, SLOT(addGame(Game *))); - connect(m_atlanticCore, SIGNAL(removeGUI(Game *)), this, SLOT(delGame(Game *))); + connect(m_atlanticCore, TQT_SIGNAL(createGUI(Game *)), this, TQT_SLOT(addGame(Game *))); + connect(m_atlanticCore, TQT_SIGNAL(removeGUI(Game *)), this, TQT_SLOT(delGame(Game *))); - m_mainLayout = new QVBoxLayout(this, KDialog::marginHint()); + m_mainLayout = new TQVBoxLayout(this, KDialog::marginHint()); Q_CHECK_PTR(m_mainLayout); - QVGroupBox *groupBox; - groupBox = new QVGroupBox(i18n("Create or Select monopd Game"), this, "groupBox"); + TQVGroupBox *groupBox; + groupBox = new TQVGroupBox(i18n("Create or Select monopd Game"), this, "groupBox"); m_mainLayout->addWidget(groupBox); // List of games @@ -52,47 +52,47 @@ SelectGame::SelectGame(AtlanticCore *atlanticCore, QWidget *parent, const char * m_gameList->setAllColumnsShowFocus(true); // m_mainLayout->addWidget(m_gameList); - connect(m_gameList, SIGNAL(clicked(QListViewItem *)), this, SLOT(validateConnectButton())); - connect(m_gameList, SIGNAL(doubleClicked(QListViewItem *)), this, SLOT(connectClicked())); - connect(m_gameList, SIGNAL(rightButtonClicked(QListViewItem *, const QPoint &, int)), this, SLOT(validateConnectButton())); - connect(m_gameList, SIGNAL(selectionChanged(QListViewItem *)), this, SLOT(validateConnectButton())); + connect(m_gameList, TQT_SIGNAL(clicked(TQListViewItem *)), this, TQT_SLOT(validateConnectButton())); + connect(m_gameList, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(connectClicked())); + connect(m_gameList, TQT_SIGNAL(rightButtonClicked(TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT(validateConnectButton())); + connect(m_gameList, TQT_SIGNAL(selectionChanged(TQListViewItem *)), this, TQT_SLOT(validateConnectButton())); - QHBoxLayout *buttonBox = new QHBoxLayout(m_mainLayout, KDialog::spacingHint()); + TQHBoxLayout *buttonBox = new TQHBoxLayout(m_mainLayout, KDialog::spacingHint()); KPushButton *backButton = new KPushButton(SmallIcon("back"), i18n("Server List"), this); buttonBox->addWidget(backButton); - connect(backButton, SIGNAL(clicked()), this, SIGNAL(leaveServer())); + connect(backButton, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(leaveServer())); - buttonBox->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); + buttonBox->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum)); m_connectButton = new KPushButton(SmallIconSet("forward"), i18n("Create Game"), this); m_connectButton->setEnabled(false); buttonBox->addWidget(m_connectButton); - connect(m_connectButton, SIGNAL(clicked()), this, SLOT(connectClicked())); + connect(m_connectButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(connectClicked())); } void SelectGame::addGame(Game *game) { - connect(game, SIGNAL(changed(Game *)), this, SLOT(updateGame(Game *))); + connect(game, TQT_SIGNAL(changed(Game *)), this, TQT_SLOT(updateGame(Game *))); if (game->id() == -1) { - QListViewItem *item = new QListViewItem( m_gameList, i18n("Create a new %1 Game").arg(game->name()), game->description(), QString::null, QString::null, game->type() ); - item->setPixmap(0, QPixmap(SmallIcon("filenew"))); + TQListViewItem *item = new TQListViewItem( m_gameList, i18n("Create a new %1 Game").arg(game->name()), game->description(), TQString::null, TQString::null, game->type() ); + item->setPixmap(0, TQPixmap(SmallIcon("filenew"))); } else { Player *master = game->master(); - QListViewItem *item = new QListViewItem( m_gameList, i18n("Join %1's %2 Game").arg( (master ? master->name() : QString::null), game->name() ), game->description(), QString::number(game->id()), QString::number(game->players()), game->type() ); - item->setPixmap( 0, QPixmap(SmallIcon("atlantik")) ); + TQListViewItem *item = new TQListViewItem( m_gameList, i18n("Join %1's %2 Game").arg( (master ? master->name() : TQString::null), game->name() ), game->description(), TQString::number(game->id()), TQString::number(game->players()), game->type() ); + item->setPixmap( 0, TQPixmap(SmallIcon("atlantik")) ); item->setEnabled(game->canBeJoined()); KNotifyClient::event(winId(), "newgame"); - connect(master, SIGNAL(changed(Player *)), this, SLOT(playerChanged(Player *))); + connect(master, TQT_SIGNAL(changed(Player *)), this, TQT_SLOT(playerChanged(Player *))); } // validateConnectButton(); @@ -100,7 +100,7 @@ void SelectGame::addGame(Game *game) void SelectGame::delGame(Game *game) { - QListViewItem *item = findItem(game); + TQListViewItem *item = findItem(game); if (!item) return; @@ -111,7 +111,7 @@ void SelectGame::delGame(Game *game) void SelectGame::updateGame(Game *game) { - QListViewItem *item = findItem(game); + TQListViewItem *item = findItem(game); if (!item) return; @@ -122,11 +122,11 @@ void SelectGame::updateGame(Game *game) else { Player *master = game->master(); - item->setText( 0, i18n("Join %1's %2 Game").arg( (master ? master->name() : QString::null), game->name() ) ); - item->setText( 3, QString::number( game->players() ) ); + item->setText( 0, i18n("Join %1's %2 Game").arg( (master ? master->name() : TQString::null), game->name() ) ); + item->setText( 3, TQString::number( game->players() ) ); item->setEnabled( game->canBeJoined() ); - connect(master, SIGNAL(changed(Player *)), this, SLOT(playerChanged(Player *))); + connect(master, TQT_SIGNAL(changed(Player *)), this, TQT_SLOT(playerChanged(Player *))); } m_gameList->triggerUpdate(); @@ -135,7 +135,7 @@ void SelectGame::updateGame(Game *game) void SelectGame::playerChanged(Player *player) { - QListViewItem *item = m_gameList->firstChild(); + TQListViewItem *item = m_gameList->firstChild(); Game *game = 0; while (item) @@ -150,12 +150,12 @@ void SelectGame::playerChanged(Player *player) } } -QListViewItem *SelectGame::findItem(Game *game) +TQListViewItem *SelectGame::findItem(Game *game) { - QListViewItem *item = m_gameList->firstChild(); + TQListViewItem *item = m_gameList->firstChild(); while (item) { - if ( (game->id() == -1 || item->text(2) == QString::number(game->id())) && item->text(4) == game->type() ) + if ( (game->id() == -1 || item->text(2) == TQString::number(game->id())) && item->text(4) == game->type() ) return item; item = item->nextSibling(); @@ -165,7 +165,7 @@ QListViewItem *SelectGame::findItem(Game *game) void SelectGame::validateConnectButton() { - if (QListViewItem *item = m_gameList->selectedItem()) + if (TQListViewItem *item = m_gameList->selectedItem()) { if (item->text(2).toInt() > 0) m_connectButton->setText(i18n("Join Game")); @@ -180,7 +180,7 @@ void SelectGame::validateConnectButton() void SelectGame::connectClicked() { - if (QListViewItem *item = m_gameList->selectedItem()) + if (TQListViewItem *item = m_gameList->selectedItem()) { if (int gameId = item->text(2).toInt()) emit joinGame(gameId); diff --git a/atlantik/client/selectgame_widget.h b/atlantik/client/selectgame_widget.h index d47e905e..f6d28f43 100644 --- a/atlantik/client/selectgame_widget.h +++ b/atlantik/client/selectgame_widget.h @@ -17,8 +17,8 @@ #ifndef ATLANTIK_SELECTGAME_WIDGET_H #define ATLANTIK_SELECTGAME_WIDGET_H -#include <qwidget.h> -#include <qlayout.h> +#include <tqwidget.h> +#include <tqlayout.h> #include <klistview.h> #include <kpushbutton.h> @@ -32,11 +32,11 @@ class SelectGame : public QWidget Q_OBJECT public: - SelectGame(AtlanticCore *atlanticCore, QWidget *parent, const char *name=0); + SelectGame(AtlanticCore *atlanticCore, TQWidget *parent, const char *name=0); void initPage(); bool validateNext(); - QString hostToConnect() const; + TQString hostToConnect() const; int portToConnect(); private slots: @@ -49,15 +49,15 @@ private slots: signals: void joinGame(int gameId); - void newGame(const QString &gameType); + void newGame(const TQString &gameType); void leaveServer(); - void msgStatus(const QString &status); + void msgStatus(const TQString &status); private: - QListViewItem *findItem(Game *game); + TQListViewItem *findItem(Game *game); AtlanticCore *m_atlanticCore; - QVBoxLayout *m_mainLayout; + TQVBoxLayout *m_mainLayout; KListView *m_gameList; KPushButton *m_connectButton; }; diff --git a/atlantik/client/selectserver_widget.cpp b/atlantik/client/selectserver_widget.cpp index 39c07b50..97a594c4 100644 --- a/atlantik/client/selectserver_widget.cpp +++ b/atlantik/client/selectserver_widget.cpp @@ -14,12 +14,12 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qlabel.h> -#include <qlayout.h> -#include <qradiobutton.h> -#include <qsizepolicy.h> -#include <qvbuttongroup.h> -#include <qhgroupbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqradiobutton.h> +#include <tqsizepolicy.h> +#include <tqvbuttongroup.h> +#include <tqhgroupbox.h> #include <kdialog.h> #include <kextendedsocket.h> @@ -28,32 +28,32 @@ #include "selectserver_widget.moc" -SelectServer::SelectServer(bool useMonopigatorOnStart, bool hideDevelopmentServers, QWidget *parent, const char *name) : QWidget(parent, name) +SelectServer::SelectServer(bool useMonopigatorOnStart, bool hideDevelopmentServers, TQWidget *parent, const char *name) : TQWidget(parent, name) { m_hideDevelopmentServers = hideDevelopmentServers; - m_mainLayout = new QVBoxLayout(this, KDialog::marginHint()); + m_mainLayout = new TQVBoxLayout(this, KDialog::marginHint()); Q_CHECK_PTR(m_mainLayout); // Custom server group - QHGroupBox *customGroup = new QHGroupBox(i18n("Enter Custom monopd Server"), this, "customGroup"); + TQHGroupBox *customGroup = new TQHGroupBox(i18n("Enter Custom monopd Server"), this, "customGroup"); m_mainLayout->addWidget(customGroup); - QLabel *hostLabel = new QLabel(i18n("Hostname:"), customGroup); + TQLabel *hostLabel = new TQLabel(i18n("Hostname:"), customGroup); m_hostEdit = new KLineEdit(customGroup); - m_hostEdit->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum)); + m_hostEdit->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum)); - QLabel *portLabel = new QLabel(i18n("Port:"), customGroup); + TQLabel *portLabel = new TQLabel(i18n("Port:"), customGroup); - m_portEdit = new KLineEdit(QString::number(1234), customGroup); - m_portEdit->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum)); + m_portEdit = new KLineEdit(TQString::number(1234), customGroup); + m_portEdit->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Minimum)); KPushButton *connectButton = new KPushButton( KGuiItem(i18n("Connect"), "network"), customGroup); - connect(connectButton, SIGNAL(clicked()), this, SLOT(customConnect())); + connect(connectButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(customConnect())); // Server list group - QVButtonGroup *bgroup = new QVButtonGroup(i18n("Select monopd Server"), this, "bgroup"); + TQVButtonGroup *bgroup = new TQVButtonGroup(i18n("Select monopd Server"), this, "bgroup"); bgroup->setExclusive(true); m_mainLayout->addWidget(bgroup); @@ -67,33 +67,33 @@ SelectServer::SelectServer(bool useMonopigatorOnStart, bool hideDevelopmentServe m_serverList->setSorting(1); // m_mainLayout->addWidget(m_serverList); - connect(m_serverList, SIGNAL(clicked(QListViewItem *)), this, SLOT(validateConnectButton())); - connect(m_serverList, SIGNAL(doubleClicked(QListViewItem *)), this, SLOT(slotConnect())); - connect(m_serverList, SIGNAL(rightButtonClicked(QListViewItem *, const QPoint &, int)), this, SLOT(validateConnectButton())); - connect(m_serverList, SIGNAL(selectionChanged(QListViewItem *)), this, SLOT(validateConnectButton())); + connect(m_serverList, TQT_SIGNAL(clicked(TQListViewItem *)), this, TQT_SLOT(validateConnectButton())); + connect(m_serverList, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(slotConnect())); + connect(m_serverList, TQT_SIGNAL(rightButtonClicked(TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT(validateConnectButton())); + connect(m_serverList, TQT_SIGNAL(selectionChanged(TQListViewItem *)), this, TQT_SLOT(validateConnectButton())); - QHBoxLayout *buttonBox = new QHBoxLayout(m_mainLayout, KDialog::spacingHint()); - buttonBox->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); + TQHBoxLayout *buttonBox = new TQHBoxLayout(m_mainLayout, KDialog::spacingHint()); + buttonBox->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum)); // Server List / Refresh m_refreshButton = new KPushButton( KGuiItem(useMonopigatorOnStart ? i18n("Reload Server List") : i18n("Get Server List"), useMonopigatorOnStart ? "reload" : "network"), this); buttonBox->addWidget(m_refreshButton); - connect(m_refreshButton, SIGNAL(clicked()), this, SLOT(slotRefresh())); + connect(m_refreshButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotRefresh())); // Connect m_connectButton = new KPushButton(BarIconSet("forward", KIcon::SizeSmall), i18n("Connect"), this); m_connectButton->setEnabled(false); buttonBox->addWidget(m_connectButton); - connect(m_connectButton, SIGNAL(clicked()), this, SLOT(slotConnect())); + connect(m_connectButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotConnect())); // Monopigator m_monopigator = new Monopigator(); - connect(m_monopigator, SIGNAL(monopigatorAdd(QString, QString, QString, QString, int)), this, SLOT(slotMonopigatorAdd(QString, QString, QString, QString, int))); - connect(m_monopigator, SIGNAL(finished()), SLOT(monopigatorFinished())); - connect(m_monopigator, SIGNAL(timeout()), SLOT(monopigatorTimeout())); + connect(m_monopigator, TQT_SIGNAL(monopigatorAdd(TQString, TQString, TQString, TQString, int)), this, TQT_SLOT(slotMonopigatorAdd(TQString, TQString, TQString, TQString, int))); + connect(m_monopigator, TQT_SIGNAL(finished()), TQT_SLOT(monopigatorFinished())); + connect(m_monopigator, TQT_SIGNAL(timeout()), TQT_SLOT(monopigatorTimeout())); } SelectServer::~SelectServer() @@ -119,15 +119,15 @@ void SelectServer::initMonopigator() m_monopigator->loadData(KURL( "http://monopd-gator.kde.org/")); } -void SelectServer::slotMonopigatorAdd(QString ip, QString host, QString port, QString version, int users) +void SelectServer::slotMonopigatorAdd(TQString ip, TQString host, TQString port, TQString version, int users) { - MonopigatorEntry *item = new MonopigatorEntry(m_serverList, host, QString::number(9999), version, (users == -1) ? i18n("unknown") : QString::number(users), port, ip); + MonopigatorEntry *item = new MonopigatorEntry(m_serverList, host, TQString::number(9999), version, (users == -1) ? i18n("unknown") : TQString::number(users), port, ip); item->setPixmap(0, BarIcon("atlantik", KIcon::SizeSmall)); if ( item->isDev() ) { item->setVisible( !m_hideDevelopmentServers ); - connect(this, SIGNAL(showDevelopmentServers(bool)), item, SLOT(showDevelopmentServers(bool))); + connect(this, TQT_SIGNAL(showDevelopmentServers(bool)), item, TQT_SLOT(showDevelopmentServers(bool))); } validateConnectButton(); @@ -167,7 +167,7 @@ void SelectServer::slotRefresh(bool useMonopigator) void SelectServer::slotConnect() { - if (QListViewItem *item = m_serverList->selectedItem()) + if (TQListViewItem *item = m_serverList->selectedItem()) emit serverConnect(item->text(0), item->text(4).toInt()); } diff --git a/atlantik/client/selectserver_widget.h b/atlantik/client/selectserver_widget.h index c5d1b586..471bc8d2 100644 --- a/atlantik/client/selectserver_widget.h +++ b/atlantik/client/selectserver_widget.h @@ -17,9 +17,9 @@ #ifndef ATLANTIK_SELECTSERVER_WIDGET_H #define ATLANTIK_SELECTSERVER_WIDGET_H -#include <qwidget.h> -#include <qlayout.h> -#include <qradiobutton.h> +#include <tqwidget.h> +#include <tqlayout.h> +#include <tqradiobutton.h> #include <klineedit.h> #include <klistview.h> @@ -34,19 +34,19 @@ class SelectServer : public QWidget Q_OBJECT public: - SelectServer(bool useMonopigatorOnStart, bool hideDevelopmentServers, QWidget *parent, const char *name=0); + SelectServer(bool useMonopigatorOnStart, bool hideDevelopmentServers, TQWidget *parent, const char *name=0); virtual ~SelectServer(); void initPage(); void setHideDevelopmentServers(bool hideDevelopmentServers); bool validateNext(); - QString hostToConnect() const; + TQString hostToConnect() const; int portToConnect(); public slots: void validateConnectButton(); void slotRefresh(bool useMonopigator = true); - void slotMonopigatorAdd(QString ip, QString host, QString port, QString version, int users); + void slotMonopigatorAdd(TQString ip, TQString host, TQString port, TQString version, int users); private slots: void slotConnect(); @@ -55,14 +55,14 @@ private slots: void monopigatorTimeout(); signals: - void serverConnect(const QString host, int port); - void msgStatus(const QString &message); + void serverConnect(const TQString host, int port); + void msgStatus(const TQString &message); void showDevelopmentServers(bool show); private: void initMonopigator(); - QVBoxLayout *m_mainLayout; + TQVBoxLayout *m_mainLayout; KListView *m_serverList; KLineEdit *m_hostEdit, *m_portEdit; KPushButton *m_addServerButton, *m_refreshButton, *m_customConnect, *m_connectButton; diff --git a/atlantik/kio_atlantik/kio_atlantik.cpp b/atlantik/kio_atlantik/kio_atlantik.cpp index 3707d41b..de74a1e0 100644 --- a/atlantik/kio_atlantik/kio_atlantik.cpp +++ b/atlantik/kio_atlantik/kio_atlantik.cpp @@ -16,7 +16,7 @@ #include <stdlib.h> -#include <qtextstream.h> +#include <tqtextstream.h> #include <kdeversion.h> #undef KDE_3_1_FEATURES @@ -49,13 +49,13 @@ void AtlantikProtocol::get( const KURL& url ) *proc << "atlantik"; #ifdef KDE_3_1_FEATURES - QString host = url.hasHost() ? url.host() : KProcess::quote( url.queryItem("host") ); + TQString host = url.hasHost() ? url.host() : KProcess::quote( url.queryItem("host") ); #else - QString host = url.hasHost() ? url.host() : url.queryItem("host"); + TQString host = url.hasHost() ? url.host() : url.queryItem("host"); #endif - QString port = QString::number( url.port() ? url.port() : 1234 ); + TQString port = TQString::number( url.port() ? url.port() : 1234 ); int game = url.queryItem("game").toInt(); - QString gameString = game ? QString::number( game ) : QString::null; + TQString gameString = game ? TQString::number( game ) : TQString::null; if (!host.isNull() && !port.isNull()) { diff --git a/atlantik/kio_atlantik/kio_atlantik.h b/atlantik/kio_atlantik/kio_atlantik.h index ac794ca9..de1804e8 100644 --- a/atlantik/kio_atlantik/kio_atlantik.h +++ b/atlantik/kio_atlantik/kio_atlantik.h @@ -17,6 +17,6 @@ class AtlantikProtocol : public KIO::SlaveBase { public: - AtlantikProtocol( const QCString &pool, const QCString &app) : SlaveBase( "atlantik", pool, app ) {} + AtlantikProtocol( const TQCString &pool, const TQCString &app) : SlaveBase( "atlantik", pool, app ) {} virtual void get( const KURL& url ); }; diff --git a/atlantik/libatlantic/atlantic_core.cpp b/atlantik/libatlantic/atlantic_core.cpp index 39e1200e..9139e6ed 100644 --- a/atlantik/libatlantic/atlantic_core.cpp +++ b/atlantik/libatlantic/atlantic_core.cpp @@ -26,7 +26,7 @@ #include "player.h" #include "trade.h" -AtlanticCore::AtlanticCore(QObject *parent, const char *name) : QObject(parent, name) +AtlanticCore::AtlanticCore(TQObject *parent, const char *name) : TQObject(parent, name) { m_playerSelf = 0; } @@ -47,7 +47,7 @@ void AtlanticCore::reset(bool deletePermanents) m_configOptions.setAutoDelete(false); Trade *trade = 0; - for (QPtrListIterator<Trade> it(m_trades); (trade = *it) ; ++it) + for (TQPtrListIterator<Trade> it(m_trades); (trade = *it) ; ++it) { emit removeGUI(trade); trade->deleteLater(); @@ -55,7 +55,7 @@ void AtlanticCore::reset(bool deletePermanents) m_trades.clear(); Player *player = 0; - for (QPtrListIterator<Player> it(m_players); (player = *it) ; ++it) + for (TQPtrListIterator<Player> it(m_players); (player = *it) ; ++it) { if (deletePermanents) { @@ -74,7 +74,7 @@ void AtlanticCore::reset(bool deletePermanents) m_playerSelf = 0; Game *game = 0; - for (QPtrListIterator<Game> it(m_games); (game = *it) ; ++it) + for (TQPtrListIterator<Game> it(m_games); (game = *it) ; ++it) { emit removeGUI(game); game->deleteLater(); @@ -98,7 +98,7 @@ Player *AtlanticCore::playerSelf() return m_playerSelf; } -QPtrList<Player> AtlanticCore::players() +TQPtrList<Player> AtlanticCore::players() { return m_players; } @@ -122,7 +122,7 @@ Player *AtlanticCore::newPlayer(int playerId, const bool &playerSelf) Player *AtlanticCore::findPlayer(int playerId) { Player *player = 0; - for (QPtrListIterator<Player> it(m_players); (player = *it) ; ++it) + for (TQPtrListIterator<Player> it(m_players); (player = *it) ; ++it) if (player->id() == playerId) return player; @@ -136,12 +136,12 @@ void AtlanticCore::removePlayer(Player *player) player->deleteLater(); } -QPtrList<Game> AtlanticCore::games() +TQPtrList<Game> AtlanticCore::games() { return m_games; } -Game *AtlanticCore::newGame(int gameId, const QString &type) +Game *AtlanticCore::newGame(int gameId, const TQString &type) { Game *game = new Game(gameId); m_games.append(game); @@ -154,10 +154,10 @@ Game *AtlanticCore::newGame(int gameId, const QString &type) return game; } -Game *AtlanticCore::findGame(const QString &type) +Game *AtlanticCore::findGame(const TQString &type) { Game *game = 0; - for (QPtrListIterator<Game> it(m_games); (game = *it) ; ++it) + for (TQPtrListIterator<Game> it(m_games); (game = *it) ; ++it) if (game->id() == -1 && game->type() == type) return game; @@ -170,7 +170,7 @@ Game *AtlanticCore::findGame(int gameId) return 0; Game *game = 0; - for (QPtrListIterator<Game> it(m_games); (game = *it) ; ++it) + for (TQPtrListIterator<Game> it(m_games); (game = *it) ; ++it) if (game->id() == gameId) return game; @@ -191,11 +191,11 @@ void AtlanticCore::removeGame(Game *game) void AtlanticCore::emitGames() { - for (QPtrListIterator<Game> it(m_games); (*it) ; ++it) + for (TQPtrListIterator<Game> it(m_games); (*it) ; ++it) emit createGUI( (*it) ); } -QPtrList<Estate> AtlanticCore::estates() +TQPtrList<Estate> AtlanticCore::estates() { return m_estates; } @@ -210,7 +210,7 @@ Estate *AtlanticCore::newEstate(int estateId) Estate *AtlanticCore::findEstate(int estateId) { Estate *estate = 0; - for (QPtrListIterator<Estate> it(m_estates); (estate = *it) ; ++it) + for (TQPtrListIterator<Estate> it(m_estates); (estate = *it) ; ++it) if (estate->id() == estateId) return estate; @@ -221,7 +221,7 @@ Estate *AtlanticCore::estateAfter(Estate *estate) { Estate *eFirst = 0, *eTmp = 0; bool useNext = false; - for (QPtrListIterator<Estate> it(m_estates); (eTmp = *it) ; ++it) + for (TQPtrListIterator<Estate> it(m_estates); (eTmp = *it) ; ++it) { if (!eFirst) eFirst = eTmp; @@ -233,7 +233,7 @@ Estate *AtlanticCore::estateAfter(Estate *estate) return eFirst; } -QPtrList<EstateGroup> AtlanticCore::estateGroups() +TQPtrList<EstateGroup> AtlanticCore::estateGroups() { return m_estateGroups; } @@ -248,14 +248,14 @@ EstateGroup *AtlanticCore::newEstateGroup(int groupId) EstateGroup *AtlanticCore::findEstateGroup(int groupId) { EstateGroup *estateGroup = 0; - for (QPtrListIterator<EstateGroup> it(m_estateGroups); (estateGroup = *it) ; ++it) + for (TQPtrListIterator<EstateGroup> it(m_estateGroups); (estateGroup = *it) ; ++it) if (estateGroup->id() == groupId) return estateGroup; return 0; } -QPtrList<Trade> AtlanticCore::trades() +TQPtrList<Trade> AtlanticCore::trades() { return m_trades; } @@ -273,7 +273,7 @@ Trade *AtlanticCore::newTrade(int tradeId) Trade *AtlanticCore::findTrade(int tradeId) { Trade *trade = 0; - for (QPtrListIterator<Trade> it(m_trades); (trade = *it) ; ++it) + for (TQPtrListIterator<Trade> it(m_trades); (trade = *it) ; ++it) if (trade->tradeId() == tradeId) return trade; @@ -287,7 +287,7 @@ void AtlanticCore::removeTrade(Trade *trade) trade->deleteLater(); } -QPtrList<Auction> AtlanticCore::auctions() +TQPtrList<Auction> AtlanticCore::auctions() { return m_auctions; } @@ -325,7 +325,7 @@ void AtlanticCore::removeConfigOption(ConfigOption *configOption) ConfigOption *AtlanticCore::findConfigOption(int configId) { ConfigOption *configOption = 0; - for (QPtrListIterator<ConfigOption> it(m_configOptions); (configOption = *it) ; ++it) + for (TQPtrListIterator<ConfigOption> it(m_configOptions); (configOption = *it) ; ++it) if (configOption->id() == configId) return configOption; @@ -335,35 +335,35 @@ ConfigOption *AtlanticCore::findConfigOption(int configId) void AtlanticCore::printDebug() { Player *player = 0; - for (QPtrListIterator<Player> it(m_players); (player = *it) ; ++it) + for (TQPtrListIterator<Player> it(m_players); (player = *it) ; ++it) if (player == m_playerSelf) - std::cout << "PS: " << player->name().latin1() << ", game " << QString::number(player->game() ? player->game()->id() : -1).latin1() << std::endl; + std::cout << "PS: " << player->name().latin1() << ", game " << TQString::number(player->game() ? player->game()->id() : -1).latin1() << std::endl; else - std::cout << " P: " << player->name().latin1() << ", game " << QString::number(player->game() ? player->game()->id() : -1).latin1() << std::endl; + std::cout << " P: " << player->name().latin1() << ", game " << TQString::number(player->game() ? player->game()->id() : -1).latin1() << std::endl; Game *game = 0; - for (QPtrListIterator<Game> it(m_games); (game = *it) ; ++it) - std::cout << " G: " << QString::number(game->id()).latin1() << ", master: " << QString::number(game->master() ? game->master()->id() : -1 ).latin1() << std::endl; + for (TQPtrListIterator<Game> it(m_games); (game = *it) ; ++it) + std::cout << " G: " << TQString::number(game->id()).latin1() << ", master: " << TQString::number(game->master() ? game->master()->id() : -1 ).latin1() << std::endl; Estate *estate = 0; - for (QPtrListIterator<Estate> it(m_estates); (estate = *it) ; ++it) + for (TQPtrListIterator<Estate> it(m_estates); (estate = *it) ; ++it) std::cout << " E: " << estate->name().latin1() << std::endl; EstateGroup *estateGroup = 0; - for (QPtrListIterator<EstateGroup> it(m_estateGroups); (estateGroup = *it) ; ++it) + for (TQPtrListIterator<EstateGroup> it(m_estateGroups); (estateGroup = *it) ; ++it) std::cout << "EG: " << estateGroup->name().latin1() << std::endl; Auction *auction = 0; - for (QPtrListIterator<Auction> it(m_auctions); (auction = *it) ; ++it) - std::cout << " A: " << QString::number(auction->auctionId()).latin1() << std::endl; + for (TQPtrListIterator<Auction> it(m_auctions); (auction = *it) ; ++it) + std::cout << " A: " << TQString::number(auction->auctionId()).latin1() << std::endl; Trade *trade = 0; - for (QPtrListIterator<Trade> it(m_trades); (trade = *it) ; ++it) - std::cout << " T: " << QString::number(trade->tradeId()).latin1() << std::endl; + for (TQPtrListIterator<Trade> it(m_trades); (trade = *it) ; ++it) + std::cout << " T: " << TQString::number(trade->tradeId()).latin1() << std::endl; ConfigOption *configOption = 0; - for (QPtrListIterator<ConfigOption> it(m_configOptions); (configOption = *it) ; ++it) - std::cout << "CO:" << QString::number(configOption->id()).latin1() << " " << configOption->name().latin1() << " " << configOption->value().latin1() << std::endl; + for (TQPtrListIterator<ConfigOption> it(m_configOptions); (configOption = *it) ; ++it) + std::cout << "CO:" << TQString::number(configOption->id()).latin1() << " " << configOption->name().latin1() << " " << configOption->value().latin1() << std::endl; } #include "atlantic_core.moc" diff --git a/atlantik/libatlantic/atlantic_core.h b/atlantik/libatlantic/atlantic_core.h index bca5b783..197fca91 100644 --- a/atlantik/libatlantic/atlantic_core.h +++ b/atlantik/libatlantic/atlantic_core.h @@ -17,8 +17,8 @@ #ifndef LIBATLANTIC_CORE_H #define LIBATLANTIC_CORE_H -#include <qobject.h> -#include <qptrlist.h> +#include <tqobject.h> +#include <tqptrlist.h> #include "libatlantic_export.h" @@ -35,7 +35,7 @@ class LIBATLANTIC_EXPORT AtlanticCore : public QObject Q_OBJECT public: - AtlanticCore(QObject *parent, const char *name); + AtlanticCore(TQObject *parent, const char *name); void reset(bool deletePermanents = false); @@ -44,34 +44,34 @@ public: void setPlayerSelf(Player *player); Player *playerSelf(); - QPtrList<Player> players(); + TQPtrList<Player> players(); Player *newPlayer(int playerId, const bool &playerSelf = false); Player *findPlayer(int playerId); void removePlayer(Player *player); - QPtrList<Game> games(); - Game *newGame(int gameId, const QString &type = QString::null); - Game *findGame(const QString &type); // finds game types + TQPtrList<Game> games(); + Game *newGame(int gameId, const TQString &type = TQString::null); + Game *findGame(const TQString &type); // finds game types Game *findGame(int gameId); // finds actual games Game *gameSelf(); void removeGame(Game *game); void emitGames(); - QPtrList<Estate> estates(); + TQPtrList<Estate> estates(); Estate *newEstate(int estateId); Estate *findEstate(int estateId); Estate *estateAfter(Estate *estate); - QPtrList<EstateGroup> estateGroups(); + TQPtrList<EstateGroup> estateGroups(); EstateGroup *newEstateGroup(int groupId); EstateGroup *findEstateGroup(int groupId); - QPtrList<Trade> trades(); + TQPtrList<Trade> trades(); Trade *newTrade(int tradeId); Trade *findTrade(int tradeId); void removeTrade(Trade *trade); - QPtrList<Auction> auctions(); + TQPtrList<Auction> auctions(); Auction *newAuction(int auctionId, Estate *estate); void delAuction(Auction *auction); @@ -93,13 +93,13 @@ signals: private: Player *m_playerSelf; - QPtrList<Player> m_players; - QPtrList<Game> m_games; - QPtrList<Estate> m_estates; - QPtrList<EstateGroup> m_estateGroups; - QPtrList<Trade> m_trades; - QPtrList<Auction> m_auctions; - QPtrList<ConfigOption> m_configOptions; + TQPtrList<Player> m_players; + TQPtrList<Game> m_games; + TQPtrList<Estate> m_estates; + TQPtrList<EstateGroup> m_estateGroups; + TQPtrList<Trade> m_trades; + TQPtrList<Auction> m_auctions; + TQPtrList<ConfigOption> m_configOptions; }; #endif diff --git a/atlantik/libatlantic/auction.cpp b/atlantik/libatlantic/auction.cpp index 70734c4e..2e09a685 100644 --- a/atlantik/libatlantic/auction.cpp +++ b/atlantik/libatlantic/auction.cpp @@ -19,7 +19,7 @@ #include "player.h" #include "estate.h" -Auction::Auction(int auctionId, Estate *estate) : QObject() +Auction::Auction(int auctionId, Estate *estate) : TQObject() { m_auctionId = auctionId; m_estate = estate; diff --git a/atlantik/libatlantic/auction.h b/atlantik/libatlantic/auction.h index cc44cce5..80633bc8 100644 --- a/atlantik/libatlantic/auction.h +++ b/atlantik/libatlantic/auction.h @@ -17,7 +17,7 @@ #ifndef LIBATLANTIC_AUCTION_H #define LIBATLANTIC_AUCTION_H -#include <qobject.h> +#include <tqobject.h> #include "libatlantic_export.h" diff --git a/atlantik/libatlantic/configoption.cpp b/atlantik/libatlantic/configoption.cpp index 00a8eb12..1d1dcc62 100644 --- a/atlantik/libatlantic/configoption.cpp +++ b/atlantik/libatlantic/configoption.cpp @@ -16,7 +16,7 @@ #include "configoption.h" -ConfigOption::ConfigOption(int configId) : QObject() +ConfigOption::ConfigOption(int configId) : TQObject() { m_id = configId; m_name = ""; @@ -31,7 +31,7 @@ int ConfigOption::id() return m_id; } -void ConfigOption::setName(const QString &name) +void ConfigOption::setName(const TQString &name) { if (m_name != name) { @@ -40,12 +40,12 @@ void ConfigOption::setName(const QString &name) } } -QString ConfigOption::name() const +TQString ConfigOption::name() const { return m_name; } -void ConfigOption::setDescription(const QString &description) +void ConfigOption::setDescription(const TQString &description) { if (m_description != description) { @@ -54,7 +54,7 @@ void ConfigOption::setDescription(const QString &description) } } -QString ConfigOption::description() const +TQString ConfigOption::description() const { return m_description; } @@ -73,7 +73,7 @@ bool ConfigOption::edit() return m_edit; } -void ConfigOption::setValue(const QString &value) +void ConfigOption::setValue(const TQString &value) { if (m_value != value) { @@ -82,7 +82,7 @@ void ConfigOption::setValue(const QString &value) } } -QString ConfigOption::value() const +TQString ConfigOption::value() const { return m_value; } diff --git a/atlantik/libatlantic/configoption.h b/atlantik/libatlantic/configoption.h index a29d6b45..823938c8 100644 --- a/atlantik/libatlantic/configoption.h +++ b/atlantik/libatlantic/configoption.h @@ -17,8 +17,8 @@ #ifndef LIBATLANTIC_CONFIGOPTION_H #define LIBATLANTIC_CONFIGOPTION_H -#include <qobject.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstring.h> #include "libatlantic_export.h" @@ -29,14 +29,14 @@ Q_OBJECT public: ConfigOption(int configId); int id(); - void setName(const QString &name); - QString name() const; - void setDescription(const QString &description); - QString description() const; + void setName(const TQString &name); + TQString name() const; + void setDescription(const TQString &description); + TQString description() const; void setEdit(bool edit); bool edit(); - void setValue(const QString &value); - QString value() const; + void setValue(const TQString &value); + TQString value() const; void update(bool force = false); signals: @@ -45,7 +45,7 @@ signals: private: int m_id; bool m_changed, m_edit; - QString m_name, m_description, m_value; + TQString m_name, m_description, m_value; }; #endif diff --git a/atlantik/libatlantic/estate.cpp b/atlantik/libatlantic/estate.cpp index eef69280..c9b40e73 100644 --- a/atlantik/libatlantic/estate.cpp +++ b/atlantik/libatlantic/estate.cpp @@ -20,18 +20,18 @@ #include "estate.moc" #include "player.h" -Estate::Estate(int estateId) : QObject() +Estate::Estate(int estateId) : TQObject() { m_id = estateId; - m_name = QString::null; + m_name = TQString::null; m_owner = 0; m_houses = 0; m_price = 0; m_money = 0; m_estateGroup = 0; m_changed = m_canBeOwned = m_canBuyHouses = m_canSellHouses = m_isMortgaged = m_canToggleMortgage = false; - m_bgColor = QColor(); - m_color = QColor(); + m_bgColor = TQColor(); + m_color = TQColor(); } void Estate::setEstateGroup(EstateGroup *estateGroup) @@ -71,7 +71,7 @@ void Estate::setHouses(unsigned int houses) m_changed = true; } -void Estate::setName(QString name) +void Estate::setName(TQString name) { if (m_name != name) { @@ -80,12 +80,12 @@ void Estate::setName(QString name) } } -QString Estate::name() const +TQString Estate::name() const { return m_name; } -void Estate::setColor(QColor color) +void Estate::setColor(TQColor color) { if (m_color != color) { @@ -94,7 +94,7 @@ void Estate::setColor(QColor color) } } -void Estate::setBgColor(QColor color) +void Estate::setBgColor(TQColor color) { if (m_bgColor != color) { diff --git a/atlantik/libatlantic/estate.h b/atlantik/libatlantic/estate.h index b6b768a5..cbbd51e1 100644 --- a/atlantik/libatlantic/estate.h +++ b/atlantik/libatlantic/estate.h @@ -17,8 +17,8 @@ #ifndef LIBATLANTIC_ESTATE_H #define LIBATLANTIC_ESTATE_H -#include <qobject.h> -#include <qcolor.h> +#include <tqobject.h> +#include <tqcolor.h> #include "libatlantic_export.h" @@ -32,8 +32,8 @@ Q_OBJECT public: Estate(int estateId); int id() { return m_id; } - void setName(QString name); - QString name() const; + void setName(TQString name); + TQString name() const; void setEstateGroup(EstateGroup *estateGroup); EstateGroup *estateGroup() { return m_estateGroup; } void setOwner(Player *player); @@ -60,10 +60,10 @@ public: unsigned int mortgagePrice() const { return m_mortgagePrice; } void setUnmortgagePrice(const unsigned int unmortgagePrice) { m_unmortgagePrice = unmortgagePrice; } unsigned int unmortgagePrice() const { return m_unmortgagePrice; } - void setColor(QColor color); - QColor color() const { return m_color; } - void setBgColor(QColor color); - QColor bgColor() const { return m_bgColor; } + void setColor(TQColor color); + TQColor color() const { return m_color; } + void setBgColor(TQColor color); + TQColor bgColor() const { return m_bgColor; } void setPrice(const unsigned int price) { m_price = price; } unsigned int price() const { return m_price; } void setMoney(int money); @@ -83,13 +83,13 @@ protected: int m_id; private: - QString m_name; + TQString m_name; Player *m_owner; EstateGroup *m_estateGroup; unsigned int m_houses, m_price, m_housePrice, m_houseSellPrice, m_mortgagePrice, m_unmortgagePrice; int m_money; bool m_canBeOwned, m_canBuyHouses, m_canSellHouses, m_isMortgaged, m_canToggleMortgage; - QColor m_bgColor, m_color; + TQColor m_bgColor, m_color; }; #endif diff --git a/atlantik/libatlantic/estategroup.cpp b/atlantik/libatlantic/estategroup.cpp index e0148afc..ef96b988 100644 --- a/atlantik/libatlantic/estategroup.cpp +++ b/atlantik/libatlantic/estategroup.cpp @@ -17,12 +17,12 @@ #include "estategroup.h" #include "estategroup.moc" -EstateGroup::EstateGroup(const int id) : QObject() +EstateGroup::EstateGroup(const int id) : TQObject() { m_id = id; } -void EstateGroup::setName(const QString name) +void EstateGroup::setName(const TQString name) { if (m_name != name) { diff --git a/atlantik/libatlantic/estategroup.h b/atlantik/libatlantic/estategroup.h index 3e08a9ce..9e0399bc 100644 --- a/atlantik/libatlantic/estategroup.h +++ b/atlantik/libatlantic/estategroup.h @@ -17,7 +17,7 @@ #ifndef LIBATLANTIC_ESTATEGROUP_H #define LIBATLANTIC_ESTATEGROUP_H -#include <qobject.h> +#include <tqobject.h> #include "libatlantic_export.h" @@ -28,8 +28,8 @@ Q_OBJECT public: EstateGroup(const int id); int id() { return m_id; } - void setName(const QString name); - QString name() const { return m_name; } + void setName(const TQString name); + TQString name() const { return m_name; } void update(bool force = false); signals: @@ -38,7 +38,7 @@ signals: private: int m_id; bool m_changed; - QString m_name; + TQString m_name; }; #endif diff --git a/atlantik/libatlantic/game.cpp b/atlantik/libatlantic/game.cpp index 1f4eb244..308a827d 100644 --- a/atlantik/libatlantic/game.cpp +++ b/atlantik/libatlantic/game.cpp @@ -14,15 +14,15 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qstring.h> +#include <tqstring.h> #include "game.h" -Game::Game(int gameId) : QObject() +Game::Game(int gameId) : TQObject() { m_id = gameId; - m_description = QString::null; - m_type = QString::null; + m_description = TQString::null; + m_type = TQString::null; m_players = 0; m_master = 0; @@ -48,7 +48,7 @@ bool Game::canBeJoined() const return m_canBeJoined; } -void Game::setDescription(const QString &description) +void Game::setDescription(const TQString &description) { if (m_description != description) { @@ -57,12 +57,12 @@ void Game::setDescription(const QString &description) } } -QString Game::description() const +TQString Game::description() const { return m_description; } -void Game::setName(const QString &name) +void Game::setName(const TQString &name) { if (m_name != name) { @@ -71,12 +71,12 @@ void Game::setName(const QString &name) } } -QString Game::name() const +TQString Game::name() const { return m_name; } -void Game::setType(const QString &type) +void Game::setType(const TQString &type) { if (m_type != type) { @@ -85,7 +85,7 @@ void Game::setType(const QString &type) } } -QString Game::type() const +TQString Game::type() const { return m_type; } diff --git a/atlantik/libatlantic/game.h b/atlantik/libatlantic/game.h index 8eaa85f6..7194dfd3 100644 --- a/atlantik/libatlantic/game.h +++ b/atlantik/libatlantic/game.h @@ -17,7 +17,7 @@ #ifndef LIBATLANTIC_GAME_H #define LIBATLANTIC_GAME_H -#include <qobject.h> +#include <tqobject.h> #include "libatlantic_export.h" @@ -35,12 +35,12 @@ public: int id() const; void setCanBeJoined(const bool &canBeJoined); bool canBeJoined() const; - void setDescription(const QString &description); - QString description() const; - void setName(const QString &name); - QString name() const; - void setType(const QString &type); - QString type() const; + void setDescription(const TQString &description); + TQString description() const; + void setName(const TQString &name); + TQString name() const; + void setType(const TQString &type); + TQString type() const; int players(); void setPlayers(int players); Player *master(); @@ -54,7 +54,7 @@ signals: private: bool m_changed; bool m_canBeJoined; - QString m_description, m_name, m_type; + TQString m_description, m_name, m_type; int m_id, m_players; Player *m_master; }; diff --git a/atlantik/libatlantic/player.cpp b/atlantik/libatlantic/player.cpp index ab5e9268..e944e970 100644 --- a/atlantik/libatlantic/player.cpp +++ b/atlantik/libatlantic/player.cpp @@ -18,7 +18,7 @@ #include "player.moc" #include "estate.h" -Player::Player(int playerId) : QObject() +Player::Player(int playerId) : TQObject() { m_id = playerId; m_game = 0; @@ -137,7 +137,7 @@ void Player::setInJail(const bool inJail) } } -void Player::setName(const QString _n) +void Player::setName(const TQString _n) { if (m_name != _n) { @@ -146,7 +146,7 @@ void Player::setName(const QString _n) } } -void Player::setHost(const QString &host) +void Player::setHost(const TQString &host) { if (m_host != host) { @@ -155,7 +155,7 @@ void Player::setHost(const QString &host) } } -void Player::setImage(const QString &image) +void Player::setImage(const TQString &image) { if (m_image != image) { diff --git a/atlantik/libatlantic/player.h b/atlantik/libatlantic/player.h index 571276ef..f36b1e8a 100644 --- a/atlantik/libatlantic/player.h +++ b/atlantik/libatlantic/player.h @@ -17,8 +17,8 @@ #ifndef LIBATLANTIC_PLAYER_H #define LIBATLANTIC_PLAYER_H -#include <qobject.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstring.h> #include "libatlantic_export.h" @@ -57,12 +57,12 @@ public: bool canUseCard() const { return m_canUseCard; } void setInJail(const bool inJail); bool inJail() const { return m_inJail; } - void setName(const QString _n); - QString name() const { return m_name; } - void setHost(const QString &host); - QString host() const { return m_host; } - void setImage(const QString &image); - const QString image() const { return m_image; } + void setName(const TQString _n); + TQString name() const { return m_name; } + void setHost(const TQString &host); + TQString host() const { return m_host; } + void setImage(const TQString &image); + const TQString image() const { return m_image; } void setMoney(unsigned int _m); unsigned int money() const { return m_money; } void update(bool force = false); @@ -76,7 +76,7 @@ private: bool m_changed, m_isSelf; bool m_bankrupt, m_hasDebt, m_hasTurn, m_canRoll, m_canBuy, m_canAuction, m_canUseCard, m_inJail; unsigned int m_money; - QString m_name, m_host, m_image; + TQString m_name, m_host, m_image; Game *m_game; Estate *m_location, *m_destination; }; diff --git a/atlantik/libatlantic/trade.cpp b/atlantik/libatlantic/trade.cpp index b516dc70..7bd638c9 100644 --- a/atlantik/libatlantic/trade.cpp +++ b/atlantik/libatlantic/trade.cpp @@ -49,7 +49,7 @@ void Trade::removePlayer(Player *player) unsigned int Trade::count( bool acceptOnly ) { unsigned int count = 0; - for (QMapIterator<Player *, bool> it = m_playerAcceptMap.begin() ; it != m_playerAcceptMap.end() ; ++it) + for (TQMapIterator<Player *, bool> it = m_playerAcceptMap.begin() ; it != m_playerAcceptMap.end() ; ++it) if ( !acceptOnly || it.data() ) count++; return count; @@ -59,7 +59,7 @@ void Trade::updateEstate(Estate *estate, Player *to) { TradeEstate *t=0; - for (QPtrListIterator<TradeItem> i(mTradeItems); *i; ++i) + for (TQPtrListIterator<TradeItem> i(mTradeItems); *i; ++i) { t=dynamic_cast<TradeEstate*>(*i); @@ -100,7 +100,7 @@ void Trade::updateMoney(unsigned int money, Player *from, Player *to) { TradeMoney *t=0; - for (QPtrListIterator<TradeItem> i(mTradeItems); *i; ++i) + for (TQPtrListIterator<TradeItem> i(mTradeItems); *i; ++i) { t=dynamic_cast<TradeMoney*>(*i); @@ -163,8 +163,8 @@ void Trade::update(bool force) TradeItem::TradeItem(Trade *trade, Player *from, Player *to) : mFrom(from), mTo(to), mTrade(trade) { - connect(from, SIGNAL(changed(Player *)), this, SLOT(playerChanged())); - connect(to, SIGNAL(changed(Player *)), this, SLOT(playerChanged())); + connect(from, TQT_SIGNAL(changed(Player *)), this, TQT_SLOT(playerChanged())); + connect(to, TQT_SIGNAL(changed(Player *)), this, TQT_SLOT(playerChanged())); } void TradeItem::playerChanged() @@ -176,7 +176,7 @@ TradeEstate::TradeEstate(Estate *estate, Trade *trade, Player *to) : TradeItem(t { } -QString TradeEstate::text() const +TQString TradeEstate::text() const { return mEstate->name(); } @@ -194,7 +194,7 @@ void TradeMoney::setMoney(unsigned int money) } } -QString TradeMoney::text() const +TQString TradeMoney::text() const { - return QString("$%1").arg(m_money); + return TQString("$%1").arg(m_money); } diff --git a/atlantik/libatlantic/trade.h b/atlantik/libatlantic/trade.h index 5d8f3c01..0d168f0a 100644 --- a/atlantik/libatlantic/trade.h +++ b/atlantik/libatlantic/trade.h @@ -17,9 +17,9 @@ #ifndef LIBATLANTIC_TRADE_H #define LIBATLANTIC_TRADE_H -#include <qobject.h> -#include <qstring.h> -#include <qptrlist.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqptrlist.h> #include "libatlantic_export.h" #include "player.h" @@ -44,7 +44,7 @@ public: /** * how to visualize this **/ - virtual QString text() const=0; + virtual TQString text() const=0; signals: void changed(TradeItem *); @@ -66,7 +66,7 @@ public: Estate *estate() { return mEstate; } - virtual QString text() const; + virtual TQString text() const; signals: void updateEstate(Trade *trade, Estate *estate, Player *player); @@ -86,7 +86,7 @@ public: unsigned int money() const { return m_money; } void setMoney(unsigned int money); - virtual QString text() const; + virtual TQString text() const; signals: void changed(TradeItem *tradeItem); @@ -143,10 +143,10 @@ private: bool m_changed, m_rejected; int m_tradeId, m_revision; - QPtrList<Player> mPlayers; - QMap<Player *, bool> m_playerAcceptMap; + TQPtrList<Player> mPlayers; + TQMap<Player *, bool> m_playerAcceptMap; - QPtrList<TradeItem> mTradeItems; + TQPtrList<TradeItem> mTradeItems; }; #endif diff --git a/atlantik/libatlantikclient/atlantik_network.cpp b/atlantik/libatlantikclient/atlantik_network.cpp index 7b1926d3..51347f84 100644 --- a/atlantik/libatlantikclient/atlantik_network.cpp +++ b/atlantik/libatlantikclient/atlantik_network.cpp @@ -16,10 +16,10 @@ #include <iostream> -#include <qdom.h> -#include <qtextcodec.h> -#include <qtextstream.h> -#include <qtimer.h> +#include <tqdom.h> +#include <tqtextcodec.h> +#include <tqtextstream.h> +#include <tqtimer.h> #include <kdebug.h> #include <klocale.h> @@ -38,18 +38,18 @@ AtlantikNetwork::AtlantikNetwork(AtlanticCore *atlanticCore) : KExtendedSocket(0, 0, KExtendedSocket::inputBufferedSocket) { m_atlanticCore = atlanticCore; - m_textStream = new QTextStream(this); - m_textStream->setCodec(QTextCodec::codecForName("utf8")); + m_textStream = new TQTextStream(this); + m_textStream->setCodec(TQTextCodec::codecForName("utf8")); m_playerId = -1; m_serverVersion = ""; - QObject::connect(this, SIGNAL(readyRead()), this, SLOT(slotRead())); - QObject::connect(this, SIGNAL(lookupFinished(int)), - this, SLOT(slotLookupFinished(int))); - QObject::connect(this, SIGNAL(connectionSuccess()), - this, SLOT(slotConnectionSuccess())); - QObject::connect(this, SIGNAL(connectionFailed(int)), - this, SLOT(slotConnectionFailed(int))); + TQObject::connect(this, TQT_SIGNAL(readyRead()), this, TQT_SLOT(slotRead())); + TQObject::connect(this, TQT_SIGNAL(lookupFinished(int)), + this, TQT_SLOT(slotLookupFinished(int))); + TQObject::connect(this, TQT_SIGNAL(connectionSuccess()), + this, TQT_SLOT(slotConnectionSuccess())); + TQObject::connect(this, TQT_SIGNAL(connectionFailed(int)), + this, TQT_SLOT(slotConnectionFailed(int))); } AtlantikNetwork::~AtlantikNetwork(void) @@ -77,7 +77,7 @@ void AtlantikNetwork::startGame() writeData(".gs"); } -void AtlantikNetwork::reconnect(const QString &cookie) +void AtlantikNetwork::reconnect(const TQString &cookie) { writeData(".R" + cookie); } @@ -92,85 +92,85 @@ void AtlantikNetwork::endTurn() writeData(".E"); } -void AtlantikNetwork::setName(QString name) +void AtlantikNetwork::setName(TQString name) { // Almost deprecated, will be replaced by libmonopdprotocol - writeData(QString(".n%1").arg(name)); + writeData(TQString(".n%1").arg(name)); } void AtlantikNetwork::tokenConfirmation(Estate *estate) { - writeData(QString(".t%1").arg(estate ? estate->id() : -1)); + writeData(TQString(".t%1").arg(estate ? estate->id() : -1)); } void AtlantikNetwork::estateToggleMortgage(Estate *estate) { - writeData(QString(".em%1").arg(estate ? estate->id() : -1)); + writeData(TQString(".em%1").arg(estate ? estate->id() : -1)); } void AtlantikNetwork::estateHouseBuy(Estate *estate) { - writeData(QString(".hb%1").arg(estate ? estate->id() : -1)); + writeData(TQString(".hb%1").arg(estate ? estate->id() : -1)); } void AtlantikNetwork::estateHouseSell(Estate *estate) { - writeData(QString(".hs%1").arg(estate ? estate->id() : -1)); + writeData(TQString(".hs%1").arg(estate ? estate->id() : -1)); } -void AtlantikNetwork::newGame(const QString &gameType) +void AtlantikNetwork::newGame(const TQString &gameType) { - writeData(QString(".gn%1").arg(gameType)); + writeData(TQString(".gn%1").arg(gameType)); } void AtlantikNetwork::joinGame(int gameId) { - writeData(QString(".gj%1").arg(gameId)); + writeData(TQString(".gj%1").arg(gameId)); } -void AtlantikNetwork::cmdChat(QString msg) +void AtlantikNetwork::cmdChat(TQString msg) { writeData(msg); } void AtlantikNetwork::newTrade(Player *player) { - writeData(QString(".Tn%1").arg(player ? player->id() : -1)); + writeData(TQString(".Tn%1").arg(player ? player->id() : -1)); } void AtlantikNetwork::kickPlayer(Player *player) { - writeData(QString(".gk%1").arg(player ? player->id() : -1)); + writeData(TQString(".gk%1").arg(player ? player->id() : -1)); } void AtlantikNetwork::tradeUpdateEstate(Trade *trade, Estate *estate, Player *player) { - writeData(QString(".Te%1:%2:%3").arg(trade ? trade->tradeId() : -1).arg(estate ? estate->id() : -1).arg(player ? player->id() : -1)); + writeData(TQString(".Te%1:%2:%3").arg(trade ? trade->tradeId() : -1).arg(estate ? estate->id() : -1).arg(player ? player->id() : -1)); } void AtlantikNetwork::tradeUpdateMoney(Trade *trade, unsigned int money, Player *pFrom, Player *pTo) { - writeData(QString(".Tm%1:%2:%3:%4").arg(trade ? trade->tradeId() : -1).arg(pFrom ? pFrom->id() : -1).arg(pTo ? pTo->id() : -1).arg(money)); + writeData(TQString(".Tm%1:%2:%3:%4").arg(trade ? trade->tradeId() : -1).arg(pFrom ? pFrom->id() : -1).arg(pTo ? pTo->id() : -1).arg(money)); } void AtlantikNetwork::tradeReject(Trade *trade) { - writeData(QString(".Tr%1").arg(trade ? trade->tradeId() : -1)); + writeData(TQString(".Tr%1").arg(trade ? trade->tradeId() : -1)); } void AtlantikNetwork::tradeAccept(Trade *trade) { - writeData(QString(".Ta%1:%2").arg(trade ? trade->tradeId() : -1).arg(trade ? trade->revision() : -1)); + writeData(TQString(".Ta%1:%2").arg(trade ? trade->tradeId() : -1).arg(trade ? trade->revision() : -1)); } void AtlantikNetwork::auctionBid(Auction *auction, int amount) { - writeData(QString(".ab%1:%2").arg(auction ? auction->auctionId() : -1).arg(amount)); + writeData(TQString(".ab%1:%2").arg(auction ? auction->auctionId() : -1).arg(amount)); } -void AtlantikNetwork::setImage(const QString &name) +void AtlantikNetwork::setImage(const TQString &name) { - writeData(QString(".pi%1").arg(name)); + writeData(TQString(".pi%1").arg(name)); } void AtlantikNetwork::jailPay() @@ -188,12 +188,12 @@ void AtlantikNetwork::jailCard() writeData(".jc"); } -void AtlantikNetwork::changeOption(int configId, const QString &value) +void AtlantikNetwork::changeOption(int configId, const TQString &value) { - writeData( QString(".gc%1:%2").arg(configId).arg(value) ); + writeData( TQString(".gc%1:%2").arg(configId).arg(value) ); } -void AtlantikNetwork::writeData(QString msg) +void AtlantikNetwork::writeData(TQString msg) { emit networkEvent(msg, "1rightarrow"); msg.append("\n"); @@ -212,7 +212,7 @@ void AtlantikNetwork::slotRead() { processMsg(m_textStream->readLine()); // There might be more data - QTimer::singleShot(0, this, SLOT(slotRead())); + TQTimer::singleShot(0, this, TQT_SLOT(slotRead())); } else { @@ -223,36 +223,36 @@ void AtlantikNetwork::slotRead() } } -void AtlantikNetwork::processMsg(const QString &msg) +void AtlantikNetwork::processMsg(const TQString &msg) { emit networkEvent(msg, "1leftarrow"); - QDomDocument dom; + TQDomDocument dom; dom.setContent(msg); - QDomElement e = dom.documentElement(); + TQDomElement e = dom.documentElement(); if (e.tagName() != "monopd") { // Invalid data, request full update from server writeData(".f"); return; } - QDomNode n = e.firstChild(); + TQDomNode n = e.firstChild(); processNode(n); m_atlanticCore->printDebug(); } -void AtlantikNetwork::processNode(QDomNode n) +void AtlantikNetwork::processNode(TQDomNode n) { - QDomAttr a; + TQDomAttr a; for ( ; !n.isNull() ; n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if(!e.isNull()) { if (e.tagName() == "server") { - a = e.attributeNode( QString("version") ); + a = e.attributeNode( TQString("version") ); if ( !a.isNull() ) m_serverVersion = a.value(); @@ -260,37 +260,37 @@ void AtlantikNetwork::processNode(QDomNode n) } else if (e.tagName() == "msg") { - a = e.attributeNode(QString("type")); + a = e.attributeNode(TQString("type")); if (!a.isNull()) { if (a.value() == "error") - emit msgError(e.attributeNode(QString("value")).value()); + emit msgError(e.attributeNode(TQString("value")).value()); else if (a.value() == "info") - emit msgInfo(e.attributeNode(QString("value")).value()); + emit msgInfo(e.attributeNode(TQString("value")).value()); else if (a.value() == "chat") - emit msgChat(e.attributeNode(QString("author")).value(), e.attributeNode(QString("value")).value()); + emit msgChat(e.attributeNode(TQString("author")).value(), e.attributeNode(TQString("value")).value()); } } else if (e.tagName() == "display") { int estateId = -1; - a = e.attributeNode(QString("estateid")); + a = e.attributeNode(TQString("estateid")); if (!a.isNull()) { estateId = a.value().toInt(); Estate *estate; estate = m_atlanticCore->findEstate(a.value().toInt()); - emit displayDetails(e.attributeNode(QString("text")).value(), e.attributeNode(QString("cleartext")).value().toInt(), e.attributeNode(QString("clearbuttons")).value().toInt(), estate); + emit displayDetails(e.attributeNode(TQString("text")).value(), e.attributeNode(TQString("cleartext")).value().toInt(), e.attributeNode(TQString("clearbuttons")).value().toInt(), estate); bool hasButtons = false; - for( QDomNode nButtons = n.firstChild() ; !nButtons.isNull() ; nButtons = nButtons.nextSibling() ) + for( TQDomNode nButtons = n.firstChild() ; !nButtons.isNull() ; nButtons = nButtons.nextSibling() ) { - QDomElement eButton = nButtons.toElement(); + TQDomElement eButton = nButtons.toElement(); if (!eButton.isNull() && eButton.tagName() == "button") { - emit addCommandButton(eButton.attributeNode(QString("command")).value(), eButton.attributeNode(QString("caption")).value(), eButton.attributeNode(QString("enabled")).value().toInt()); + emit addCommandButton(eButton.attributeNode(TQString("command")).value(), eButton.attributeNode(TQString("caption")).value(), eButton.attributeNode(TQString("enabled")).value().toInt()); hasButtons = true; } } @@ -301,18 +301,18 @@ void AtlantikNetwork::processNode(QDomNode n) } else if (e.tagName() == "client") { - a = e.attributeNode(QString("playerid")); + a = e.attributeNode(TQString("playerid")); if (!a.isNull()) m_playerId = a.value().toInt(); - a = e.attributeNode(QString("cookie")); + a = e.attributeNode(TQString("cookie")); if (!a.isNull()) emit clientCookie(a.value()); } else if (e.tagName() == "configupdate") { int configId = -1; - a = e.attributeNode(QString("configid")); + a = e.attributeNode(TQString("configid")); if (!a.isNull()) { configId = a.value().toInt(); @@ -320,19 +320,19 @@ void AtlantikNetwork::processNode(QDomNode n) if (!(configOption = m_atlanticCore->findConfigOption(configId))) configOption = m_atlanticCore->newConfigOption( configId ); - a = e.attributeNode(QString("name")); + a = e.attributeNode(TQString("name")); if (configOption && !a.isNull()) configOption->setName(a.value()); - a = e.attributeNode(QString("description")); + a = e.attributeNode(TQString("description")); if (configOption && !a.isNull()) configOption->setDescription(a.value()); - a = e.attributeNode(QString("edit")); + a = e.attributeNode(TQString("edit")); if (configOption && !a.isNull()) configOption->setEdit(a.value().toInt()); - a = e.attributeNode(QString("value")); + a = e.attributeNode(TQString("value")); if (configOption && !a.isNull()) configOption->setValue(a.value()); @@ -341,22 +341,22 @@ void AtlantikNetwork::processNode(QDomNode n) } int gameId = -1; - a = e.attributeNode(QString("gameid")); + a = e.attributeNode(TQString("gameid")); if (!a.isNull()) { gameId = a.value().toInt(); - for( QDomNode nOptions = n.firstChild() ; !nOptions.isNull() ; nOptions = nOptions.nextSibling() ) + for( TQDomNode nOptions = n.firstChild() ; !nOptions.isNull() ; nOptions = nOptions.nextSibling() ) { - QDomElement eOption = nOptions.toElement(); + TQDomElement eOption = nOptions.toElement(); if (!eOption.isNull() && eOption.tagName() == "option") - emit gameOption(eOption.attributeNode(QString("title")).value(), eOption.attributeNode(QString("type")).value(), eOption.attributeNode(QString("value")).value(), eOption.attributeNode(QString("edit")).value(), eOption.attributeNode(QString("command")).value()); + emit gameOption(eOption.attributeNode(TQString("title")).value(), eOption.attributeNode(TQString("type")).value(), eOption.attributeNode(TQString("value")).value(), eOption.attributeNode(TQString("edit")).value(), eOption.attributeNode(TQString("command")).value()); } emit endConfigUpdate(); } } else if (e.tagName() == "deletegame") { - a = e.attributeNode(QString("gameid")); + a = e.attributeNode(TQString("gameid")); if (!a.isNull()) { int gameId = a.value().toInt(); @@ -370,45 +370,45 @@ void AtlantikNetwork::processNode(QDomNode n) { int gameId = -1; - a = e.attributeNode(QString("gameid")); + a = e.attributeNode(TQString("gameid")); if (!a.isNull()) { gameId = a.value().toInt(); Player *playerSelf = m_atlanticCore->playerSelf(); if ( playerSelf && playerSelf->game() ) - kdDebug() << "gameupdate for " << QString::number(gameId) << " with playerSelf in game " << QString::number(playerSelf->game()->id()) << endl; + kdDebug() << "gameupdate for " << TQString::number(gameId) << " with playerSelf in game " << TQString::number(playerSelf->game()->id()) << endl; else - kdDebug() << "gameupdate for " << QString::number(gameId) << endl; + kdDebug() << "gameupdate for " << TQString::number(gameId) << endl; Game *game = 0; if (gameId == -1) { - a = e.attributeNode(QString("gametype")); + a = e.attributeNode(TQString("gametype")); if ( !a.isNull() && !(game = m_atlanticCore->findGame(a.value())) ) game = m_atlanticCore->newGame(gameId, a.value()); } else if (!(game = m_atlanticCore->findGame(gameId))) game = m_atlanticCore->newGame(gameId); - a = e.attributeNode(QString("canbejoined")); + a = e.attributeNode(TQString("canbejoined")); if (game && !a.isNull()) game->setCanBeJoined(a.value().toInt()); - a = e.attributeNode(QString("description")); + a = e.attributeNode(TQString("description")); if (game && !a.isNull()) game->setDescription(a.value()); - a = e.attributeNode(QString("name")); + a = e.attributeNode(TQString("name")); if (game && !a.isNull()) game->setName(a.value()); - a = e.attributeNode(QString("players")); + a = e.attributeNode(TQString("players")); if (game && !a.isNull()) game->setPlayers(a.value().toInt()); - a = e.attributeNode(QString("master")); + a = e.attributeNode(TQString("master")); if (game && !a.isNull()) { // Ensure setMaster succeeds by creating player if necessary @@ -418,7 +418,7 @@ void AtlantikNetwork::processNode(QDomNode n) game->setMaster( player ); } - QString status = e.attributeNode(QString("status")).value(); + TQString status = e.attributeNode(TQString("status")).value(); if ( m_serverVersion.left(4) == "0.9." || (playerSelf && playerSelf->game() == game) ) { if (status == "config") @@ -437,7 +437,7 @@ void AtlantikNetwork::processNode(QDomNode n) } else if (e.tagName() == "deleteplayer") { - a = e.attributeNode(QString("playerid")); + a = e.attributeNode(TQString("playerid")); if (!a.isNull()) { int playerId = a.value().toInt(); @@ -451,7 +451,7 @@ void AtlantikNetwork::processNode(QDomNode n) { int playerId = -1; - a = e.attributeNode(QString("playerid")); + a = e.attributeNode(TQString("playerid")); if (!a.isNull()) { playerId = a.value().toInt(); @@ -461,12 +461,12 @@ void AtlantikNetwork::processNode(QDomNode n) player = m_atlanticCore->newPlayer( playerId, (m_playerId == playerId) ); // Update player name - a = e.attributeNode(QString("name")); + a = e.attributeNode(TQString("name")); if (player && !a.isNull()) player->setName(a.value()); // Update player game - a = e.attributeNode(QString("game")); + a = e.attributeNode(TQString("game")); if (player && !a.isNull()) { int gameId = a.value().toInt(); @@ -483,54 +483,54 @@ void AtlantikNetwork::processNode(QDomNode n) } // Update player host - a = e.attributeNode(QString("host")); + a = e.attributeNode(TQString("host")); if (player && !a.isNull()) player->setHost(a.value()); // Update player image/token - a = e.attributeNode(QString("image")); + a = e.attributeNode(TQString("image")); if (player && !a.isNull()) player->setImage(a.value()); // Update player money - a = e.attributeNode(QString("money")); + a = e.attributeNode(TQString("money")); if (player && !a.isNull()) player->setMoney(a.value().toInt()); - a = e.attributeNode(QString("bankrupt")); + a = e.attributeNode(TQString("bankrupt")); if (player && !a.isNull()) player->setBankrupt(a.value().toInt()); - a = e.attributeNode(QString("hasdebt")); + a = e.attributeNode(TQString("hasdebt")); if (player && !a.isNull()) player->setHasDebt(a.value().toInt()); - a = e.attributeNode(QString("hasturn")); + a = e.attributeNode(TQString("hasturn")); if (player && !a.isNull()) player->setHasTurn(a.value().toInt()); // Update whether player can roll - a = e.attributeNode(QString("can_roll")); + a = e.attributeNode(TQString("can_roll")); if (player && !a.isNull()) player->setCanRoll(a.value().toInt()); // Update whether player can buy - a = e.attributeNode(QString("can_buyestate")); + a = e.attributeNode(TQString("can_buyestate")); if (player && !a.isNull()) player->setCanBuy(a.value().toInt()); // Update whether player can auction - a = e.attributeNode(QString("canauction")); + a = e.attributeNode(TQString("canauction")); if (player && !a.isNull()) player->setCanAuction(a.value().toInt()); // Update whether player can use a card - a = e.attributeNode(QString("canusecard")); + a = e.attributeNode(TQString("canusecard")); if (player && !a.isNull()) player->setCanUseCard(a.value().toInt()); // Update whether player is jailed - a = e.attributeNode(QString("jailed")); + a = e.attributeNode(TQString("jailed")); if (player && !a.isNull()) { player->setInJail(a.value().toInt()); @@ -538,7 +538,7 @@ void AtlantikNetwork::processNode(QDomNode n) } // Update player location - a = e.attributeNode(QString("location")); + a = e.attributeNode(TQString("location")); if (!a.isNull()) { m_playerLocationMap[player] = a.value().toInt(); @@ -547,7 +547,7 @@ void AtlantikNetwork::processNode(QDomNode n) Estate *estate = m_atlanticCore->findEstate(a.value().toInt()); - a = e.attributeNode(QString("directmove")); + a = e.attributeNode(TQString("directmove")); if (!a.isNull()) directMove = a.value().toInt(); @@ -566,7 +566,7 @@ void AtlantikNetwork::processNode(QDomNode n) } else if (e.tagName() == "estategroupupdate") { - a = e.attributeNode(QString("groupid")); + a = e.attributeNode(TQString("groupid")); if (!a.isNull()) { int groupId = a.value().toInt(); @@ -581,7 +581,7 @@ void AtlantikNetwork::processNode(QDomNode n) b_newEstateGroup = true; } - a = e.attributeNode(QString("name")); + a = e.attributeNode(TQString("name")); if (estateGroup && !a.isNull()) estateGroup->setName(a.value()); @@ -599,7 +599,7 @@ void AtlantikNetwork::processNode(QDomNode n) { int estateId = -1; - a = e.attributeNode(QString("estateid")); + a = e.attributeNode(TQString("estateid")); if (!a.isNull()) { estateId = a.value().toInt(); @@ -614,45 +614,45 @@ void AtlantikNetwork::processNode(QDomNode n) estate = m_atlanticCore->newEstate(estateId); b_newEstate = true; - QObject::connect(estate, SIGNAL(estateToggleMortgage(Estate *)), this, SLOT(estateToggleMortgage(Estate *))); - QObject::connect(estate, SIGNAL(estateHouseBuy(Estate *)), this, SLOT(estateHouseBuy(Estate *))); - QObject::connect(estate, SIGNAL(estateHouseSell(Estate *)), this, SLOT(estateHouseSell(Estate *))); - QObject::connect(estate, SIGNAL(newTrade(Player *)), this, SLOT(newTrade(Player *))); + TQObject::connect(estate, TQT_SIGNAL(estateToggleMortgage(Estate *)), this, TQT_SLOT(estateToggleMortgage(Estate *))); + TQObject::connect(estate, TQT_SIGNAL(estateHouseBuy(Estate *)), this, TQT_SLOT(estateHouseBuy(Estate *))); + TQObject::connect(estate, TQT_SIGNAL(estateHouseSell(Estate *)), this, TQT_SLOT(estateHouseSell(Estate *))); + TQObject::connect(estate, TQT_SIGNAL(newTrade(Player *)), this, TQT_SLOT(newTrade(Player *))); // Players without estate should get one Player *player = 0; - QPtrList<Player> playerList = m_atlanticCore->players(); - for (QPtrListIterator<Player> it(playerList); (player = *it) ; ++it) + TQPtrList<Player> playerList = m_atlanticCore->players(); + for (TQPtrListIterator<Player> it(playerList); (player = *it) ; ++it) if (m_playerLocationMap[player] == estate->id()) player->setLocation(estate); } - a = e.attributeNode(QString("name")); + a = e.attributeNode(TQString("name")); if (estate && !a.isNull()) estate->setName(a.value()); - a = e.attributeNode(QString("color")); + a = e.attributeNode(TQString("color")); if (estate && !a.isNull() && !a.value().isEmpty()) estate->setColor(a.value()); - a = e.attributeNode(QString("bgcolor")); + a = e.attributeNode(TQString("bgcolor")); if (estate && !a.isNull()) estate->setBgColor(a.value()); - a = e.attributeNode(QString("owner")); + a = e.attributeNode(TQString("owner")); Player *player = m_atlanticCore->findPlayer(a.value().toInt()); if (estate && !a.isNull()) estate->setOwner(player); - a = e.attributeNode(QString("houses")); + a = e.attributeNode(TQString("houses")); if (estate && !a.isNull()) estate->setHouses(a.value().toInt()); - a = e.attributeNode(QString("mortgaged")); + a = e.attributeNode(TQString("mortgaged")); if (estate && !a.isNull()) estate->setIsMortgaged(a.value().toInt()); - a = e.attributeNode(QString("group")); + a = e.attributeNode(TQString("group")); if (!a.isNull()) { EstateGroup *estateGroup = m_atlanticCore->findEstateGroup(a.value().toInt()); @@ -660,43 +660,43 @@ void AtlantikNetwork::processNode(QDomNode n) estate->setEstateGroup(estateGroup); } - a = e.attributeNode(QString("can_toggle_mortgage")); + a = e.attributeNode(TQString("can_toggle_mortgage")); if (estate && !a.isNull()) estate->setCanToggleMortgage(a.value().toInt()); - a = e.attributeNode(QString("can_be_owned")); + a = e.attributeNode(TQString("can_be_owned")); if (estate && !a.isNull()) estate->setCanBeOwned(a.value().toInt()); - a = e.attributeNode(QString("can_buy_houses")); + a = e.attributeNode(TQString("can_buy_houses")); if (estate && !a.isNull()) estate->setCanBuyHouses(a.value().toInt()); - a = e.attributeNode(QString("can_sell_houses")); + a = e.attributeNode(TQString("can_sell_houses")); if (estate && !a.isNull()) estate->setCanSellHouses(a.value().toInt()); - a = e.attributeNode(QString("price")); + a = e.attributeNode(TQString("price")); if (estate && !a.isNull()) estate->setPrice(a.value().toInt()); - a = e.attributeNode(QString("houseprice")); + a = e.attributeNode(TQString("houseprice")); if (estate && !a.isNull()) estate->setHousePrice(a.value().toInt()); - a = e.attributeNode(QString("sellhouseprice")); + a = e.attributeNode(TQString("sellhouseprice")); if (estate && !a.isNull()) estate->setHouseSellPrice(a.value().toInt()); - a = e.attributeNode(QString("mortgageprice")); + a = e.attributeNode(TQString("mortgageprice")); if (estate && !a.isNull()) estate->setMortgagePrice(a.value().toInt()); - a = e.attributeNode(QString("unmortgageprice")); + a = e.attributeNode(TQString("unmortgageprice")); if (estate && !a.isNull()) estate->setUnmortgagePrice(a.value().toInt()); - a = e.attributeNode(QString("money")); + a = e.attributeNode(TQString("money")); if (estate && !a.isNull()) estate->setMoney(a.value().toInt()); @@ -712,7 +712,7 @@ void AtlantikNetwork::processNode(QDomNode n) } else if (e.tagName() == "tradeupdate") { - a = e.attributeNode(QString("tradeid")); + a = e.attributeNode(TQString("tradeid")); if (!a.isNull()) { int tradeId = a.value().toInt(); @@ -723,35 +723,35 @@ void AtlantikNetwork::processNode(QDomNode n) // Create trade object trade = m_atlanticCore->newTrade(tradeId); - QObject::connect(trade, SIGNAL(updateEstate(Trade *, Estate *, Player *)), this, SLOT(tradeUpdateEstate(Trade *, Estate *, Player *))); - QObject::connect(trade, SIGNAL(updateMoney(Trade *, unsigned int, Player *, Player *)), this, SLOT(tradeUpdateMoney(Trade *, unsigned int, Player *, Player *))); - QObject::connect(trade, SIGNAL(reject(Trade *)), this, SLOT(tradeReject(Trade *))); - QObject::connect(trade, SIGNAL(accept(Trade *)), this, SLOT(tradeAccept(Trade *))); + TQObject::connect(trade, TQT_SIGNAL(updateEstate(Trade *, Estate *, Player *)), this, TQT_SLOT(tradeUpdateEstate(Trade *, Estate *, Player *))); + TQObject::connect(trade, TQT_SIGNAL(updateMoney(Trade *, unsigned int, Player *, Player *)), this, TQT_SLOT(tradeUpdateMoney(Trade *, unsigned int, Player *, Player *))); + TQObject::connect(trade, TQT_SIGNAL(reject(Trade *)), this, TQT_SLOT(tradeReject(Trade *))); + TQObject::connect(trade, TQT_SIGNAL(accept(Trade *)), this, TQT_SLOT(tradeAccept(Trade *))); } - a = e.attributeNode(QString("revision")); + a = e.attributeNode(TQString("revision")); if (trade && !a.isNull()) trade->setRevision(a.value().toInt()); - QString type = e.attributeNode(QString("type")).value(); + TQString type = e.attributeNode(TQString("type")).value(); if (type=="new") { // TODO: trade->setActor - // Player *player = m_atlanticCore->findPlayer(e.attributeNode(QString("actor")).value().toInt()); + // Player *player = m_atlanticCore->findPlayer(e.attributeNode(TQString("actor")).value().toInt()); // if (trade && player) // trade->setActor(player); - QDomNode n_player = n.firstChild(); + TQDomNode n_player = n.firstChild(); while(!n_player.isNull()) { - QDomElement e_player = n_player.toElement(); + TQDomElement e_player = n_player.toElement(); if (!e_player.isNull() && e_player.tagName() == "tradeplayer") { - Player *player = m_atlanticCore->findPlayer(e_player.attributeNode(QString("playerid")).value().toInt()); + Player *player = m_atlanticCore->findPlayer(e_player.attributeNode(TQString("playerid")).value().toInt()); if (trade && player) { trade->addPlayer(player); - QObject::connect(m_atlanticCore, SIGNAL(removePlayer(Player *)), trade, SLOT(removePlayer(Player *))); + TQObject::connect(m_atlanticCore, TQT_SIGNAL(removePlayer(Player *)), trade, TQT_SLOT(removePlayer(Player *))); } } n_player = n_player.nextSibling(); @@ -766,7 +766,7 @@ void AtlantikNetwork::processNode(QDomNode n) } else if (type=="rejected") { - Player *player = m_atlanticCore->findPlayer(e.attributeNode(QString("actor")).value().toInt()); + Player *player = m_atlanticCore->findPlayer(e.attributeNode(TQString("actor")).value().toInt()); if (trade) trade->reject(player); if ( player && player == m_atlanticCore->playerSelf() ) @@ -779,31 +779,31 @@ void AtlantikNetwork::processNode(QDomNode n) { // No type specified, edit is implied. - QDomNode n_child = n.firstChild(); + TQDomNode n_child = n.firstChild(); while(!n_child.isNull()) { - QDomElement e_child = n_child.toElement(); + TQDomElement e_child = n_child.toElement(); if (!e_child.isNull()) { if (e_child.tagName() == "tradeplayer") { - a = e_child.attributeNode(QString("playerid")); + a = e_child.attributeNode(TQString("playerid")); if (!a.isNull()) { Player *player = m_atlanticCore->findPlayer(a.value().toInt()); - a = e_child.attributeNode(QString("accept")); + a = e_child.attributeNode(TQString("accept")); if (trade && player && !a.isNull()) trade->updateAccept(player, (bool)(a.value().toInt())); } } else if (e_child.tagName() == "tradeestate") { - a = e_child.attributeNode(QString("estateid")); + a = e_child.attributeNode(TQString("estateid")); if (!a.isNull()) { Estate *estate = m_atlanticCore->findEstate(a.value().toInt()); - a = e_child.attributeNode(QString("targetplayer")); + a = e_child.attributeNode(TQString("targetplayer")); if (!a.isNull()) { Player *player = m_atlanticCore->findPlayer(a.value().toInt()); @@ -817,15 +817,15 @@ void AtlantikNetwork::processNode(QDomNode n) { Player *pFrom = 0, *pTo = 0; - a = e_child.attributeNode(QString("playerfrom")); + a = e_child.attributeNode(TQString("playerfrom")); if (!a.isNull()) pFrom = m_atlanticCore->findPlayer(a.value().toInt()); - a = e_child.attributeNode(QString("playerto")); + a = e_child.attributeNode(TQString("playerto")); if (!a.isNull()) pTo = m_atlanticCore->findPlayer(a.value().toInt()); - a = e_child.attributeNode(QString("money")); + a = e_child.attributeNode(TQString("money")); kdDebug() << "tradeupdatemoney" << (pFrom ? "1" : "0") << (pTo ? "1" : "0") << (a.isNull() ? "0" : "1") << endl; if (trade && pFrom && pTo && !a.isNull()) trade->updateMoney(a.value().toInt(), pFrom, pTo); @@ -841,7 +841,7 @@ void AtlantikNetwork::processNode(QDomNode n) } else if (e.tagName() == "auctionupdate") { - a = e.attributeNode(QString("auctionid")); + a = e.attributeNode(TQString("auctionid")); if (!a.isNull()) { int auctionId = a.value().toInt(); @@ -851,24 +851,24 @@ void AtlantikNetwork::processNode(QDomNode n) if (!(auction = m_auctions[auctionId])) { // Create auction object - auction = m_atlanticCore->newAuction(auctionId, m_atlanticCore->findEstate(e.attributeNode(QString("estateid")).value().toInt())); + auction = m_atlanticCore->newAuction(auctionId, m_atlanticCore->findEstate(e.attributeNode(TQString("estateid")).value().toInt())); m_auctions[auctionId] = auction; - QObject::connect(auction, SIGNAL(bid(Auction *, int)), this, SLOT(auctionBid(Auction *, int))); + TQObject::connect(auction, TQT_SIGNAL(bid(Auction *, int)), this, TQT_SLOT(auctionBid(Auction *, int))); b_newAuction = true; } - a = e.attributeNode(QString("highbidder")); + a = e.attributeNode(TQString("highbidder")); if (!a.isNull()) { - Player *player = m_atlanticCore->findPlayer(e.attributeNode(QString("highbidder")).value().toInt()); - a = e.attributeNode(QString("highbid")); + Player *player = m_atlanticCore->findPlayer(e.attributeNode(TQString("highbidder")).value().toInt()); + a = e.attributeNode(TQString("highbid")); if (auction && !a.isNull()) auction->newBid(player, a.value().toInt()); } - a = e.attributeNode(QString("status")); + a = e.attributeNode(TQString("status")); if (auction && !a.isNull()) { int status = a.value().toInt(); @@ -897,16 +897,16 @@ void AtlantikNetwork::processNode(QDomNode n) kdDebug() << "ignored TAG: " << e.tagName() << endl; } // TODO: remove permanently? - // QDomNode node = n.firstChild(); + // TQDomNode node = n.firstChild(); // processNode(node); } } -void AtlantikNetwork::serverConnect(const QString host, int port) +void AtlantikNetwork::serverConnect(const TQString host, int port) { setAddress(host, port); enableRead(true); - emit msgStatus(i18n("Connecting to %1:%2...").arg(host).arg(QString::number(port)), "connect_creating"); + emit msgStatus(i18n("Connecting to %1:%2...").arg(host).arg(TQString::number(port)), "connect_creating"); startAsyncConnect(); } diff --git a/atlantik/libatlantikclient/atlantik_network.h b/atlantik/libatlantikclient/atlantik_network.h index 087a01be..cd1477f8 100644 --- a/atlantik/libatlantikclient/atlantik_network.h +++ b/atlantik/libatlantikclient/atlantik_network.h @@ -17,7 +17,7 @@ #ifndef LIBATLANTIK_NETWORK_H #define LIBATLANTIK_NETWORK_H -#include <qmap.h> +#include <tqmap.h> #include <kextsock.h> #include "libatlantic_export.h" @@ -39,15 +39,15 @@ Q_OBJECT public: AtlantikNetwork(AtlanticCore *atlanticCore); virtual ~AtlantikNetwork(void); - void setName(QString name); - void cmdChat(QString msg); + void setName(TQString name); + void cmdChat(TQString msg); private slots: - void writeData(QString msg); + void writeData(TQString msg); void rollDice(); void endTurn(); - void newGame(const QString &gameType); - void reconnect(const QString &cookie); + void newGame(const TQString &gameType); + void reconnect(const TQString &cookie); void startGame(); void buyEstate(); void auctionEstate(); @@ -65,17 +65,17 @@ private slots: void tradeReject(Trade *trade); void tradeAccept(Trade *trade); void auctionBid(Auction *auction, int amount); - void changeOption(int, const QString &value); + void changeOption(int, const TQString &value); void slotLookupFinished(int count); void slotConnectionSuccess(); void slotConnectionFailed(int error); public slots: - void serverConnect(const QString host, int port); + void serverConnect(const TQString host, int port); void joinGame(int gameId); void leaveGame(); void slotRead(); - void setImage(const QString &name); + void setImage(const TQString &name); signals: /** @@ -98,17 +98,17 @@ signals: */ void newEstateGroup(EstateGroup *estateGroup); - void msgInfo(QString); - void msgError(QString); - void msgChat(QString, QString); - void msgStatus(const QString &data, const QString &icon = QString::null); - void networkEvent(const QString &data, const QString &icon); + void msgInfo(TQString); + void msgError(TQString); + void msgChat(TQString, TQString); + void msgStatus(const TQString &data, const TQString &icon = TQString::null); + void networkEvent(const TQString &data, const TQString &icon); - void displayDetails(QString text, bool clearText, bool clearButtons, Estate *estate = 0); - void addCommandButton(QString command, QString caption, bool enabled); + void displayDetails(TQString text, bool clearText, bool clearButtons, Estate *estate = 0); + void addCommandButton(TQString command, TQString caption, bool enabled); void addCloseButton(); - void gameOption(QString title, QString type, QString value, QString edit, QString command); + void gameOption(TQString title, TQString type, TQString value, TQString edit, TQString command); void endConfigUpdate(); void gameConfig(); @@ -136,20 +136,20 @@ signals: void newAuction(Auction *auction); void auctionCompleted(Auction *auction); void receivedHandshake(); - void clientCookie(QString cookie); + void clientCookie(TQString cookie); private: - void processMsg(const QString &msg); - void processNode(QDomNode); + void processMsg(const TQString &msg); + void processNode(TQDomNode); AtlanticCore *m_atlanticCore; - QTextStream *m_textStream; + TQTextStream *m_textStream; int m_playerId; - QString m_serverVersion; + TQString m_serverVersion; - QMap<Player *, int> m_playerLocationMap; - QMap<int, Auction *> m_auctions; + TQMap<Player *, int> m_playerLocationMap; + TQMap<int, Auction *> m_auctions; }; #endif diff --git a/atlantik/libatlantikclient/monopdprotocol.cpp b/atlantik/libatlantikclient/monopdprotocol.cpp index 5f6c401b..f024f163 100644 --- a/atlantik/libatlantikclient/monopdprotocol.cpp +++ b/atlantik/libatlantikclient/monopdprotocol.cpp @@ -14,7 +14,7 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qstring.h> +#include <tqstring.h> /* #include <atlantic_core.h> @@ -30,50 +30,50 @@ #include "monopdprotocol.h" #include "monopdprotocol.moc" -MonopdProtocol::MonopdProtocol() : QObject() +MonopdProtocol::MonopdProtocol() : TQObject() { } void MonopdProtocol::auctionEstate() { - sendData(QString::fromLatin1(".ea")); + sendData(TQString::fromLatin1(".ea")); } void MonopdProtocol::buyEstate() { - sendData(QString::fromLatin1(".eb")); + sendData(TQString::fromLatin1(".eb")); } void MonopdProtocol::confirmTokenLocation(Estate *estate) { - QString data(".t"); - data.append(QString::number(estate ? estate->id() : -1)); + TQString data(".t"); + data.append(TQString::number(estate ? estate->id() : -1)); sendData(data); } void MonopdProtocol::endTurn() { - sendData(QString::fromLatin1(".E")); + sendData(TQString::fromLatin1(".E")); } void MonopdProtocol::rollDice() { - sendData(QString::fromLatin1(".r")); + sendData(TQString::fromLatin1(".r")); } -void MonopdProtocol::setName(QString name) +void MonopdProtocol::setName(TQString name) { - QString data(".n"); + TQString data(".n"); data.append(name); sendData(data); } void MonopdProtocol::startGame() { - sendData(QString::fromLatin1(".gs")); + sendData(TQString::fromLatin1(".gs")); } -void MonopdProtocol::sendData(QString) +void MonopdProtocol::sendData(TQString) { // Your reimplementation of this method should send send data over the // network. diff --git a/atlantik/libatlantikclient/monopdprotocol.h b/atlantik/libatlantikclient/monopdprotocol.h index 0fc16ad8..36e8fcb6 100644 --- a/atlantik/libatlantikclient/monopdprotocol.h +++ b/atlantik/libatlantikclient/monopdprotocol.h @@ -20,7 +20,7 @@ #ifndef MONOPDPROTOCOL_H_H #define MONOPDPROTOCOL_H_H -#include <qobject.h> +#include <tqobject.h> class QString; @@ -48,11 +48,11 @@ private slots: void confirmTokenLocation(Estate *estate); void endTurn(); void rollDice(); - void setName(QString name); + void setName(TQString name); void startGame(); private: - virtual void sendData(QString data); + virtual void sendData(TQString data); }; #endif diff --git a/atlantik/libatlantikui/auction_widget.cpp b/atlantik/libatlantikui/auction_widget.cpp index e7dc7fd8..219c8b2b 100644 --- a/atlantik/libatlantikui/auction_widget.cpp +++ b/atlantik/libatlantikui/auction_widget.cpp @@ -14,10 +14,10 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qvgroupbox.h> -#include <qhbox.h> -#include <qspinbox.h> -#include <qlabel.h> +#include <tqvgroupbox.h> +#include <tqhbox.h> +#include <tqspinbox.h> +#include <tqlabel.h> #include <kdebug.h> @@ -33,21 +33,21 @@ #include "auction_widget.moc" -AuctionWidget::AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, QWidget *parent, const char *name) : QWidget(parent, name) +AuctionWidget::AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, TQWidget *parent, const char *name) : TQWidget(parent, name) { m_atlanticCore = atlanticCore; m_auction = auction; - connect(m_auction, SIGNAL(changed()), this, SLOT(auctionChanged())); - connect(m_auction, SIGNAL(updateBid(Player *, int)), this, SLOT(updateBid(Player *, int))); - connect(this, SIGNAL(bid(Auction *, int)), m_auction, SIGNAL(bid(Auction *, int))); + connect(m_auction, TQT_SIGNAL(changed()), this, TQT_SLOT(auctionChanged())); + connect(m_auction, TQT_SIGNAL(updateBid(Player *, int)), this, TQT_SLOT(updateBid(Player *, int))); + connect(this, TQT_SIGNAL(bid(Auction *, int)), m_auction, TQT_SIGNAL(bid(Auction *, int))); - m_mainLayout = new QVBoxLayout(this, KDialog::marginHint()); + m_mainLayout = new TQVBoxLayout(this, KDialog::marginHint()); Q_CHECK_PTR(m_mainLayout); // Player list Estate *estate = auction->estate(); - m_playerGroupBox = new QVGroupBox(estate ? i18n("Auction: %1").arg(estate->name()) : i18n("Auction"), this, "groupBox"); + m_playerGroupBox = new TQVGroupBox(estate ? i18n("Auction: %1").arg(estate->name()) : i18n("Auction"), this, "groupBox"); m_mainLayout->addWidget(m_playerGroupBox); m_playerList = new KListView(m_playerGroupBox); @@ -58,36 +58,36 @@ AuctionWidget::AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, QWidg KListViewItem *item; Player *player, *pSelf = m_atlanticCore->playerSelf(); - QPtrList<Player> playerList = m_atlanticCore->players(); - for (QPtrListIterator<Player> it(playerList); *it; ++it) + TQPtrList<Player> playerList = m_atlanticCore->players(); + for (TQPtrListIterator<Player> it(playerList); *it; ++it) { if ( (player = *it) && player->game() == pSelf->game() ) { - item = new KListViewItem(m_playerList, player->name(), QString("0")); - item->setPixmap(0, QPixmap(SmallIcon("personal"))); + item = new KListViewItem(m_playerList, player->name(), TQString("0")); + item->setPixmap(0, TQPixmap(SmallIcon("personal"))); m_playerItems[player] = item; - connect(player, SIGNAL(changed(Player *)), this, SLOT(playerChanged(Player *))); + connect(player, TQT_SIGNAL(changed(Player *)), this, TQT_SLOT(playerChanged(Player *))); } } // Bid spinbox and button - QHBox *bidBox = new QHBox(this); + TQHBox *bidBox = new TQHBox(this); m_mainLayout->addWidget(bidBox); - m_bidSpinBox = new QSpinBox(1, 10000, 1, bidBox); + m_bidSpinBox = new TQSpinBox(1, 10000, 1, bidBox); KPushButton *bidButton = new KPushButton(i18n("Make Bid"), bidBox, "bidButton"); - connect(bidButton, SIGNAL(clicked()), this, SLOT(slotBidButtonClicked())); + connect(bidButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBidButtonClicked())); // Status label - m_statusLabel = new QLabel(this, "statusLabel"); + m_statusLabel = new TQLabel(this, "statusLabel"); m_mainLayout->addWidget(m_statusLabel); } void AuctionWidget::auctionChanged() { - QString status; + TQString status; switch (m_auction->status()) { case 1: @@ -103,7 +103,7 @@ void AuctionWidget::auctionChanged() break; default: - status = QString::null; + status = TQString::null; } m_statusLabel->setText(status); } @@ -113,7 +113,7 @@ void AuctionWidget::playerChanged(Player *player) if (!player) return; - QListViewItem *item; + TQListViewItem *item; if (!(item = m_playerItems[player])) return; @@ -126,11 +126,11 @@ void AuctionWidget::updateBid(Player *player, int amount) if (!player) return; - QListViewItem *item; + TQListViewItem *item; if (!(item = m_playerItems[player])) return; - item->setText(1, QString::number(amount)); + item->setText(1, TQString::number(amount)); m_bidSpinBox->setMinValue(amount+1); m_playerList->triggerUpdate(); } diff --git a/atlantik/libatlantikui/auction_widget.h b/atlantik/libatlantikui/auction_widget.h index a87b8fc4..72568615 100644 --- a/atlantik/libatlantikui/auction_widget.h +++ b/atlantik/libatlantikui/auction_widget.h @@ -17,9 +17,9 @@ #ifndef ATLANTIK_AUCTION_WIDGET_H #define ATLANTIK_AUCTION_WIDGET_H -#include <qwidget.h> -#include <qlayout.h> -#include <qmap.h> +#include <tqwidget.h> +#include <tqlayout.h> +#include <tqmap.h> #include <klistview.h> @@ -38,7 +38,7 @@ class AuctionWidget : public QWidget Q_OBJECT public: - AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, QWidget *parent, const char *name=0); + AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, TQWidget *parent, const char *name=0); private slots: void auctionChanged(); @@ -50,11 +50,11 @@ signals: void bid(Auction *auction, int amount); private: - QVBoxLayout *m_mainLayout; - QVGroupBox *m_playerGroupBox; - QSpinBox *m_bidSpinBox; - QMap<Player *, KListViewItem *> m_playerItems; - QLabel *m_statusLabel; + TQVBoxLayout *m_mainLayout; + TQVGroupBox *m_playerGroupBox; + TQSpinBox *m_bidSpinBox; + TQMap<Player *, KListViewItem *> m_playerItems; + TQLabel *m_statusLabel; KListView *m_playerList; diff --git a/atlantik/libatlantikui/board.cpp b/atlantik/libatlantikui/board.cpp index a4fdf3ce..1b9ae0b5 100644 --- a/atlantik/libatlantikui/board.cpp +++ b/atlantik/libatlantikui/board.cpp @@ -16,8 +16,8 @@ #include <iostream> -#include <qpainter.h> -#include <qstring.h> +#include <tqpainter.h> +#include <tqstring.h> #include <kdebug.h> #include <klocale.h> @@ -35,7 +35,7 @@ #include "board.h" #include "board.moc" -AtlantikBoard::AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, DisplayMode mode, QWidget *parent, const char *name) : QWidget(parent, name) +AtlantikBoard::AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, DisplayMode mode, TQWidget *parent, const char *name) : TQWidget(parent, name) { m_atlanticCore = atlanticCore; m_maxEstates = maxEstates; @@ -43,17 +43,17 @@ AtlantikBoard::AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, Display m_animateTokens = false; m_lastServerDisplay = 0; - setMinimumSize(QSize(500, 500)); + setMinimumSize(TQSize(500, 500)); int sideLen = maxEstates/4; // Animated token movement m_movingToken = 0; - m_timer = new QTimer(this); - connect(m_timer, SIGNAL(timeout()), this, SLOT(slotMoveToken())); + m_timer = new TQTimer(this); + connect(m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotMoveToken())); m_resumeTimer = false; - m_gridLayout = new QGridLayout(this, sideLen+1, sideLen+1); + m_gridLayout = new TQGridLayout(this, sideLen+1, sideLen+1); for(int i=0;i<=sideLen;i++) { if (i==0 || i==sideLen) @@ -68,7 +68,7 @@ AtlantikBoard::AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, Display } } -// spacer = new QWidget(this); +// spacer = new TQWidget(this); // m_gridLayout->addWidget(spacer, sideLen, sideLen); // SE m_displayQueue.setAutoDelete(true); @@ -101,7 +101,7 @@ void AtlantikBoard::setViewProperties(bool indicateUnowned, bool highliteUnowned // Update EstateViews EstateView *estateView; - for (QPtrListIterator<EstateView> it(m_estateViews); *it; ++it) + for (TQPtrListIterator<EstateView> it(m_estateViews); *it; ++it) if ((estateView = dynamic_cast<EstateView*>(*it))) estateView->setViewProperties(indicateUnowned, highliteUnowned, darkenMortgaged, quartzEffects); } @@ -114,7 +114,7 @@ int AtlantikBoard::heightForWidth(int width) EstateView *AtlantikBoard::findEstateView(Estate *estate) { EstateView *estateView; - for (QPtrListIterator<EstateView> i(m_estateViews); *i; ++i) + for (TQPtrListIterator<EstateView> i(m_estateViews); *i; ++i) { estateView = dynamic_cast<EstateView*>(*i); if (estateView && estateView->estate() == estate) @@ -125,7 +125,7 @@ EstateView *AtlantikBoard::findEstateView(Estate *estate) void AtlantikBoard::addEstateView(Estate *estate, bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects) { - QString icon = QString(); + TQString icon = TQString(); int estateId = estate->id(); EstateOrientation orientation = North; int sideLen = m_gridLayout->numRows() - 1; @@ -142,16 +142,16 @@ void AtlantikBoard::addEstateView(Estate *estate, bool indicateUnowned, bool hig EstateView *estateView = new EstateView(estate, orientation, icon, indicateUnowned, highliteUnowned, darkenMortgaged, quartzEffects, this, "estateview"); m_estateViews.append(estateView); - connect(estate, SIGNAL(changed()), estateView, SLOT(estateChanged())); - connect(estateView, SIGNAL(estateToggleMortgage(Estate *)), estate, SIGNAL(estateToggleMortgage(Estate *))); - connect(estateView, SIGNAL(LMBClicked(Estate *)), estate, SIGNAL(LMBClicked(Estate *))); - connect(estateView, SIGNAL(estateHouseBuy(Estate *)), estate, SIGNAL(estateHouseBuy(Estate *))); - connect(estateView, SIGNAL(estateHouseSell(Estate *)), estate, SIGNAL(estateHouseSell(Estate *))); - connect(estateView, SIGNAL(newTrade(Player *)), estate, SIGNAL(newTrade(Player *))); + connect(estate, TQT_SIGNAL(changed()), estateView, TQT_SLOT(estateChanged())); + connect(estateView, TQT_SIGNAL(estateToggleMortgage(Estate *)), estate, TQT_SIGNAL(estateToggleMortgage(Estate *))); + connect(estateView, TQT_SIGNAL(LMBClicked(Estate *)), estate, TQT_SIGNAL(LMBClicked(Estate *))); + connect(estateView, TQT_SIGNAL(estateHouseBuy(Estate *)), estate, TQT_SIGNAL(estateHouseBuy(Estate *))); + connect(estateView, TQT_SIGNAL(estateHouseSell(Estate *)), estate, TQT_SIGNAL(estateHouseSell(Estate *))); + connect(estateView, TQT_SIGNAL(newTrade(Player *)), estate, TQT_SIGNAL(newTrade(Player *))); // Designer has its own LMBClicked slot if (m_mode == Play) - connect(estateView, SIGNAL(LMBClicked(Estate *)), this, SLOT(prependEstateDetails(Estate *))); + connect(estateView, TQT_SIGNAL(LMBClicked(Estate *)), this, TQT_SLOT(prependEstateDetails(Estate *))); if (estateId<sideLen) m_gridLayout->addWidget(estateView, sideLen, sideLen-estateId); @@ -167,8 +167,8 @@ void AtlantikBoard::addEstateView(Estate *estate, bool indicateUnowned, bool hig if (m_atlanticCore) { Player *player = 0; - QPtrList<Player> playerList = m_atlanticCore->players(); - for (QPtrListIterator<Player> it(playerList); (player = *it) ; ++it) + TQPtrList<Player> playerList = m_atlanticCore->players(); + for (TQPtrListIterator<Player> it(playerList); (player = *it) ; ++it) if (player->location() == estate) addToken(player); } @@ -181,13 +181,13 @@ void AtlantikBoard::addAuctionWidget(Auction *auction) m_displayQueue.prepend(auctionW); updateCenter(); - connect(auction, SIGNAL(completed()), this, SLOT(displayDefault())); + connect(auction, TQT_SIGNAL(completed()), this, TQT_SLOT(displayDefault())); } Token *AtlantikBoard::findToken(Player *player) { Token *token = 0; - for (QPtrListIterator<Token> it(m_tokens); (token = *it) ; ++it) + for (TQPtrListIterator<Token> it(m_tokens); (token = *it) ; ++it) if (token->player() == player) return token; return 0; @@ -215,12 +215,12 @@ void AtlantikBoard::addToken(Player *player) Token *token = new Token(player, this, "token"); m_tokens.append(token); - connect(player, SIGNAL(changed(Player *)), token, SLOT(playerChanged())); + connect(player, TQT_SIGNAL(changed(Player *)), token, TQT_SLOT(playerChanged())); jumpToken(token); // Timer to reinit the gameboard _after_ event loop - QTimer::singleShot(100, this, SLOT(slotResizeAftermath())); + TQTimer::singleShot(100, this, TQT_SLOT(slotResizeAftermath())); } void AtlantikBoard::playerChanged(Player *player) @@ -305,7 +305,7 @@ void AtlantikBoard::jumpToken(Token *token) kdDebug() << "jumpToken to " << token->location()->name() << endl; - QPoint tGeom = calculateTokenDestination(token); + TQPoint tGeom = calculateTokenDestination(token); token->setGeometry(tGeom.x(), tGeom.y(), token->width(), token->height()); Player *player = token->player(); @@ -339,14 +339,14 @@ void AtlantikBoard::moveToken(Token *token) m_timer->start(15); } -QPoint AtlantikBoard::calculateTokenDestination(Token *token, Estate *eDest) +TQPoint AtlantikBoard::calculateTokenDestination(Token *token, Estate *eDest) { if (!eDest) eDest = token->location(); EstateView *evDest = findEstateView(eDest); if (!evDest) - return QPoint(0, 0); + return TQPoint(0, 0); int x = 0, y = 0; if (token->player()->inJail()) @@ -374,7 +374,7 @@ QPoint AtlantikBoard::calculateTokenDestination(Token *token, Estate *eDest) } */ } - return QPoint(x, y); + return TQPoint(x, y); } void AtlantikBoard::slotMoveToken() @@ -399,7 +399,7 @@ void AtlantikBoard::slotMoveToken() // Where do we want to go today? Estate *eDest = m_atlanticCore->estateAfter(m_movingToken->location()); - QPoint tGeom = calculateTokenDestination(m_movingToken, eDest); + TQPoint tGeom = calculateTokenDestination(m_movingToken, eDest); int xDest = tGeom.x(); int yDest = tGeom.y(); @@ -442,7 +442,7 @@ void AtlantikBoard::slotMoveToken() } } -void AtlantikBoard::resizeEvent(QResizeEvent *) +void AtlantikBoard::resizeEvent(TQResizeEvent *) { // Stop moving tokens, slotResizeAftermath will re-enable this if (m_timer!=0 && m_timer->isActive()) @@ -456,17 +456,17 @@ void AtlantikBoard::resizeEvent(QResizeEvent *) int q = e->size().width() - e->size().height(); if (q > 0) { - QSize s(q, 0); + TQSize s(q, 0); spacer->setFixedSize(s); } else { - QSize s(0, -q); + TQSize s(0, -q); spacer->setFixedSize(s); } */ // Timer to reinit the gameboard _after_ resizeEvent - QTimer::singleShot(0, this, SLOT(slotResizeAftermath())); + TQTimer::singleShot(0, this, TQT_SLOT(slotResizeAftermath())); } void AtlantikBoard::slotResizeAftermath() @@ -477,7 +477,7 @@ void AtlantikBoard::slotResizeAftermath() // adjusted estate geometries. Token *token = 0; - for (QPtrListIterator<Token> it(m_tokens); (token = *it) ; ++it) + for (TQPtrListIterator<Token> it(m_tokens); (token = *it) ; ++it) jumpToken(token); // Restart the timer that was stopped in resizeEvent @@ -493,7 +493,7 @@ void AtlantikBoard::displayDefault() switch(m_displayQueue.count()) { case 0: - m_displayQueue.prepend(new QWidget(this)); + m_displayQueue.prepend(new TQWidget(this)); break; case 1: if (EstateDetails *display = dynamic_cast<EstateDetails*>(m_lastServerDisplay)) @@ -508,7 +508,7 @@ void AtlantikBoard::displayDefault() updateCenter(); } -void AtlantikBoard::displayButton(QString command, QString caption, bool enabled) +void AtlantikBoard::displayButton(TQString command, TQString caption, bool enabled) { if (EstateDetails *display = dynamic_cast<EstateDetails*>(m_lastServerDisplay)) display->addButton(command, caption, enabled); @@ -521,7 +521,7 @@ void AtlantikBoard::addCloseButton() eDetails->addCloseButton(); } -void AtlantikBoard::insertDetails(QString text, bool clearText, bool clearButtons, Estate *estate) +void AtlantikBoard::insertDetails(TQString text, bool clearText, bool clearButtons, Estate *estate) { EstateDetails *eDetails = 0; @@ -544,8 +544,8 @@ void AtlantikBoard::insertDetails(QString text, bool clearText, bool clearButton eDetails = new EstateDetails(estate, text, this); m_lastServerDisplay = eDetails; - connect(eDetails, SIGNAL(buttonCommand(QString)), this, SIGNAL(buttonCommand(QString))); - connect(eDetails, SIGNAL(buttonClose()), this, SLOT(displayDefault())); + connect(eDetails, TQT_SIGNAL(buttonCommand(TQString)), this, TQT_SIGNAL(buttonCommand(TQString))); + connect(eDetails, TQT_SIGNAL(buttonClose()), this, TQT_SLOT(displayDefault())); m_displayQueue.insert(0, eDetails); updateCenter(); @@ -560,11 +560,11 @@ void AtlantikBoard::prependEstateDetails(Estate *estate) if (m_displayQueue.getFirst() == m_lastServerDisplay) { - eDetails = new EstateDetails(estate, QString::null, this); + eDetails = new EstateDetails(estate, TQString::null, this); m_displayQueue.prepend(eDetails); - connect(eDetails, SIGNAL(buttonCommand(QString)), this, SIGNAL(buttonCommand(QString))); - connect(eDetails, SIGNAL(buttonClose()), this, SLOT(displayDefault())); + connect(eDetails, TQT_SIGNAL(buttonCommand(TQString)), this, TQT_SIGNAL(buttonCommand(TQString))); + connect(eDetails, TQT_SIGNAL(buttonClose()), this, TQT_SLOT(displayDefault())); } else { @@ -572,7 +572,7 @@ void AtlantikBoard::prependEstateDetails(Estate *estate) if (eDetails) { eDetails->setEstate(estate); - eDetails->setText( QString::null ); + eDetails->setText( TQString::null ); // eDetails->clearButtons(); } else @@ -590,12 +590,12 @@ void AtlantikBoard::prependEstateDetails(Estate *estate) void AtlantikBoard::updateCenter() { - QWidget *center = m_displayQueue.getFirst(); + TQWidget *center = m_displayQueue.getFirst(); m_gridLayout->addMultiCellWidget(center, 1, m_gridLayout->numRows()-2, 1, m_gridLayout->numCols()-2); center->show(); } -QWidget *AtlantikBoard::centerWidget() +TQWidget *AtlantikBoard::centerWidget() { return m_displayQueue.getFirst(); } diff --git a/atlantik/libatlantikui/board.h b/atlantik/libatlantikui/board.h index deedb3d6..21c47991 100644 --- a/atlantik/libatlantikui/board.h +++ b/atlantik/libatlantikui/board.h @@ -17,10 +17,10 @@ #ifndef ATLANTIK_BOARD_H #define ATLANTIK_BOARD_H -#include <qwidget.h> -#include <qtimer.h> -#include <qlayout.h> -#include <qptrlist.h> +#include <tqwidget.h> +#include <tqtimer.h> +#include <tqlayout.h> +#include <tqptrlist.h> #include "libatlantikui_export.h" class QPoint; @@ -39,7 +39,7 @@ Q_OBJECT public: enum DisplayMode { Play, Edit }; - AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, DisplayMode mode, QWidget *parent, const char *name=0); + AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, DisplayMode mode, TQWidget *parent, const char *name=0); ~AtlantikBoard(); void reset(); @@ -53,7 +53,7 @@ public: void indicateUnownedChanged(); EstateView *findEstateView(Estate *estate); - QWidget *centerWidget(); + TQWidget *centerWidget(); public slots: void slotMoveToken(); @@ -62,41 +62,41 @@ public slots: private slots: void playerChanged(Player *player); - void displayButton(QString command, QString caption, bool enabled); + void displayButton(TQString command, TQString caption, bool enabled); void prependEstateDetails(Estate *); - void insertDetails(QString text, bool clearText, bool clearButtons, Estate *estate = 0); + void insertDetails(TQString text, bool clearText, bool clearButtons, Estate *estate = 0); void addCloseButton(); signals: void tokenConfirmation(Estate *estate); - void buttonCommand(QString command); + void buttonCommand(TQString command); protected: - void resizeEvent(QResizeEvent *); + void resizeEvent(TQResizeEvent *); private: Token *findToken(Player *player); void jumpToken(Token *token); void moveToken(Token *token); - QPoint calculateTokenDestination(Token *token, Estate *estate = 0); + TQPoint calculateTokenDestination(Token *token, Estate *estate = 0); void updateCenter(); AtlanticCore *m_atlanticCore; DisplayMode m_mode; - QWidget *spacer, *m_lastServerDisplay; - QGridLayout *m_gridLayout; + TQWidget *spacer, *m_lastServerDisplay; + TQGridLayout *m_gridLayout; Token *m_movingToken; - QTimer *m_timer; + TQTimer *m_timer; bool m_resumeTimer; bool m_animateTokens; int m_maxEstates; - QPtrList<EstateView> m_estateViews; - QPtrList<Token> m_tokens; - QPtrList<QWidget> m_displayQueue; + TQPtrList<EstateView> m_estateViews; + TQPtrList<Token> m_tokens; + TQPtrList<TQWidget> m_displayQueue; }; #endif diff --git a/atlantik/libatlantikui/estatedetails.cpp b/atlantik/libatlantikui/estatedetails.cpp index d143033c..3a71f25a 100644 --- a/atlantik/libatlantikui/estatedetails.cpp +++ b/atlantik/libatlantikui/estatedetails.cpp @@ -14,12 +14,12 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qpainter.h> -#include <qpixmap.h> -#include <qlayout.h> -#include <qptrlist.h> -#include <qregexp.h> -#include <qvgroupbox.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqlayout.h> +#include <tqptrlist.h> +#include <tqregexp.h> +#include <tqvgroupbox.h> #include <kdialog.h> #include <kglobalsettings.h> @@ -39,7 +39,7 @@ #include "estatedetails.h" #include "kwrappedlistviewitem.h" -EstateDetails::EstateDetails(Estate *estate, QString text, QWidget *parent, const char *name) : QWidget(parent, name) +EstateDetails::EstateDetails(Estate *estate, TQString text, TQWidget *parent, const char *name) : TQWidget(parent, name) { m_pixmap = 0; m_quartzBlocks = 0; @@ -51,22 +51,22 @@ EstateDetails::EstateDetails(Estate *estate, QString text, QWidget *parent, cons m_closeButton = 0; m_buttons.setAutoDelete(true); - m_mainLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + m_mainLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); Q_CHECK_PTR(m_mainLayout); - m_mainLayout->addItem(new QSpacerItem(KDialog::spacingHint(), KDialog::spacingHint()+50, QSizePolicy::Fixed, QSizePolicy::Minimum)); + m_mainLayout->addItem(new TQSpacerItem(KDialog::spacingHint(), KDialog::spacingHint()+50, TQSizePolicy::Fixed, TQSizePolicy::Minimum)); m_infoListView = new KListView(this, "infoListView"); - m_infoListView->addColumn(m_estate ? m_estate->name() : QString("") ); + m_infoListView->addColumn(m_estate ? m_estate->name() : TQString("") ); m_infoListView->setSorting(-1); m_mainLayout->addWidget(m_infoListView); appendText(text); - m_buttonBox = new QHBoxLayout(m_mainLayout, KDialog::spacingHint()); + m_buttonBox = new TQHBoxLayout(m_mainLayout, KDialog::spacingHint()); m_buttonBox->setMargin(0); - m_buttonBox->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); + m_buttonBox->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum)); setEstate(estate); } @@ -78,7 +78,7 @@ EstateDetails::~EstateDetails() delete m_infoListView; } -void EstateDetails::paintEvent(QPaintEvent *) +void EstateDetails::paintEvent(TQPaintEvent *) { if (m_recreateQuartz) { @@ -109,11 +109,11 @@ void EstateDetails::paintEvent(QPaintEvent *) if (b_recreate) { delete m_pixmap; - m_pixmap = new QPixmap(width(), height()); + m_pixmap = new TQPixmap(width(), height()); - QColor greenHouse(0, 255, 0); - QColor redHotel(255, 51, 51); - QPainter painter; + TQColor greenHouse(0, 255, 0); + TQColor redHotel(255, 51, 51); + TQPainter painter; painter.begin(m_pixmap, this); painter.setPen(Qt::black); @@ -130,12 +130,12 @@ void EstateDetails::paintEvent(QPaintEvent *) if (m_estate) { int titleHeight = 50; - QColor titleColor = (m_estate->color().isValid() ? m_estate->color() : m_estate->bgColor().light(80)); + TQColor titleColor = (m_estate->color().isValid() ? m_estate->color() : m_estate->bgColor().light(80)); KPixmap* quartzBuffer = new KPixmap; quartzBuffer->resize(25, (height()/4)-2); - QPainter quartzPainter; + TQPainter quartzPainter; quartzPainter.begin(quartzBuffer, this); painter.setBrush(titleColor); @@ -178,7 +178,7 @@ void EstateDetails::paintEvent(QPaintEvent *) if (fontSize == -1) fontSize = KGlobalSettings::generalFont().pixelSize(); - painter.setFont(QFont(KGlobalSettings::generalFont().family(), fontSize * 2, QFont::Bold)); + painter.setFont(TQFont(KGlobalSettings::generalFont().family(), fontSize * 2, TQFont::Bold)); painter.drawText(KDialog::marginHint(), KDialog::marginHint(), width()-KDialog::marginHint(), titleHeight, Qt::AlignJustify, m_estate->name()); painter.setPen(Qt::black); @@ -189,12 +189,12 @@ void EstateDetails::paintEvent(QPaintEvent *) if (m_estate->estateGroup()) { xText = titleHeight - fontSize - KDialog::marginHint(); - painter.setFont(QFont(KGlobalSettings::generalFont().family(), fontSize, QFont::Bold)); + painter.setFont(TQFont(KGlobalSettings::generalFont().family(), fontSize, TQFont::Bold)); painter.drawText(5, xText, width()-10, titleHeight, Qt::AlignRight, m_estate->estateGroup()->name().upper()); } xText = titleHeight + fontSize + 5; - painter.setFont(QFont(KGlobalSettings::generalFont().family(), fontSize, QFont::Normal)); + painter.setFont(TQFont(KGlobalSettings::generalFont().family(), fontSize, TQFont::Normal)); } b_recreate = false; @@ -202,7 +202,7 @@ void EstateDetails::paintEvent(QPaintEvent *) bitBlt(this, 0, 0, m_pixmap); } -void EstateDetails::resizeEvent(QResizeEvent *) +void EstateDetails::resizeEvent(TQResizeEvent *) { m_recreateQuartz = true; b_recreate = true; @@ -212,43 +212,43 @@ void EstateDetails::addDetails() { if (m_estate) { - QListViewItem *infoText = 0; + TQListViewItem *infoText = 0; // Price if (m_estate->price()) { - infoText = new QListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Price: %1").arg(m_estate->price())); - infoText->setPixmap(0, QPixmap(SmallIcon("info"))); + infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Price: %1").arg(m_estate->price())); + infoText->setPixmap(0, TQPixmap(SmallIcon("info"))); } // Owner, houses, isMortgaged if (m_estate && m_estate->canBeOwned()) { - infoText = new QListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Owner: %1").arg(m_estate->owner() ? m_estate->owner()->name() : i18n("unowned"))); - infoText->setPixmap(0, QPixmap(SmallIcon("info"))); + infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Owner: %1").arg(m_estate->owner() ? m_estate->owner()->name() : i18n("unowned"))); + infoText->setPixmap(0, TQPixmap(SmallIcon("info"))); if (m_estate->isOwned()) { - infoText = new QListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Houses: %1").arg(m_estate->houses())); - infoText->setPixmap(0, QPixmap(SmallIcon("info"))); + infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Houses: %1").arg(m_estate->houses())); + infoText->setPixmap(0, TQPixmap(SmallIcon("info"))); - infoText = new QListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Mortgaged: %1").arg(m_estate->isMortgaged() ? i18n("Yes") : i18n("No"))); - infoText->setPixmap(0, QPixmap(SmallIcon("info"))); + infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Mortgaged: %1").arg(m_estate->isMortgaged() ? i18n("Yes") : i18n("No"))); + infoText->setPixmap(0, TQPixmap(SmallIcon("info"))); } } } } -void EstateDetails::addButton(QString command, QString caption, bool enabled) +void EstateDetails::addButton(TQString command, TQString caption, bool enabled) { KPushButton *button = new KPushButton(caption, this); m_buttons.append(button); - m_buttonCommandMap[(QObject *)button] = command; + m_buttonCommandMap[(TQObject *)button] = command; m_buttonBox->addWidget(button); if (m_estate) { - QColor bgColor, fgColor; + TQColor bgColor, fgColor; bgColor = m_estate->bgColor().light(110); fgColor = ( bgColor.red() + bgColor.green() + bgColor.blue() < 255 ) ? Qt::white : Qt::black; @@ -258,7 +258,7 @@ void EstateDetails::addButton(QString command, QString caption, bool enabled) button->setEnabled(enabled); button->show(); - connect(button, SIGNAL(pressed()), this, SLOT(buttonPressed())); + connect(button, TQT_SIGNAL(pressed()), this, TQT_SLOT(buttonPressed())); } void EstateDetails::addCloseButton() @@ -268,7 +268,7 @@ void EstateDetails::addCloseButton() m_closeButton = new KPushButton(KStdGuiItem::close(), this); m_buttonBox->addWidget(m_closeButton); m_closeButton->show(); - connect(m_closeButton, SIGNAL(pressed()), this, SIGNAL(buttonClose())); + connect(m_closeButton, TQT_SIGNAL(pressed()), this, TQT_SIGNAL(buttonClose())); } } @@ -278,30 +278,30 @@ void EstateDetails::setEstate(Estate *estate) { m_estate = estate; - m_infoListView->setColumnText( 0, m_estate ? m_estate->name() : QString("") ); + m_infoListView->setColumnText( 0, m_estate ? m_estate->name() : TQString("") ); b_recreate = true; update(); } } -void EstateDetails::setText(QString text) +void EstateDetails::setText(TQString text) { m_infoListView->clear(); appendText(text); } -void EstateDetails::appendText(QString text) +void EstateDetails::appendText(TQString text) { if ( text.isEmpty() ) return; KWrappedListViewItem *infoText = new KWrappedListViewItem(m_infoListView, m_infoListView->lastItem(), text); - if ( text.find( QRegExp("rolls") ) != -1 ) - infoText->setPixmap(0, QPixmap(SmallIcon("roll"))); + if ( text.find( TQRegExp("rolls") ) != -1 ) + infoText->setPixmap(0, TQPixmap(SmallIcon("roll"))); else - infoText->setPixmap(0, QPixmap(SmallIcon("atlantik"))); + infoText->setPixmap(0, TQPixmap(SmallIcon("atlantik"))); m_infoListView->ensureItemVisible( infoText ); } @@ -321,7 +321,7 @@ void EstateDetails::clearButtons() void EstateDetails::buttonPressed() { - emit buttonCommand(QString(m_buttonCommandMap[(QObject *)QObject::sender()])); + emit buttonCommand(TQString(m_buttonCommandMap[(TQObject *)TQObject::sender()])); } #include "estatedetails.moc" diff --git a/atlantik/libatlantikui/estatedetails.h b/atlantik/libatlantikui/estatedetails.h index b8264a51..6c8a7640 100644 --- a/atlantik/libatlantikui/estatedetails.h +++ b/atlantik/libatlantikui/estatedetails.h @@ -17,7 +17,7 @@ #ifndef ATLANTIK_ESTATEDETAILS_H #define ATLANTIK_ESTATEDETAILS_H -#include <qwidget.h> +#include <tqwidget.h> class QPixmap; class QString; @@ -37,41 +37,41 @@ class EstateDetails : public QWidget Q_OBJECT public: - EstateDetails(Estate *estate, QString text, QWidget *parent, const char *name = 0); + EstateDetails(Estate *estate, TQString text, TQWidget *parent, const char *name = 0); ~EstateDetails(); Estate *estate() { return m_estate; } void addDetails(); - void addButton(const QString command, const QString caption, bool enabled); + void addButton(const TQString command, const TQString caption, bool enabled); void addCloseButton(); void setEstate(Estate *estate); - void setText(QString text); - void appendText(QString text); + void setText(TQString text); + void appendText(TQString text); void clearButtons(); protected: - void paintEvent(QPaintEvent *); - void resizeEvent(QResizeEvent *); + void paintEvent(TQPaintEvent *); + void resizeEvent(TQResizeEvent *); private slots: void buttonPressed(); signals: - void buttonCommand(QString); + void buttonCommand(TQString); void buttonClose(); private: Estate *m_estate; - QPixmap *m_pixmap; + TQPixmap *m_pixmap; KPixmap *m_quartzBlocks; KListView *m_infoListView; KPushButton *m_closeButton; bool b_recreate, m_recreateQuartz; - QVBoxLayout *m_mainLayout; - QHBoxLayout *m_buttonBox; - QVGroupBox *m_textGroupBox; - QMap <QObject *, QString> m_buttonCommandMap; - QPtrList<KPushButton> m_buttons; + TQVBoxLayout *m_mainLayout; + TQHBoxLayout *m_buttonBox; + TQVGroupBox *m_textGroupBox; + TQMap <TQObject *, TQString> m_buttonCommandMap; + TQPtrList<KPushButton> m_buttons; }; #endif diff --git a/atlantik/libatlantikui/estateview.cpp b/atlantik/libatlantikui/estateview.cpp index b8c3f38c..4755ccd3 100644 --- a/atlantik/libatlantikui/estateview.cpp +++ b/atlantik/libatlantikui/estateview.cpp @@ -14,11 +14,11 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qtooltip.h> -#include <qpainter.h> -#include <qtimer.h> -#include <qwmatrix.h> -#include <qcursor.h> +#include <tqtooltip.h> +#include <tqpainter.h> +#include <tqtimer.h> +#include <tqwmatrix.h> +#include <tqcursor.h> #include <kdebug.h> #include <kdeversion.h> @@ -36,7 +36,7 @@ #include "estateview.moc" #include "config.h" -EstateView::EstateView(Estate *estate, EstateOrientation orientation, const QString &_icon, bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects, QWidget *parent, const char *name) : QWidget(parent, name, WResizeNoErase) +EstateView::EstateView(Estate *estate, EstateOrientation orientation, const TQString &_icon, bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects, TQWidget *parent, const char *name) : TQWidget(parent, name, WResizeNoErase) { m_estate = estate; m_orientation = orientation; @@ -57,7 +57,7 @@ EstateView::EstateView(Estate *estate, EstateOrientation orientation, const QStr pe = 0; updatePE(); - icon = new QPixmap(locate("data", "atlantik/pics/" + _icon)); + icon = new TQPixmap(locate("data", "atlantik/pics/" + _icon)); icon = rotatePixmap(icon); updateToolTip(); @@ -65,11 +65,11 @@ EstateView::EstateView(Estate *estate, EstateOrientation orientation, const QStr void EstateView::updateToolTip() { - QToolTip::remove(this); + TQToolTip::remove(this); if ( m_estate ) { - QString toolTip = m_estate->name(); + TQString toolTip = m_estate->name(); if ( m_estate->isOwned() ) { toolTip.append( "\n" + i18n("Owner: %1").arg( m_estate->owner()->name() ) ); @@ -87,7 +87,7 @@ void EstateView::updateToolTip() else if ( m_estate->money() ) toolTip.append( "\n" + i18n("Money: %1").arg( m_estate->money() ) ); - QToolTip::add( this, toolTip ); + TQToolTip::add( this, toolTip ); } } @@ -123,12 +123,12 @@ void EstateView::setViewProperties(bool indicateUnowned, bool highliteUnowned, b update(); } -QPixmap *EstateView::rotatePixmap(QPixmap *p) +TQPixmap *EstateView::rotatePixmap(TQPixmap *p) { if (p==0 || p->isNull()) return 0; - QWMatrix m; + TQWMatrix m; switch(m_orientation) { @@ -152,7 +152,7 @@ KPixmap *EstateView::rotatePixmap(KPixmap *p) if (p==0 || p->isNull()) return 0; - QWMatrix m; + TQWMatrix m; switch(m_orientation) { @@ -217,7 +217,7 @@ void EstateView::repositionPortfolioEstate() } } -void EstateView::paintEvent(QPaintEvent *) +void EstateView::paintEvent(TQPaintEvent *) { m_titleHeight = height()/4; m_titleWidth = width()/4; @@ -250,11 +250,11 @@ void EstateView::paintEvent(QPaintEvent *) if (b_recreate) { delete qpixmap; - qpixmap = new QPixmap(width(), height()); + qpixmap = new TQPixmap(width(), height()); - QColor greenHouse(0, 255, 0); - QColor redHotel(255, 51, 51); - QPainter painter; + TQColor greenHouse(0, 255, 0); + TQColor redHotel(255, 51, 51); + TQPainter painter; painter.begin(qpixmap, this); painter.setPen(Qt::black); @@ -280,7 +280,7 @@ void EstateView::paintEvent(QPaintEvent *) else quartzBuffer->resize(m_titleWidth-2, 25); - QPainter quartzPainter; + TQPainter quartzPainter; quartzPainter.begin(quartzBuffer, this); painter.setBrush(m_estate->color()); @@ -401,15 +401,15 @@ void EstateView::paintEvent(QPaintEvent *) delete quartzBuffer; } - QFont font = QFont( KGlobalSettings::generalFont().family(), KGlobalSettings::generalFont().pointSize(), QFont::Normal ); + TQFont font = TQFont( KGlobalSettings::generalFont().family(), KGlobalSettings::generalFont().pointSize(), TQFont::Normal ); painter.setFont(font); - QString estateName = m_estate->name(); + TQString estateName = m_estate->name(); #if defined(KDE_MAKE_VERSION) #if KDE_VERSION >= KDE_MAKE_VERSION(3,2,0) if ( m_estate->color().isValid() && ( m_orientation == West || m_orientation == East ) ) - estateName = KStringHandler::rPixelSqueeze( m_estate->name(), QFontMetrics( font ), 3*width()/4 ); + estateName = KStringHandler::rPixelSqueeze( m_estate->name(), TQFontMetrics( font ), 3*width()/4 ); else - estateName = KStringHandler::rPixelSqueeze( m_estate->name(), QFontMetrics( font ), width() ); + estateName = KStringHandler::rPixelSqueeze( m_estate->name(), TQFontMetrics( font ), width() ); #endif #endif if (m_estate->color().isValid() && m_orientation == West) @@ -422,15 +422,15 @@ void EstateView::paintEvent(QPaintEvent *) bitBlt(this, 0, 0, qpixmap); } -void EstateView::resizeEvent(QResizeEvent *) +void EstateView::resizeEvent(TQResizeEvent *) { m_recreateQuartz = true; b_recreate = true; - QTimer::singleShot(0, this, SLOT(slotResizeAftermath())); + TQTimer::singleShot(0, this, TQT_SLOT(slotResizeAftermath())); } -void EstateView::mousePressEvent(QMouseEvent *e) +void EstateView::mousePressEvent(TQMouseEvent *e) { if (e->button()==RightButton && m_estate->isOwned()) { @@ -482,9 +482,9 @@ void EstateView::mousePressEvent(QMouseEvent *e) KPopupMenu *pm = dynamic_cast<KPopupMenu *>(rmbMenu); if (pm) { - connect(pm, SIGNAL(activated(int)), this, SLOT(slotMenuAction(int))); + connect(pm, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotMenuAction(int))); } - QPoint g = QCursor::pos(); + TQPoint g = TQCursor::pos(); rmbMenu->exec(g); delete rmbMenu; } @@ -521,9 +521,9 @@ void EstateView::slotMenuAction(int item) // Kudos to Gallium <gallium@kde.org> for writing the Quartz KWin style and // letting me use the ultra slick algorithm! -void EstateView::drawQuartzBlocks(KPixmap *pi, KPixmap &p, const QColor &c1, const QColor &c2) +void EstateView::drawQuartzBlocks(KPixmap *pi, KPixmap &p, const TQColor &c1, const TQColor &c2) { - QPainter px; + TQPainter px; if (pi==0 || pi->isNull()) return; diff --git a/atlantik/libatlantikui/estateview.h b/atlantik/libatlantikui/estateview.h index 864c8983..7e1d8cdc 100644 --- a/atlantik/libatlantikui/estateview.h +++ b/atlantik/libatlantikui/estateview.h @@ -17,8 +17,8 @@ #ifndef ATLANTIK_ESTATEVIEW_H #define ATLANTIK_ESTATEVIEW_H -#include <qwidget.h> -#include <qpixmap.h> +#include <tqwidget.h> +#include <tqpixmap.h> #include <kpixmap.h> @@ -34,7 +34,7 @@ class EstateView : public QWidget Q_OBJECT public: - EstateView(Estate *estate, EstateOrientation orientation, const QString &, bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects, QWidget *parent, const char *name = 0); + EstateView(Estate *estate, EstateOrientation orientation, const TQString &, bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects, TQWidget *parent, const char *name = 0); void setViewProperties(bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects); Estate *estate() { return m_estate; } void updatePE(); @@ -51,20 +51,20 @@ Q_OBJECT void LMBClicked(Estate *estate); protected: - void paintEvent(QPaintEvent *); - void resizeEvent(QResizeEvent *); - void mousePressEvent(QMouseEvent *); + void paintEvent(TQPaintEvent *); + void resizeEvent(TQResizeEvent *); + void mousePressEvent(TQMouseEvent *); private: void updateToolTip(); - QPixmap *rotatePixmap(QPixmap *); + TQPixmap *rotatePixmap(TQPixmap *); KPixmap *rotatePixmap(KPixmap *); - void drawQuartzBlocks(KPixmap *pi, KPixmap &p, const QColor &c1, const QColor &c2); + void drawQuartzBlocks(KPixmap *pi, KPixmap &p, const TQColor &c1, const TQColor &c2); void repositionPortfolioEstate(); Estate *m_estate; - QPixmap *qpixmap, *icon; + TQPixmap *qpixmap, *icon; KPixmap *m_quartzBlocks; bool m_indicateUnowned, m_highliteUnowned, m_darkenMortgaged, m_quartzEffects; bool b_recreate, m_recreateQuartz; diff --git a/atlantik/libatlantikui/kwrappedlistviewitem.cpp b/atlantik/libatlantikui/kwrappedlistviewitem.cpp index 7bd9e2cf..38c0d636 100644 --- a/atlantik/libatlantikui/kwrappedlistviewitem.cpp +++ b/atlantik/libatlantikui/kwrappedlistviewitem.cpp @@ -22,8 +22,8 @@ // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. -#include <qheader.h> -#include <qstring.h> +#include <tqheader.h> +#include <tqstring.h> #include <kglobalsettings.h> #include <klistview.h> @@ -31,14 +31,14 @@ #include "kwrappedlistviewitem.h" -KWrappedListViewItem::KWrappedListViewItem( QListView *parent, QString text, QString t2 ) -: QObject(), KListViewItem( parent ) +KWrappedListViewItem::KWrappedListViewItem( TQListView *parent, TQString text, TQString t2 ) +: TQObject(), KListViewItem( parent ) { init( parent, text, t2 ); } -KWrappedListViewItem::KWrappedListViewItem( QListView *parent, QListViewItem *after, QString text, QString t2 ) -: QObject(), KListViewItem( parent, after ) +KWrappedListViewItem::KWrappedListViewItem( TQListView *parent, TQListViewItem *after, TQString text, TQString t2 ) +: TQObject(), KListViewItem( parent, after ) { init( parent, text, t2 ); } @@ -49,7 +49,7 @@ void KWrappedListViewItem::setup() } /* -int KWrappedListViewItem::width( const QFontMetrics&, const QListView*, int ) const +int KWrappedListViewItem::width( const TQFontMetrics&, const TQListView*, int ) const { return m_wrap->boundingRect().width(); } @@ -60,12 +60,12 @@ void KWrappedListViewItem::wrapColumn( int c ) if ( c != m_wrapColumn ) return; - QListView *lv = listView(); + TQListView *lv = listView(); if ( !lv ) return; - QFont font = QFont( KGlobalSettings::generalFont().family(), KGlobalSettings::generalFont().pointSize(), QFont::Normal ); - QFontMetrics fm = QFontMetrics( font ); + TQFont font = TQFont( KGlobalSettings::generalFont().family(), KGlobalSettings::generalFont().pointSize(), TQFont::Normal ); + TQFontMetrics fm = TQFontMetrics( font ); int wrapWidth = lv->width(); for ( int i = 0 ; i < m_wrapColumn ; i++ ) @@ -74,16 +74,16 @@ void KWrappedListViewItem::wrapColumn( int c ) if ( pixmap(c) ) wrapWidth -= ( pixmap( c )->width() + lv->itemMargin() ); - QScrollBar *scrollBar = lv->verticalScrollBar(); + TQScrollBar *scrollBar = lv->verticalScrollBar(); if ( !scrollBar->isHidden() ) wrapWidth -= scrollBar->width(); - QRect rect = QRect( 0, 0, wrapWidth - 20, -1 ); + TQRect rect = TQRect( 0, 0, wrapWidth - 20, -1 ); KWordWrap *wrap = KWordWrap::formatText( fm, rect, 0, m_origText ); setText( c, wrap->wrappedString() ); - int lc = text(c).contains( QChar( '\n' ) ) + 1; + int lc = text(c).contains( TQChar( '\n' ) ) + 1; setHeight( wrap->boundingRect().height() + lc*lv->itemMargin() ); widthChanged( c ); @@ -91,11 +91,11 @@ void KWrappedListViewItem::wrapColumn( int c ) delete wrap; } -void KWrappedListViewItem::init( QListView *parent, QString text, QString t2 ) +void KWrappedListViewItem::init( TQListView *parent, TQString text, TQString t2 ) { m_wrapColumn = 0; setMultiLinesEnabled( true ); - parent->setResizeMode( QListView::LastColumn ); + parent->setResizeMode( TQListView::LastColumn ); m_origText = text; @@ -110,7 +110,7 @@ void KWrappedListViewItem::init( QListView *parent, QString text, QString t2 ) wrapColumn( m_wrapColumn ); - connect( parent->header(), SIGNAL(sizeChange(int, int, int)), this, SLOT(wrapColumn(int))); + connect( parent->header(), TQT_SIGNAL(sizeChange(int, int, int)), this, TQT_SLOT(wrapColumn(int))); } #include "kwrappedlistviewitem.moc" diff --git a/atlantik/libatlantikui/kwrappedlistviewitem.h b/atlantik/libatlantikui/kwrappedlistviewitem.h index 056cef6d..ceda1afe 100644 --- a/atlantik/libatlantikui/kwrappedlistviewitem.h +++ b/atlantik/libatlantikui/kwrappedlistviewitem.h @@ -25,29 +25,29 @@ #ifndef KWRAPPEDLISTVIEWITEM_H #define KWRAPPEDLISTVIEWITEM_H -#include <qobject.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstring.h> #include <klistview.h> class KWordWrap; -class KWrappedListViewItem : public QObject, public KListViewItem +class KWrappedListViewItem : public TQObject, public KListViewItem { Q_OBJECT public: - KWrappedListViewItem( QListView *parent, QString text, QString=QString::null ); - KWrappedListViewItem( QListView *parent, QListViewItem *after, QString text, QString=QString::null ); + KWrappedListViewItem( TQListView *parent, TQString text, QString=TQString::null ); + KWrappedListViewItem( TQListView *parent, TQListViewItem *after, TQString text, QString=TQString::null ); void setup(); -// int width(const QFontMetrics& fm, const QListView* lv, int c) const; +// int width(const TQFontMetrics& fm, const TQListView* lv, int c) const; private slots: void wrapColumn( int c ); private: - void init( QListView *parent, QString text, QString=QString::null ); - QString m_origText; + void init( TQListView *parent, TQString text, QString=TQString::null ); + TQString m_origText; int m_wrapColumn; }; diff --git a/atlantik/libatlantikui/portfolioestate.cpp b/atlantik/libatlantikui/portfolioestate.cpp index 625fb055..3bfed677 100644 --- a/atlantik/libatlantikui/portfolioestate.cpp +++ b/atlantik/libatlantikui/portfolioestate.cpp @@ -14,20 +14,20 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qcolor.h> -#include <qpainter.h> -#include <qrect.h> +#include <tqcolor.h> +#include <tqpainter.h> +#include <tqrect.h> #include "portfolioestate.moc" #include "estate.h" -PortfolioEstate::PortfolioEstate(Estate *estate, Player *player, bool alwaysOwned, QWidget *parent, const char *name) : QWidget(parent, name) +PortfolioEstate::PortfolioEstate(Estate *estate, Player *player, bool alwaysOwned, TQWidget *parent, const char *name) : TQWidget(parent, name) { m_estate = estate; m_player = player; m_alwaysOwned = alwaysOwned; - QSize s(PE_WIDTH, PE_HEIGHT); + TQSize s(PE_WIDTH, PE_HEIGHT); setFixedSize(s); b_recreate = true; @@ -39,16 +39,16 @@ void PortfolioEstate::estateChanged() update(); } -QPixmap PortfolioEstate::drawPixmap(Estate *estate, Player *player, bool alwaysOwned) +TQPixmap PortfolioEstate::drawPixmap(Estate *estate, Player *player, bool alwaysOwned) { - QColor lightGray(204, 204, 204), darkGray(153, 153, 153); - QPixmap qpixmap(PE_WIDTH, PE_HEIGHT); - QPainter painter; + TQColor lightGray(204, 204, 204), darkGray(153, 153, 153); + TQPixmap qpixmap(PE_WIDTH, PE_HEIGHT); + TQPainter painter; painter.begin(&qpixmap); painter.setPen(lightGray); painter.setBrush(white); - painter.drawRect(QRect(0, 0, PE_WIDTH, PE_HEIGHT)); + painter.drawRect(TQRect(0, 0, PE_WIDTH, PE_HEIGHT)); if (alwaysOwned || (estate && estate->isOwned() && player == estate->owner())) { painter.setPen(darkGray); @@ -77,7 +77,7 @@ QPixmap PortfolioEstate::drawPixmap(Estate *estate, Player *player, bool alwaysO return qpixmap; } -void PortfolioEstate::paintEvent(QPaintEvent *) +void PortfolioEstate::paintEvent(TQPaintEvent *) { if (b_recreate) { @@ -87,7 +87,7 @@ void PortfolioEstate::paintEvent(QPaintEvent *) bitBlt(this, 0, 0, &m_pixmap); } -void PortfolioEstate::mousePressEvent(QMouseEvent *e) +void PortfolioEstate::mousePressEvent(TQMouseEvent *e) { if (e->button()==LeftButton) emit estateClicked(m_estate); diff --git a/atlantik/libatlantikui/portfolioestate.h b/atlantik/libatlantikui/portfolioestate.h index 65bd5db3..fb1dc8d3 100644 --- a/atlantik/libatlantikui/portfolioestate.h +++ b/atlantik/libatlantikui/portfolioestate.h @@ -17,8 +17,8 @@ #ifndef ATLANTIK_PORTFOLIOESTATE_H #define ATLANTIK_PORTFOLIOESTATE_H -#include <qpixmap.h> -#include <qwidget.h> +#include <tqpixmap.h> +#include <tqwidget.h> #define PE_WIDTH 13 #define PE_HEIGHT 16 @@ -31,13 +31,13 @@ class PortfolioEstate : public QWidget Q_OBJECT public: - PortfolioEstate(Estate *estate, Player *player, bool alwaysOwned, QWidget *parent, const char *name = 0); + PortfolioEstate(Estate *estate, Player *player, bool alwaysOwned, TQWidget *parent, const char *name = 0); Estate *estate() { return m_estate; } - static QPixmap drawPixmap(Estate *estate, Player *player = 0, bool alwaysOwned = true); + static TQPixmap drawPixmap(Estate *estate, Player *player = 0, bool alwaysOwned = true); protected: - void paintEvent(QPaintEvent *); - void mousePressEvent(QMouseEvent *); + void paintEvent(TQPaintEvent *); + void mousePressEvent(TQMouseEvent *); private slots: void estateChanged(); @@ -48,7 +48,7 @@ signals: private: Estate *m_estate; Player *m_player; - QPixmap m_pixmap; + TQPixmap m_pixmap; bool b_recreate, m_alwaysOwned; }; diff --git a/atlantik/libatlantikui/portfolioview.cpp b/atlantik/libatlantikui/portfolioview.cpp index c07d426b..6725cbca 100644 --- a/atlantik/libatlantikui/portfolioview.cpp +++ b/atlantik/libatlantikui/portfolioview.cpp @@ -14,8 +14,8 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qpainter.h> -#include <qcursor.h> +#include <tqpainter.h> +#include <tqcursor.h> #include <kdebug.h> #include <kdialogbase.h> @@ -40,7 +40,7 @@ #define PE_MARGINH 2 #define ICONSIZE 48 -PortfolioView::PortfolioView(AtlanticCore *core, Player *player, QColor activeColor, QColor inactiveColor, QWidget *parent, const char *name) : QWidget(parent, name) +PortfolioView::PortfolioView(AtlanticCore *core, Player *player, TQColor activeColor, TQColor inactiveColor, TQWidget *parent, const char *name) : TQWidget(parent, name) { m_atlanticCore = core; m_player = player; @@ -79,14 +79,14 @@ void PortfolioView::buildPortfolio() clearPortfolio(); // Loop through estate groups in order - QPtrList<EstateGroup> estateGroups = m_atlanticCore->estateGroups(); + TQPtrList<EstateGroup> estateGroups = m_atlanticCore->estateGroups(); PortfolioEstate *lastPE = 0, *firstPEprevGroup = 0; int x = 100, y = 25, marginHint = 5, bottom; bottom = ICONSIZE - PE_HEIGHT - marginHint; EstateGroup *estateGroup; - for (QPtrListIterator<EstateGroup> it(estateGroups); *it; ++it) + for (TQPtrListIterator<EstateGroup> it(estateGroups); *it; ++it) { if ((estateGroup = *it)) { @@ -94,9 +94,9 @@ void PortfolioView::buildPortfolio() lastPE = 0; // Loop through estates - QPtrList<Estate> estates = m_atlanticCore->estates(); + TQPtrList<Estate> estates = m_atlanticCore->estates(); Estate *estate; - for (QPtrListIterator<Estate> it(estates); *it; ++it) + for (TQPtrListIterator<Estate> it(estates); *it; ++it) { if ((estate = *it) && estate->estateGroup() == estateGroup) { @@ -104,7 +104,7 @@ void PortfolioView::buildPortfolio() PortfolioEstate *portfolioEstate = new PortfolioEstate(estate, m_player, false, this, "portfolioestate"); m_portfolioEstates.append(portfolioEstate); - connect(portfolioEstate, SIGNAL(estateClicked(Estate *)), this, SIGNAL(estateClicked(Estate *))); + connect(portfolioEstate, TQT_SIGNAL(estateClicked(Estate *)), this, TQT_SIGNAL(estateClicked(Estate *))); if (lastPE) { x = lastPE->x() + 2; @@ -130,7 +130,7 @@ void PortfolioView::buildPortfolio() portfolioEstate->setGeometry(x, y, portfolioEstate->width(), portfolioEstate->height()); portfolioEstate->show(); - connect(estate, SIGNAL(changed()), portfolioEstate, SLOT(estateChanged())); + connect(estate, TQT_SIGNAL(changed()), portfolioEstate, TQT_SLOT(estateChanged())); lastPE = portfolioEstate; } @@ -159,9 +159,9 @@ void PortfolioView::loadIcon() if (!m_imageName.isEmpty()) { - QString filename = locate("data", "atlantik/themes/default/tokens/" + m_imageName); + TQString filename = locate("data", "atlantik/themes/default/tokens/" + m_imageName); if (KStandardDirs::exists(filename)) - m_image = new QPixmap(filename); + m_image = new TQPixmap(filename); } if (!m_image) @@ -171,31 +171,31 @@ void PortfolioView::loadIcon() /* m_imageName = "hamburger.png"; - QString filename = locate("data", "atlantik/themes/default/tokens/" + m_imageName); + TQString filename = locate("data", "atlantik/themes/default/tokens/" + m_imageName); if (KStandardDirs::exists(filename)) - m_image = new QPixmap(filename); + m_image = new TQPixmap(filename); */ } else if (ICONSIZE > minimumHeight()) setMinimumHeight(ICONSIZE); - QWMatrix m; + TQWMatrix m; m.scale(double(ICONSIZE) / m_image->width(), double(ICONSIZE) / m_image->height()); - QPixmap *scaledPixmap = new QPixmap(ICONSIZE, ICONSIZE); + TQPixmap *scaledPixmap = new TQPixmap(ICONSIZE, ICONSIZE); *scaledPixmap = m_image->xForm(m); delete m_image; m_image = scaledPixmap; } -void PortfolioView::paintEvent(QPaintEvent *) +void PortfolioView::paintEvent(TQPaintEvent *) { if (b_recreate) { delete qpixmap; - qpixmap = new QPixmap(width(), height()); + qpixmap = new TQPixmap(width(), height()); - QPainter painter; + TQPainter painter; painter.begin(qpixmap, this); painter.setPen(Qt::white); @@ -216,17 +216,17 @@ void PortfolioView::paintEvent(QPaintEvent *) } painter.setPen(Qt::white); - painter.setFont(QFont(KGlobalSettings::generalFont().family(), KGlobalSettings::generalFont().pointSize(), QFont::Bold)); + painter.setFont(TQFont(KGlobalSettings::generalFont().family(), KGlobalSettings::generalFont().pointSize(), TQFont::Bold)); painter.drawText(ICONSIZE + KDialog::marginHint(), 15, m_player->name()); if ( m_portfolioEstates.count() ) - painter.drawText(width() - 50, 15, QString::number(m_player->money())); + painter.drawText(width() - 50, 15, TQString::number(m_player->money())); else { painter.setPen(Qt::black); painter.setBrush(Qt::white); - painter.setFont(QFont(KGlobalSettings::generalFont().family(), KGlobalSettings::generalFont().pointSize(), QFont::Normal)); + painter.setFont(TQFont(KGlobalSettings::generalFont().family(), KGlobalSettings::generalFont().pointSize(), TQFont::Normal)); painter.drawText(ICONSIZE + KDialog::marginHint(), 30, m_player->host()); } @@ -235,7 +235,7 @@ void PortfolioView::paintEvent(QPaintEvent *) bitBlt(this, 0, 0, qpixmap); } -void PortfolioView::resizeEvent(QResizeEvent *) +void PortfolioView::resizeEvent(TQResizeEvent *) { b_recreate = true; } @@ -248,7 +248,7 @@ void PortfolioView::playerChanged() update(); } -void PortfolioView::mousePressEvent(QMouseEvent *e) +void PortfolioView::mousePressEvent(TQMouseEvent *e) { Player *playerSelf = m_atlanticCore->playerSelf(); @@ -269,8 +269,8 @@ void PortfolioView::mousePressEvent(QMouseEvent *e) rmbMenu->setItemEnabled( 0, m_atlanticCore->selfIsMaster() ); } - connect(rmbMenu, SIGNAL(activated(int)), this, SLOT(slotMenuAction(int))); - QPoint g = QCursor::pos(); + connect(rmbMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotMenuAction(int))); + TQPoint g = TQCursor::pos(); rmbMenu->exec(g); } } diff --git a/atlantik/libatlantikui/portfolioview.h b/atlantik/libatlantikui/portfolioview.h index 26317e2b..d1443a3e 100644 --- a/atlantik/libatlantikui/portfolioview.h +++ b/atlantik/libatlantikui/portfolioview.h @@ -17,9 +17,9 @@ #ifndef ATLANTIK_PORTFOLIOVIEW_H #define ATLANTIK_PORTFOLIOVIEW_H -#include <qwidget.h> -#include <qpixmap.h> -#include <qptrlist.h> +#include <tqwidget.h> +#include <tqpixmap.h> +#include <tqptrlist.h> #include "portfolioestate.h" #include "libatlantikui_export.h" @@ -35,7 +35,7 @@ class LIBATLANTIKUI_EXPORT PortfolioView : public QWidget Q_OBJECT public: - PortfolioView(AtlanticCore *core, Player *_player, QColor activeColor, QColor inactiveColor, QWidget *parent, const char *name = 0); + PortfolioView(AtlanticCore *core, Player *_player, TQColor activeColor, TQColor inactiveColor, TQWidget *parent, const char *name = 0); ~PortfolioView(); void buildPortfolio(); @@ -44,9 +44,9 @@ public: Player *player(); protected: - void paintEvent(QPaintEvent *); - void resizeEvent(QResizeEvent *); - void mousePressEvent(QMouseEvent *); + void paintEvent(TQPaintEvent *); + void resizeEvent(TQResizeEvent *); + void mousePressEvent(TQMouseEvent *); signals: void newTrade(Player *player); @@ -63,11 +63,11 @@ private: AtlanticCore *m_atlanticCore; Player *m_player; PortfolioEstate *m_lastPE; - QColor m_activeColor, m_inactiveColor; - QPixmap *qpixmap, *m_image; - QString m_imageName; + TQColor m_activeColor, m_inactiveColor; + TQPixmap *qpixmap, *m_image; + TQString m_imageName; bool b_recreate; - QPtrList<PortfolioEstate> m_portfolioEstates; + TQPtrList<PortfolioEstate> m_portfolioEstates; }; #endif diff --git a/atlantik/libatlantikui/token.cpp b/atlantik/libatlantikui/token.cpp index 6f13333f..c77aeadb 100644 --- a/atlantik/libatlantikui/token.cpp +++ b/atlantik/libatlantikui/token.cpp @@ -16,9 +16,9 @@ #include <iostream> -#include <qpainter.h> -#include <qpixmap.h> -#include <qfont.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqfont.h> #include <kdebug.h> @@ -33,14 +33,14 @@ #define TOKEN_ICONSIZE 32 -Token::Token(Player *player, AtlantikBoard *parent, const char *name) : QWidget(parent, name) +Token::Token(Player *player, AtlantikBoard *parent, const char *name) : TQWidget(parent, name) { setBackgroundMode(NoBackground); // avoid flickering m_parentBoard = parent; m_player = player; - connect(m_player, SIGNAL(changed(Player *)), this, SLOT(playerChanged())); + connect(m_player, TQT_SIGNAL(changed(Player *)), this, TQT_SLOT(playerChanged())); m_inJail = m_player->inJail(); m_location = m_player->location(); @@ -53,7 +53,7 @@ Token::Token(Player *player, AtlantikBoard *parent, const char *name) : QWidget( m_image = 0; loadIcon(); - setFixedSize(QSize(TOKEN_ICONSIZE, TOKEN_ICONSIZE + KGlobalSettings::generalFont().pointSize())); + setFixedSize(TQSize(TOKEN_ICONSIZE, TOKEN_ICONSIZE + KGlobalSettings::generalFont().pointSize())); } Token::~Token() @@ -96,37 +96,37 @@ void Token::loadIcon() if (!m_imageName.isEmpty()) { - QString filename = locate("data", "atlantik/themes/default/tokens/" + m_imageName); + TQString filename = locate("data", "atlantik/themes/default/tokens/" + m_imageName); if (KStandardDirs::exists(filename)) - m_image = new QPixmap(filename); + m_image = new TQPixmap(filename); } if (!m_image) { m_imageName = "hamburger.png"; - QString filename = locate("data", "atlantik/themes/default/tokens/" + m_imageName); + TQString filename = locate("data", "atlantik/themes/default/tokens/" + m_imageName); if (KStandardDirs::exists(filename)) - m_image = new QPixmap(filename); + m_image = new TQPixmap(filename); } - QWMatrix m; + TQWMatrix m; m.scale(double(TOKEN_ICONSIZE) / m_image->width(), double(TOKEN_ICONSIZE) / m_image->height()); - QPixmap *scaledPixmap = new QPixmap(TOKEN_ICONSIZE, TOKEN_ICONSIZE); + TQPixmap *scaledPixmap = new TQPixmap(TOKEN_ICONSIZE, TOKEN_ICONSIZE); *scaledPixmap = m_image->xForm(m); delete m_image; m_image = scaledPixmap; } -void Token::paintEvent(QPaintEvent *) +void Token::paintEvent(TQPaintEvent *) { if (b_recreate) { delete qpixmap; - qpixmap = new QPixmap(width(), height()); + qpixmap = new TQPixmap(width(), height()); - QPainter painter; + TQPainter painter; painter.begin(qpixmap, this); if (m_image) @@ -143,15 +143,15 @@ void Token::paintEvent(QPaintEvent *) painter.drawRect(0, TOKEN_ICONSIZE, width(), KGlobalSettings::generalFont().pointSize()); painter.setPen(Qt::white); - painter.setFont(QFont(KGlobalSettings::generalFont().family(), KGlobalSettings::generalFont().pointSize(), QFont::DemiBold)); - painter.drawText(1, height()-1, (m_player ? m_player->name() : QString::null)); + painter.setFont(TQFont(KGlobalSettings::generalFont().family(), KGlobalSettings::generalFont().pointSize(), TQFont::DemiBold)); + painter.drawText(1, height()-1, (m_player ? m_player->name() : TQString::null)); b_recreate = false; } bitBlt(this, 0, 0, qpixmap); } -void Token::resizeEvent(QResizeEvent *) +void Token::resizeEvent(TQResizeEvent *) { b_recreate = true; } diff --git a/atlantik/libatlantikui/token.h b/atlantik/libatlantikui/token.h index f0e52f2b..81408501 100644 --- a/atlantik/libatlantikui/token.h +++ b/atlantik/libatlantikui/token.h @@ -17,7 +17,7 @@ #ifndef ATLANTIK_TOKEN_H #define ATLANTIK_TOKEN_H -#include <qwidget.h> +#include <tqwidget.h> class QPixmap; @@ -44,8 +44,8 @@ Q_OBJECT void playerChanged(); protected: - void paintEvent(QPaintEvent *); - void resizeEvent(QResizeEvent *); + void paintEvent(TQPaintEvent *); + void resizeEvent(TQResizeEvent *); private: void loadIcon(); @@ -55,8 +55,8 @@ private: bool m_inJail; AtlantikBoard *m_parentBoard; bool b_recreate; - QPixmap *qpixmap, *m_image; - QString m_imageName; + TQPixmap *qpixmap, *m_image; + TQString m_imageName; }; #endif diff --git a/atlantik/libatlantikui/trade_widget.cpp b/atlantik/libatlantikui/trade_widget.cpp index b2658abb..be8b2749 100644 --- a/atlantik/libatlantikui/trade_widget.cpp +++ b/atlantik/libatlantikui/trade_widget.cpp @@ -16,15 +16,15 @@ #include <iostream> -#include <qlayout.h> -#include <qhgroupbox.h> -#include <qheader.h> -#include <qpopupmenu.h> -#include <qcursor.h> -#include <qvalidator.h> -#include <qmap.h> -#include <qlabel.h> -#include <qspinbox.h> +#include <tqlayout.h> +#include <tqhgroupbox.h> +#include <tqheader.h> +#include <tqpopupmenu.h> +#include <tqcursor.h> +#include <tqvalidator.h> +#include <tqmap.h> +#include <tqlabel.h> +#include <tqspinbox.h> #include <klocale.h> #include <klistview.h> @@ -44,8 +44,8 @@ #include "trade_widget.moc" -TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, QWidget *parent, const char *name) - : QWidget(parent, name, +TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, TQWidget *parent, const char *name) + : TQWidget(parent, name, WType_Dialog | WStyle_Customize | WStyle_DialogBorder | WStyle_Title | WStyle_Minimize | WStyle_ContextHelp ) { @@ -54,21 +54,21 @@ TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, QWidget *pa setCaption(i18n("Trade %1").arg(trade->tradeId())); - QVBoxLayout *listCompBox = new QVBoxLayout(this, KDialog::marginHint()); + TQVBoxLayout *listCompBox = new TQVBoxLayout(this, KDialog::marginHint()); - m_updateComponentBox = new QHGroupBox(i18n("Add Component"), this); + m_updateComponentBox = new TQHGroupBox(i18n("Add Component"), this); listCompBox->addWidget(m_updateComponentBox); m_editTypeCombo = new KComboBox(m_updateComponentBox); m_editTypeCombo->insertItem(i18n("Estate")); m_editTypeCombo->insertItem(i18n("Money")); - connect(m_editTypeCombo, SIGNAL(activated(int)), this, SLOT(setTypeCombo(int))); + connect(m_editTypeCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setTypeCombo(int))); m_estateCombo = new KComboBox(m_updateComponentBox); - QPtrList<Estate> estateList = m_atlanticCore->estates(); + TQPtrList<Estate> estateList = m_atlanticCore->estates(); Estate *estate; - for (QPtrListIterator<Estate> it(estateList); *it; ++it) + for (TQPtrListIterator<Estate> it(estateList); *it; ++it) { if ((estate = *it) && estate->isOwned()) { @@ -78,22 +78,22 @@ TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, QWidget *pa } } - connect(m_estateCombo, SIGNAL(activated(int)), this, SLOT(setEstateCombo(int))); + connect(m_estateCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setEstateCombo(int))); - m_moneyBox = new QSpinBox(0, 10000, 1, m_updateComponentBox); + m_moneyBox = new TQSpinBox(0, 10000, 1, m_updateComponentBox); - QPtrList<Player> playerList = m_atlanticCore->players(); + TQPtrList<Player> playerList = m_atlanticCore->players(); Player *player, *pSelf = m_atlanticCore->playerSelf(); - m_fromLabel = new QLabel(m_updateComponentBox); + m_fromLabel = new TQLabel(m_updateComponentBox); m_fromLabel->setText(i18n("From")); m_playerFromCombo = new KComboBox(m_updateComponentBox); - m_toLabel = new QLabel(m_updateComponentBox); + m_toLabel = new TQLabel(m_updateComponentBox); m_toLabel->setText(i18n("To")); m_playerTargetCombo = new KComboBox(m_updateComponentBox); - for (QPtrListIterator<Player> it(playerList); *it; ++it) + for (TQPtrListIterator<Player> it(playerList); *it; ++it) { if ((player = *it) && player->game() == pSelf->game()) { @@ -105,14 +105,14 @@ TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, QWidget *pa m_playerTargetMap[m_playerTargetCombo->count() - 1] = player; m_playerTargetRevMap[player] = m_playerTargetCombo->count() - 1; - connect(player, SIGNAL(changed(Player *)), this, SLOT(playerChanged(Player *))); + connect(player, TQT_SIGNAL(changed(Player *)), this, TQT_SLOT(playerChanged(Player *))); } } m_updateButton = new KPushButton(i18n("Update"), m_updateComponentBox); m_updateButton->setEnabled(false); - connect(m_updateButton, SIGNAL(clicked()), this, SLOT(updateComponent())); + connect(m_updateButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateComponent())); m_componentList = new KListView(this, "componentList"); listCompBox->addWidget(m_componentList); @@ -122,26 +122,26 @@ TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, QWidget *pa m_componentList->addColumn(i18n("Player")); m_componentList->addColumn(i18n("Item")); - connect(m_componentList, SIGNAL(contextMenu(KListView*, QListViewItem *, const QPoint&)), SLOT(contextMenu(KListView *, QListViewItem *, const QPoint&))); - connect(m_componentList, SIGNAL(clicked(QListViewItem *)), this, SLOT(setCombos(QListViewItem *))); + connect(m_componentList, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem *, const TQPoint&)), TQT_SLOT(contextMenu(KListView *, TQListViewItem *, const TQPoint&))); + connect(m_componentList, TQT_SIGNAL(clicked(TQListViewItem *)), this, TQT_SLOT(setCombos(TQListViewItem *))); - QHBoxLayout *actionBox = new QHBoxLayout(this, 0, KDialog::spacingHint()); + TQHBoxLayout *actionBox = new TQHBoxLayout(this, 0, KDialog::spacingHint()); listCompBox->addItem(actionBox); - actionBox->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); + actionBox->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum)); m_rejectButton = new KPushButton(BarIcon("cancel", KIcon::SizeSmall), i18n("Reject"), this); actionBox->addWidget(m_rejectButton); - connect(m_rejectButton, SIGNAL(clicked()), this, SLOT(reject())); + connect(m_rejectButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); m_acceptButton = new KPushButton(BarIcon("ok", KIcon::SizeSmall), i18n("Accept"), this); // m_acceptButton->setEnabled(false); actionBox->addWidget(m_acceptButton); - connect(m_acceptButton, SIGNAL(clicked()), this, SLOT(accept())); + connect(m_acceptButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept())); - m_status = new QLabel(this); + m_status = new TQLabel(this); listCompBox->addWidget(m_status); m_status->setText( i18n( "%1 out of %2 players accept current trade proposal." ).arg( m_trade->count( true ) ).arg( m_trade->count( false ) ) ); @@ -149,14 +149,14 @@ TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, QWidget *pa // mPlayerList->setRootIsDecorated(true); // mPlayerList->setResizeMode(KListView::AllColumns); - connect(m_trade, SIGNAL(itemAdded(TradeItem *)), this, SLOT(tradeItemAdded(TradeItem *))); - connect(m_trade, SIGNAL(itemRemoved(TradeItem *)), this, SLOT(tradeItemRemoved(TradeItem *))); - connect(m_trade, SIGNAL(changed(Trade *)), this, SLOT(tradeChanged())); - connect(m_trade, SIGNAL(rejected(Player *)), this, SLOT(tradeRejected(Player *))); - connect(this, SIGNAL(updateEstate(Trade *, Estate *, Player *)), m_trade, SIGNAL(updateEstate(Trade *, Estate *, Player *))); - connect(this, SIGNAL(updateMoney(Trade *, unsigned int, Player *, Player *)), m_trade, SIGNAL(updateMoney(Trade *, unsigned int, Player *, Player *))); - connect(this, SIGNAL(reject(Trade *)), m_trade, SIGNAL(reject(Trade *))); - connect(this, SIGNAL(accept(Trade *)), m_trade, SIGNAL(accept(Trade *))); + connect(m_trade, TQT_SIGNAL(itemAdded(TradeItem *)), this, TQT_SLOT(tradeItemAdded(TradeItem *))); + connect(m_trade, TQT_SIGNAL(itemRemoved(TradeItem *)), this, TQT_SLOT(tradeItemRemoved(TradeItem *))); + connect(m_trade, TQT_SIGNAL(changed(Trade *)), this, TQT_SLOT(tradeChanged())); + connect(m_trade, TQT_SIGNAL(rejected(Player *)), this, TQT_SLOT(tradeRejected(Player *))); + connect(this, TQT_SIGNAL(updateEstate(Trade *, Estate *, Player *)), m_trade, TQT_SIGNAL(updateEstate(Trade *, Estate *, Player *))); + connect(this, TQT_SIGNAL(updateMoney(Trade *, unsigned int, Player *, Player *)), m_trade, TQT_SIGNAL(updateMoney(Trade *, unsigned int, Player *, Player *))); + connect(this, TQT_SIGNAL(reject(Trade *)), m_trade, TQT_SIGNAL(reject(Trade *))); + connect(this, TQT_SIGNAL(accept(Trade *)), m_trade, TQT_SIGNAL(accept(Trade *))); setTypeCombo(m_editTypeCombo->currentItem()); setEstateCombo(m_estateCombo->currentItem()); @@ -164,7 +164,7 @@ TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, QWidget *pa m_contextTradeItem = 0; } -void TradeDisplay::closeEvent(QCloseEvent *e) +void TradeDisplay::closeEvent(TQCloseEvent *e) { // Don't send network event when trade is already rejected if (m_trade->isRejected()) @@ -177,11 +177,11 @@ void TradeDisplay::closeEvent(QCloseEvent *e) void TradeDisplay::tradeItemAdded(TradeItem *tradeItem) { - KListViewItem *item = new KListViewItem(m_componentList, (tradeItem->from() ? tradeItem->from()->name() : QString("?")), i18n("gives is transitive ;)", "gives"), (tradeItem->to() ? tradeItem->to()->name() : QString("?")), tradeItem->text()); - connect(tradeItem, SIGNAL(changed(TradeItem *)), this, SLOT(tradeItemChanged(TradeItem *))); + KListViewItem *item = new KListViewItem(m_componentList, (tradeItem->from() ? tradeItem->from()->name() : TQString("?")), i18n("gives is transitive ;)", "gives"), (tradeItem->to() ? tradeItem->to()->name() : TQString("?")), tradeItem->text()); + connect(tradeItem, TQT_SIGNAL(changed(TradeItem *)), this, TQT_SLOT(tradeItemChanged(TradeItem *))); - item->setPixmap(0, QPixmap(SmallIcon("personal"))); - item->setPixmap(2, QPixmap(SmallIcon("personal"))); + item->setPixmap(0, TQPixmap(SmallIcon("personal"))); + item->setPixmap(2, TQPixmap(SmallIcon("personal"))); if (TradeEstate *tradeEstate = dynamic_cast<TradeEstate*>(tradeItem)) item->setPixmap(3, PortfolioEstate::drawPixmap(tradeEstate->estate())); @@ -204,10 +204,10 @@ void TradeDisplay::tradeItemChanged(TradeItem *t) KListViewItem *item = m_componentMap[t]; if (item) { - item->setText(0, t->from() ? t->from()->name() : QString("?")); - item->setPixmap(0, QPixmap(SmallIcon("personal"))); - item->setText(2, t->to() ? t->to()->name() : QString("?")); - item->setPixmap(2, QPixmap(SmallIcon("personal"))); + item->setText(0, t->from() ? t->from()->name() : TQString("?")); + item->setPixmap(0, TQPixmap(SmallIcon("personal"))); + item->setText(2, t->to() ? t->to()->name() : TQString("?")); + item->setPixmap(2, TQPixmap(SmallIcon("personal"))); item->setText(3, t->text()); } } @@ -225,7 +225,7 @@ void TradeDisplay::playerChanged(Player *player) m_playerTargetCombo->changeItem(player->name(), m_playerTargetRevMap[player]); TradeItem *item = 0; - for (QMap<KListViewItem *, TradeItem *>::Iterator it=m_componentRevMap.begin() ; it != m_componentRevMap.end() && (item = *it) ; ++it) + for (TQMap<KListViewItem *, TradeItem *>::Iterator it=m_componentRevMap.begin() ; it != m_componentRevMap.end() && (item = *it) ; ++it) tradeItemChanged(item); } @@ -291,7 +291,7 @@ void TradeDisplay::setEstateCombo(int index) m_playerFromCombo->setCurrentItem( m_playerFromRevMap[estate->owner()] ); } -void TradeDisplay::setCombos(QListViewItem *i) +void TradeDisplay::setCombos(TQListViewItem *i) { TradeItem *item = m_componentRevMap[(KListViewItem *)(i)]; if (TradeEstate *tradeEstate = dynamic_cast<TradeEstate*>(item)) @@ -348,7 +348,7 @@ void TradeDisplay::accept() emit accept(m_trade); } -void TradeDisplay::contextMenu(KListView *, QListViewItem *i, const QPoint& p) +void TradeDisplay::contextMenu(KListView *, TQListViewItem *i, const TQPoint& p) { m_contextTradeItem = m_componentRevMap[(KListViewItem *)(i)]; @@ -356,7 +356,7 @@ void TradeDisplay::contextMenu(KListView *, QListViewItem *i, const QPoint& p) // rmbMenu->insertTitle( ... ); rmbMenu->insertItem(i18n("Remove From Trade"), 0); - connect(rmbMenu, SIGNAL(activated(int)), this, SLOT(contextMenuClicked(int))); + connect(rmbMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(contextMenuClicked(int))); rmbMenu->exec(p); } diff --git a/atlantik/libatlantikui/trade_widget.h b/atlantik/libatlantikui/trade_widget.h index 642cc919..5c0e0ff7 100644 --- a/atlantik/libatlantikui/trade_widget.h +++ b/atlantik/libatlantikui/trade_widget.h @@ -17,8 +17,8 @@ #ifndef TRADEWIDGET_H #define TRADEWIDGET_H -#include <qwidget.h> -#include <qmap.h> +#include <tqwidget.h> +#include <tqmap.h> #include "libatlantikui_export.h" class QHGroupBox; @@ -41,12 +41,12 @@ class LIBATLANTIKUI_EXPORT TradeDisplay : public QWidget Q_OBJECT public: - TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, QWidget *parent=0, const char *name = 0); + TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, TQWidget *parent=0, const char *name = 0); Trade *trade() { return mTrade; } protected: - void closeEvent(QCloseEvent *e); + void closeEvent(TQCloseEvent *e); private slots: void tradeItemAdded(TradeItem *); @@ -58,13 +58,13 @@ private slots: void setTypeCombo(int); void setEstateCombo(int); - void setCombos(QListViewItem *i); + void setCombos(TQListViewItem *i); void updateComponent(); void reject(); void accept(); - void contextMenu(KListView *l, QListViewItem *i, const QPoint& p); + void contextMenu(KListView *l, TQListViewItem *i, const TQPoint& p); void contextMenuClicked(int item); signals: @@ -74,9 +74,9 @@ signals: void accept(Trade *trade); private: - QHGroupBox *m_updateComponentBox; - QLabel *m_status, *m_fromLabel, *m_toLabel; - QSpinBox *m_moneyBox; + TQHGroupBox *m_updateComponentBox; + TQLabel *m_status, *m_fromLabel, *m_toLabel; + TQSpinBox *m_moneyBox; KComboBox *m_editTypeCombo, *m_playerFromCombo, *m_playerTargetCombo, *m_estateCombo; KListView *m_componentList; @@ -87,12 +87,12 @@ private: TradeItem *m_contextTradeItem; // TODO: Wouldn't QPair make more sense here? - QMap<TradeItem *, KListViewItem *> m_componentMap; - QMap<KListViewItem *, TradeItem *> m_componentRevMap; - QMap<int, Estate *> m_estateMap; - QMap<Estate *, int> m_estateRevMap; - QMap<int, Player *> m_playerFromMap, m_playerTargetMap; - QMap<Player *, int> m_playerFromRevMap, m_playerTargetRevMap; + TQMap<TradeItem *, KListViewItem *> m_componentMap; + TQMap<KListViewItem *, TradeItem *> m_componentRevMap; + TQMap<int, Estate *> m_estateMap; + TQMap<Estate *, int> m_estateRevMap; + TQMap<int, Player *> m_playerFromMap, m_playerTargetMap; + TQMap<Player *, int> m_playerFromRevMap, m_playerTargetRevMap; }; #endif diff --git a/kasteroids/ledmeter.cpp b/kasteroids/ledmeter.cpp index 3df87b8f..1d807d18 100644 --- a/kasteroids/ledmeter.cpp +++ b/kasteroids/ledmeter.cpp @@ -4,11 +4,11 @@ * Part of the KDE project */ -#include <qpainter.h> +#include <tqpainter.h> #include "ledmeter.h" #include "ledmeter.moc" -KALedMeter::KALedMeter( QWidget *parent ) : QFrame( parent ) +KALedMeter::KALedMeter( TQWidget *parent ) : TQFrame( parent ) { mCRanges.setAutoDelete( true ); mRange = 100; @@ -53,7 +53,7 @@ void KALedMeter::setValue( int v ) } } -void KALedMeter::addColorRange( int pc, const QColor &c ) +void KALedMeter::addColorRange( int pc, const TQColor &c ) { ColorRange *cr = new ColorRange; cr->mPc = pc; @@ -62,21 +62,21 @@ void KALedMeter::addColorRange( int pc, const QColor &c ) calcColorRanges(); } -void KALedMeter::resizeEvent( QResizeEvent *e ) +void KALedMeter::resizeEvent( TQResizeEvent *e ) { - QFrame::resizeEvent( e ); + TQFrame::resizeEvent( e ); int w = ( width() - frameWidth() - 2 ) / mCount * mCount; w += frameWidth() + 2; - setFrameRect( QRect( 0, 0, w, height() ) ); + setFrameRect( TQRect( 0, 0, w, height() ) ); } -void KALedMeter::drawContents( QPainter *p ) +void KALedMeter::drawContents( TQPainter *p ) { - QRect b = contentsRect(); + TQRect b = contentsRect(); unsigned cidx = 0; int ncol = mCount; - QColor col = colorGroup().foreground(); + TQColor col = colorGroup().foreground(); if ( !mCRanges.isEmpty() ) { diff --git a/kasteroids/ledmeter.h b/kasteroids/ledmeter.h index ea9b7e96..307b5bfc 100644 --- a/kasteroids/ledmeter.h +++ b/kasteroids/ledmeter.h @@ -7,15 +7,15 @@ #ifndef __LEDMETER_H__ #define __LEDMETER_H__ -#include <qframe.h> -#include <qptrlist.h> +#include <tqframe.h> +#include <tqptrlist.h> class KALedMeter : public QFrame { Q_OBJECT public: - KALedMeter( QWidget *parent ); + KALedMeter( TQWidget *parent ); int range() const { return mRange; } void setRange( int r ); @@ -25,14 +25,14 @@ public: int value () const { return mValue; } - void addColorRange( int pc, const QColor &c ); + void addColorRange( int pc, const TQColor &c ); public slots: void setValue( int v ); protected: - virtual void resizeEvent( QResizeEvent * ); - virtual void drawContents( QPainter * ); + virtual void resizeEvent( TQResizeEvent * ); + virtual void drawContents( TQPainter * ); void calcColorRanges(); protected: @@ -40,14 +40,14 @@ protected: { int mPc; int mValue; - QColor mColor; + TQColor mColor; }; int mRange; int mCount; int mCurrentCount; int mValue; - QPtrList<ColorRange> mCRanges; + TQPtrList<ColorRange> mCRanges; }; #endif diff --git a/kasteroids/sprites.h b/kasteroids/sprites.h index 0b0a718a..43dc34ea 100644 --- a/kasteroids/sprites.h +++ b/kasteroids/sprites.h @@ -7,7 +7,7 @@ #ifndef __SPRITES_H__ #define __SPRITES_H__ -#include <qcanvas.h> +#include <tqcanvas.h> #define ID_ROCK_LARGE 1024 #define ID_ROCK_MEDIUM 1025 @@ -34,7 +34,7 @@ class KMissile : public QCanvasSprite { public: - KMissile( QCanvasPixmapArray *s, QCanvas *c ) : QCanvasSprite( s, c ) + KMissile( TQCanvasPixmapArray *s, TQCanvas *c ) : TQCanvasSprite( s, c ) { myAge = 0; } virtual int rtti() const { return ID_MISSILE; } @@ -49,7 +49,7 @@ private: class KBit : public QCanvasSprite { public: - KBit( QCanvasPixmapArray *s, QCanvas *c ) : QCanvasSprite( s, c ) + KBit( TQCanvasPixmapArray *s, TQCanvas *c ) : TQCanvasSprite( s, c ) { death = 7; } virtual int rtti() const { return ID_BIT; } @@ -65,7 +65,7 @@ private: class KExhaust : public QCanvasSprite { public: - KExhaust( QCanvasPixmapArray *s, QCanvas *c ) : QCanvasSprite( s, c ) + KExhaust( TQCanvasPixmapArray *s, TQCanvas *c ) : TQCanvasSprite( s, c ) { death = 1; } virtual int rtti() const { return ID_EXHAUST; } @@ -81,7 +81,7 @@ private: class KPowerup : public QCanvasSprite { public: - KPowerup( QCanvasPixmapArray *s, QCanvas *c, int t ) : QCanvasSprite( s, c ), + KPowerup( TQCanvasPixmapArray *s, TQCanvas *c, int t ) : TQCanvasSprite( s, c ), myAge( 0 ), type(t) { } virtual int rtti() const { return type; } @@ -97,7 +97,7 @@ protected: class KRock : public QCanvasSprite { public: - KRock (QCanvasPixmapArray *s, QCanvas *c, int t, int sk, int st) : QCanvasSprite( s, c ) + KRock (TQCanvasPixmapArray *s, TQCanvas *c, int t, int sk, int st) : TQCanvasSprite( s, c ) { type = t; skip = cskip = sk; step = st; } void nextFrame() @@ -120,8 +120,8 @@ private: class KShield : public QCanvasSprite { public: - KShield( QCanvasPixmapArray *s, QCanvas *c ) - : QCanvasSprite( s, c ) {} + KShield( TQCanvasPixmapArray *s, TQCanvas *c ) + : TQCanvasSprite( s, c ) {} virtual int rtti() const { return ID_SHIELD; } }; diff --git a/kasteroids/toplevel.cpp b/kasteroids/toplevel.cpp index a4286d2f..256174b6 100644 --- a/kasteroids/toplevel.cpp +++ b/kasteroids/toplevel.cpp @@ -4,11 +4,11 @@ * Part of the KDE project */ -#include <qlabel.h> -#include <qlayout.h> -#include <qlcdnumber.h> -#include <qspinbox.h> -#include <qcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlcdnumber.h> +#include <tqspinbox.h> +#include <tqcheckbox.h> #include <kdebug.h> #include <kapplication.h> @@ -75,76 +75,76 @@ Arts::SimpleSoundServer *soundServer = 0; KAstTopLevel::KAstTopLevel() { - QWidget *mainWin = new QWidget( this ); + TQWidget *mainWin = new TQWidget( this ); mainWin->setFixedSize(640, 480); view = new KAsteroidsView( mainWin ); - connect( view, SIGNAL( shipKilled() ), SLOT( slotShipKilled() ) ); - connect( view, SIGNAL( rockHit(int) ), SLOT( slotRockHit(int) ) ); - connect( view, SIGNAL( rocksRemoved() ), SLOT( slotRocksRemoved() ) ); - connect( view, SIGNAL( updateVitals() ), SLOT( slotUpdateVitals() ) ); - - QVBoxLayout *vb = new QVBoxLayout( mainWin ); - QHBoxLayout *hb = new QHBoxLayout; - QHBoxLayout *hbd = new QHBoxLayout; + connect( view, TQT_SIGNAL( shipKilled() ), TQT_SLOT( slotShipKilled() ) ); + connect( view, TQT_SIGNAL( rockHit(int) ), TQT_SLOT( slotRockHit(int) ) ); + connect( view, TQT_SIGNAL( rocksRemoved() ), TQT_SLOT( slotRocksRemoved() ) ); + connect( view, TQT_SIGNAL( updateVitals() ), TQT_SLOT( slotUpdateVitals() ) ); + + TQVBoxLayout *vb = new TQVBoxLayout( mainWin ); + TQHBoxLayout *hb = new QHBoxLayout; + TQHBoxLayout *hbd = new QHBoxLayout; vb->addLayout( hb ); - QFont labelFont( KGlobalSettings::generalFont().family(), 24 ); - QColorGroup grp( darkGreen, black, QColor( 128, 128, 128 ), - QColor( 64, 64, 64 ), black, darkGreen, black ); - QPalette pal( grp, grp, grp ); + TQFont labelFont( KGlobalSettings::generalFont().family(), 24 ); + TQColorGroup grp( darkGreen, black, TQColor( 128, 128, 128 ), + TQColor( 64, 64, 64 ), black, darkGreen, black ); + TQPalette pal( grp, grp, grp ); mainWin->setPalette( pal ); hb->addSpacing( 10 ); - QLabel *label; - label = new QLabel( i18n("Score"), mainWin ); + TQLabel *label; + label = new TQLabel( i18n("Score"), mainWin ); label->setFont( labelFont ); label->setPalette( pal ); label->setFixedWidth( label->sizeHint().width() ); hb->addWidget( label ); - scoreLCD = new QLCDNumber( 6, mainWin ); - scoreLCD->setFrameStyle( QFrame::NoFrame ); - scoreLCD->setSegmentStyle( QLCDNumber::Flat ); + scoreLCD = new TQLCDNumber( 6, mainWin ); + scoreLCD->setFrameStyle( TQFrame::NoFrame ); + scoreLCD->setSegmentStyle( TQLCDNumber::Flat ); scoreLCD->setFixedWidth( 150 ); scoreLCD->setPalette( pal ); hb->addWidget( scoreLCD ); hb->addStretch( 10 ); - label = new QLabel( i18n("Level"), mainWin ); + label = new TQLabel( i18n("Level"), mainWin ); label->setFont( labelFont ); label->setPalette( pal ); label->setFixedWidth( label->sizeHint().width() ); hb->addWidget( label ); - levelLCD = new QLCDNumber( 2, mainWin ); - levelLCD->setFrameStyle( QFrame::NoFrame ); - levelLCD->setSegmentStyle( QLCDNumber::Flat ); + levelLCD = new TQLCDNumber( 2, mainWin ); + levelLCD->setFrameStyle( TQFrame::NoFrame ); + levelLCD->setSegmentStyle( TQLCDNumber::Flat ); levelLCD->setFixedWidth( 70 ); levelLCD->setPalette( pal ); hb->addWidget( levelLCD ); hb->addStretch( 10 ); - label = new QLabel( i18n("Ships"), mainWin ); + label = new TQLabel( i18n("Ships"), mainWin ); label->setFont( labelFont ); label->setFixedWidth( label->sizeHint().width() ); label->setPalette( pal ); hb->addWidget( label ); - shipsLCD = new QLCDNumber( 1, mainWin ); - shipsLCD->setFrameStyle( QFrame::NoFrame ); - shipsLCD->setSegmentStyle( QLCDNumber::Flat ); + shipsLCD = new TQLCDNumber( 1, mainWin ); + shipsLCD->setFrameStyle( TQFrame::NoFrame ); + shipsLCD->setSegmentStyle( TQLCDNumber::Flat ); shipsLCD->setFixedWidth( 40 ); shipsLCD->setPalette( pal ); hb->addWidget( shipsLCD ); hb->addStrut( 30 ); - QFrame *sep = new QFrame( mainWin ); + TQFrame *sep = new TQFrame( mainWin ); sep->setMaximumHeight( 5 ); - sep->setFrameStyle( QFrame::HLine | QFrame::Raised ); + sep->setFrameStyle( TQFrame::HLine | TQFrame::Raised ); sep->setPalette( pal ); vb->addWidget( sep ); @@ -152,45 +152,45 @@ KAstTopLevel::KAstTopLevel() vb->addWidget( view, 10 ); // -- bottom layout: - QFrame *sep2 = new QFrame( mainWin ); + TQFrame *sep2 = new TQFrame( mainWin ); sep2->setMaximumHeight( 1 ); - sep2->setFrameStyle( QFrame::HLine | QFrame::Raised ); + sep2->setFrameStyle( TQFrame::HLine | TQFrame::Raised ); sep2->setPalette( pal ); vb->addWidget( sep2, 1 ); vb->addLayout( hbd ); - QFont smallFont( KGlobalSettings::generalFont().family(), 14 ); + TQFont smallFont( KGlobalSettings::generalFont().family(), 14 ); hbd->addSpacing( 10 ); - QString sprites_prefix = + TQString sprites_prefix = KGlobal::dirs()->findResourceDir("sprite", "rock1/rock10000.png"); /* - label = new QLabel( i18n( "T" ), mainWin ); + label = new TQLabel( i18n( "T" ), mainWin ); label->setFont( smallFont ); label->setFixedWidth( label->sizeHint().width() ); label->setPalette( pal ); hbd->addWidget( label ); - teleportsLCD = new QLCDNumber( 1, mainWin ); - teleportsLCD->setFrameStyle( QFrame::NoFrame ); - teleportsLCD->setSegmentStyle( QLCDNumber::Flat ); + teleportsLCD = new TQLCDNumber( 1, mainWin ); + teleportsLCD->setFrameStyle( TQFrame::NoFrame ); + teleportsLCD->setSegmentStyle( TQLCDNumber::Flat ); teleportsLCD->setPalette( pal ); teleportsLCD->setFixedHeight( 20 ); hbd->addWidget( teleportsLCD ); hbd->addSpacing( 10 ); */ - QPixmap pm( sprites_prefix + "powerups/brake.png" ); - label = new QLabel( mainWin ); + TQPixmap pm( sprites_prefix + "powerups/brake.png" ); + label = new TQLabel( mainWin ); label->setPixmap( pm ); label->setFixedWidth( label->sizeHint().width() ); label->setPalette( pal ); hbd->addWidget( label ); - brakesLCD = new QLCDNumber( 1, mainWin ); - brakesLCD->setFrameStyle( QFrame::NoFrame ); - brakesLCD->setSegmentStyle( QLCDNumber::Flat ); + brakesLCD = new TQLCDNumber( 1, mainWin ); + brakesLCD->setFrameStyle( TQFrame::NoFrame ); + brakesLCD->setSegmentStyle( TQLCDNumber::Flat ); brakesLCD->setPalette( pal ); brakesLCD->setFixedHeight( 20 ); hbd->addWidget( brakesLCD ); @@ -198,15 +198,15 @@ KAstTopLevel::KAstTopLevel() hbd->addSpacing( 10 ); pm.load( sprites_prefix + "powerups/shield.png" ); - label = new QLabel( mainWin ); + label = new TQLabel( mainWin ); label->setPixmap( pm ); label->setFixedWidth( label->sizeHint().width() ); label->setPalette( pal ); hbd->addWidget( label ); - shieldLCD = new QLCDNumber( 1, mainWin ); - shieldLCD->setFrameStyle( QFrame::NoFrame ); - shieldLCD->setSegmentStyle( QLCDNumber::Flat ); + shieldLCD = new TQLCDNumber( 1, mainWin ); + shieldLCD->setFrameStyle( TQFrame::NoFrame ); + shieldLCD->setSegmentStyle( TQLCDNumber::Flat ); shieldLCD->setPalette( pal ); shieldLCD->setFixedHeight( 20 ); hbd->addWidget( shieldLCD ); @@ -214,32 +214,32 @@ KAstTopLevel::KAstTopLevel() hbd->addSpacing( 10 ); pm.load( sprites_prefix + "powerups/shoot.png" ); - label = new QLabel( mainWin ); + label = new TQLabel( mainWin ); label->setPixmap( pm ); label->setFixedWidth( label->sizeHint().width() ); label->setPalette( pal ); hbd->addWidget( label ); - shootLCD = new QLCDNumber( 1, mainWin ); - shootLCD->setFrameStyle( QFrame::NoFrame ); - shootLCD->setSegmentStyle( QLCDNumber::Flat ); + shootLCD = new TQLCDNumber( 1, mainWin ); + shootLCD->setFrameStyle( TQFrame::NoFrame ); + shootLCD->setSegmentStyle( TQLCDNumber::Flat ); shootLCD->setPalette( pal ); shootLCD->setFixedHeight( 20 ); hbd->addWidget( shootLCD ); hbd->addStretch( 1 ); - label = new QLabel( i18n( "Fuel" ), mainWin ); + label = new TQLabel( i18n( "Fuel" ), mainWin ); label->setFont( smallFont ); label->setFixedWidth( label->sizeHint().width() + 10 ); label->setPalette( pal ); hbd->addWidget( label ); powerMeter = new KALedMeter( mainWin ); - powerMeter->setFrameStyle( QFrame::Box | QFrame::Plain ); + powerMeter->setFrameStyle( TQFrame::Box | TQFrame::Plain ); powerMeter->setRange( MAX_POWER_LEVEL ); powerMeter->addColorRange( 10, darkRed ); - powerMeter->addColorRange( 20, QColor(160, 96, 0) ); + powerMeter->addColorRange( 20, TQColor(160, 96, 0) ); powerMeter->addColorRange( 70, darkGreen ); powerMeter->setCount( 40 ); powerMeter->setPalette( pal ); @@ -280,14 +280,14 @@ KAstTopLevel::~KAstTopLevel() void KAstTopLevel::initKAction() { // game - KStdGameAction::gameNew( this, SLOT( slotNewGame() ), actionCollection() ); - KStdGameAction::highscores( this, SLOT( slotShowHighscores() ), actionCollection() ); - KStdGameAction::pause( this, SLOT( slotPause() ), actionCollection() ); - KStdGameAction::quit(this, SLOT( close() ), actionCollection()); + KStdGameAction::gameNew( this, TQT_SLOT( slotNewGame() ), actionCollection() ); + KStdGameAction::highscores( this, TQT_SLOT( slotShowHighscores() ), actionCollection() ); + KStdGameAction::pause( this, TQT_SLOT( slotPause() ), actionCollection() ); + KStdGameAction::quit(this, TQT_SLOT( close() ), actionCollection()); // settings - KStdAction::keyBindings(this, SLOT( slotKeyConfig() ), actionCollection()); - KStdAction::preferences(this, SLOT( slotPref() ), actionCollection()); + KStdAction::keyBindings(this, TQT_SLOT( slotKeyConfig() ), actionCollection()); + KStdAction::preferences(this, TQT_SLOT( slotPref() ), actionCollection()); // keyboard-only actions keycodes.insert(Thrust, new KAction(i18n("Thrust"), Qt::Key_Up, 0, 0, actionCollection(), "Thrust")); @@ -297,16 +297,16 @@ void KAstTopLevel::initKAction() // keycodes.insert(Teleport, new KAction(i18n("Teleport"), Qt::Key_Z, 0, 0, actionCollection(), "Teleport")); keycodes.insert(Brake, new KAction(i18n("Brake"), Qt::Key_X, 0, 0, actionCollection(), "Brake")); keycodes.insert(Shield, new KAction(i18n("Shield"), Qt::Key_S, 0, 0, actionCollection(), "Shield")); - launchAction = new KAction(i18n("Launch"), Qt::Key_L, this, SLOT(slotLaunch()), actionCollection(), "Launch"); + launchAction = new KAction(i18n("Launch"), Qt::Key_L, this, TQT_SLOT(slotLaunch()), actionCollection(), "Launch"); } void KAstTopLevel::loadSettings() { soundDict.insert("ShipDestroyed", - new QString( locate("sounds", Settings::soundShipDestroyed())) ); + new TQString( locate("sounds", Settings::soundShipDestroyed())) ); soundDict.insert("RockDestroyed", - new QString( locate("sounds", Settings::soundRockDestroyed())) ); + new TQString( locate("sounds", Settings::soundRockDestroyed())) ); shipsRemain = Settings::numShips(); } @@ -319,14 +319,14 @@ void KAstTopLevel::playSound( const char *snd ) if (!Settings::playSounds()) return; - QString *filename = soundDict[ snd ]; + TQString *filename = soundDict[ snd ]; if (filename) { KAudioPlayer::play(*filename); } return; // remove this and the above when the sound below is working correctly #ifdef KA_ENABLE_SOUND - QString *filename = soundDict[ snd ]; + TQString *filename = soundDict[ snd ]; if (filename) { kdDebug(12012)<< "playing " << *filename << endl; if(!soundServer->isNull()) soundServer->play(filename->latin1()); @@ -334,15 +334,15 @@ return; // remove this and the above when the sound below is working correctly #endif } -bool KAstTopLevel::eventFilter( QObject* /* object */, QEvent *event ) +bool KAstTopLevel::eventFilter( TQObject* /* object */, TQEvent *event ) { - QKeyEvent *e = static_cast<QKeyEvent*>(event); - if (event->type() == QEvent::AccelOverride) + TQKeyEvent *e = static_cast<TQKeyEvent*>(event); + if (event->type() == TQEvent::AccelOverride) { if (processKeyPress(e)) return true; else return false; } - else if (event->type() == QEvent::KeyRelease) + else if (event->type() == TQEvent::KeyRelease) { if (processKeyRelease(e)) return true; else return false; @@ -350,11 +350,11 @@ bool KAstTopLevel::eventFilter( QObject* /* object */, QEvent *event ) return false; } -bool KAstTopLevel::processKeyPress( QKeyEvent *event ) +bool KAstTopLevel::processKeyPress( TQKeyEvent *event ) { KKey key(event); Action a = Invalid; - QMap<Action, KAction*>::Iterator it = keycodes.begin(); + TQMap<Action, KAction*>::Iterator it = keycodes.begin(); for (; it != keycodes.end(); ++it) { if ( (*it)->shortcut().contains(key) ) @@ -403,11 +403,11 @@ bool KAstTopLevel::processKeyPress( QKeyEvent *event ) return true; } -bool KAstTopLevel::processKeyRelease( QKeyEvent *event ) +bool KAstTopLevel::processKeyRelease( TQKeyEvent *event ) { KKey key(event); Action a = Invalid; - QMap<Action, KAction*>::Iterator it = keycodes.begin(); + TQMap<Action, KAction*>::Iterator it = keycodes.begin(); for (; it != keycodes.end(); ++it) { if ( (*it)->shortcut().contains(key) ) @@ -454,7 +454,7 @@ bool KAstTopLevel::processKeyRelease( QKeyEvent *event ) return true; } -void KAstTopLevel::focusInEvent( QFocusEvent *e ) +void KAstTopLevel::focusInEvent( TQFocusEvent *e ) { view->pause( false ); #if defined Q_WS_X11 && ! defined K_WS_QTONLY @@ -463,7 +463,7 @@ void KAstTopLevel::focusInEvent( QFocusEvent *e ) KMainWindow::focusInEvent(e); } -void KAstTopLevel::focusOutEvent( QFocusEvent *e ) +void KAstTopLevel::focusOutEvent( TQFocusEvent *e ) { view->pause( true ); #if defined Q_WS_X11 && ! defined K_WS_QTONLY @@ -529,7 +529,7 @@ void KAstTopLevel::slotShipKilled() } else { - QTimer::singleShot(1000, this, SLOT(slotGameOver())); + TQTimer::singleShot(1000, this, TQT_SLOT(slotGameOver())); } } } @@ -589,31 +589,31 @@ void KAstTopLevel::slotPref() KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self(), KDialogBase::Swallow); /* Make widget */ - QWidget *w = new QWidget(0, "Settings"); - QVBoxLayout *page = new QVBoxLayout( w, 11 ); + TQWidget *w = new TQWidget(0, "Settings"); + TQVBoxLayout *page = new TQVBoxLayout( w, 11 ); - QHBoxLayout *hb = new QHBoxLayout( page, 11 ); - QLabel *label = new QLabel( i18n("Start new game with"), w ); - QSpinBox* sb = new QSpinBox( 1, 5, 1, w, "kcfg_numShips" ); + TQHBoxLayout *hb = new TQHBoxLayout( page, 11 ); + TQLabel *label = new TQLabel( i18n("Start new game with"), w ); + TQSpinBox* sb = new TQSpinBox( 1, 5, 1, w, "kcfg_numShips" ); sb->setValue(3); - QLabel *lb = new QLabel( i18n(" ships."), w ); - QSpacerItem* hspacer = new QSpacerItem( 16, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQLabel *lb = new TQLabel( i18n(" ships."), w ); + TQSpacerItem* hspacer = new TQSpacerItem( 16, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); hb->addWidget(label); hb->addWidget(sb); hb->addWidget(lb); hb->addItem(hspacer); - QCheckBox *f1 = new QCheckBox(i18n("Show highscores on Game Over"), w, "kcfg_showHiscores"); - QCheckBox *f2 = new QCheckBox(i18n("Player can destroy Powerups"), w, "kcfg_canDestroyPowerups"); + TQCheckBox *f1 = new TQCheckBox(i18n("Show highscores on Game Over"), w, "kcfg_showHiscores"); + TQCheckBox *f2 = new TQCheckBox(i18n("Player can destroy Powerups"), w, "kcfg_canDestroyPowerups"); f2->setChecked(true); page->addWidget(f1); page->addWidget(f2); - QSpacerItem* spacer = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); page->addItem( spacer ); /* Done */ dialog->addPage(w, i18n("General"), "package_settings"); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(loadSettings())); dialog->show(); } @@ -625,14 +625,14 @@ void KAstTopLevel::slotShowHighscores() void KAstTopLevel::doStats() { - QString r; + TQString r; if ( view->shots() ) r = KGlobal::locale()->formatNumber(( (float)view->hits() / (float)view->shots() ) * 100, 2 ); else r = KGlobal::locale()->formatNumber( 0.0, 2 ); - QString s = i18n( "Game Over\n\n" + TQString s = i18n( "Game Over\n\n" "Shots fired:\t%1\n" " Hit:\t%2\n" " Missed:\t%3\n" diff --git a/kasteroids/toplevel.h b/kasteroids/toplevel.h index 70545f71..fb67cc14 100644 --- a/kasteroids/toplevel.h +++ b/kasteroids/toplevel.h @@ -9,8 +9,8 @@ #include <kmainwindow.h> #include <kaccel.h> -#include <qdict.h> -#include <qmap.h> +#include <tqdict.h> +#include <tqmap.h> #include "view.h" @@ -33,13 +33,13 @@ private: void readSoundMapping(); void doStats(); bool queryExit(); - bool processKeyPress( QKeyEvent *event ); - bool processKeyRelease( QKeyEvent *event ); + bool processKeyPress( TQKeyEvent *event ); + bool processKeyRelease( TQKeyEvent *event ); protected: - virtual bool eventFilter( QObject *object, QEvent *event ); - virtual void focusInEvent( QFocusEvent *event ); - virtual void focusOutEvent( QFocusEvent *event ); + virtual bool eventFilter( TQObject *object, TQEvent *event ); + virtual void focusInEvent( TQFocusEvent *event ); + virtual void focusOutEvent( TQFocusEvent *event ); private slots: void loadSettings(); @@ -61,18 +61,18 @@ private slots: private: KAsteroidsView *view; - QLCDNumber *scoreLCD; - QLCDNumber *levelLCD; - QLCDNumber *shipsLCD; - - QLCDNumber *teleportsLCD; -// QLCDNumber *bombsLCD; - QLCDNumber *brakesLCD; - QLCDNumber *shieldLCD; - QLCDNumber *shootLCD; + TQLCDNumber *scoreLCD; + TQLCDNumber *levelLCD; + TQLCDNumber *shipsLCD; + + TQLCDNumber *teleportsLCD; +// TQLCDNumber *bombsLCD; + TQLCDNumber *brakesLCD; + TQLCDNumber *shieldLCD; + TQLCDNumber *shootLCD; KALedMeter *powerMeter; - QDict<QString> soundDict; + TQDict<TQString> soundDict; // waiting for user to press Enter to launch a ship bool waitShip; @@ -85,7 +85,7 @@ private: enum Action { Invalid, Launch, Thrust, RotateLeft, RotateRight, Shoot, Teleport, Brake, Shield }; - QMap<Action, KAction*> keycodes; + TQMap<Action, KAction*> keycodes; KAction *launchAction; }; diff --git a/kasteroids/view.cpp b/kasteroids/view.cpp index 8ca358fd..e203ffb5 100644 --- a/kasteroids/view.cpp +++ b/kasteroids/view.cpp @@ -63,13 +63,13 @@ kas_animations [] = -KAsteroidsView::KAsteroidsView( QWidget *parent, const char *name ) - : QWidget( parent, name ), +KAsteroidsView::KAsteroidsView( TQWidget *parent, const char *name ) + : TQWidget( parent, name ), field(640, 440), view(&field,this) { - view.setVScrollBarMode( QScrollView::AlwaysOff ); - view.setHScrollBarMode( QScrollView::AlwaysOff ); + view.setVScrollBarMode( TQScrollView::AlwaysOff ); + view.setHScrollBarMode( TQScrollView::AlwaysOff ); rocks.setAutoDelete( true ); missiles.setAutoDelete( true ); bits.setAutoDelete( true ); @@ -77,11 +77,11 @@ KAsteroidsView::KAsteroidsView( QWidget *parent, const char *name ) exhaust.setAutoDelete( true ); field.setBackgroundColor(black); - QPixmap pm( locate("sprite", IMG_BACKGROUND) ); + TQPixmap pm( locate("sprite", IMG_BACKGROUND) ); field.setBackgroundPixmap( pm ); - textSprite = new QCanvasText( &field ); - QFont font( KGlobalSettings::generalFont().family(), 18 ); + textSprite = new TQCanvasText( &field ); + TQFont font( KGlobalSettings::generalFont().family(), 18 ); textSprite->setFont( font ); shield = 0; @@ -90,8 +90,8 @@ KAsteroidsView::KAsteroidsView( QWidget *parent, const char *name ) readSprites(); - shieldTimer = new QTimer( this ); - connect( shieldTimer, SIGNAL(timeout()), this, SLOT(hideShield()) ); + shieldTimer = new TQTimer( this ); + connect( shieldTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(hideShield()) ); mTimerId = -1; shipPower = MAX_POWER_LEVEL; @@ -229,19 +229,19 @@ void KAsteroidsView::brake( bool b ) void KAsteroidsView::readSprites() { - QString sprites_prefix = + TQString sprites_prefix = KGlobal::dirs()->findResourceDir("sprite", "rock1/rock10000.png"); int i = 0; while ( kas_animations[i].id ) { animation.insert( kas_animations[i].id, - new QCanvasPixmapArray( sprites_prefix + kas_animations[i].path, + new TQCanvasPixmapArray( sprites_prefix + kas_animations[i].path, kas_animations[i].frames ) ); i++; } - ship = new QCanvasSprite( animation[ID_SHIP], &field ); + ship = new TQCanvasSprite( animation[ID_SHIP], &field ); ship->hide(); shield = new KShield( animation[ID_SHIELD], &field ); @@ -282,7 +282,7 @@ void KAsteroidsView::addRocks( int num ) // - - - -void KAsteroidsView::showText( const QString &text, const QColor &color, bool scroll ) +void KAsteroidsView::showText( const TQString &text, const TQColor &color, bool scroll ) { // textSprite->setTextFlags( AlignHCenter | AlignVCenter ); textSprite->setText( text ); @@ -309,20 +309,20 @@ void KAsteroidsView::hideText() // - - - -void KAsteroidsView::resizeEvent(QResizeEvent* event) +void KAsteroidsView::resizeEvent(TQResizeEvent* event) { - QWidget::resizeEvent(event); + TQWidget::resizeEvent(event); field.resize(width()-4, height()-4); view.resize(width(),height()); } // - - - -void KAsteroidsView::timerEvent( QTimerEvent * ) +void KAsteroidsView::timerEvent( TQTimerEvent * ) { field.advance(); - QCanvasSprite *rock; + TQCanvasSprite *rock; // move rocks forward for ( rock = rocks.first(); rock; rock = rocks.next() ) { @@ -380,7 +380,7 @@ void KAsteroidsView::timerEvent( QTimerEvent * ) mFrameNum++; } -void KAsteroidsView::wrapSprite( QCanvasItem *s ) +void KAsteroidsView::wrapSprite( TQCanvasItem *s ) { int x = int(s->x() + s->boundingRect().width() / 2); int y = int(s->y() + s->boundingRect().height() / 2); @@ -398,7 +398,7 @@ void KAsteroidsView::wrapSprite( QCanvasItem *s ) // - - - -void KAsteroidsView::rockHit( QCanvasItem *hit ) +void KAsteroidsView::rockHit( TQCanvasItem *hit ) { KPowerup *nPup = 0; int rnd = static_cast<int>(krandom.getDouble()*30.0) % 30; @@ -455,7 +455,7 @@ void KAsteroidsView::rockHit( QCanvasItem *hit ) else if ( dy < -maxRockSpeed ) dy = -maxRockSpeed; - QCanvasSprite *nrock; + TQCanvasSprite *nrock; for ( int i = 0; i < 4; i++ ) { @@ -484,7 +484,7 @@ void KAsteroidsView::rockHit( QCanvasItem *hit ) } else if ( hit->rtti() == ID_ROCK_SMALL ) emit rockHit( 2 ); - rocks.removeRef( (QCanvasSprite *)hit ); + rocks.removeRef( (TQCanvasSprite *)hit ); if ( rocks.count() == 0 ) emit rocksRemoved(); } @@ -524,7 +524,7 @@ void KAsteroidsView::processMissiles() // if a missile has hit a rock, remove missile and break rock into smaller // rocks or remove completely. - QPtrListIterator<KMissile> it(missiles); + TQPtrListIterator<KMissile> it(missiles); for ( ; it.current(); ++it ) { @@ -539,8 +539,8 @@ void KAsteroidsView::processMissiles() wrapSprite( missile ); - QCanvasItemList hits = missile->collisions( true ); - QCanvasItemList::Iterator hit; + TQCanvasItemList hits = missile->collisions( true ); + TQCanvasItemList::Iterator hit; for ( hit = hits.begin(); hit != hits.end(); ++hit ) { if ( (*hit)->rtti() >= ID_ROCK_LARGE && @@ -572,8 +572,8 @@ void KAsteroidsView::processShip() shield->setFrame( (shield->frame()+1) % shield->frameCount() ); shield->move( ship->x() - 9, ship->y() - 9 ); - QCanvasItemList hits = shield->collisions( true ); - QCanvasItemList::Iterator it; + TQCanvasItemList hits = shield->collisions( true ); + TQCanvasItemList::Iterator it; for ( it = hits.begin(); it != hits.end(); ++it ) { if ( (*it)->rtti() >= ID_ROCK_LARGE && @@ -610,8 +610,8 @@ void KAsteroidsView::processShip() if ( !shieldOn ) { shield->hide(); - QCanvasItemList hits = ship->collisions( true ); - QCanvasItemList::Iterator it; + TQCanvasItemList hits = ship->collisions( true ); + TQCanvasItemList::Iterator it; for ( it = hits.begin(); it != hits.end(); ++it ) { if ( (*it)->rtti() >= ID_ROCK_LARGE && @@ -780,7 +780,7 @@ void KAsteroidsView::processPowerups() // destroy it KPowerup *pup; - QPtrListIterator<KPowerup> it( powerups ); + TQPtrListIterator<KPowerup> it( powerups ); for( ; (pup = it.current()); ) { @@ -795,8 +795,8 @@ void KAsteroidsView::processPowerups() wrapSprite( pup ); - QCanvasItemList hits = pup->collisions( true ); - QCanvasItemList::Iterator it; + TQCanvasItemList hits = pup->collisions( true ); + TQCanvasItemList::Iterator it; for ( it = hits.begin(); it != hits.end(); ++it ) { if ( (*it) == ship || (*it) == shield ) diff --git a/kasteroids/view.h b/kasteroids/view.h index 6807037a..5d62f640 100644 --- a/kasteroids/view.h +++ b/kasteroids/view.h @@ -7,11 +7,11 @@ #ifndef __AST_VIEW_H__ #define __AST_VIEW_H__ -#include <qwidget.h> -#include <qptrlist.h> -#include <qtimer.h> -#include <qcanvas.h> -#include <qintdict.h> +#include <tqwidget.h> +#include <tqptrlist.h> +#include <tqtimer.h> +#include <tqcanvas.h> +#include <tqintdict.h> #include "sprites.h" #include <krandomsequence.h> @@ -21,7 +21,7 @@ class KAsteroidsView : public QWidget { Q_OBJECT public: - KAsteroidsView( QWidget *parent = 0, const char *name = 0 ); + KAsteroidsView( TQWidget *parent = 0, const char *name = 0 ); virtual ~KAsteroidsView(); int refreshRate; @@ -42,7 +42,7 @@ public: void brake( bool b ); void pause( bool p); - void showText( const QString &text, const QColor &color, bool scroll=TRUE ); + void showText( const TQString &text, const TQColor &color, bool scroll=TRUE ); void hideText(); int shots() const { return shotsFired; } @@ -65,8 +65,8 @@ private slots: protected: void readSprites(); - void wrapSprite( QCanvasItem * ); - void rockHit( QCanvasItem * ); + void wrapSprite( TQCanvasItem * ); + void rockHit( TQCanvasItem * ); void reducePower( int val ); void addExhaust( double x, double y, double dx, double dy, int count ); void processMissiles(); @@ -74,21 +74,21 @@ protected: void processPowerups(); void processShield(); - virtual void resizeEvent( QResizeEvent *event ); - virtual void timerEvent( QTimerEvent * ); + virtual void resizeEvent( TQResizeEvent *event ); + virtual void timerEvent( TQTimerEvent * ); private: - QCanvas field; - QCanvasView view; - QIntDict<QCanvasPixmapArray> animation; - QPtrList<QCanvasSprite> rocks; - QPtrList<KMissile> missiles; - QPtrList<KBit> bits; - QPtrList<KExhaust> exhaust; - QPtrList<KPowerup> powerups; + TQCanvas field; + TQCanvasView view; + TQIntDict<TQCanvasPixmapArray> animation; + TQPtrList<TQCanvasSprite> rocks; + TQPtrList<KMissile> missiles; + TQPtrList<KBit> bits; + TQPtrList<KExhaust> exhaust; + TQPtrList<KPowerup> powerups; KShield *shield; - QCanvasSprite *ship; - QCanvasText *textSprite; + TQCanvasSprite *ship; + TQCanvasText *textSprite; bool rotateL; bool rotateR; @@ -127,7 +127,7 @@ private: double powerupSpeed; KRandomSequence krandom; - QTimer *shieldTimer; + TQTimer *shieldTimer; }; #endif diff --git a/katomic/configbox.cpp b/katomic/configbox.cpp index ea546d89..d6fcde23 100644 --- a/katomic/configbox.cpp +++ b/katomic/configbox.cpp @@ -8,38 +8,38 @@ #include <klocale.h> #include <kglobal.h> #include <kconfig.h> -#include <qlayout.h> -#include <qgroupbox.h> -#include <qslider.h> +#include <tqlayout.h> +#include <tqgroupbox.h> +#include <tqslider.h> #include "settings.h" extern Options settings; -ConfigBox::ConfigBox ( QWidget *parent, const char *name) +ConfigBox::ConfigBox ( TQWidget *parent, const char *name) : KDialogBase ( parent, name, true, i18n("Configure"), Ok | Cancel, Ok, true ) { - QWidget *page = makeMainWidget(); + TQWidget *page = makeMainWidget(); - QGridLayout *glay = new QGridLayout (page, 4, 5, 0, spacingHint()); + TQGridLayout *glay = new TQGridLayout (page, 4, 5, 0, spacingHint()); glay->setRowStretch(0, 1); glay->setRowStretch(3, 1); glay->setColStretch(0, 1); glay->setColStretch(4, 1); - glay->addWidget(new QLabel(i18n("Animation speed:"),page), 2, 1); + glay->addWidget(new TQLabel(i18n("Animation speed:"),page), 2, 1); - disp = new QLCDNumber(page); + disp = new TQLCDNumber(page); glay->addWidget(disp, 1, 2); disp->display(1); - speed = new QSlider(1, 10, 1, 1, QSlider::Horizontal, page); + speed = new TQSlider(1, 10, 1, 1, TQSlider::Horizontal, page); glay->addMultiCellWidget(speed, 2, 2, 2, 3); - connect(speed, SIGNAL(valueChanged(int)), disp, SLOT(display(int))); + connect(speed, TQT_SIGNAL(valueChanged(int)), disp, TQT_SLOT(display(int))); speed->setValue(settings.anim_speed); - incInitialSize(QSize(20,20), true); + incInitialSize(TQSize(20,20), true); } void ConfigBox::slotOk() diff --git a/katomic/configbox.h b/katomic/configbox.h index 0acdfd0d..b3d8dfe2 100644 --- a/katomic/configbox.h +++ b/katomic/configbox.h @@ -7,9 +7,9 @@ #ifndef CONFIGBOX_H #define CONFIGBOX_H -#include <qlabel.h> -#include <qslider.h> -#include <qlcdnumber.h> +#include <tqlabel.h> +#include <tqslider.h> +#include <tqlcdnumber.h> #include <kdialogbase.h> @@ -18,7 +18,7 @@ class ConfigBox : public KDialogBase Q_OBJECT public: - ConfigBox ( QWidget *, const char* name ); + ConfigBox ( TQWidget *, const char* name ); ~ConfigBox(); protected slots: @@ -28,8 +28,8 @@ signals: void speedChanged(); private: - QSlider *speed; - QLCDNumber *disp; + TQSlider *speed; + TQLCDNumber *disp; }; #endif diff --git a/katomic/feld.cpp b/katomic/feld.cpp index 47af46d5..e01060cb 100644 --- a/katomic/feld.cpp +++ b/katomic/feld.cpp @@ -26,27 +26,27 @@ extern Options settings; -Feld::Feld( QWidget *parent, const char *name ) : - QWidget( parent, name ), +Feld::Feld( TQWidget *parent, const char *name ) : + TQWidget( parent, name ), data(locate("appdata", "pics/abilder.png")), undoBegin (0), undoSize (0), redoSize (0) { anim = false; dir = None; - sprite = QPixmap (30, 30); + sprite = TQPixmap (30, 30); cx = -1; cy = -1; - point = new QPoint [1]; + point = new TQPoint [1]; moving = false; chosen = false; setMouseTracking(true); - setFocusPolicy(QWidget::StrongFocus); - setBackgroundColor( QColor( 0, 0, 0) ); + setFocusPolicy(TQWidget::StrongFocus); + setBackgroundColor( TQColor( 0, 0, 0) ); setFixedSize(15 * 30, 15 * 30); } @@ -74,12 +74,12 @@ void Feld::load (const KSimpleConfig& config) mol->load(config); - QString key; + TQString key; for (int j = 0; j < FIELD_SIZE; j++) { key.sprintf("feld_%02d", j); - QString line = config.readEntry(key); + TQString line = config.readEntry(key); for (int i = 0; i < FIELD_SIZE; i++) feld[i][j] = atom2int(line[i].latin1()); @@ -98,7 +98,7 @@ void Feld::load (const KSimpleConfig& config) nextAtom(); } -void Feld::mousePressEvent (QMouseEvent *e) +void Feld::mousePressEvent (TQMouseEvent *e) { if (moving) return; @@ -406,7 +406,7 @@ void Feld::doRedo () bitBlt (&sprite, 0, 0, this, cx, cy, 30, 30, CopyROP); } -void Feld::mouseMoveEvent (QMouseEvent *e) +void Feld::mouseMoveEvent (TQMouseEvent *e) { // warning: mouseMoveEvents can report positions upto 1 pixel outside // of the field widget, so we must be sure handle this case @@ -450,7 +450,7 @@ bool Feld::checkDone () int mx = 0; int my = j - 1; - QRect extent(0, 0, FIELD_SIZE - molecWidth + 1, FIELD_SIZE - molecHeight + 1); + TQRect extent(0, 0, FIELD_SIZE - molecWidth + 1, FIELD_SIZE - molecHeight + 1); extent.moveBy(0, my); // find first atom in playing field @@ -486,7 +486,7 @@ bool Feld::checkDone () } -void Feld::timerEvent (QTimerEvent *) +void Feld::timerEvent (TQTimerEvent *) { // animation beenden if (frames <= 0) @@ -510,7 +510,7 @@ void Feld::paintMovingAtom() { int a = settings.anim_speed; - QPainter paint(this); + TQPainter paint(this); switch(dir) { @@ -554,11 +554,11 @@ void Feld::putNonAtom (int x, int y, Direction which, bool brick) bitBlt(this, x * 30, y * 30, &data, xarr, yarr, 30, 30, CopyROP); } -void Feld::paintEvent( QPaintEvent * ) +void Feld::paintEvent( TQPaintEvent * ) { int i, j, x, y; - QPainter paint ( this ); + TQPainter paint ( this ); paint.setPen (black); diff --git a/katomic/feld.h b/katomic/feld.h index 6a1cf761..b48ebf39 100644 --- a/katomic/feld.h +++ b/katomic/feld.h @@ -10,11 +10,11 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <qwidget.h> -#include <qpoint.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qmessagebox.h> +#include <tqwidget.h> +#include <tqpoint.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqmessagebox.h> #include <kscoredialog.h> @@ -32,7 +32,7 @@ class Feld : public QWidget Q_OBJECT public: - Feld (QWidget *parent=0, const char *name=0); + Feld (TQWidget *parent=0, const char *name=0); ~Feld (); enum Direction { None = 0, @@ -59,11 +59,11 @@ signals: protected: bool checkDone(); - void timerEvent (QTimerEvent *); - void paintEvent( QPaintEvent * ); + void timerEvent (TQTimerEvent *); + void paintEvent( TQPaintEvent * ); void paintMovingAtom(); - void mousePressEvent (QMouseEvent *); - void mouseMoveEvent (QMouseEvent *); + void mousePressEvent (TQMouseEvent *); + void mouseMoveEvent (TQMouseEvent *); void emitStatus(); protected: @@ -84,9 +84,9 @@ private: void putNonAtom(int, int, Direction, bool brick = false); - QPoint *point; - QPixmap data; - QPixmap sprite; + TQPoint *point; + TQPixmap data; + TQPixmap sprite; Molek *mol; diff --git a/katomic/gamewidget.cpp b/katomic/gamewidget.cpp index 165e55c0..2c9ccf0a 100644 --- a/katomic/gamewidget.cpp +++ b/katomic/gamewidget.cpp @@ -23,11 +23,11 @@ #include "feld.h" #include "molek.h" -#include <qscrollbar.h> -#include <qgroupbox.h> -#include <qlayout.h> -#include <qvbox.h> -#include <qlabel.h> +#include <tqscrollbar.h> +#include <tqgroupbox.h> +#include <tqlayout.h> +#include <tqvbox.h> +#include <tqlabel.h> #include <kapplication.h> #include <kscoredialog.h> @@ -99,7 +99,7 @@ void GameWidget::gameOver(int moves) { KScoreDialog high(KScoreDialog::Name | KScoreDialog::Score, this); high.setCaption(i18n("Level %1 Highscores").arg(level)); - high.setConfigGroup(QString("Highscores Level %1").arg(level)); + high.setConfigGroup(TQString("Highscores Level %1").arg(level)); KScoreDialog::FieldInfo scoreInfo; @@ -118,16 +118,16 @@ void GameWidget::getMoves(int moves) void GameWidget::mergeHighScores(int l) { - KConfigGroup oldConfig(kapp->config(), QString("High Scores Level %1").arg(l).utf8()); - KConfigGroup newConfig(kapp->config(), QString("Highscores Level %1").arg(l).utf8()); + KConfigGroup oldConfig(kapp->config(), TQString("High Scores Level %1").arg(l).utf8()); + KConfigGroup newConfig(kapp->config(), TQString("Highscores Level %1").arg(l).utf8()); newConfig.writeEntry("LastPlayer", oldConfig.readEntry("LastPlayer")); - QString num; + TQString num; for (int i = 1; i <= 10; ++i) { num.setNum(i); - QString key = "Pos" + num + "Name"; + TQString key = "Pos" + num + "Name"; newConfig.writeEntry(key, oldConfig.readEntry(key, "-")); key = "Pos" + num + "Score"; newConfig.writeEntry(key, oldConfig.readEntry(key, "-")); @@ -138,7 +138,7 @@ void GameWidget::mergeHighScores(int l) void GameWidget::updateLevel (int l) { level=l; - QString levelFile = locate("appdata", QString("levels/level_%1").arg(l)); + TQString levelFile = locate("appdata", TQString("levels/level_%1").arg(l)); if (levelFile.isNull()) { return updateLevel(1); } @@ -147,11 +147,11 @@ void GameWidget::updateLevel (int l) cfg.setGroup("Level"); feld->load(cfg); - if (!kapp->config()->hasGroup(QString("Highscores Level %1").arg(level)) && - kapp->config()->hasGroup(QString("High Scores Level %1").arg(level))) + if (!kapp->config()->hasGroup(TQString("Highscores Level %1").arg(level)) && + kapp->config()->hasGroup(TQString("High Scores Level %1").arg(level))) mergeHighScores(level); - highScore->setConfigGroup(QString("Highscores Level %1").arg(level)); + highScore->setConfigGroup(TQString("Highscores Level %1").arg(level)); highest.setNum(highScore->highScore()); if (highest != "0" ) hs->setText(highest); @@ -167,14 +167,14 @@ void GameWidget::restartLevel() updateLevel(level); } -GameWidget::GameWidget ( QWidget *parent, const char* name ) - : QWidget( parent, name ) +GameWidget::GameWidget ( TQWidget *parent, const char* name ) + : TQWidget( parent, name ) { level = 1; nlevels = KGlobal::dirs()->findAllResources("appdata", "levels/level_*", false, true).count(); - QHBoxLayout *top = new QHBoxLayout(this, 10); + TQHBoxLayout *top = new TQHBoxLayout(this, 10); // spielfeld feld = new Feld (this, "feld"); @@ -182,47 +182,47 @@ GameWidget::GameWidget ( QWidget *parent, const char* name ) top->addWidget(feld); - QVBox *vb = new QVBox(this); + TQVBox *vb = new TQVBox(this); vb->setSpacing(20); top->addWidget(vb); // scrollbar - scrl = new QScrollBar(1, nlevels, 1, - 5, 1, QScrollBar::Horizontal, vb, "scrl" ); - connect (scrl, SIGNAL (valueChanged (int)), SLOT (updateLevel (int))); + scrl = new TQScrollBar(1, nlevels, 1, + 5, 1, TQScrollBar::Horizontal, vb, "scrl" ); + connect (scrl, TQT_SIGNAL (valueChanged (int)), TQT_SLOT (updateLevel (int))); // molekül molek = new Molek (vb, "molek"); feld->setMolek(molek); - connect (feld, SIGNAL (gameOver(int)), SLOT(gameOver(int))); - connect (feld, SIGNAL (sendMoves(int)), SLOT(getMoves(int))); - connect (feld, SIGNAL (enableRedo(bool)), SIGNAL(enableRedo(bool))); - connect (feld, SIGNAL (enableUndo(bool)), SIGNAL(enableUndo(bool))); + connect (feld, TQT_SIGNAL (gameOver(int)), TQT_SLOT(gameOver(int))); + connect (feld, TQT_SIGNAL (sendMoves(int)), TQT_SLOT(getMoves(int))); + connect (feld, TQT_SIGNAL (enableRedo(bool)), TQT_SIGNAL(enableRedo(bool))); + connect (feld, TQT_SIGNAL (enableUndo(bool)), TQT_SIGNAL(enableUndo(bool))); highScore = new KScoreDialog(KScoreDialog::Name | KScoreDialog::Score, this); // the score group - QGroupBox *bg = new QGroupBox (i18n("Score"), vb, "bg"); - QBoxLayout *slay = new QVBoxLayout (bg, 10); + TQGroupBox *bg = new TQGroupBox (i18n("Score"), vb, "bg"); + TQBoxLayout *slay = new TQVBoxLayout (bg, 10); slay->addSpacing(10); - slay->addWidget(new QLabel(i18n("Highscore:"), bg)); + slay->addWidget(new TQLabel(i18n("Highscore:"), bg)); - QFont headerFont = KGlobalSettings::generalFont(); + TQFont headerFont = KGlobalSettings::generalFont(); headerFont.setBold(true); - hs = new QLabel (highest, bg); + hs = new TQLabel (highest, bg); hs->setAlignment(Qt::AlignRight); hs->setFont(headerFont); slay->addWidget(hs); slay->addSpacing(10); - slay->addWidget(new QLabel(i18n("Your score so far:"), bg)); + slay->addWidget(new TQLabel(i18n("Your score so far:"), bg)); - ys = new QLabel (current, bg); + ys = new TQLabel (current, bg); ys->setAlignment(Qt::AlignRight); ys->setFont(headerFont); slay->addWidget(ys); @@ -246,7 +246,7 @@ void GameWidget::showHighscores () { KScoreDialog high(KScoreDialog::Name | KScoreDialog::Score, this); high.setCaption(i18n("Level %1 Highscores").arg(level)); - high.setConfigGroup(QString("Highscores Level %1").arg(level)); + high.setConfigGroup(TQString("Highscores Level %1").arg(level)); high.exec(); } diff --git a/katomic/gamewidget.h b/katomic/gamewidget.h index 00e95376..c68965fd 100644 --- a/katomic/gamewidget.h +++ b/katomic/gamewidget.h @@ -8,7 +8,7 @@ class QScrollBar; class QLabel; class KScoreDialog; -#include <qwidget.h> +#include <tqwidget.h> class GameWidget : public QWidget { @@ -16,7 +16,7 @@ class GameWidget : public QWidget public: - GameWidget ( QWidget *parent, const char *name=0 ); + GameWidget ( TQWidget *parent, const char *name=0 ); ~GameWidget(); @@ -63,11 +63,11 @@ class GameWidget : public QWidget Molek *molek; // scorllbar zur levelwahl - QScrollBar *scrl; + TQScrollBar *scrl; // important labels : highest and current scores - QLabel *hs, *ys; - QString highest, current; + TQLabel *hs, *ys; + TQString highest, current; int nlevels; diff --git a/katomic/main.cpp b/katomic/main.cpp index 91072a8b..6d358bda 100644 --- a/katomic/main.cpp +++ b/katomic/main.cpp @@ -52,7 +52,7 @@ int main(int argc, char **argv) KCmdLineArgs::init( argc, argv, &aboutData ); - QApplication::setColorSpec(QApplication::ManyColor); + TQApplication::setColorSpec(TQApplication::ManyColor); KApplication a; KGlobal::locale()->insertCatalogue("libkdegames"); diff --git a/katomic/molek.cpp b/katomic/molek.cpp index 3425ffe1..26cbcbf6 100644 --- a/katomic/molek.cpp +++ b/katomic/molek.cpp @@ -26,10 +26,10 @@ extern int level; -Molek::Molek( QWidget *parent, const char *name ) : QWidget( parent, name ), +Molek::Molek( TQWidget *parent, const char *name ) : TQWidget( parent, name ), data(locate("appdata", "pics/molek.png")) { - setBackgroundColor (QColor (0, 0, 0)); + setBackgroundColor (TQColor (0, 0, 0)); setMinimumSize(240, 200); } @@ -50,12 +50,12 @@ const atom& Molek::getAtom(uint index) const void Molek::load (const KSimpleConfig& config) { atoms.clear(); - QString key; + TQString key; atom current; int atom_index = 1; - QString value; + TQString value; while (true) { key.sprintf("atom_%c", int2atom(atom_index)); value = config.readEntry(key); @@ -74,7 +74,7 @@ void Molek::load (const KSimpleConfig& config) atom_index++; } - QString line; + TQString line; for (int j = 0; j < MOLEK_SIZE; j++) { @@ -106,12 +106,12 @@ void Molek::load (const KSimpleConfig& config) repaint (); } -void Molek::paintEvent( QPaintEvent * ) +void Molek::paintEvent( TQPaintEvent * ) { - QString st = i18n("Level: %1").arg(level); + TQString st = i18n("Level: %1").arg(level); - QPainter paint (this); - paint.setPen (QColor (190, 190, 190)); + TQPainter paint (this); + paint.setPen (TQColor (190, 190, 190)); paint.drawText (7, height() - 36, mname); paint.drawText (7, height() - 18, st); // spielfeld gleich zeichnen diff --git a/katomic/molek.h b/katomic/molek.h index 6189e4e8..354cf49b 100644 --- a/katomic/molek.h +++ b/katomic/molek.h @@ -9,12 +9,12 @@ #include <stdio.h> #include <stdlib.h> -#include <qwidget.h> -#include <qpoint.h> -#include <qpainter.h> -#include <qpixmap.h> +#include <tqwidget.h> +#include <tqpoint.h> +#include <tqpainter.h> +#include <tqpixmap.h> #include "atom.h" -#include <qvaluelist.h> +#include <tqvaluelist.h> class KSimpleConfig; @@ -25,7 +25,7 @@ class Molek : public QWidget Q_OBJECT public: - Molek (QWidget *parent=0, const char *name=0); + Molek (TQWidget *parent=0, const char *name=0); ~Molek (); void load(const KSimpleConfig& config); @@ -33,18 +33,18 @@ public: const atom& getAtom(uint index) const; int atomSize() const { return atoms.count(); } - QSize molecSize() const { return _size; } + TQSize molecSize() const { return _size; } uint getAtom(int x, int y) const { return molek[x][y]; } protected: - void paintEvent( QPaintEvent * ); + void paintEvent( TQPaintEvent * ); private: - QPixmap data; + TQPixmap data; uint molek[MOLEK_SIZE][MOLEK_SIZE]; // the indexes within atoms - QValueList<atom> atoms; - QString mname; - QSize _size; + TQValueList<atom> atoms; + TQString mname; + TQSize _size; }; diff --git a/katomic/settings.h b/katomic/settings.h index e43471c2..a8396e12 100644 --- a/katomic/settings.h +++ b/katomic/settings.h @@ -21,7 +21,7 @@ #ifndef SETTINGS_H #define SETTINGS_H -#include <qstring.h> +#include <tqstring.h> #define MAX_SPEED 10 diff --git a/katomic/toplevel.cpp b/katomic/toplevel.cpp index ca4de920..bb9613f2 100644 --- a/katomic/toplevel.cpp +++ b/katomic/toplevel.cpp @@ -18,8 +18,8 @@ */ -#include <qgroupbox.h> -#include <qlayout.h> +#include <tqgroupbox.h> +#include <tqlayout.h> #include <kglobal.h> #include <klocale.h> @@ -40,27 +40,27 @@ extern Options settings; void AtomTopLevel::createMenu() { - KAction *act = KStdGameAction::highscores(main, SLOT(showHighscores()), actionCollection()); + KAction *act = KStdGameAction::highscores(main, TQT_SLOT(showHighscores()), actionCollection()); act->setText(i18n("Show &Highscores")); - KStdGameAction::quit(this, SLOT(close()), actionCollection()); - KStdGameAction::restart(main, SLOT(restartLevel()), actionCollection()); + KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdGameAction::restart(main, TQT_SLOT(restartLevel()), actionCollection()); - KStdAction::preferences(this, SLOT(configopts()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(configopts()), actionCollection()); - undoAction = KStdGameAction::undo (main, SLOT(doUndo()), actionCollection()); - redoAction = KStdGameAction::redo (main, SLOT(doRedo()), actionCollection()); + undoAction = KStdGameAction::undo (main, TQT_SLOT(doUndo()), actionCollection()); + redoAction = KStdGameAction::redo (main, TQT_SLOT(doRedo()), actionCollection()); undoAction->setEnabled(false); redoAction->setEnabled(false); - connect (main, SIGNAL (enableRedo(bool)), SLOT(enableRedo(bool))); - connect (main, SIGNAL (enableUndo(bool)), SLOT(enableUndo(bool))); + connect (main, TQT_SIGNAL (enableRedo(bool)), TQT_SLOT(enableRedo(bool))); + connect (main, TQT_SIGNAL (enableUndo(bool)), TQT_SLOT(enableUndo(bool))); - new KAction(i18n("Atom Up"), Key_Up, main, SLOT(moveUp()), actionCollection(), "atom_up"); - new KAction(i18n("Atom Down"), Key_Down, main, SLOT(moveDown()), actionCollection(), "atom_down"); - new KAction(i18n("Atom Left"), Key_Left, main, SLOT(moveLeft()), actionCollection(), "atom_left"); - new KAction(i18n("Atom Right"), Key_Right, main, SLOT(moveRight()), actionCollection(), "atom_right"); + new KAction(i18n("Atom Up"), Key_Up, main, TQT_SLOT(moveUp()), actionCollection(), "atom_up"); + new KAction(i18n("Atom Down"), Key_Down, main, TQT_SLOT(moveDown()), actionCollection(), "atom_down"); + new KAction(i18n("Atom Left"), Key_Left, main, TQT_SLOT(moveLeft()), actionCollection(), "atom_left"); + new KAction(i18n("Atom Right"), Key_Right, main, TQT_SLOT(moveRight()), actionCollection(), "atom_right"); - new KAction(i18n("Next Atom"), Key_Tab, main, SLOT(nextAtom()), actionCollection(), "next_atom"); - new KAction(i18n("Previous Atom"), SHIFT+Key_Tab, main, SLOT(previousAtom()), actionCollection(), "prev_atom"); + new KAction(i18n("Next Atom"), Key_Tab, main, TQT_SLOT(nextAtom()), actionCollection(), "next_atom"); + new KAction(i18n("Previous Atom"), SHIFT+Key_Tab, main, TQT_SLOT(previousAtom()), actionCollection(), "prev_atom"); } void AtomTopLevel::configopts() diff --git a/kbackgammon/engines/fibs/kbgfibs.cpp b/kbackgammon/engines/fibs/kbgfibs.cpp index 06fdaec7..4e7fd2f4 100644 --- a/kbackgammon/engines/fibs/kbgfibs.cpp +++ b/kbackgammon/engines/fibs/kbgfibs.cpp @@ -37,27 +37,27 @@ #include <kapplication.h> #include <kconfig.h> -#include <qtimer.h> -#include <qcheckbox.h> -#include <qlayout.h> -#include <qstring.h> -#include <qsocket.h> -#include <qpopupmenu.h> -#include <qgroupbox.h> -#include <qbuttongroup.h> -#include <qradiobutton.h> +#include <tqtimer.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqstring.h> +#include <tqsocket.h> +#include <tqpopupmenu.h> +#include <tqgroupbox.h> +#include <tqbuttongroup.h> +#include <tqradiobutton.h> #include <kmainwindow.h> #include <klineeditdlg.h> #include <kmessagebox.h> -#include <qdatetime.h> -#include <qwhatsthis.h> +#include <tqdatetime.h> +#include <tqwhatsthis.h> #include <kaudioplayer.h> #include <kstandarddirs.h> -#include <qvbox.h> +#include <tqvbox.h> #include <kiconloader.h> #include <ktabctl.h> #include <kpassdlg.h> -#include <qcstring.h> +#include <tqcstring.h> #include <knotifyclient.h> #include <kaction.h> @@ -207,7 +207,7 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) /* * Main Widget */ - QVBox *vbp = nb->addVBoxPage(i18n("FIBS Engine"), i18n("Here you can configure the FIBS backgammon engine"), + TQVBox *vbp = nb->addVBoxPage(i18n("FIBS Engine"), i18n("Here you can configure the FIBS backgammon engine"), kapp->iconLoader()->loadIcon(PROG_NAME "_engine", KIcon::Desktop)); /* @@ -218,14 +218,14 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) /* * FIBS, local options */ - QWidget *w = new QWidget(tc); - QGridLayout *gl = new QGridLayout(w, 3, 1, nb->spacingHint()); + TQWidget *w = new TQWidget(tc); + TQGridLayout *gl = new TQGridLayout(w, 3, 1, nb->spacingHint()); /* * Group boxes */ - QGroupBox *gbo = new QGroupBox(i18n("Options"), w); - QGroupBox *gbm = new QGroupBox(i18n("Automatic Messages"), w); + TQGroupBox *gbo = new TQGroupBox(i18n("Options"), w); + TQGroupBox *gbm = new TQGroupBox(i18n("Automatic Messages"), w); gl->addWidget(gbo, 0, 0); gl->addWidget(gbm, 1, 0); @@ -233,50 +233,50 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) /* * Options */ - cbp = new QCheckBox(i18n("Show copy of personal messages in main window"), gbo); - cbi = new QCheckBox(i18n("Automatically request player info on invitation"), gbo); + cbp = new TQCheckBox(i18n("Show copy of personal messages in main window"), gbo); + cbi = new TQCheckBox(i18n("Automatically request player info on invitation"), gbo); - QWhatsThis::add(cbp, i18n("Usually, all messages sent directly to you by other players " + TQWhatsThis::add(cbp, i18n("Usually, all messages sent directly to you by other players " "are displayed only in the chat window. Check this box if you " "would like to get a copy of these messages in the main window.")); - QWhatsThis::add(cbi, i18n("Check this box if you would like to receive information on " + TQWhatsThis::add(cbi, i18n("Check this box if you would like to receive information on " "players that invite you to games.")); cbp->setChecked(showMsg); cbi->setChecked(whoisInvite); - gl = new QGridLayout(gbo, 2, 1, 20); + gl = new TQGridLayout(gbo, 2, 1, 20); gl->addWidget(cbp, 0, 0); gl->addWidget(cbi, 1, 0); /* * Automatic messages */ - gl = new QGridLayout(gbm, NumMsg, 2, 20); + gl = new TQGridLayout(gbm, NumMsg, 2, 20); - cbm[MsgBeg] = new QCheckBox(i18n("Start match:"), gbm); - cbm[MsgWin] = new QCheckBox(i18n("Win match:"), gbm); - cbm[MsgLos] = new QCheckBox(i18n("Lose match:"), gbm); + cbm[MsgBeg] = new TQCheckBox(i18n("Start match:"), gbm); + cbm[MsgWin] = new TQCheckBox(i18n("Win match:"), gbm); + cbm[MsgLos] = new TQCheckBox(i18n("Lose match:"), gbm); - QWhatsThis::add(cbm[MsgBeg], i18n("If you want to send a standard greeting to your " + TQWhatsThis::add(cbm[MsgBeg], i18n("If you want to send a standard greeting to your " "opponent whenever you start a new match, check " "this box and write the message into the entry " "field.")); - QWhatsThis::add(cbm[MsgWin], i18n("If you want to send a standard message to your " + TQWhatsThis::add(cbm[MsgWin], i18n("If you want to send a standard message to your " "opponent whenever you won a match, check this box " "and write the message into the entry field.")); - QWhatsThis::add(cbm[MsgLos], i18n("If you want to send a standard message to your " + TQWhatsThis::add(cbm[MsgLos], i18n("If you want to send a standard message to your " "opponent whenever you lost a match, check this box " "and write the message into the entry field.")); for (int i = 0; i < NumMsg; i++) { - lem[i] = new QLineEdit(autoMsg[i], gbm); + lem[i] = new TQLineEdit(autoMsg[i], gbm); gl->addWidget(cbm[i], i, 0); gl->addWidget(lem[i], i, 1); - connect(cbm[i], SIGNAL(toggled(bool)), lem[i], SLOT(setEnabled(bool))); + connect(cbm[i], TQT_SIGNAL(toggled(bool)), lem[i], TQT_SLOT(setEnabled(bool))); cbm[i]->setChecked(useAutoMsg[i]); lem[i]->setEnabled(useAutoMsg[i]); - QWhatsThis::add(lem[i], QWhatsThis::textFor(cbm[i])); + TQWhatsThis::add(lem[i], TQWhatsThis::textFor(cbm[i])); } /* @@ -289,11 +289,11 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) /* * FIBS, connection setup */ - w = new QWidget(tc); - gl = new QGridLayout(w, 3, 1, nb->spacingHint()); + w = new TQWidget(tc); + gl = new TQGridLayout(w, 3, 1, nb->spacingHint()); - QGroupBox *gbc = new QGroupBox(i18n("Server"), w); - QGroupBox *gbk = new QGroupBox(i18n("Other"), w); + TQGroupBox *gbc = new TQGroupBox(i18n("Server"), w); + TQGroupBox *gbk = new TQGroupBox(i18n("Other"), w); gl->addWidget(gbc, 0, 0); gl->addWidget(gbk, 1, 0); @@ -301,35 +301,35 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) /* * Server box */ - gl = new QGridLayout(gbc, 4, 2, 20); + gl = new TQGridLayout(gbc, 4, 2, 20); - QLabel *lbc[NumFIBS]; + TQLabel *lbc[NumFIBS]; - lbc[FIBSHost] = new QLabel(i18n("Server name:"), gbc); - lbc[FIBSPort] = new QLabel(i18n("Server port:"), gbc); - lbc[FIBSUser] = new QLabel(i18n("User name:"), gbc); - lbc[FIBSPswd] = new QLabel(i18n("Password:"), gbc); + lbc[FIBSHost] = new TQLabel(i18n("Server name:"), gbc); + lbc[FIBSPort] = new TQLabel(i18n("Server port:"), gbc); + lbc[FIBSUser] = new TQLabel(i18n("User name:"), gbc); + lbc[FIBSPswd] = new TQLabel(i18n("Password:"), gbc); for (int i = 0; i < NumFIBS; i++) { - lec[i] = new QLineEdit(infoFIBS[i], gbc); + lec[i] = new TQLineEdit(infoFIBS[i], gbc); gl->addWidget(lbc[i], i, 0); gl->addWidget(lec[i], i, 1); } - lec[FIBSPswd]->setEchoMode(QLineEdit::Password); + lec[FIBSPswd]->setEchoMode(TQLineEdit::Password); - QWhatsThis::add(lec[FIBSHost], i18n("Enter here the host name of FIBS. With almost " + TQWhatsThis::add(lec[FIBSHost], i18n("Enter here the host name of FIBS. With almost " "absolute certainty this should be \"fibs.com\". " "If you leave this blank, you will be asked again " "at connection time.")); - QWhatsThis::add(lec[FIBSPort], i18n("Enter here the port number of FIBS. With almost " + TQWhatsThis::add(lec[FIBSPort], i18n("Enter here the port number of FIBS. With almost " "absolute certainty this should be \"4321\". " "If you leave this blank, you will be asked again " "at connection time.")); - QWhatsThis::add(lec[FIBSUser], i18n("Enter your login on FIBS here. If you do not have a " + TQWhatsThis::add(lec[FIBSUser], i18n("Enter your login on FIBS here. If you do not have a " "login yet, you should first create an account using " "the corresponding menu entry. If you leave this blank, " "you will be asked again at connection time.")); - QWhatsThis::add(lec[FIBSPswd], i18n("Enter your password on FIBS here. If you do not have a " + TQWhatsThis::add(lec[FIBSPswd], i18n("Enter your password on FIBS here. If you do not have a " "login yet, you should first create an account using " "the corresponding menu entry. If you leave this blank, " "you will be asked again at connection time. The password " @@ -338,16 +338,16 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) /* * Connection keepalive */ - cbk = new QCheckBox(i18n("Keep connections alive"), gbk); + cbk = new TQCheckBox(i18n("Keep connections alive"), gbk); - QWhatsThis::add(cbk, i18n("Usually, FIBS drops the connection after one hour of inactivity. When " + TQWhatsThis::add(cbk, i18n("Usually, FIBS drops the connection after one hour of inactivity. When " "you check this box, %1 will try to keep the connection alive, even " "if you are not actually playing or chatting. Use this with caution " "if you do not have flat-rate Internet access.").arg(PROG_NAME)); cbk->setChecked(keepalive); - gl = new QGridLayout(gbk, 1, 1, nb->spacingHint()); + gl = new TQGridLayout(gbk, 1, 1, nb->spacingHint()); gl->addWidget(cbk, 0, 0); /* @@ -365,7 +365,7 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) /* * TODO: future extensions */ - w = new QWidget(tc); + w = new TQWidget(tc); tc->addTab(w, i18n("&Buddy List")); } @@ -375,9 +375,9 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) /* * Remove a player from the invitation list in the join menu */ -void KBgEngineFIBS::cancelJoin(const QString &info) +void KBgEngineFIBS::cancelJoin(const TQString &info) { - QRegExp patt = QRegExp("^" + info + " "); + TQRegExp patt = TQRegExp("^" + info + " "); for (int i = 0; i <= numJoin; i++) { if (actJoin[i]->text().contains(patt)) { @@ -394,7 +394,7 @@ void KBgEngineFIBS::cancelJoin(const QString &info) * Parse the information in info for the purposes of the invitation * submenu */ -void KBgEngineFIBS::changeJoin(const QString &info) +void KBgEngineFIBS::changeJoin(const TQString &info) { char name_p[100], name_o[100]; float rate; @@ -407,13 +407,13 @@ void KBgEngineFIBS::changeJoin(const QString &info) sscanf(info.latin1(), "%99s %99s %*s %*s %*s %f %i %*s %*s %*s %*s %*s", name_p, name_o, &rate, &expi); - QString name = name_p; - QString oppo = name_o; + TQString name = name_p; + TQString oppo = name_o; - QString rate_s; rate_s.setNum(rate); - QString expi_s; expi_s.setNum(expi); + TQString rate_s; rate_s.setNum(rate); + TQString expi_s; expi_s.setNum(expi); - QRegExp patt = QRegExp("^" + name + " "); + TQRegExp patt = TQRegExp("^" + name + " "); /* * We have essentially two lists of names to check against: the ones @@ -424,20 +424,20 @@ void KBgEngineFIBS::changeJoin(const QString &info) if (numJoin > -1 && oppo != "-") cancelJoin(name); - for (QStringList::Iterator it = invitations.begin(); it != invitations.end(); ++it) { + for (TQStringList::Iterator it = invitations.begin(); it != invitations.end(); ++it) { if ((*it).contains(patt)) { - QString text, menu; + TQString text, menu; - if ((*it).contains(QRegExp(" r$"))) { + if ((*it).contains(TQRegExp(" r$"))) { menu = i18n("R means resume", "%1 (R)").arg(name); text = i18n("%1 (experience %2, rating %3) wants to resume a saved match with you. " "If you want to play, use the corresponding menu entry to join (or type " "'join %4').").arg(name).arg(expi_s).arg(rate_s).arg(name); KNotifyClient::event("invitation", i18n("%1 wants to resume a saved match with you"). arg(name)); - } else if ((*it).contains(QRegExp(" u$"))) { + } else if ((*it).contains(TQRegExp(" u$"))) { menu = i18n("U means unlimited", "%1 (U)").arg(name); text = i18n("%1 (experience %2, rating %3) wants to play an unlimited match with you. " "If you want to play, use the corresponding menu entry to join (or type " @@ -445,7 +445,7 @@ void KBgEngineFIBS::changeJoin(const QString &info) KNotifyClient::event("invitation", i18n("%1 has invited you to an unlimited match"). arg(name)); } else { - QString len = (*it).right((*it).length() - name.length() - 1); + TQString len = (*it).right((*it).length() - name.length() - 1); menu = i18n("If the format of the (U) and (R) strings is changed, it should also be changed here", "%1 (%2)").arg(name).arg(len); text = i18n("%1 (experience %2, rating %3) wants to play a %4 point match with you. " @@ -539,10 +539,10 @@ void KBgEngineFIBS::showChat() /* * Process the last move coming from the board */ -void KBgEngineFIBS::handleMove(QString *s) +void KBgEngineFIBS::handleMove(TQString *s) { lastMove = *s; - QString t = lastMove.left(1); + TQString t = lastMove.left(1); int moves = t.toInt(); emit allowCommand(Done, moves == toMove); @@ -629,7 +629,7 @@ void KBgEngineFIBS::rollDice(const int w) /* * This engine passes all commands unmodified to the server */ -void KBgEngineFIBS::handleCommand(QString const &cmd) +void KBgEngineFIBS::handleCommand(TQString const &cmd) { emit serverString(cmd); } @@ -639,10 +639,10 @@ void KBgEngineFIBS::handleCommand(QString const &cmd) */ bool KBgEngineFIBS::queryClose() { - if (connection->state() == QSocket::Idle) + if (connection->state() == TQSocket::Idle) return true; - switch (KMessageBox::warningYesNoCancel((QWidget *)parent(),i18n("Still connected. Log out first?"),QString::null,i18n("Log Out"), i18n("Stay Connected"))) { + switch (KMessageBox::warningYesNoCancel((TQWidget *)parent(),i18n("Still connected. Log out first?"),TQString::null,i18n("Log Out"), i18n("Stay Connected"))) { case KMessageBox::Yes : disconnectFIBS(); return true; @@ -660,7 +660,7 @@ bool KBgEngineFIBS::queryExit() { if( kapp->sessionSaving()) return true; - if (connection->state() != QSocket::Idle) + if (connection->state() != TQSocket::Idle) disconnectFIBS(); return true; } @@ -669,7 +669,7 @@ bool KBgEngineFIBS::queryExit() * This displays a copy of personal messages in the main window. * Normally, these only get displayed in the chat window. */ -void KBgEngineFIBS::personalMessage(const QString &msg) +void KBgEngineFIBS::personalMessage(const TQString &msg) { if (showMsg) emit infoText(msg); @@ -729,9 +729,9 @@ void KBgEngineFIBS::match_leave() void KBgEngineFIBS::away() { bool ret; - QString msg = KLineEditDlg::getText(i18n("Please type the message that should be displayed to other\n" + TQString msg = KLineEditDlg::getText(i18n("Please type the message that should be displayed to other\n" "users while you are away."), - lastAway, &ret, (QWidget *)parent()); + lastAway, &ret, (TQWidget *)parent()); if (ret) { lastAway = msg; emit serverString("away " + msg); @@ -807,7 +807,7 @@ void KBgEngineFIBS::load() * Handle the menu short cuts for joining. This is not as pretty as it * could or should be, but it works and is easy to understand. */ -void KBgEngineFIBS::join(const QString &msg) +void KBgEngineFIBS::join(const TQString &msg) { emit serverString("join " + msg.left(msg.find('('))); } @@ -834,13 +834,13 @@ void KBgEngineFIBS::inviteDialog() /* * Show the invitation dialog and set the name to player */ -void KBgEngineFIBS::fibsRequestInvitation(const QString &player) +void KBgEngineFIBS::fibsRequestInvitation(const TQString &player) { if (!invitationDlg) { - QString p = player; + TQString p = player; invitationDlg = new KBgInvite("invite"); - connect(invitationDlg, SIGNAL(inviteCommand(const QString &)), this, SLOT(handleCommand(const QString &))); - connect(invitationDlg, SIGNAL(dialogDone()), this, SLOT(invitationDone())); + connect(invitationDlg, TQT_SIGNAL(inviteCommand(const TQString &)), this, TQT_SLOT(handleCommand(const TQString &))); + connect(invitationDlg, TQT_SIGNAL(dialogDone()), this, TQT_SLOT(invitationDone())); } invitationDlg->setPlayer(player); invitationDlg->show(); @@ -897,13 +897,13 @@ void KBgEngineFIBS::hostFound() void KBgEngineFIBS::connError(int f) { switch (f) { - case QSocket::ErrConnectionRefused: + case TQSocket::ErrConnectionRefused: emit infoText(i18n("Error, connection has been refused")); break; - case QSocket::ErrHostNotFound: + case TQSocket::ErrHostNotFound: emit infoText(i18n("Error, nonexistent host or name server down.")); break; - case QSocket::ErrSocketRead: + case TQSocket::ErrSocketRead: emit infoText(i18n("Error, reading data from socket")); break; } @@ -913,7 +913,7 @@ void KBgEngineFIBS::connError(int f) void KBgEngineFIBS::readData() { - QString line; + TQString line; while(connection->canReadLine()) { line = connection->readLine(); if (line.length() > 2) { @@ -926,7 +926,7 @@ void KBgEngineFIBS::readData() /* * Transmit the string s to the server */ -void KBgEngineFIBS::sendData(const QString &s) +void KBgEngineFIBS::sendData(const TQString &s) { connection->writeBlock((s+"\r\n").latin1(),2+s.length()); } @@ -964,9 +964,9 @@ void KBgEngineFIBS::connected() /* * Login, using the autologin feature of FIBS, before we even receive anything. */ - QString entry; + TQString entry; entry.setNum(CLIP_VERSION); - emit serverString(QString("login ") + PROG_NAME + "-" + PROG_VERSION + " " + entry + " " + emit serverString(TQString("login ") + PROG_NAME + "-" + PROG_VERSION + " " + entry + " " + infoFIBS[FIBSUser] + " " + infoFIBS[FIBSPswd]); } else { @@ -1042,7 +1042,7 @@ void KBgEngineFIBS::connectionClosed() */ bool KBgEngineFIBS::queryConnection(const bool newlogin) { - QString text, msg; + TQString text, msg; bool first, ret = true; /* @@ -1052,7 +1052,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) msg = KLineEditDlg::getText(i18n("Enter the name of the server you want to connect to.\n" "This should almost always be \"fibs.com\"."), - infoFIBS[FIBSHost], &ret, (QWidget *)parent()); + infoFIBS[FIBSHost], &ret, (TQWidget *)parent()); if (ret) infoFIBS[FIBSHost] = msg; @@ -1064,7 +1064,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) msg = KLineEditDlg::getText(i18n("Enter the port number on the server. " "It should almost always be \"4321\"."), - infoFIBS[FIBSPort], &ret, (QWidget *)parent()); + infoFIBS[FIBSPort], &ret, (TQWidget *)parent()); if (ret) infoFIBS[FIBSPort] = msg; @@ -1088,7 +1088,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) first = true; do { msg = (KLineEditDlg::getText(text, infoFIBS[FIBSUser], &ret, - (QWidget *)parent())).stripWhiteSpace(); + (TQWidget *)parent())).stripWhiteSpace(); if (first) { text += i18n("The login may not contain spaces or colons!"); first = false; @@ -1116,7 +1116,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) first = true; do { - QCString password; + TQCString password; if (newlogin) ret = (KPasswordDialog::getNewPassword(password, text) == KPasswordDialog::Accepted); else @@ -1152,91 +1152,91 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) */ void KBgEngineFIBS::initPattern() { - QString pattern; + TQString pattern; /* * Initialize the search pattern array */ - pat[Welcome] = QRegExp(pattern.sprintf("^%d ", CLIP_WELCOME)); - pat[OwnInfo] = QRegExp(pattern.sprintf("^%d ", CLIP_OWN_INFO)); - pat[WhoInfo] = QRegExp(pattern.sprintf("^%d ", CLIP_WHO_INFO)); - pat[WhoEnde] = QRegExp(pattern.sprintf("^%d$", CLIP_WHO_END)); - pat[MotdBeg] = QRegExp(pattern.sprintf("^%d" , CLIP_MOTD_BEGIN)); - pat[MotdEnd] = QRegExp(pattern.sprintf("^%d" , CLIP_MOTD_END)); - pat[MsgPers] = QRegExp(pattern.sprintf("^%d ", CLIP_MESSAGE)); - pat[MsgDeli] = QRegExp(pattern.sprintf("^%d ", CLIP_MESSAGE_DELIVERED)); - pat[MsgSave] = QRegExp(pattern.sprintf("^%d ", CLIP_MESSAGE_SAVED)); - pat[ChatSay] = QRegExp(pattern.sprintf("^%d ", CLIP_SAYS)); - pat[ChatSht] = QRegExp(pattern.sprintf("^%d ", CLIP_SHOUTS)); - pat[ChatWis] = QRegExp(pattern.sprintf("^%d ", CLIP_WHISPERS)); - pat[ChatKib] = QRegExp(pattern.sprintf("^%d ", CLIP_KIBITZES)); - pat[SelfSay] = QRegExp(pattern.sprintf("^%d ", CLIP_YOU_SAY)); - pat[SelfSht] = QRegExp(pattern.sprintf("^%d ", CLIP_YOU_SHOUT)); - pat[SelfWis] = QRegExp(pattern.sprintf("^%d ", CLIP_YOU_WHISPER)); - pat[SelfKib] = QRegExp(pattern.sprintf("^%d ", CLIP_YOU_KIBITZ)); - pat[UserLin] = QRegExp(pattern.sprintf("^%d ", CLIP_LOGIN)); - pat[UserLot] = QRegExp(pattern.sprintf("^%d ", CLIP_LOGOUT)); - - pat[NoLogin] = QRegExp("\\*\\* Unknown command: 'login'"); - pat[BegRate] = QRegExp("^rating calculation:$"); - pat[EndRate] = QRegExp("^change for "); - pat[HTML_lt] = QRegExp("<"); - pat[HTML_gt] = QRegExp(">"); - pat[BoardSY] = QRegExp("^Value of 'boardstyle' set to 3"); - pat[BoardSN] = QRegExp("^Value of 'boardstyle' set to [^3]"); - pat[WhoisBG] = QRegExp("^Information about "); - pat[WhoisE1] = QRegExp("^ No email address\\.$"); - pat[WhoisE2] = QRegExp("^ Email address: "); - pat[SelfSlf] = QRegExp("^You say to yourself:"); - pat[Goodbye] = QRegExp("^ Goodbye\\."); - pat[GameSav] = QRegExp("The game was saved\\.$"); - pat[RawBord] = QRegExp("^board:"); - pat[YouTurn] = QRegExp("^It's your turn\\. Please roll or double"); - pat[PlsMove] = QRegExp("^Please move [1-6]+ pie"); - pat[EndWtch] = QRegExp("^You stop watching "); - pat[BegWtch] = QRegExp("^You're now watching "); - pat[BegGame] = QRegExp("^Starting a new game with "); - pat[Reload1] = QRegExp("^You are now playing with "); - pat[Reload2] = QRegExp(" has joined you. Your running match was loaded\\.$"); - pat[OneWave] = QRegExp(" waves goodbye.$"); - pat[TwoWave] = QRegExp(" waves goodbye again.$"); - pat[YouWave] = QRegExp("^You wave goodbye.$"); - pat[GameBG1] = QRegExp("start a [0-9]+ point match"); - pat[GameBG2] = QRegExp("start an unlimited match"); - pat[GameRE1] = QRegExp("are resuming their [0-9]+-point match"); - pat[GameRE2] = QRegExp("are resuming their unlimited match"); - pat[GameEnd] = QRegExp("point match against"); - pat[TabChar] = QRegExp("\\t"); - pat[PlsChar] = QRegExp("\\+"); - pat[Invite0] = QRegExp(" wants to play a [0-9]+ point match with you\\.$"); - pat[Invite1] = QRegExp("^.+ wants to play a "); - pat[Invite2] = QRegExp(" wants to resume a saved match with you\\.$"); - pat[Invite3] = QRegExp(" wants to play an unlimited match with you\\.$"); - pat[TypJoin] = QRegExp("^Type 'join "); - pat[OneName] = QRegExp("^ONE USERNAME PER PERSON ONLY!!!"); - pat[YouAway] = QRegExp("^You're away. Please type 'back'"); - pat[YouBack] = QRegExp("^Welcome back\\.$"); - pat[YouMove] = QRegExp("^It's your turn to move\\."); - pat[YouRoll] = QRegExp("^It's your turn to roll or double\\."); - pat[TwoStar] = QRegExp("^\\*\\* "); - pat[OthrNam] = QRegExp("^\\*\\* Please use another name\\. "); - pat[BoxHori] = QRegExp("^ *\\+-*\\+ *$"); - pat[BoxVer1] = QRegExp("^ *\\|"); - pat[BoxVer2] = QRegExp("\\| *$"); - pat[YourNam] = QRegExp("Your name will be "); - pat[GivePwd] = QRegExp("Please give your password:"); - pat[RetypeP] = QRegExp("Please retype your password:"); - pat[HelpTxt] = QRegExp("^NAME$"); - pat[MatchB1] = QRegExp(" has joined you for a [0-9]+ point match\\.$"); - pat[MatchB2] = QRegExp(" has joined you for an unlimited match\\.$"); - pat[EndLose] = QRegExp(" wins the [0-9]+ point match [0-9]+-[0-9]+"); - pat[EndVict] = QRegExp(" win the [0-9]+ point match [0-9]+-[0-9]+"); - pat[RejAcpt] = QRegExp("Type 'accept' or 'reject'\\.$"); - pat[YouAcpt] = QRegExp("^You accept the double\\. The cube shows [0-9]+\\."); - - pat[KeepAlv] = QRegExp("^\\*\\* Unknown command: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"); - pat[RatingY] = QRegExp("You'll see how the rating changes are calculated\\.$"); - pat[RatingN] = QRegExp("You won't see how the rating changes are calculated\\.$"); + pat[Welcome] = TQRegExp(pattern.sprintf("^%d ", CLIP_WELCOME)); + pat[OwnInfo] = TQRegExp(pattern.sprintf("^%d ", CLIP_OWN_INFO)); + pat[WhoInfo] = TQRegExp(pattern.sprintf("^%d ", CLIP_WHO_INFO)); + pat[WhoEnde] = TQRegExp(pattern.sprintf("^%d$", CLIP_WHO_END)); + pat[MotdBeg] = TQRegExp(pattern.sprintf("^%d" , CLIP_MOTD_BEGIN)); + pat[MotdEnd] = TQRegExp(pattern.sprintf("^%d" , CLIP_MOTD_END)); + pat[MsgPers] = TQRegExp(pattern.sprintf("^%d ", CLIP_MESSAGE)); + pat[MsgDeli] = TQRegExp(pattern.sprintf("^%d ", CLIP_MESSAGE_DELIVERED)); + pat[MsgSave] = TQRegExp(pattern.sprintf("^%d ", CLIP_MESSAGE_SAVED)); + pat[ChatSay] = TQRegExp(pattern.sprintf("^%d ", CLIP_SAYS)); + pat[ChatSht] = TQRegExp(pattern.sprintf("^%d ", CLIP_SHOUTS)); + pat[ChatWis] = TQRegExp(pattern.sprintf("^%d ", CLIP_WHISPERS)); + pat[ChatKib] = TQRegExp(pattern.sprintf("^%d ", CLIP_KIBITZES)); + pat[SelfSay] = TQRegExp(pattern.sprintf("^%d ", CLIP_YOU_SAY)); + pat[SelfSht] = TQRegExp(pattern.sprintf("^%d ", CLIP_YOU_SHOUT)); + pat[SelfWis] = TQRegExp(pattern.sprintf("^%d ", CLIP_YOU_WHISPER)); + pat[SelfKib] = TQRegExp(pattern.sprintf("^%d ", CLIP_YOU_KIBITZ)); + pat[UserLin] = TQRegExp(pattern.sprintf("^%d ", CLIP_LOGIN)); + pat[UserLot] = TQRegExp(pattern.sprintf("^%d ", CLIP_LOGOUT)); + + pat[NoLogin] = TQRegExp("\\*\\* Unknown command: 'login'"); + pat[BegRate] = TQRegExp("^rating calculation:$"); + pat[EndRate] = TQRegExp("^change for "); + pat[HTML_lt] = TQRegExp("<"); + pat[HTML_gt] = TQRegExp(">"); + pat[BoardSY] = TQRegExp("^Value of 'boardstyle' set to 3"); + pat[BoardSN] = TQRegExp("^Value of 'boardstyle' set to [^3]"); + pat[WhoisBG] = TQRegExp("^Information about "); + pat[WhoisE1] = TQRegExp("^ No email address\\.$"); + pat[WhoisE2] = TQRegExp("^ Email address: "); + pat[SelfSlf] = TQRegExp("^You say to yourself:"); + pat[Goodbye] = TQRegExp("^ Goodbye\\."); + pat[GameSav] = TQRegExp("The game was saved\\.$"); + pat[RawBord] = TQRegExp("^board:"); + pat[YouTurn] = TQRegExp("^It's your turn\\. Please roll or double"); + pat[PlsMove] = TQRegExp("^Please move [1-6]+ pie"); + pat[EndWtch] = TQRegExp("^You stop watching "); + pat[BegWtch] = TQRegExp("^You're now watching "); + pat[BegGame] = TQRegExp("^Starting a new game with "); + pat[Reload1] = TQRegExp("^You are now playing with "); + pat[Reload2] = TQRegExp(" has joined you. Your running match was loaded\\.$"); + pat[OneWave] = TQRegExp(" waves goodbye.$"); + pat[TwoWave] = TQRegExp(" waves goodbye again.$"); + pat[YouWave] = TQRegExp("^You wave goodbye.$"); + pat[GameBG1] = TQRegExp("start a [0-9]+ point match"); + pat[GameBG2] = TQRegExp("start an unlimited match"); + pat[GameRE1] = TQRegExp("are resuming their [0-9]+-point match"); + pat[GameRE2] = TQRegExp("are resuming their unlimited match"); + pat[GameEnd] = TQRegExp("point match against"); + pat[TabChar] = TQRegExp("\\t"); + pat[PlsChar] = TQRegExp("\\+"); + pat[Invite0] = TQRegExp(" wants to play a [0-9]+ point match with you\\.$"); + pat[Invite1] = TQRegExp("^.+ wants to play a "); + pat[Invite2] = TQRegExp(" wants to resume a saved match with you\\.$"); + pat[Invite3] = TQRegExp(" wants to play an unlimited match with you\\.$"); + pat[TypJoin] = TQRegExp("^Type 'join "); + pat[OneName] = TQRegExp("^ONE USERNAME PER PERSON ONLY!!!"); + pat[YouAway] = TQRegExp("^You're away. Please type 'back'"); + pat[YouBack] = TQRegExp("^Welcome back\\.$"); + pat[YouMove] = TQRegExp("^It's your turn to move\\."); + pat[YouRoll] = TQRegExp("^It's your turn to roll or double\\."); + pat[TwoStar] = TQRegExp("^\\*\\* "); + pat[OthrNam] = TQRegExp("^\\*\\* Please use another name\\. "); + pat[BoxHori] = TQRegExp("^ *\\+-*\\+ *$"); + pat[BoxVer1] = TQRegExp("^ *\\|"); + pat[BoxVer2] = TQRegExp("\\| *$"); + pat[YourNam] = TQRegExp("Your name will be "); + pat[GivePwd] = TQRegExp("Please give your password:"); + pat[RetypeP] = TQRegExp("Please retype your password:"); + pat[HelpTxt] = TQRegExp("^NAME$"); + pat[MatchB1] = TQRegExp(" has joined you for a [0-9]+ point match\\.$"); + pat[MatchB2] = TQRegExp(" has joined you for an unlimited match\\.$"); + pat[EndLose] = TQRegExp(" wins the [0-9]+ point match [0-9]+-[0-9]+"); + pat[EndVict] = TQRegExp(" win the [0-9]+ point match [0-9]+-[0-9]+"); + pat[RejAcpt] = TQRegExp("Type 'accept' or 'reject'\\.$"); + pat[YouAcpt] = TQRegExp("^You accept the double\\. The cube shows [0-9]+\\."); + + pat[KeepAlv] = TQRegExp("^\\*\\* Unknown command: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"); + pat[RatingY] = TQRegExp("You'll see how the rating changes are calculated\\.$"); + pat[RatingN] = TQRegExp("You won't see how the rating changes are calculated\\.$"); // FIXME same problem as in previous line // mpgnu accepts the double.5 arthur_tn - gnu 1 0 1243.32 365 6 983722411 adsl-61-168-141.bna.bellsouth.net - - @@ -1256,27 +1256,27 @@ void KBgEngineFIBS::initPattern() */ - pat[ConLeav] = QRegExp("^Type 'join' if you want to play the next game, type 'leave' if you don't\\.$"); - pat[GreedyY] = QRegExp("^\\*\\* Will use automatic greedy bearoffs\\."); - pat[GreedyN] = QRegExp("^\\*\\* Won't use automatic greedy bearoffs\\."); - pat[BegBlnd] = QRegExp("^\\*\\* You blind "); - pat[EndBlnd] = QRegExp("^\\*\\* You unblind "); - pat[MatchB3] = QRegExp("^\\*\\* You are now playing a [0-9]+ point match with "); - pat[MatchB4] = QRegExp("^\\*\\* You are now playing an unlimited match with "); - pat[RejCont] = QRegExp("^You reject\\. The game continues\\."); - pat[AcptWin] = QRegExp("^You accept and win "); - pat[YouGive] = QRegExp("^You give up\\."); - pat[DoubleY] = QRegExp("^\\*\\* You will be asked if you want to double\\."); - pat[DoubleN] = QRegExp("^\\*\\* You won't be asked if you want to double\\."); + pat[ConLeav] = TQRegExp("^Type 'join' if you want to play the next game, type 'leave' if you don't\\.$"); + pat[GreedyY] = TQRegExp("^\\*\\* Will use automatic greedy bearoffs\\."); + pat[GreedyN] = TQRegExp("^\\*\\* Won't use automatic greedy bearoffs\\."); + pat[BegBlnd] = TQRegExp("^\\*\\* You blind "); + pat[EndBlnd] = TQRegExp("^\\*\\* You unblind "); + pat[MatchB3] = TQRegExp("^\\*\\* You are now playing a [0-9]+ point match with "); + pat[MatchB4] = TQRegExp("^\\*\\* You are now playing an unlimited match with "); + pat[RejCont] = TQRegExp("^You reject\\. The game continues\\."); + pat[AcptWin] = TQRegExp("^You accept and win "); + pat[YouGive] = TQRegExp("^You give up\\."); + pat[DoubleY] = TQRegExp("^\\*\\* You will be asked if you want to double\\."); + pat[DoubleN] = TQRegExp("^\\*\\* You won't be asked if you want to double\\."); } /* * Parse an incoming line and notify all interested parties - first match * decides. */ -void KBgEngineFIBS::handleServerData(QString &line) +void KBgEngineFIBS::handleServerData(TQString &line) { - QString rawline = line; // contains the line before it is HTML'fied + TQString rawline = line; // contains the line before it is HTML'fied /* * Fix-up any HTML-like tags in the line @@ -1323,7 +1323,7 @@ void KBgEngineFIBS::handleServerData(QString &line) * Receive the logout sequence. The string will be flushed by the * disconnectFIBS() callback */ - rxCollect += QString("<font color=\"blue\"><pre>") + line + "</pre></font><br>"; + rxCollect += TQString("<font color=\"blue\"><pre>") + line + "</pre></font><br>"; break; case RxNormal: @@ -1341,7 +1341,7 @@ void KBgEngineFIBS::handleServerData(QString &line) /* * Handle messages during the RxWhois state */ -void KBgEngineFIBS::handleMessageWhois(const QString &line) +void KBgEngineFIBS::handleMessageWhois(const TQString &line) { rxCollect += "<br> " + line; if (line.contains(pat[WhoisE1]) || line.contains(pat[WhoisE2])) { @@ -1353,7 +1353,7 @@ void KBgEngineFIBS::handleMessageWhois(const QString &line) /* * Handle messages during the RxRating state */ -void KBgEngineFIBS::handleMessageRating(const QString &line) +void KBgEngineFIBS::handleMessageRating(const TQString &line) { rxCollect += "<br>" + line; if (line.contains(pat[EndRate]) && ++rxCount == 2) { @@ -1365,7 +1365,7 @@ void KBgEngineFIBS::handleMessageRating(const QString &line) /* * Handle messages during the RxMotd state */ -void KBgEngineFIBS::handleMessageMotd(const QString &line) +void KBgEngineFIBS::handleMessageMotd(const TQString &line) { if (line.contains(pat[MotdEnd])) { rxStatus = RxNormal; @@ -1377,7 +1377,7 @@ void KBgEngineFIBS::handleMessageMotd(const QString &line) */ emit serverString("set boardstyle 3"); } else { - QString tline = line; + TQString tline = line; tline.replace(pat[BoxHori], "<br><hr>"); tline.replace(pat[BoxVer1], ""); tline.replace(pat[BoxVer2], ""); @@ -1388,7 +1388,7 @@ void KBgEngineFIBS::handleMessageMotd(const QString &line) /* * Handle messages during the RxConnect state */ -void KBgEngineFIBS::handleMessageConnect(const QString &line, const QString &rawline) +void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &rawline) { /* * Two possibilities: either we are logged in or we sent bad password/login @@ -1400,7 +1400,7 @@ void KBgEngineFIBS::handleMessageConnect(const QString &line, const QString &raw if (rxCollect.isEmpty()) { rxStatus = RxIgnore; int ret = KMessageBox::warningContinueCancel - ((QWidget *)parent(), i18n("There was a problem with " + ((TQWidget *)parent(), i18n("There was a problem with " "your login and password. " "You can reenter\n" "your login and password and " @@ -1434,8 +1434,8 @@ void KBgEngineFIBS::handleMessageConnect(const QString &line, const QString &raw // Using latin1() is okay, since the string comes from FIBS. int words = sscanf (line.latin1(), "%255s%255s%li%255s", p[0], p[1], &tmp, p[2]); if (words >= 4) { - QDateTime d; d.setTime_t(tmp); - QString text = i18n("%1, last logged in from %2 at %3.").arg(p[1]).arg(p[2]).arg(d.toString()); + TQDateTime d; d.setTime_t(tmp); + TQString text = i18n("%1, last logged in from %2 at %3.").arg(p[1]).arg(p[2]).arg(d.toString()); emit infoText("<hr><br>" + text); playerlist->setName(p[1]); } @@ -1539,9 +1539,9 @@ void KBgEngineFIBS::handleMessageConnect(const QString &line, const QString &raw */ if (line.contains(pat[OneName])) { rxStatus = RxNewLogin; - emit infoText(QString("<font color=\"red\">") + rxCollect + "</font>"); + emit infoText(TQString("<font color=\"red\">") + rxCollect + "</font>"); rxCollect = ""; - QString tmp = rawline; + TQString tmp = rawline; handleServerData(tmp); return; } @@ -1555,26 +1555,26 @@ void KBgEngineFIBS::handleMessageConnect(const QString &line, const QString &raw /* * Handle messages during the RxNewLogin state */ -void KBgEngineFIBS::handleMessageNewLogin(const QString &line) +void KBgEngineFIBS::handleMessageNewLogin(const TQString &line) { /* * Request the new login */ if (line.contains(pat[OneName])) { - emit serverString(QString("name ") + infoFIBS[FIBSUser]); + emit serverString(TQString("name ") + infoFIBS[FIBSUser]); return; } /* * Ooops, user name already exists */ if (line.contains(pat[OthrNam])) { - QString text = i18n("The selected login is alreay in use! Please select another one."); + TQString text = i18n("The selected login is alreay in use! Please select another one."); bool ret, first = true; - QString msg; + TQString msg; do { msg = (KLineEditDlg::getText(text, infoFIBS[FIBSUser], &ret, - (QWidget *)parent())).stripWhiteSpace(); + (TQWidget *)parent())).stripWhiteSpace(); if (first) { text += i18n("\n\nThe login may not contain spaces or colons!"); first = false; @@ -1608,7 +1608,7 @@ void KBgEngineFIBS::handleMessageNewLogin(const QString &line) */ if (line.contains(pat[RetypeP])) { - QString text = i18n("Your account has been created. Your new login is <u>%1</u>. To fully activate " + TQString text = i18n("Your account has been created. Your new login is <u>%1</u>. To fully activate " "this account, I will now close the connection. Once you reconnect, you can start " "playing backgammon on FIBS.").arg(infoFIBS[FIBSUser]); emit infoText("<br><hr><font color=\"blue\">" + text + "</font><br><hr>"); @@ -1623,7 +1623,7 @@ void KBgEngineFIBS::handleMessageNewLogin(const QString &line) /* * Handle all normal messages - during the RxNormal state */ -void KBgEngineFIBS::handleMessageNormal(QString &line, QString &rawline) +void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) { // - ignored ---------------------------------------------------------------------- @@ -1728,7 +1728,7 @@ void KBgEngineFIBS::handleMessageNormal(QString &line, QString &rawline) pname[US ] = st->player(US); pname[THEM] = st->player(THEM); - playing = (QString("You") == pname[US]); + playing = (TQString("You") == pname[US]); toMove = st->moves(); @@ -1864,7 +1864,7 @@ void KBgEngineFIBS::handleMessageNormal(QString &line, QString &rawline) else if (line.contains(pat[WhoisBG])) { rxStatus = RxWhois; - rxCollect = QString("<br><u>") + line + "</u>"; + rxCollect = TQString("<br><u>") + line + "</u>"; return; } else if (line.contains(pat[MotdBeg])) { @@ -1904,7 +1904,7 @@ void KBgEngineFIBS::handleMessageNormal(QString &line, QString &rawline) */ else if (line.contains(pat[WhoInfo])) { rawline.replace(pat[WhoInfo], ""); - if (rawline.contains(QRegExp("^" + infoFIBS[FIBSUser] + " "))) { + if (rawline.contains(TQRegExp("^" + infoFIBS[FIBSUser] + " "))) { int ready; // Using latin1() is fine, since the string is coming from FIBS. sscanf(rawline.latin1(), "%*s %*s %*s %i %*s %*s %*s %*s %*s %*s %*s %*s", &ready); @@ -2015,7 +2015,7 @@ void KBgEngineFIBS::handleMessageNormal(QString &line, QString &rawline) if (playing) { KNotifyClient::event("game over l", i18n("Sorry, you lost the game.")); if (useAutoMsg[MsgLos] && !autoMsg[MsgLos].stripWhiteSpace().isEmpty()) - emit serverString(QString("tell ") + pname[THEM] + " " + autoMsg[MsgLos]); + emit serverString(TQString("tell ") + pname[THEM] + " " + autoMsg[MsgLos]); } emit gameOver(); } @@ -2023,7 +2023,7 @@ void KBgEngineFIBS::handleMessageNormal(QString &line, QString &rawline) if (playing) { KNotifyClient::event("game over w", i18n("Congratulations, you won the game!")); if (useAutoMsg[MsgWin] && !autoMsg[MsgWin].stripWhiteSpace().isEmpty()) - emit serverString(QString("tell ") + pname[THEM] + " " + autoMsg[MsgWin]); + emit serverString(TQString("tell ") + pname[THEM] + " " + autoMsg[MsgWin]); } emit gameOver(); } @@ -2058,7 +2058,7 @@ void KBgEngineFIBS::handleMessageNormal(QString &line, QString &rawline) } else if (line.contains(pat[BoardSN])) { emit serverString("set boardstyle 3"); - emit infoText(QString("<font color=\"red\"><br>") + emit infoText(TQString("<font color=\"red\"><br>") + i18n("You should never set the 'boardstyle' variable " "by hand! It is vital for proper functioning of " "this program that it remains set to 3. It has " @@ -2091,77 +2091,77 @@ void KBgEngineFIBS::handleMessageNormal(QString &line, QString &rawline) /* * Constructor */ -KBgEngineFIBS::KBgEngineFIBS(QWidget *parent, QString *name, QPopupMenu *pmenu) +KBgEngineFIBS::KBgEngineFIBS(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) : KBgEngine(parent, name, pmenu) { /* * No connection, not playing, ready for login */ - connection = new QSocket(parent, "fibs connection"); + connection = new TQSocket(parent, "fibs connection"); playing = false; login = true; - connect(connection, SIGNAL(hostFound()), this, SLOT(hostFound())); - connect(connection, SIGNAL(connected()), this, SLOT(connected())); - connect(connection, SIGNAL(error(int)), this, SLOT(connError(int))); - connect(connection, SIGNAL(connectionClosed()), this, SLOT(connectionClosed())); - connect(connection, SIGNAL(delayedCloseFinished()), this, SLOT(connectionClosed())); - connect(connection, SIGNAL(readyRead()), this, SLOT(readData())); + connect(connection, TQT_SIGNAL(hostFound()), this, TQT_SLOT(hostFound())); + connect(connection, TQT_SIGNAL(connected()), this, TQT_SLOT(connected())); + connect(connection, TQT_SIGNAL(error(int)), this, TQT_SLOT(connError(int))); + connect(connection, TQT_SIGNAL(connectionClosed()), this, TQT_SLOT(connectionClosed())); + connect(connection, TQT_SIGNAL(delayedCloseFinished()), this, TQT_SLOT(connectionClosed())); + connect(connection, TQT_SIGNAL(readyRead()), this, TQT_SLOT(readData())); - connect(this, SIGNAL(serverString(const QString &)), this, SLOT(sendData(const QString &))); + connect(this, TQT_SIGNAL(serverString(const TQString &)), this, TQT_SLOT(sendData(const TQString &))); /* * No invitation dialog */ invitationDlg = 0; - connect(this, SIGNAL(fibsWhoInfo(const QString &)), this, SLOT(changeJoin(const QString &))); - connect(this, SIGNAL(fibsLogout (const QString &)), this, SLOT(cancelJoin(const QString &))); - connect(this, SIGNAL(gameOver()), this, SLOT(endGame())); + connect(this, TQT_SIGNAL(fibsWhoInfo(const TQString &)), this, TQT_SLOT(changeJoin(const TQString &))); + connect(this, TQT_SIGNAL(fibsLogout (const TQString &)), this, TQT_SLOT(cancelJoin(const TQString &))); + connect(this, TQT_SIGNAL(gameOver()), this, TQT_SLOT(endGame())); /* * Creating, initializing and connecting the player list */ playerlist = new KFibsPlayerList(0, "fibs player list"); - connect(this, SIGNAL(fibsWhoInfo(const QString &)), playerlist, SLOT(changePlayer(const QString &))); - connect(this, SIGNAL(fibsLogout (const QString &)), playerlist, SLOT(deletePlayer(const QString &))); - connect(this, SIGNAL(fibsWhoEnd()), playerlist, SLOT(stopUpdate())); - connect(this, SIGNAL(fibsConnectionClosed()), playerlist, SLOT(stopUpdate())); - connect(this, SIGNAL(changePlayerStatus(const QString &, int, bool)), - playerlist, SLOT(changePlayerStatus(const QString &, int, bool))); - connect(playerlist, SIGNAL(fibsCommand(const QString &)), this, SLOT(handleCommand(const QString &))); - connect(playerlist, SIGNAL(fibsInvite(const QString &)), this, SLOT(fibsRequestInvitation(const QString &))); + connect(this, TQT_SIGNAL(fibsWhoInfo(const TQString &)), playerlist, TQT_SLOT(changePlayer(const TQString &))); + connect(this, TQT_SIGNAL(fibsLogout (const TQString &)), playerlist, TQT_SLOT(deletePlayer(const TQString &))); + connect(this, TQT_SIGNAL(fibsWhoEnd()), playerlist, TQT_SLOT(stopUpdate())); + connect(this, TQT_SIGNAL(fibsConnectionClosed()), playerlist, TQT_SLOT(stopUpdate())); + connect(this, TQT_SIGNAL(changePlayerStatus(const TQString &, int, bool)), + playerlist, TQT_SLOT(changePlayerStatus(const TQString &, int, bool))); + connect(playerlist, TQT_SIGNAL(fibsCommand(const TQString &)), this, TQT_SLOT(handleCommand(const TQString &))); + connect(playerlist, TQT_SIGNAL(fibsInvite(const TQString &)), this, TQT_SLOT(fibsRequestInvitation(const TQString &))); /* * Create, initialize and connect the chat window */ chatWindow = new KBgChat(0, "chat window"); - connect(this, SIGNAL(chatMessage(const QString &)), chatWindow, SLOT(handleData(const QString &))); - connect(this, SIGNAL(fibsStartNewGame(const QString &)), chatWindow, SLOT(startGame(const QString &))); - connect(this, SIGNAL(gameOver()), chatWindow, SLOT(endGame())); - connect(this, SIGNAL(fibsLogout (const QString &)), chatWindow, SLOT(deletePlayer(const QString &))); - connect(chatWindow, SIGNAL(fibsCommand(const QString &)), this, SLOT(handleCommand(const QString &))); - connect(chatWindow, SIGNAL(fibsRequestInvitation(const QString &)), this, SLOT(fibsRequestInvitation(const QString &))); - connect(chatWindow, SIGNAL(personalMessage(const QString &)), this, SLOT(personalMessage(const QString &))); - connect(playerlist, SIGNAL(fibsTalk(const QString &)), chatWindow, SLOT(fibsTalk(const QString &))); + connect(this, TQT_SIGNAL(chatMessage(const TQString &)), chatWindow, TQT_SLOT(handleData(const TQString &))); + connect(this, TQT_SIGNAL(fibsStartNewGame(const TQString &)), chatWindow, TQT_SLOT(startGame(const TQString &))); + connect(this, TQT_SIGNAL(gameOver()), chatWindow, TQT_SLOT(endGame())); + connect(this, TQT_SIGNAL(fibsLogout (const TQString &)), chatWindow, TQT_SLOT(deletePlayer(const TQString &))); + connect(chatWindow, TQT_SIGNAL(fibsCommand(const TQString &)), this, TQT_SLOT(handleCommand(const TQString &))); + connect(chatWindow, TQT_SIGNAL(fibsRequestInvitation(const TQString &)), this, TQT_SLOT(fibsRequestInvitation(const TQString &))); + connect(chatWindow, TQT_SIGNAL(personalMessage(const TQString &)), this, TQT_SLOT(personalMessage(const TQString &))); + connect(playerlist, TQT_SIGNAL(fibsTalk(const TQString &)), chatWindow, TQT_SLOT(fibsTalk(const TQString &))); /* * Creating, initializing and connecting the menu * ---------------------------------------------- */ - respMenu = new QPopupMenu(); - joinMenu = new QPopupMenu(); - cmdMenu = new QPopupMenu(); - optsMenu = new QPopupMenu(); + respMenu = new TQPopupMenu(); + joinMenu = new TQPopupMenu(); + cmdMenu = new TQPopupMenu(); + optsMenu = new TQPopupMenu(); /* * Initialize the FIBS submenu - this is also put in the play menu */ - conAction = new KAction(i18n("&Connect"), 0, this, SLOT( connectFIBS()), this); - newAction = new KAction(i18n("New Account"), 0, this, SLOT( newAccount()), this); - disAction = new KAction(i18n("&Disconnect"), 0, this, SLOT(disconnectFIBS()), this); + conAction = new KAction(i18n("&Connect"), 0, this, TQT_SLOT( connectFIBS()), this); + newAction = new KAction(i18n("New Account"), 0, this, TQT_SLOT( newAccount()), this); + disAction = new KAction(i18n("&Disconnect"), 0, this, TQT_SLOT(disconnectFIBS()), this); conAction->setEnabled(true ); conAction->plug(menu); disAction->setEnabled(false); disAction->plug(menu); @@ -2169,7 +2169,7 @@ KBgEngineFIBS::KBgEngineFIBS(QWidget *parent, QString *name, QPopupMenu *pmenu) menu->insertSeparator(); - (invAction = new KAction(i18n("&Invite..."), 0, this, SLOT(inviteDialog()), this))->plug(menu); + (invAction = new KAction(i18n("&Invite..."), 0, this, TQT_SLOT(inviteDialog()), this))->plug(menu); /* * Create and fill the response menu. This is for all these: type this or @@ -2177,8 +2177,8 @@ KBgEngineFIBS::KBgEngineFIBS(QWidget *parent, QString *name, QPopupMenu *pmenu) */ cmdMenuID = menu->insertItem(i18n("&Commands"), cmdMenu); { - (actAway = new KAction(i18n("Away"), 0, this, SLOT(away()), this))->plug(cmdMenu); - (actBack = new KAction(i18n("Back"), 0, this, SLOT(back()), this))->plug(cmdMenu); + (actAway = new KAction(i18n("Away"), 0, this, TQT_SLOT(away()), this))->plug(cmdMenu); + (actBack = new KAction(i18n("Back"), 0, this, TQT_SLOT(back()), this))->plug(cmdMenu); actAway->setEnabled(true); actBack->setEnabled(false); @@ -2195,14 +2195,14 @@ KBgEngineFIBS::KBgEngineFIBS(QWidget *parent, QString *name, QPopupMenu *pmenu) fibsOpt[i] = 0; fibsOpt[OptReady] = new KToggleAction(i18n("Ready to Play"), - 0, this, SLOT(toggle_ready()), this); + 0, this, TQT_SLOT(toggle_ready()), this); fibsOpt[OptRatings] = new KToggleAction(i18n("Show Rating Computations"), - 0, this, SLOT(toggle_ratings()), this); + 0, this, TQT_SLOT(toggle_ratings()), this); fibsOpt[OptRatings]->setCheckedState(i18n("Hide Rating Computations")); fibsOpt[OptGreedy] = new KToggleAction(i18n("Greedy Bearoffs"), - 0, this, SLOT(toggle_greedy()), this); + 0, this, TQT_SLOT(toggle_greedy()), this); fibsOpt[OptDouble] = new KToggleAction(i18n("Ask for Doubles"), - 0, this, SLOT(toggle_double()), this); + 0, this, TQT_SLOT(toggle_double()), this); for (int i = 0; i < NumFIBSOpt; i++) if (fibsOpt[i]) @@ -2216,16 +2216,16 @@ KBgEngineFIBS::KBgEngineFIBS(QWidget *parent, QString *name, QPopupMenu *pmenu) */ respMenuID = menu->insertItem(i18n("&Response"), respMenu); { - (actAccept = new KAction(i18n("Accept"), 0, this, SLOT(accept()), this))->plug(respMenu); - (actReject = new KAction(i18n("Reject"), 0, this, SLOT(reject()), this))->plug(respMenu); + (actAccept = new KAction(i18n("Accept"), 0, this, TQT_SLOT(accept()), this))->plug(respMenu); + (actReject = new KAction(i18n("Reject"), 0, this, TQT_SLOT(reject()), this))->plug(respMenu); actAccept->setEnabled(false); actReject->setEnabled(false); respMenu->insertSeparator(); - (actConti = new KAction(i18n("Join"), 0, this, SLOT(match_conti()), this))->plug(respMenu); - (actLeave = new KAction(i18n("Leave"), 0, this, SLOT(match_leave()), this))->plug(respMenu); + (actConti = new KAction(i18n("Join"), 0, this, TQT_SLOT(match_conti()), this))->plug(respMenu); + (actLeave = new KAction(i18n("Leave"), 0, this, TQT_SLOT(match_leave()), this))->plug(respMenu); actConti->setEnabled(false); actLeave->setEnabled(false); @@ -2238,14 +2238,14 @@ KBgEngineFIBS::KBgEngineFIBS(QWidget *parent, QString *name, QPopupMenu *pmenu) joinMenuID = menu->insertItem(i18n("&Join"), joinMenu); { numJoin = -1; - actJoin[0] = new KAction("", 0, this, SLOT(join_0()), this); - actJoin[1] = new KAction("", 0, this, SLOT(join_1()), this); - actJoin[2] = new KAction("", 0, this, SLOT(join_2()), this); - actJoin[3] = new KAction("", 0, this, SLOT(join_3()), this); - actJoin[4] = new KAction("", 0, this, SLOT(join_4()), this); - actJoin[5] = new KAction("", 0, this, SLOT(join_5()), this); - actJoin[6] = new KAction("", 0, this, SLOT(join_6()), this); - actJoin[7] = new KAction("", 0, this, SLOT(join_7()), this); + actJoin[0] = new KAction("", 0, this, TQT_SLOT(join_0()), this); + actJoin[1] = new KAction("", 0, this, TQT_SLOT(join_1()), this); + actJoin[2] = new KAction("", 0, this, TQT_SLOT(join_2()), this); + actJoin[3] = new KAction("", 0, this, TQT_SLOT(join_3()), this); + actJoin[4] = new KAction("", 0, this, TQT_SLOT(join_4()), this); + actJoin[5] = new KAction("", 0, this, TQT_SLOT(join_5()), this); + actJoin[6] = new KAction("", 0, this, TQT_SLOT(join_6()), this); + actJoin[7] = new KAction("", 0, this, TQT_SLOT(join_7()), this); } menu->setItemEnabled(joinMenuID, false); @@ -2258,11 +2258,11 @@ KBgEngineFIBS::KBgEngineFIBS(QWidget *parent, QString *name, QPopupMenu *pmenu) */ menu->insertSeparator(); - (listAct = new KToggleAction(i18n("&Player List"), 0, this, SLOT(showList()), this))->plug(menu); - (chatAct = new KToggleAction(i18n("&Chat"), 0, this, SLOT(showChat()), this))->plug(menu); + (listAct = new KToggleAction(i18n("&Player List"), 0, this, TQT_SLOT(showList()), this))->plug(menu); + (chatAct = new KToggleAction(i18n("&Chat"), 0, this, TQT_SLOT(showChat()), this))->plug(menu); - connect(playerlist, SIGNAL(windowVisible(bool)), listAct, SLOT(setChecked(bool))); - connect(chatWindow, SIGNAL(windowVisible(bool)), chatAct, SLOT(setChecked(bool))); + connect(playerlist, TQT_SIGNAL(windowVisible(bool)), listAct, TQT_SLOT(setChecked(bool))); + connect(chatWindow, TQT_SIGNAL(windowVisible(bool)), chatAct, TQT_SLOT(setChecked(bool))); /* * Create message IDs. This sets up a lot of regular expressions. @@ -2289,8 +2289,8 @@ KBgEngineFIBS::KBgEngineFIBS(QWidget *parent, QString *name, QPopupMenu *pmenu) // FIXME: move the start to connect... - keepaliveTimer = new QTimer(this); - connect(keepaliveTimer, SIGNAL(timeout()), this, SLOT(keepAlive())); + keepaliveTimer = new TQTimer(this); + connect(keepaliveTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(keepAlive())); keepaliveTimer->start(1200000); } diff --git a/kbackgammon/engines/fibs/kbgfibs.h b/kbackgammon/engines/fibs/kbgfibs.h index 1c14e0f3..23db44b2 100644 --- a/kbackgammon/engines/fibs/kbgfibs.h +++ b/kbackgammon/engines/fibs/kbgfibs.h @@ -35,9 +35,9 @@ #include "kbgfibschat.h" #include "kbginvite.h" // TODO -#include <qstring.h> -#include <qstringlist.h> -#include <qregexp.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqregexp.h> #include <klocale.h> @@ -66,7 +66,7 @@ public: /** * Constructor */ - KBgEngineFIBS(QWidget *parent = 0, QString *name = 0, QPopupMenu *pmenu = 0); + KBgEngineFIBS(TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); /** * Destructor @@ -118,7 +118,7 @@ public slots: * A move has been made on the board - see the board class * for the format of the string s */ - virtual void handleMove(QString *s); + virtual void handleMove(TQString *s); /** * Undo the last move @@ -149,11 +149,11 @@ public slots: /* * Process the string cmd */ - void handleCommand(const QString &cmd); + void handleCommand(const TQString &cmd); - void fibsRequestInvitation(const QString &player); + void fibsRequestInvitation(const TQString &player); - void personalMessage(const QString &msg); + void personalMessage(const TQString &msg); @@ -165,20 +165,20 @@ public slots: signals: - void serverString(const QString &s); + void serverString(const TQString &s); - void fibsWhoInfo(const QString &line); + void fibsWhoInfo(const TQString &line); void fibsWhoEnd(); - void fibsLogout(const QString &p); - void fibsLogin(const QString &p); + void fibsLogout(const TQString &p); + void fibsLogin(const TQString &p); void fibsConnectionClosed(); - void changePlayerStatus(const QString &, int, bool); + void changePlayerStatus(const TQString &, int, bool); - void chatMessage(const QString &msg); + void chatMessage(const TQString &msg); - void fibsStartNewGame(const QString &msg); + void fibsStartNewGame(const TQString &msg); void gameOver(); protected slots: @@ -192,22 +192,22 @@ protected slots: private: - QTimer *keepaliveTimer; + TQTimer *keepaliveTimer; - QString pname[2]; + TQString pname[2]; - QString currBoard, caption; + TQString currBoard, caption; //KBgStatus *currBoard //KBgFIBSBoard *boardHandler; - QStringList invitations; + TQStringList invitations; /* * special menu entries */ int respMenuID, cmdMenuID, joinMenuID, optsMenuID; - QPopupMenu *respMenu, *cmdMenu, *joinMenu, *optsMenu; + TQPopupMenu *respMenu, *cmdMenu, *joinMenu, *optsMenu; /* * child windows @@ -219,10 +219,10 @@ private: /* * Other stuff */ - QString lastMove; + TQString lastMove; int toMove; - QString lastAway; + TQString lastAway; bool playing; bool redoPossible; int undoCounter; @@ -261,13 +261,13 @@ protected slots: * Handle rawwho information for the purposes of the invitation * submenu and the join entries */ - void changeJoin(const QString &info); + void changeJoin(const TQString &info); /** * A player will be removed from the menu of pending invitations * if necessary. */ - void cancelJoin(const QString &info); + void cancelJoin(const TQString &info); /** * We have up to 8 names in the join menu. They are the @@ -275,7 +275,7 @@ protected slots: * has its own slot and all slots call the common backend * join(). */ - void join(const QString &msg); + void join(const TQString &msg); void join_0(); void join_1(); @@ -337,7 +337,7 @@ public slots: void readData(); // send the string s to the server - void sendData(const QString &s); + void sendData(const TQString &s); protected: @@ -347,7 +347,7 @@ protected: private: // actual connection object - QSocket *connection; + TQSocket *connection; // flag if we have login information or new account bool login; @@ -395,7 +395,7 @@ protected slots: * made more efficient, but it is not time critical (and it appears to be * easier to understand this way). */ - void handleServerData(QString &line); + void handleServerData(TQString &line); protected: @@ -404,18 +404,18 @@ protected: int rxStatus, rxCount; - QString rxCollect; + TQString rxCollect; /* * The following functions handle the individual states * of the handleServerData() state machine, */ - void handleMessageWhois(const QString &line); - void handleMessageRating(const QString &line); - void handleMessageMotd(const QString &line); - void handleMessageNewLogin(const QString &line); - void handleMessageConnect(const QString &line, const QString &rawline); - void handleMessageNormal(QString &line, QString &rawline); + void handleMessageWhois(const TQString &line); + void handleMessageRating(const TQString &line); + void handleMessageMotd(const TQString &line); + void handleMessageNewLogin(const TQString &line); + void handleMessageConnect(const TQString &line, const TQString &rawline); + void handleMessageNormal(TQString &line, TQString &rawline); /* * The next enumeration and the array of regular expressions is needed for the @@ -436,7 +436,7 @@ protected: YouGive, DoubleY, DoubleN, KeepAlv, RatingY, RatingN, NumPattern}; - QRegExp pat[NumPattern]; + TQRegExp pat[NumPattern]; /* * This function is simply filling the pat[] array with the proper values. @@ -454,26 +454,26 @@ private: * Various options */ bool showMsg, whoisInvite; - QCheckBox *cbp, *cbi; + TQCheckBox *cbp, *cbi; - QCheckBox *cbk; + TQCheckBox *cbk; bool keepalive; /* * Connection setup */ enum FIBSInfo {FIBSHost, FIBSPort, FIBSUser, FIBSPswd, NumFIBS}; - QString infoFIBS[NumFIBS]; - QLineEdit *lec[NumFIBS]; + TQString infoFIBS[NumFIBS]; + TQLineEdit *lec[NumFIBS]; /* * Auto messages */ enum AutoMessages {MsgBeg, MsgLos, MsgWin, NumMsg}; - QLineEdit *lem[NumMsg]; - QCheckBox *cbm[NumMsg]; + TQLineEdit *lem[NumMsg]; + TQCheckBox *cbm[NumMsg]; bool useAutoMsg[NumMsg]; - QString autoMsg[NumMsg]; + TQString autoMsg[NumMsg]; }; #endif // __KBGFIBS_H diff --git a/kbackgammon/engines/fibs/kbgfibschat.cpp b/kbackgammon/engines/fibs/kbgfibschat.cpp index 45ba2bb7..7b34bae0 100644 --- a/kbackgammon/engines/fibs/kbgfibschat.cpp +++ b/kbackgammon/engines/fibs/kbgfibschat.cpp @@ -26,25 +26,25 @@ #include "kbgfibschat.h" #include "kbgfibschat.moc" -#include <qstring.h> - -#include <qlayout.h> -#include <qlabel.h> -#include <qpopupmenu.h> -#include <qregexp.h> -#include <qfont.h> -#include <qwhatsthis.h> -#include <qdatetime.h> -#include <qclipboard.h> -#include <qsimplerichtext.h> -#include <qregion.h> -#include <qpalette.h> -#include <qpainter.h> -#include <qpoint.h> -#include <qlistbox.h> -#include <qiconset.h> -#include <qstringlist.h> -#include <qdict.h> +#include <tqstring.h> + +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqpopupmenu.h> +#include <tqregexp.h> +#include <tqfont.h> +#include <tqwhatsthis.h> +#include <tqdatetime.h> +#include <tqclipboard.h> +#include <tqsimplerichtext.h> +#include <tqregion.h> +#include <tqpalette.h> +#include <tqpainter.h> +#include <tqpoint.h> +#include <tqlistbox.h> +#include <tqiconset.h> +#include <tqstringlist.h> +#include <tqdict.h> #include <klocale.h> #include <kconfig.h> @@ -61,7 +61,7 @@ /* * Private utility class that might become more generally useful in - * the future. Basically, it implements rich text QListBox items. + * the future. Basically, it implements rich text TQListBox items. */ class KLBT : public QListBoxText { @@ -71,12 +71,12 @@ public: /* * Constructor */ - KLBT(QWidget *parent, const QString &text = QString::null, const QString &player = QString::null) - : QListBoxText(text) + KLBT(TQWidget *parent, const TQString &text = TQString::null, const TQString &player = TQString::null) + : TQListBoxText(text) { w = parent; - n = new QString(player); - t = new QSimpleRichText(text, w->font()); + n = new TQString(player); + t = new TQSimpleRichText(text, w->font()); // FIXME: this is not yet perfect t->setWidth(w->width()-20); @@ -94,7 +94,7 @@ public: /* * Overloaded required members returning height */ - virtual int height(const QListBox *) const + virtual int height(const TQListBox *) const { return (1+t->height()); } @@ -102,7 +102,7 @@ public: /* * Overloaded required members returning width */ - virtual int width(const QListBox *) const + virtual int width(const TQListBox *) const { return t->width(); } @@ -111,7 +111,7 @@ public: * The context menu needs the name of the player. It's easier * than extracting it from the text. */ - QString player() const + TQString player() const { return *n; } @@ -121,16 +121,16 @@ protected: /* * Required overloaded member to paint the text on the painter p. */ - virtual void paint(QPainter *p) + virtual void paint(TQPainter *p) { - t->draw(p, 1, 1, QRegion(p->viewport()), w->colorGroup()); + t->draw(p, 1, 1, TQRegion(p->viewport()), w->colorGroup()); } private: - QSimpleRichText *t; - QWidget *w; - QString *n; + TQSimpleRichText *t; + TQWidget *w; + TQString *n; }; @@ -142,12 +142,12 @@ public: /* * Name of the users */ - QString mName[2]; + TQString mName[2]; /* * Hold and assemble info text */ - QString mText; + TQString mText; /* * Numbers of the private action list. @@ -164,22 +164,22 @@ public: /* * Context menu and invitation menu */ - QPopupMenu *mChat, *mInvt; + TQPopupMenu *mChat, *mInvt; /* * list of users we do not want to hear shouting */ - QStringList mGag; + TQStringList mGag; /* * Listbox needed by the setup dialog */ - QListBox *mLb; + TQListBox *mLb; /* * Internal ID to name mapping */ - QDict<int> *mName2ID; + TQDict<int> *mName2ID; }; @@ -189,15 +189,15 @@ public: /* * Constructor of the chat window. */ -KBgChat::KBgChat(QWidget *parent, const char *name) +KBgChat::KBgChat(TQWidget *parent, const char *name) : KChat(parent, false) { d = new KBgChatPrivate(); KActionCollection* actions = new KActionCollection(this); - d->mName[0] = QString::null; + d->mName[0] = TQString::null; d->mChat = 0; - d->mInvt = new QPopupMenu(); + d->mInvt = new TQPopupMenu(); setAutoAddMessages(false); // we get an echo from FIBS setFromNickname(i18n("%1 user").arg(PROG_NAME)); @@ -207,12 +207,12 @@ KBgChat::KBgChat(QWidget *parent, const char *name) if (!addSendingEntry(i18n("Whisper to watchers only"), CLIP_YOU_WHISPER)) kdDebug(10500) << "adding whisper" << endl; - connect(this, SIGNAL(rightButtonClicked(QListBoxItem *, const QPoint &)), - this, SLOT(contextMenu(QListBoxItem *, const QPoint &))); - connect(this, SIGNAL(signalSendMessage(int, const QString &)), - this, SLOT(handleCommand(int, const QString &))); + connect(this, TQT_SIGNAL(rightButtonClicked(TQListBoxItem *, const TQPoint &)), + this, TQT_SLOT(contextMenu(TQListBoxItem *, const TQPoint &))); + connect(this, TQT_SIGNAL(signalSendMessage(int, const TQString &)), + this, TQT_SLOT(handleCommand(int, const TQString &))); - d->mName2ID = new QDict<int>(17, true); + d->mName2ID = new TQDict<int>(17, true); d->mName2ID->setAutoDelete(true); /* @@ -221,7 +221,7 @@ KBgChat::KBgChat(QWidget *parent, const char *name) setIcon(kapp->miniIcon()); setCaption(i18n("Chat Window")); - QWhatsThis::add(this, i18n("This is the chat window.\n\n" + TQWhatsThis::add(this, i18n("This is the chat window.\n\n" "The text in this window is colored depending on whether " "it is directed at you personally, shouted to the general " "FIBS population, has been said by you, or is of general " @@ -231,34 +231,34 @@ KBgChat::KBgChat(QWidget *parent, const char *name) * Define set of available actions */ d->mAct[KBgChatPrivate::Inquire] = new KAction(i18n("Info On"), - QIconSet(kapp->iconLoader()->loadIcon( + TQIconSet(kapp->iconLoader()->loadIcon( "help.xpm", KIcon::Small)), - 0, this, SLOT(slotInquire()), actions); + 0, this, TQT_SLOT(slotInquire()), actions); d->mAct[KBgChatPrivate::Talk] = new KAction(i18n("Talk To"), - QIconSet(kapp->iconLoader()->loadIcon( + TQIconSet(kapp->iconLoader()->loadIcon( PROG_NAME "-chat.png", KIcon::Small)), - 0, this, SLOT(slotTalk()), actions); + 0, this, TQT_SLOT(slotTalk()), actions); d->mAct[KBgChatPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, this, - SLOT(slotInviteD()), actions); + TQT_SLOT(slotInviteD()), actions); d->mAct[KBgChatPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, this, - SLOT(slotInvite1()), actions); + TQT_SLOT(slotInvite1()), actions); d->mAct[KBgChatPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, this, - SLOT(slotInvite2()), actions); + TQT_SLOT(slotInvite2()), actions); d->mAct[KBgChatPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, this, - SLOT(slotInvite3()), actions); + TQT_SLOT(slotInvite3()), actions); d->mAct[KBgChatPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, this, - SLOT(slotInvite4()), actions); + TQT_SLOT(slotInvite4()), actions); d->mAct[KBgChatPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, this, - SLOT(slotInvite5()), actions); + TQT_SLOT(slotInvite5()), actions); d->mAct[KBgChatPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, this, - SLOT(slotInvite6()), actions); + TQT_SLOT(slotInvite6()), actions); d->mAct[KBgChatPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, this, - SLOT(slotInvite7()), actions); + TQT_SLOT(slotInvite7()), actions); d->mAct[KBgChatPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, this, - SLOT(slotInviteU()), actions); + TQT_SLOT(slotInviteU()), actions); d->mAct[KBgChatPrivate::InviteR] = new KAction(i18n("Resume"), 0, this, - SLOT(slotInviteR()), actions); + TQT_SLOT(slotInviteR()), actions); d->mAct[KBgChatPrivate::InviteD]->plug(d->mInvt); @@ -277,13 +277,13 @@ KBgChat::KBgChat(QWidget *parent, const char *name) d->mAct[KBgChatPrivate::InviteU]->plug(d->mInvt); d->mAct[KBgChatPrivate::InviteR]->plug(d->mInvt); - d->mAct[KBgChatPrivate::Gag] = new KAction(i18n("Gag"), 0, this, SLOT(slotGag()), actions); - d->mAct[KBgChatPrivate::Ungag] = new KAction(i18n("Ungag"), 0, this, SLOT(slotUngag()), actions); - d->mAct[KBgChatPrivate::Cleargag] = new KAction(i18n("Clear Gag List"), 0, this, SLOT(slotCleargag()), actions); - d->mAct[KBgChatPrivate::Copy] = KStdAction::copy(this, SLOT(slotCopy()), actions); - d->mAct[KBgChatPrivate::Clear] = new KAction(i18n("Clear"), 0, this, SLOT(slotClear()), actions); - d->mAct[KBgChatPrivate::Close] = KStdAction::close(this, SLOT(hide()), actions); - d->mAct[KBgChatPrivate::Silent] = new KToggleAction(i18n("Silent"), 0, this, SLOT(slotSilent()), actions); + d->mAct[KBgChatPrivate::Gag] = new KAction(i18n("Gag"), 0, this, TQT_SLOT(slotGag()), actions); + d->mAct[KBgChatPrivate::Ungag] = new KAction(i18n("Ungag"), 0, this, TQT_SLOT(slotUngag()), actions); + d->mAct[KBgChatPrivate::Cleargag] = new KAction(i18n("Clear Gag List"), 0, this, TQT_SLOT(slotCleargag()), actions); + d->mAct[KBgChatPrivate::Copy] = KStdAction::copy(this, TQT_SLOT(slotCopy()), actions); + d->mAct[KBgChatPrivate::Clear] = new KAction(i18n("Clear"), 0, this, TQT_SLOT(slotClear()), actions); + d->mAct[KBgChatPrivate::Close] = KStdAction::close(this, TQT_SLOT(hide()), actions); + d->mAct[KBgChatPrivate::Silent] = new KToggleAction(i18n("Silent"), 0, this, TQT_SLOT(slotSilent()), actions); } @@ -309,7 +309,7 @@ void KBgChat::readConfig() KConfig* config = kapp->config(); config->setGroup("chat window"); - QPoint pos(10, 10); + TQPoint pos(10, 10); pos = config->readPointEntry("ori", &pos); setGeometry(pos.x(), pos.y(), config->readNumEntry("wdt",460), config->readNumEntry("hgt",200)); @@ -344,7 +344,7 @@ void KBgChat::saveConfig() * Setup dialog page of the player list - allow the user to select the * columns to show * - * FIXME: need to be able to set font here KChatBase::setBothFont(const QFont& font) + * FIXME: need to be able to set font here KChatBase::setBothFont(const TQFont& font) */ void KBgChat::getSetupPages(KTabCtl *nb, int space) { @@ -352,18 +352,18 @@ void KBgChat::getSetupPages(KTabCtl *nb, int space) * Main Widget * =========== */ - QWidget *w = new QWidget(nb); - QGridLayout *gl = new QGridLayout(w, 2, 1, space); + TQWidget *w = new TQWidget(nb); + TQGridLayout *gl = new TQGridLayout(w, 2, 1, space); - d->mLb = new QListBox(w); + d->mLb = new TQListBox(w); d->mLb->setMultiSelection(true); d->mLb->insertStringList(d->mGag); - QLabel *info = new QLabel(w); + TQLabel *info = new TQLabel(w); info->setText(i18n("Select users to be removed from the gag list.")); - QWhatsThis::add(w, i18n("Select all the users you want " + TQWhatsThis::add(w, i18n("Select all the users you want " "to remove from the gag list " "and then click OK. Afterwards " "you will again hear what they shout.")); @@ -414,37 +414,37 @@ void KBgChat::setupDefault() // == various slots and functions ============================================== /* - * Overloaded member to create a QListBoxItem for the chat window. + * Overloaded member to create a TQListBoxItem for the chat window. */ -QListBoxItem* KBgChat::layoutMessage(const QString& fromName, const QString& text) +TQListBoxItem* KBgChat::layoutMessage(const TQString& fromName, const TQString& text) { - QListBoxText* message = new KLBT(this, text, fromName); + TQListBoxText* message = new KLBT(this, text, fromName); return message; } /* * Catch hide events, so the engine's menu can be update. */ -void KBgChat::showEvent(QShowEvent *e) +void KBgChat::showEvent(TQShowEvent *e) { - QFrame::showEvent(e); + TQFrame::showEvent(e); emit windowVisible(true); } /* * Catch hide events, so the engine's menu can be update. */ -void KBgChat::hideEvent(QHideEvent *e) +void KBgChat::hideEvent(TQHideEvent *e) { emit windowVisible(false); - QFrame::hideEvent(e); + TQFrame::hideEvent(e); } /* * At the beginning of a game, add the name to the list and switch to * kibitz mode. */ -void KBgChat::startGame(const QString &name) +void KBgChat::startGame(const TQString &name) { int *id = d->mName2ID->find(d->mName[1] = name); if (!id) { @@ -470,7 +470,7 @@ void KBgChat::endGame() /* * Set the chat window ready to talk to name */ -void KBgChat::fibsTalk(const QString &name) +void KBgChat::fibsTalk(const TQString &name) { int *id = d->mName2ID->find(name); if (!id) { @@ -484,7 +484,7 @@ void KBgChat::fibsTalk(const QString &name) /* * Remove the player from the combo box when he/she logs out. */ -void KBgChat::deletePlayer(const QString &name) +void KBgChat::deletePlayer(const TQString &name) { int *id = d->mName2ID->find(name); if (id) { @@ -496,7 +496,7 @@ void KBgChat::deletePlayer(const QString &name) /* * Take action when the user presses return in the line edit control. */ -void KBgChat::handleCommand(int id, const QString& msg) +void KBgChat::handleCommand(int id, const TQString& msg) { int realID = sendingEntry(); @@ -511,7 +511,7 @@ void KBgChat::handleCommand(int id, const QString& msg) emit fibsCommand("whisper " + msg); break; default: - QDictIterator<int> it(*d->mName2ID); + TQDictIterator<int> it(*d->mName2ID); while (it.current()) { if (*it.current() == realID) { emit fibsCommand("tell " + it.currentKey() + " " + msg); @@ -533,10 +533,10 @@ void KBgChat::handleCommand(int id, const QString& msg) * This function emits the string in rich text format with the signal * personalMessage - again: the string contains rich text! */ -void KBgChat::handleData(const QString &msg) +void KBgChat::handleData(const TQString &msg) { - QString clip = msg.left(msg.find(' ')), user, cMsg = msg; - QDateTime date; + TQString clip = msg.left(msg.find(' ')), user, cMsg = msg; + TQDateTime date; bool flag = false; int cmd = clip.toInt(&flag); @@ -549,7 +549,7 @@ void KBgChat::handleData(const QString &msg) switch (cmd) { case CLIP_SAYS: if (!d->mGag.contains(user)) { - cMsg = i18n("<u>%1 tells you:</u> %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), "")); + cMsg = i18n("<u>%1 tells you:</u> %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); cMsg = "<font color=\"red\">" + cMsg + "</font>"; emit personalMessage(cMsg); } else @@ -558,7 +558,7 @@ void KBgChat::handleData(const QString &msg) case CLIP_SHOUTS: if ((!((KToggleAction *)d->mAct[KBgChatPrivate::Silent])->isChecked()) && (!d->mGag.contains(user))) { - cMsg = i18n("<u>%1 shouts:</u> %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), "")); + cMsg = i18n("<u>%1 shouts:</u> %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); cMsg = "<font color=\"black\">" + cMsg + "</font>"; } else cMsg = ""; @@ -566,7 +566,7 @@ void KBgChat::handleData(const QString &msg) case CLIP_WHISPERS: if (!d->mGag.contains(user)) { - cMsg = i18n("<u>%1 whispers:</u> %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), "")); + cMsg = i18n("<u>%1 whispers:</u> %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); cMsg = "<font color=\"red\">" + cMsg + "</font>"; emit personalMessage(cMsg); } else @@ -575,7 +575,7 @@ void KBgChat::handleData(const QString &msg) case CLIP_KIBITZES: if (!d->mGag.contains(user)) { - cMsg = i18n("<u>%1 kibitzes:</u> %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), "")); + cMsg = i18n("<u>%1 kibitzes:</u> %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); cMsg = "<font color=\"red\">" + cMsg + "</font>"; emit personalMessage(cMsg); } else @@ -583,31 +583,31 @@ void KBgChat::handleData(const QString &msg) break; case CLIP_YOU_SAY: - cMsg = i18n("<u>You tell %1:</u> %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), "")); + cMsg = i18n("<u>You tell %1:</u> %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>"; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; case CLIP_YOU_SHOUT: cMsg = i18n("<u>You shout:</u> %1").arg(cMsg); cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>"; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; case CLIP_YOU_WHISPER: cMsg = i18n("<u>You whisper:</u> %1").arg(cMsg); cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>"; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; case CLIP_YOU_KIBITZ: cMsg = i18n("<u>You kibitz:</u> %1").arg(cMsg); cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>"; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; case CLIP_MESSAGE: @@ -618,21 +618,21 @@ void KBgChat::handleData(const QString &msg) cMsg = i18n("<u>User %1 left a message at %2</u>: %3").arg(user).arg(date.toString()).arg(cMsg); cMsg = "<font color=\"red\">" + cMsg + "</font>"; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; case CLIP_MESSAGE_DELIVERED: cMsg = i18n("Your message for %1 has been delivered.").arg(user); - cMsg = QString("<font color=\"darkgreen\">") + cMsg + "</font>"; + cMsg = TQString("<font color=\"darkgreen\">") + cMsg + "</font>"; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; case CLIP_MESSAGE_SAVED: cMsg = i18n("Your message for %1 has been saved.").arg(user); - cMsg = QString("<font color=\"darkgreen\">") + cMsg + "</font>"; + cMsg = TQString("<font color=\"darkgreen\">") + cMsg + "</font>"; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; default: // ignore the message @@ -644,8 +644,8 @@ void KBgChat::handleData(const QString &msg) /* * Special treatment for non-CLIP messages */ - if (cMsg.contains(QRegExp("^You say to yourself: "))) { - cMsg.replace(QRegExp("^You say to yourself: "), + if (cMsg.contains(TQRegExp("^You say to yourself: "))) { + cMsg.replace(TQRegExp("^You say to yourself: "), i18n("<u>You say to yourself:</u> ")); } else { kdDebug(user.isNull(), 10500) << "KBgChat::handleData unhandled message: " @@ -664,19 +664,19 @@ void KBgChat::handleData(const QString &msg) /* * RMB opens a context menu. */ -void KBgChat::contextMenu(QListBoxItem *i, const QPoint &p) +void KBgChat::contextMenu(TQListBoxItem *i, const TQPoint &p) { /* - * Even if i is non-null, user might still be QString::null + * Even if i is non-null, user might still be TQString::null */ - d->mName[0] = (i == 0) ? QString::null : ((KLBT *)i)->player(); - d->mText = (i == 0) ? QString::null : ((KLBT *)i)->text(); + d->mName[0] = (i == 0) ? TQString::null : ((KLBT *)i)->player(); + d->mText = (i == 0) ? TQString::null : ((KLBT *)i)->text(); /* * Get a new context menu every time. Safe to delete the 0 * pointer. */ - delete d->mChat; d->mChat = new QPopupMenu(); + delete d->mChat; d->mChat = new TQPopupMenu(); /* * Fill the context menu with actions @@ -726,11 +726,11 @@ void KBgChat::slotCleargag() { d->mGag.clear(); - QString msg("<font color=\"blue\">"); + TQString msg("<font color=\"blue\">"); msg += i18n("The gag list is now empty."); msg += "</font>"; - addMessage(QString::null, msg); + addMessage(TQString::null, msg); } /* @@ -740,11 +740,11 @@ void KBgChat::slotGag() { d->mGag.append(d->mName[0]); - QString msg("<font color=\"blue\">"); + TQString msg("<font color=\"blue\">"); msg += i18n("You won't hear what %1 says and shouts.").arg(d->mName[0]); msg += "</font>"; - addMessage(QString::null, msg); + addMessage(TQString::null, msg); } /* @@ -762,11 +762,11 @@ void KBgChat::slotUngag() { d->mGag.remove(d->mName[0]); - QString msg("<font color=\"blue\">"); + TQString msg("<font color=\"blue\">"); msg += i18n("You will again hear what %1 says and shouts.").arg(d->mName[0]); msg += "</font>"; - addMessage(QString::null, msg); + addMessage(TQString::null, msg); } /* @@ -783,12 +783,12 @@ void KBgChat::slotInquire() */ void KBgChat::slotSilent() { - QString msg; + TQString msg; if (((KToggleAction *)d->mAct[KBgChatPrivate::Silent])->isChecked()) msg = "<font color=\"blue\">" + i18n("You will not hear what people shout.") + "</font>"; else msg = "<font color=\"blue\">" + i18n("You will hear what people shout.") + "</font>"; - addMessage(QString::null, msg); + addMessage(TQString::null, msg); } /* @@ -797,10 +797,10 @@ void KBgChat::slotSilent() */ void KBgChat::slotCopy() { - d->mText.replace(QRegExp("<u>"), ""); - d->mText.replace(QRegExp("</u>"), ""); - d->mText.replace(QRegExp("</font>"), ""); - d->mText.replace(QRegExp("^.*\">"), ""); + d->mText.replace(TQRegExp("<u>"), ""); + d->mText.replace(TQRegExp("</u>"), ""); + d->mText.replace(TQRegExp("</font>"), ""); + d->mText.replace(TQRegExp("^.*\">"), ""); kapp->clipboard()->setText(d->mText); } diff --git a/kbackgammon/engines/fibs/kbgfibschat.h b/kbackgammon/engines/fibs/kbgfibschat.h index c3a1d670..491cf19b 100644 --- a/kbackgammon/engines/fibs/kbgfibschat.h +++ b/kbackgammon/engines/fibs/kbgfibschat.h @@ -61,7 +61,7 @@ public: /** * Constructor */ - KBgChat(QWidget *parent = 0, const char *name = 0); + KBgChat(TQWidget *parent = 0, const char *name = 0); /** * Destructor @@ -74,7 +74,7 @@ public slots: * Catch the RMB signal to display a context menu at p. The * menu shows entries specific to the selected item i. */ - void contextMenu(QListBoxItem *i, const QPoint &p); + void contextMenu(TQListBoxItem *i, const TQPoint &p); /** * Add chat window specific pages to the setup dialog @@ -100,12 +100,12 @@ public slots: * Player name has logges out. Remove name from the chat * window combo box if necessary. */ - void deletePlayer(const QString &name); + void deletePlayer(const TQString &name); /** * Process and append msg to the text. */ - void handleData(const QString &msg); + void handleData(const TQString &msg); /** * Restore previously saved setting or provides defaults @@ -120,7 +120,7 @@ public slots: /** * Set the opponents name and select whisper */ - void startGame(const QString &name); + void startGame(const TQString &name); /** * Game is over. We won (or not) and have been playing (or not) @@ -130,24 +130,24 @@ public slots: /** * Start talking to name */ - void fibsTalk(const QString &name); + void fibsTalk(const TQString &name); signals: /** * Emits a string that can be sent to the server */ - void fibsCommand(const QString &cmd); + void fibsCommand(const TQString &cmd); /** * Request an invitation of player */ - void fibsRequestInvitation(const QString &player); + void fibsRequestInvitation(const TQString &player); /** * Text of a personal message */ - void personalMessage(const QString &msg); + void personalMessage(const TQString &msg); /** * Dialog is visible or not @@ -159,18 +159,18 @@ protected: /** * Catch show events, so the engine's menu can be updated. */ - virtual void showEvent(QShowEvent *e); + virtual void showEvent(TQShowEvent *e); /** * Catch hide events, so the engine's menu can be updated. */ - virtual void hideEvent(QHideEvent *e); + virtual void hideEvent(TQHideEvent *e); /** * Create a custom ListBoxItem that contains a formated string * for the chat window. */ - virtual QListBoxItem* layoutMessage(const QString& fromName, const QString& text); + virtual TQListBoxItem* layoutMessage(const TQString& fromName, const TQString& text); protected slots: @@ -262,7 +262,7 @@ protected slots: /** * Slot for return pressed. Time to send the text to FIBS. */ - void handleCommand(int id, const QString& msg); + void handleCommand(int id, const TQString& msg); private: diff --git a/kbackgammon/engines/fibs/kbginvite.cpp b/kbackgammon/engines/fibs/kbginvite.cpp index cb455f0a..f43c3b6a 100644 --- a/kbackgammon/engines/fibs/kbginvite.cpp +++ b/kbackgammon/engines/fibs/kbginvite.cpp @@ -24,11 +24,11 @@ #include "kbginvite.h" #include "kbginvite.moc" -#include <qlabel.h> -#include <qlayout.h> -#include <qframe.h> -#include <qspinbox.h> -#include <qstring.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqframe.h> +#include <tqspinbox.h> +#include <tqstring.h> #include <klocale.h> #include <klineedit.h> @@ -40,8 +40,8 @@ class KBgInvitePrivate { public: KLineEdit *mLe; - QSpinBox *mSb; - QPushButton *mInvite, *mResume, *mUnlimited, *mCancel, *mClose; + TQSpinBox *mSb; + TQPushButton *mInvite, *mResume, *mUnlimited, *mCancel, *mClose; }; @@ -56,14 +56,14 @@ KBgInvite::KBgInvite(const char *name) d = new KBgInvitePrivate(); - QLabel *info = new QLabel(this); + TQLabel *info = new TQLabel(this); d->mLe = new KLineEdit(this, "invitation dialog"); - d->mSb = new QSpinBox(1, 999, 1, this, "spin box"); + d->mSb = new TQSpinBox(1, 999, 1, this, "spin box"); - d->mInvite = new QPushButton(i18n("&Invite"), this); - d->mResume = new QPushButton(i18n("&Resume"), this); - d->mUnlimited = new QPushButton(i18n("&Unlimited"), this); + d->mInvite = new TQPushButton(i18n("&Invite"), this); + d->mResume = new TQPushButton(i18n("&Resume"), this); + d->mUnlimited = new TQPushButton(i18n("&Unlimited"), this); d->mClose = new KPushButton(KStdGuiItem::close(), this); d->mCancel = new KPushButton(KStdGuiItem::clear(), this); @@ -71,19 +71,19 @@ KBgInvite::KBgInvite(const char *name) info->setText(i18n("Type the name of the player you want to invite in the first entry\n" "field and select the desired match length in the spin box.")); - QFrame *hLine = new QFrame(this); - hLine->setFrameStyle(QFrame::Sunken|QFrame::HLine); + TQFrame *hLine = new TQFrame(this); + hLine->setFrameStyle(TQFrame::Sunken|TQFrame::HLine); /* * Set up layouts */ - QBoxLayout *vbox = new QVBoxLayout(this); + TQBoxLayout *vbox = new TQVBoxLayout(this); - QBoxLayout *hbox_1 = new QHBoxLayout(vbox); - QBoxLayout *hbox_2 = new QHBoxLayout(vbox); - QBoxLayout *hbox_3 = new QHBoxLayout(vbox); - QBoxLayout *hbox_4 = new QHBoxLayout(vbox); - QBoxLayout *hbox_5 = new QHBoxLayout(vbox); + TQBoxLayout *hbox_1 = new TQHBoxLayout(vbox); + TQBoxLayout *hbox_2 = new TQHBoxLayout(vbox); + TQBoxLayout *hbox_3 = new TQHBoxLayout(vbox); + TQBoxLayout *hbox_4 = new TQHBoxLayout(vbox); + TQBoxLayout *hbox_5 = new TQHBoxLayout(vbox); hbox_1->addWidget(info); @@ -117,11 +117,11 @@ KBgInvite::KBgInvite(const char *name) /* * Connect the buttons */ - connect(d->mUnlimited, SIGNAL(clicked()), SLOT(unlimitedClicked())); - connect(d->mResume, SIGNAL(clicked()), SLOT(resumeClicked())); - connect(d->mInvite, SIGNAL(clicked()), SLOT(inviteClicked())); - connect(d->mClose, SIGNAL(clicked()), SLOT(hide())); - connect(d->mCancel, SIGNAL(clicked()), SLOT(cancelClicked())); + connect(d->mUnlimited, TQT_SIGNAL(clicked()), TQT_SLOT(unlimitedClicked())); + connect(d->mResume, TQT_SIGNAL(clicked()), TQT_SLOT(resumeClicked())); + connect(d->mInvite, TQT_SIGNAL(clicked()), TQT_SLOT(inviteClicked())); + connect(d->mClose, TQT_SIGNAL(clicked()), TQT_SLOT(hide())); + connect(d->mCancel, TQT_SIGNAL(clicked()), TQT_SLOT(cancelClicked())); } /* @@ -143,7 +143,7 @@ void KBgInvite::hide() /* * Set player name */ -void KBgInvite::setPlayer(const QString &player) +void KBgInvite::setPlayer(const TQString &player) { d->mLe->setText(player); } @@ -153,8 +153,8 @@ void KBgInvite::setPlayer(const QString &player) */ void KBgInvite::inviteClicked() { - QString tmp; - emit inviteCommand(QString("invite ") + d->mLe->text() + " " + tmp.setNum(d->mSb->value())); + TQString tmp; + emit inviteCommand(TQString("invite ") + d->mLe->text() + " " + tmp.setNum(d->mSb->value())); } /* @@ -162,7 +162,7 @@ void KBgInvite::inviteClicked() */ void KBgInvite::unlimitedClicked() { - emit inviteCommand(QString("invite ") + d->mLe->text() + " unlimited"); + emit inviteCommand(TQString("invite ") + d->mLe->text() + " unlimited"); } /* @@ -170,7 +170,7 @@ void KBgInvite::unlimitedClicked() */ void KBgInvite::resumeClicked() { - emit inviteCommand(QString("invite ") + d->mLe->text()); + emit inviteCommand(TQString("invite ") + d->mLe->text()); } /* diff --git a/kbackgammon/engines/fibs/kbginvite.h b/kbackgammon/engines/fibs/kbginvite.h index 992ee445..7bc5f3f7 100644 --- a/kbackgammon/engines/fibs/kbginvite.h +++ b/kbackgammon/engines/fibs/kbginvite.h @@ -69,7 +69,7 @@ public slots: /** * Set the name of the player in the line editor */ - void setPlayer(const QString &name); + void setPlayer(const TQString &name); protected slots: @@ -98,7 +98,7 @@ signals: /** * Emits the text of an invitation */ - void inviteCommand(const QString &cmd); + void inviteCommand(const TQString &cmd); /** * Delete the dialog after it is closed. diff --git a/kbackgammon/engines/fibs/kplayerlist.cpp b/kbackgammon/engines/fibs/kplayerlist.cpp index 102c354d..06b724e5 100644 --- a/kbackgammon/engines/fibs/kplayerlist.cpp +++ b/kbackgammon/engines/fibs/kplayerlist.cpp @@ -24,15 +24,15 @@ #include "kplayerlist.moc" #include "kplayerlist.h" -#include <qlayout.h> -#include <qiconset.h> -#include <qgroupbox.h> -#include <qpopupmenu.h> -#include <qcheckbox.h> -#include <qlistview.h> -#include <qwhatsthis.h> -#include <qdatetime.h> -#include <qlabel.h> +#include <tqlayout.h> +#include <tqiconset.h> +#include <tqgroupbox.h> +#include <tqpopupmenu.h> +#include <tqcheckbox.h> +#include <tqlistview.h> +#include <tqwhatsthis.h> +#include <tqdatetime.h> +#include <tqlabel.h> #include <kapplication.h> #include <kconfig.h> @@ -63,13 +63,13 @@ public: int index, width; bool show; - QCheckBox *cb; - QString key, name; + TQCheckBox *cb; + TQString key, name; }; /* - * Extension of the QListViewItem class that has a custom key function + * Extension of the TQListViewItem class that has a custom key function * that can deal with the different items of the player list. */ class KFibsPlayerListLVI : public KListViewItem { @@ -89,11 +89,11 @@ public: /* * Overloaded key function for sorting */ - virtual QString key(int col, bool) const + virtual TQString key(int col, bool) const { int real_col = _plist->cIndex(col); - QString s = text(col); + TQString s = text(col); switch (real_col) { case KFibsPlayerList::Player: @@ -155,7 +155,7 @@ public: /* * Context menus for player related commands */ - QPopupMenu *mPm[2]; + TQPopupMenu *mPm[2]; /* * ID of the invite menu in the context menu @@ -175,22 +175,22 @@ public: /* * Short abbreviations for Blind, Ready, and Away. */ - QString mAbrv[KFibsPlayerList::MaxStatus]; + TQString mAbrv[KFibsPlayerList::MaxStatus]; /* * Name of the last selected player - for internal purposes */ - QString mUser; + TQString mUser; /* * Our own name */ - QString mName; + TQString mName; /* * Email address of the last selected player - for internal purposes */ - QString mMail; + TQString mMail; }; @@ -200,7 +200,7 @@ public: /* * Construct the playerlist and do some initial setup */ -KFibsPlayerList::KFibsPlayerList(QWidget *parent, const char *name) +KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) : KListView(parent, name) { d = new KFibsPlayerListPrivate(); @@ -246,7 +246,7 @@ KFibsPlayerList::KFibsPlayerList(QWidget *parent, const char *name) d->mAbrv[Away ] = i18n("abreviate away", "A"); d->mAbrv[Ready] = i18n("abreviate ready", "R"); - d->mName = QString::null; + d->mName = TQString::null; d->mWatch = false; @@ -256,7 +256,7 @@ KFibsPlayerList::KFibsPlayerList(QWidget *parent, const char *name) */ updateCaption(); setIcon(kapp->miniIcon()); - QWhatsThis::add(this, i18n("This window contains the player list. It shows " + TQWhatsThis::add(this, i18n("This window contains the player list. It shows " "all players that are currently logged into FIBS." "Use the right mouse button to get a context " "menu with helpful information and commands.")); @@ -280,51 +280,51 @@ KFibsPlayerList::KFibsPlayerList(QWidget *parent, const char *name) /* * Create context menus */ - d->mPm[0] = new QPopupMenu(); - d->mPm[1] = new QPopupMenu(); + d->mPm[0] = new TQPopupMenu(); + d->mPm[1] = new TQPopupMenu(); /* * Create the whole set of actions */ d->mAct[KFibsPlayerListPrivate::Info] = new KAction(i18n("Info"), - QIconSet(kapp->iconLoader()->loadIcon + TQIconSet(kapp->iconLoader()->loadIcon ("help.xpm", KIcon::Small)), - 0, this, SLOT(slotInfo()), actions); + 0, this, TQT_SLOT(slotInfo()), actions); d->mAct[KFibsPlayerListPrivate::Talk] = new KAction(i18n("Talk"), - QIconSet(kapp->iconLoader()->loadIcon + TQIconSet(kapp->iconLoader()->loadIcon (PROG_NAME "-chat.png", KIcon::Small)), - 0, this, SLOT(slotTalk()), actions); + 0, this, TQT_SLOT(slotTalk()), actions); - d->mAct[KFibsPlayerListPrivate::Look] = new KAction(i18n("Look"), 0, this, SLOT(slotLook()), actions); - d->mAct[KFibsPlayerListPrivate::Watch] = new KAction(i18n("Watch"), 0, this, SLOT(slotWatch()), actions); - d->mAct[KFibsPlayerListPrivate::Unwatch] = new KAction(i18n("Unwatch"), 0, this, SLOT(slotUnwatch()),actions); - d->mAct[KFibsPlayerListPrivate::BlindAct] = new KAction(i18n("Blind"), 0, this, SLOT(slotBlind()), actions); - d->mAct[KFibsPlayerListPrivate::Update] = new KAction(i18n("Update"), 0, this, SLOT(slotUpdate()), actions); + d->mAct[KFibsPlayerListPrivate::Look] = new KAction(i18n("Look"), 0, this, TQT_SLOT(slotLook()), actions); + d->mAct[KFibsPlayerListPrivate::Watch] = new KAction(i18n("Watch"), 0, this, TQT_SLOT(slotWatch()), actions); + d->mAct[KFibsPlayerListPrivate::Unwatch] = new KAction(i18n("Unwatch"), 0, this, TQT_SLOT(slotUnwatch()),actions); + d->mAct[KFibsPlayerListPrivate::BlindAct] = new KAction(i18n("Blind"), 0, this, TQT_SLOT(slotBlind()), actions); + d->mAct[KFibsPlayerListPrivate::Update] = new KAction(i18n("Update"), 0, this, TQT_SLOT(slotUpdate()), actions); - d->mAct[KFibsPlayerListPrivate::Reload] = KStdAction::redisplay(this, SLOT(slotReload()), actions); - d->mAct[KFibsPlayerListPrivate::Mail] = KStdAction::mail(this, SLOT(slotMail()), actions); - d->mAct[KFibsPlayerListPrivate::Close] = KStdAction::close(this, SLOT(hide()), actions); + d->mAct[KFibsPlayerListPrivate::Reload] = KStdAction::redisplay(this, TQT_SLOT(slotReload()), actions); + d->mAct[KFibsPlayerListPrivate::Mail] = KStdAction::mail(this, TQT_SLOT(slotMail()), actions); + d->mAct[KFibsPlayerListPrivate::Close] = KStdAction::close(this, TQT_SLOT(hide()), actions); d->mAct[KFibsPlayerListPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, this, - SLOT(slotInviteD()), actions); + TQT_SLOT(slotInviteD()), actions); d->mAct[KFibsPlayerListPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, this, - SLOT(slotInvite1()), actions); + TQT_SLOT(slotInvite1()), actions); d->mAct[KFibsPlayerListPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, this, - SLOT(slotInvite2()), actions); + TQT_SLOT(slotInvite2()), actions); d->mAct[KFibsPlayerListPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, this, - SLOT(slotInvite3()), actions); + TQT_SLOT(slotInvite3()), actions); d->mAct[KFibsPlayerListPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, this, - SLOT(slotInvite4()), actions); + TQT_SLOT(slotInvite4()), actions); d->mAct[KFibsPlayerListPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, this, - SLOT(slotInvite5()), actions); + TQT_SLOT(slotInvite5()), actions); d->mAct[KFibsPlayerListPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, this, - SLOT(slotInvite6()), actions); + TQT_SLOT(slotInvite6()), actions); d->mAct[KFibsPlayerListPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, this, - SLOT(slotInvite7()), actions); + TQT_SLOT(slotInvite7()), actions); d->mAct[KFibsPlayerListPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, this, - SLOT(slotInviteU()), actions); + TQT_SLOT(slotInviteU()), actions); d->mAct[KFibsPlayerListPrivate::InviteR] = new KAction(i18n("Resume"), 0, this, - SLOT(slotInviteR()), actions); + TQT_SLOT(slotInviteR()), actions); /* * Fill normal context menu @@ -363,10 +363,10 @@ KFibsPlayerList::KFibsPlayerList(QWidget *parent, const char *name) /* * Right mouse button gets context menu, double click gets player info */ - connect(this, SIGNAL(contextMenu(KListView *, QListViewItem *, const QPoint &)), - this, SLOT(showContextMenu(KListView *, QListViewItem *, const QPoint &))); - connect(this, SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int)), - this, SLOT(getPlayerInfo(QListViewItem *, const QPoint &, int))); + connect(this, TQT_SIGNAL(contextMenu(KListView *, TQListViewItem *, const TQPoint &)), + this, TQT_SLOT(showContextMenu(KListView *, TQListViewItem *, const TQPoint &))); + connect(this, TQT_SIGNAL(doubleClicked(TQListViewItem *, const TQPoint &, int)), + this, TQT_SLOT(getPlayerInfo(TQListViewItem *, const TQPoint &, int))); } /* @@ -444,13 +444,13 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space) /* * Main Widget */ - QWidget *w = new QWidget(nb); - QGridLayout *gl = new QGridLayout(w, 2, 1, space); + TQWidget *w = new TQWidget(nb); + TQGridLayout *gl = new TQGridLayout(w, 2, 1, space); /* * Label */ - QGroupBox *gbl = new QGroupBox(w); + TQGroupBox *gbl = new TQGroupBox(w); gbl->setTitle(i18n("Column Selection")); gl->addWidget(gbl, 0, 0); @@ -458,15 +458,15 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space) /* * Note that the first column (Player == 0) is always there */ - QLabel *lb = new QLabel(i18n("Select all the columns that you would\n" + TQLabel *lb = new TQLabel(i18n("Select all the columns that you would\n" "like to be shown in the player list."), gbl); for (i = 1; i < LVEnd; i++) { - d->mCol[i]->cb = new QCheckBox(d->mCol[i]->name, gbl); + d->mCol[i]->cb = new TQCheckBox(d->mCol[i]->name, gbl); d->mCol[i]->cb->setChecked(d->mCol[i]->show); } - gl = new QGridLayout(gbl, LVEnd, 2, 20); + gl = new TQGridLayout(gbl, LVEnd, 2, 20); gl->addWidget(lb, 0, 0); // two column layout.... @@ -483,7 +483,7 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space) */ nb->addTab(w, i18n("&Playerlist")); - connect(nb, SIGNAL(applyButtonPressed()), this, SLOT(setupOk())); + connect(nb, TQT_SIGNAL(applyButtonPressed()), this, TQT_SLOT(setupOk())); } /* @@ -525,7 +525,7 @@ void KFibsPlayerList::readConfig() KConfig* config = kapp->config(); config->setGroup(name()); - QPoint pos, defpos(10, 10); + TQPoint pos, defpos(10, 10); pos = config->readPointEntry("ori", &defpos); setGeometry(pos.x(), pos.y(), config->readNumEntry("wdt",460), config->readNumEntry("hgt",190)); @@ -562,12 +562,12 @@ void KFibsPlayerList::saveConfig() /* * Save selected player, update the menu entries and show the popup menu */ -void KFibsPlayerList::showContextMenu(KListView *, QListViewItem *i, const QPoint &p) +void KFibsPlayerList::showContextMenu(KListView *, TQListViewItem *i, const TQPoint &p) { /* * Get the name of the selected player */ - d->mUser = (i ? i->text(Player) : QString::null); + d->mUser = (i ? i->text(Player) : TQString::null); d->mAct[KFibsPlayerListPrivate::Info ]->setText(i18n("Info on %1" ).arg(d->mUser)); d->mAct[KFibsPlayerListPrivate::Talk ]->setText(i18n("Talk to %1" ).arg(d->mUser)); @@ -589,7 +589,7 @@ void KFibsPlayerList::showContextMenu(KListView *, QListViewItem *i, const QPoin d->mPm[0]->setItemEnabled(d->mInID, i && d->mName != d->mUser); d->mPm[0]->changeItem(d->mInID, i18n("Invite %1").arg(d->mUser)); - d->mMail = (i && d->mCol[Email]->show ? i->text(d->mCol[Email]->index) : QString::null); + d->mMail = (i && d->mCol[Email]->show ? i->text(d->mCol[Email]->index) : TQString::null); d->mAct[KFibsPlayerListPrivate::Mail]->setEnabled(!d->mMail.isEmpty()); if (i && d->mCol[Status]->show) @@ -657,7 +657,7 @@ void KFibsPlayerList::slotLook() */ void KFibsPlayerList::slotMail() { - kapp->invokeMailer(d->mMail, QString::null); + kapp->invokeMailer(d->mMail, TQString::null); } /* @@ -680,7 +680,7 @@ void KFibsPlayerList::slotWatch() /* * Request information about the selected user */ -void KFibsPlayerList::getPlayerInfo(QListViewItem *i, const QPoint &, int col) +void KFibsPlayerList::getPlayerInfo(TQListViewItem *i, const TQPoint &, int col) { int num = cIndex(col); if (col < 0 || num < 0 || num > 2 || i->text(num).isEmpty()) @@ -713,13 +713,13 @@ void KFibsPlayerList::slotInviteR() { emit fibsCommand("invite " + d->mUser); } * Add or change the entry of player with the corresponding string * from the server - rawwho */ -void KFibsPlayerList::changePlayer(const QString &line) +void KFibsPlayerList::changePlayer(const TQString &line) { char entry[LVEnd][100]; char ready[2], away[2]; - QListViewItem *i; - QDateTime fromEpoch; - QString str_entry[LVEnd], tmp; + TQListViewItem *i; + TQDateTime fromEpoch; + TQString str_entry[LVEnd], tmp; entry[Status][0] = '\0'; @@ -746,7 +746,7 @@ void KFibsPlayerList::changePlayer(const QString &line) setUpdatesEnabled(false); // try to find the item in the list - QListViewItemIterator it(this); + TQListViewItemIterator it(this); for ( ; it.current(); ++it) { if (it.current()->text(0) == str_entry[Player]) { i = it.current(); @@ -789,9 +789,9 @@ void KFibsPlayerList::changePlayer(const QString &line) /* * Remove player from the list */ -void KFibsPlayerList::deletePlayer(const QString &player) +void KFibsPlayerList::deletePlayer(const TQString &player) { - QListViewItemIterator it(this); + TQListViewItemIterator it(this); for ( ; it.current(); ++it) { if (it.current()->text(0) == player) { if (it.current()->text(Client).contains(PROG_NAME)) @@ -808,14 +808,14 @@ void KFibsPlayerList::deletePlayer(const QString &player) /* * Set/Unset the status stat in the corresponding column of the list */ -void KFibsPlayerList::changePlayerStatus(const QString &player, int stat, bool flag) +void KFibsPlayerList::changePlayerStatus(const TQString &player, int stat, bool flag) { - QListViewItem *i = 0; + TQListViewItem *i = 0; /* * Find the correct line */ - QListViewItemIterator it(this); + TQListViewItemIterator it(this); for ( ; it.current(); ++it) { if (it.current()->text(Player) == player) { i = it.current(); @@ -847,7 +847,7 @@ int KFibsPlayerList::cIndex(int col) /* * Catch hide events, so the engine's menu can be update. */ -void KFibsPlayerList::showEvent(QShowEvent *e) +void KFibsPlayerList::showEvent(TQShowEvent *e) { KListView::showEvent(e); emit windowVisible(true); @@ -856,7 +856,7 @@ void KFibsPlayerList::showEvent(QShowEvent *e) /* * Catch hide events, so the engine's menu can be update. */ -void KFibsPlayerList::hideEvent(QHideEvent *e) +void KFibsPlayerList::hideEvent(TQHideEvent *e) { emit windowVisible(false); KListView::hideEvent(e); @@ -875,7 +875,7 @@ void KFibsPlayerList::stopUpdate() * Knowing our own name allows us to disable certain menu entries for * ourselves. */ -void KFibsPlayerList::setName(const QString &name) +void KFibsPlayerList::setName(const TQString &name) { d->mName = name; } @@ -896,7 +896,7 @@ void KFibsPlayerList::clear() { d->mCount[0] = 0; d->mCount[1] = 0; - QListView::clear(); + TQListView::clear(); } // EOF diff --git a/kbackgammon/engines/fibs/kplayerlist.h b/kbackgammon/engines/fibs/kplayerlist.h index 701f9ace..27fd825f 100644 --- a/kbackgammon/engines/fibs/kplayerlist.h +++ b/kbackgammon/engines/fibs/kplayerlist.h @@ -63,7 +63,7 @@ public: /** * Constructor */ - KFibsPlayerList(QWidget *parent = 0, const char *name = 0); + KFibsPlayerList(TQWidget *parent = 0, const char *name = 0); /** * Destructor @@ -80,12 +80,12 @@ public slots: /** * Remove the player with the name given by the first word */ - void deletePlayer(const QString &player); + void deletePlayer(const TQString &player); /** * Change/Add the entry for the given player */ - void changePlayer(const QString &line); + void changePlayer(const TQString &line); /** * Enables list redraws after an update @@ -110,7 +110,7 @@ public slots: /** * Change the status of a player */ - void changePlayerStatus(const QString &player, int stat, bool flag); + void changePlayerStatus(const TQString &player, int stat, bool flag); /** * Fills the playerlist page into the notebook @@ -136,7 +136,7 @@ public slots: * Set our own name. This allows us to special case the context * menu. */ - void setName(const QString &name); + void setName(const TQString &name); /** * Return the column index @@ -148,24 +148,24 @@ protected: /** * Catch show events, so the engine's menu can be update. */ - virtual void showEvent(QShowEvent *e); + virtual void showEvent(TQShowEvent *e); /** * Catch hide events, so the engine's menu can be update. */ - virtual void hideEvent(QHideEvent *e); + virtual void hideEvent(TQHideEvent *e); protected slots: /** * Double click handler, requests information on a player */ - void getPlayerInfo(QListViewItem *i, const QPoint &p, int col); + void getPlayerInfo(TQListViewItem *i, const TQPoint &p, int col); /** * Display a popup menu for the current player */ - void showContextMenu(KListView *, QListViewItem *, const QPoint &); + void showContextMenu(KListView *, TQListViewItem *, const TQPoint &); /** * Reload the whole list @@ -272,17 +272,17 @@ signals: /** * Send a command to the server */ - void fibsCommand(const QString &); + void fibsCommand(const TQString &); /** * Initiate an invitation of a player */ - void fibsInvite(const QString &); + void fibsInvite(const TQString &); /** * Request talking to player user */ - void fibsTalk(const QString &); + void fibsTalk(const TQString &); /** * Allow the engine's menu to be updated diff --git a/kbackgammon/engines/generic/kbgengine.cpp b/kbackgammon/engines/generic/kbgengine.cpp index bbe528a6..59c19e2f 100644 --- a/kbackgammon/engines/generic/kbgengine.cpp +++ b/kbackgammon/engines/generic/kbgengine.cpp @@ -21,8 +21,8 @@ */ -#include <qtimer.h> -#include <qpopupmenu.h> +#include <tqtimer.h> +#include <tqpopupmenu.h> #include <kdialogbase.h> @@ -33,13 +33,13 @@ /* * Constructor initializes the QObject */ -KBgEngine::KBgEngine(QWidget *parent, QString *name, QPopupMenu *pmenu) - : QObject(parent, name->local8Bit()) +KBgEngine::KBgEngine(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) + : TQObject(parent, name->local8Bit()) { menu = pmenu; cl = -1; - ct = new QTimer(this); - connect(ct, SIGNAL(timeout()), this, SLOT(done())); + ct = new TQTimer(this); + connect(ct, TQT_SIGNAL(timeout()), this, TQT_SLOT(done())); } /* diff --git a/kbackgammon/engines/generic/kbgengine.h b/kbackgammon/engines/generic/kbgengine.h index ee672f40..2dd3a9a9 100644 --- a/kbackgammon/engines/generic/kbgengine.h +++ b/kbackgammon/engines/generic/kbgengine.h @@ -28,7 +28,7 @@ #include <config.h> #endif -#include <qobject.h> +#include <tqobject.h> class QTimer; class QPopupMenu; @@ -67,7 +67,7 @@ class KBgEngine:public QObject /** * Constructor */ - KBgEngine (QWidget * parent = 0, QString * name = 0, QPopupMenu * pmenu = 0); + KBgEngine (TQWidget * parent = 0, TQString * name = 0, TQPopupMenu * pmenu = 0); /** * Destructor @@ -179,7 +179,7 @@ public slots: * A move has been made on the board - see the board class * for the format of the string s */ - virtual void handleMove (QString * s) = 0; + virtual void handleMove (TQString * s) = 0; /** * Undo the last move @@ -214,7 +214,7 @@ public slots: /** * Process the string cmd */ - virtual void handleCommand (const QString & cmd) = 0; + virtual void handleCommand (const TQString & cmd) = 0; /** * Start a new game @@ -237,12 +237,12 @@ signals: * The text identifies the current game status - could be put * into the main window caption */ - void statText (const QString & msg); + void statText (const TQString & msg); /** * Text that should be displayed in the ongoing message window */ - void infoText (const QString & msg); + void infoText (const TQString & msg); /** * Emit the most recent game state @@ -285,12 +285,12 @@ protected: /** * Context menu for the board */ - QPopupMenu * menu; + TQPopupMenu * menu; /** * Commit timer */ - QTimer *ct; + TQTimer *ct; int cl; }; diff --git a/kbackgammon/engines/gnubg/kbggnubg.cpp b/kbackgammon/engines/gnubg/kbggnubg.cpp index eaaa4bdf..d17a6f88 100644 --- a/kbackgammon/engines/gnubg/kbggnubg.cpp +++ b/kbackgammon/engines/gnubg/kbggnubg.cpp @@ -29,17 +29,17 @@ #include <stdlib.h> #include <time.h> #include <unistd.h> -#include <qlayout.h> +#include <tqlayout.h> #include <kiconloader.h> #include <kstdaction.h> -#include <qbuttongroup.h> -#include <qcheckbox.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> #include <kconfig.h> #include <iostream> #include <klocale.h> #include <kmainwindow.h> #include <klineeditdlg.h> -#include <qregexp.h> +#include <tqregexp.h> #include <kregexp.h> #include <knotifyclient.h> @@ -75,17 +75,17 @@ void KBgEngineGNU::doubleCube(const int w) -void KBgEngineGNU::handleLine(const QString &l) +void KBgEngineGNU::handleLine(const TQString &l) { if (l.isEmpty()) return; - QString line(l); + TQString line(l); /* * Start of a new game/match */ - if (line.contains(QRegExp("^gnubg rolls [1-6], .* rolls [1-6]\\."))) { + if (line.contains(TQRegExp("^gnubg rolls [1-6], .* rolls [1-6]\\."))) { KRegExp e("^gnubg rolls ([1-6]), .* rolls ([1-6])\\."); e.match(line.latin1()); if (int r = strcmp(e.group(1), e.group(2))) @@ -95,14 +95,14 @@ void KBgEngineGNU::handleLine(const QString &l) /* * Bug fixes for older versions of GNUBG - to be removed */ - if (line.contains(QRegExp("^.* cannot move\\..+$"))) { + if (line.contains(TQRegExp("^.* cannot move\\..+$"))) { KRegExp e("(^.* cannot move.)(.*$)"); e.match(line.latin1()); handleLine(e.group(1)); handleLine(e.group(2)); return; } - if (line.contains(QRegExp("^Are you sure you want to start a new game, and discard the one in progress\\?"))) { + if (line.contains(TQRegExp("^Are you sure you want to start a new game, and discard the one in progress\\?"))) { KRegExp e("(^Are you sure you want to start a new game, and discard the one in progress\\? )(.+$)"); e.match(line.latin1()); handleLine(e.group(1)); @@ -113,7 +113,7 @@ void KBgEngineGNU::handleLine(const QString &l) /* * Cube handling */ - if (line.contains(QRegExp("^gnubg accepts and immediately redoubles to [0-9]+\\.$"))) { + if (line.contains(TQRegExp("^gnubg accepts and immediately redoubles to [0-9]+\\.$"))) { // redoubles mess up the game counter "turn" @@ -122,7 +122,7 @@ void KBgEngineGNU::handleLine(const QString &l) //emit newState(st); } - if (line.contains(QRegExp("^gnubg doubles\\.$"))) { + if (line.contains(TQRegExp("^gnubg doubles\\.$"))) { // TODO: we need some generic class for this. the class // can be shared between all engines @@ -155,14 +155,14 @@ void KBgEngineGNU::handleLine(const QString &l) /* * Ignore the following messages */ - if (line.contains(QRegExp("^TTY boards will be given in raw format"))) { + if (line.contains(TQRegExp("^TTY boards will be given in raw format"))) { line = " "; } /* * Board messages */ - if (line.contains(QRegExp("^board:"))) { + if (line.contains(TQRegExp("^board:"))) { KBgStatus st(line); @@ -248,7 +248,7 @@ void KBgEngineGNU::handleLine(const QString &l) /* * Show the line... */ - line.replace(QRegExp(" "), " "); + line.replace(TQRegExp(" "), " "); if (!line.isEmpty()) emit infoText(line); } @@ -257,7 +257,7 @@ void KBgEngineGNU::handleLine(const QString &l) /* * Handle textual commands. All commands are passed to gnubg. */ -void KBgEngineGNU::handleCommand(const QString& cmd) +void KBgEngineGNU::handleCommand(const TQString& cmd) { cmdList += cmd; nextCommand(); @@ -275,10 +275,10 @@ void KBgEngineGNU::newGame() /* * If there is a game running we warn the user first */ - if (gameRunning && (KMessageBox::warningYesNo((QWidget *)parent(), + if (gameRunning && (KMessageBox::warningYesNo((TQWidget *)parent(), i18n("A game is currently in progress. " "Starting a new one will terminate it."), - QString::null, i18n("Start New Game"), i18n("Continue Old Game")) + TQString::null, i18n("Start New Game"), i18n("Continue Old Game")) == KMessageBox::No)) return; @@ -379,7 +379,7 @@ void KBgEngineGNU::getSetupPages(KDialogBase *nb) /* * Main Widget */ - QVBox *w = nb->addVBoxPage(i18n("GNU Engine"), i18n("Here you can configure the GNU backgammon engine"), + TQVBox *w = nb->addVBoxPage(i18n("GNU Engine"), i18n("Here you can configure the GNU backgammon engine"), kapp->iconLoader()->loadIcon(PROG_NAME "_engine", KIcon::Desktop)); } @@ -422,7 +422,7 @@ void KBgEngineGNU::saveConfig() /* * Constructor */ -KBgEngineGNU::KBgEngineGNU(QWidget *parent, QString *name, QPopupMenu *pmenu) +KBgEngineGNU::KBgEngineGNU(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) : KBgEngine(parent, name, pmenu) { // obsolete @@ -434,12 +434,12 @@ KBgEngineGNU::KBgEngineGNU(QWidget *parent, QString *name, QPopupMenu *pmenu) * internal statue variables */ rollingAllowed = undoPossible = gameRunning = donePossible = false; - connect(this, SIGNAL(allowCommand(int, bool)), this, SLOT(setAllowed(int, bool))); + connect(this, TQT_SIGNAL(allowCommand(int, bool)), this, TQT_SLOT(setAllowed(int, bool))); /* * Setup of menu */ - resAction = new KAction(i18n("&Restart GNU Backgammon"), 0, this, SLOT(startGNU()), this); + resAction = new KAction(i18n("&Restart GNU Backgammon"), 0, this, TQT_SLOT(startGNU()), this); resAction->setEnabled(false); resAction->plug(menu); /* @@ -468,8 +468,8 @@ void KBgEngineGNU::start() /* * Will be started later */ - cmdTimer = new QTimer(this); - connect(cmdTimer, SIGNAL(timeout()), SLOT(nextCommand()) ); + cmdTimer = new TQTimer(this); + connect(cmdTimer, TQT_SIGNAL(timeout()), TQT_SLOT(nextCommand()) ); emit infoText(i18n("This is experimental code which currently requires a specially " "patched version of GNU Backgammon.<br/><br/>")); @@ -484,12 +484,12 @@ void KBgEngineGNU::start() */ gnubg << "gnubg" << "--tty"; - connect(&gnubg, SIGNAL(processExited(KProcess *)), this, SLOT(gnubgExit(KProcess *))); - connect(&gnubg, SIGNAL(receivedStderr(KProcess *, char *, int)), - this, SLOT(receiveData(KProcess *, char *, int))); - connect(&gnubg, SIGNAL(receivedStdout(KProcess *, char *, int)), - this, SLOT(receiveData(KProcess *, char *, int))); - connect(&gnubg, SIGNAL(wroteStdin(KProcess *)), this, SLOT(wroteStdin(KProcess *))); + connect(&gnubg, TQT_SIGNAL(processExited(KProcess *)), this, TQT_SLOT(gnubgExit(KProcess *))); + connect(&gnubg, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), + this, TQT_SLOT(receiveData(KProcess *, char *, int))); + connect(&gnubg, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)), + this, TQT_SLOT(receiveData(KProcess *, char *, int))); + connect(&gnubg, TQT_SIGNAL(wroteStdin(KProcess *)), this, TQT_SLOT(wroteStdin(KProcess *))); startGNU(); } @@ -503,7 +503,7 @@ void KBgEngineGNU::startGNU() resAction->setEnabled(false); if (!gnubg.start(KProcess::NotifyOnExit, KProcess::All)) - KMessageBox::information((QWidget *)parent(), + KMessageBox::information((TQWidget *)parent(), i18n("Could not start the GNU Backgammon process.\n" "Make sure the program is in your PATH and is " "called \"gnubg\".\n" @@ -532,7 +532,7 @@ void KBgEngineGNU::gnubgExit(KProcess *proc) emit allowMoving(false); - emit infoText(QString("<br/><font color=\"red\">") + i18n("The GNU Backgammon process (%1) has exited. ") + emit infoText(TQString("<br/><font color=\"red\">") + i18n("The GNU Backgammon process (%1) has exited. ") .arg(proc->pid()) + "</font><br/>"); resAction->setEnabled(true); @@ -560,16 +560,16 @@ void KBgEngineGNU::nextCommand() if (!gnubg.isRunning()) return; - for (QStringList::Iterator it = cmdList.begin(); it != cmdList.end(); ++it) { - QString s = (*it) + "\n"; + for (TQStringList::Iterator it = cmdList.begin(); it != cmdList.end(); ++it) { + TQString s = (*it) + "\n"; if (!gnubg.writeStdin(s.latin1(), strlen(s.latin1()))) { cmdTimer->start(250, true); - cmdList.remove(QString::null); + cmdList.remove(TQString::null); return; } - (*it) = QString::null; + (*it) = TQString::null; } - cmdList.remove(QString::null); + cmdList.remove(TQString::null); cmdTimer->stop(); } @@ -587,7 +587,7 @@ void KBgEngineGNU::receiveData(KProcess *proc, char *buffer, int buflen) memcpy(buf, buffer, buflen); buf[buflen] = '\0'; - QStringList l(QStringList::split('\n', buf, true)); + TQStringList l(TQStringList::split('\n', buf, true)); /* * Restore partial lines from the previous time @@ -604,7 +604,7 @@ void KBgEngineGNU::receiveData(KProcess *proc, char *buffer, int buflen) /* * Handle the information from gnubg */ - for (QStringList::Iterator it = l.begin(); it != l.end(); ++it) + for (TQStringList::Iterator it = l.begin(); it != l.end(); ++it) handleLine(*it); } @@ -626,8 +626,8 @@ void KBgEngineGNU::done() // Transform the string to FIBS format lastmove.replace(0, 2, "move "); - lastmove.replace(QRegExp("\\+"), " "); - lastmove.replace(QRegExp("\\-"), " "); + lastmove.replace(TQRegExp("\\+"), " "); + lastmove.replace(TQRegExp("\\-"), " "); // sent it to the server handleCommand(lastmove); @@ -664,12 +664,12 @@ void KBgEngineGNU::redo() * Take the move string and make the changes on the working copy * of the state. */ -void KBgEngineGNU::handleMove(QString *s) +void KBgEngineGNU::handleMove(TQString *s) { lastmove = *s; int index = 0; - QString t = s->mid(index, s->find(' ', index)); + TQString t = s->mid(index, s->find(' ', index)); index += 1 + t.length(); int moves = t.toInt(); diff --git a/kbackgammon/engines/gnubg/kbggnubg.h b/kbackgammon/engines/gnubg/kbggnubg.h index 3240b8b1..acb007f1 100644 --- a/kbackgammon/engines/gnubg/kbggnubg.h +++ b/kbackgammon/engines/gnubg/kbggnubg.h @@ -30,12 +30,12 @@ #include <generic/kbgengine.h> -#include <qtimer.h> -#include <qspinbox.h> +#include <tqtimer.h> +#include <tqspinbox.h> #include <kaction.h> #include <krandomsequence.h> #include <kprocess.h> -#include <qstringlist.h> +#include <tqstringlist.h> /** * @@ -50,7 +50,7 @@ public: /* * Constructor and destructor */ - KBgEngineGNU(QWidget *parent = 0, QString *name = 0, QPopupMenu *pmenu = 0); + KBgEngineGNU(TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); virtual ~KBgEngineGNU(); /** @@ -96,7 +96,7 @@ public slots: * A move has been made on the board - see the board class * for the format of the string s */ - virtual void handleMove(QString *s); + virtual void handleMove(TQString *s); /** * Undo the last move @@ -136,7 +136,7 @@ public slots: /** * Process the string cmd */ - virtual void handleCommand(const QString& cmd); + virtual void handleCommand(const TQString& cmd); /** * Start a new game. @@ -163,7 +163,7 @@ private: /** * Player's names */ - QString nameUS, nameTHEM; + TQString nameUS, nameTHEM; /** * Who did the last roll @@ -192,15 +192,15 @@ private: KProcess gnubg; - QStringList cmdList; + TQStringList cmdList; - QTimer *cmdTimer; + TQTimer *cmdTimer; - QString partline; + TQString partline; - QString board; + TQString board; - QString lastmove; + TQString lastmove; int turn; @@ -212,7 +212,7 @@ protected slots: void receiveData(KProcess *, char *buffer, int buflen); - void handleLine(const QString &l); + void handleLine(const TQString &l); void gnubgExit(KProcess *proc); diff --git a/kbackgammon/engines/nextgen/kbggame.cpp b/kbackgammon/engines/nextgen/kbggame.cpp index 6ee709e1..13ae076a 100644 --- a/kbackgammon/engines/nextgen/kbggame.cpp +++ b/kbackgammon/engines/nextgen/kbggame.cpp @@ -31,13 +31,13 @@ /* * Constructor */ -KBgGame::KBgGame(int cookie, QObject *parent) +KBgGame::KBgGame(int cookie, TQObject *parent) : KGame(cookie, parent) { // do nothing... } -bool KBgGame::playerInput(QDataStream &msg,KPlayer *player) +bool KBgGame::playerInput(TQDataStream &msg,KPlayer *player) { Q_INT32 move; msg >> move; diff --git a/kbackgammon/engines/nextgen/kbggame.h b/kbackgammon/engines/nextgen/kbggame.h index fea5f516..1c045433 100644 --- a/kbackgammon/engines/nextgen/kbggame.h +++ b/kbackgammon/engines/nextgen/kbggame.h @@ -45,11 +45,11 @@ public: enum MsgID {Text, Cmd, MaxMsg}; - KBgGame(int cookie = 42, QObject *parent = 0); + KBgGame(int cookie = 42, TQObject *parent = 0); protected: - virtual bool playerInput(QDataStream &msg,KPlayer *player); + virtual bool playerInput(TQDataStream &msg,KPlayer *player); }; diff --git a/kbackgammon/engines/nextgen/kbgng.cpp b/kbackgammon/engines/nextgen/kbgng.cpp index 6518147c..302cbb58 100644 --- a/kbackgammon/engines/nextgen/kbgng.cpp +++ b/kbackgammon/engines/nextgen/kbgng.cpp @@ -29,19 +29,19 @@ #include <stdlib.h> #include <time.h> #include <unistd.h> -#include <qlayout.h> +#include <tqlayout.h> #include <kiconloader.h> #include <kstdaction.h> -#include <qbuttongroup.h> -#include <qcheckbox.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> #include <kconfig.h> #include <klocale.h> #include <kmainwindow.h> #include <klineeditdlg.h> #include <krandomsequence.h> -#include <qstringlist.h> -#include <qcstring.h> -#include <qtextstream.h> +#include <tqstringlist.h> +#include <tqcstring.h> +#include <tqtextstream.h> #include <version.h> @@ -51,30 +51,30 @@ /* * Constructor */ -KBgEngineNg::KBgEngineNg(QWidget *parent, QString *name, QPopupMenu *pmenu) +KBgEngineNg::KBgEngineNg(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) : KBgEngine(parent, name, pmenu) { // get a new game initGame(); // create actions and menus - QString label[MaxTypes]; + TQString label[MaxTypes]; label[Local ] = i18n("Local Games"); label[NetServer] = i18n("Offer Network Games"); label[NetClient] = i18n("Join Network Games"); - QStringList list; + TQStringList list; for (int i = 0; i < MaxTypes; i++) list.append(label[i]); - _gameSelect = new KSelectAction(i18n("&Types"), 0, this, SLOT(setGame()), this); + _gameSelect = new KSelectAction(i18n("&Types"), 0, this, TQT_SLOT(setGame()), this); _gameSelect->setItems(list); _gameSelect->plug(menu); menu->insertSeparator(); - _connectAction = new KAction(i18n("&Names..."), 0, this, SLOT(changeName()), this); + _connectAction = new KAction(i18n("&Names..."), 0, this, TQT_SLOT(changeName()), this); _connectAction->plug(menu); // Restore last settings @@ -123,7 +123,7 @@ void KBgEngineNg::setGame() // initialize a new game bool ret = false; - QString label, port_s, host_s; + TQString label, port_s, host_s; Q_UINT16 port; switch (_currGame = _gameSelect->currentItem()) { @@ -140,7 +140,7 @@ void KBgEngineNg::setGame() "65535."); port_s.setNum(_port); do { - port_s = KLineEditDlg::getText(label, port_s, &ret, (QWidget *)parent()); + port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)parent()); if (!ret) return; port = port_s.toUShort(&ret); @@ -159,7 +159,7 @@ void KBgEngineNg::setGame() label = i18n("Type the name of the server you want to connect to:"); host_s = _host; do { - host_s = KLineEditDlg::getText(label, host_s, &ret, (QWidget *)parent()); + host_s = KLineEditDlg::getText(label, host_s, &ret, (TQWidget *)parent()); if (!ret) return; } while (host_s.isEmpty()); @@ -168,7 +168,7 @@ void KBgEngineNg::setGame() "number should be between 1024 and 65535.").arg(host_s); port_s.setNum(_port); do { - port_s = KLineEditDlg::getText(label, port_s, &ret, (QWidget *)parent()); + port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)parent()); if (!ret) return; port = port_s.toUShort(&ret); @@ -311,7 +311,7 @@ void KBgEngineNg::redo() * Take the move string and make the changes on the working copy * of the state. */ -void KBgEngineNg::handleMove(QString *s) +void KBgEngineNg::handleMove(TQString *s) { Q_UNUSED(s) // TODO @@ -477,10 +477,10 @@ void KBgEngineNg::saveConfig() * players. Although the message gets the Cmd ID, it is currently * handled as a regular text message. */ -void KBgEngineNg::handleCommand(const QString& text) +void KBgEngineNg::handleCommand(const TQString& text) { - QByteArray msg; - QTextStream ts(msg, IO_WriteOnly); + TQByteArray msg; + TQTextStream ts(msg, IO_WriteOnly); ts << text; if (!_game->sendMessage(msg, KBgGame::Cmd)) kdDebug(true, PROG_COOKIE) << "couldn't send message: " @@ -539,17 +539,17 @@ void KBgEngineNg::slotPropertyChanged(KGamePropertyBase *p, KGame *me) void KBgEngineNg::changeName() { bool ok = false; - QString name; + TQString name; for (int i = 0; i < 2; i++) { - name = QString::null; + name = TQString::null; while (!_player[i]->isVirtual() && name.isEmpty()) { if (i == 0) name = KLineEditDlg::getText(i18n("Type the name of the first player:"), - _name[i], &ok, (QWidget *)parent()); + _name[i], &ok, (TQWidget *)parent()); else name = KLineEditDlg::getText(i18n("Type the name of the second player:"), - _name[i], &ok, (QWidget *)parent()); + _name[i], &ok, (TQWidget *)parent()); if (!ok) return; _player[i]->setName(name); } @@ -559,7 +559,7 @@ void KBgEngineNg::changeName() /* * Receive data sent via KBgGame::sendMessage(...) */ -void KBgEngineNg::slotNetworkData(int msgid, const QByteArray &msg, Q_UINT32 r, Q_UINT32 s) +void KBgEngineNg::slotNetworkData(int msgid, const TQByteArray &msg, Q_UINT32 r, Q_UINT32 s) { Q_UNUSED(r); Q_UNUSED(s); @@ -580,7 +580,7 @@ void KBgEngineNg::slotNetworkData(int msgid, const QByteArray &msg, Q_UINT32 r, /* * Create the i-th player */ -KBgPlayer * KBgEngineNg::createPlayer(int i, QString name) +KBgPlayer * KBgEngineNg::createPlayer(int i, TQString name) { KBgPlayer *p = new KBgPlayer(); @@ -589,8 +589,8 @@ KBgPlayer * KBgEngineNg::createPlayer(int i, QString name) p->findProperty(KGamePropertyBase::IdName)->setEmittingSignal(true); - connect(p, SIGNAL(signalPropertyChanged(KGamePropertyBase *, KPlayer *)), - this, SLOT(slotPropertyChanged(KGamePropertyBase *, KPlayer *))); + connect(p, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase *, KPlayer *)), + this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase *, KPlayer *))); return (_player[i] = p); } @@ -603,20 +603,20 @@ void KBgEngineNg::initGame() _game = new KBgGame(PROG_COOKIE); _game->random()->setSeed(getpid()*time(NULL)); - connect(_game, SIGNAL(signalPlayerJoinedGame(KPlayer *)), - this, SLOT(slotPlayerJoinedGame(KPlayer *))); - connect(_game, SIGNAL(signalCreatePlayer(KPlayer *&, int, int, bool, KGame *)), - this, SLOT(slotCreatePlayer(KPlayer *&, int, int, bool, KGame *))); + connect(_game, TQT_SIGNAL(signalPlayerJoinedGame(KPlayer *)), + this, TQT_SLOT(slotPlayerJoinedGame(KPlayer *))); + connect(_game, TQT_SIGNAL(signalCreatePlayer(KPlayer *&, int, int, bool, KGame *)), + this, TQT_SLOT(slotCreatePlayer(KPlayer *&, int, int, bool, KGame *))); - connect(_game, SIGNAL(signalClientConnected(Q_UINT32)), - this, SLOT(slotClientConnected(Q_UINT32))); - connect(_game, SIGNAL(signalClientDisconnected(Q_UINT32, bool)), - this, SLOT(slotClientDisconnected(Q_UINT32, bool))); + connect(_game, TQT_SIGNAL(signalClientConnected(Q_UINT32)), + this, TQT_SLOT(slotClientConnected(Q_UINT32))); + connect(_game, TQT_SIGNAL(signalClientDisconnected(Q_UINT32, bool)), + this, TQT_SLOT(slotClientDisconnected(Q_UINT32, bool))); - connect(_game, SIGNAL(signalPropertyChanged(KGamePropertyBase *, KGame *)), - this, SLOT(slotPropertyChanged(KGamePropertyBase *, KGame *))); - connect(_game, SIGNAL(signalNetworkData(int,const QByteArray &, Q_UINT32, Q_UINT32)), - this, SLOT(slotNetworkData(int,const QByteArray &, Q_UINT32, Q_UINT32))); + connect(_game, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase *, KGame *)), + this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase *, KGame *))); + connect(_game, TQT_SIGNAL(signalNetworkData(int,const TQByteArray &, Q_UINT32, Q_UINT32)), + this, TQT_SLOT(slotNetworkData(int,const TQByteArray &, Q_UINT32, Q_UINT32))); } // EOF diff --git a/kbackgammon/engines/nextgen/kbgng.h b/kbackgammon/engines/nextgen/kbgng.h index 149f3bf6..99ea82c1 100644 --- a/kbackgammon/engines/nextgen/kbgng.h +++ b/kbackgammon/engines/nextgen/kbgng.h @@ -29,10 +29,10 @@ #endif -#include <qtimer.h> -#include <qspinbox.h> +#include <tqtimer.h> +#include <tqspinbox.h> #include <kaction.h> -#include <qdatastream.h> +#include <tqdatastream.h> #include <kgameproperty.h> #include <generic/kbgengine.h> @@ -57,7 +57,7 @@ public: /* * Constructor and destructor */ - KBgEngineNg( QWidget *parent = 0, QString *name = 0, QPopupMenu *pmenu = 0); + KBgEngineNg( TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); virtual ~KBgEngineNg(); /** @@ -107,7 +107,7 @@ public slots: * A move has been made on the board - see the board class * for the format of the string s */ - virtual void handleMove(QString *s); + virtual void handleMove(TQString *s); /** * Undo the last move @@ -142,7 +142,7 @@ public slots: /** * Process the string text */ - virtual void handleCommand(const QString& text); + virtual void handleCommand(const TQString& text); /** * Start a new game. @@ -152,7 +152,7 @@ public slots: void slotPlayerJoinedGame(KPlayer *p); - void slotNetworkData(int msgid, const QByteArray &msg, Q_UINT32 receiver, Q_UINT32 sender); + void slotNetworkData(int msgid, const TQByteArray &msg, Q_UINT32 receiver, Q_UINT32 sender); void slotCreatePlayer(KPlayer *&, int, int, bool, KGame *); void slotClientDisconnected(Q_UINT32, bool); @@ -219,7 +219,7 @@ private: int _nplayers; - QString _host; + TQString _host; Q_UINT16 _port; // ************************************************************ @@ -248,13 +248,13 @@ private: * the player is @ref _player. That means that the players are * automatically deleted. */ - KBgPlayer * createPlayer(int i, QString name = QString::null); + KBgPlayer * createPlayer(int i, TQString name = TQString::null); private: KBgGame* _game; - QString _name[2]; + TQString _name[2]; KBgPlayer* _player[2]; diff --git a/kbackgammon/engines/nextgen/kbgplayer.cpp b/kbackgammon/engines/nextgen/kbgplayer.cpp index f0b3a7ed..d1d8b998 100644 --- a/kbackgammon/engines/nextgen/kbgplayer.cpp +++ b/kbackgammon/engines/nextgen/kbgplayer.cpp @@ -48,13 +48,13 @@ int KBgPlayer::rtti() const return 10500; } -bool KBgPlayer::load(QDataStream &stream) +bool KBgPlayer::load(TQDataStream &stream) { KPlayer::load(stream); cerr << "-------- KBgPlayer::load" << endl; return false; } -bool KBgPlayer::save(QDataStream &stream) +bool KBgPlayer::save(TQDataStream &stream) { KPlayer::save(stream); cerr << "-------- KBgPlayer::save" << endl; diff --git a/kbackgammon/engines/nextgen/kbgplayer.h b/kbackgammon/engines/nextgen/kbgplayer.h index 7c11d83c..8d6536de 100644 --- a/kbackgammon/engines/nextgen/kbgplayer.h +++ b/kbackgammon/engines/nextgen/kbgplayer.h @@ -29,7 +29,7 @@ #endif #include <kplayer.h> -#include <qdatastream.h> +#include <tqdatastream.h> class KGame; @@ -49,8 +49,8 @@ public: virtual int rtti() const; - virtual bool load(QDataStream &stream); - virtual bool save(QDataStream &stream); + virtual bool load(TQDataStream &stream); + virtual bool save(TQDataStream &stream); }; diff --git a/kbackgammon/engines/offline/kbgoffline.cpp b/kbackgammon/engines/offline/kbgoffline.cpp index 920dc741..4a9e1755 100644 --- a/kbackgammon/engines/offline/kbgoffline.cpp +++ b/kbackgammon/engines/offline/kbgoffline.cpp @@ -24,14 +24,14 @@ #include "kbgoffline.moc" #include "kbgoffline.h" -#include <qlayout.h> -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qtimer.h> -#include <qspinbox.h> -#include <qwhatsthis.h> -#include <qlineedit.h> -#include <qvbox.h> +#include <tqlayout.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqtimer.h> +#include <tqspinbox.h> +#include <tqwhatsthis.h> +#include <tqlineedit.h> +#include <tqvbox.h> #include <kapplication.h> #include <kmessagebox.h> @@ -76,7 +76,7 @@ public: /* * Player's names */ - QString mName[2]; + TQString mName[2]; /* * Who did the last roll @@ -96,7 +96,7 @@ public: /* * Entry fields for the names */ - QLineEdit *mLe[2]; + TQLineEdit *mLe[2]; }; @@ -106,7 +106,7 @@ public: /* * Constructor */ -KBgEngineOffline::KBgEngineOffline(QWidget *parent, QString *name, QPopupMenu *pmenu) +KBgEngineOffline::KBgEngineOffline(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) : KBgEngine(parent, name, pmenu) { d = new KBgEngineOfflinePrivate(); @@ -120,11 +120,11 @@ KBgEngineOffline::KBgEngineOffline(QWidget *parent, QString *name, QPopupMenu *p /* * Create engine specific actions */ - d->mNew = new KAction(i18n("&New Game..."), 0, this, SLOT(newGame()), this); - d->mSwap = new KAction(i18n("&Swap Colors"), 0, this, SLOT(swapColors()), this); + d->mNew = new KAction(i18n("&New Game..."), 0, this, TQT_SLOT(newGame()), this); + d->mSwap = new KAction(i18n("&Swap Colors"), 0, this, TQT_SLOT(swapColors()), this); d->mEdit = new KToggleAction(i18n("&Edit Mode"), 0, this, - SLOT(toggleEditMode()), this); + TQT_SLOT(toggleEditMode()), this); d->mEdit->setChecked(false); /* @@ -143,14 +143,14 @@ KBgEngineOffline::KBgEngineOffline(QWidget *parent, QString *name, QPopupMenu *p /* * initialize the commit timeout */ - ct = new QTimer(this); - connect(ct, SIGNAL(timeout()), this, SLOT(done())); + ct = new TQTimer(this); + connect(ct, TQT_SIGNAL(timeout()), this, TQT_SLOT(done())); /* * internal statue variables */ d->mRollFlag = d->mUndoFlag = d->mGameFlag = d->mDoneFlag = false; - connect(this, SIGNAL(allowCommand(int, bool)), this, SLOT(setAllowed(int, bool))); + connect(this, TQT_SIGNAL(allowCommand(int, bool)), this, TQT_SLOT(setAllowed(int, bool))); /* * Restore last stored settings @@ -179,7 +179,7 @@ void KBgEngineOffline::getSetupPages(KDialogBase *nb) /* * Main Widget */ - QVBox *vbp = nb->addVBoxPage(i18n("Offline Engine"), i18n("Use this to configure the Offline engine"), + TQVBox *vbp = nb->addVBoxPage(i18n("Offline Engine"), i18n("Use this to configure the Offline engine"), kapp->iconLoader()->loadIcon(PROG_NAME "_engine", KIcon::Desktop)); /* @@ -190,32 +190,32 @@ void KBgEngineOffline::getSetupPages(KDialogBase *nb) /* * Player names */ - QWidget *w = new QWidget(tc); - QGridLayout *gl = new QGridLayout(w, 2, 1, nb->spacingHint()); + TQWidget *w = new TQWidget(tc); + TQGridLayout *gl = new TQGridLayout(w, 2, 1, nb->spacingHint()); /* * Group boxes */ - QGroupBox *gbn = new QGroupBox(i18n("Names"), w); + TQGroupBox *gbn = new TQGroupBox(i18n("Names"), w); gl->addWidget(gbn, 0, 0); - gl = new QGridLayout(gbn, 2, 2, 20); + gl = new TQGridLayout(gbn, 2, 2, 20); - d->mLe[0] = new QLineEdit(d->mName[0], gbn); - d->mLe[1] = new QLineEdit(d->mName[1], gbn); + d->mLe[0] = new TQLineEdit(d->mName[0], gbn); + d->mLe[1] = new TQLineEdit(d->mName[1], gbn); - QLabel *lb[2]; - lb[0] = new QLabel(i18n("First player:"), gbn); - lb[1] = new QLabel(i18n("Second player:"), gbn); + TQLabel *lb[2]; + lb[0] = new TQLabel(i18n("First player:"), gbn); + lb[1] = new TQLabel(i18n("Second player:"), gbn); for (int i = 0; i < 2; i++) { gl->addWidget(lb[i], i, 0); gl->addWidget(d->mLe[i], i, 1); } - QWhatsThis::add(d->mLe[0], i18n("Enter the name of the first player.")); - QWhatsThis::add(d->mLe[1], i18n("Enter the name of the second player.")); + TQWhatsThis::add(d->mLe[0], i18n("Enter the name of the first player.")); + TQWhatsThis::add(d->mLe[1], i18n("Enter the name of the second player.")); /* * Done with the page, put it in @@ -282,10 +282,10 @@ void KBgEngineOffline::newGame() /* * If there is a game running we warn the user first */ - if (d->mGameFlag && (KMessageBox::warningYesNo((QWidget *)parent(), + if (d->mGameFlag && (KMessageBox::warningYesNo((TQWidget *)parent(), i18n("A game is currently in progress. " "Starting a new one will terminate it."), - QString::null, i18n("Start New Game"), + TQString::null, i18n("Start New Game"), i18n("Continue Old Game")) == KMessageBox::No)) return; @@ -383,8 +383,8 @@ void KBgEngineOffline::initGame() bool KBgEngineOffline::queryPlayerName(int w) { bool ret = false; - QString *name; - QString text; + TQString *name; + TQString text; if (w == US) { name = &d->mName[0]; @@ -397,7 +397,7 @@ bool KBgEngineOffline::queryPlayerName(int w) } do { - *name = KLineEditDlg::getText(text, *name, &ret, (QWidget *)parent()); + *name = KLineEditDlg::getText(text, *name, &ret, (TQWidget *)parent()); if (!ret) break; } while (name->isEmpty()); @@ -481,10 +481,10 @@ void KBgEngineOffline::redo() * Take the move string and make the changes on the working copy * of the state. */ -void KBgEngineOffline::handleMove(QString *s) +void KBgEngineOffline::handleMove(TQString *s) { int index = 0; - QString t = s->mid(index, s->find(' ', index)); + TQString t = s->mid(index, s->find(' ', index)); index += 1 + t.length(); int moves = t.toInt(); @@ -517,7 +517,7 @@ void KBgEngineOffline::handleMove(QString *s) c = '+'; kick = true; } - QString r = t.left(t.find(c)); + TQString r = t.left(t.find(c)); if (r.contains("bar")) { d->mGame[0].setBar(d->mRoll, abs(d->mGame[0].bar(d->mRoll)) - 1); } else { @@ -626,7 +626,7 @@ void KBgEngineOffline::rollDiceBackend(const int w, const int a, const int b) break; // case 1: default: - emit infoText(QString((w == US) ? d->mName[0] : d->mName[1]) + + emit infoText(TQString((w == US) ? d->mName[0] : d->mName[1]) + i18n(", please move 1 piece.",", please move %n pieces.",d->mMove)); emit allowMoving(true); break; @@ -645,7 +645,7 @@ void KBgEngineOffline::cube() if (d->mRollFlag && d->mGame[0].cube(w) > 0) { emit allowCommand(Cube, false); - if (KMessageBox::questionYesNo((QWidget *)parent(), + if (KMessageBox::questionYesNo((TQWidget *)parent(), i18n("%1 has doubled. %2, do you accept the double?"). arg((w == THEM) ? d->mName[1] : d->mName[0]). arg((w == US) ? d->mName[1] : d->mName[0]), @@ -695,9 +695,9 @@ bool KBgEngineOffline::queryClose() if (!d->mGameFlag) return true; - switch (KMessageBox::warningContinueCancel((QWidget *)parent(), + switch (KMessageBox::warningContinueCancel((TQWidget *)parent(), i18n("In the middle of a game. " - "Really quit?"), QString::null, KStdGuiItem::quit())) { + "Really quit?"), TQString::null, KStdGuiItem::quit())) { case KMessageBox::Continue : return TRUE; case KMessageBox::Cancel : @@ -719,7 +719,7 @@ bool KBgEngineOffline::queryExit() /* * Handle textual commands. Right now, all commands are ignored */ -void KBgEngineOffline::handleCommand(const QString& cmd) +void KBgEngineOffline::handleCommand(const TQString& cmd) { emit infoText(i18n("Text commands are not yet working. " "The command '%1' has been ignored.").arg(cmd)); diff --git a/kbackgammon/engines/offline/kbgoffline.h b/kbackgammon/engines/offline/kbgoffline.h index db2bdc03..8a6448fb 100644 --- a/kbackgammon/engines/offline/kbgoffline.h +++ b/kbackgammon/engines/offline/kbgoffline.h @@ -55,7 +55,7 @@ public: /** * Constructor */ - KBgEngineOffline(QWidget *parent = 0, QString *name = 0, QPopupMenu *pmenu = 0); + KBgEngineOffline(TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); /** * Destructor @@ -119,7 +119,7 @@ public slots: * A move has been made on the board - see the board class * for the format of the string s */ - virtual void handleMove(QString *s); + virtual void handleMove(TQString *s); /** * Undo the last move @@ -154,7 +154,7 @@ public slots: /** * Process the string cmd */ - virtual void handleCommand(const QString& cmd); + virtual void handleCommand(const TQString& cmd); /** * Start a new game. diff --git a/kbackgammon/kbg.cpp b/kbackgammon/kbg.cpp index 55aef32a..711471ad 100644 --- a/kbackgammon/kbg.cpp +++ b/kbackgammon/kbg.cpp @@ -24,16 +24,16 @@ #include "kbg.h" #include "kbg.moc" -#include <qpainter.h> -#include <qlayout.h> -#include <qgroupbox.h> -#include <qpixmap.h> -#include <qstring.h> -#include <qwhatsthis.h> -#include <qstringlist.h> -#include <qvaluelist.h> -#include <qiconset.h> -#include <qvbox.h> +#include <tqpainter.h> +#include <tqlayout.h> +#include <tqgroupbox.h> +#include <tqpixmap.h> +#include <tqstring.h> +#include <tqwhatsthis.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> +#include <tqiconset.h> +#include <tqvbox.h> #include <kmenubar.h> #include <ktoolbar.h> @@ -89,7 +89,7 @@ KBg::KBg() /* * The main view is shared between the board and a small text window */ - panner = new QSplitter(Vertical, this, "panner"); + panner = new TQSplitter(Vertical, this, "panner"); board = new KBgBoardSetup(panner, "board"); status = new KBgTextView(panner, "status"); setCentralWidget(panner); @@ -97,59 +97,59 @@ KBg::KBg() /* * Create all actions needed by the application */ - newAction = KStdGameAction::gameNew(this, SLOT(openNew()), actionCollection()); + newAction = KStdGameAction::gameNew(this, TQT_SLOT(openNew()), actionCollection()); newAction->setEnabled(false); - KStdGameAction::print(this, SLOT(print()), actionCollection()); - KStdGameAction::quit(this, SLOT(close()), actionCollection()); + KStdGameAction::print(this, TQT_SLOT(print()), actionCollection()); + KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); - QStringList list; + TQStringList list; for (int i = 0; i < MaxEngine; i++) list.append(engineString[i]); - engineSet = new KSelectAction(i18n("&Engine"), 0, this, SLOT(setupEngine()), actionCollection(), + engineSet = new KSelectAction(i18n("&Engine"), 0, this, TQT_SLOT(setupEngine()), actionCollection(), "move_engine"); engineSet->setItems(list); // AB: what the heck has this to do with redisplay? perhaps use reload instead? - loadAction = KStdAction::redisplay(this, SLOT(load()), actionCollection(), "move_load"); + loadAction = KStdAction::redisplay(this, TQT_SLOT(load()), actionCollection(), "move_load"); loadAction->setEnabled(false); - undoAction = KStdGameAction::undo(this, SLOT(undo()), actionCollection()); + undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); undoAction->setEnabled(false); - redoAction = KStdGameAction::redo(this, SLOT(redo()), actionCollection()); + redoAction = KStdGameAction::redo(this, TQT_SLOT(redo()), actionCollection()); redoAction->setEnabled(false); - rollAction = KStdGameAction::roll(this, SLOT(roll()), actionCollection()); + rollAction = KStdGameAction::roll(this, TQT_SLOT(roll()), actionCollection()); rollAction->setEnabled(false); - endAction = KStdGameAction::endTurn(this, SLOT(done()), actionCollection()); + endAction = KStdGameAction::endTurn(this, TQT_SLOT(done()), actionCollection()); endAction->setEnabled(false); - cubeAction = new KAction(i18n("Double Cube"), QIconSet(kapp->iconLoader()->loadIcon + cubeAction = new KAction(i18n("Double Cube"), TQIconSet(kapp->iconLoader()->loadIcon (PROG_NAME "-double.xpm", KIcon::Toolbar)), - 0, this, SLOT(cube()), actionCollection(), "move_cube"); + 0, this, TQT_SLOT(cube()), actionCollection(), "move_cube"); cubeAction->setEnabled(false); - KStdAction::showMenubar(this, SLOT(toggleMenubar()), actionCollection()); - KStdAction::preferences(this, SLOT(setupDlg()), actionCollection()); - KStdAction::saveOptions(this, SLOT(saveConfig()), actionCollection()); + KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(setupDlg()), actionCollection()); + KStdAction::saveOptions(this, TQT_SLOT(saveConfig()), actionCollection()); KPopupMenu *p = (new KActionMenu(i18n("&Backgammon on the Web"), actionCollection(), "help_www"))->popupMenu(); - (new KAction(helpTopic[FIBSHome][0], 0, this, SLOT(wwwFIBS()), + (new KAction(helpTopic[FIBSHome][0], 0, this, TQT_SLOT(wwwFIBS()), actionCollection(), "help_www_fibs"))->plug(p); - (new KAction(helpTopic[RuleHome][0], 0, this, SLOT(wwwRule()), + (new KAction(helpTopic[RuleHome][0], 0, this, TQT_SLOT(wwwRule()), actionCollection(), "help_www_rule"))->plug(p); /* * Set up the command line - using actions, otherwise recreating the GUI will delete them * (e.g. using KEditToolbar) */ - cmdLabel = new QLabel(i18n("Command: "), this); + cmdLabel = new TQLabel(i18n("Command: "), this); new KWidgetAction( cmdLabel, cmdLabel->text(), 0, 0, 0, actionCollection(), "command_label"); cmdLine = new KLineEdit(this, "commandline"); - KWidgetAction* actionCmdLine = new KWidgetAction( cmdLine, QString::null, 0, 0, 0, actionCollection(), "command_lineedit"); + KWidgetAction* actionCmdLine = new KWidgetAction( cmdLine, TQString::null, 0, 0, 0, actionCollection(), "command_lineedit"); actionCmdLine->setAutoSized(true); cmdLine->completionObject()->setOrder(KCompletion::Weighted); - connect(cmdLine, SIGNAL(returnPressed(const QString &)), this, SLOT(handleCmd(const QString &))); + connect(cmdLine, TQT_SIGNAL(returnPressed(const TQString &)), this, TQT_SLOT(handleCmd(const TQString &))); /* * Done with the actions, create the XML-defined parts of the * user interface @@ -173,33 +173,33 @@ KBg::KBg() * Set up configuration handling. * FIXME: support session management */ - connect(this, SIGNAL(readSettings()), board, SLOT(readConfig())); - connect(this, SIGNAL(saveSettings()), board, SLOT(saveConfig())); + connect(this, TQT_SIGNAL(readSettings()), board, TQT_SLOT(readConfig())); + connect(this, TQT_SIGNAL(saveSettings()), board, TQT_SLOT(saveConfig())); /* * Set up some whatis messages for the online help */ - QWhatsThis::add(status, i18n("This area contains the status messages for the game. " + TQWhatsThis::add(status, i18n("This area contains the status messages for the game. " "Most of these messages are sent to you from the current " "engine.")); - QWhatsThis::add(toolBar("cmdToolBar"), + TQWhatsThis::add(toolBar("cmdToolBar"), i18n("This is the command line. You can type special " "commands related to the current engine in here. " "Most relevant commands are also available " "through the menus.")); - QWhatsThis::add(toolBar("mainToolBar"), + TQWhatsThis::add(toolBar("mainToolBar"), i18n("This is the button bar tool bar. It gives " "you easy access to game related commands. " "You can drag the bar to a different location " "within the window.")); - QWhatsThis::add(statusBar(), + TQWhatsThis::add(statusBar(), i18n("This is the status bar. It shows you the currently " "selected engine in the left corner.")); /* * Create and initialize the context menu */ - QPopupMenu* menu = (QPopupMenu*)factory()->container("popup", this); + TQPopupMenu* menu = (TQPopupMenu*)factory()->container("popup", this); board->setContextMenu(menu); } @@ -239,8 +239,8 @@ void KBg::setupEngine() /* * Remove the old engine, create a new one, and hook up menu and slots/signals */ - QPopupMenu *commandMenu = (QPopupMenu *)factory()->container("command_menu", this); - QString s = PROG_NAME; + TQPopupMenu *commandMenu = (TQPopupMenu *)factory()->container("command_menu", this); + TQString s = PROG_NAME; commandMenu->clear(); if (currEngine != None) { @@ -275,26 +275,26 @@ void KBg::setupEngine() newAction->setEnabled(engine[currEngine]->haveNewGame()); // engine -> this - connect(engine[currEngine], SIGNAL(statText(const QString &)), this, SLOT(updateCaption(const QString &))); - connect(engine[currEngine], SIGNAL(infoText(const QString &)), status, SLOT(write(const QString &))); - connect(engine[currEngine], SIGNAL(allowCommand(int, bool)), this, SLOT(allowCommand(int, bool))); + connect(engine[currEngine], TQT_SIGNAL(statText(const TQString &)), this, TQT_SLOT(updateCaption(const TQString &))); + connect(engine[currEngine], TQT_SIGNAL(infoText(const TQString &)), status, TQT_SLOT(write(const TQString &))); + connect(engine[currEngine], TQT_SIGNAL(allowCommand(int, bool)), this, TQT_SLOT(allowCommand(int, bool))); // this -> engine - connect(this, SIGNAL(readSettings()), engine[currEngine], SLOT(readConfig())); - connect(this, SIGNAL(saveSettings()), engine[currEngine], SLOT(saveConfig())); + connect(this, TQT_SIGNAL(readSettings()), engine[currEngine], TQT_SLOT(readConfig())); + connect(this, TQT_SIGNAL(saveSettings()), engine[currEngine], TQT_SLOT(saveConfig())); // board -> engine - connect(board, SIGNAL(rollDice(const int)), engine[currEngine], SLOT(rollDice(const int))); - connect(board, SIGNAL(doubleCube(const int)), engine[currEngine], SLOT(doubleCube(const int))); - connect(board, SIGNAL(currentMove(QString *)), engine[currEngine], SLOT(handleMove(QString *))); + connect(board, TQT_SIGNAL(rollDice(const int)), engine[currEngine], TQT_SLOT(rollDice(const int))); + connect(board, TQT_SIGNAL(doubleCube(const int)), engine[currEngine], TQT_SLOT(doubleCube(const int))); + connect(board, TQT_SIGNAL(currentMove(TQString *)), engine[currEngine], TQT_SLOT(handleMove(TQString *))); // engine -> board - connect(engine[currEngine], SIGNAL(undoMove()), board, SLOT(undoMove())); - connect(engine[currEngine], SIGNAL(redoMove()), board, SLOT(redoMove())); - connect(engine[currEngine], SIGNAL(setEditMode(const bool)), board, SLOT(setEditMode(const bool))); - connect(engine[currEngine], SIGNAL(allowMoving(const bool)), board, SLOT(allowMoving(const bool))); - connect(engine[currEngine], SIGNAL(getState(KBgStatus *)), board, SLOT(getState(KBgStatus *))); - connect(engine[currEngine], SIGNAL(newState(const KBgStatus &)), board, SLOT(setState(const KBgStatus &))); + connect(engine[currEngine], TQT_SIGNAL(undoMove()), board, TQT_SLOT(undoMove())); + connect(engine[currEngine], TQT_SIGNAL(redoMove()), board, TQT_SLOT(redoMove())); + connect(engine[currEngine], TQT_SIGNAL(setEditMode(const bool)), board, TQT_SLOT(setEditMode(const bool))); + connect(engine[currEngine], TQT_SIGNAL(allowMoving(const bool)), board, TQT_SLOT(allowMoving(const bool))); + connect(engine[currEngine], TQT_SIGNAL(getState(KBgStatus *)), board, TQT_SLOT(getState(KBgStatus *))); + connect(engine[currEngine], TQT_SIGNAL(newState(const KBgStatus &)), board, TQT_SLOT(setState(const KBgStatus &))); // now that all signals are connected, start the engine engine[currEngine]->start(); @@ -363,14 +363,14 @@ void KBg::readConfig() config->setGroup("main window"); - QPoint pos, defpos(10, 10); - QFont kappFont = kapp->font(); + TQPoint pos, defpos(10, 10); + TQFont kappFont = kapp->font(); pos = config->readPointEntry("origin", &defpos); status->setFont(config->readFontEntry("font", &kappFont)); - QValueList<int> l; + TQValueList<int> l; l.append(qRound( config->readDoubleNumEntry("panner", 0.75) *panner->height())); l.append(qRound((1-config->readDoubleNumEntry("panner", 0.75))*panner->height())); panner->setSizes(l); @@ -481,7 +481,7 @@ void KBg::setupDone() // FIXME make more general... -void KBg::startKCM(const QString &url) +void KBg::startKCM(const TQString &url) { KRun::runCommand(url); } @@ -506,29 +506,29 @@ void KBg::setupDlg() /* * Main Widget */ - QVBox *w = nb->addVBoxPage(i18n("General"), i18n("Here you can configure general settings of %1"). + TQVBox *w = nb->addVBoxPage(i18n("General"), i18n("Here you can configure general settings of %1"). arg(kapp->aboutData()->programName()), kapp->iconLoader()->loadIcon("go", KIcon::Desktop)); /* * Group boxes */ - QGroupBox *gbm = new QGroupBox(i18n("Messages"), w); - QGroupBox *gbt = new QGroupBox(i18n("Timer"), w); - QGroupBox *gbs = new QGroupBox(i18n("Autosave"), w); - QGroupBox *gbe = new QGroupBox(i18n("Events"), w); + TQGroupBox *gbm = new TQGroupBox(i18n("Messages"), w); + TQGroupBox *gbt = new TQGroupBox(i18n("Timer"), w); + TQGroupBox *gbs = new TQGroupBox(i18n("Autosave"), w); + TQGroupBox *gbe = new TQGroupBox(i18n("Events"), w); /* * Timer box */ - QWhatsThis::add(gbt, i18n("After you finished your moves, they have to be sent to the engine. " + TQWhatsThis::add(gbt, i18n("After you finished your moves, they have to be sent to the engine. " "You can either do that manually (in which case you should not enable " "this feature), or you can specify an amount of time that has to pass " "before the move is committed. If you undo a move during the timeout, the " "timeout will be reset and restarted once you finish the move. This is " "very useful if you would like to review the result of your move.")); - cbt = new QCheckBox(i18n("Enable timeout"), gbt); + cbt = new TQCheckBox(i18n("Enable timeout"), gbt); cbt->setChecked(config->readBoolEntry("enable timeout", true)); sbt = new KDoubleNumInput(gbt); @@ -536,49 +536,49 @@ void KBg::setupDlg() sbt->setLabel(i18n("Move timeout in seconds:")); sbt->setValue(config->readDoubleNumEntry("timeout", 2.5)); - connect(cbt, SIGNAL(toggled(bool)), sbt, SLOT(setEnabled(bool))); + connect(cbt, TQT_SIGNAL(toggled(bool)), sbt, TQT_SLOT(setEnabled(bool))); sbt->setEnabled(cbt->isChecked()); - QGridLayout *gl = new QGridLayout(gbt, 2, 1, 20); + TQGridLayout *gl = new TQGridLayout(gbt, 2, 1, 20); gl->addWidget(cbt, 0, 0); gl->addWidget(sbt, 1, 0); /* * Enable messages */ - QWhatsThis::add(gbm, i18n("Check the box to enable all the messages that you have previously " + TQWhatsThis::add(gbm, i18n("Check the box to enable all the messages that you have previously " "disabled by choosing the \"Don't show this message again\" option.")); - QGridLayout *glm = new QGridLayout(gbm, 1, 1, nb->spacingHint()); - cbm = new QCheckBox(i18n("Reenable all messages"), gbm); + TQGridLayout *glm = new TQGridLayout(gbm, 1, 1, nb->spacingHint()); + cbm = new TQCheckBox(i18n("Reenable all messages"), gbm); glm->addWidget(cbm, 0, 0); /* * Save options on exit ? */ - QWhatsThis::add(gbm, i18n("Check the box to automatically save all window positions on program " + TQWhatsThis::add(gbm, i18n("Check the box to automatically save all window positions on program " "exit. They will be restored at next start.")); - QGridLayout *gls = new QGridLayout(gbs, 1, 1, nb->spacingHint()); - cbs = new QCheckBox(i18n("Save settings on exit"), gbs); + TQGridLayout *gls = new TQGridLayout(gbs, 1, 1, nb->spacingHint()); + cbs = new TQCheckBox(i18n("Save settings on exit"), gbs); cbs->setChecked(config->readBoolEntry("autosave on exit", true)); gls->addWidget(cbs, 0, 0); /* * Event vonfiguration */ - QWhatsThis::add(gbe, i18n("Event notification of %1 is configured as part of the " + TQWhatsThis::add(gbe, i18n("Event notification of %1 is configured as part of the " "system-wide notification process. Click here, and you " "will be able to configure system sounds, etc."). arg(kapp->aboutData()->programName())); - QGridLayout *gle = new QGridLayout(gbe, 1, 1, nb->spacingHint()); + TQGridLayout *gle = new TQGridLayout(gbe, 1, 1, nb->spacingHint()); KURLLabel *lab = new KURLLabel("kcmshell kcmnotify", i18n("Klick here to configure the event notification"), gbe); lab->setMaximumSize(lab->sizeHint()); gle->addWidget(lab, 0, 0); - connect(lab, SIGNAL(leftClickedURL(const QString &)), SLOT(startKCM(const QString &))); + connect(lab, TQT_SIGNAL(leftClickedURL(const TQString &)), TQT_SLOT(startKCM(const TQString &))); /* * Board settings @@ -589,8 +589,8 @@ void KBg::setupDlg() * Hack alert: this little trick makes sure that ALL engines * have their settings available in the dialog. */ - QPopupMenu *dummyPopup = new QPopupMenu(nb); - QString s = PROG_NAME; + TQPopupMenu *dummyPopup = new TQPopupMenu(nb); + TQString s = PROG_NAME; for (int i = 0; i < MaxEngine; i++) { if (currEngine != i) { switch (i) { @@ -607,7 +607,7 @@ void KBg::setupDlg() engine[i] = new KBgEngineNg(nb, &s, dummyPopup); break; } - connect(this, SIGNAL(saveSettings()), engine[i], SLOT(saveConfig())); + connect(this, TQT_SIGNAL(saveSettings()), engine[i], TQT_SLOT(saveConfig())); } engine[i]->getSetupPages(nb); } @@ -615,12 +615,12 @@ void KBg::setupDlg() /* * Connect the signals of nb */ - connect(nb, SIGNAL(okClicked()), this, SLOT(setupOk())); - connect(nb, SIGNAL(applyClicked()), this, SLOT(setupOk())); - connect(nb, SIGNAL(cancelClicked()), this, SLOT(setupCancel())); - connect(nb, SIGNAL(defaultClicked()),this, SLOT(setupDefault())); + connect(nb, TQT_SIGNAL(okClicked()), this, TQT_SLOT(setupOk())); + connect(nb, TQT_SIGNAL(applyClicked()), this, TQT_SLOT(setupOk())); + connect(nb, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(setupCancel())); + connect(nb, TQT_SIGNAL(defaultClicked()),this, TQT_SLOT(setupDefault())); - connect(nb, SIGNAL(finished()), this, SLOT(setupDone())); + connect(nb, TQT_SIGNAL(finished()), this, TQT_SLOT(setupDone())); nb->resize(nb->minimumSize()); nb->show(); @@ -647,7 +647,7 @@ void KBg::print() prt->setOrientation((KPrinter::Orientation)config->readNumEntry("orientation", KPrinter::Landscape)); if (prt->setup(this, i18n("Print %1").arg(baseCaption))) { - QPainter p; + TQPainter p; p.begin(prt); board->print(&p); p.end(); @@ -686,7 +686,7 @@ void KBg::configureToolbars() { saveMainWindowSettings(KGlobal::config(), "kedittoolbar settings"); // temp group KEditToolbar dlg(actionCollection(), xmlFile(), true, this); - connect(&dlg,SIGNAL(newToolbarConfig()),this,SLOT(newToolbarConfig())); + connect(&dlg,TQT_SIGNAL(newToolbarConfig()),this,TQT_SLOT(newToolbarConfig())); dlg.exec(); KGlobal::config()->deleteGroup( "kedittoolbar settings" ); // delete temp group } @@ -748,14 +748,14 @@ bool KBg::queryClose() * Set the caption of the main window. If the user has requested pip * counts, they are appended, too. */ -void KBg::updateCaption(const QString &s) +void KBg::updateCaption(const TQString &s) { baseCaption = s; - QString msg; + TQString msg; if (!s.isEmpty()) { msg = s; if (board->getPipCount(US) >= 0) { - QString tmp; + TQString tmp; tmp.setNum(board->getPipCount(US )); msg += " - " + tmp; tmp.setNum(board->getPipCount(THEM)); @@ -769,7 +769,7 @@ void KBg::updateCaption(const QString &s) * Take the string from the commandline, give it to the engine, append * to the history and clear the buffer. */ -void KBg::handleCmd(const QString &s) +void KBg::handleCmd(const TQString &s) { if (!s.stripWhiteSpace().isEmpty()) { engine[currEngine]->handleCommand(s); @@ -810,7 +810,7 @@ void KBg::allowCommand(int cmd, bool f) * Catch the hide envents. That way, the current engine can close its * child windows. */ -void KBg::hideEvent(QHideEvent *e) +void KBg::hideEvent(TQHideEvent *e) { KMainWindow::hideEvent(e); engine[currEngine]->hideEvent(); @@ -820,7 +820,7 @@ void KBg::hideEvent(QHideEvent *e) * Catch the show envents. That way, the current engine can open any * previously hidden windows. */ -void KBg::showEvent(QShowEvent *e) +void KBg::showEvent(TQShowEvent *e) { KMainWindow::showEvent(e); engine[currEngine]->showEvent(); diff --git a/kbackgammon/kbg.h b/kbackgammon/kbg.h index d191c8a3..030b30ad 100644 --- a/kbackgammon/kbg.h +++ b/kbackgammon/kbg.h @@ -73,7 +73,7 @@ public slots: * Set the caption to KFIBS_NAME + string + pipcount (if requested by * the user) */ - void updateCaption(const QString &s); + void updateCaption(const TQString &s); /** * Slot to be called by the engine - it enables/disables buttons @@ -86,7 +86,7 @@ public slots: */ void setupEngine(); - void startKCM(const QString &); + void startKCM(const TQString &); signals: @@ -106,12 +106,12 @@ protected: /* * Windows are to be hidden */ - virtual void hideEvent(QHideEvent *); + virtual void hideEvent(TQHideEvent *); /* * Redisplay the windows */ - virtual void showEvent(QShowEvent *); + virtual void showEvent(TQShowEvent *); /* * Called before the window is closed. Check with the engine @@ -140,7 +140,7 @@ protected slots: * Takes text from the commandline and hands it over to the * current engine */ - void handleCmd(const QString &); + void handleCmd(const TQString &); /** * Saves the user settings to disk @@ -198,13 +198,13 @@ private: * Each engine has its own identifier. */ enum Engines {None = -1, Offline, FIBS, GNUbg, NextGen, MaxEngine}; - QString engineString[MaxEngine]; + TQString engineString[MaxEngine]; KBgEngine *engine[MaxEngine]; int currEngine; - QPopupMenu *dummyPopup; + TQPopupMenu *dummyPopup; enum HelpTopics {FIBSHome, RuleHome, MaxHelpTopic}; - QString helpTopic[MaxHelpTopic][2]; + TQString helpTopic[MaxHelpTopic][2]; KSelectAction *engineSet; /** @@ -212,17 +212,17 @@ private: */ KDialogBase *nb; KDoubleNumInput *sbt; - QCheckBox *cbt, *cbs, *cbm; + TQCheckBox *cbt, *cbs, *cbm; /* * UI elements */ - QSplitter *panner; + TQSplitter *panner; KBgBoardSetup *board; KBgTextView *status; KLineEdit *cmdLine; - QLabel *cmdLabel; - QString baseCaption; // for user friendly printing, we keep it around + TQLabel *cmdLabel; + TQString baseCaption; // for user friendly printing, we keep it around }; #endif // __KBG_H diff --git a/kbackgammon/kbgboard.cpp b/kbackgammon/kbgboard.cpp index 8b961a45..fc024ab8 100644 --- a/kbackgammon/kbgboard.cpp +++ b/kbackgammon/kbgboard.cpp @@ -39,12 +39,12 @@ #include <math.h> #include <kcolordialog.h> #include <klocale.h> -#include <qlayout.h> -#include <qgroupbox.h> -#include <qbuttongroup.h> +#include <tqlayout.h> +#include <tqgroupbox.h> +#include <tqbuttongroup.h> #include <kconfig.h> -#include <qwhatsthis.h> -#include <qvbox.h> +#include <tqwhatsthis.h> +#include <tqvbox.h> #include <kiconloader.h> #include <ktabctl.h> #include <kpushbutton.h> @@ -64,17 +64,17 @@ static const int MINIMUM_CHECKER_SIZE = 10; void KBgBoardSetup::setupDefault() { // default background color - setBackgroundColor(QColor(200, 200, 166)); - pbc_1->setPalette(QPalette(backgroundColor())); + setBackgroundColor(TQColor(200, 200, 166)); + pbc_1->setPalette(TQPalette(backgroundColor())); // checker colors baseColors[0] = black; baseColors[1] = white; - pbc_2->setPalette(QPalette(baseColors[0])); - pbc_3->setPalette(QPalette(baseColors[1])); + pbc_2->setPalette(TQPalette(baseColors[0])); + pbc_3->setPalette(TQPalette(baseColors[1])); // default font - setFont(QFont("Serif", 18, QFont::Normal)); + setFont(TQFont("Serif", 18, TQFont::Normal)); kf->setFont(getFont()); // short moves @@ -128,7 +128,7 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb) * Main Widget * =========== */ - QVBox *vbp = nb->addVBoxPage(i18n("Board"), i18n("Here you can configure the backgammon board"), + TQVBox *vbp = nb->addVBoxPage(i18n("Board"), i18n("Here you can configure the backgammon board"), kapp->iconLoader()->loadIcon(PROG_NAME, KIcon::Desktop)); /* @@ -136,16 +136,16 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb) */ KTabCtl *tc = new KTabCtl(vbp, "board tabs"); - QWidget *w = new QWidget(tc); - QGridLayout *gl = new QGridLayout(w, 3, 1, nb->spacingHint()); + TQWidget *w = new TQWidget(tc); + TQGridLayout *gl = new TQGridLayout(w, 3, 1, nb->spacingHint()); /* * Group boxes * =========== */ - QGroupBox *ga = new QGroupBox(w); - QButtonGroup *gm = new QButtonGroup(w); - QGroupBox *go = new QGroupBox(w); + TQGroupBox *ga = new TQGroupBox(w); + TQButtonGroup *gm = new TQButtonGroup(w); + TQGroupBox *go = new TQGroupBox(w); ga->setTitle(i18n("Colors")); gm->setTitle(i18n("Short Moves")); @@ -159,35 +159,35 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb) * Appearance group * ---------------- */ - QGridLayout *blc = new QGridLayout(ga, 2, 2, 20); + TQGridLayout *blc = new TQGridLayout(ga, 2, 2, 20); - pbc_1 = new QPushButton(i18n("Background"), ga); - pbc_1->setPalette(QPalette(backgroundColor())); + pbc_1 = new TQPushButton(i18n("Background"), ga); + pbc_1->setPalette(TQPalette(backgroundColor())); - pbc_2 = new QPushButton(i18n("Color 1"), ga); - pbc_2->setPalette(QPalette(baseColors[0])); + pbc_2 = new TQPushButton(i18n("Color 1"), ga); + pbc_2->setPalette(TQPalette(baseColors[0])); - pbc_3 = new QPushButton(i18n("Color 2"), ga); - pbc_3->setPalette(QPalette(baseColors[1])); + pbc_3 = new TQPushButton(i18n("Color 2"), ga); + pbc_3->setPalette(TQPalette(baseColors[1])); blc->addWidget(pbc_2, 0, 0); blc->addWidget(pbc_3, 0, 1); blc->addMultiCellWidget(pbc_1, 1, 1, 0, 1); - connect(pbc_1, SIGNAL(clicked()), this, SLOT(selectBackgroundColor())); - connect(pbc_2, SIGNAL(clicked()), this, SLOT(selectBaseColorOne())); - connect(pbc_3, SIGNAL(clicked()), this, SLOT(selectBaseColorTwo())); + connect(pbc_1, TQT_SIGNAL(clicked()), this, TQT_SLOT(selectBackgroundColor())); + connect(pbc_2, TQT_SIGNAL(clicked()), this, TQT_SLOT(selectBaseColorOne())); + connect(pbc_3, TQT_SIGNAL(clicked()), this, TQT_SLOT(selectBaseColorTwo())); /* * Moving style * ------------ */ - QBoxLayout *blm = new QVBoxLayout(gm, nb->spacingHint()); + TQBoxLayout *blm = new TQVBoxLayout(gm, nb->spacingHint()); blm->addSpacing(gm->fontMetrics().height()); for (int i = 0; i < 3; i++) - rbMove[i] = new QRadioButton(gm); + rbMove[i] = new TQRadioButton(gm); rbMove[SHORT_MOVE_NONE]->setText(i18n("&Disable short moves. Only drag and drop will move.")); rbMove[SHORT_MOVE_SINGLE]->setText(i18n("&Single clicks with the left mouse button will\n" @@ -205,9 +205,9 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb) * Other options * ------------- */ - QGridLayout *glo = new QGridLayout(go, 1, 1, 20); + TQGridLayout *glo = new TQGridLayout(go, 1, 1, 20); - cbp = new QCheckBox(i18n("Show pip count in title bar"), go); + cbp = new TQCheckBox(i18n("Show pip count in title bar"), go); cbp->setChecked(computePipCount); cbp->adjustSize(); cbp->setMinimumSize(cbp->size()); @@ -234,10 +234,10 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb) * Font selection page * =================== */ - w = new QWidget(tc); + w = new TQWidget(tc); kf = new KFontChooser(w); kf->setFont(getFont()); - gl = new QGridLayout(w, 1, 1, nb->spacingHint()); + gl = new TQGridLayout(w, 1, 1, nb->spacingHint()); gl->addWidget(kf, 0, 0); gl->activate(); w->adjustSize(); @@ -248,7 +248,7 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb) /* * Empty constructor calls the board constructor */ -KBgBoardSetup::KBgBoardSetup(QWidget *parent, const char *name, QPopupMenu *menu) +KBgBoardSetup::KBgBoardSetup(TQWidget *parent, const char *name, TQPopupMenu *menu) : KBgBoard(parent, name, menu) { // empty @@ -263,7 +263,7 @@ void KBgBoardSetup::selectBaseColorOne() c->setColor(baseColors[0]); if (c->exec()) { baseColors[0] = c->color(); - pbc_2->setPalette(QPalette(baseColors[0])); + pbc_2->setPalette(TQPalette(baseColors[0])); for (int i = 0; i < 30; i++) cells[i]->update(); } @@ -279,7 +279,7 @@ void KBgBoardSetup::selectBaseColorTwo() c->setColor(baseColors[1]); if (c->exec()) { baseColors[1] = c->color(); - pbc_3->setPalette(QPalette(baseColors[1])); + pbc_3->setPalette(TQPalette(baseColors[1])); for (int i = 0; i < 30; i++) cells[i]->update(); } @@ -295,7 +295,7 @@ void KBgBoardSetup::selectBackgroundColor() c->setColor(backgroundColor()); if (c->exec()) { setBackgroundColor(c->color()); - pbc_1->setPalette(QPalette(backgroundColor())); + pbc_1->setPalette(TQPalette(backgroundColor())); for (int i = 0; i < 30; i++) cells[i]->update(); } @@ -323,8 +323,8 @@ void KBgBoard::saveConfig() */ void KBgBoard::readConfig() { - QColor col(200, 200, 166); - QFont fon("Serif", 18, QFont::Normal); + TQColor col(200, 200, 166); + TQFont fon("Serif", 18, TQFont::Normal); KConfig* config = kapp->config(); config->setGroup(name()); @@ -341,7 +341,7 @@ void KBgBoard::readConfig() * Get the font the board cells should use for the display of * numbers and cube value. */ -QFont KBgBoard::getFont() const +TQFont KBgBoard::getFont() const { return boardFont; } @@ -350,7 +350,7 @@ QFont KBgBoard::getFont() const * Allows the users of the board classe to set the font to be used * on the board. Note that the fontsize is dynamically set */ -void KBgBoard::setFont(const QFont& f) +void KBgBoard::setFont(const TQFont& f) { boardFont = f; } @@ -378,16 +378,16 @@ void KBgBoard::queryCube() * Constructor, creates the dialog but does not show nor execute it. */ KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them) - : QDialog(0, 0, true) + : TQDialog(0, 0, true) { setCaption(i18n("Set Cube Values")); - QBoxLayout *vbox = new QVBoxLayout(this, 17); + TQBoxLayout *vbox = new TQVBoxLayout(this, 17); - QLabel *info = new QLabel(this); + TQLabel *info = new TQLabel(this); - cb[0] = new QComboBox(this, "first sb"); - cb[1] = new QComboBox(this, "second sb"); + cb[0] = new TQComboBox(this, "first sb"); + cb[1] = new TQComboBox(this, "second sb"); ok = new KPushButton(KStdGuiItem::ok(), this); cancel = new KPushButton(KStdGuiItem::cancel(), this); @@ -399,8 +399,8 @@ KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them) vbox->addWidget(info, 0); - QBoxLayout *hbox_1 = new QHBoxLayout(); - QBoxLayout *hbox_2 = new QHBoxLayout(); + TQBoxLayout *hbox_1 = new TQHBoxLayout(); + TQBoxLayout *hbox_2 = new TQHBoxLayout(); vbox->addLayout(hbox_1); vbox->addLayout(hbox_2); @@ -471,11 +471,11 @@ KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them) cb[0]->setFocus(); - connect(ok, SIGNAL(clicked()), SLOT(accept())); - connect(cancel, SIGNAL(clicked()), SLOT(reject())); + connect(ok, TQT_SIGNAL(clicked()), TQT_SLOT(accept())); + connect(cancel, TQT_SIGNAL(clicked()), TQT_SLOT(reject())); - connect(cb[0], SIGNAL(activated(int)), SLOT(changePlayer(int))); - connect(cb[1], SIGNAL(activated(int)), SLOT(changeValue (int))); + connect(cb[0], TQT_SIGNAL(activated(int)), TQT_SLOT(changePlayer(int))); + connect(cb[1], TQT_SIGNAL(activated(int)), TQT_SLOT(changeValue (int))); } /* @@ -528,16 +528,16 @@ void KBgBoardQCube::changePlayer(int val) * Constructor, creates the dialog but does not show nor execute it. */ KBgBoardQDice::KBgBoardQDice(const char *name) - : QDialog(0, name, true) + : TQDialog(0, name, true) { setCaption(i18n("Set Dice Values")); - QBoxLayout *vbox = new QVBoxLayout(this, 17); + TQBoxLayout *vbox = new TQVBoxLayout(this, 17); - QLabel *info = new QLabel(this); + TQLabel *info = new TQLabel(this); - sb[0] = new QSpinBox(this, "first sb"); - sb[1] = new QSpinBox(this, "second sb"); + sb[0] = new TQSpinBox(this, "first sb"); + sb[1] = new TQSpinBox(this, "second sb"); ok = new KPushButton(KStdGuiItem::ok(), this); cancel = new KPushButton(KStdGuiItem::cancel(), this); @@ -548,8 +548,8 @@ KBgBoardQDice::KBgBoardQDice(const char *name) vbox->addWidget(info, 0); - QBoxLayout *hbox_1 = new QHBoxLayout(); - QBoxLayout *hbox_2 = new QHBoxLayout(); + TQBoxLayout *hbox_1 = new TQHBoxLayout(); + TQBoxLayout *hbox_2 = new TQHBoxLayout(); vbox->addLayout(hbox_1); vbox->addLayout(hbox_2); @@ -577,8 +577,8 @@ KBgBoardQDice::KBgBoardQDice(const char *name) sb[0]->setFocus(); - connect(ok, SIGNAL(clicked()), SLOT(accept())); - connect(cancel, SIGNAL(clicked()), SLOT(reject())); + connect(ok, TQT_SIGNAL(clicked()), TQT_SLOT(accept())); + connect(cancel, TQT_SIGNAL(clicked()), TQT_SLOT(reject())); sb[0]->setValue(1); sb[1]->setValue(1); @@ -656,7 +656,7 @@ KBgStatus* KBgBoard::getState(KBgStatus *st) const /* * This function lets external users change the context menu */ -void KBgBoard::setContextMenu(QPopupMenu *menu) +void KBgBoard::setContextMenu(TQPopupMenu *menu) { contextMenu = menu; } @@ -670,12 +670,12 @@ void KBgBoard::sendMove() if (getEditMode()) return; - QString s, t; + TQString s, t; s.setNum(moveHistory.count()); s += " "; - QPtrListIterator<KBgBoardMove> it(moveHistory); + TQPtrListIterator<KBgBoardMove> it(moveHistory); for (; it.current(); ++it) { KBgBoardMove *move = it.current(); if (move->source() == BAR_US || move->source() == BAR_THEM ) { @@ -702,22 +702,22 @@ void KBgBoard::sendMove() } /* - * This is overloaded from QWidget, since it has to pass the new + * This is overloaded from TQWidget, since it has to pass the new * background color to the child widgets (the cells). */ -void KBgBoard::setBackgroundColor(const QColor &col) +void KBgBoard::setBackgroundColor(const TQColor &col) { if (col != backgroundColor()) { - QWidget::setBackgroundColor(col); + TQWidget::setBackgroundColor(col); for( int i = 0; i < 30; ++i) cells[i]->setBackgroundColor(col); } } /* - * Overloaded from QWidget since we have to resize all cells + * Overloaded from TQWidget since we have to resize all cells */ -void KBgBoard::resizeEvent(QResizeEvent *) +void KBgBoard::resizeEvent(TQResizeEvent *) { int xo0 = 0; int xo1, w; @@ -750,7 +750,7 @@ void KBgBoard::resizeEvent(QResizeEvent *) * can print whatever she/he wants above the 0.2*p->viewport().height() * margin (like game status information). */ -void KBgBoard::print(QPainter *p) +void KBgBoard::print(TQPainter *p) { double sf = 0.8*p->viewport().width()/width(); int xo = int((p->viewport().width() - sf*width())/2); @@ -770,7 +770,7 @@ void KBgBoard::print(QPainter *p) * of the given sign(!). I.e. we distinguish checkers by whether * they are negative or positive. */ -QColor KBgBoard::getCheckerColor(int p) const +TQColor KBgBoard::getCheckerColor(int p) const { return ((p < 0) ? baseColors[0] : baseColors[1]); } @@ -799,14 +799,14 @@ int KBgBoardCell::getCheckerDiameter() const /* * Draws the cells content using the painter p. - * Reimplemented from QLabel. + * Reimplemented from TQLabel. */ -void KBgBoardCell::drawContents(QPainter *) +void KBgBoardCell::drawContents(TQPainter *) { - QRect cr(0, 0, width(), height()); + TQRect cr(0, 0, width(), height()); cr.moveBottomLeft(rect().bottomLeft()); - QPixmap pix(cr.size()); - QPainter tmp; + TQPixmap pix(cr.size()); + TQPainter tmp; pix.fill(this, cr.topLeft()); tmp.begin(&pix); paintCell(&tmp); @@ -825,7 +825,7 @@ void KBgBoardCell::drawContents(QPainter *) * overloaded paintCell() member are supposed to call this one after(!) they * have painted themselves. */ -void KBgBoardCell::paintCell(QPainter *p, int xo, int yo, double sf) const +void KBgBoardCell::paintCell(TQPainter *p, int xo, int yo, double sf) const { int x1 = xo; int x2 = xo; int y1 = yo; int y2 = yo; @@ -857,7 +857,7 @@ void KBgBoardCell::paintCell(QPainter *p, int xo, int yo, double sf) const * for bars and homes to get them separated from the rest of the board. */ void -KBgBoardCell::drawVertBorder(QPainter *p, int xo, int yo, double sf) const +KBgBoardCell::drawVertBorder(TQPainter *p, int xo, int yo, double sf) const { p->setBrush(black); p->setPen(black); @@ -870,7 +870,7 @@ KBgBoardCell::drawVertBorder(QPainter *p, int xo, int yo, double sf) const * starts at the upper left corner (xo, yo) and uses the scaling factor * sf. */ -void KBgBoardHome::paintCell(QPainter *p, int xo, int yo, double sf) const +void KBgBoardHome::paintCell(TQPainter *p, int xo, int yo, double sf) const { /* * Only these homes contain checkers. The other ones contains dice and cube. @@ -902,7 +902,7 @@ void KBgBoardHome::paintCell(QPainter *p, int xo, int yo, double sf) const * checkers and the cube. Please read the comments in the code on how * and why the checkers and (especially) the cube is printed. */ -void KBgBoardBar::paintCell(QPainter *p, int xo, int yo, double sf) const +void KBgBoardBar::paintCell(TQPainter *p, int xo, int yo, double sf) const { /* * Put in the checkers. @@ -944,18 +944,18 @@ void KBgBoardBar::paintCell(QPainter *p, int xo, int yo, double sf) const * the coundaries given by cubeRect(...). The other parameters are like * in the other functions. */ -void KBgBoardCell::drawCube(QPainter *p, int who, int xo, int yo, +void KBgBoardCell::drawCube(TQPainter *p, int who, int xo, int yo, double sf) const { - QRect r = cubeRect(who, true, sf); - r.moveTopLeft(QPoint(xo+r.left(), yo+r.top())); + TQRect r = cubeRect(who, true, sf); + r.moveTopLeft(TQPoint(xo+r.left(), yo+r.top())); p->setBrush(black); p->setPen(black); p->drawRoundRect(r, 20, 20); r = cubeRect(who, false, sf); - r.moveTopLeft(QPoint(xo+r.left(), yo+r.top())); + r.moveTopLeft(TQPoint(xo+r.left(), yo+r.top())); p->setBrush(white); p->setPen(white); @@ -964,7 +964,7 @@ void KBgBoardCell::drawCube(QPainter *p, int who, int xo, int yo, p->setBrush(black); p->setPen(black); - QString cubeNum; + TQString cubeNum; int v = board->getCube(); /* * Ensure that the cube shows 64 initially @@ -975,7 +975,7 @@ void KBgBoardCell::drawCube(QPainter *p, int who, int xo, int yo, /* * Adjust the font size */ - QFont f = board->getFont(); + TQFont f = board->getFont(); f.setPointSizeFloat(0.75*f.pointSizeFloat()); p->setFont(f); p->drawText(r, AlignCenter, cubeNum); @@ -987,12 +987,12 @@ void KBgBoardCell::drawCube(QPainter *p, int who, int xo, int yo, * is scaled with a default value of 1.0. The scale parameter determines the the * size of the dice relative to the checker diameter. */ -QRect KBgBoardCell::diceRect(int i, bool big, double sf, double scale) const +TQRect KBgBoardCell::diceRect(int i, bool big, double sf, double scale) const { int d = int(scale*getCheckerDiameter()); int l = (1+width())%2; int k = (big ? 0 : 1); - return(QRect(sf*(width()/2-d+k), + return(TQRect(sf*(width()/2-d+k), sf*(height()/2-2*d-3+2*i*(d+3)-1+k), sf*(2*(d-k)+1-l), sf*(2*(d-k)+1-l))); @@ -1003,9 +1003,9 @@ QRect KBgBoardCell::diceRect(int i, bool big, double sf, double scale) const * is moved to the correct place and scaled correctly. The cube is slightly * smaller than the dice. */ -QRect KBgBoardCell::cubeRect(int who, bool big, double sf) const +TQRect KBgBoardCell::cubeRect(int who, bool big, double sf) const { - QRect r = diceRect(0, big, sf, 0.40); + TQRect r = diceRect(0, big, sf, 0.40); int d = int(0.40*getCheckerDiameter()); int h = r.height(); @@ -1025,7 +1025,7 @@ QRect KBgBoardCell::cubeRect(int who, bool big, double sf) const r.setTop( -d*sf - k); break; default: - return(QRect(0,0,0,0)); + return(TQRect(0,0,0,0)); } r.setHeight(h); return r; @@ -1036,14 +1036,14 @@ QRect KBgBoardCell::cubeRect(int who, bool big, double sf) const * If the painting of dice should be saved this is the place * to modify. */ -void KBgBoardHome::drawDiceFace(QPainter *p, int col, int num, int who, +void KBgBoardHome::drawDiceFace(TQPainter *p, int col, int num, int who, int xo, int yo, double sf) const { p->setBrush(board->getCheckerColor(col)); p->setPen(board->getCheckerColor(col)); - QRect r = diceRect(num, false, sf); - r.moveTopLeft(QPoint(xo+r.left(), yo+r.top())); + TQRect r = diceRect(num, false, sf); + r.moveTopLeft(TQPoint(xo+r.left(), yo+r.top())); int cx = r.width() /2; int cy = r.height()/2; @@ -1087,13 +1087,13 @@ void KBgBoardHome::drawDiceFace(QPainter *p, int col, int num, int who, * The square is suited to contain a a face value as printed * by drawDiceFace(...). */ -void KBgBoardHome::drawDiceFrame(QPainter *p, int col, int num, +void KBgBoardHome::drawDiceFrame(TQPainter *p, int col, int num, int xo, int yo, bool big, double sf) const { p->setBrush(board->getCheckerColor(col)); p->setPen(board->getCheckerColor(col)); - QRect r = diceRect(num, big, sf); - r.moveTopLeft(QPoint(xo+r.left(), yo+r.top())); + TQRect r = diceRect(num, big, sf); + r.moveTopLeft(TQPoint(xo+r.left(), yo+r.top())); p->drawRoundRect(r, 20, 20); } @@ -1101,7 +1101,7 @@ void KBgBoardHome::drawDiceFrame(QPainter *p, int col, int num, * If the event is left button we just store that. If the event is right * button we ask the board to possibly display the popup menu. */ -void KBgBoardCell::mousePressEvent(QMouseEvent *e) +void KBgBoardCell::mousePressEvent(TQMouseEvent *e) { if (e->button() == RightButton) board->showContextMenu(); @@ -1140,7 +1140,7 @@ int KBgBoard::getShortMoveMode() * tests are ok, the shortest possible move away from here is * made. */ -void KBgBoardCell::checkAndMakeShortMove(QMouseEvent *e, int m) +void KBgBoardCell::checkAndMakeShortMove(TQMouseEvent *e, int m) { if ((e->button() == LeftButton) && (board->getShortMoveMode() == m) && @@ -1152,7 +1152,7 @@ void KBgBoardCell::checkAndMakeShortMove(QMouseEvent *e, int m) /* * This functions reacts on a double click. */ -void KBgBoardCell::mouseDoubleClickEvent(QMouseEvent *e) +void KBgBoardCell::mouseDoubleClickEvent(TQMouseEvent *e) { checkAndMakeShortMove(e, SHORT_MOVE_DOUBLE); } @@ -1162,9 +1162,9 @@ void KBgBoardCell::mouseDoubleClickEvent(QMouseEvent *e) * about two different double clicks: double the cube and make a * short move. */ -void KBgBoardBar::mouseDoubleClickEvent(QMouseEvent *e) +void KBgBoardBar::mouseDoubleClickEvent(TQMouseEvent *e) { - QRect r = cubeRect(cellID == BAR_THEM ? CUBE_UPPER : CUBE_LOWER, true); + TQRect r = cubeRect(cellID == BAR_THEM ? CUBE_UPPER : CUBE_LOWER, true); if (board->canDouble(US) && board->canDouble(THEM) && r.contains(e->pos())) { if (board->getEditMode()) @@ -1189,7 +1189,7 @@ KBgBoard::~KBgBoard() * This function draws dice and cube on the painter for a home cell. * who may be either US or THEM. */ -void KBgBoardHome::drawDiceAndCube(QPainter *p, int who, int xo, int yo, +void KBgBoardHome::drawDiceAndCube(TQPainter *p, int who, int xo, int yo, double sf) const { int col = ((who == THEM) ? -color : color); @@ -1316,7 +1316,7 @@ int KBgBoard::getPipCount(const int& w) const * only if the the click happened within the boundaries of a * dice or the cube. */ -void KBgBoardHome::mouseDoubleClickEvent(QMouseEvent * e) +void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e) { if (e->button() != LeftButton) return; @@ -1331,7 +1331,7 @@ void KBgBoardHome::mouseDoubleClickEvent(QMouseEvent * e) int w = ((cellID == HOME_US_LEFT || cellID == HOME_US_RIGHT) ? US : THEM); for (int i = 0; i < 2; ++i) { - QRect r = diceRect(i, true); + TQRect r = diceRect(i, true); if (r.contains(e->pos())) { if (board->getEditMode()) { @@ -1355,7 +1355,7 @@ void KBgBoardHome::mouseDoubleClickEvent(QMouseEvent * e) } if (board->canDouble(w) && !(board->canDouble(US) && board->canDouble(THEM))) { - QRect r = cubeRect(w, true); + TQRect r = cubeRect(w, true); if (r.contains(e->pos())) if (board->getEditMode()) board->queryCube(); @@ -1432,7 +1432,7 @@ bool KBgBoard::moveOffPossible() const * a pointer to the cell or NULL if there is no cell under the point. */ -KBgBoardCell* KBgBoard::getCellByPos(const QPoint& p) const +KBgBoardCell* KBgBoard::getCellByPos(const TQPoint& p) const { for (int i = 0; i < 30; ++i) { if (cells[i]->rect().contains(cells[i]->mapFromParent(p))) @@ -1512,11 +1512,11 @@ bool KBgBoardCell::getPiece() * This function stores the current cursor and replaces it with the * supplied one c. */ -void KBgBoard::replaceCursor(const QCursor& c) +void KBgBoard::replaceCursor(const TQCursor& c) { if (savedCursor) delete savedCursor; - savedCursor = new QCursor(cursor()); + savedCursor = new TQCursor(cursor()); setCursor(c); } @@ -1558,7 +1558,7 @@ void KBgBoardCell::putPiece(int newColor) * the cell where the first mousePressEvent occurred receives the release event. * The release event marks the end of a drag or a single click short move. */ -void KBgBoardCell::mouseReleaseEvent(QMouseEvent *e) +void KBgBoardCell::mouseReleaseEvent(TQMouseEvent *e) { if (dragInProgress) { @@ -1608,12 +1608,12 @@ KBgBoardField::~KBgBoardField() /* * This is the constructor of the bars. It calls the base class' constructor - * and defines the QWhatsThis string. + * and defines the TQWhatsThis string. */ -KBgBoardBar::KBgBoardBar(QWidget * parent, int numID) +KBgBoardBar::KBgBoardBar(TQWidget * parent, int numID) : KBgBoardCell(parent, numID) { - QWhatsThis::add(this, i18n("This is the bar of the backgammon board.\n\n" + TQWhatsThis::add(this, i18n("This is the bar of the backgammon board.\n\n" "Checkers that have been kicked from the board are put " "on the bar and remain there until they can be put back " "on the board. Checkers can be moved by dragging them to " @@ -1625,12 +1625,12 @@ KBgBoardBar::KBgBoardBar(QWidget * parent, int numID) /* * This is the constructor of regular fields. It calls the base class' constructor - * and defines the QWhatsThis string. + * and defines the TQWhatsThis string. */ -KBgBoardField::KBgBoardField(QWidget * parent, int numID) +KBgBoardField::KBgBoardField(TQWidget * parent, int numID) : KBgBoardCell(parent, numID) { - QWhatsThis::add(this, i18n("This is a regular field of the backgammon board.\n\n" + TQWhatsThis::add(this, i18n("This is a regular field of the backgammon board.\n\n" "Checkers can be placed on this field and if the current state " "of the game and the dice permit this, they can be moved by " "dragging them to their destination or by using the 'short " @@ -1639,12 +1639,12 @@ KBgBoardField::KBgBoardField(QWidget * parent, int numID) /* * This is the constructor of the homes. It calls the base class' constructor - * and defines the QWhatsThis string. + * and defines the TQWhatsThis string. */ -KBgBoardHome::KBgBoardHome(QWidget * parent, int numID) +KBgBoardHome::KBgBoardHome(TQWidget * parent, int numID) : KBgBoardCell(parent, numID) { - QWhatsThis::add(this, i18n("This part of the backgammon board is the home.\n\n" + TQWhatsThis::add(this, i18n("This part of the backgammon board is the home.\n\n" "Depending on the direction of the game, one of the homes " "contains the dice and the other one contains checkers that " "have been moved off the board. Checkers can never be moved " @@ -1734,8 +1734,8 @@ int KBgBoard::getTurn() const * This is the constructor of the basic cells. It initializes the cell * to a sane state and connects a signal to the board. */ -KBgBoardCell::KBgBoardCell(QWidget * parent, int numID) - : QLabel(parent) +KBgBoardCell::KBgBoardCell(TQWidget * parent, int numID) + : TQLabel(parent) { board = (KBgBoard *)parent; @@ -1749,7 +1749,7 @@ KBgBoardCell::KBgBoardCell(QWidget * parent, int numID) mouseButton = NoButton; dragInProgress = false; - connect(parent, SIGNAL(finishedUpdate()), this, SLOT(refresh())); + connect(parent, TQT_SIGNAL(finishedUpdate()), this, TQT_SLOT(refresh())); } /* @@ -1858,7 +1858,7 @@ void KBgBoard::updateField(int f, int v) */ void KBgBoard::showContextMenu() { - if (contextMenu) contextMenu->popup(QCursor::pos()); + if (contextMenu) contextMenu->popup(TQCursor::pos()); } /* @@ -2149,23 +2149,23 @@ void KBgBoard::setState(const KBgStatus &st) * This function starts a drag from this cell if possible. It asks the board to * change the mouse pointer and takes a checker away from this cell. */ -void KBgBoardCell::mouseMoveEvent(QMouseEvent *) +void KBgBoardCell::mouseMoveEvent(TQMouseEvent *) { if ((mouseButton == LeftButton) && dragPossible()) { dragInProgress = true; - QRect cr(0, 0, 1+getCheckerDiameter(), 1+getCheckerDiameter()); + TQRect cr(0, 0, 1+getCheckerDiameter(), 1+getCheckerDiameter()); cr.moveBottomLeft(rect().bottomLeft()); - QPixmap pix(cr.size()); - QPainter tmp; + TQPixmap pix(cr.size()); + TQPainter tmp; pix.fill(this, cr.topLeft()); tmp.begin(&pix); board->drawSimpleChecker(&tmp, 0, 0, pcs, getCheckerDiameter()); tmp.end(); pix.setMask(pix.createHeuristicMask()); - QBitmap mask = *(pix.mask()); - QBitmap newCursor; + TQBitmap mask = *(pix.mask()); + TQBitmap newCursor; newCursor = pix; - board->replaceCursor(QCursor(newCursor, mask)); + board->replaceCursor(TQCursor(newCursor, mask)); if (board->getEditMode()) board->storeTurn(pcs); getPiece(); @@ -2179,7 +2179,7 @@ void KBgBoardCell::mouseMoveEvent(QMouseEvent *) * maximum diameter of diam. This checker has only two colors and * as such it is suited for the mouse cursor and printing. */ -void KBgBoard::drawSimpleChecker(QPainter *p, int x, int y, int pcs, +void KBgBoard::drawSimpleChecker(TQPainter *p, int x, int y, int pcs, int diam) const { p->setBrush(getCheckerColor(pcs)); @@ -2202,7 +2202,7 @@ void KBgBoard::drawSimpleChecker(QPainter *p, int x, int y, int pcs, * on a field respectively. upper indicates whether the checker is * in the upper half of the board or not. */ -void KBgBoard::drawChecker(QPainter *p, int x, int y, int pcs, int diam, +void KBgBoard::drawChecker(TQPainter *p, int x, int y, int pcs, int diam, int col, bool upper) const { drawCircle(p, x, y, pcs, diam , col, upper, true ); @@ -2215,7 +2215,7 @@ void KBgBoard::drawChecker(QPainter *p, int x, int y, int pcs, int diam, * up to fifteen checkers fit on the cell. This is used by homes and * bars. */ -void KBgBoardCell::drawOverlappingCheckers(QPainter *p, int xo, int yo, +void KBgBoardCell::drawOverlappingCheckers(TQPainter *p, int xo, int yo, double sf) const { int d = getCheckerDiameter(); @@ -2240,9 +2240,9 @@ void KBgBoardCell::drawOverlappingCheckers(QPainter *p, int xo, int yo, * checkers in such a way that always five are in one level and the next * level is slightly shifted. */ -void KBgBoardField::paintCell(QPainter *p, int xo, int yo, double sf) const +void KBgBoardField::paintCell(TQPainter *p, int xo, int yo, double sf) const { - QColor color, alphaColor, background = backgroundColor(); + TQColor color, alphaColor, background = backgroundColor(); bool printing = abs(xo)+abs(yo) > 0; if (printing) { @@ -2251,7 +2251,7 @@ void KBgBoardField::paintCell(QPainter *p, int xo, int yo, double sf) const * paper. This justs draws a triangle and surrounds * it by a black triangle. Easy but works. */ - QPointArray pa(3); + TQPointArray pa(3); color = (getNumber()%2 ? white : black); @@ -2362,11 +2362,11 @@ void KBgBoardField::paintCell(QPainter *p, int xo, int yo, double sf) const p->setBrush(color); p->setPen(color); - QString t; + TQString t; t.setNum(getNumber()); p->setFont(board->getFont()); - int textHeight = QFontMetrics(p->font()).height(); + int textHeight = TQFontMetrics(p->font()).height(); p->drawText(xo, yo+((cellID < 13) ? 5 : height()-5-textHeight), width()*sf, textHeight, AlignCenter, t); @@ -2408,12 +2408,12 @@ void KBgBoardField::paintCell(QPainter *p, int xo, int yo, double sf) const * about the triangles on the cells. This is long but it is just a big if * construct. */ -void KBgBoard::drawCircle(QPainter *p, int x, int y, int pcs, int diam, +void KBgBoard::drawCircle(TQPainter *p, int x, int y, int pcs, int diam, int col, bool upper, bool outer) const { - QColor fColor = getCheckerColor(pcs); - QColor alphaColor; - QColor bColor; + TQColor fColor = getCheckerColor(pcs); + TQColor alphaColor; + TQColor bColor; int red, green, blue; int rad = diam/2; @@ -2823,8 +2823,8 @@ void KBgBoard::getRollDice(const int w) * You have to change the status by passing a KBgStatus * object to setState(...) before you can play! */ -KBgBoard::KBgBoard(QWidget *parent, const char *name, QPopupMenu *menu) - : QWidget(parent, name) +KBgBoard::KBgBoard(TQWidget *parent, const char *name, TQPopupMenu *menu) + : TQWidget(parent, name) { /* * The following lines set up internal bookkeeping data. @@ -2898,21 +2898,21 @@ KBgBoard::KBgBoard(QWidget *parent, const char *name, QPopupMenu *menu) * overwritten by the user. */ shortMoveMode = SHORT_MOVE_DOUBLE; - setBackgroundColor(QColor(200, 200, 166)); + setBackgroundColor(TQColor(200, 200, 166)); computePipCount = true; /* * Set initial font */ - setFont(QApplication::font()); + setFont(TQApplication::font()); } -QSize KBgBoard::minimumSizeHint() const +TQSize KBgBoard::minimumSizeHint() const { - return QSize(MINIMUM_CHECKER_SIZE * 15, MINIMUM_CHECKER_SIZE * 11); + return TQSize(MINIMUM_CHECKER_SIZE * 15, MINIMUM_CHECKER_SIZE * 11); } -QSize KBgBoard::sizeHint() const { - return QSize(MINIMUM_CHECKER_SIZE *15*4,MINIMUM_CHECKER_SIZE*11*2); +TQSize KBgBoard::sizeHint() const { + return TQSize(MINIMUM_CHECKER_SIZE *15*4,MINIMUM_CHECKER_SIZE*11*2); } diff --git a/kbackgammon/kbgboard.h b/kbackgammon/kbgboard.h index e2f35f68..54ad506c 100644 --- a/kbackgammon/kbgboard.h +++ b/kbackgammon/kbgboard.h @@ -39,23 +39,23 @@ #include <config.h> #endif -#include <qspinbox.h> -#include <qpushbutton.h> -#include <qcheckbox.h> -#include <qdialog.h> -#include <qstring.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qbitmap.h> -#include <qregexp.h> -#include <qradiobutton.h> -#include <qwidget.h> -#include <qptrlist.h> -#include <qtimer.h> -#include <qlabel.h> -#include <qcursor.h> -#include <qpopupmenu.h> -#include <qcombobox.h> +#include <tqspinbox.h> +#include <tqpushbutton.h> +#include <tqcheckbox.h> +#include <tqdialog.h> +#include <tqstring.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqbitmap.h> +#include <tqregexp.h> +#include <tqradiobutton.h> +#include <tqwidget.h> +#include <tqptrlist.h> +#include <tqtimer.h> +#include <tqlabel.h> +#include <tqcursor.h> +#include <tqpopupmenu.h> +#include <tqcombobox.h> #include <kdialogbase.h> #include <kfontdialog.h> @@ -109,8 +109,8 @@ class KBgBoard : public QWidget /** * Constructor and destructor. Parameter as usual. */ - KBgBoard(QWidget *parent = 0, const char *name = 0, - QPopupMenu *menu = 0); + KBgBoard(TQWidget *parent = 0, const char *name = 0, + TQPopupMenu *menu = 0); virtual ~KBgBoard(); /** @@ -141,14 +141,14 @@ class KBgBoard : public QWidget * Sets the background color and passes the info to the * child widgets */ - virtual void setBackgroundColor(const QColor &col); + virtual void setBackgroundColor(const TQColor &col); /** * Prints the baord along with some basic info onto the * painetr p. It is assumed that this painter is a postscript * printer. Hence the plot is black/white only. */ - void print(QPainter *p); + void print(TQPainter *p); /** * Get whose turn it is - US, THEM or 0 @@ -174,13 +174,13 @@ class KBgBoard : public QWidget * Get the font the board cells should use for the display of * numbers and cube value. */ - QFont getFont() const; + TQFont getFont() const; /** * This function has to be reimplemented to provide a minimum size for * the playing area. */ - QSize minimumSizeHint() const; + TQSize minimumSizeHint() const; public slots: /** @@ -196,7 +196,7 @@ public slots: * We overwrite the handler to make sure that all the cells are * repainted as well. */ - virtual void resizeEvent(QResizeEvent *); + virtual void resizeEvent(TQResizeEvent *); /** * Undo the last move. @@ -218,7 +218,7 @@ public slots: /** * Set the context menu */ - void setContextMenu(QPopupMenu *menu); + void setContextMenu(TQPopupMenu *menu); /** * Get the current state of the board. @@ -235,7 +235,7 @@ public slots: * Allows the users of the board classe to set the font to be used * on the board. Note that the fontsize is dynamically set */ - void setFont(const QFont& f); + void setFont(const TQFont& f); /** * Write the current configuration to the application's data base @@ -253,7 +253,7 @@ public slots: * The text identifies the current game status - could be put * into the main window caption */ - void statText(const QString &msg); + void statText(const TQString &msg); /** * The cells connect to this signal and it tells them that it is @@ -276,7 +276,7 @@ public slots: * Once the moves are all made, build a server command and send * them out. */ - void currentMove(QString *s); + void currentMove(TQString *s); /* ************************************************** */ /* ************************************************** */ @@ -291,10 +291,10 @@ public slots: /* ************************************************** */ protected: - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; - QColor baseColors[2]; - QFont boardFont; + TQColor baseColors[2]; + TQFont boardFont; KBgBoardCell* cells[30]; bool computePipCount; @@ -382,26 +382,26 @@ protected: * Draws a piece on the painter p, with the upper left corner * of the enclosing rectangle being (x,y) */ - void drawCircle(QPainter *p, int x, int y, int pcs, int diam, + void drawCircle(TQPainter *p, int x, int y, int pcs, int diam, int col, bool upper, bool outer) const; /** * Draws an anti-aliased checker on the painter p. */ - void drawChecker(QPainter *p, int x, int y, int pcs, int diam, + void drawChecker(TQPainter *p, int x, int y, int pcs, int diam, int col, bool upper) const; /** * Draws a simple 2-color checker on the painter p. This is intended * for printing. */ - void drawSimpleChecker(QPainter *p, int x, int y, int pcs, + void drawSimpleChecker(TQPainter *p, int x, int y, int pcs, int diam) const; /** * Given a position on the board, return the cell under the mouse pointer */ - KBgBoardCell* getCellByPos(const QPoint& p) const; + KBgBoardCell* getCellByPos(const TQPoint& p) const; /** * Name says it all, doesn't it? @@ -411,7 +411,7 @@ protected: /** * Temporary replace the cursor, saves the old one */ - void replaceCursor(const QCursor& c); + void replaceCursor(const TQCursor& c); /** * Restore the previously stored cursor. @@ -421,7 +421,7 @@ protected: /** * Given the sign of p, return the current base color */ - QColor getCheckerColor(int p) const; + TQColor getCheckerColor(int p) const; /** * Small utility function for makeMove - just for readability @@ -431,9 +431,9 @@ protected: /** * Private data members - no description needed */ - QPopupMenu *contextMenu; - QPtrList<KBgBoardMove> moveHistory; - QPtrList<KBgBoardMove> redoHistory; + TQPopupMenu *contextMenu; + TQPtrList<KBgBoardMove> moveHistory; + TQPtrList<KBgBoardMove> redoHistory; int direction, color; int hasmoved; bool allowmoving, editMode; @@ -448,7 +448,7 @@ protected: bool cubechanged; bool maydouble[2]; int shortMoveMode; - QCursor *savedCursor; + TQCursor *savedCursor; }; /** @@ -467,7 +467,7 @@ class KBgBoardCell : public QLabel /** * Constructor and destructor */ - KBgBoardCell(QWidget * parent, int numID); + KBgBoardCell(TQWidget * parent, int numID); virtual ~KBgBoardCell(); /** @@ -479,7 +479,7 @@ class KBgBoardCell : public QLabel /** * Draws the content of the cell on the painter *p */ - virtual void paintCell(QPainter *p, int xo = 0, int yo = 0, + virtual void paintCell(TQPainter *p, int xo = 0, int yo = 0, double sf = 1.0) const; /** @@ -492,10 +492,10 @@ protected: /** * Draw vertical lines around the board. */ - void drawVertBorder(QPainter *p, int xo, int yo, double sf = 1.0) const; - void drawOverlappingCheckers(QPainter *p, int xo, int yo, + void drawVertBorder(TQPainter *p, int xo, int yo, double sf = 1.0) const; + void drawOverlappingCheckers(TQPainter *p, int xo, int yo, double sf = 1.0) const; - void drawCube(QPainter *p, int who, int xo, int yo, double sf = 1.0) const; + void drawCube(TQPainter *p, int who, int xo, int yo, double sf = 1.0) const; /** * Puts a piece of color on a field @@ -530,7 +530,7 @@ protected: /** * Overwrite how a cell draws itself */ - virtual void drawContents(QPainter *); + virtual void drawContents(TQPainter *); /** * Status numbers that store the current board status. @@ -561,17 +561,17 @@ protected: * sense without the other). So the pieces know and access their parent. */ KBgBoard *board; - void checkAndMakeShortMove(QMouseEvent *e, int m); + void checkAndMakeShortMove(TQMouseEvent *e, int m); /** * Returns the bounding rectangle of the cube on this cell */ - QRect cubeRect( int who, bool big, double sf = 1.0 ) const; + TQRect cubeRect( int who, bool big, double sf = 1.0 ) const; /** * Returns the bounding rectangle of the dice i on this cell */ - QRect diceRect(int i, bool big, double sf = 1.0, double scale = 0.45) const; + TQRect diceRect(int i, bool big, double sf = 1.0, double scale = 0.45) const; bool dragInProgress; protected slots: @@ -588,8 +588,8 @@ protected: /** * Possibly initiate a drag. */ - virtual void mouseMoveEvent( QMouseEvent * ); - virtual void mousePressEvent(QMouseEvent *e); + virtual void mouseMoveEvent( TQMouseEvent * ); + virtual void mousePressEvent(TQMouseEvent *e); /** * Make the shortes possible move away from this cell @@ -600,12 +600,12 @@ protected: /** * Catch a single left click and perhapes make a move. */ - virtual void mouseReleaseEvent( QMouseEvent *e ); + virtual void mouseReleaseEvent( TQMouseEvent *e ); /** * Catch a double left click and perhapes make a move. */ - virtual void mouseDoubleClickEvent( QMouseEvent *e ); + virtual void mouseDoubleClickEvent( TQMouseEvent *e ); }; /** @@ -626,13 +626,13 @@ class KBgBoardHome : public KBgBoardCell /* * Draws the content of the cell on the painter *p */ - virtual void paintCell(QPainter *p, int xo = 0, int yo = 0, + virtual void paintCell(TQPainter *p, int xo = 0, int yo = 0, double sf = 1.0) const; /** * Constructor and destructor */ - KBgBoardHome( QWidget * parent, int numID); + KBgBoardHome( TQWidget * parent, int numID); virtual ~KBgBoardHome(); /** @@ -649,17 +649,17 @@ class KBgBoardHome : public KBgBoardCell /** * Get the double clicks */ - virtual void mouseDoubleClickEvent( QMouseEvent *e ); + virtual void mouseDoubleClickEvent( TQMouseEvent *e ); /** * The homes contain dice and cube. This draws them. */ - void drawDiceAndCube(QPainter *p, int who, int xo, int yo, + void drawDiceAndCube(TQPainter *p, int who, int xo, int yo, double sf) const; - void drawDiceFrame(QPainter *p, int col, int num, int xo, int yo, + void drawDiceFrame(TQPainter *p, int col, int num, int xo, int yo, bool big, double sf) const; - void drawDiceFace(QPainter *p, int col, int num, int who, int xo, + void drawDiceFace(TQPainter *p, int col, int num, int who, int xo, int yo, double sf) const; private: @@ -688,13 +688,13 @@ class KBgBoardBar : public KBgBoardCell /** * Draws the content of the cell on the painter *p */ - virtual void paintCell(QPainter *p, int xo = 0, int yo = 0, + virtual void paintCell(TQPainter *p, int xo = 0, int yo = 0, double sf = 1.0) const; /** * Constructor */ - KBgBoardBar( QWidget * parent, int numID ); + KBgBoardBar( TQWidget * parent, int numID ); /** * Destructor @@ -714,7 +714,7 @@ class KBgBoardBar : public KBgBoardCell /** * Get the double clicks */ - virtual void mouseDoubleClickEvent(QMouseEvent *e); + virtual void mouseDoubleClickEvent(TQMouseEvent *e); }; /** @@ -729,7 +729,7 @@ class KBgBoardField : public KBgBoardCell /** * Constructor and destructor */ - KBgBoardField( QWidget * parent, int numID); + KBgBoardField( TQWidget * parent, int numID); virtual ~KBgBoardField(); /** @@ -741,7 +741,7 @@ class KBgBoardField : public KBgBoardCell /** * Draws the content of the cell on the painter *p */ - virtual void paintCell(QPainter *p, int xo = 0, int yo = 0, + virtual void paintCell(TQPainter *p, int xo = 0, int yo = 0, double sf = 1.0) const; /** @@ -833,9 +833,9 @@ protected: /** * Spin boxes and buttons are children */ - QSpinBox *sb[2]; - QPushButton *ok; - QPushButton *cancel; + TQSpinBox *sb[2]; + TQPushButton *ok; + TQPushButton *cancel; public slots: @@ -866,9 +866,9 @@ protected: /** * Spin boxes and buttons are children */ - QComboBox *cb[2]; - QPushButton *ok; - QPushButton *cancel; + TQComboBox *cb[2]; + TQPushButton *ok; + TQPushButton *cancel; public slots: @@ -892,7 +892,7 @@ protected slots: /** * Extension of the KBgBoard class that can add itself - * to a QTabDialog for configuration. + * to a TQTabDialog for configuration. */ class KBgBoardSetup : public KBgBoard { @@ -903,8 +903,8 @@ public: /** * Constructor */ - KBgBoardSetup(QWidget *parent = 0, const char *name = 0, - QPopupMenu *menu = 0); + KBgBoardSetup(TQWidget *parent = 0, const char *name = 0, + TQPopupMenu *menu = 0); /** * Lets the board put its setup pages into the notebook nb @@ -952,16 +952,16 @@ private: */ KFontChooser *kf; - QRadioButton *rbMove[3]; + TQRadioButton *rbMove[3]; - QColor saveBackgroundColor; - QColor saveBaseColors[2]; + TQColor saveBackgroundColor; + TQColor saveBaseColors[2]; /** * Need these to change their colors */ - QPushButton *pbc_1, *pbc_2, *pbc_3; - QCheckBox *cbp; + TQPushButton *pbc_1, *pbc_2, *pbc_3; + TQCheckBox *cbp; }; #endif // KBGBOARD_H diff --git a/kbackgammon/kbgstatus.cpp b/kbackgammon/kbgstatus.cpp index 1215324e..4f5db3c0 100644 --- a/kbackgammon/kbgstatus.cpp +++ b/kbackgammon/kbgstatus.cpp @@ -29,7 +29,7 @@ /* * Parse a rawboard description from FIBS and initialize members. */ -KBgStatus::KBgStatus(const QString &rawboard) +KBgStatus::KBgStatus(const TQString &rawboard) { /* * This is the format string from hell... @@ -45,7 +45,7 @@ KBgStatus::KBgStatus(const QString &rawboard) char opponent[100], player[100]; - QString cap; + TQString cap; int board[26], ldice[2][2], maydouble[2], scratch[4], onhome[2], onbar[2]; int points[2]; @@ -117,7 +117,7 @@ KBgStatus::KBgStatus(const QString &rawboard) * and empty dice. */ KBgStatus::KBgStatus() - : QObject() + : TQObject() { /* * Initialize members @@ -131,7 +131,7 @@ KBgStatus::KBgStatus() setHome (i, 0); setBar (i, 0); setPoints(i, -1); - setPlayer(i, QString::null); + setPlayer(i, TQString::null); } setColor(White, US); setCube(1, BOTH); // also initializes maydouble @@ -147,7 +147,7 @@ KBgStatus::KBgStatus() * Copy constructor calls private utility function. */ KBgStatus::KBgStatus(const KBgStatus &rhs) - : QObject() + : TQObject() { copy(rhs); } @@ -244,9 +244,9 @@ int KBgStatus::points(const int& w) const return ((w == US || w == THEM) ? points_[w] : -1); } -QString KBgStatus::player(const int &w) const +TQString KBgStatus::player(const int &w) const { - return ((w == US || w == THEM) ? player_[w] : QString::null); + return ((w == US || w == THEM) ? player_[w] : TQString::null); } int KBgStatus::length() const @@ -343,7 +343,7 @@ void KBgStatus::setPoints(const int &w, const int &p) points_[w] = p; } -void KBgStatus::setPlayer(const int &w, const QString &name) +void KBgStatus::setPlayer(const int &w, const TQString &name) { if (w == US || w == THEM) player_[w] = name; diff --git a/kbackgammon/kbgstatus.h b/kbackgammon/kbgstatus.h index 5543e1ca..afcc2f6a 100644 --- a/kbackgammon/kbgstatus.h +++ b/kbackgammon/kbgstatus.h @@ -27,7 +27,7 @@ #include <config.h> #endif -#include <qobject.h> +#include <tqobject.h> /** @@ -70,7 +70,7 @@ class KBgStatus : public QObject /** * Constructor from a FIBS rawboard string */ - KBgStatus(const QString &rawboard); + KBgStatus(const TQString &rawboard); /** * Copy constructor @@ -156,10 +156,10 @@ class KBgStatus : public QObject /* * Return the name of player w. If w is out of bounds or if - * the player names have not been set, QString::null is + * the player names have not been set, TQString::null is * returned. */ - QString player(const int &w = US) const; + TQString player(const int &w = US) const; /* * Return the length of the game. Negative values should be used to @@ -260,7 +260,7 @@ class KBgStatus : public QObject * Set the name of player w to name. If w is out of bound, * nothing is done. */ - void setPlayer(const int &w, const QString &name); + void setPlayer(const int &w, const TQString &name); /* * Set the length of the game. Negative values should be used to @@ -298,7 +298,7 @@ class KBgStatus : public QObject /* * Private variables with self-expalanatory names. */ - QString player_[2]; + TQString player_[2]; int board_[26], home_[2], bar_[2], dice_[2][2], points_[2]; int color_, direction_, cube_, length_, turn_; diff --git a/kbackgammon/kbgtextview.cpp b/kbackgammon/kbgtextview.cpp index b99a2f27..a2199b05 100644 --- a/kbackgammon/kbgtextview.cpp +++ b/kbackgammon/kbgtextview.cpp @@ -26,7 +26,7 @@ #include <kconfig.h> #include <kcmenumngr.h> #include <kfontdialog.h> -#include <qfont.h> +#include <tqfont.h> #include <kapplication.h> #include <iostream> @@ -36,7 +36,7 @@ /* * Constructor */ -KBgTextView::KBgTextView(QWidget *parent, const char *name) +KBgTextView::KBgTextView(TQWidget *parent, const char *name) : KTextBrowser(parent, name) { clear(); @@ -55,7 +55,7 @@ KBgTextView::~KBgTextView() * Write the string l to the TextView and put the cursor at the end of * the current text */ -void KBgTextView::write(const QString &l) +void KBgTextView::write(const TQString &l) { append("<font face=\"" + font().family() + "\">" + l + "</font><br>\n"); scrollToBottom(); @@ -74,7 +74,7 @@ void KBgTextView::clear() */ void KBgTextView::selectFont() { - QFont f = font(); + TQFont f = font(); KFontDialog::getFont(f, false, this, true); setFont(f); } diff --git a/kbackgammon/kbgtextview.h b/kbackgammon/kbgtextview.h index 887136f4..8b8b8389 100644 --- a/kbackgammon/kbgtextview.h +++ b/kbackgammon/kbgtextview.h @@ -27,11 +27,11 @@ #endif #include <ktextbrowser.h> -#include <qstring.h> +#include <tqstring.h> /** - * A small extension to the QTextView control. + * A small extension to the TQTextView control. */ class KBgTextView : public KTextBrowser { @@ -42,7 +42,7 @@ public: /** * Constructor */ - KBgTextView(QWidget *parent = 0, const char *name = 0); + KBgTextView(TQWidget *parent = 0, const char *name = 0); /** * Destructor @@ -75,7 +75,7 @@ public slots: * Write the string at the end of the buffer and scroll to * the end */ - void write(const QString &); + void write(const TQString &); }; #endif // __KBGTEXTVIEW_H diff --git a/kbackgammon/main.cpp b/kbackgammon/main.cpp index fe20cc7c..5c942f70 100644 --- a/kbackgammon/main.cpp +++ b/kbackgammon/main.cpp @@ -20,7 +20,7 @@ */ #include <kapplication.h> -#include <qstring.h> +#include <tqstring.h> #include <klocale.h> #include <kaboutdata.h> #include <kcmdlineargs.h> diff --git a/kbattleship/kbattleship/kbaiplayer.cpp b/kbattleship/kbattleship/kbaiplayer.cpp index ca95c2da..3381c00c 100644 --- a/kbattleship/kbattleship/kbaiplayer.cpp +++ b/kbattleship/kbattleship/kbaiplayer.cpp @@ -45,9 +45,9 @@ void KBAIPlayer::init(KBattleField *battle_field, KShipList *ai_shiplist) if(m_battleField != 0) { - QRect rect = m_battleField->enemyRect(); + TQRect rect = m_battleField->enemyRect(); int grid = m_battleField->gridSize(); - m_fieldRect = QRect(0, 0, (rect.width() / grid), (rect.height() / grid)); + m_fieldRect = TQRect(0, 0, (rect.width() / grid), (rect.height() / grid)); } } @@ -92,7 +92,7 @@ bool KBAIPlayer::slotRequestShot() { if(m_masterStrategy != 0 && m_masterStrategy->hasMoreShots()) { - QPoint pos = m_masterStrategy->nextShot(); + TQPoint pos = m_masterStrategy->nextShot(); emit sigShootAt(pos); m_masterStrategy->shotAt(pos); return true; @@ -102,6 +102,6 @@ bool KBAIPlayer::slotRequestShot() bool KBAIPlayer::shipPlaced(int shiplen, int x, int y, bool vertical) { - QRect ship = vertical ? QRect(x, y, 1, shiplen) : QRect(x, y, shiplen, 1); + TQRect ship = vertical ? TQRect(x, y, 1, shiplen) : TQRect(x, y, shiplen, 1); return m_ownShipList->addNewShip(vertical, ship.x(), ship.y()); } diff --git a/kbattleship/kbattleship/kbaiplayer.h b/kbattleship/kbattleship/kbaiplayer.h index aebb149d..c5aa3a79 100644 --- a/kbattleship/kbattleship/kbaiplayer.h +++ b/kbattleship/kbattleship/kbaiplayer.h @@ -18,7 +18,7 @@ #ifndef KBAIPLAYER_H #define KBAIPLAYER_H -#include <qobject.h> +#include <tqobject.h> #include <krandomsequence.h> @@ -41,7 +41,7 @@ public slots: bool shipPlaced(int shiplen, int x, int y, bool vertical); signals: - void sigShootAt(const QPoint pos); + void sigShootAt(const TQPoint pos); void sigReady(); private: @@ -53,7 +53,7 @@ private: KBattleField *m_battleField; KRandomSequence *m_randomSeq; - QRect m_fieldRect; + TQRect m_fieldRect; }; #endif diff --git a/kbattleship/kbattleship/kbattlefield.cpp b/kbattleship/kbattleship/kbattlefield.cpp index 0467ae28..c4a9e422 100644 --- a/kbattleship/kbattleship/kbattlefield.cpp +++ b/kbattleship/kbattleship/kbattlefield.cpp @@ -20,7 +20,7 @@ #include "kbattlefield.h" -KBattleField::KBattleField(QWidget *parent, bool grid) : KGridWidget(parent, grid) +KBattleField::KBattleField(TQWidget *parent, bool grid) : KGridWidget(parent, grid) { m_parent = parent; m_width = parent->width(); @@ -222,12 +222,12 @@ int KBattleField::rectX() return 10; } -QRect KBattleField::ownRect() +TQRect KBattleField::ownRect() { - return QRect(ownXPosition(), ownYPosition(), m_ownfieldx * gridSize(), m_ownfieldy * gridSize()); + return TQRect(ownXPosition(), ownYPosition(), m_ownfieldx * gridSize(), m_ownfieldy * gridSize()); } -QRect KBattleField::enemyRect() +TQRect KBattleField::enemyRect() { - return QRect(enemyXPosition(), enemyYPosition(), m_enemyfieldx * gridSize(), m_enemyfieldy * gridSize()); + return TQRect(enemyXPosition(), enemyYPosition(), m_enemyfieldx * gridSize(), m_enemyfieldy * gridSize()); } diff --git a/kbattleship/kbattleship/kbattlefield.h b/kbattleship/kbattleship/kbattlefield.h index d1e62b3f..94bcf3f5 100644 --- a/kbattleship/kbattleship/kbattlefield.h +++ b/kbattleship/kbattleship/kbattlefield.h @@ -18,8 +18,8 @@ #ifndef KBATTLEFIELD_H #define KBATTLEFIELD_H -#include <qpainter.h> -#include <qwidget.h> +#include <tqpainter.h> +#include <tqwidget.h> #include "kgridwidget.h" @@ -27,7 +27,7 @@ class KBattleField : public KGridWidget { public: enum{FREE, WATER, HIT, DEATH, BORDER, SHIP1P1, SHIP2P1, SHIP2P2, SHIP3P1, SHIP3P2, SHIP3P3, SHIP4P1, SHIP4P2, SHIP4P3, SHIP4P4}; - KBattleField(QWidget *parent, bool grid); + KBattleField(TQWidget *parent, bool grid); void clearOwnField(); void clearEnemyField(); @@ -44,8 +44,8 @@ public: void setPreviewState(int fieldx, int fieldy, int type, bool rotate); - QRect ownRect(); - QRect enemyRect(); + TQRect ownRect(); + TQRect enemyRect(); int gridSize() { return 32; } @@ -76,7 +76,7 @@ private: bool m_canDraw; - QWidget *m_parent; + TQWidget *m_parent; }; #endif diff --git a/kbattleship/kbattleship/kbattleship.cpp b/kbattleship/kbattleship/kbattleship.cpp index b7d38891..32759e28 100644 --- a/kbattleship/kbattleship/kbattleship.cpp +++ b/kbattleship/kbattleship/kbattleship.cpp @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#include <qlayout.h> -#include <qtimer.h> +#include <tqlayout.h> +#include <tqtimer.h> #include <kgamemisc.h> #include <kinputdialog.h> @@ -92,16 +92,16 @@ void KBattleshipWindow::initStatusBar() void KBattleshipWindow::initActions() { - KStdAction::configureNotifications(this, SLOT(slotConfigureNotifications()), actionCollection()); - m_gameServerConnect = new KAction(i18n("&Connect to Server..."), "connect_no", Key_F2, this, SLOT(slotServerConnect()), actionCollection(), "game_serverconnect"); - m_gameNewServer = new KAction(i18n("&Start Server..."), "network", Key_F3, this, SLOT(slotNewServer()), actionCollection(), "game_newserver"); - m_gameSingle = new KAction(i18n("S&ingle Player..."), "gear", Key_F4, this, SLOT(slotSinglePlayer()), actionCollection(), "game_singleplayer"); - m_gameQuit = KStdGameAction::quit(this, SLOT(close()), actionCollection()); - KStdGameAction::highscores(this, SLOT(slotHighscore()), actionCollection()); - m_gameEnemyInfo = new KAction(i18n("&Enemy Info"), "view_text", Key_F11, this, SLOT(slotEnemyClientInfo()), actionCollection(), "game_enemyinfo"); + KStdAction::configureNotifications(this, TQT_SLOT(slotConfigureNotifications()), actionCollection()); + m_gameServerConnect = new KAction(i18n("&Connect to Server..."), "connect_no", Key_F2, this, TQT_SLOT(slotServerConnect()), actionCollection(), "game_serverconnect"); + m_gameNewServer = new KAction(i18n("&Start Server..."), "network", Key_F3, this, TQT_SLOT(slotNewServer()), actionCollection(), "game_newserver"); + m_gameSingle = new KAction(i18n("S&ingle Player..."), "gear", Key_F4, this, TQT_SLOT(slotSinglePlayer()), actionCollection(), "game_singleplayer"); + m_gameQuit = KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdGameAction::highscores(this, TQT_SLOT(slotHighscore()), actionCollection()); + m_gameEnemyInfo = new KAction(i18n("&Enemy Info"), "view_text", Key_F11, this, TQT_SLOT(slotEnemyClientInfo()), actionCollection(), "game_enemyinfo"); m_configSound = new KToggleAction(i18n("&Play Sounds"), 0, actionCollection(), "options_configure_sound"); - m_configGrid = new KToggleAction(i18n("&Show Grid"), 0, this, SLOT(slotShowGrid()), actionCollection(), "options_show_grid"); + m_configGrid = new KToggleAction(i18n("&Show Grid"), 0, this, TQT_SLOT(slotShowGrid()), actionCollection(), "options_show_grid"); m_configGrid->setCheckedState(i18n("Hide Grid")); m_gameEnemyInfo->setEnabled(false); @@ -111,9 +111,9 @@ void KBattleshipWindow::initActions() void KBattleshipWindow::initChat() { - connect(m_chat, SIGNAL(sigSendMessage(const QString &)), this, SLOT(slotSendChatMessage(const QString &))); - connect(m_chat, SIGNAL(sigChangeEnemyNickname(const QString &)), this, SLOT(slotChangeEnemyPlayer(const QString &))); - connect(m_chat, SIGNAL(sigChangeOwnNickname(const QString &)), this, SLOT(slotChangedNickCommand(const QString &))); + connect(m_chat, TQT_SIGNAL(sigSendMessage(const TQString &)), this, TQT_SLOT(slotSendChatMessage(const TQString &))); + connect(m_chat, TQT_SIGNAL(sigChangeEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + connect(m_chat, TQT_SIGNAL(sigChangeOwnNickname(const TQString &)), this, TQT_SLOT(slotChangedNickCommand(const TQString &))); } void KBattleshipWindow::changeShipPlacementDirection(){ @@ -122,16 +122,16 @@ void KBattleshipWindow::changeShipPlacementDirection(){ void KBattleshipWindow::initShipPlacing() { - connect(m_ownshiplist, SIGNAL(sigOwnFieldDataChanged(int, int, int)), this, SLOT(slotChangeOwnFieldData(int, int, int))); - connect(m_ownshiplist, SIGNAL(sigLastShipAdded()), this, SLOT(slotShipsReady())); + connect(m_ownshiplist, TQT_SIGNAL(sigOwnFieldDataChanged(int, int, int)), this, TQT_SLOT(slotChangeOwnFieldData(int, int, int))); + connect(m_ownshiplist, TQT_SIGNAL(sigLastShipAdded()), this, TQT_SLOT(slotShipsReady())); } void KBattleshipWindow::initView() { - QWidget *dummy = new QWidget(this, "dummy"); + TQWidget *dummy = new TQWidget(this, "dummy"); setCentralWidget(dummy); - QGridLayout *topLayout = new QGridLayout(dummy, 2, 2, 0, -1, "topLayout"); + TQGridLayout *topLayout = new TQGridLayout(dummy, 2, 2, 0, -1, "topLayout"); m_chat = new KChatWidget(dummy); m_view = new KBattleshipView(dummy, "", m_configGrid->isChecked()); @@ -148,10 +148,10 @@ void KBattleshipWindow::initView() m_view->startDrawing(); setFocusProxy(m_view); - connect(m_view, SIGNAL(sigEnemyFieldClicked(int, int)), this, SLOT(slotEnemyFieldClick(int, int))); - connect(m_view, SIGNAL(sigOwnFieldClicked(int, int)), this, SLOT(slotPlaceShip(int, int))); - connect(m_view, SIGNAL(sigMouseOverField(int, int)), this, SLOT(slotPlaceShipPreview(int, int))); - connect(m_view, SIGNAL(changeShipPlacementDirection()), this, SLOT(changeShipPlacementDirection())); + connect(m_view, TQT_SIGNAL(sigEnemyFieldClicked(int, int)), this, TQT_SLOT(slotEnemyFieldClick(int, int))); + connect(m_view, TQT_SIGNAL(sigOwnFieldClicked(int, int)), this, TQT_SLOT(slotPlaceShip(int, int))); + connect(m_view, TQT_SIGNAL(sigMouseOverField(int, int)), this, TQT_SLOT(slotPlaceShipPreview(int, int))); + connect(m_view, TQT_SIGNAL(changeShipPlacementDirection()), this, TQT_SLOT(changeShipPlacementDirection())); } void KBattleshipWindow::slotDeleteAI() @@ -186,8 +186,8 @@ void KBattleshipWindow::slotEnemyFieldClick(int fieldx, int fieldy) { slotStatusMsg(i18n("Sending Message...")); KMessage *msg = new KMessage(KMessage::SHOOT); - msg->addField("fieldx", QString::number(fieldx)); - msg->addField("fieldy", QString::number(fieldy)); + msg->addField("fieldx", TQString::number(fieldx)); + msg->addField("fieldy", TQString::number(fieldy)); slotSendMessage(msg); } @@ -213,7 +213,7 @@ void KBattleshipWindow::slotEnemyFieldClick(int fieldx, int fieldy) if(showstate == KBattleField::HIT) { KShip *ship = m_enemyshiplist->shipAt(fieldx, fieldy); - typedef QValueList<int> DeathValueList; + typedef TQValueList<int> DeathValueList; DeathValueList deathList; bool xokay = true, yokay = true; int tempy = 0, tempx = 0; @@ -314,14 +314,14 @@ void KBattleshipWindow::slotEnemyFieldClick(int fieldx, int fieldy) slotStatusMsg(i18n("You won the game :)")); m_stat->slotAddOwnWon(); slotUpdateHighscore(); - switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"),QString::null,i18n("Restart"),i18n("Do Not Restart"))) + switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"),TQString::null,i18n("Restart"),i18n("Do Not Restart"))) { case KMessageBox::Yes: - QTimer::singleShot(0, this, SLOT(slotRestartAI())); + TQTimer::singleShot(0, this, TQT_SLOT(slotRestartAI())); break; case KMessageBox::No: - QTimer::singleShot(0, this, SLOT(slotDeleteAI())); + TQTimer::singleShot(0, this, TQT_SLOT(slotDeleteAI())); break; } return; @@ -576,9 +576,9 @@ void KBattleshipWindow::slotSendMessage(int fieldx, int fieldy, int state) if(m_connection != 0) { KMessage *msg = new KMessage(KMessage::ANSWER_SHOOT); - msg->addField(QString("fieldx"), QString::number(fieldx)); - msg->addField(QString("fieldy"), QString::number(fieldy)); - msg->addField(QString("fieldstate"), QString::number(state)); + msg->addField(TQString("fieldx"), TQString::number(fieldx)); + msg->addField(TQString("fieldy"), TQString::number(fieldy)); + msg->addField(TQString("fieldstate"), TQString::number(state)); if(m_connection->type() == KonnectionHandling::SERVER) m_kbserver->sendMessage(msg); @@ -598,7 +598,7 @@ void KBattleshipWindow::slotSendMessage(KMessage *msg) } } -void KBattleshipWindow::slotSendChatMessage(const QString &text) +void KBattleshipWindow::slotSendChatMessage(const TQString &text) { if(m_connection != 0 && m_serverHasClient) { @@ -608,7 +608,7 @@ void KBattleshipWindow::slotSendChatMessage(const QString &text) } } -void KBattleshipWindow::slotChangedNickCommand(const QString &text) +void KBattleshipWindow::slotChangedNickCommand(const TQString &text) { m_ownNickname = text; slotChangeOwnPlayer(m_ownNickname); @@ -642,9 +642,9 @@ void KBattleshipWindow::slotUpdateHighscore() KScoreDialog::FieldInfo info; info[KScoreDialog::Name] = m_ownNickname; - info[KScoreDialog::Custom1] = QString::number(m_stat->shot()); - info[KScoreDialog::Custom2] = QString::number(m_stat->hit()); - info[KScoreDialog::Custom3] = QString::number(m_stat->water()); + info[KScoreDialog::Custom1] = TQString::number(m_stat->shot()); + info[KScoreDialog::Custom2] = TQString::number(m_stat->hit()); + info[KScoreDialog::Custom3] = TQString::number(m_stat->water()); scoreDialog->addScore((int)score, info, false, false); } @@ -697,8 +697,8 @@ void KBattleshipWindow::slotServerConnect() slotStatusMsg(i18n("Loading Connect-Server dialog...")); m_client = new KClientDialog(this); - connect(m_client, SIGNAL(sigConnectServer()), this, SLOT(slotConnectToBattleshipServer())); - connect(m_client, SIGNAL(sigCancelConnect()), this, SLOT(slotDeleteConnectDialog())); + connect(m_client, TQT_SIGNAL(sigConnectServer()), this, TQT_SLOT(slotConnectToBattleshipServer())); + connect(m_client, TQT_SIGNAL(sigCancelConnect()), this, TQT_SLOT(slotDeleteConnectDialog())); m_client->show(); slotStatusMsg(i18n("Ready")); @@ -715,7 +715,7 @@ void KBattleshipWindow::slotDeleteConnectDialog() void KBattleshipWindow::slotReplayRequest() { - switch(KMessageBox::questionYesNo(this, i18n("The client is asking to restart the game. Do you accept?"),QString::null,i18n("Accept Restart"), i18n("Deny Restart"))) + switch(KMessageBox::questionYesNo(this, i18n("The client is asking to restart the game. Do you accept?"),TQString::null,i18n("Accept Restart"), i18n("Deny Restart"))) { case KMessageBox::Yes: if (m_connection) @@ -735,7 +735,7 @@ void KBattleshipWindow::slotReplayRequest() void KBattleshipWindow::slotServerReplay() { KMessage *msg = new KMessage(KMessage::REPLAY); - switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"), QString::null, i18n("Restart"), i18n("Do Not Restart"))) + switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"), TQString::null, i18n("Restart"), i18n("Do Not Restart"))) { case KMessageBox::Yes: if (m_connection) @@ -761,7 +761,7 @@ void KBattleshipWindow::slotServerReplay() void KBattleshipWindow::slotClientReplay() { KMessage *msg = new KMessage(KMessage::REPLAY); - switch(KMessageBox::questionYesNo(this, i18n("Do you want to ask the server restarting the game?"), QString::null, i18n("Ask to Restart"), i18n("Do Not Ask"))) + switch(KMessageBox::questionYesNo(this, i18n("Do you want to ask the server restarting the game?"), TQString::null, i18n("Ask to Restart"), i18n("Do Not Ask"))) { case KMessageBox::Yes: if (m_connection) @@ -806,8 +806,8 @@ void KBattleshipWindow::slotNewServer() slotStatusMsg(i18n("Loading Start-Server dialog...")); m_server = new KServerDialog(this); - connect(m_server, SIGNAL(okClicked()), this, SLOT(slotStartBattleshipServer())); - connect(m_server, SIGNAL(cancelClicked()), this, SLOT(slotDeleteServerDialog())); + connect(m_server, TQT_SIGNAL(okClicked()), this, TQT_SLOT(slotStartBattleshipServer())); + connect(m_server, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(slotDeleteServerDialog())); m_server->show(); slotStatusMsg(i18n("Ready")); @@ -828,7 +828,7 @@ void KBattleshipWindow::slotSendVersion() msg->versionMessage(); slotSendMessage(msg); - QTimer::singleShot(150, this, SLOT(slotSendGreet())); + TQTimer::singleShot(150, this, TQT_SLOT(slotSendGreet())); } void KBattleshipWindow::slotSendGreet() @@ -837,7 +837,7 @@ void KBattleshipWindow::slotSendGreet() m_chat->slotAcceptMsg(true); KMessage *msg = new KMessage(KMessage::GREET); - msg->addField(QString("nickname"), m_ownNickname); + msg->addField(TQString("nickname"), m_ownNickname); slotSendMessage(msg); } @@ -862,49 +862,49 @@ void KBattleshipWindow::slotStartBattleshipServer() if(m_connection == 0) { m_connection = new KonnectionHandling(this, m_kbserver); - connect(m_connection, SIGNAL(sigStatusBar(const QString &)), this, SLOT(slotStatusMsg(const QString &))); - connect(m_connection, SIGNAL(sigEnemyNickname(const QString &)), this, SLOT(slotChangeEnemyPlayer(const QString &))); - connect(m_connection, SIGNAL(sigSendNickname()), this, SLOT(slotSendGreet())); - connect(m_connection, SIGNAL(sigPlaceShips(bool)), this, SLOT(slotSetPlaceable(bool))); - connect(m_connection, SIGNAL(sigShootable(bool)), this, SLOT(slotSetShootable(bool))); - connect(m_connection, SIGNAL(sigSendFieldState(int, int)), this, SLOT(slotSendEnemyFieldState(int, int))); - connect(m_connection, SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); - connect(m_connection, SIGNAL(sigClientLost()), this, SLOT(slotClientLost())); - connect(m_connection, SIGNAL(sigAbortNetworkGame()), this, SLOT(slotAbortNetworkGame())); - connect(m_connection, SIGNAL(sigReplay()), this, SLOT(slotReplayRequest())); - connect(m_connection, SIGNAL(sigChatMessage(const QString &, const QString &, bool)), m_chat, SLOT(slotReceivedMessage(const QString &, const QString &, bool))); - connect(m_connection, SIGNAL(sigClientInformation(const QString &, const QString &, const QString &, const QString &)), this, SLOT(slotReceivedClientInformation(const QString &, const QString &, const QString &, const QString &))); - connect(m_connection, SIGNAL(sigLost(KMessage *)), this, SLOT(slotLost(KMessage *))); + connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigSendNickname()), this, TQT_SLOT(slotSendGreet())); + connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool))); + connect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool))); + connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int))); + connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + connect(m_connection, TQT_SIGNAL(sigClientLost()), this, TQT_SLOT(slotClientLost())); + connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame())); + connect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplayRequest())); + connect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool))); + connect(m_connection, TQT_SIGNAL(sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)), this, TQT_SLOT(slotReceivedClientInformation(const TQString &, const TQString &, const TQString &, const TQString &))); + connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *))); } else { if(m_connection->type() == KonnectionHandling::CLIENT) { - disconnect(m_kbclient, SIGNAL(sigConnected()), this, SLOT(slotSendVersion())); - disconnect(m_connection, SIGNAL(sigAbortNetworkGame()), this, SLOT(slotAbortNetworkGame())); - disconnect(m_connection, SIGNAL(sigStatusBar(const QString &)), this, SLOT(slotStatusMsg(const QString &))); - disconnect(m_connection, SIGNAL(sigEnemyNickname(const QString &)), this, SLOT(slotChangeEnemyPlayer(const QString &))); - disconnect(m_connection, SIGNAL(sigSendFieldState(int, int)), this, SLOT(slotSendEnemyFieldState(int, int))); - disconnect(m_connection, SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); - disconnect(m_connection, SIGNAL(sigShootable(bool)), this, SLOT(slotSetShootable(bool))); - disconnect(m_connection, SIGNAL(sigPlaceShips(bool)), this, SLOT(slotSetPlaceable(bool))); - disconnect(m_connection, SIGNAL(sigServerLost()), this, SLOT(slotServerLost())); - disconnect(m_connection, SIGNAL(sigReplay()), this, SLOT(slotReplay())); - disconnect(m_connection, SIGNAL(sigChatMessage(const QString &, const QString &, bool)), m_chat, SLOT(slotReceivedMessage(const QString &, const QString &, bool))); - disconnect(m_connection, SIGNAL(sigLost(KMessage *)), this, SLOT(slotLost(KMessage *))); + disconnect(m_kbclient, TQT_SIGNAL(sigConnected()), this, TQT_SLOT(slotSendVersion())); + disconnect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame())); + disconnect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &))); + disconnect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + disconnect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int))); + disconnect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + disconnect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool))); + disconnect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool))); + disconnect(m_connection, TQT_SIGNAL(sigServerLost()), this, TQT_SLOT(slotServerLost())); + disconnect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplay())); + disconnect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool))); + disconnect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *))); m_connection->updateInternal(m_kbserver); - connect(m_connection, SIGNAL(sigStatusBar(const QString &)), this, SLOT(slotStatusMsg(const QString &))); - connect(m_connection, SIGNAL(sigEnemyNickname(const QString &)), this, SLOT(slotChangeEnemyPlayer(const QString &))); - connect(m_connection, SIGNAL(sigSendNickname()), this, SLOT(slotSendGreet())); - connect(m_connection, SIGNAL(sigPlaceShips(bool)), this, SLOT(slotSetPlaceable(bool))); - connect(m_connection, SIGNAL(sigShootable(bool)), this, SLOT(slotSetShootable(bool))); - connect(m_connection, SIGNAL(sigSendFieldState(int, int)), this, SLOT(slotSendEnemyFieldState(int, int))); - connect(m_connection, SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); - connect(m_connection, SIGNAL(sigClientLost()), this, SLOT(slotClientLost())); - connect(m_connection, SIGNAL(sigAbortNetworkGame()), this, SLOT(slotAbortNetworkGame())); - connect(m_connection, SIGNAL(sigReplay()), this, SLOT(slotReplayRequest())); - connect(m_connection, SIGNAL(sigChatMessage(const QString &, const QString &, bool)), m_chat, SLOT(slotReceivedMessage(const QString &, const QString &, bool))); - connect(m_connection, SIGNAL(sigLost(KMessage *)), this, SLOT(slotLost(KMessage *))); + connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigSendNickname()), this, TQT_SLOT(slotSendGreet())); + connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool))); + connect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool))); + connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int))); + connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + connect(m_connection, TQT_SIGNAL(sigClientLost()), this, TQT_SLOT(slotClientLost())); + connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame())); + connect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplayRequest())); + connect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool))); + connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *))); } else m_connection->updateInternal(m_kbserver); @@ -923,7 +923,7 @@ void KBattleshipWindow::slotSendEnemyFieldState(int fieldx, int fieldy) { int data, showstate; bool xokay = false, yokay = false, is_kill = false; - typedef QValueList<int> DeathValueList; + typedef TQValueList<int> DeathValueList; DeathValueList deathList; data = m_ownshiplist->shipTypeAt(fieldx, fieldy); @@ -982,46 +982,46 @@ void KBattleshipWindow::slotSendEnemyFieldState(int fieldx, int fieldy) } else if(m_ownshiplist->shipTypeAt(fieldx, fieldy) == 0) { - msg->addField(QString("xstart"), QString::number(fieldx)); - msg->addField(QString("xstop"), QString::number(fieldx)); - msg->addField(QString("ystart"), QString::number(fieldy)); - msg->addField(QString("ystop"), QString::number(fieldy)); - msg->addField(QString("death"), QString("true")); + msg->addField(TQString("xstart"), TQString::number(fieldx)); + msg->addField(TQString("xstop"), TQString::number(fieldx)); + msg->addField(TQString("ystart"), TQString::number(fieldy)); + msg->addField(TQString("ystop"), TQString::number(fieldy)); + msg->addField(TQString("death"), TQString("true")); is_kill = true; } } - msg->addField(QString("fieldx"), QString::number(fieldx)); - msg->addField(QString("fieldy"), QString::number(fieldy)); + msg->addField(TQString("fieldx"), TQString::number(fieldx)); + msg->addField(TQString("fieldy"), TQString::number(fieldy)); if(xokay) { - msg->addField(QString("xstart"), QString::number(deathList.first())); - msg->addField(QString("xstop"), QString::number(deathList.last())); - msg->addField(QString("ystart"), QString::number(fieldy)); - msg->addField(QString("ystop"), QString::number(fieldy)); - msg->addField(QString("death"), QString("true")); + msg->addField(TQString("xstart"), TQString::number(deathList.first())); + msg->addField(TQString("xstop"), TQString::number(deathList.last())); + msg->addField(TQString("ystart"), TQString::number(fieldy)); + msg->addField(TQString("ystop"), TQString::number(fieldy)); + msg->addField(TQString("death"), TQString("true")); is_kill = true; } else if(yokay) { - msg->addField(QString("xstart"), QString::number(fieldx)); - msg->addField(QString("xstop"), QString::number(fieldx)); - msg->addField(QString("ystart"), QString::number(deathList.first())); - msg->addField(QString("ystop"), QString::number(deathList.last())); - msg->addField(QString("death"), QString("true")); + msg->addField(TQString("xstart"), TQString::number(fieldx)); + msg->addField(TQString("xstop"), TQString::number(fieldx)); + msg->addField(TQString("ystart"), TQString::number(deathList.first())); + msg->addField(TQString("ystop"), TQString::number(deathList.last())); + msg->addField(TQString("death"), TQString("true")); is_kill = true; } if(is_kill) // If sunk, reveal ship type - msg->addField(QString("fieldstate"), QString::number(data)); + msg->addField(TQString("fieldstate"), TQString::number(data)); else if(showstate == KBattleField::HIT) // On non-fatal hit, keep ship type secret - msg->addField(QString("fieldstate"), QString::number(1)); + msg->addField(TQString("fieldstate"), TQString::number(1)); else /* showstate == KBattleField::WATER */ // Miss - msg->addField(QString("fieldstate"), QString::number(99)); + msg->addField(TQString("fieldstate"), TQString::number(99)); if(m_connection->type() == KonnectionHandling::SERVER) m_kbserver->sendMessage(msg); @@ -1094,14 +1094,14 @@ void KBattleshipWindow::parseCommandLine() { void KBattleshipWindow::slotConnectToBattleshipServer() { - QString host = m_client->host(); + TQString host = m_client->host(); int port = m_client->port().toInt(); - QString nickname = m_client->nickname(); + TQString nickname = m_client->nickname(); delete m_client; m_client = 0; slotConnectToBattleshipServer(host, port, nickname); } -void KBattleshipWindow::slotConnectToBattleshipServer(const QString &host, int port, const QString &nickname) +void KBattleshipWindow::slotConnectToBattleshipServer(const TQString &host, int port, const TQString &nickname) { m_kbclient = new KBattleshipClient(host, port); nickname.isEmpty() ? m_ownNickname = "TestUser" : m_ownNickname = nickname; @@ -1119,51 +1119,51 @@ void KBattleshipWindow::slotConnectToBattleshipServer(const QString &host, int p if(m_connection == 0) { m_connection = new KonnectionHandling(this, m_kbclient); - connect(m_kbclient, SIGNAL(sigConnected()), this, SLOT(slotSendVersion())); - connect(m_connection, SIGNAL(sigAbortNetworkGame()), this, SLOT(slotAbortNetworkGame())); - connect(m_connection, SIGNAL(sigStatusBar(const QString &)), this, SLOT(slotStatusMsg(const QString &))); - connect(m_connection, SIGNAL(sigEnemyNickname(const QString &)), this, SLOT(slotChangeEnemyPlayer(const QString &))); - connect(m_connection, SIGNAL(sigSendFieldState(int, int)), this, SLOT(slotSendEnemyFieldState(int, int))); - connect(m_connection, SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); - connect(m_connection, SIGNAL(sigShootable(bool)), this, SLOT(slotSetShootable(bool))); - connect(m_connection, SIGNAL(sigPlaceShips(bool)), this, SLOT(slotSetPlaceable(bool))); - connect(m_connection, SIGNAL(sigServerLost()), this, SLOT(slotServerLost())); - connect(m_connection, SIGNAL(sigReplay()), this, SLOT(slotReplay())); - connect(m_connection, SIGNAL(sigChatMessage(const QString &, const QString &, bool)), m_chat, SLOT(slotReceivedMessage(const QString &, const QString &, bool))); - connect(m_connection, SIGNAL(sigClientInformation(const QString &, const QString &, const QString &, const QString &)), this, SLOT(slotReceivedClientInformation(const QString &, const QString &, const QString &, const QString &))); - connect(m_connection, SIGNAL(sigLost(KMessage *)), this, SLOT(slotLost(KMessage *))); + connect(m_kbclient, TQT_SIGNAL(sigConnected()), this, TQT_SLOT(slotSendVersion())); + connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame())); + connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int))); + connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + connect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool))); + connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool))); + connect(m_connection, TQT_SIGNAL(sigServerLost()), this, TQT_SLOT(slotServerLost())); + connect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplay())); + connect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool))); + connect(m_connection, TQT_SIGNAL(sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)), this, TQT_SLOT(slotReceivedClientInformation(const TQString &, const TQString &, const TQString &, const TQString &))); + connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *))); } else { if(m_connection->type() == KonnectionHandling::SERVER) { - disconnect(m_connection, SIGNAL(sigStatusBar(const QString &)), this, SLOT(slotStatusMsg(const QString &))); - disconnect(m_connection, SIGNAL(sigEnemyNickname(const QString &)), this, SLOT(slotChangeEnemyPlayer(const QString &))); - disconnect(m_connection, SIGNAL(sigSendNickname()), this, SLOT(slotSendGreet())); - disconnect(m_connection, SIGNAL(sigPlaceShips(bool)), this, SLOT(slotSetPlaceable(bool))); - disconnect(m_connection, SIGNAL(sigShootable(bool)), this, SLOT(slotSetShootable(bool))); - disconnect(m_connection, SIGNAL(sigSendFieldState(int, int)), this, SLOT(slotSendEnemyFieldState(int, int))); - disconnect(m_connection, SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); - disconnect(m_connection, SIGNAL(sigClientLost()), this, SLOT(slotClientLost())); - disconnect(m_connection, SIGNAL(sigAbortNetworkGame()), this, SLOT(slotAbortNetworkGame())); - disconnect(m_connection, SIGNAL(sigReplay()), this, SLOT(slotReplayRequest())); - disconnect(m_connection, SIGNAL(sigChatMessage(const QString &, const QString &, bool)), m_chat, SLOT(slotReceivedMessage(const QString &, const QString &, bool))); - disconnect(m_connection, SIGNAL(sigLost(KMessage *)), this, SLOT(slotLost(KMessage *))); + disconnect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &))); + disconnect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + disconnect(m_connection, TQT_SIGNAL(sigSendNickname()), this, TQT_SLOT(slotSendGreet())); + disconnect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool))); + disconnect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool))); + disconnect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int))); + disconnect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + disconnect(m_connection, TQT_SIGNAL(sigClientLost()), this, TQT_SLOT(slotClientLost())); + disconnect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame())); + disconnect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplayRequest())); + disconnect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool))); + disconnect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *))); m_connection->updateInternal(m_kbclient); - connect(m_kbclient, SIGNAL(sigConnected()), this, SLOT(slotSendVersion())); - connect(m_connection, SIGNAL(sigAbortNetworkGame()), this, SLOT(slotAbortNetworkGame())); - connect(m_connection, SIGNAL(sigStatusBar(const QString &)), this, SLOT(slotStatusMsg(const QString &))); - connect(m_connection, SIGNAL(sigEnemyNickname(const QString &)), this, SLOT(slotChangeEnemyPlayer(const QString &))); - connect(m_connection, SIGNAL(sigSendFieldState(int, int)), this, SLOT(slotSendEnemyFieldState(int, int))); - connect(m_connection, SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); - connect(m_connection, SIGNAL(sigShootable(bool)), this, SLOT(slotSetShootable(bool))); - connect(m_connection, SIGNAL(sigPlaceShips(bool)), this, SLOT(slotSetPlaceable(bool))); - connect(m_connection, SIGNAL(sigServerLost()), this, SLOT(slotServerLost())); - connect(m_connection, SIGNAL(sigReplay()), this, SLOT(slotReplay())); - connect(m_connection, SIGNAL(sigChatMessage(const QString &, const QString &, bool)), m_chat, SLOT(slotReceivedMessage(const QString &, const QString &, bool))); + connect(m_kbclient, TQT_SIGNAL(sigConnected()), this, TQT_SLOT(slotSendVersion())); + connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame())); + connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int))); + connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + connect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool))); + connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool))); + connect(m_connection, TQT_SIGNAL(sigServerLost()), this, TQT_SLOT(slotServerLost())); + connect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplay())); + connect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool))); m_kbclient->init(); - connect(m_connection, SIGNAL(sigClientInformation(const QString &, const QString &, const QString &, const QString &)), this, SLOT(slotReceivedClientInformation(const QString &, const QString &, const QString &, const QString &))); - connect(m_connection, SIGNAL(sigLost(KMessage *)), this, SLOT(slotLost(KMessage *))); + connect(m_connection, TQT_SIGNAL(sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)), this, TQT_SLOT(slotReceivedClientInformation(const TQString &, const TQString &, const TQString &, const TQString &))); + connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *))); } else m_connection->updateInternal(m_kbclient); @@ -1189,19 +1189,19 @@ void KBattleshipWindow::slotShowGrid() m_view->field()->enableGrid(); } -void KBattleshipWindow::slotStatusMsg(const QString &text) +void KBattleshipWindow::slotStatusMsg(const TQString &text) { statusBar()->clear(); statusBar()->changeItem(text, ID_STATUS_MSG); } -void KBattleshipWindow::slotChangeOwnPlayer(const QString &text) +void KBattleshipWindow::slotChangeOwnPlayer(const TQString &text) { statusBar()->clear(); statusBar()->changeItem(i18n(" Player 1: %1 ").arg(text), ID_PLAYER_OWN); } -void KBattleshipWindow::slotChangeEnemyPlayer(const QString &text) +void KBattleshipWindow::slotChangeEnemyPlayer(const TQString &text) { statusBar()->clear(); statusBar()->changeItem(i18n(" Player 2: %1 ").arg(text), ID_PLAYER_ENEMY); @@ -1234,7 +1234,7 @@ void KBattleshipWindow::slotSinglePlayer() slotStatusMsg(i18n("Ready")); m_stat->clear(); m_chat->clear(); - QTimer::singleShot(0, this, SLOT(slotDeleteAI())); + TQTimer::singleShot(0, this, TQT_SLOT(slotDeleteAI())); cleanup(false); } } @@ -1269,8 +1269,8 @@ void KBattleshipWindow::slotStartBattleshipGame(bool clearstat) { m_aiPlayer = new KBAIPlayer(); m_aiPlayer->init(m_view->field(), m_enemyshiplist); - connect(m_aiPlayer, SIGNAL(sigReady()), this, SLOT(slotAIReady())); - connect(m_aiPlayer, SIGNAL(sigShootAt(const QPoint)), this, SLOT(slotAIShootsAt(const QPoint))); + connect(m_aiPlayer, TQT_SIGNAL(sigReady()), this, TQT_SLOT(slotAIReady())); + connect(m_aiPlayer, TQT_SIGNAL(sigShootAt(const TQPoint)), this, TQT_SLOT(slotAIShootsAt(const TQPoint))); } m_aiPlayer->slotRestart(); } @@ -1281,7 +1281,7 @@ void KBattleshipWindow::slotAIReady() m_placeable = true; } -void KBattleshipWindow::slotAIShootsAt(const QPoint pos) +void KBattleshipWindow::slotAIShootsAt(const TQPoint pos) { if(!m_shootable) m_shootable = true; @@ -1317,14 +1317,14 @@ void KBattleshipWindow::slotAIShootsAt(const QPoint pos) m_stat->slotAddEnemyWon(); slotUpdateHighscore(); m_view->drawEnemyShipsAI(m_enemyshiplist); // let's show ai player ships - switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"), QString::null, i18n("Restart"), i18n("Do Not Restart"))) + switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"), TQString::null, i18n("Restart"), i18n("Do Not Restart"))) { case KMessageBox::Yes: - QTimer::singleShot(0, this, SLOT(slotRestartAI())); + TQTimer::singleShot(0, this, TQT_SLOT(slotRestartAI())); break; case KMessageBox::No: - QTimer::singleShot(0, this, SLOT(slotDeleteAI())); + TQTimer::singleShot(0, this, TQT_SLOT(slotDeleteAI())); break; } } @@ -1335,7 +1335,7 @@ void KBattleshipWindow::slotAIShootsAt(const QPoint pos) } } -void KBattleshipWindow::slotReceivedClientInformation(const QString &clientName, const QString &clientVersion, const QString &clientDescription, const QString &protocolVersion) +void KBattleshipWindow::slotReceivedClientInformation(const TQString &clientName, const TQString &clientVersion, const TQString &clientDescription, const TQString &protocolVersion) { m_enemyClient = clientName; m_enemyClientVersion = clientVersion; diff --git a/kbattleship/kbattleship/kbattleship.h b/kbattleship/kbattleship/kbattleship.h index 7e606140..9ba86eac 100644 --- a/kbattleship/kbattleship/kbattleship.h +++ b/kbattleship/kbattleship/kbattleship.h @@ -28,7 +28,7 @@ #include <kmessagebox.h> #include <kstdaction.h> -#include <qstring.h> +#include <tqstring.h> #include "dialogs/infoDlg.h" @@ -61,11 +61,11 @@ private slots: void changeShipPlacementDirection(); void slotConfigureNotifications(); void slotLost(KMessage *msg); - void slotStatusMsg(const QString &text); + void slotStatusMsg(const TQString &text); void slotReceivedEnemyFieldData(int fieldx, int fieldx1, int enemystate, int xstart, int xstop, int ystart, int ystop, bool death); void slotSendEnemyFieldState(int, int); - void slotChangeOwnPlayer(const QString &text); - void slotChangeEnemyPlayer(const QString &text); + void slotChangeOwnPlayer(const TQString &text); + void slotChangeEnemyPlayer(const TQString &text); void slotSendVersion(); void slotSendGreet(); void slotShipsReady(); @@ -79,7 +79,7 @@ private slots: void slotServerReplay(); void slotClientReplay(); void slotAIReady(); - void slotAIShootsAt(const QPoint pos); + void slotAIShootsAt(const TQPoint pos); void slotDeleteAI(); void slotRestartAI(); void slotSinglePlayer(); @@ -96,7 +96,7 @@ private slots: * Get server to connect to from "Connect to server" dialog. */ void slotConnectToBattleshipServer(); - void slotConnectToBattleshipServer(const QString &host, int port, const QString &nickname); + void slotConnectToBattleshipServer(const TQString &host, int port, const TQString &nickname); void slotPlaceShipPreview(int fieldx, int fieldy); void slotPlaceShip(int fieldx, int fieldy); void slotChangeOwnFieldData(int fieldx, int fieldy, int type); @@ -105,10 +105,10 @@ private slots: void slotAbortNetworkGame(); void slotReplay(); void slotReplayRequest(); - void slotChangedNickCommand(const QString &text); - void slotSendChatMessage(const QString &text); + void slotChangedNickCommand(const TQString &text); + void slotSendChatMessage(const TQString &text); void slotEnemyClientInfo(); - void slotReceivedClientInformation(const QString &client, const QString &clientVersion, const QString &clientInformation, const QString &protocolVersion); + void slotReceivedClientInformation(const TQString &client, const TQString &clientVersion, const TQString &clientInformation, const TQString &protocolVersion); private: bool shift; @@ -131,10 +131,10 @@ private: bool m_lost; int m_aiHits; - QString m_enemyClient; - QString m_enemyClientVersion; - QString m_enemyClientDescription; - QString m_enemyProtocolVersion; + TQString m_enemyClient; + TQString m_enemyClientVersion; + TQString m_enemyClientDescription; + TQString m_enemyProtocolVersion; KConfig *m_config; KBAIPlayer *m_aiPlayer; @@ -155,8 +155,8 @@ private: KServerDialog *m_server; KShipList *m_ownshiplist; KShipList *m_enemyshiplist; - QString m_ownNickname; - QString m_enemyNickname; + TQString m_ownNickname; + TQString m_enemyNickname; }; #endif diff --git a/kbattleship/kbattleship/kbattleshipclient.cpp b/kbattleship/kbattleship/kbattleshipclient.cpp index d8ae2a75..e7d61638 100644 --- a/kbattleship/kbattleship/kbattleshipclient.cpp +++ b/kbattleship/kbattleship/kbattleshipclient.cpp @@ -27,11 +27,11 @@ #include <sys/filio.h> #endif #include <sys/ioctl.h> -#include <qsocketnotifier.h> +#include <tqsocketnotifier.h> #include "kmessage.h" #include "kbattleshipclient.moc" -KBattleshipClient::KBattleshipClient(const QString &host, int port) : KExtendedSocket(host, port, inetSocket) +KBattleshipClient::KBattleshipClient(const TQString &host, int port) : KExtendedSocket(host, port, inetSocket) { } @@ -43,14 +43,14 @@ void KBattleshipClient::init() return; } - m_readNotifier = new QSocketNotifier(fd(), QSocketNotifier::Read, this); - QObject::connect(m_readNotifier, SIGNAL(activated(int)), SLOT(slotReadData())); + m_readNotifier = new TQSocketNotifier(fd(), TQSocketNotifier::Read, this); + TQObject::connect(m_readNotifier, TQT_SIGNAL(activated(int)), TQT_SLOT(slotReadData())); emit sigConnected(); } void KBattleshipClient::sendMessage(KMessage *msg) { - QCString post = msg->sendStream().utf8(); + TQCString post = msg->sendStream().utf8(); writeBlock(post.data(), post.length()); emit sigMessageSent(msg); } @@ -70,7 +70,7 @@ void KBattleshipClient::slotReadData() char *buf = new char[len + 1]; readBlock(buf, len); buf[len] = 0; - m_readBuffer += QString::fromUtf8(buf); + m_readBuffer += TQString::fromUtf8(buf); delete []buf; int pos; while ((pos = m_readBuffer.find("</kmessage>")) >= 0) diff --git a/kbattleship/kbattleship/kbattleshipclient.h b/kbattleship/kbattleship/kbattleshipclient.h index d69ec7f9..1f6bdd96 100644 --- a/kbattleship/kbattleship/kbattleshipclient.h +++ b/kbattleship/kbattleship/kbattleshipclient.h @@ -19,14 +19,14 @@ #define KBATTLESHIPCLIENT_H #include <kextsock.h> -#include <qsocketnotifier.h> +#include <tqsocketnotifier.h> #include "kmessage.h" class KBattleshipClient : public KExtendedSocket { Q_OBJECT public: - KBattleshipClient(const QString &host, int port); + KBattleshipClient(const TQString &host, int port); void init(); void sendMessage(KMessage *msg); @@ -42,8 +42,8 @@ signals: void sigMessageSent(KMessage *); private: - QSocketNotifier *m_readNotifier; - QString m_readBuffer; + TQSocketNotifier *m_readNotifier; + TQString m_readBuffer; }; #endif diff --git a/kbattleship/kbattleship/kbattleshipserver.cpp b/kbattleship/kbattleship/kbattleshipserver.cpp index d03bd213..a90533cc 100644 --- a/kbattleship/kbattleship/kbattleshipserver.cpp +++ b/kbattleship/kbattleship/kbattleshipserver.cpp @@ -25,13 +25,13 @@ #include <sys/filio.h> #endif #include <sys/ioctl.h> -#include <qtimer.h> +#include <tqtimer.h> #include <kmessagebox.h> #include <klocale.h> #include "kbattleshipserver.moc" -KBattleshipServer::KBattleshipServer(int port, const QString& name) - : KExtendedSocket(QString::null, port, inetSocket | passiveSocket), m_name(name) +KBattleshipServer::KBattleshipServer(int port, const TQString& name) + : KExtendedSocket(TQString::null, port, inetSocket | passiveSocket), m_name(name) { m_port = port; m_serverSocket = 0; @@ -49,8 +49,8 @@ void KBattleshipServer::init() m_service.setType(BATTLESHIP_SERVICE); m_service.setPort(m_port); m_service.publishAsync(); - m_connectNotifier = new QSocketNotifier(fd(), QSocketNotifier::Read, this); - QObject::connect(m_connectNotifier, SIGNAL(activated(int)), SLOT(slotNewConnection())); + m_connectNotifier = new TQSocketNotifier(fd(), TQSocketNotifier::Read, this); + TQObject::connect(m_connectNotifier, TQT_SIGNAL(activated(int)), TQT_SLOT(slotNewConnection())); } void KBattleshipServer::slotNewConnection() @@ -61,8 +61,8 @@ void KBattleshipServer::slotNewConnection() { m_service.stop(); m_serverSocket = sock; - m_readNotifier = new QSocketNotifier(sock->fd(), QSocketNotifier::Read, this); - QObject::connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(slotReadClient())); + m_readNotifier = new TQSocketNotifier(sock->fd(), TQSocketNotifier::Read, this); + TQObject::connect(m_readNotifier, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotReadClient())); emit sigNewConnect(); } else @@ -82,7 +82,7 @@ void KBattleshipServer::slotReadClient() char *buf = new char[len + 1]; m_serverSocket->readBlock(buf, len); buf[len] = 0; - m_readBuffer += QString::fromUtf8(buf); + m_readBuffer += TQString::fromUtf8(buf); delete []buf; int pos; while ((pos = m_readBuffer.find("</kmessage>")) >= 0) @@ -97,12 +97,12 @@ void KBattleshipServer::slotReadClient() void KBattleshipServer::sendMessage(KMessage *msg) { - QCString post = msg->sendStream().utf8(); + TQCString post = msg->sendStream().utf8(); m_serverSocket->writeBlock(post.data(), post.length()); emit sigMessageSent(msg); } -void KBattleshipServer::slotDiscardClient(const QString &reason, bool kmversion, bool bemit) +void KBattleshipServer::slotDiscardClient(const TQString &reason, bool kmversion, bool bemit) { KMessage *msg = new KMessage(KMessage::DISCARD); msg->addField("reason", reason); @@ -110,7 +110,7 @@ void KBattleshipServer::slotDiscardClient(const QString &reason, bool kmversion, msg->addField("kmversion", "true"); else msg->addField("kmversion", "false"); - QCString post = msg->sendStream().utf8(); + TQCString post = msg->sendStream().utf8(); m_serverSocket->writeBlock(post.data(), post.length()); delete msg; diff --git a/kbattleship/kbattleship/kbattleshipserver.h b/kbattleship/kbattleship/kbattleshipserver.h index 46f815e0..bb198db8 100644 --- a/kbattleship/kbattleship/kbattleshipserver.h +++ b/kbattleship/kbattleship/kbattleshipserver.h @@ -19,7 +19,7 @@ #define KBATTLESHIPSERVER_H #include <kextsock.h> -#include <qsocketnotifier.h> +#include <tqsocketnotifier.h> #include <dnssd/publicservice.h> #include "kmessage.h" @@ -27,12 +27,12 @@ class KBattleshipServer : public KExtendedSocket { Q_OBJECT public: - KBattleshipServer(int port, const QString& name); + KBattleshipServer(int port, const TQString& name); void init(); void sendMessage(KMessage *msg); public slots: - void slotDiscardClient(const QString &reason, bool kmversion, bool bemit); + void slotDiscardClient(const TQString &reason, bool kmversion, bool bemit); private slots: void slotNewConnection(); @@ -46,13 +46,13 @@ signals: void sigMessageSent(KMessage *); private: - QSocketNotifier *m_connectNotifier; - QSocketNotifier *m_readNotifier; + TQSocketNotifier *m_connectNotifier; + TQSocketNotifier *m_readNotifier; KExtendedSocket *m_serverSocket; - QString m_readBuffer; + TQString m_readBuffer; DNSSD::PublicService m_service; int m_port; - QString m_name; + TQString m_name; }; #define BATTLESHIP_SERVICE "_kbattleship._tcp" diff --git a/kbattleship/kbattleship/kbattleshipview.cpp b/kbattleship/kbattleship/kbattleshipview.cpp index 86e8cbf6..14339d78 100644 --- a/kbattleship/kbattleship/kbattleshipview.cpp +++ b/kbattleship/kbattleship/kbattleshipview.cpp @@ -15,15 +15,15 @@ * * ***************************************************************************/ -#include <qlayout.h> +#include <tqlayout.h> #include <klocale.h> #include <kdebug.h> #include "kbattleship.h" #include "kbattleshipview.moc" -KBattleshipView::KBattleshipView(QWidget *parent, const char *name, bool draw) - : QWidget(parent, name, WResizeNoErase), m_drawGrid(draw) +KBattleshipView::KBattleshipView(TQWidget *parent, const char *name, bool draw) + : TQWidget(parent, name, WResizeNoErase), m_drawGrid(draw) { setFixedSize(20 * 32 + 30, 10 * 32 + 20); setBackgroundMode(NoBackground); @@ -106,11 +106,11 @@ void KBattleshipView::drawEnemyShipsHuman(KMessage *msg, KShipList *list) int posx, posy, placedLeft; bool left; int i = 3; - while (!msg->field(QString("ship%1").arg(i)).isNull()) + while (!msg->field(TQString("ship%1").arg(i)).isNull()) { - posx = msg->field(QString("ship%1").arg(i)).section(" ", 0, 0).toInt(); - posy = msg->field(QString("ship%1").arg(i)).section(" ", 1, 1).toInt(); - placedLeft = msg->field(QString("ship%1").arg(i)).section(" ", 2, 2).toInt(); + posx = msg->field(TQString("ship%1").arg(i)).section(" ", 0, 0).toInt(); + posy = msg->field(TQString("ship%1").arg(i)).section(" ", 1, 1).toInt(); + placedLeft = msg->field(TQString("ship%1").arg(i)).section(" ", 2, 2).toInt(); if (placedLeft == 0) left = false; else left = true; list->addNewShip(!left, posx, posy); @@ -122,7 +122,7 @@ void KBattleshipView::drawEnemyShipsHuman(KMessage *msg, KShipList *list) KMessage *KBattleshipView::getAliveShips(KShipList *list) { KShip *ship; - QString shipPos, shipNum; + TQString shipPos, shipNum; int shipType; int grid = m_battlefield->gridSize(); int width = m_battlefield->enemyRect().width() / grid; @@ -148,29 +148,29 @@ KMessage *KBattleshipView::getAliveShips(KShipList *list) return msg; } -bool KBattleshipView::eventFilter(QObject *object, QEvent *event) +bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) { - if(event->type() == QEvent::KeyPress && m_decide) + if(event->type() == TQEvent::KeyPress && m_decide) { - QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); + TQKeyEvent *keyEvent = static_cast<TQKeyEvent *>(event); if(keyEvent->key() == Key_Shift){ emit sigMouseOverField(m_lastX, m_lastY); emit changeShipPlacementDirection(); } } - else if(event->type() == QEvent::KeyRelease && m_decide) + else if(event->type() == TQEvent::KeyRelease && m_decide) { - QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); + TQKeyEvent *keyEvent = static_cast<TQKeyEvent *>(event); if(keyEvent->key() == Key_Shift){ emit sigMouseOverField(m_lastX, m_lastY); emit changeShipPlacementDirection(); } } - else if(event->type() == QEvent::MouseButtonRelease) + else if(event->type() == TQEvent::MouseButtonRelease) { m_decide = false; - QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event); + TQMouseEvent *mouseEvent = static_cast<TQMouseEvent *>(event); if(mouseEvent->button() == RightButton){ emit sigMouseOverField(m_lastX, m_lastY); @@ -181,11 +181,11 @@ bool KBattleshipView::eventFilter(QObject *object, QEvent *event) if(mouseEvent->button() != LeftButton) return false; - QPoint point(mouseEvent->x(), mouseEvent->y()); - QRect ownRect = m_battlefield->ownRect(); - QRect enemyRect = m_battlefield->enemyRect(); + TQPoint point(mouseEvent->x(), mouseEvent->y()); + TQRect ownRect = m_battlefield->ownRect(); + TQRect enemyRect = m_battlefield->enemyRect(); - QRect newRect; + TQRect newRect; int fieldx = 0; int fieldy = 0; @@ -202,7 +202,7 @@ bool KBattleshipView::eventFilter(QObject *object, QEvent *event) for(int i = newRect.left(); i <= newRect.right(); i += m_battlefield->gridSize()) { j++; - QRect tempRect(i, newRect.top(), m_battlefield->gridSize(), newRect.bottom() - newRect.top()); + TQRect tempRect(i, newRect.top(), m_battlefield->gridSize(), newRect.bottom() - newRect.top()); if(tempRect.contains(point)) { @@ -216,7 +216,7 @@ bool KBattleshipView::eventFilter(QObject *object, QEvent *event) for(int i = newRect.top(); i <= newRect.bottom(); i += m_battlefield->gridSize()) { j++; - QRect tempRect(newRect.left(), i, newRect.right() - newRect.left(), m_battlefield->gridSize()); + TQRect tempRect(newRect.left(), i, newRect.right() - newRect.left(), m_battlefield->gridSize()); if(tempRect.contains(point)) { @@ -232,15 +232,15 @@ bool KBattleshipView::eventFilter(QObject *object, QEvent *event) return true; } - else if(event->type() == QEvent::MouseMove) + else if(event->type() == TQEvent::MouseMove) { setFocus(); m_decide = true; - QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event); + TQMouseEvent *mouseEvent = static_cast<TQMouseEvent *>(event); - QPoint point(mouseEvent->x(), mouseEvent->y()); - QRect ownRect = m_battlefield->ownRect(); + TQPoint point(mouseEvent->x(), mouseEvent->y()); + TQRect ownRect = m_battlefield->ownRect(); int fieldx = 0; int fieldy = 0; @@ -252,7 +252,7 @@ bool KBattleshipView::eventFilter(QObject *object, QEvent *event) for(int i = ownRect.left(); i <= ownRect.right(); i += m_battlefield->gridSize()) { j++; - QRect tempRect(i, ownRect.top(), m_battlefield->gridSize(), ownRect.bottom() - ownRect.top()); + TQRect tempRect(i, ownRect.top(), m_battlefield->gridSize(), ownRect.bottom() - ownRect.top()); if(tempRect.contains(point)) { @@ -266,7 +266,7 @@ bool KBattleshipView::eventFilter(QObject *object, QEvent *event) for(int i = ownRect.top(); i <= ownRect.bottom(); i += m_battlefield->gridSize()) { j++; - QRect tempRect(ownRect.left(), i, ownRect.right() - ownRect.left(), m_battlefield->gridSize()); + TQRect tempRect(ownRect.left(), i, ownRect.right() - ownRect.left(), m_battlefield->gridSize()); if(tempRect.contains(point)) { @@ -285,11 +285,11 @@ bool KBattleshipView::eventFilter(QObject *object, QEvent *event) return true; } - else if(event->type() == QEvent::Paint) + else if(event->type() == TQEvent::Paint) { m_battlefield->drawField(); return true; } - return QWidget::eventFilter(object, event); + return TQWidget::eventFilter(object, event); } diff --git a/kbattleship/kbattleship/kbattleshipview.h b/kbattleship/kbattleship/kbattleshipview.h index f7f0a953..51d1fcc3 100644 --- a/kbattleship/kbattleship/kbattleshipview.h +++ b/kbattleship/kbattleship/kbattleshipview.h @@ -20,10 +20,10 @@ #include <kmainwindow.h> -#include <qpainter.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qwidget.h> +#include <tqpainter.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqwidget.h> #include "kbattlefield.h" #include "kmessage.h" @@ -34,7 +34,7 @@ class KBattleshipView : public QWidget { Q_OBJECT public: - KBattleshipView(QWidget *parent = 0, const char *name = 0, bool draw = false); + KBattleshipView(TQWidget *parent = 0, const char *name = 0, bool draw = false); ~KBattleshipView(); KBattleField *field() { return m_battlefield; } @@ -60,7 +60,7 @@ signals: void changeShipPlacementDirection(); private: - bool eventFilter(QObject *object, QEvent *event); + bool eventFilter(TQObject *object, TQEvent *event); KBattleField *m_battlefield; bool m_drawGrid; diff --git a/kbattleship/kbattleship/kbchooserstrategy.cpp b/kbattleship/kbattleship/kbchooserstrategy.cpp index f365c6d1..6473e73b 100644 --- a/kbattleship/kbattleship/kbchooserstrategy.cpp +++ b/kbattleship/kbattleship/kbchooserstrategy.cpp @@ -42,7 +42,7 @@ KBChooserStrategy::~KBChooserStrategy() delete m_random; } -void KBChooserStrategy::init(KBattleField *field, const QRect &field_rect) +void KBChooserStrategy::init(KBattleField *field, const TQRect &field_rect) { KBStrategy::init(field, field_rect); @@ -52,7 +52,7 @@ void KBChooserStrategy::init(KBattleField *field, const QRect &field_rect) advance(); } -const QPoint KBChooserStrategy::nextShot() +const TQPoint KBChooserStrategy::nextShot() { if(hasMoreShots()) { @@ -62,7 +62,7 @@ const QPoint KBChooserStrategy::nextShot() return m_child->nextShot(); } - return QPoint(0, 0); + return TQPoint(0, 0); } bool KBChooserStrategy::advance() @@ -102,7 +102,7 @@ bool KBChooserStrategy::hasMoreShots() { if((!m_destroying) && m_prevShots.count() > 0) { - QPoint pos = m_prevShots.last(); + TQPoint pos = m_prevShots.last(); int state = m_battleField->ownState(pos.x(), pos.y()); if(state == KBattleField::HIT) { @@ -132,7 +132,7 @@ bool KBChooserStrategy::hasMoreShots() return false; } -void KBChooserStrategy::shotAt(const QPoint &pos) +void KBChooserStrategy::shotAt(const TQPoint &pos) { m_prevShots.append(pos); m_child->shotAt(pos); diff --git a/kbattleship/kbattleship/kbchooserstrategy.h b/kbattleship/kbattleship/kbchooserstrategy.h index 298cbe68..5ac7d7c2 100644 --- a/kbattleship/kbattleship/kbchooserstrategy.h +++ b/kbattleship/kbattleship/kbchooserstrategy.h @@ -28,10 +28,10 @@ public: KBChooserStrategy(KBStrategy *parent = 0); virtual ~KBChooserStrategy(); - virtual void init(KBattleField *field, const QRect &field_rect); - virtual const QPoint nextShot(); + virtual void init(KBattleField *field, const TQRect &field_rect); + virtual const TQPoint nextShot(); virtual bool hasMoreShots(); - virtual void shotAt(const QPoint &pos); + virtual void shotAt(const TQPoint &pos); private: bool advance(); diff --git a/kbattleship/kbattleship/kbdestroyshipstrategy.cpp b/kbattleship/kbattleship/kbdestroyshipstrategy.cpp index 714bdd7c..a3882963 100644 --- a/kbattleship/kbattleship/kbdestroyshipstrategy.cpp +++ b/kbattleship/kbattleship/kbdestroyshipstrategy.cpp @@ -22,16 +22,16 @@ KBDestroyShipStrategy::KBDestroyShipStrategy(KBStrategy *parent) : KBStrategy(pa m_working = false; } -void KBDestroyShipStrategy::init(KBattleField *field, const QRect &field_rect) +void KBDestroyShipStrategy::init(KBattleField *field, const TQRect &field_rect) { KBStrategy::init(field, field_rect); m_working = false; } -const QPoint KBDestroyShipStrategy::nextShot() +const TQPoint KBDestroyShipStrategy::nextShot() { if(hasMoreShots()) - return QPoint(m_column, m_row); + return TQPoint(m_column, m_row); else return m_start; } @@ -110,12 +110,12 @@ bool KBDestroyShipStrategy::hasMoreShots() return false; } -void KBDestroyShipStrategy::shotAt(const QPoint &pos) +void KBDestroyShipStrategy::shotAt(const TQPoint &pos) { m_prevShots.append(pos); } -void KBDestroyShipStrategy::destroyShipAt(const QPoint pos) +void KBDestroyShipStrategy::destroyShipAt(const TQPoint pos) { if(enemyFieldStateAt(pos.x(), pos.y()) == FREE || m_battleField->ownState(pos.x(), pos.y()) == KBattleField::DEATH || m_battleField->ownState(pos.x(), pos.y()) == KBattleField::WATER) m_working = false; diff --git a/kbattleship/kbattleship/kbdestroyshipstrategy.h b/kbattleship/kbattleship/kbdestroyshipstrategy.h index 0fb6ca92..41503be1 100644 --- a/kbattleship/kbattleship/kbdestroyshipstrategy.h +++ b/kbattleship/kbattleship/kbdestroyshipstrategy.h @@ -25,18 +25,18 @@ class KBDestroyShipStrategy : public KBStrategy public: KBDestroyShipStrategy(KBStrategy *parent = 0); - virtual void init(KBattleField *field, const QRect &field_rect); - virtual const QPoint nextShot(); + virtual void init(KBattleField *field, const TQRect &field_rect); + virtual const TQPoint nextShot(); virtual bool hasMoreShots(); - virtual void shotAt(const QPoint &pos); + virtual void shotAt(const TQPoint &pos); - virtual void destroyShipAt(const QPoint pos); + virtual void destroyShipAt(const TQPoint pos); private: enum {NODIR, VERTICAL, HORIZONTAL}; bool m_working; - QPoint m_start; + TQPoint m_start; int m_column; int m_row; diff --git a/kbattleship/kbattleship/kbdiagonalshotstrategy.cpp b/kbattleship/kbattleship/kbdiagonalshotstrategy.cpp index f0e0d6c3..db83bc75 100644 --- a/kbattleship/kbattleship/kbdiagonalshotstrategy.cpp +++ b/kbattleship/kbattleship/kbdiagonalshotstrategy.cpp @@ -24,12 +24,12 @@ KBDiagonalShotStrategy::KBDiagonalShotStrategy(KBStrategy *parent) : KBStrategy( m_horizontal = 0; } -const QPoint KBDiagonalShotStrategy::nextShot() +const TQPoint KBDiagonalShotStrategy::nextShot() { if(hasMoreShots()) - return QPoint(m_column, m_row); + return TQPoint(m_column, m_row); - return QPoint(0,0); + return TQPoint(0,0); } bool KBDiagonalShotStrategy::advance() @@ -50,7 +50,7 @@ bool KBDiagonalShotStrategy::hasMoreShots() return advance(); } -void KBDiagonalShotStrategy::shotAt(const QPoint &pos) +void KBDiagonalShotStrategy::shotAt(const TQPoint &pos) { m_prevShots.append(pos); } @@ -89,13 +89,13 @@ void KBDiagonalShotStrategy::startAt(int col, int row, Direction dir) } } -QPoint KBDiagonalShotStrategy::endPoint() +TQPoint KBDiagonalShotStrategy::endPoint() { int row = m_row; int col = m_column; if(m_vertical == 0 || m_horizontal == 0) - return QPoint(col, row); + return TQPoint(col, row); while(m_fieldRect.contains(col, row)) { @@ -106,5 +106,5 @@ QPoint KBDiagonalShotStrategy::endPoint() row -= m_vertical; col -= m_horizontal; - return QPoint(col, row); + return TQPoint(col, row); } diff --git a/kbattleship/kbattleship/kbdiagonalshotstrategy.h b/kbattleship/kbattleship/kbdiagonalshotstrategy.h index b7c9b086..e328fad2 100644 --- a/kbattleship/kbattleship/kbdiagonalshotstrategy.h +++ b/kbattleship/kbattleship/kbdiagonalshotstrategy.h @@ -25,11 +25,11 @@ public: enum Direction {LEFTUP, LEFTDOWN, RIGHTUP, RIGHTDOWN}; KBDiagonalShotStrategy(KBStrategy *parent = 0); - virtual const QPoint nextShot(); + virtual const TQPoint nextShot(); virtual bool hasMoreShots(); - virtual void shotAt(const QPoint &pos); + virtual void shotAt(const TQPoint &pos); virtual void startAt(int col, int row, Direction dir); - virtual QPoint endPoint(); + virtual TQPoint endPoint(); private: bool advance(); diff --git a/kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp b/kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp index 7f88fb54..7055403b 100644 --- a/kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp +++ b/kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp @@ -39,7 +39,7 @@ KBDiagonalWrapStrategy::~KBDiagonalWrapStrategy() delete m_destroyer; } -void KBDiagonalWrapStrategy::init(KBattleField *field, const QRect &field_rect) +void KBDiagonalWrapStrategy::init(KBattleField *field, const TQRect &field_rect) { KBStrategy::init(field, field_rect); KRandomSequence rand; @@ -73,13 +73,13 @@ void KBDiagonalWrapStrategy::init(KBattleField *field, const QRect &field_rect) m_child->init(field, field_rect); m_child->startAt(m_column, m_row, m_direction); - m_start = QPoint(m_column, m_row); + m_start = TQPoint(m_column, m_row); if(m_destroyer != 0) m_destroyer->init(field, field_rect); } -const QPoint KBDiagonalWrapStrategy::nextShot() +const TQPoint KBDiagonalWrapStrategy::nextShot() { if(hasMoreShots()) { @@ -127,7 +127,7 @@ bool KBDiagonalWrapStrategy::hasMoreShots() { if(m_parent == 0 && !m_destroying && m_prevShots.count() > 0) { - QPoint pos = m_prevShots.last(); + TQPoint pos = m_prevShots.last(); int state = m_battleField->ownState(pos.x(), pos.y()); if(state == KBattleField::HIT) { @@ -150,7 +150,7 @@ bool KBDiagonalWrapStrategy::hasMoreShots() return true; } -void KBDiagonalWrapStrategy::shotAt(const QPoint &pos) +void KBDiagonalWrapStrategy::shotAt(const TQPoint &pos) { m_prevShots.append(pos); @@ -183,7 +183,7 @@ bool KBDiagonalWrapStrategy::advanceRightDown() } m_column = col; } - m_start = QPoint(m_column, m_row); + m_start = TQPoint(m_column, m_row); } else { @@ -224,7 +224,7 @@ bool KBDiagonalWrapStrategy::advanceRightUp() } m_row = row; } - m_start = QPoint(m_column, m_row); + m_start = TQPoint(m_column, m_row); } else { @@ -264,7 +264,7 @@ bool KBDiagonalWrapStrategy::advanceLeftDown() } m_row = row; } - m_start = QPoint(m_column, m_row); + m_start = TQPoint(m_column, m_row); } else { @@ -305,7 +305,7 @@ bool KBDiagonalWrapStrategy::advanceLeftUp() } m_column = col; } - m_start = QPoint(m_column, m_row); + m_start = TQPoint(m_column, m_row); } else { diff --git a/kbattleship/kbattleship/kbdiagonalwrapstrategy.h b/kbattleship/kbattleship/kbdiagonalwrapstrategy.h index 06ff8f6a..f4a7c28d 100644 --- a/kbattleship/kbattleship/kbdiagonalwrapstrategy.h +++ b/kbattleship/kbattleship/kbdiagonalwrapstrategy.h @@ -27,10 +27,10 @@ public: KBDiagonalWrapStrategy(KBStrategy *parent = 0); virtual ~KBDiagonalWrapStrategy(); - virtual void init(KBattleField *field, const QRect &field_rect); - virtual const QPoint nextShot(); + virtual void init(KBattleField *field, const TQRect &field_rect); + virtual const TQPoint nextShot(); virtual bool hasMoreShots(); - virtual void shotAt(const QPoint &pos); + virtual void shotAt(const TQPoint &pos); private: bool advance(); @@ -42,7 +42,7 @@ private: int m_row; int m_column; - QPoint m_start; + TQPoint m_start; KBDiagonalShotStrategy *m_child; KBDiagonalShotStrategy::Direction m_direction; diff --git a/kbattleship/kbattleship/kbhorizontalstepstrategy.cpp b/kbattleship/kbattleship/kbhorizontalstepstrategy.cpp index 080bc08e..a6e931da 100644 --- a/kbattleship/kbattleship/kbhorizontalstepstrategy.cpp +++ b/kbattleship/kbattleship/kbhorizontalstepstrategy.cpp @@ -38,27 +38,27 @@ KBHorizontalStepStrategy::~KBHorizontalStepStrategy() delete m_destroyer; } -void KBHorizontalStepStrategy::init(KBattleField *field, const QRect &field_rect) +void KBHorizontalStepStrategy::init(KBattleField *field, const TQRect &field_rect) { KBStrategy::init(field, field_rect); KRandomSequence rand; m_column = (int) rand.getLong(m_fieldRect.width()); m_row = (int) rand.getLong(m_fieldRect.height()); - m_start = QPoint(m_column, m_row); + m_start = TQPoint(m_column, m_row); m_passes = 0; if(m_destroyer != 0) m_destroyer->init(field, field_rect); } -const QPoint KBHorizontalStepStrategy::nextShot() +const TQPoint KBHorizontalStepStrategy::nextShot() { if(hasMoreShots()) { if(m_destroying) return m_destroyer->nextShot(); else if(m_passes == 0) - return QPoint(m_column, m_row); + return TQPoint(m_column, m_row); else if(m_parent == 0) return m_child->nextShot(); } @@ -101,7 +101,7 @@ bool KBHorizontalStepStrategy::advance() void KBHorizontalStepStrategy::setStart(int col, int row) { - m_start = QPoint(col, row); + m_start = TQPoint(col, row); m_column = col; m_row = row; } @@ -131,7 +131,7 @@ bool KBHorizontalStepStrategy::hasMoreShots() // Parent Strategy if((!m_destroying) && m_prevShots.count() > 0) { - QPoint pos = m_prevShots.last(); + TQPoint pos = m_prevShots.last(); int state = m_battleField->ownState(pos.x(), pos.y()); if(state == KBattleField::HIT) { @@ -202,7 +202,7 @@ bool KBHorizontalStepStrategy::hasMoreShots() } } -void KBHorizontalStepStrategy::shotAt(const QPoint &pos) +void KBHorizontalStepStrategy::shotAt(const TQPoint &pos) { m_prevShots.append(pos); if(m_child != 0) diff --git a/kbattleship/kbattleship/kbhorizontalstepstrategy.h b/kbattleship/kbattleship/kbhorizontalstepstrategy.h index 4e68e4e7..80ec7b72 100644 --- a/kbattleship/kbattleship/kbhorizontalstepstrategy.h +++ b/kbattleship/kbattleship/kbhorizontalstepstrategy.h @@ -26,10 +26,10 @@ public: KBHorizontalStepStrategy(KBStrategy *parent = 0); virtual ~KBHorizontalStepStrategy(); - virtual void init(KBattleField *field, const QRect &field_rect); - virtual const QPoint nextShot(); + virtual void init(KBattleField *field, const TQRect &field_rect); + virtual const TQPoint nextShot(); virtual bool hasMoreShots(); - virtual void shotAt(const QPoint &pos); + virtual void shotAt(const TQPoint &pos); private: bool advance(); @@ -39,7 +39,7 @@ private: int m_column; int m_passes; - QPoint m_start; + TQPoint m_start; KBHorizontalStepStrategy *m_child; KBDestroyShipStrategy *m_destroyer; bool m_destroying; diff --git a/kbattleship/kbattleship/kbrandomshotstrategy.cpp b/kbattleship/kbattleship/kbrandomshotstrategy.cpp index a3748a69..62416350 100644 --- a/kbattleship/kbattleship/kbrandomshotstrategy.cpp +++ b/kbattleship/kbattleship/kbrandomshotstrategy.cpp @@ -27,7 +27,7 @@ KBRandomShotStrategy::~KBRandomShotStrategy() delete m_destroyer; } -void KBRandomShotStrategy::init(KBattleField *field, const QRect &field_rect) +void KBRandomShotStrategy::init(KBattleField *field, const TQRect &field_rect) { KBStrategy::init(field, field_rect); KRandomSequence rand; @@ -38,17 +38,17 @@ void KBRandomShotStrategy::init(KBattleField *field, const QRect &field_rect) m_destroyer->init(field, field_rect); } -const QPoint KBRandomShotStrategy::nextShot() +const TQPoint KBRandomShotStrategy::nextShot() { if(hasMoreShots()) { if(m_destroying) return m_destroyer->nextShot(); else if(advance()) - return QPoint(m_column, m_row); + return TQPoint(m_column, m_row); } - return QPoint(0, 0); + return TQPoint(0, 0); } bool KBRandomShotStrategy::advance() @@ -67,7 +67,7 @@ bool KBRandomShotStrategy::hasMoreShots() { if((!m_destroying) && m_prevShots.count() > 0) { - QPoint pos = m_prevShots.last(); + TQPoint pos = m_prevShots.last(); int state = m_battleField->ownState(pos.x(), pos.y()); if(state == KBattleField::HIT) { @@ -96,7 +96,7 @@ bool KBRandomShotStrategy::hasMoreShots() return false; } -void KBRandomShotStrategy::shotAt(const QPoint &pos) +void KBRandomShotStrategy::shotAt(const TQPoint &pos) { m_prevShots.append(pos); } diff --git a/kbattleship/kbattleship/kbrandomshotstrategy.h b/kbattleship/kbattleship/kbrandomshotstrategy.h index 1e93cefa..141961b9 100644 --- a/kbattleship/kbattleship/kbrandomshotstrategy.h +++ b/kbattleship/kbattleship/kbrandomshotstrategy.h @@ -28,10 +28,10 @@ public: KBRandomShotStrategy(KBStrategy *parent = 0); virtual ~KBRandomShotStrategy(); - virtual void init(KBattleField *field, const QRect &field_rect); - virtual const QPoint nextShot(); + virtual void init(KBattleField *field, const TQRect &field_rect); + virtual const TQPoint nextShot(); virtual bool hasMoreShots(); - virtual void shotAt(const QPoint &pos); + virtual void shotAt(const TQPoint &pos); private: bool advance(); diff --git a/kbattleship/kbattleship/kbstrategy.cpp b/kbattleship/kbattleship/kbstrategy.cpp index f8183cfd..be445559 100644 --- a/kbattleship/kbattleship/kbstrategy.cpp +++ b/kbattleship/kbattleship/kbstrategy.cpp @@ -36,18 +36,18 @@ KBStrategy::~KBStrategy() } /* Returns the master strategy's shot list. */ -QValueList<QPoint> KBStrategy::masterShotList() +TQValueList<TQPoint> KBStrategy::masterShotList() { return (!m_parent) ? m_prevShots : m_parent->masterShotList(); } /* the AI player decided to shoot at pos */ -void KBStrategy::shotAt(const QPoint &pos) +void KBStrategy::shotAt(const TQPoint &pos) { m_prevShots.append(pos); } -void KBStrategy::init(KBattleField *field, const QRect &field_rect) +void KBStrategy::init(KBattleField *field, const TQRect &field_rect) { m_battleField = field; m_fieldRect = field_rect; diff --git a/kbattleship/kbattleship/kbstrategy.h b/kbattleship/kbattleship/kbstrategy.h index 55707a17..9c4cdf15 100644 --- a/kbattleship/kbattleship/kbstrategy.h +++ b/kbattleship/kbattleship/kbstrategy.h @@ -18,8 +18,8 @@ #ifndef KBSTRATEGY_H #define KBSTRATEGY_H -#include <qvaluelist.h> -#include <qpoint.h> +#include <tqvaluelist.h> +#include <tqpoint.h> #include "kbattlefield.h" class KBStrategy @@ -29,21 +29,21 @@ public: KBStrategy(KBStrategy *parent = 0); virtual ~KBStrategy(); - virtual const QPoint nextShot() = 0; - virtual void shotAt(const QPoint &pos); - virtual void init(KBattleField *field, const QRect &field_rect); + virtual const TQPoint nextShot() = 0; + virtual void shotAt(const TQPoint &pos); + virtual void init(KBattleField *field, const TQRect &field_rect); virtual bool hasMoreShots() = 0; protected: - QValueList<QPoint> masterShotList(); + TQValueList<TQPoint> masterShotList(); int enemyFieldStateAt(int x, int y); bool* getViableShots(); - QRect m_fieldRect; + TQRect m_fieldRect; bool* m_viableShots; bool isViablePos(int x, int y); void setViablePos(int x, int y, bool viable); - QValueList<QPoint> m_prevShots; + TQValueList<TQPoint> m_prevShots; KBattleField *m_battleField; KBStrategy *m_parent; diff --git a/kbattleship/kbattleship/kbverticalstepstrategy.cpp b/kbattleship/kbattleship/kbverticalstepstrategy.cpp index 736e9ac8..7642ccaf 100644 --- a/kbattleship/kbattleship/kbverticalstepstrategy.cpp +++ b/kbattleship/kbattleship/kbverticalstepstrategy.cpp @@ -40,27 +40,27 @@ KBVerticalStepStrategy::~KBVerticalStepStrategy() delete m_destroyer; } -void KBVerticalStepStrategy::init(KBattleField *field, const QRect &field_rect) +void KBVerticalStepStrategy::init(KBattleField *field, const TQRect &field_rect) { KBStrategy::init(field, field_rect); KRandomSequence rand; m_column = (int) rand.getLong(m_fieldRect.width()); m_row = (int) rand.getLong(m_fieldRect.height()); - m_start = QPoint(m_column, m_row); + m_start = TQPoint(m_column, m_row); m_passes = 0; if(m_destroyer != 0) m_destroyer->init(field, field_rect); } -const QPoint KBVerticalStepStrategy::nextShot() +const TQPoint KBVerticalStepStrategy::nextShot() { if(hasMoreShots()) { if(m_destroying) return m_destroyer->nextShot(); else if(m_passes == 0) - return QPoint(m_column, m_row); + return TQPoint(m_column, m_row); else if(m_parent == 0) return m_child->nextShot(); } @@ -103,7 +103,7 @@ bool KBVerticalStepStrategy::advance() void KBVerticalStepStrategy::setStart(int col, int row) { - m_start = QPoint(col, row); + m_start = TQPoint(col, row); m_column = col; m_row = row; } @@ -133,7 +133,7 @@ bool KBVerticalStepStrategy::hasMoreShots() // Parent Strategy if((!m_destroying) && m_prevShots.count() > 0) { - QPoint pos = m_prevShots.last(); + TQPoint pos = m_prevShots.last(); int state = m_battleField->ownState(pos.x(), pos.y()); if(state == KBattleField::HIT) { @@ -206,7 +206,7 @@ bool KBVerticalStepStrategy::hasMoreShots() } } -void KBVerticalStepStrategy::shotAt(const QPoint &pos) +void KBVerticalStepStrategy::shotAt(const TQPoint &pos) { m_prevShots.append(pos); if(m_child != 0) diff --git a/kbattleship/kbattleship/kbverticalstepstrategy.h b/kbattleship/kbattleship/kbverticalstepstrategy.h index 904fa68e..a5d614c6 100644 --- a/kbattleship/kbattleship/kbverticalstepstrategy.h +++ b/kbattleship/kbattleship/kbverticalstepstrategy.h @@ -27,10 +27,10 @@ public: KBVerticalStepStrategy(KBStrategy *parent = 0); virtual ~KBVerticalStepStrategy(); - virtual void init(KBattleField *field, const QRect &field_rect); - virtual const QPoint nextShot(); + virtual void init(KBattleField *field, const TQRect &field_rect); + virtual const TQPoint nextShot(); virtual bool hasMoreShots(); - virtual void shotAt(const QPoint &pos); + virtual void shotAt(const TQPoint &pos); private: bool advance(); @@ -40,7 +40,7 @@ private: int m_column; int m_passes; - QPoint m_start; + TQPoint m_start; KBVerticalStepStrategy *m_child; KBDestroyShipStrategy *m_destroyer; bool m_destroying; diff --git a/kbattleship/kbattleship/kchatwidget.cpp b/kbattleship/kbattleship/kchatwidget.cpp index 6c4755c6..9d5e12af 100644 --- a/kbattleship/kbattleship/kchatwidget.cpp +++ b/kbattleship/kbattleship/kchatwidget.cpp @@ -18,21 +18,21 @@ #include <kapplication.h> #include "kchatwidget.moc" -KChatWidget::KChatWidget(QWidget *parent, const char *name) : chatDlg(parent, name) +KChatWidget::KChatWidget(TQWidget *parent, const char *name) : chatDlg(parent, name) { - connect(sendBtn, SIGNAL(clicked()), this, SLOT(slotComputeMessage())); - connect(commentEdit, SIGNAL(returnPressed()), this, SLOT(slotComputeMessage())); + connect(sendBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotComputeMessage())); + connect(commentEdit, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotComputeMessage())); chatView->setFocusProxy(commentEdit); chatView->setMinimumSize(0, 50); commentEdit->installEventFilter(this); - m_currentNickname = QString::null; + m_currentNickname = TQString::null; slotAcceptMsg(false); } void KChatWidget::clear() { - m_currentNickname = QString::null; + m_currentNickname = TQString::null; slotAcceptMsg(false); chatView->clear(); commentEdit->clear(); @@ -43,25 +43,25 @@ void KChatWidget::slotAcceptMsg(bool value) m_acceptMsgs = value; } -void KChatWidget::slotReceivedMessage(const QString &nickname, const QString &msg, bool fromenemy) +void KChatWidget::slotReceivedMessage(const TQString &nickname, const TQString &msg, bool fromenemy) { // Niko Z: // IRC roxxx :) if(msg.startsWith("/me ")) - chatView->append(QString(" * ") + nickname + QString(" ") + msg.mid(4)); + chatView->append(TQString(" * ") + nickname + TQString(" ") + msg.mid(4)); else if(msg.startsWith("/nick ")) if(fromenemy) emit sigChangeEnemyNickname(msg.mid(6)); else emit sigChangeOwnNickname(msg.mid(6)); else - chatView->append(nickname + QString(": ") + msg); + chatView->append(nickname + TQString(": ") + msg); chatView->setCursorPosition(chatView->numLines(), 0); } -bool KChatWidget::eventFilter(QObject *obj, QEvent *e) +bool KChatWidget::eventFilter(TQObject *obj, TQEvent *e) { - if(obj == commentEdit && e->type() == QEvent::Wheel) + if(obj == commentEdit && e->type() == TQEvent::Wheel) { kapp->notify(chatView, e); return true; diff --git a/kbattleship/kbattleship/kchatwidget.h b/kbattleship/kbattleship/kchatwidget.h index e9a756a7..7a0f0bed 100644 --- a/kbattleship/kbattleship/kchatwidget.h +++ b/kbattleship/kbattleship/kchatwidget.h @@ -18,9 +18,9 @@ #ifndef KCHATWIDGET_H #define KCHATWIDGET_H -#include <qpushbutton.h> -#include <qmultilineedit.h> -#include <qlineedit.h> +#include <tqpushbutton.h> +#include <tqmultilineedit.h> +#include <tqlineedit.h> #include "dialogs/chatDlg.h" #include "kmessage.h" @@ -28,25 +28,25 @@ class KChatWidget : public chatDlg { Q_OBJECT public: - KChatWidget(QWidget *parent = 0, const char *name = 0); + KChatWidget(TQWidget *parent = 0, const char *name = 0); void clear(); - void setNickname(const QString &nickname) { m_currentNickname = nickname; } + void setNickname(const TQString &nickname) { m_currentNickname = nickname; } public slots: void slotAcceptMsg(bool value); void slotComputeMessage(); - void slotReceivedMessage(const QString &nickname, const QString &msg, bool fromenemy = true); + void slotReceivedMessage(const TQString &nickname, const TQString &msg, bool fromenemy = true); signals: - void sigSendMessage(const QString &); - void sigChangeEnemyNickname(const QString &); - void sigChangeOwnNickname(const QString &); + void sigSendMessage(const TQString &); + void sigChangeEnemyNickname(const TQString &); + void sigChangeOwnNickname(const TQString &); private: - virtual bool eventFilter(QObject *, QEvent *); + virtual bool eventFilter(TQObject *, TQEvent *); - QString m_currentNickname; + TQString m_currentNickname; bool m_acceptMsgs; }; diff --git a/kbattleship/kbattleship/kclientdialog.cpp b/kbattleship/kbattleship/kclientdialog.cpp index 78fc04de..97015b71 100644 --- a/kbattleship/kbattleship/kclientdialog.cpp +++ b/kbattleship/kbattleship/kclientdialog.cpp @@ -15,21 +15,21 @@ * * ***************************************************************************/ -#include <qstring.h> -#include <qglobal.h> +#include <tqstring.h> +#include <tqglobal.h> #include <kdebug.h> #include <klocale.h> #include <kcombobox.h> #include <kuser.h> -#include <qlayout.h> +#include <tqlayout.h> #include "kbattleshipserver.h" // for BATTLESHIP_SERVICE #include "kclientdialog.moc" -KClientDialog::KClientDialog(QWidget *parent, const char *name) +KClientDialog::KClientDialog(TQWidget *parent, const char *name) : KDialogBase(Plain, i18n("Connect to Server"), Ok|Cancel, Ok, parent, name, true, false, KGuiItem(i18n("&Connect"))) { - QFrame* page = plainPage(); - QGridLayout* pageLayout = new QGridLayout(page, 1, 1, 0, 0); + TQFrame* page = plainPage(); + TQGridLayout* pageLayout = new TQGridLayout(page, 1, 1, 0, 0); m_mainWidget = new clientConnectDlg(page); pageLayout->addWidget(m_mainWidget, 0, 0); @@ -38,14 +38,14 @@ KClientDialog::KClientDialog(QWidget *parent, const char *name) KUser u; m_mainWidget->nicknameEdit->setText(u.loginName()); - connect(m_mainWidget->serverEdit, SIGNAL(returnPressed(const QString &)), this, SLOT(slotReturnPressed(const QString &))); - connect(m_mainWidget->serverEdit, SIGNAL(textChanged(const QString &)), this, SLOT(slotCheckEnableOk())); + connect(m_mainWidget->serverEdit, TQT_SIGNAL(returnPressed(const TQString &)), this, TQT_SLOT(slotReturnPressed(const TQString &))); + connect(m_mainWidget->serverEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotCheckEnableOk())); m_config->setGroup("History"); - m_browser = new DNSSD::ServiceBrowser(QString::fromLatin1(BATTLESHIP_SERVICE)); - connect(m_browser,SIGNAL(finished()),SLOT(nextBatch())); + m_browser = new DNSSD::ServiceBrowser(TQString::fromLatin1(BATTLESHIP_SERVICE)); + connect(m_browser,TQT_SIGNAL(finished()),TQT_SLOT(nextBatch())); m_browser->startBrowse(); - connect(m_mainWidget->lanBox,SIGNAL(activated(int)),SLOT(gameSelected(int))); + connect(m_mainWidget->lanBox,TQT_SIGNAL(activated(int)),TQT_SLOT(gameSelected(int))); m_mainWidget->serverEdit->completionObject()->setItems(m_config->readListEntry("CompletionList")); m_mainWidget->serverEdit->setMaxCount(5); @@ -70,7 +70,7 @@ void KClientDialog::slotCheckEnableOk() void KClientDialog::slotOk() { - QString server = m_mainWidget->serverEdit->currentText().stripWhiteSpace(); + TQString server = m_mainWidget->serverEdit->currentText().stripWhiteSpace(); if(!server.isEmpty()) { hide(); @@ -81,7 +81,7 @@ void KClientDialog::slotOk() m_mainWidget->serverEdit->clearEdit(); } -void KClientDialog::slotReturnPressed(const QString &hostname) +void KClientDialog::slotReturnPressed(const TQString &hostname) { if(!hostname.stripWhiteSpace().isEmpty()) m_mainWidget->serverEdit->addToHistory(hostname); @@ -95,17 +95,17 @@ void KClientDialog::slotCancel() emit sigCancelConnect(); } -QString KClientDialog::port() const +TQString KClientDialog::port() const { - return QString::number(m_mainWidget->portEdit->value()); + return TQString::number(m_mainWidget->portEdit->value()); } -QString KClientDialog::host() const +TQString KClientDialog::host() const { return m_mainWidget->serverEdit->currentText(); } -QString KClientDialog::nickname() const +TQString KClientDialog::nickname() const { return m_mainWidget->nicknameEdit->text(); } @@ -115,9 +115,9 @@ void KClientDialog::nextBatch() bool autoselect=false; if (!m_mainWidget->lanBox->count()) autoselect=true; m_mainWidget->lanBox->clear(); - QStringList names; - QValueList<DNSSD::RemoteService::Ptr>::ConstIterator itEnd = m_browser->services().end(); - for (QValueList<DNSSD::RemoteService::Ptr>::ConstIterator it = m_browser->services().begin(); + TQStringList names; + TQValueList<DNSSD::RemoteService::Ptr>::ConstIterator itEnd = m_browser->services().end(); + for (TQValueList<DNSSD::RemoteService::Ptr>::ConstIterator it = m_browser->services().begin(); it!=itEnd; ++it) names << (*it)->serviceName(); m_mainWidget->lanBox->insertStringList(names); if (autoselect && m_mainWidget->lanBox->count()) gameSelected(0); diff --git a/kbattleship/kbattleship/kclientdialog.h b/kbattleship/kbattleship/kclientdialog.h index e3dbf341..f424baf6 100644 --- a/kbattleship/kbattleship/kclientdialog.h +++ b/kbattleship/kbattleship/kclientdialog.h @@ -22,10 +22,10 @@ #include <kconfig.h> #include <dnssd/servicebrowser.h> #include <dnssd/remoteservice.h> -#include <qstring.h> -#include <qpushbutton.h> -#include <qlineedit.h> -#include <qspinbox.h> +#include <tqstring.h> +#include <tqpushbutton.h> +#include <tqlineedit.h> +#include <tqspinbox.h> #include <kdialogbase.h> #include "dialogs/connectDlg.h" @@ -33,17 +33,17 @@ class KClientDialog : public KDialogBase { Q_OBJECT public: - KClientDialog(QWidget *parent = 0, const char *name = 0); + KClientDialog(TQWidget *parent = 0, const char *name = 0); ~KClientDialog(); - QString port() const; - QString host() const; - QString nickname() const; + TQString port() const; + TQString host() const; + TQString nickname() const; public slots: virtual void slotOk(); virtual void slotCancel(); - void slotReturnPressed(const QString &hostname); + void slotReturnPressed(const TQString &hostname); void nextBatch(); void gameSelected(int); void slotCheckEnableOk(); diff --git a/kbattleship/kbattleship/kgridwidget.cpp b/kbattleship/kbattleship/kgridwidget.cpp index 49a6d106..6cc660d7 100644 --- a/kbattleship/kbattleship/kgridwidget.cpp +++ b/kbattleship/kbattleship/kgridwidget.cpp @@ -15,9 +15,9 @@ * * ***************************************************************************/ -#include <qapplication.h> -#include <qimage.h> -#include <qpainter.h> +#include <tqapplication.h> +#include <tqimage.h> +#include <tqpainter.h> #include <kstandarddirs.h> #include <kimageeffect.h> @@ -26,9 +26,9 @@ #include "kbattlefield.h" #include "kgridwidget.h" -KGridWidget::KGridWidget(QWidget *parent, bool draw) : m_drawGrid(draw) +KGridWidget::KGridWidget(TQWidget *parent, bool draw) : m_drawGrid(draw) { - m_doubleBuffer = new QPixmap(parent->width(), parent->height()); + m_doubleBuffer = new TQPixmap(parent->width(), parent->height()); m_parent = parent; cleanBuffer(); @@ -42,31 +42,31 @@ KGridWidget::~KGridWidget() void KGridWidget::cacheImages() { - seaPng = QPixmap(findIcon("sea.png")); - waterPng = QPixmap(findIcon("water.png")); - hitPng = QPixmap(findIcon("hit.png")); - borderPng = QPixmap(findIcon("border.png")); - deathPng = QPixmap(findIcon("death.png")); - ship1p1Png = QPixmap(findIcon("ship1-1.png")); - ship1p1rPng = QPixmap(findIcon("ship1-1-r.png")); - ship2p1Png = QPixmap(findIcon("ship2-1.png")); - ship2p1rPng = QPixmap(findIcon("ship2-1-r.png")); - ship2p2Png = QPixmap(findIcon("ship2-2.png")); - ship2p2rPng = QPixmap(findIcon("ship2-2-r.png")); - ship3p1Png = QPixmap(findIcon("ship3-1.png")); - ship3p1rPng = QPixmap(findIcon("ship3-1-r.png")); - ship3p2Png = QPixmap(findIcon("ship3-2.png")); - ship3p2rPng = QPixmap(findIcon("ship3-2-r.png")); - ship3p3Png = QPixmap(findIcon("ship3-3.png")); - ship3p3rPng = QPixmap(findIcon("ship3-3-r.png")); - ship4p1Png = QPixmap(findIcon("ship4-1.png")); - ship4p1rPng = QPixmap(findIcon("ship4-1-r.png")); - ship4p2Png = QPixmap(findIcon("ship4-2.png")); - ship4p2rPng = QPixmap(findIcon("ship4-2-r.png")); - ship4p3Png = QPixmap(findIcon("ship4-3.png")); - ship4p3rPng = QPixmap(findIcon("ship4-3-r.png")); - ship4p4Png = QPixmap(findIcon("ship4-4.png")); - ship4p4rPng = QPixmap(findIcon("ship4-4-r.png")); + seaPng = TQPixmap(findIcon("sea.png")); + waterPng = TQPixmap(findIcon("water.png")); + hitPng = TQPixmap(findIcon("hit.png")); + borderPng = TQPixmap(findIcon("border.png")); + deathPng = TQPixmap(findIcon("death.png")); + ship1p1Png = TQPixmap(findIcon("ship1-1.png")); + ship1p1rPng = TQPixmap(findIcon("ship1-1-r.png")); + ship2p1Png = TQPixmap(findIcon("ship2-1.png")); + ship2p1rPng = TQPixmap(findIcon("ship2-1-r.png")); + ship2p2Png = TQPixmap(findIcon("ship2-2.png")); + ship2p2rPng = TQPixmap(findIcon("ship2-2-r.png")); + ship3p1Png = TQPixmap(findIcon("ship3-1.png")); + ship3p1rPng = TQPixmap(findIcon("ship3-1-r.png")); + ship3p2Png = TQPixmap(findIcon("ship3-2.png")); + ship3p2rPng = TQPixmap(findIcon("ship3-2-r.png")); + ship3p3Png = TQPixmap(findIcon("ship3-3.png")); + ship3p3rPng = TQPixmap(findIcon("ship3-3-r.png")); + ship4p1Png = TQPixmap(findIcon("ship4-1.png")); + ship4p1rPng = TQPixmap(findIcon("ship4-1-r.png")); + ship4p2Png = TQPixmap(findIcon("ship4-2.png")); + ship4p2rPng = TQPixmap(findIcon("ship4-2-r.png")); + ship4p3Png = TQPixmap(findIcon("ship4-3.png")); + ship4p3rPng = TQPixmap(findIcon("ship4-3-r.png")); + ship4p4Png = TQPixmap(findIcon("ship4-4.png")); + ship4p4rPng = TQPixmap(findIcon("ship4-4-r.png")); } void KGridWidget::setValues(int x, int y, int size) @@ -365,14 +365,14 @@ void KGridWidget::drawShipIcon(int ship, int part, bool rotate, bool hit) } } -void KGridWidget::drawIcon(const QPixmap &icon, bool hitBlend, bool waterBlend, bool rotate) +void KGridWidget::drawIcon(const TQPixmap &icon, bool hitBlend, bool waterBlend, bool rotate) { - QPainter painter; + TQPainter painter; painter.begin(m_doubleBuffer); if(!hitBlend && waterBlend) { - QImage first = icon.convertToImage(); - QImage second = seaPng.convertToImage(); + TQImage first = icon.convertToImage(); + TQImage second = seaPng.convertToImage(); painter.drawPixmap(m_x, m_y, seaPng); if(rotate) painter.drawImage(m_x, m_y, KImageEffect::blend(first, second, KImageEffect::VerticalGradient, 30, 30)); @@ -399,7 +399,7 @@ void KGridWidget::drawIcon(const QPixmap &icon, bool hitBlend, bool waterBlend, } } -QString KGridWidget::findIcon(const QString &name) const +TQString KGridWidget::findIcon(const TQString &name) const { return locate("data", "kbattleship/pictures/" + name); } @@ -412,5 +412,5 @@ void KGridWidget::finished() void KGridWidget::cleanBuffer() { - m_doubleBuffer->fill(QApplication::palette().color(QPalette::Normal, QColorGroup::Background)); + m_doubleBuffer->fill(TQApplication::palette().color(TQPalette::Normal, TQColorGroup::Background)); } diff --git a/kbattleship/kbattleship/kgridwidget.h b/kbattleship/kbattleship/kgridwidget.h index 91f48eb0..1026695b 100644 --- a/kbattleship/kbattleship/kgridwidget.h +++ b/kbattleship/kbattleship/kgridwidget.h @@ -18,12 +18,12 @@ #ifndef KGRIDWIDGET_H #define KGRIDWIDGET_H -#include <qpixmap.h> +#include <tqpixmap.h> class KGridWidget { public: - KGridWidget(QWidget *parent, bool draw); + KGridWidget(TQWidget *parent, bool draw); ~KGridWidget(); void enableGrid() { m_drawGrid = true; } @@ -43,24 +43,24 @@ protected: private: void cacheImages(); - void drawIcon(const QPixmap &icon, bool hitBlend = false, bool waterBlend = false, bool rotate = false); - QString findIcon(const QString &name) const; + void drawIcon(const TQPixmap &icon, bool hitBlend = false, bool waterBlend = false, bool rotate = false); + TQString findIcon(const TQString &name) const; bool m_drawGrid; int m_x, m_y, m_size; - QPixmap *m_doubleBuffer; - QPixmap seaPng, waterPng, hitPng, borderPng,deathPng; - QPixmap ship1p1Png, ship1p1rPng; - QPixmap ship2p1Png, ship2p1rPng; - QPixmap ship2p2Png, ship2p2rPng; - QPixmap ship3p1Png, ship3p1rPng; - QPixmap ship3p2Png, ship3p2rPng; - QPixmap ship3p3Png, ship3p3rPng; - QPixmap ship4p1Png, ship4p1rPng; - QPixmap ship4p2Png, ship4p2rPng; - QPixmap ship4p3Png, ship4p3rPng; - QPixmap ship4p4Png, ship4p4rPng; - QWidget *m_parent; + TQPixmap *m_doubleBuffer; + TQPixmap seaPng, waterPng, hitPng, borderPng,deathPng; + TQPixmap ship1p1Png, ship1p1rPng; + TQPixmap ship2p1Png, ship2p1rPng; + TQPixmap ship2p2Png, ship2p2rPng; + TQPixmap ship3p1Png, ship3p1rPng; + TQPixmap ship3p2Png, ship3p2rPng; + TQPixmap ship3p3Png, ship3p3rPng; + TQPixmap ship4p1Png, ship4p1rPng; + TQPixmap ship4p2Png, ship4p2rPng; + TQPixmap ship4p3Png, ship4p3rPng; + TQPixmap ship4p4Png, ship4p4rPng; + TQWidget *m_parent; }; #endif diff --git a/kbattleship/kbattleship/kmessage.cpp b/kbattleship/kbattleship/kmessage.cpp index 5eccacd2..a316b314 100644 --- a/kbattleship/kbattleship/kmessage.cpp +++ b/kbattleship/kbattleship/kmessage.cpp @@ -32,10 +32,10 @@ const char *protocolVersion = "0.1.0"; KMessage::KMessage(int type) { - m_xmlDocument = QDomDocument("kmessage"); + m_xmlDocument = TQDomDocument("kmessage"); m_xmlDocument.appendChild(m_xmlDocument.createElement("kmessage")); m_messageType = type; - addField("msgtype", QString::number(type)); + addField("msgtype", TQString::number(type)); } KMessage::KMessage(KMessage *msg) @@ -46,18 +46,18 @@ KMessage::KMessage(KMessage *msg) KMessage::KMessage() { - m_xmlDocument = QDomDocument("kmessage"); + m_xmlDocument = TQDomDocument("kmessage"); } -void KMessage::addField(const QString &name, const QString &content) +void KMessage::addField(const TQString &name, const TQString &content) { - QDomElement xmlElement = m_xmlDocument.createElement(name); - QDomText xmlText = m_xmlDocument.createTextNode(content); + TQDomElement xmlElement = m_xmlDocument.createElement(name); + TQDomText xmlText = m_xmlDocument.createTextNode(content); xmlElement.appendChild(xmlText); m_xmlDocument.documentElement().appendChild(xmlElement); } -void KMessage::setDataStream(const QString &stream) +void KMessage::setDataStream(const TQString &stream) { m_xmlDocument.setContent(stream); #ifdef XMLDUMP @@ -65,7 +65,7 @@ void KMessage::setDataStream(const QString &stream) #endif } -QString KMessage::sendStream() const +TQString KMessage::sendStream() const { #ifdef XMLDUMP kdDebug() << "*** XML OUT ***" << endl << m_xmlDocument.toString() << endl << "*** END ***" << endl; @@ -73,12 +73,12 @@ QString KMessage::sendStream() const return m_xmlDocument.toString(); } -QString KMessage::field(const QString &name) const +TQString KMessage::field(const TQString &name) const { - QDomNode xmlNode = m_xmlDocument.documentElement().namedItem(name); + TQDomNode xmlNode = m_xmlDocument.documentElement().namedItem(name); if(!xmlNode.isNull()) return (xmlNode.toElement()).text(); - return QString::null; + return TQString::null; } int KMessage::type() @@ -86,7 +86,7 @@ int KMessage::type() return field("msgtype").toInt(); } -void KMessage::chatMessage(const QString &nickname, const QString &message) +void KMessage::chatMessage(const TQString &nickname, const TQString &message) { addField("nickname", nickname); addField("chat", message); diff --git a/kbattleship/kbattleship/kmessage.h b/kbattleship/kbattleship/kmessage.h index f1d6a0b5..fca32c1b 100644 --- a/kbattleship/kbattleship/kmessage.h +++ b/kbattleship/kbattleship/kmessage.h @@ -18,8 +18,8 @@ #ifndef KMESSAGE_H #define KMESSAGE_H -#include <qdom.h> -#include <qstring.h> +#include <tqdom.h> +#include <tqstring.h> class KMessage { @@ -32,17 +32,17 @@ public: int type(); - void addField(const QString &name, const QString &content); - QString field(const QString &name) const; + void addField(const TQString &name, const TQString &content); + TQString field(const TQString &name) const; - void setDataStream(const QString &stream); - QString sendStream() const; + void setDataStream(const TQString &stream); + TQString sendStream() const; - void chatMessage(const QString &nickname, const QString &message); + void chatMessage(const TQString &nickname, const TQString &message); void versionMessage(); private: - QDomDocument m_xmlDocument; + TQDomDocument m_xmlDocument; int m_messageType; }; diff --git a/kbattleship/kbattleship/konnectionhandling.cpp b/kbattleship/kbattleship/konnectionhandling.cpp index bcfefe04..5d5c1026 100644 --- a/kbattleship/kbattleship/konnectionhandling.cpp +++ b/kbattleship/kbattleship/konnectionhandling.cpp @@ -19,27 +19,27 @@ extern const char *protocolVersion; -KonnectionHandling::KonnectionHandling(QWidget *parent, KBattleshipServer *server) : QObject(parent) +KonnectionHandling::KonnectionHandling(TQWidget *parent, KBattleshipServer *server) : TQObject(parent) { m_kbserver = server; m_kbclient = 0; m_type = KonnectionHandling::SERVER; - connect(server, SIGNAL(sigServerFailure()), this, SIGNAL(sigAbortNetworkGame())); - connect(server, SIGNAL(sigNewConnect()), this, SLOT(slotNewClient())); - connect(server, SIGNAL(sigEndConnect()), this, SLOT(slotLostClient())); - connect(server, SIGNAL(sigNewMessage(KMessage *)), this, SLOT(slotNewMessage(KMessage *))); - connect(server, SIGNAL(sigMessageSent(KMessage *)), this, SLOT(slotMessageSent(KMessage *))); + connect(server, TQT_SIGNAL(sigServerFailure()), this, TQT_SIGNAL(sigAbortNetworkGame())); + connect(server, TQT_SIGNAL(sigNewConnect()), this, TQT_SLOT(slotNewClient())); + connect(server, TQT_SIGNAL(sigEndConnect()), this, TQT_SLOT(slotLostClient())); + connect(server, TQT_SIGNAL(sigNewMessage(KMessage *)), this, TQT_SLOT(slotNewMessage(KMessage *))); + connect(server, TQT_SIGNAL(sigMessageSent(KMessage *)), this, TQT_SLOT(slotMessageSent(KMessage *))); } -KonnectionHandling::KonnectionHandling(QWidget *parent, KBattleshipClient *client) : QObject(parent) +KonnectionHandling::KonnectionHandling(TQWidget *parent, KBattleshipClient *client) : TQObject(parent) { m_kbclient = client; m_kbserver = 0; m_type = KonnectionHandling::CLIENT; - connect(client, SIGNAL(sigEndConnect()), this, SLOT(slotLostServer())); - connect(client, SIGNAL(sigSocketFailure(int)), this, SLOT(slotSocketError(int))); - connect(client, SIGNAL(sigNewMessage(KMessage *)), this, SLOT(slotNewMessage(KMessage *))); - connect(client, SIGNAL(sigMessageSent(KMessage *)), this, SLOT(slotMessageSent(KMessage *))); + connect(client, TQT_SIGNAL(sigEndConnect()), this, TQT_SLOT(slotLostServer())); + connect(client, TQT_SIGNAL(sigSocketFailure(int)), this, TQT_SLOT(slotSocketError(int))); + connect(client, TQT_SIGNAL(sigNewMessage(KMessage *)), this, TQT_SLOT(slotNewMessage(KMessage *))); + connect(client, TQT_SIGNAL(sigMessageSent(KMessage *)), this, TQT_SLOT(slotMessageSent(KMessage *))); } void KonnectionHandling::updateInternal(KBattleshipServer *server) @@ -47,11 +47,11 @@ void KonnectionHandling::updateInternal(KBattleshipServer *server) m_kbserver = server; m_kbclient = 0; m_type = KonnectionHandling::SERVER; - connect(server, SIGNAL(sigServerFailure()), this, SIGNAL(sigAbortNetworkGame())); - connect(server, SIGNAL(sigNewConnect()), this, SLOT(slotNewClient())); - connect(server, SIGNAL(sigEndConnect()), this, SLOT(slotLostClient())); - connect(server, SIGNAL(sigNewMessage(KMessage *)), this, SLOT(slotNewMessage(KMessage *))); - connect(server, SIGNAL(sigMessageSent(KMessage *)), this, SLOT(slotMessageSent(KMessage *))); + connect(server, TQT_SIGNAL(sigServerFailure()), this, TQT_SIGNAL(sigAbortNetworkGame())); + connect(server, TQT_SIGNAL(sigNewConnect()), this, TQT_SLOT(slotNewClient())); + connect(server, TQT_SIGNAL(sigEndConnect()), this, TQT_SLOT(slotLostClient())); + connect(server, TQT_SIGNAL(sigNewMessage(KMessage *)), this, TQT_SLOT(slotNewMessage(KMessage *))); + connect(server, TQT_SIGNAL(sigMessageSent(KMessage *)), this, TQT_SLOT(slotMessageSent(KMessage *))); } void KonnectionHandling::updateInternal(KBattleshipClient *client) @@ -59,10 +59,10 @@ void KonnectionHandling::updateInternal(KBattleshipClient *client) m_kbclient = client; m_kbserver = 0; m_type = KonnectionHandling::CLIENT; - connect(client, SIGNAL(sigEndConnect()), this, SLOT(slotLostServer())); - connect(client, SIGNAL(sigSocketFailure(int)), this, SLOT(slotSocketError(int))); - connect(client, SIGNAL(sigNewMessage(KMessage *)), this, SLOT(slotNewMessage(KMessage *))); - connect(client, SIGNAL(sigMessageSent(KMessage *)), this, SLOT(slotMessageSent(KMessage *))); + connect(client, TQT_SIGNAL(sigEndConnect()), this, TQT_SLOT(slotLostServer())); + connect(client, TQT_SIGNAL(sigSocketFailure(int)), this, TQT_SLOT(slotSocketError(int))); + connect(client, TQT_SIGNAL(sigNewMessage(KMessage *)), this, TQT_SLOT(slotNewMessage(KMessage *))); + connect(client, TQT_SIGNAL(sigMessageSent(KMessage *)), this, TQT_SLOT(slotMessageSent(KMessage *))); } void KonnectionHandling::slotNewClient() @@ -92,7 +92,7 @@ void KonnectionHandling::slotNewMessage(KMessage *msg) { // First possible message case KMessage::DISCARD: - if(msg->field("kmversion") == QString("true")) + if(msg->field("kmversion") == TQString("true")) { KMessageBox::error(0L, i18n("Connection dropped by enemy. The client's protocol implementation (%1) is not compatible with our (%2) version.").arg(msg->field("reason")).arg(protocolVersion)); emit sigAbortNetworkGame(); @@ -128,7 +128,7 @@ void KonnectionHandling::slotNewMessage(KMessage *msg) // The server gave us the field data of our last shot case KMessage::ANSWER_SHOOT: emit sigShootable(false); - emit sigEnemyFieldData(msg->field("fieldx").toInt(), msg->field("fieldy").toInt(), msg->field("fieldstate").toInt(), msg->field("xstart").toInt(), msg->field("xstop").toInt(), msg->field("ystart").toInt(), msg->field("ystop").toInt(), (msg->field("death") == QString("true"))); + emit sigEnemyFieldData(msg->field("fieldx").toInt(), msg->field("fieldy").toInt(), msg->field("fieldstate").toInt(), msg->field("xstart").toInt(), msg->field("xstop").toInt(), msg->field("ystart").toInt(), msg->field("ystop").toInt(), (msg->field("death") == TQString("true"))); break; // The server starts a new game @@ -156,7 +156,7 @@ void KonnectionHandling::slotNewMessage(KMessage *msg) { // First message....got client information case KMessage::GETVERSION: - if(msg->field("protocolVersion") != QString::fromLatin1(protocolVersion)) + if(msg->field("protocolVersion") != TQString::fromLatin1(protocolVersion)) { m_kbserver->slotDiscardClient(protocolVersion, true, false); KMessageBox::error(0L, i18n("Connection to client dropped. The client's protocol implementation (%1) is not compatible with our (%2) version.").arg(msg->field("protocolVersion")).arg(protocolVersion)); @@ -183,7 +183,7 @@ void KonnectionHandling::slotNewMessage(KMessage *msg) // The client gave us the field data of our last shot case KMessage::ANSWER_SHOOT: emit sigShootable(false); - emit sigEnemyFieldData(msg->field("fieldx").toInt(), msg->field("fieldy").toInt(), msg->field("fieldstate").toInt(), msg->field("xstart").toInt(), msg->field("xstop").toInt(), msg->field("ystart").toInt(), msg->field("ystop").toInt(), (msg->field("death") == QString("true"))); + emit sigEnemyFieldData(msg->field("fieldx").toInt(), msg->field("fieldy").toInt(), msg->field("fieldstate").toInt(), msg->field("xstart").toInt(), msg->field("xstop").toInt(), msg->field("ystart").toInt(), msg->field("ystop").toInt(), (msg->field("death") == TQString("true"))); break; // The client shot and wants the field state diff --git a/kbattleship/kbattleship/konnectionhandling.h b/kbattleship/kbattleship/konnectionhandling.h index baa823df..95615d66 100644 --- a/kbattleship/kbattleship/konnectionhandling.h +++ b/kbattleship/kbattleship/konnectionhandling.h @@ -21,7 +21,7 @@ #include <klocale.h> #include <kmessagebox.h> -#include <qobject.h> +#include <tqobject.h> #include "kbattleshipclient.h" #include "kbattleshipserver.h" @@ -32,8 +32,8 @@ class KonnectionHandling : public QObject Q_OBJECT public: enum{SERVER, CLIENT}; - KonnectionHandling(QWidget *parent, KBattleshipServer *server); - KonnectionHandling(QWidget *parent, KBattleshipClient *client); + KonnectionHandling(TQWidget *parent, KBattleshipServer *server); + KonnectionHandling(TQWidget *parent, KBattleshipClient *client); int type() { return m_type; } @@ -49,10 +49,10 @@ public slots: void slotSocketError(int error); signals: - void sigStatusBar(const QString &); - void sigEnemyNickname(const QString &); + void sigStatusBar(const TQString &); + void sigEnemyNickname(const TQString &); void sigEnemyFieldData(int, int, int, int, int, int, int, bool); - void sigClientInformation(const QString &, const QString &, const QString &, const QString &); + void sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &); void sigSendNickname(); void sigSendFieldState(int, int); void sigPlaceShips(bool); @@ -62,7 +62,7 @@ signals: void sigReplay(); void sigLost(KMessage *); void sigAbortNetworkGame(); - void sigChatMessage(const QString &, const QString &, bool); + void sigChatMessage(const TQString &, const TQString &, bool); private: KBattleshipServer *m_kbserver; diff --git a/kbattleship/kbattleship/kserverdialog.cpp b/kbattleship/kbattleship/kserverdialog.cpp index 3936bebf..d8fa1b1d 100644 --- a/kbattleship/kbattleship/kserverdialog.cpp +++ b/kbattleship/kbattleship/kserverdialog.cpp @@ -17,22 +17,22 @@ #include <klocale.h> #include <kuser.h> -#include <qlayout.h> +#include <tqlayout.h> #include "kserverdialog.h" -KServerDialog::KServerDialog(QWidget *parent, const char *name) : +KServerDialog::KServerDialog(TQWidget *parent, const char *name) : KDialogBase(Plain, i18n("Start Server"), Ok|Cancel, Ok, parent, name, true, false, KGuiItem(i18n("&Start"))) { - QFrame* page = plainPage(); - QGridLayout* pageLayout = new QGridLayout(page, 1, 1, 0, 0); + TQFrame* page = plainPage(); + TQGridLayout* pageLayout = new TQGridLayout(page, 1, 1, 0, 0); m_mainWidget = new serverStartDlg(page); pageLayout->addWidget(m_mainWidget, 0, 0); KUser u; m_mainWidget->nicknameEdit->setText(u.loginName()); - QString gamename = u.fullName(); + TQString gamename = u.fullName(); if(gamename.isEmpty()) gamename = u.loginName(); m_mainWidget->gamenameEdit->setText(gamename); } @@ -49,17 +49,17 @@ void KServerDialog::slotCancel() emit cancelClicked(); } -QString KServerDialog::port() const +TQString KServerDialog::port() const { - return QString::number(m_mainWidget->portEdit->value()); + return TQString::number(m_mainWidget->portEdit->value()); } -QString KServerDialog::nickname() const +TQString KServerDialog::nickname() const { return m_mainWidget->nicknameEdit->text(); } -QString KServerDialog::gamename() const +TQString KServerDialog::gamename() const { return m_mainWidget->gamenameEdit->text(); } diff --git a/kbattleship/kbattleship/kserverdialog.h b/kbattleship/kbattleship/kserverdialog.h index e6655c1a..ca455509 100644 --- a/kbattleship/kbattleship/kserverdialog.h +++ b/kbattleship/kbattleship/kserverdialog.h @@ -18,10 +18,10 @@ #ifndef KSERVERDIALOG_H #define KSERVERDIALOG_H -#include <qstring.h> -#include <qpushbutton.h> -#include <qlineedit.h> -#include <qspinbox.h> +#include <tqstring.h> +#include <tqpushbutton.h> +#include <tqlineedit.h> +#include <tqspinbox.h> #include <kdialogbase.h> @@ -32,11 +32,11 @@ class KServerDialog : public KDialogBase { Q_OBJECT public: - KServerDialog(QWidget *parent = 0, const char *name = 0); + KServerDialog(TQWidget *parent = 0, const char *name = 0); - QString port() const; - QString nickname() const; - QString gamename() const; + TQString port() const; + TQString nickname() const; + TQString gamename() const; public slots: virtual void slotOk(); diff --git a/kbattleship/kbattleship/kshiplist.cpp b/kbattleship/kbattleship/kshiplist.cpp index 8a17ad37..6a3463af 100644 --- a/kbattleship/kbattleship/kshiplist.cpp +++ b/kbattleship/kbattleship/kshiplist.cpp @@ -19,7 +19,7 @@ #include "kshiplist.moc" #include <kdebug.h> -KShipList::KShipList() : QObject() +KShipList::KShipList() : TQObject() { m_shiplist.setAutoDelete(true); m_shipsadded = 4; @@ -124,8 +124,8 @@ void KShipList::addNewShip(int button, int fieldx, int fieldy) bool KShipList::addNewShip(bool vertical, int fieldx, int fieldy) { - QRect ship = vertical ? QRect(fieldx, fieldy, 1, m_shipsadded) : QRect(fieldx, fieldy, m_shipsadded, 1); - QRect field = QRect(0, 0, m_fieldx, m_fieldy); + TQRect ship = vertical ? TQRect(fieldx, fieldy, 1, m_shipsadded) : TQRect(fieldx, fieldy, m_shipsadded, 1); + TQRect field = TQRect(0, 0, m_fieldx, m_fieldy); if(!field.contains(ship)) return false; diff --git a/kbattleship/kbattleship/kshiplist.h b/kbattleship/kbattleship/kshiplist.h index 59915a5b..e27705b6 100644 --- a/kbattleship/kbattleship/kshiplist.h +++ b/kbattleship/kbattleship/kshiplist.h @@ -21,7 +21,7 @@ #include <kmessagebox.h> #include <klocale.h> -#include <qptrlist.h> +#include <tqptrlist.h> #include "kbattlefield.h" #include "kship.h" @@ -51,7 +51,7 @@ signals: void sigOwnFieldDataChanged(int, int, int); private: - QPtrList<KShip> m_shiplist; + TQPtrList<KShip> m_shiplist; int m_shipsadded; }; diff --git a/kbattleship/kbattleship/kstatdialog.cpp b/kbattleship/kbattleship/kstatdialog.cpp index 9db2afe4..03bc7d41 100644 --- a/kbattleship/kbattleship/kstatdialog.cpp +++ b/kbattleship/kbattleship/kstatdialog.cpp @@ -15,22 +15,22 @@ * * ***************************************************************************/ -#include <qlcdnumber.h> -#include <qlabel.h> +#include <tqlcdnumber.h> +#include <tqlabel.h> #include "kstatdialog.moc" -KStatDialog::KStatDialog(QWidget *parent, const char *name) : statDlg(parent, name) +KStatDialog::KStatDialog(TQWidget *parent, const char *name) : statDlg(parent, name) { } void KStatDialog::slotAddOwnWon() { - OwnLabel->setText(QString::number(OwnLabel->text().toInt() + 1)); + OwnLabel->setText(TQString::number(OwnLabel->text().toInt() + 1)); } void KStatDialog::slotAddEnemyWon() { - EnemyLabel->setText(QString::number(EnemyLabel->text().toInt() + 1)); + EnemyLabel->setText(TQString::number(EnemyLabel->text().toInt() + 1)); } void KStatDialog::setShot() @@ -72,8 +72,8 @@ void KStatDialog::clear() void KStatDialog::clearWon() { - OwnLabel->setText(QString::number(0)); - EnemyLabel->setText(QString::number(0)); + OwnLabel->setText(TQString::number(0)); + EnemyLabel->setText(TQString::number(0)); } int KStatDialog::shot() diff --git a/kbattleship/kbattleship/kstatdialog.h b/kbattleship/kbattleship/kstatdialog.h index fd9b3dd7..5657fccd 100644 --- a/kbattleship/kbattleship/kstatdialog.h +++ b/kbattleship/kbattleship/kstatdialog.h @@ -24,7 +24,7 @@ class KStatDialog : public statDlg { Q_OBJECT public: - KStatDialog(QWidget *parent = 0, const char *name = 0); + KStatDialog(TQWidget *parent = 0, const char *name = 0); void setShot(); void setShot(int shot); diff --git a/kbattleship/kbattleship/main.cpp b/kbattleship/kbattleship/main.cpp index 2fdba01e..2ce685d8 100644 --- a/kbattleship/kbattleship/main.cpp +++ b/kbattleship/kbattleship/main.cpp @@ -51,8 +51,8 @@ int main(int argc, char *argv[]) KApplication app; KGlobal::locale()->insertCatalogue("libkdegames"); - QString picDirCheck = locate("data", "kbattleship/pictures/"); - QString onePicCheck = locate("data", "kbattleship/pictures/hit.png"); + TQString picDirCheck = locate("data", "kbattleship/pictures/"); + TQString onePicCheck = locate("data", "kbattleship/pictures/hit.png"); if(picDirCheck.isEmpty() || onePicCheck.isEmpty()) { KMessageBox::error(0, i18n("You don't have KBattleship pictures installed. The game cannot run without them!")); diff --git a/kblackbox/kbbgame.cpp b/kblackbox/kbbgame.cpp index 82028871..6370291d 100644 --- a/kblackbox/kbbgame.cpp +++ b/kblackbox/kbbgame.cpp @@ -10,12 +10,12 @@ #include <config.h> -#include <qpopupmenu.h> -#include <qkeycode.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qtooltip.h> -#include <qstring.h> +#include <tqpopupmenu.h> +#include <tqkeycode.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqtooltip.h> +#include <tqstring.h> #include <kmessagebox.h> #include <kdebug.h> @@ -58,8 +58,8 @@ KBBGame::KBBGame() { int i; - QPixmap **pix = new QPixmap * [NROFTYPES]; - pix[0] = new QPixmap(); + TQPixmap **pix = new TQPixmap * [NROFTYPES]; + pix[0] = new TQPixmap(); *pix[0] = BarIcon( pFNames[0] ); if (!pix[0]->isNull()) { kdDebug(12009) << "Pixmap \"" << pFNames[0] << "\" loaded." << endl; @@ -89,15 +89,15 @@ KBBGame::KBBGame() initKAction(); - connect( gr, SIGNAL(inputAt(int,int,int)), - this, SLOT(gotInputAt(int,int,int)) ); - connect( this, SIGNAL(gameRuns(bool)), - gr, SLOT(setInputAccepted(bool)) ); - connect( gr, SIGNAL(endMouseClicked()), - this, SLOT(gameFinished()) ); + connect( gr, TQT_SIGNAL(inputAt(int,int,int)), + this, TQT_SLOT(gotInputAt(int,int,int)) ); + connect( this, TQT_SIGNAL(gameRuns(bool)), + gr, TQT_SLOT(setInputAccepted(bool)) ); + connect( gr, TQT_SIGNAL(endMouseClicked()), + this, TQT_SLOT(gameFinished()) ); /* - QToolTip::add( doneButton, i18n( + TQToolTip::add( doneButton, i18n( "Click here when you think you placed all the balls.") ); */ @@ -164,7 +164,7 @@ KBBGame::KBBGame() KBBGame::~KBBGame() { KConfig *kConf; - QString s; + TQString s; kConf = kapp->config(); kConf->setGroup( "KBlackBox Setup" ); @@ -266,7 +266,7 @@ void KBBGame::newGame() if (running) { bool cancel; cancel = KMessageBox::warningContinueCancel(0, - i18n("Do you really want to give up this game?"),QString::null,i18n("Give Up")) + i18n("Do you really want to give up this game?"),TQString::null,i18n("Give Up")) == KMessageBox::Cancel; if (cancel) return; @@ -314,7 +314,7 @@ void KBBGame::newGame() void KBBGame::gameFinished() { if (running) { - QString s; + TQString s; if (ballsPlaced == balls) { getResults(); abortGame(); @@ -388,7 +388,7 @@ void KBBGame::giveUp() bool stop; stop = KMessageBox::warningContinueCancel(0, i18n( - "Do you really want to give up this game?"),QString::null,i18n("Give Up")) + "Do you really want to give up this game?"),TQString::null,i18n("Give Up")) == KMessageBox::Continue; if (stop) { @@ -404,8 +404,8 @@ void KBBGame::giveUp() void KBBGame::updateStats() { - QString tmp; - QString s = i18n("Run: "); + TQString tmp; + TQString s = i18n("Run: "); if (running) s += i18n("Yes"); else @@ -442,7 +442,7 @@ bool KBBGame::setSize( int w, int h ) if (running) { ok = KMessageBox::warningContinueCancel(0, i18n( - "This will be the end of the current game!"),QString::null,i18n("End Game")) + "This will be the end of the current game!"),TQString::null,i18n("End Game")) == KMessageBox::Continue; } else ok = TRUE; @@ -470,7 +470,7 @@ bool KBBGame::setBalls( int n ) if (balls != n) { if (running) { ok = KMessageBox::warningContinueCancel(0, - i18n("This will be the end of the current game!"),QString::null,i18n("End Game")) + i18n("This will be the end of the current game!"),TQString::null,i18n("End Game")) == KMessageBox::Continue; } else ok = TRUE; if (ok) { @@ -698,37 +698,37 @@ void KBBGame::gotInputAt( int col, int row, int state ) void KBBGame::initKAction() { // game - KStdGameAction::gameNew(this, SLOT(newGame()), actionCollection()); - (void)new KAction( i18n("&Give Up"), SmallIcon("giveup"), 0, this, SLOT(giveUp()), actionCollection(), "game_giveup" ); - (void)new KAction( i18n("&Done"), SmallIcon("done"), 0, this, SLOT(gameFinished()), actionCollection(), "game_done" ); - (void)new KAction( i18n("&Resize"), 0, this, SLOT(slotResize()), actionCollection(), "game_resize" ); - KStdGameAction::quit(this, SLOT(close()), actionCollection()); + KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection()); + (void)new KAction( i18n("&Give Up"), SmallIcon("giveup"), 0, this, TQT_SLOT(giveUp()), actionCollection(), "game_giveup" ); + (void)new KAction( i18n("&Done"), SmallIcon("done"), 0, this, TQT_SLOT(gameFinished()), actionCollection(), "game_done" ); + (void)new KAction( i18n("&Resize"), 0, this, TQT_SLOT(slotResize()), actionCollection(), "game_resize" ); + KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); // settings - sizeAction = new KSelectAction( i18n("&Size"), 0, this, SLOT(slotSize()), actionCollection(), "options_size"); - QStringList list; + sizeAction = new KSelectAction( i18n("&Size"), 0, this, TQT_SLOT(slotSize()), actionCollection(), "options_size"); + TQStringList list; list.append(i18n(" 8 x 8 ")); list.append(i18n(" 10 x 10 ")); list.append(i18n(" 12 x 12 ")); sizeAction->setItems(list); - ballsAction = new KSelectAction( i18n("&Balls"), 0, this, SLOT(slotBalls()), actionCollection(), "options_balls"); + ballsAction = new KSelectAction( i18n("&Balls"), 0, this, TQT_SLOT(slotBalls()), actionCollection(), "options_balls"); list.clear(); list.append(i18n(" 4 ")); list.append(i18n(" 6 ")); list.append(i18n(" 8 ")); ballsAction->setItems(list); - tutorialAction = new KToggleAction( i18n("&Tutorial"), 0, this, SLOT(tutorialSwitch()), actionCollection(), "options_tutorial" ); -// KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), + tutorialAction = new KToggleAction( i18n("&Tutorial"), 0, this, TQT_SLOT(tutorialSwitch()), actionCollection(), "options_tutorial" ); +// KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), //actionCollection()); // keyboard only - (void)new KAction( i18n("Move Down"), Qt::Key_Down, gr, SLOT(slotDown()), actionCollection(), "move_down" ); - (void)new KAction( i18n("Move Up"), Qt::Key_Up, gr, SLOT(slotUp()), actionCollection(), "move_up" ); - (void)new KAction( i18n("Move Left"), Qt::Key_Left, gr, SLOT(slotLeft()), actionCollection(), "move_left" ); - (void)new KAction( i18n("Move Right"), Qt::Key_Right, gr, SLOT(slotRight()), actionCollection(), "move_right" ); - (void)new KAction( i18n("Trigger Action"), Qt::Key_Return, gr, SLOT(slotInput()), actionCollection(), "move_trigger" ); + (void)new KAction( i18n("Move Down"), Qt::Key_Down, gr, TQT_SLOT(slotDown()), actionCollection(), "move_down" ); + (void)new KAction( i18n("Move Up"), Qt::Key_Up, gr, TQT_SLOT(slotUp()), actionCollection(), "move_up" ); + (void)new KAction( i18n("Move Left"), Qt::Key_Left, gr, TQT_SLOT(slotLeft()), actionCollection(), "move_left" ); + (void)new KAction( i18n("Move Right"), Qt::Key_Right, gr, TQT_SLOT(slotRight()), actionCollection(), "move_right" ); + (void)new KAction( i18n("Trigger Action"), Qt::Key_Return, gr, TQT_SLOT(slotInput()), actionCollection(), "move_trigger" ); } void KBBGame::slotResize() diff --git a/kblackbox/kbbgame.h b/kblackbox/kbbgame.h index 70f6ad48..85b12e29 100644 --- a/kblackbox/kbbgame.h +++ b/kblackbox/kbbgame.h @@ -93,8 +93,8 @@ private: KBBGraphic *gr; int score; - /* QLabel *scoreText; - QLabel *statusText;*/ + /* TQLabel *scoreText; + TQLabel *statusText;*/ KRandomSequence random; KSelectAction *ballsAction, *sizeAction; diff --git a/kblackbox/kbbgfx.cpp b/kblackbox/kbbgfx.cpp index d37edc1e..79e4b029 100644 --- a/kblackbox/kbbgfx.cpp +++ b/kblackbox/kbbgfx.cpp @@ -9,11 +9,11 @@ // The implementation of the KBBGraphic widget // -#include <qpainter.h> -#include <qpixmap.h> -#include <qcolor.h> -#include <qkeycode.h> -#include <qwmatrix.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqcolor.h> +#include <tqkeycode.h> +#include <tqwmatrix.h> #include "kbbgfx.h" #include "util.h" @@ -22,8 +22,8 @@ Constructs a KBBGraphic widget. */ -KBBGraphic::KBBGraphic( QPixmap **p, QWidget* parent, const char* name ) - : QWidget( parent, name ) +KBBGraphic::KBBGraphic( TQPixmap **p, TQWidget* parent, const char* name ) + : TQWidget( parent, name ) { int i; @@ -37,7 +37,7 @@ KBBGraphic::KBBGraphic( QPixmap **p, QWidget* parent, const char* name ) pix = p; if (pix == NULL) pixScaled = NULL; else { - pixScaled = new QPixmap * [NROFTYPES]; + pixScaled = new TQPixmap * [NROFTYPES]; for (i = 0; i < NROFTYPES; i++) { pixScaled[i] = new QPixmap; } @@ -117,7 +117,7 @@ void KBBGraphic::setNumCols( int cols ) void KBBGraphic::scalePixmaps( int w, int h ) { int i, w0, h0; - QWMatrix wm; + TQWMatrix wm; w0 = pix[0]->width(); h0 = pix[0]->height(); @@ -137,7 +137,7 @@ int KBBGraphic::width() { return cellW * numRows; } int KBBGraphic::height() { return cellH * numCols; } int KBBGraphic::wHint() const { return minW; } int KBBGraphic::hHint() const { return minH; } -QSize KBBGraphic::sizeHint() const { return QSize(wHint(), hHint()); } +TQSize KBBGraphic::sizeHint() const { return TQSize(wHint(), hHint()); } /* Returns a pointer to graphicBoard @@ -149,20 +149,20 @@ RectOnArray *KBBGraphic::getGraphicBoard() { return graphicBoard; } Handles cell painting for the KBBGraphic widget. */ -void KBBGraphic::paintCell( QPainter* p, int row, int col ) +void KBBGraphic::paintCell( TQPainter* p, int row, int col ) { if (pix == NULL) paintCellDefault( p, row, col ); else paintCellPixmap( p, row, col ); } -void KBBGraphic::paintCellPixmap( QPainter* p, int row, int col ) +void KBBGraphic::paintCellPixmap( TQPainter* p, int row, int col ) { int w = cellW; int h = cellH; int x2 = w - 1; int y2 = h - 1; int type; - QPixmap pm; + TQPixmap pm; // kdDebug(12009) << p->viewport().width() << endl; @@ -193,7 +193,7 @@ void KBBGraphic::paintCellPixmap( QPainter* p, int row, int col ) /* Extra drawings for boxes aroud lasers. */ - QString s; + TQString s; switch (type) { case RLASERBBG: s.sprintf( "%c", 'R' ); @@ -225,14 +225,14 @@ void KBBGraphic::paintCellPixmap( QPainter* p, int row, int col ) } } -void KBBGraphic::paintCellDefault( QPainter* p, int row, int col ) +void KBBGraphic::paintCellDefault( TQPainter* p, int row, int col ) { int w = cellW; int h = cellH; int x2 = w - 1; int y2 = h - 1; int type; - QColor color; + TQColor color; switch (type = graphicBoard->get( col, row )) { case MARK1BBG: color = darkRed; break; @@ -254,7 +254,7 @@ void KBBGraphic::paintCellDefault( QPainter* p, int row, int col ) /* Extra drawings for boxes aroud lasers. */ - QString s; + TQString s; switch (type) { case RLASERBBG: s.sprintf( "%c", 'R' ); @@ -289,10 +289,10 @@ void KBBGraphic::paintCellDefault( QPainter* p, int row, int col ) Xperimantal... */ -void KBBGraphic::paintEvent( QPaintEvent* ) +void KBBGraphic::paintEvent( TQPaintEvent* ) { int i, j; - QPainter paint( drawBuffer ); + TQPainter paint( drawBuffer ); // kdDebug(12009) << drawBuffer->width() << endl; for (i = 0; i < numRows; i++) { @@ -308,10 +308,10 @@ void KBBGraphic::paintEvent( QPaintEvent* ) Resize event of the KBBGraphic widget. */ -void KBBGraphic::resizeEvent( QResizeEvent* ) +void KBBGraphic::resizeEvent( TQResizeEvent* ) { - int w = QWidget::width(); - int h = QWidget::height(); + int w = TQWidget::width(); + int h = TQWidget::height(); int wNew, hNew; // kbDebug() << w << " " << h << " " << minW << " " << minH << endl; @@ -330,13 +330,13 @@ void KBBGraphic::resizeEvent( QResizeEvent* ) setCellHeight( hNew ); delete drawBuffer; - drawBuffer = new QPixmap( cellW * numRows, cellH * numCols ); + drawBuffer = new TQPixmap( cellW * numRows, cellH * numCols ); } /* Handles mouse press events for the KBBGraphic widget. */ -void KBBGraphic::mousePressEvent( QMouseEvent* e ) +void KBBGraphic::mousePressEvent( TQMouseEvent* e ) { if (inputAccepted) { /* @@ -348,7 +348,7 @@ void KBBGraphic::mousePressEvent( QMouseEvent* e ) } int oldRow = curRow; int oldCol = curCol; - QPoint pos = e->pos(); // extract pointer position + TQPoint pos = e->pos(); // extract pointer position curRow = pos.y() / cellH; curCol = pos.x() / cellW; //kdDebug(12009) << e->state() << " " << LeftButton << " " << e->state()&LeftButton << endl; @@ -362,11 +362,11 @@ void KBBGraphic::mousePressEvent( QMouseEvent* e ) Handles mouse move events for the KBBGraphic widget. */ -void KBBGraphic::mouseMoveEvent( QMouseEvent* e ) { +void KBBGraphic::mouseMoveEvent( TQMouseEvent* e ) { if (inputAccepted) { int oldRow = curRow; int oldCol = curCol; - QPoint pos = e->pos(); // extract pointer position + TQPoint pos = e->pos(); // extract pointer position int movRow = pos.y() / cellH; int movCol = pos.x() / cellW; // kdDebug(12009) << movRow << " " << curRow << endl; @@ -432,7 +432,7 @@ void KBBGraphic::moveSelection(int drow, int dcol) Handles focus reception events for the KBBGraphic widget. */ -void KBBGraphic::focusInEvent( QFocusEvent* ) +void KBBGraphic::focusInEvent( TQFocusEvent* ) { repaint( FALSE ); } @@ -442,7 +442,7 @@ void KBBGraphic::focusInEvent( QFocusEvent* ) Handles focus loss events for the KBBGraphic widget. */ -void KBBGraphic::focusOutEvent( QFocusEvent* ) +void KBBGraphic::focusOutEvent( TQFocusEvent* ) { repaint( FALSE ); } @@ -464,7 +464,7 @@ void KBBGraphic::setInputAccepted( bool b ) void KBBGraphic::updateElement( int col, int row ) { - QPainter paint( this ); + TQPainter paint( this ); paint.setViewport( col * cellW, row * cellH, width(), height() ); paintCell( &paint, row, col ); diff --git a/kblackbox/kbbgfx.h b/kblackbox/kbbgfx.h index ae4d207c..16d97298 100644 --- a/kblackbox/kbbgfx.h +++ b/kblackbox/kbbgfx.h @@ -12,8 +12,8 @@ #ifndef KBBGFX_H #define KBBGFX_H -#include <qwidget.h> -#include <qpixmap.h> +#include <tqwidget.h> +#include <tqpixmap.h> #include "util.h" @@ -54,7 +54,7 @@ class KBBGraphic : public QWidget { Q_OBJECT public: - KBBGraphic( QPixmap** p=0, QWidget* parent=0, const char* name=0 ); + KBBGraphic( TQPixmap** p=0, TQWidget* parent=0, const char* name=0 ); ~KBBGraphic(); friend class KBBGame; @@ -87,20 +87,20 @@ signals: void endMouseClicked(); protected: - virtual QSize sizeHint() const; - void paintEvent( QPaintEvent* ); - void mousePressEvent( QMouseEvent* ); - void mouseMoveEvent( QMouseEvent* ); - void focusInEvent( QFocusEvent* ); - void focusOutEvent( QFocusEvent* ); - void resizeEvent( QResizeEvent* e ); + virtual TQSize sizeHint() const; + void paintEvent( TQPaintEvent* ); + void mousePressEvent( TQMouseEvent* ); + void mouseMoveEvent( TQMouseEvent* ); + void focusInEvent( TQFocusEvent* ); + void focusOutEvent( TQFocusEvent* ); + void resizeEvent( TQResizeEvent* e ); void moveSelection(int drow, int dcol); private: - void paintCell( QPainter* p, int row, int col ); - void paintCellDefault( QPainter*, int row, int col ); - void paintCellPixmap( QPainter*, int row, int col ); + void paintCell( TQPainter* p, int row, int col ); + void paintCellDefault( TQPainter*, int row, int col ); + void paintCellPixmap( TQPainter*, int row, int col ); void scalePixmaps( int w, int h ); RectOnArray *graphicBoard; int curRow; @@ -112,9 +112,9 @@ private: int cellH; int numCols; int numRows; - QPixmap **pix; - QPixmap **pixScaled; - QPixmap *drawBuffer; + TQPixmap **pix; + TQPixmap **pixScaled; + TQPixmap *drawBuffer; }; #endif // KBBGFX_H diff --git a/kbounce/game.cpp b/kbounce/game.cpp index 853a645d..0c5f1e2d 100644 --- a/kbounce/game.cpp +++ b/kbounce/game.cpp @@ -18,11 +18,11 @@ #include <stdlib.h> -#include <qtimer.h> +#include <tqtimer.h> #include <kstandarddirs.h> #include <kapplication.h> #include <kdebug.h> -#include <qimage.h> +#include <tqimage.h> #include <kglobalsettings.h> #include "game.h" @@ -47,13 +47,13 @@ #if HAVE_ARTS SimpleSoundServer *JezzGame::m_artsServer = 0; #endif -QString JezzGame::m_soundPath; +TQString JezzGame::m_soundPath; bool JezzGame::m_sound = true; #define MS2TICKS( ms ) ((ms)/GAME_DELAY) -Ball::Ball(QCanvasPixmapArray* array, QCanvas* canvas) - : QCanvasSprite( array, canvas ), m_animDelay( 0 ), m_soundDelay( MS2TICKS(BALL_ANIM_DELAY)/2 ) +Ball::Ball(TQCanvasPixmapArray* array, TQCanvas* canvas) + : TQCanvasSprite( array, canvas ), m_animDelay( 0 ), m_soundDelay( MS2TICKS(BALL_ANIM_DELAY)/2 ) { } @@ -90,7 +90,7 @@ void Ball::advance(int stage) if ( !reflectX && !reflectY && collide(xVelocity(), yVelocity()) ) reflectX = reflectY = true; // emit collision - QRect r = boundingRect(); + TQRect r = boundingRect(); r.moveBy( xVelocity(), yVelocity() ); JezzField* field = (JezzField *)canvas(); @@ -117,12 +117,12 @@ void Ball::advance(int stage) // update field update(); - QCanvasSprite::advance( stage ); + TQCanvasSprite::advance( stage ); } bool Ball::collide( double dx, double dy ) { - QRect r = boundingRect(); + TQRect r = boundingRect(); r.moveBy( dx, dy ); JezzField* field = (JezzField *)canvas(); @@ -136,8 +136,8 @@ bool Ball::collide( double dx, double dy ) /*************************************************************************/ -Wall::Wall( JezzField *field, int x, int y, Direction dir, int tile, QObject *parent, const char *name ) - : QObject( parent, name ), m_dir( dir ), m_field( field ), m_startX( x ), m_startY( y ), +Wall::Wall( JezzField *field, int x, int y, Direction dir, int tile, TQObject *parent, const char *name ) + : TQObject( parent, name ), m_dir( dir ), m_field( field ), m_startX( x ), m_startY( y ), m_tile( tile ), m_delay( MS2TICKS(WALL_DELAY)/2 ), m_active( true ) { //kdDebug(12008) << "Wall::Wall" << endl; @@ -169,7 +169,7 @@ bool Wall::isFree( int x, int y ) if ( m_field->tile(x, y)==TILE_FREE ) { // check whether there is a ball at the moment - QCanvasItemList cols = m_field->collisions( QRect(x*TILE_SIZE, y*TILE_SIZE, + TQCanvasItemList cols = m_field->collisions( TQRect(x*TILE_SIZE, y*TILE_SIZE, TILE_SIZE, TILE_SIZE) ); if ( cols.count()==0 ) return true; @@ -236,8 +236,8 @@ void Wall::fill( bool black ) /*************************************************************************/ -JezzField::JezzField( const QPixmap &tiles, const QPixmap &background, QObject* parent, const char* name ) - : QCanvas( parent, name ), m_tiles( tiles ) +JezzField::JezzField( const TQPixmap &tiles, const TQPixmap &background, TQObject* parent, const char* name ) + : TQCanvas( parent, name ), m_tiles( tiles ) { setPixmaps( tiles, background ); } @@ -250,7 +250,7 @@ void JezzField::setGameTile( int x, int y, bool black ) setTile( x, y, black ? TILE_BORDER : TILE_FREE ); } -void JezzField::setBackground( const QPixmap &background ) +void JezzField::setBackground( const TQPixmap &background ) { // copy current field into buffer int backup[FIELD_WIDTH][FIELD_HEIGHT]; @@ -287,18 +287,18 @@ void JezzField::setBackground( const QPixmap &background ) setTile( x, FIELD_HEIGHT-1, TILE_BORDER ); } -void JezzField::setPixmaps( const QPixmap &tiles, const QPixmap &background ) +void JezzField::setPixmaps( const TQPixmap &tiles, const TQPixmap &background ) { // create new tiles - QPixmap allTiles( TILE_SIZE*(FIELD_WIDTH-2), TILE_SIZE*(FIELD_HEIGHT-1) ); + TQPixmap allTiles( TILE_SIZE*(FIELD_WIDTH-2), TILE_SIZE*(FIELD_HEIGHT-1) ); if ( background.width()==0 || background.height()==0 ) { m_background = false; } else { // handle background m_background = true; - QImage img = background.convertToImage(); - QPixmap scalledBackground( img.smoothScale( TILE_SIZE*(FIELD_WIDTH-2), + TQImage img = background.convertToImage(); + TQPixmap scalledBackground( img.smoothScale( TILE_SIZE*(FIELD_WIDTH-2), TILE_SIZE*(FIELD_HEIGHT-2) ) ); bitBlt( &allTiles, 0, 0, &scalledBackground, 0, 0, scalledBackground.width(), scalledBackground.height() ); } @@ -314,8 +314,8 @@ void JezzField::setPixmaps( const QPixmap &tiles, const QPixmap &background ) /*************************************************************************/ -JezzView::JezzView(QCanvas* viewing, QWidget* parent, const char* name, WFlags f) - : QCanvasView( viewing, parent, name, f ), m_vertical( false ) +JezzView::JezzView(TQCanvas* viewing, TQWidget* parent, const char* name, WFlags f) + : TQCanvasView( viewing, parent, name, f ), m_vertical( false ) { setResizePolicy( AutoOne ); setHScrollBarMode( AlwaysOff ); @@ -324,7 +324,7 @@ JezzView::JezzView(QCanvas* viewing, QWidget* parent, const char* name, WFlags f setCursor( sizeHorCursor ); } -void JezzView::viewportMouseReleaseEvent( QMouseEvent *ev ) +void JezzView::viewportMouseReleaseEvent( TQMouseEvent *ev ) { if ( ev->button() & RightButton ) { @@ -340,17 +340,17 @@ void JezzView::viewportMouseReleaseEvent( QMouseEvent *ev ) /*************************************************************************/ -JezzGame::JezzGame( const QPixmap &background, int ballNum, QWidget *parent, const char *name ) - : QWidget( parent, name ), m_wall1( 0 ), m_wall2( 0 ), +JezzGame::JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent, const char *name ) + : TQWidget( parent, name ), m_wall1( 0 ), m_wall2( 0 ), m_text( 0 ), m_running( false ), m_percent( 0 ), m_pictured( false ) { - QString path = kapp->dirs()->findResourceDir( "data", "kbounce/pics/ball0000.png" ) + "kbounce/pics/"; + TQString path = kapp->dirs()->findResourceDir( "data", "kbounce/pics/ball0000.png" ) + "kbounce/pics/"; // load gfx - m_ballPixmaps = new QCanvasPixmapArray( path + "ball%1.png", 25 ); + m_ballPixmaps = new TQCanvasPixmapArray( path + "ball%1.png", 25 ); for ( unsigned n=0; n<m_ballPixmaps->count(); n++ ) m_ballPixmaps->image(n)->setOffset( 0, 0 ); - QPixmap tiles( path + "tiles.png" ); + TQPixmap tiles( path + "tiles.png" ); // setup arts #if HAVE_ARTS @@ -378,13 +378,13 @@ JezzGame::JezzGame( const QPixmap &background, int ballNum, QWidget *parent, con for ( int x=0; x<FIELD_WIDTH; x++ ) m_field->setTile( x, FIELD_HEIGHT-1, TILE_BORDER ); - connect( m_field, SIGNAL(ballCollision(Ball *, int, int, int)), this, SLOT(ballCollision(Ball *, int, int, int)) ); + connect( m_field, TQT_SIGNAL(ballCollision(Ball *, int, int, int)), this, TQT_SLOT(ballCollision(Ball *, int, int, int)) ); // create view m_view = new JezzView( m_field, this, "m_view" ); m_view->move( 0, 0 ); m_view->adjustSize(); - connect( m_view, SIGNAL(buildWall(int, int, bool)), this, SLOT(buildWall(int, int, bool)) ); + connect( m_view, TQT_SIGNAL(buildWall(int, int, bool)), this, TQT_SLOT(buildWall(int, int, bool)) ); // create balls for ( int n=0; n<ballNum; n++ ) @@ -399,11 +399,11 @@ JezzGame::JezzGame( const QPixmap &background, int ballNum, QWidget *parent, con } // create text label - m_text = new QCanvasText( m_field ); + m_text = new TQCanvasText( m_field ); // create game clock - m_clock = new QTimer( this ); - connect( m_clock, SIGNAL(timeout()), this, SLOT(tick()) ); + m_clock = new TQTimer( this ); + connect( m_clock, TQT_SIGNAL(timeout()), this, TQT_SLOT(tick()) ); m_clock->start( GAME_DELAY ); // setup geometry @@ -422,20 +422,20 @@ JezzGame::~JezzGame() } -void JezzGame::display( const QString &text, int size ) +void JezzGame::display( const TQString &text, int size ) { qDebug("This function \"display\" shouldn't be called!!!"); if ( !text.isEmpty() ) { //kdDebug(12008) << "text = " << text << endl; - QFont font = KGlobalSettings::generalFont(); + TQFont font = KGlobalSettings::generalFont(); font.setBold(true); font.setPointSize(size); m_text->setFont( font ); m_text->setText( text ); - QRect size = m_text->boundingRect(); + TQRect size = m_text->boundingRect(); m_text->move( ( FIELD_WIDTH*TILE_SIZE - size.width() ) / 2, ( FIELD_HEIGHT*TILE_SIZE - size.height() ) / 2 ); @@ -446,12 +446,12 @@ void JezzGame::display( const QString &text, int size ) } } -void JezzGame::playSound( const QString &name ) +void JezzGame::playSound( const TQString &name ) { #if HAVE_ARTS if( !m_artsServer->isNull() && m_sound) { - QString path = m_soundPath + name; + TQString path = m_soundPath + name; m_artsServer->play( path.latin1() ); } #else @@ -459,7 +459,7 @@ void JezzGame::playSound( const QString &name ) #endif } -void JezzGame::setBackground( const QPixmap &background ) +void JezzGame::setBackground( const TQPixmap &background ) { m_field->setBackground( background ); } @@ -603,7 +603,7 @@ void JezzGame::buildWall( int x, int y, bool vertical ) playSound( "wallstart.au" ); // check whether there is a ball at the moment - QCanvasItemList cols = m_field->collisions( QRect(x*TILE_SIZE, y*TILE_SIZE, TILE_SIZE, TILE_SIZE) ); + TQCanvasItemList cols = m_field->collisions( TQRect(x*TILE_SIZE, y*TILE_SIZE, TILE_SIZE, TILE_SIZE) ); if ( cols.count()>0 ) { kdDebug(12008) << "Direct collision" << endl; @@ -618,8 +618,8 @@ void JezzGame::buildWall( int x, int y, bool vertical ) vertical? Wall::Up : Wall::Left, vertical? TILE_WALLUP : TILE_WALLLEFT, this, "m_wall1" ); - connect( m_wall1, SIGNAL(finished(Wall *, int)), - this, SLOT(wallFinished(Wall *, int)) ); } + connect( m_wall1, TQT_SIGNAL(finished(Wall *, int)), + this, TQT_SLOT(wallFinished(Wall *, int)) ); } if ( !m_wall2 ) { @@ -627,8 +627,8 @@ void JezzGame::buildWall( int x, int y, bool vertical ) vertical? Wall::Down: Wall::Right, vertical? TILE_WALLDOWN : TILE_WALLRIGHT, this, "m_wall2" ); - connect( m_wall2, SIGNAL(finished(Wall *, int)), - this, SLOT(wallFinished(Wall *, int)) ); + connect( m_wall2, TQT_SIGNAL(finished(Wall *, int)), + this, TQT_SLOT(wallFinished(Wall *, int)) ); } } } diff --git a/kbounce/game.h b/kbounce/game.h index eb5208cd..b7ebe769 100644 --- a/kbounce/game.h +++ b/kbounce/game.h @@ -19,9 +19,9 @@ #ifndef GAME_H_INCLUDED #define GAME_H_INCLUDED -#include <qwidget.h> -#include <qcanvas.h> -#include <qmemarray.h> +#include <tqwidget.h> +#include <tqcanvas.h> +#include <tqmemarray.h> #if HAVE_ARTS #include <arts/soundserver.h> @@ -38,7 +38,7 @@ class JezzField; class Ball : public QCanvasSprite { public: - Ball(QCanvasPixmapArray* array, QCanvas* canvas); + Ball(TQCanvasPixmapArray* array, TQCanvas* canvas); void update(); void advance(int stage); @@ -57,7 +57,7 @@ public: enum Direction { Up, Down, Left, Right }; Wall( JezzField *field, int x, int y, Direction dir, int tile, - QObject *parent=0, const char *name=0 ); + TQObject *parent=0, const char *name=0 ); void finish(); void fill( bool black ); @@ -87,10 +87,10 @@ class JezzField : public QCanvas { Q_OBJECT public: - JezzField( const QPixmap &tiles, const QPixmap &background, QObject* parent = 0, const char* name = 0 ); + JezzField( const TQPixmap &tiles, const TQPixmap &background, TQObject* parent = 0, const char* name = 0 ); void setGameTile( int x, int y, bool black ); - void setBackground( const QPixmap &background ); + void setBackground( const TQPixmap &background ); signals: void ballCollision( Ball *ball, int x, int y, int tile ); @@ -98,10 +98,10 @@ signals: private: friend class Ball; bool m_background; - QPixmap m_tiles; - QMemArray<QPixmap> m_backTiles; + TQPixmap m_tiles; + TQMemArray<TQPixmap> m_backTiles; - void setPixmaps( const QPixmap &tiles, const QPixmap &background ); + void setPixmaps( const TQPixmap &tiles, const TQPixmap &background ); void emitBallCollisiton( Ball *ball, int x, int y, int tile ) { emit ballCollision( ball, x, y, tile ); } @@ -112,13 +112,13 @@ class JezzView : public QCanvasView { Q_OBJECT public: - JezzView(QCanvas* viewing=0, QWidget* parent=0, const char* name=0, WFlags f=0); + JezzView(TQCanvas* viewing=0, TQWidget* parent=0, const char* name=0, WFlags f=0); signals: void buildWall( int x, int y, bool vertical ); protected: - void viewportMouseReleaseEvent( QMouseEvent * ); + void viewportMouseReleaseEvent( TQMouseEvent * ); private: bool m_vertical; @@ -130,13 +130,13 @@ class JezzGame : public QWidget Q_OBJECT public: - JezzGame( const QPixmap &background, int ballNum, QWidget *parent=0, const char *name=0 ); + JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent=0, const char *name=0 ); ~JezzGame(); int percent(); - static void playSound( const QString &name ); - void display( const QString &text, int size=20 ); - void setBackground( const QPixmap &background ); + static void playSound( const TQString &name ); + void display( const TQString &text, int size=20 ); + void setBackground( const TQPixmap &background ); signals: void died(); @@ -164,11 +164,11 @@ protected: Wall *m_wall1, *m_wall2; - QPtrList<Ball> m_balls; - QCanvasPixmapArray *m_ballPixmaps; - QCanvasText *m_text; + TQPtrList<Ball> m_balls; + TQCanvasPixmapArray *m_ballPixmaps; + TQCanvasText *m_text; - QTimer *m_clock; + TQTimer *m_clock; bool m_running; int m_percent; bool m_pictured; @@ -176,7 +176,7 @@ protected: #if HAVE_ARTS static SimpleSoundServer *m_artsServer; #endif - static QString m_soundPath; + static TQString m_soundPath; static bool m_sound; }; diff --git a/kbounce/kbounce.cpp b/kbounce/kbounce.cpp index eab691b8..65fcaae9 100644 --- a/kbounce/kbounce.cpp +++ b/kbounce/kbounce.cpp @@ -16,13 +16,13 @@ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qlayout.h> +#include <tqlayout.h> #include <klocale.h> #include <kapplication.h> #include <kaction.h> #include <kstdgameaction.h> -#include <qtimer.h> -#include <qlcdnumber.h> +#include <tqtimer.h> +#include <tqlcdnumber.h> #include <kmessagebox.h> #include <kdebug.h> #include <kfiledialog.h> @@ -51,51 +51,51 @@ KJezzball::KJezzball() m_soundAction -> setChecked((config->readBoolEntry( "PlaySounds", true ))); // create widgets - m_view = new QWidget( this, "m_view" ); + m_view = new TQWidget( this, "m_view" ); setCentralWidget( m_view ); - m_layout = new QGridLayout( m_view, 1, 3 ); + m_layout = new TQGridLayout( m_view, 1, 3 ); m_layout->setColStretch( 2, 1 ); - QVBoxLayout *infoLayout = new QVBoxLayout; + TQVBoxLayout *infoLayout = new QVBoxLayout; m_layout->addLayout( infoLayout, 0, 1 ); - QLabel *label = new QLabel( i18n("Level:"), m_view ); + TQLabel *label = new TQLabel( i18n("Level:"), m_view ); infoLayout->addWidget( label ); - m_levelLCD = new QLCDNumber( 5, m_view ); + m_levelLCD = new TQLCDNumber( 5, m_view ); infoLayout->addWidget( m_levelLCD ); - label = new QLabel( i18n("Score:"), m_view ); + label = new TQLabel( i18n("Score:"), m_view ); infoLayout->addWidget( label ); - m_scoreLCD = new QLCDNumber( 5, m_view ); + m_scoreLCD = new TQLCDNumber( 5, m_view ); infoLayout->addWidget( m_scoreLCD ); infoLayout->addSpacing( 20 ); - label = new QLabel( i18n("Filled area:"), m_view ); + label = new TQLabel( i18n("Filled area:"), m_view ); infoLayout->addWidget( label ); - m_percentLCD = new QLCDNumber( 5, m_view ); + m_percentLCD = new TQLCDNumber( 5, m_view ); infoLayout->addWidget( m_percentLCD ); - label = new QLabel( i18n("Lives:"), m_view ); + label = new TQLabel( i18n("Lives:"), m_view ); infoLayout->addWidget( label ); - m_lifesLCD = new QLCDNumber( 5, m_view ); + m_lifesLCD = new TQLCDNumber( 5, m_view ); infoLayout->addWidget( m_lifesLCD ); - label = new QLabel( i18n("Time:"), m_view ); + label = new TQLabel( i18n("Time:"), m_view ); infoLayout->addWidget( label ); - m_timeLCD = new QLCDNumber( 5, m_view ); + m_timeLCD = new TQLCDNumber( 5, m_view ); infoLayout->addWidget( m_timeLCD ); // create timers - m_nextLevelTimer = new QTimer( this, "m_nextLevelTimer" ); - connect( m_nextLevelTimer, SIGNAL(timeout()), this, SLOT(switchLevel()) ); + m_nextLevelTimer = new TQTimer( this, "m_nextLevelTimer" ); + connect( m_nextLevelTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(switchLevel()) ); - m_gameOverTimer = new QTimer( this, "m_gameOverTimer" ); - connect( m_gameOverTimer, SIGNAL(timeout()), this, SLOT(gameOverNow()) ); + m_gameOverTimer = new TQTimer( this, "m_gameOverTimer" ); + connect( m_gameOverTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(gameOverNow()) ); - m_timer = new QTimer( this, "m_timer" ); - connect( m_timer, SIGNAL(timeout()), this, SLOT(second()) ); + m_timer = new TQTimer( this, "m_timer" ); + connect( m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(second()) ); // create demo game createLevel( 1 ); @@ -103,7 +103,7 @@ KJezzball::KJezzball() .arg(m_newAction->shortcut().toString()) ); //m_gameWidget->display( i18n("Press <Space> to start a game!") ); - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(TQWidget::StrongFocus); setFocus(); setupGUI(); } @@ -119,23 +119,23 @@ KJezzball::~KJezzball() */ void KJezzball::initXMLUI() { - m_newAction = KStdGameAction::gameNew( this, SLOT(newGame()), actionCollection() ); + m_newAction = KStdGameAction::gameNew( this, TQT_SLOT(newGame()), actionCollection() ); // AB: originally KBounce/KJezzball used Space for new game - but Ctrl+N is // default. We solve this by providing space as an alternative key KShortcut s = m_newAction->shortcut(); - s.append(KKeySequence(QKeySequence(Key_Space))); + s.append(KKeySequence(TQKeySequence(Key_Space))); m_newAction->setShortcut(s); - KStdGameAction::quit(this, SLOT(close()), actionCollection() ); - KStdGameAction::highscores(this, SLOT(showHighscore()), actionCollection() ); - m_pauseButton = KStdGameAction::pause(this, SLOT(pauseGame()), actionCollection()); - KStdGameAction::end(this, SLOT(closeGame()), actionCollection()); - KStdGameAction::configureHighscores(this, SLOT(configureHighscores()),actionCollection()); + KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection() ); + KStdGameAction::highscores(this, TQT_SLOT(showHighscore()), actionCollection() ); + m_pauseButton = KStdGameAction::pause(this, TQT_SLOT(pauseGame()), actionCollection()); + KStdGameAction::end(this, TQT_SLOT(closeGame()), actionCollection()); + KStdGameAction::configureHighscores(this, TQT_SLOT(configureHighscores()),actionCollection()); - new KAction( i18n("&Select Background Folder..."), 0, this, SLOT(selectBackground()), + new KAction( i18n("&Select Background Folder..."), 0, this, TQT_SLOT(selectBackground()), actionCollection(), "background_select" ); m_backgroundShowAction = - new KToggleAction( i18n("Show &Backgrounds"), 0, this, SLOT(showBackground()), + new KToggleAction( i18n("Show &Backgrounds"), 0, this, TQT_SLOT(showBackground()), actionCollection(), "background_show" ); m_backgroundShowAction->setCheckedState(i18n("Hide &Backgrounds")); m_backgroundShowAction->setEnabled( !m_backgroundDir.isEmpty() ); @@ -177,7 +177,7 @@ void KJezzball::closeGame() int old_state = m_state; if (old_state == Running) pauseGame(); - int ret = KMessageBox::questionYesNo( this, i18n("Do you really want to close the running game?"), QString::null, KStdGuiItem::close(), KStdGuiItem::cancel() ); + int ret = KMessageBox::questionYesNo( this, i18n("Do you really want to close the running game?"), TQString::null, KStdGuiItem::close(), KStdGuiItem::cancel() ); if ( ret==KMessageBox::Yes ) { stopLevel(); @@ -206,7 +206,7 @@ void KJezzball::pauseGame() case Suspend: m_state = Running; statusBar()->clear(); - //m_gameWidget->display( QString::null ); + //m_gameWidget->display( TQString::null ); startLevel(); break; @@ -226,7 +226,7 @@ void KJezzball::gameOverNow() { m_state = Idle; - QString score; + TQString score; score.setNum( m_game.score ); KMessageBox::information( this, i18n("Game Over! Score: %1").arg(score) ); statusBar()->message( i18n("Game over. Press <Space> for a new game") ); @@ -255,7 +255,7 @@ void KJezzball::showHighscore() */ void KJezzball::selectBackground() { - QString path = KFileDialog::getExistingDirectory( m_backgroundDir, this, + TQString path = KFileDialog::getExistingDirectory( m_backgroundDir, this, i18n("Select Background Image Folder") ); if ( !path.isEmpty() && path!=m_backgroundDir ) { m_backgroundDir = path; @@ -299,33 +299,33 @@ void KJezzball::showBackground() m_background = getBackgroundPixmap(); } - m_gameWidget->setBackground( m_showBackground ? m_background : QPixmap() ); + m_gameWidget->setBackground( m_showBackground ? m_background : TQPixmap() ); } } -QPixmap KJezzball::getBackgroundPixmap() +TQPixmap KJezzball::getBackgroundPixmap() { // list directory - QDir dir( m_backgroundDir, "*.png *.jpg", QDir::Name|QDir::IgnoreCase, QDir::Files ); + TQDir dir( m_backgroundDir, "*.png *.jpg", TQDir::Name|TQDir::IgnoreCase, TQDir::Files ); if ( !dir.exists() ) { kdDebug(12008) << "Directory not found" << endl; - return QPixmap(); + return TQPixmap(); } if (dir.count() > 1) { // return random pixmap int num = kapp->random() % dir.count(); - return QPixmap( dir.absFilePath( dir[num] ) ); + return TQPixmap( dir.absFilePath( dir[num] ) ); } else if (dir.count()==1) { - return QPixmap( dir.absFilePath(dir[0]) ); + return TQPixmap( dir.absFilePath(dir[0]) ); } - else return QPixmap(); + else return TQPixmap(); } -void KJezzball::focusOutEvent( QFocusEvent *ev ) +void KJezzball::focusOutEvent( TQFocusEvent *ev ) { if ( m_state==Running ) { @@ -339,7 +339,7 @@ void KJezzball::focusOutEvent( QFocusEvent *ev ) KMainWindow::focusOutEvent( ev ); } -void KJezzball::focusInEvent ( QFocusEvent *ev ) +void KJezzball::focusInEvent ( TQFocusEvent *ev ) { if ( m_state==Suspend ) { @@ -347,7 +347,7 @@ void KJezzball::focusInEvent ( QFocusEvent *ev ) m_state = Running; statusBar()->clear(); m_pauseButton->setChecked(false); - //m_gameWidget->display( QString::null ); + //m_gameWidget->display( TQString::null ); } KMainWindow::focusInEvent( ev ); @@ -393,16 +393,16 @@ void KJezzball::createLevel( int level ) if ( m_showBackground ) m_background = getBackgroundPixmap(); else - m_background = QPixmap(); + m_background = TQPixmap(); m_gameWidget = new JezzGame( m_background, level+1, m_view, "m_gameWidget" ); m_gameWidget->setSound(m_soundAction->isChecked()); m_gameWidget->show(); m_layout->addWidget( m_gameWidget, 0, 0 ); - connect( m_gameWidget, SIGNAL(died()), this, SLOT(died()) ); - connect( m_gameWidget, SIGNAL(newPercent(int)), this, SLOT(newPercent(int)) ); - connect( m_soundAction, SIGNAL(toggled(bool)), m_gameWidget, SLOT(setSound(bool)) ); + connect( m_gameWidget, TQT_SIGNAL(died()), this, TQT_SLOT(died()) ); + connect( m_gameWidget, TQT_SIGNAL(newPercent(int)), this, TQT_SLOT(newPercent(int)) ); + connect( m_soundAction, TQT_SIGNAL(toggled(bool)), m_gameWidget, TQT_SLOT(setSound(bool)) ); // update displays m_level.lifes = level+1; @@ -453,13 +453,13 @@ void KJezzball::switchLevel() m_scoreLCD->setNumDigits( numDigits ); m_scoreLCD->display( m_game.score ); - QString score; + TQString score; score.setNum( m_level.score ); - QString level; + TQString level; level.setNum( m_game.level ); -QString foo = QString( +TQString foo = TQString( i18n("You have successfully cleared more than 75% of the board.\n") + i18n("%1 points: 15 points per remaining life\n").arg(m_level.lifes*15) + i18n("%1 points: Bonus\n").arg((m_gameWidget->percent()-75)*2*(m_game.level+5)) + diff --git a/kbounce/kbounce.h b/kbounce/kbounce.h index a4e0a95f..34d1ee77 100644 --- a/kbounce/kbounce.h +++ b/kbounce/kbounce.h @@ -60,29 +60,29 @@ protected: void gameOver(); void initXMLUI(); - void focusOutEvent( QFocusEvent * ); - void focusInEvent ( QFocusEvent * ); + void focusOutEvent( TQFocusEvent * ); + void focusInEvent ( TQFocusEvent * ); - QPixmap getBackgroundPixmap(); + TQPixmap getBackgroundPixmap(); JezzGame *m_gameWidget; - QWidget *m_view; - QGridLayout *m_layout; - QLCDNumber *m_levelLCD; - QLCDNumber *m_lifesLCD; - QLCDNumber *m_scoreLCD; - QLCDNumber *m_percentLCD; - QLCDNumber *m_timeLCD; + TQWidget *m_view; + TQGridLayout *m_layout; + TQLCDNumber *m_levelLCD; + TQLCDNumber *m_lifesLCD; + TQLCDNumber *m_scoreLCD; + TQLCDNumber *m_percentLCD; + TQLCDNumber *m_timeLCD; KToggleAction *m_pauseButton, *m_backgroundShowAction, *m_soundAction; KAction *m_newAction; - QTimer *m_timer; - QTimer *m_nextLevelTimer; - QTimer *m_gameOverTimer; + TQTimer *m_timer; + TQTimer *m_nextLevelTimer; + TQTimer *m_gameOverTimer; - QString m_backgroundDir; + TQString m_backgroundDir; bool m_showBackground; - QPixmap m_background; + TQPixmap m_background; enum { Idle, Running, Paused, Suspend } m_state; diff --git a/kbounce/main.cpp b/kbounce/main.cpp index 390b7c62..41ed3a7b 100644 --- a/kbounce/main.cpp +++ b/kbounce/main.cpp @@ -52,7 +52,7 @@ int main(int argc, char **argv) KCmdLineArgs::init( argc, argv, &aboutData ); - QApplication::setColorSpec(QApplication::ManyColor); + TQApplication::setColorSpec(TQApplication::ManyColor); KApplication a; KGlobal::locale()->insertCatalogue("libkdegames"); diff --git a/kenolaba/AbTop.cpp b/kenolaba/AbTop.cpp index a2283f16..1820e591 100644 --- a/kenolaba/AbTop.cpp +++ b/kenolaba/AbTop.cpp @@ -1,8 +1,8 @@ /* Class AbTop */ -#include <qpopupmenu.h> -#include <qtimer.h> -#include <qclipboard.h> +#include <tqpopupmenu.h> +#include <tqtimer.h> +#include <tqclipboard.h> #include <kaction.h> #include <kapplication.h> @@ -63,12 +63,12 @@ AbTop::AbTop() timer = new QTimer; - connect( timer, SIGNAL(timeout()), this, SLOT(timerDone()) ); + connect( timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timerDone()) ); board = new Board(); setMoveNo(0); - connect( board, SIGNAL(searchBreak()), this, SLOT(searchBreak()) ); + connect( board, TQT_SIGNAL(searchBreak()), this, TQT_SLOT(searchBreak()) ); Q_CHECK_PTR(board); boardWidget = new BoardWidget(*board,this); @@ -76,8 +76,8 @@ AbTop::AbTop() spy = new Spy(*board); #endif - connect( boardWidget, SIGNAL(updateSpy(QString)), - this, SLOT(updateSpy(QString)) ); + connect( boardWidget, TQT_SIGNAL(updateSpy(TQString)), + this, TQT_SLOT(updateSpy(TQString)) ); setCentralWidget(boardWidget); boardWidget->show(); @@ -88,17 +88,17 @@ AbTop::AbTop() setMinimumSize(200,300); // RMB context menu - connect( boardWidget, SIGNAL(rightButtonPressed(int,const QPoint&)), - this, SLOT(rightButtonPressed(int,const QPoint&)) ); + connect( boardWidget, TQT_SIGNAL(rightButtonPressed(int,const TQPoint&)), + this, TQT_SLOT(rightButtonPressed(int,const TQPoint&)) ); - connect( boardWidget, SIGNAL(edited(int)), - this, SLOT(edited(int)) ); + connect( boardWidget, TQT_SIGNAL(edited(int)), + this, TQT_SLOT(edited(int)) ); - connect( board, SIGNAL(updateBestMove(Move&,int)), - this, SLOT(updateBestMove(Move&,int)) ); + connect( board, TQT_SIGNAL(updateBestMove(Move&,int)), + this, TQT_SLOT(updateBestMove(Move&,int)) ); - connect( boardWidget, SIGNAL(moveChoosen(Move&)), - this, SLOT(moveChoosen(Move&)) ); + connect( boardWidget, TQT_SIGNAL(moveChoosen(Move&)), + this, TQT_SLOT(moveChoosen(Move&)) ); /* default */ setLevel(Easy); @@ -132,76 +132,76 @@ AbTop::~AbTop() void AbTop::setupActions() { - newAction = KStdGameAction::gameNew( this, SLOT(newGame()), actionCollection() ); - KStdGameAction::quit( this, SLOT(close()), actionCollection() ); + newAction = KStdGameAction::gameNew( this, TQT_SLOT(newGame()), actionCollection() ); + KStdGameAction::quit( this, TQT_SLOT(close()), actionCollection() ); stopAction = new KAction( i18n("&Stop Search"), "stop", Key_S, this, - SLOT(stopSearch()), actionCollection(), "move_stop"); + TQT_SLOT(stopSearch()), actionCollection(), "move_stop"); backAction = new KAction( i18n("Take &Back"), "back", KStdAccel::shortcut(KStdAccel::Prior), this, - SLOT(back()), actionCollection(), "move_back"); + TQT_SLOT(back()), actionCollection(), "move_back"); forwardAction = new KAction( i18n("&Forward"), "forward", KStdAccel::shortcut(KStdAccel::Next), this, - SLOT(forward()), actionCollection(), "move_forward"); + TQT_SLOT(forward()), actionCollection(), "move_forward"); - hintAction = KStdGameAction::hint(this, SLOT(suggestion()), actionCollection()); + hintAction = KStdGameAction::hint(this, TQT_SLOT(suggestion()), actionCollection()); - KStdAction::copy( this, SLOT(copy()), actionCollection()); - pasteAction = KStdAction::paste( this, SLOT(paste()), actionCollection()); + KStdAction::copy( this, TQT_SLOT(copy()), actionCollection()); + pasteAction = KStdAction::paste( this, TQT_SLOT(paste()), actionCollection()); (void) new KAction( i18n("&Restore Position"), KStdAccel::shortcut(KStdAccel::Open), - this, SLOT(restorePosition()), + this, TQT_SLOT(restorePosition()), actionCollection(), "edit_restore" ); (void) new KAction( i18n("&Save Position"), KStdAccel::shortcut(KStdAccel::Save), - this, SLOT(savePosition()), + this, TQT_SLOT(savePosition()), actionCollection(), "edit_save" ); KToggleAction *ta; ta = new KToggleAction( i18n("&Network Play"), "network", Key_N, actionCollection(), "game_net"); - connect(ta, SIGNAL(toggled(bool)), this, SLOT(gameNetwork(bool))); + connect(ta, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(gameNetwork(bool))); editAction = new KToggleAction( i18n("&Modify"), "edit", CTRL+Key_Insert, actionCollection(), "edit_modify"); - connect(editAction, SIGNAL(toggled(bool)), this, SLOT( editModify(bool))); + connect(editAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT( editModify(bool))); - showMenubar = KStdAction::showMenubar(this, SLOT(toggleMenubar()), actionCollection()); - KStdAction::saveOptions( this, SLOT(writeConfig()), actionCollection()); + showMenubar = KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); + KStdAction::saveOptions( this, TQT_SLOT(writeConfig()), actionCollection()); - KStdAction::preferences( this, SLOT(configure()), actionCollection()); + KStdAction::preferences( this, TQT_SLOT(configure()), actionCollection()); moveSlowAction = new KToggleAction( i18n("&Move Slow"), 0, actionCollection(), "options_moveSlow"); - connect(moveSlowAction, SIGNAL(toggled(bool)), this, SLOT(optionMoveSlow(bool))); + connect(moveSlowAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(optionMoveSlow(bool))); renderBallsAction = new KToggleAction( i18n("&Render Balls"), 0, actionCollection(), "options_renderBalls"); - connect(renderBallsAction, SIGNAL(toggled(bool)), this, SLOT(optionRenderBalls(bool))); + connect(renderBallsAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(optionRenderBalls(bool))); showSpyAction = new KToggleAction( i18n("&Spy"), 0, actionCollection(), "options_showSpy"); - connect(showSpyAction, SIGNAL(toggled(bool)), this, SLOT(optionShowSpy(bool))); + connect(showSpyAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(optionShowSpy(bool))); levelAction = KStdGameAction::chooseGameType(0, 0, actionCollection()); - QStringList list; + TQStringList list; for (uint i=0; i<Nb_Levels; i++) list.append( i18n(LEVEL[i].label) ); levelAction->setItems(list); - connect(levelAction, SIGNAL(activated(int)), SLOT(setLevel(int))); + connect(levelAction, TQT_SIGNAL(activated(int)), TQT_SLOT(setLevel(int))); iplayAction = new KSelectAction(i18n("&Computer Play"), 0, actionCollection(), "options_iplay"); list.clear(); for (uint i=0; i<Nb_IPlays; i++) list.append( i18n(IPLAY[i].label) ); iplayAction->setItems(list); - connect(iplayAction, SIGNAL(activated(int)), SLOT(setIPlay(int))); + connect(iplayAction, TQT_SIGNAL(activated(int)), TQT_SLOT(setIPlay(int))); } void AbTop::toggleMenubar() @@ -229,9 +229,9 @@ void AbTop::configure() } /* Right Mouse button pressed in BoardWidget area */ -void AbTop::rightButtonPressed(int /* field */, const QPoint& pos) +void AbTop::rightButtonPressed(int /* field */, const TQPoint& pos) { - QPopupMenu* rmbMenu = static_cast<QPopupMenu*> (factory()->container("rmbPopup",this)); + TQPopupMenu* rmbMenu = static_cast<TQPopupMenu*> (factory()->container("rmbPopup",this)); if (rmbMenu) rmbMenu->popup( pos ); } @@ -260,7 +260,7 @@ void AbTop::readConfig() void AbTop::readOptions(KConfig* config) { - QString entry = config->readEntry("Level"); + TQString entry = config->readEntry("Level"); for (uint i=0; i<Nb_Levels; i++) if ( entry==LEVEL[i].key ) setLevel(i); @@ -282,7 +282,7 @@ void AbTop::readOptions(KConfig* config) void AbTop::readProperties(KConfig *config) { - QString entry; + TQString entry; readOptions(config); @@ -361,7 +361,7 @@ void AbTop::restorePosition() { KConfig* config = kapp->config(); config->setGroup("SavedPosition"); - QString entry = config->readEntry("Position"); + TQString entry = config->readEntry("Position"); timerState = notStarted; timer->stop(); @@ -379,10 +379,10 @@ void AbTop::restorePosition() void AbTop::setupStatusBar() { - QString tmp; + TQString tmp; - QString t = i18n("Press %1 for a new game").arg( newAction->shortcut().toString()); - statusLabel = new QLabel( t, statusBar(), "statusLabel" ); + TQString t = i18n("Press %1 for a new game").arg( newAction->shortcut().toString()); + statusLabel = new TQLabel( t, statusBar(), "statusLabel" ); statusBar()->addWidget(statusLabel,1,false); // PERMANENT: Moving side + move No. @@ -390,7 +390,7 @@ void AbTop::setupStatusBar() // validPixmap, only visible in Modify mode: is position valid ? warningPix = BarIcon( "warning" ); okPix = BarIcon( "ok" ); - validLabel = new QLabel( "", statusBar(), "validLabel" ); + validLabel = new TQLabel( "", statusBar(), "validLabel" ); validLabel->setFixedSize( 18, statusLabel->sizeHint().height() ); validLabel->setAlignment( AlignCenter ); validLabel->hide(); @@ -399,20 +399,20 @@ void AbTop::setupStatusBar() redBall = BarIcon( "redball" ); yellowBall = BarIcon( "yellowball" ); noBall = BarIcon( "noball" ); - ballLabel = new QLabel( "", statusBar(), "ballLabel" ); + ballLabel = new TQLabel( "", statusBar(), "ballLabel" ); ballLabel->setPixmap(noBall); ballLabel->setFixedSize( 18, statusLabel->sizeHint().height() ); ballLabel->setAlignment( AlignCenter ); statusBar()->addWidget(ballLabel, 0, true); - moveLabel = new QLabel( i18n("Move %1").arg("--"), statusBar(), "moveLabel" ); + moveLabel = new TQLabel( i18n("Move %1").arg("--"), statusBar(), "moveLabel" ); statusBar()->addWidget(moveLabel, 0, true); #ifdef MYTRACE /* Create a toolbar menu for debugging output level */ KToolBar *tb = toolBar("mainToolBar"); if (tb) { - QPopupMenu* spyPopup = new QPopupMenu; + TQPopupMenu* spyPopup = new QPopupMenu; spy0 = BarIcon( "spy0" ); spy1 = BarIcon( "spy1" ); spy2 = BarIcon( "spy2" ); @@ -421,8 +421,8 @@ void AbTop::setupStatusBar() spyPopup->insertItem(spy1, 1); spyPopup->insertItem(spy2, 2); spyPopup->insertItem(spy3, 3); - connect( spyPopup, SIGNAL(activated(int)), - this, SLOT(setSpy(int)) ); + connect( spyPopup, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(setSpy(int)) ); tb->insertButton(spy0, 30, spyPopup, TRUE, i18n("Spy")); } @@ -432,7 +432,7 @@ void AbTop::setupStatusBar() -void AbTop::updateSpy(QString s) +void AbTop::updateSpy(TQString s) { if (showSpy) { if (s.isEmpty()) { @@ -450,7 +450,7 @@ void AbTop::updateBestMove(Move& m, int value) boardWidget->showMove(m,3); boardWidget->showMove(m,0,false); - QString tmp; + TQString tmp; tmp.sprintf("%s : %+d", (const char*) m.name().utf8(), value-actValue); updateSpy(tmp); kapp->processEvents(); @@ -460,7 +460,7 @@ void AbTop::updateBestMove(Move& m, int value) void AbTop::updateStatus() { - QString tmp; + TQString tmp; bool showValid = false; if (!editMode && timerState == noGame) { @@ -475,7 +475,7 @@ void AbTop::updateStatus() moveLabel->setText(tmp); if (editMode) { - tmp = QString("%1: %2 %3 - %4 %5") + tmp = TQString("%1: %2 %3 - %4 %5") .arg( i18n("Edit") ) .arg( i18n("Red") ).arg(boardWidget->getColor1Count()) .arg( i18n("Yellow") ).arg(boardWidget->getColor2Count()); @@ -494,7 +494,7 @@ void AbTop::updateStatus() showValid = true; } else { - tmp = QString("%1 - %2") + tmp = TQString("%1 - %2") .arg( (board->actColor() == Board::color1) ? i18n("Red"):i18n("Yellow") ) .arg( iPlayNow() ? @@ -733,7 +733,7 @@ void AbTop::newGame() /* Copy ASCII representation into Clipboard */ void AbTop::copy() { - QClipboard *cb = QApplication::clipboard(); + QClipboard *cb = TQApplication::clipboard(); cb->setText( board->getASCIIState( moveNo ).ascii() ); } @@ -741,7 +741,7 @@ void AbTop::paste() { if (!pastePossible) return; - QClipboard *cb = QApplication::clipboard(); + QClipboard *cb = TQApplication::clipboard(); pastePosition( cb->text().ascii() ); /* don't do this in pastePosition: RECURSION !! */ @@ -800,8 +800,8 @@ void AbTop::gameNetwork(bool on) h2[i]=0; net->addListener(h2, p); } - QObject::connect(net, SIGNAL(gotPosition(const char *)), - this, SLOT(pastePosition(const char *)) ); + TQObject::connect(net, TQT_SIGNAL(gotPosition(const char *)), + this, TQT_SLOT(pastePosition(const char *)) ); } diff --git a/kenolaba/AbTop.h b/kenolaba/AbTop.h index 35357452..be06f030 100644 --- a/kenolaba/AbTop.h +++ b/kenolaba/AbTop.h @@ -70,12 +70,12 @@ public slots: void savePosition(); void restorePosition(); void setSpy(int); - void updateSpy(QString); + void updateSpy(TQString); void edited(int); void updateBestMove(Move&,int); void readConfig(); void writeConfig(); - void rightButtonPressed(int,const QPoint&); + void rightButtonPressed(int,const TQPoint&); void gameNetwork(bool); void editModify(bool); @@ -106,7 +106,7 @@ private: int actValue; BoardWidget *boardWidget; EvalScheme* currentEvalScheme; - QTimer *timer; + TQTimer *timer; int timerState; int depth, moveNo; bool showMoveLong, stop, showSpy; @@ -123,13 +123,13 @@ private: int yellow_id, red_id, both_id, none_id, iplay_id; int spy_id, paste_id, edit_id, forward_id, net_id; - QLabel *validLabel, *ballLabel, *moveLabel, *statusLabel; - QPixmap warningPix, okPix, redBall, yellowBall, noBall, netPix; - QPixmap spy0, spy1, spy2, spy3; + TQLabel *validLabel, *ballLabel, *moveLabel, *statusLabel; + TQPixmap warningPix, okPix, redBall, yellowBall, noBall, netPix; + TQPixmap spy0, spy1, spy2, spy3; Network *net; int myPort; - QStrList hosts; + TQStrList hosts; KAction *newAction, *stopAction, *backAction, *forwardAction, *hintAction, *pasteAction; KToggleAction *showMenubar, *renderBallsAction, *moveSlowAction, diff --git a/kenolaba/Ball.cpp b/kenolaba/Ball.cpp index 565ef296..525f919b 100644 --- a/kenolaba/Ball.cpp +++ b/kenolaba/Ball.cpp @@ -1,18 +1,18 @@ /* Ball animation classes */ #include "Ball.h" -#include <qtimer.h> -#include <qbitmap.h> -#include <qimage.h> -#include <qpixmap.h> +#include <tqtimer.h> +#include <tqbitmap.h> +#include <tqimage.h> +#include <tqpixmap.h> #include <math.h> #include <stdio.h> Ball* Ball::first = 0; -//QImage Ball::back; +//TQImage Ball::back; int Ball::sizeX, Ball::sizeY; double Ball::lightX, Ball::lightY, Ball::lightZ; -QColor Ball::lightColor; +TQColor Ball::lightColor; double Ball::rippleCount, Ball::rippleDepth; /* set global Ball parameter */ @@ -33,7 +33,7 @@ void Ball::invalidate() b->pm.resize(0,0); } -void Ball::setLight(int x, int y, int z, const QColor& c) +void Ball::setLight(int x, int y, int z, const TQColor& c) { double len = sqrt(double(x*x + y*y + z*z)); @@ -57,7 +57,7 @@ void Ball::setTexture(double c, double d) -Ball::Ball(const QColor& c, double a, int t) +Ball::Ball(const TQColor& c, double a, int t) { if (first ==0) { sizeX = sizeY = -1; @@ -90,7 +90,7 @@ Ball::~Ball() } } -QPixmap* Ball::pixmap() +TQPixmap* Ball::pixmap() { if (pm.isNull() && sizeX>0 && sizeY>0) render(); @@ -105,7 +105,7 @@ void Ball::render() if (sizeX==0 || sizeY==0) return; - QImage image(sizeX,sizeY,32); + TQImage image(sizeX,sizeY,32); image.fill(0); double vv=2./(sizeX+sizeY); @@ -159,8 +159,8 @@ void Ball::render() } } } - const QImage iMask = image.createHeuristicMask(); - QBitmap bMask; + const TQImage iMask = image.createHeuristicMask(); + TQBitmap bMask; bMask = iMask; pm.convertFromImage( image, 0 ); pm.setMask(bMask); @@ -171,15 +171,15 @@ void Ball::render() BallAnimation::BallAnimation(int s, Ball* ball1, Ball* ball2) { - QColor c1 = ball1->ballColor(); + TQColor c1 = ball1->ballColor(); double a1 = ball1->angle(); int r1 = c1.red(), g1 = c1.green(), b1 = c1.blue(); - QColor c2 = ball2->ballColor(); + TQColor c2 = ball2->ballColor(); double a2 = ball2->angle(); int r2 = c2.red(), g2 = c2.green(), b2 = c2.blue(); - QColor c; + TQColor c; double a; int i; @@ -213,8 +213,8 @@ BallPosition::BallPosition(int xp,int yp, Ball* d) /* Class BallWidget */ -BallWidget::BallWidget( int _freq, int bFr, QWidget *parent, const char *name ) - : QWidget(parent,name), positions(MAX_POSITION), animations(MAX_ANIMATION) +BallWidget::BallWidget( int _freq, int bFr, TQWidget *parent, const char *name ) + : TQWidget(parent,name), positions(MAX_POSITION), animations(MAX_ANIMATION) { int i; @@ -228,8 +228,8 @@ BallWidget::BallWidget( int _freq, int bFr, QWidget *parent, const char *name ) isRunning = false; ballFraction = bFr; realSize = -1; - timer = new QTimer(this); - connect( timer, SIGNAL(timeout()), SLOT(animate()) ); + timer = new TQTimer(this); + connect( timer, TQT_SIGNAL(timeout()), TQT_SLOT(animate()) ); } BallWidget::~BallWidget() @@ -302,7 +302,7 @@ void BallWidget::stopAnimation(int pos) p->actStep = p->actAnimation->steps; } -void BallWidget::resizeEvent(QResizeEvent *) +void BallWidget::resizeEvent(TQResizeEvent *) { int w = width() *10/12, h = height(); @@ -312,13 +312,13 @@ void BallWidget::resizeEvent(QResizeEvent *) repaint(); } -void BallWidget::paintEvent(QPaintEvent *) +void BallWidget::paintEvent(TQPaintEvent *) { paint(this); } -void BallWidget::paint(QPaintDevice *pd) +void BallWidget::paint(TQPaintDevice *pd) { int i; BallPosition *p; @@ -421,7 +421,7 @@ void BallWidget::animate() /* Ball Test */ -BallTest::BallTest( QWidget *parent, const char *name ) +BallTest::BallTest( TQWidget *parent, const char *name ) : BallWidget(10,2,parent,name) { int w,h; @@ -449,13 +449,13 @@ BallTest::BallTest( QWidget *parent, const char *name ) } /* -void BallTest::paintEvent( QPaintEvent * ) +void BallTest::paintEvent( TQPaintEvent * ) { bitBlt(this,0,0, b.pixmap()); } */ -void BallTest::mousePressEvent( QMouseEvent * ) +void BallTest::mousePressEvent( TQMouseEvent * ) { startAnimation(0,0, ANIMATION_CYCLE); startAnimation(1,1); @@ -463,7 +463,7 @@ void BallTest::mousePressEvent( QMouseEvent * ) startAnimation(3,3, ANIMATION_LOOP); } -void BallTest::mouseReleaseEvent( QMouseEvent * ) +void BallTest::mouseReleaseEvent( TQMouseEvent * ) { stopAnimation(0); stopAnimation(1); diff --git a/kenolaba/Ball.h b/kenolaba/Ball.h index 1a3e0d28..1fcf1b37 100644 --- a/kenolaba/Ball.h +++ b/kenolaba/Ball.h @@ -16,11 +16,11 @@ #ifndef _BALL_H_ #define _BALL_H_ -#include <qpixmap.h> -#include <qimage.h> -#include <qcolor.h> -#include <qwidget.h> -#include <qptrlist.h> +#include <tqpixmap.h> +#include <tqimage.h> +#include <tqcolor.h> +#include <tqwidget.h> +#include <tqptrlist.h> /* textures for balls */ #define TEX_FLAT 0 @@ -29,13 +29,13 @@ class Ball { public: - Ball(const QColor& c, double a = 0.0, int t=TEX_RIPPLE ); + Ball(const TQColor& c, double a = 0.0, int t=TEX_RIPPLE ); ~Ball(); - QPixmap* pixmap(); + TQPixmap* pixmap(); double angle() { return an; } - QColor ballColor() { return bColor; } + TQColor ballColor() { return bColor; } void setSpecials(double z, double f, double l) { zoom = z, flip=f, limit=l; } @@ -43,7 +43,7 @@ class Ball { static int h() { return sizeY; } static void setSize(int x,int y); static void setLight(int x=5, int y=3, int z=10, - const QColor& c = QColor(200,230,255) ); + const TQColor& c = TQColor(200,230,255) ); static void setTexture(double c=13., double d=.2); private: @@ -51,14 +51,14 @@ class Ball { void render(); static void invalidate(); - //static QImage back; + //static TQImage back; static int sizeX, sizeY; static double lightX, lightY, lightZ; - static QColor lightColor; + static TQColor lightColor; static double rippleCount, rippleDepth; - QPixmap pm; - QColor bColor; + TQPixmap pm; + TQColor bColor; double an, sina, cosa; double zoom, flip, limit; int tex; @@ -73,7 +73,7 @@ class BallAnimation { BallAnimation(int s, Ball*, Ball*); int steps; - QPtrList<Ball> balls; + TQPtrList<Ball> balls; }; #define ANIMATION_STOPPED 0 @@ -99,7 +99,7 @@ class BallWidget : public QWidget Q_OBJECT public: - BallWidget(int _freq, int bFr, QWidget *parent = 0, const char *name = 0); + BallWidget(int _freq, int bFr, TQWidget *parent = 0, const char *name = 0); ~BallWidget(); void createBlending(int, int, Ball* , Ball* ); @@ -108,10 +108,10 @@ class BallWidget : public QWidget void startAnimation(int pos, int anim, int type=ANIMATION_FORWARD); void stopAnimation(int pos); - void paint(QPaintDevice *); + void paint(TQPaintDevice *); - virtual void resizeEvent(QResizeEvent *); - virtual void paintEvent(QPaintEvent *); + virtual void resizeEvent(TQResizeEvent *); + virtual void paintEvent(TQPaintEvent *); signals: void animationFinished(int); @@ -124,14 +124,14 @@ class BallWidget : public QWidget void animate(); protected: - QMemArray<BallPosition*> positions; - QMemArray<BallAnimation*> animations; + TQMemArray<BallPosition*> positions; + TQMemArray<BallAnimation*> animations; private: int freq; int xStart, yStart, realSize, ballFraction; bool isRunning; - QTimer *timer; + TQTimer *timer; }; @@ -141,10 +141,10 @@ class BallTest: public BallWidget { Q_OBJECT public: - BallTest(QWidget *parent=0, const char *name=0 ); + BallTest(TQWidget *parent=0, const char *name=0 ); protected: - void mousePressEvent( QMouseEvent * ); - void mouseReleaseEvent( QMouseEvent * ); + void mousePressEvent( TQMouseEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); }; diff --git a/kenolaba/Board.cpp b/kenolaba/Board.cpp index b8546fbc..d939ad09 100644 --- a/kenolaba/Board.cpp +++ b/kenolaba/Board.cpp @@ -11,8 +11,8 @@ #include <stdio.h> -#include <qdatetime.h> -#include <qstrlist.h> +#include <tqdatetime.h> +#include <tqstrlist.h> #include <kconfig.h> #include <krandomsequence.h> @@ -122,7 +122,7 @@ Board::Board() void Board::setEvalScheme(EvalScheme* scheme) { if (!scheme) - scheme = new EvalScheme( QString("Default") ); + scheme = new EvalScheme( TQString("Default") ); _evalScheme = scheme; setFieldValues(); @@ -1347,9 +1347,9 @@ void Board::print(int ) color1Count, color2Count); } -QString Board::getASCIIState(int moveNo) +TQString Board::getASCIIState(int moveNo) { - QString state, tmp; + TQString state, tmp; int row,i; char spaces[]=" "; @@ -1378,7 +1378,7 @@ QString Board::getASCIIState(int moveNo) return state; } -int Board::setASCIIState(const QString& state) +int Board::setASCIIState(const TQString& state) { int moveNo=-1, index; int len = state.length(); @@ -1443,10 +1443,10 @@ int Board::setASCIIState(const QString& state) } -QString Board::getState(int moveNo) +TQString Board::getState(int moveNo) { - QString state; - QString entry, tmp; + TQString state; + TQString entry, tmp; int i; /* Color + Counts */ @@ -1464,7 +1464,7 @@ QString Board::getState(int moveNo) return state; } -int Board::setState(QString& _state) +int Board::setState(TQString& _state) { int moveNo; const char *state = _state.ascii(); diff --git a/kenolaba/Board.h b/kenolaba/Board.h index 61871d1f..81b589d9 100644 --- a/kenolaba/Board.h +++ b/kenolaba/Board.h @@ -6,7 +6,7 @@ #ifndef _BOARD_H_ #define _BOARD_H_ -#include <qobject.h> +#include <tqobject.h> #include <krandomsequence.h> #include "Move.h" @@ -126,12 +126,12 @@ class Board : public QObject void stopSearch() { breakOut = true; } /* Compressed ASCII representation */ - QString getState(int); - int setState(QString&); + TQString getState(int); + int setState(TQString&); /* Readable ASCII representation */ - QString getASCIIState(int); - int setASCIIState(const QString&); + TQString getASCIIState(int); + int setASCIIState(const TQString&); void updateSpy(bool b) { bUpdateSpy = b; } diff --git a/kenolaba/BoardWidget.cpp b/kenolaba/BoardWidget.cpp index 9d420cc3..da6358c7 100644 --- a/kenolaba/BoardWidget.cpp +++ b/kenolaba/BoardWidget.cpp @@ -6,9 +6,9 @@ * Josef Weidendorfer, 9/97 */ -#include <qbitmap.h> -#include <qpainter.h> -#include <qcursor.h> +#include <tqbitmap.h> +#include <tqpainter.h> +#include <tqcursor.h> #include <klocale.h> #include <kdebug.h> @@ -34,7 +34,7 @@ #include "bitmaps/Arrow6" #include "bitmaps/Arrow6Mask" -BoardWidget::BoardWidget(Board& b, QWidget *parent, const char *name) +BoardWidget::BoardWidget(Board& b, TQWidget *parent, const char *name) : BallWidget(10,9,parent, name), board(b) { pList =0; @@ -44,18 +44,18 @@ BoardWidget::BoardWidget(Board& b, QWidget *parent, const char *name) #ifdef HAVE_KIR m_backRenderer = KIRManager::attach( this, "Background" ); - connect( m_backRenderer, SIGNAL(rendered()), - this, SLOT(drawBoard()) ); + connect( m_backRenderer, TQT_SIGNAL(rendered()), + this, TQT_SLOT(drawBoard()) ); #endif /* setup cursors */ #define createCursor(bitmap,name) \ - static QBitmap bitmap(bitmap##_width, bitmap##_height, \ + static TQBitmap bitmap(bitmap##_width, bitmap##_height, \ (unsigned char *) bitmap##_bits, TRUE); \ - static QBitmap bitmap##Mask(bitmap##Mask_width, bitmap##Mask_height, \ + static TQBitmap bitmap##Mask(bitmap##Mask_width, bitmap##Mask_height, \ (unsigned char *) bitmap##Mask_bits, TRUE); \ - name = new QCursor(bitmap, bitmap##Mask, bitmap##_x_hot, bitmap##_y_hot); + name = new TQCursor(bitmap, bitmap##Mask, bitmap##_x_hot, bitmap##_y_hot); createCursor(Arrow1, arrow[1]); createCursor(Arrow2, arrow[2]); @@ -66,12 +66,12 @@ BoardWidget::BoardWidget(Board& b, QWidget *parent, const char *name) setCursor(crossCursor); - // boardColor = new QColor("lightblue"); - boardColor = new QColor(backgroundColor()); - redColor = new QColor("red2"); - yellowColor = new QColor("yellow2"); - redHColor = new QColor("orange"); - yellowHColor = new QColor("green"); + // boardColor = new TQColor("lightblue"); + boardColor = new TQColor(backgroundColor()); + redColor = new TQColor("red2"); + yellowColor = new TQColor("yellow2"); + redHColor = new TQColor("orange"); + yellowHColor = new TQColor("green"); initBalls(); @@ -149,18 +149,18 @@ void BoardWidget::initBalls() for(i=0;i<3;i++) createPos(pos++, -2-i, 4-i, 0 ); } -void BoardWidget::resizeEvent(QResizeEvent *e) +void BoardWidget::resizeEvent(TQResizeEvent *e) { drawBoard(); BallWidget::resizeEvent(e); } -void BoardWidget::moveEvent(QMoveEvent*) +void BoardWidget::moveEvent(TQMoveEvent*) { drawBoard(); } -void BoardWidget::paintEvent(QPaintEvent *) +void BoardWidget::paintEvent(TQPaintEvent *) { if (renderMode) { pm = boardPM; @@ -172,14 +172,14 @@ void BoardWidget::paintEvent(QPaintEvent *) } -void drawShadedHexagon(QPainter *p, int x, int y, int r, int lineWidth, - const QColorGroup& g, bool sunken) +void drawShadedHexagon(TQPainter *p, int x, int y, int r, int lineWidth, + const TQColorGroup& g, bool sunken) { int dx=r/2, dy=(r*87)/100; int y1=y-dy, y2=y+dy; int i; - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); p->setPen(sunken ? g.midlight() : g.dark()); @@ -201,13 +201,13 @@ void drawShadedHexagon(QPainter *p, int x, int y, int r, int lineWidth, } -void drawColor(QPainter *p, int x, int y, int r, QColor* c) +void drawColor(TQPainter *p, int x, int y, int r, TQColor* c) { - QColor w("white"); - QPalette pal(*c); + TQColor w("white"); + TQPalette pal(*c); - QPen oldPen = p->pen(); - QBrush oldBrush = p->brush(); + TQPen oldPen = p->pen(); + TQBrush oldBrush = p->brush(); p->setBrush(pal.active().dark()); p->setPen(pal.active().dark()); @@ -236,18 +236,18 @@ void BoardWidget::drawBoard() boardPM.fill(this, 0,0); #ifndef HAVE_KIR - QColorGroup g = QPalette( *boardColor ).active(); - QColorGroup g2 = QWidget::colorGroup(); + TQColorGroup g = TQPalette( *boardColor ).active(); + TQColorGroup g2 = TQWidget::colorGroup(); int boardSize = width() *10/12; if (boardSize > height()) boardSize = height(); - QPainter p; + TQPainter p; p.begin(&boardPM); - p.setBrush(g2.brush(QColorGroup::Mid)); + p.setBrush(g2.brush(TQColorGroup::Mid)); - QWMatrix m; - QPoint cp = rect().center(); + TQWMatrix m; + TQPoint cp = rect().center(); m.translate(cp.x(), cp.y()); m.scale(boardSize/1100.0, boardSize/1000.0); @@ -259,7 +259,7 @@ void BoardWidget::drawBoard() int i,j; - QPointArray a; + TQPointArray a; int dx=520 /2, dy=(520 *87)/100; a.setPoints(6, -dx,-dy, dx,-dy, 2*dx,0, dx,dy, -dx,dy, -2*dx,0 ); p.drawPolygon(a); @@ -352,12 +352,12 @@ void BoardWidget::draw() int boardSize = width() *10/12; if (boardSize > height()) boardSize = height(); - QPainter p; + TQPainter p; p.begin(&pm); p.setBrush(foregroundColor()); - QWMatrix m; - QPoint cp = rect().center(); + TQWMatrix m; + TQPoint cp = rect().center(); m.translate(cp.x(), cp.y()); m.scale(boardSize/1100.0, boardSize/1000.0); @@ -829,7 +829,7 @@ bool BoardWidget::isValidEnd(int pos) -void BoardWidget::mousePressEvent( QMouseEvent* pEvent ) +void BoardWidget::mousePressEvent( TQMouseEvent* pEvent ) { int pos = positionOf( pEvent->x(), pEvent->y() ); int f = fieldOf(pos); @@ -887,14 +887,14 @@ void BoardWidget::mousePressEvent( QMouseEvent* pEvent ) showStart(actMove,1); startShown = true; - QString tmp; + TQString tmp; actValue = - board.calcEvaluation(); tmp = i18n("Board value: %1").arg(actValue); emit updateSpy(tmp); } -void BoardWidget::mouseMoveEvent( QMouseEvent* pEvent ) +void BoardWidget::mouseMoveEvent( TQMouseEvent* pEvent ) { if ((!gettingMove && !editMode) || !mbDown) return; @@ -928,7 +928,7 @@ void BoardWidget::mouseMoveEvent( QMouseEvent* pEvent ) showStart(actMove,1); startShown = true; - QString tmp; + TQString tmp; actValue = - board.calcEvaluation(); tmp = i18n("Board value: %1").arg(actValue); emit updateSpy(tmp); @@ -946,16 +946,16 @@ void BoardWidget::mouseMoveEvent( QMouseEvent* pEvent ) int v = board.calcEvaluation(); board.takeBack(); - QString tmp; + TQString tmp; tmp.sprintf("%+d", v-actValue); - QString str = QString("%1 : %2").arg(actMove.name()).arg(tmp); + TQString str = TQString("%1 : %2").arg(actMove.name()).arg(tmp); emit updateSpy(str); showMove(actMove,3); setCursor(*arrow[shownDirection]); } else { - QString tmp; + TQString tmp; setCursor(crossCursor); if (pos == startPos) { @@ -970,7 +970,7 @@ void BoardWidget::mouseMoveEvent( QMouseEvent* pEvent ) } -void BoardWidget::mouseReleaseEvent( QMouseEvent* pEvent ) +void BoardWidget::mouseReleaseEvent( TQMouseEvent* pEvent ) { if (!gettingMove && !editMode) return; mbDown = false; @@ -1015,13 +1015,13 @@ void BoardWidget::mouseReleaseEvent( QMouseEvent* pEvent ) startValid = false; setCursor(crossCursor); - QString tmp; + TQString tmp; emit updateSpy(tmp); } -QSize BoardWidget::sizeHint() const +TQSize BoardWidget::sizeHint() const { - return QSize(400, 350); + return TQSize(400, 350); } #include "BoardWidget.moc" diff --git a/kenolaba/BoardWidget.h b/kenolaba/BoardWidget.h index 8fc0a317..f3cfd969 100644 --- a/kenolaba/BoardWidget.h +++ b/kenolaba/BoardWidget.h @@ -1,8 +1,8 @@ #ifndef _BOARDWIDGET_H_ #define _BOARDWIDGET_H_ -#include <qwidget.h> -#include <qpixmap.h> +#include <tqwidget.h> +#include <tqpixmap.h> #include "Ball.h" #include "Move.h" @@ -17,19 +17,19 @@ class BoardWidget : public BallWidget Q_OBJECT public: - BoardWidget(Board&, QWidget *parent = 0, const char *name = 0); + BoardWidget(Board&, TQWidget *parent = 0, const char *name = 0); ~BoardWidget(); void createPos(int , int , int , Ball*); void initBalls(); void updateBalls(); - virtual void resizeEvent(QResizeEvent *); - virtual void moveEvent(QMoveEvent *); - virtual void paintEvent(QPaintEvent *); - virtual void mousePressEvent( QMouseEvent* pEvent ); - virtual void mouseReleaseEvent( QMouseEvent* pEvent ); - virtual void mouseMoveEvent( QMouseEvent* pEvent ); + virtual void resizeEvent(TQResizeEvent *); + virtual void moveEvent(TQMoveEvent *); + virtual void paintEvent(TQPaintEvent *); + virtual void mousePressEvent( TQMouseEvent* pEvent ); + virtual void mouseReleaseEvent( TQMouseEvent* pEvent ); + virtual void mouseMoveEvent( TQMouseEvent* pEvent ); void renderBalls(bool r); @@ -73,18 +73,18 @@ class BoardWidget : public BallWidget signals: void moveChoosen(Move&); - void rightButtonPressed(int,const QPoint&); - void updateSpy(QString); + void rightButtonPressed(int,const TQPoint&); + void updateSpy(TQString); void edited(int); protected: - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; private: int positionOf(int x, int y); bool isValidStart(int pos, bool); bool isValidEnd(int pos); - QPixmap pm, boardPM; + TQPixmap pm, boardPM; Board& board; int actValue; @@ -102,8 +102,8 @@ class BoardWidget : public BallWidget bool gettingMove, mbDown, startValid, startShown; int startPos, actPos, oldPos, shownDirection; int startField, startField2, actField, oldField, startType; - QColor *boardColor, *redColor, *yellowColor, *redHColor, *yellowHColor; - QCursor *arrowAll, *arrow[7]; + TQColor *boardColor, *redColor, *yellowColor, *redHColor, *yellowHColor; + TQCursor *arrowAll, *arrow[7]; Ball *n1, *n2, *h1, *h2, *d1, *d2; //, *e; diff --git a/kenolaba/EvalDlgImpl.cpp b/kenolaba/EvalDlgImpl.cpp index a5903429..70662629 100644 --- a/kenolaba/EvalDlgImpl.cpp +++ b/kenolaba/EvalDlgImpl.cpp @@ -3,12 +3,12 @@ * */ -#include <qvalidator.h> -#include <qlineedit.h> -#include <qlcdnumber.h> +#include <tqvalidator.h> +#include <tqlineedit.h> +#include <tqlcdnumber.h> #include <klineeditdlg.h> -#include <qlistbox.h> -#include <qpushbutton.h> +#include <tqlistbox.h> +#include <tqpushbutton.h> #include <kconfig.h> #include <klocale.h> @@ -19,20 +19,20 @@ #include "Board.h" #include "EvalScheme.h" -EvalDlgImpl::EvalDlgImpl(QWidget* parent, Board* board) +EvalDlgImpl::EvalDlgImpl(TQWidget* parent, Board* board) :EvalDlg(parent) { _board = board; _origScheme = board->evalScheme(); _scheme = new EvalScheme(*_origScheme); - connect( evalDelete, SIGNAL( clicked() ), this, SLOT( deleteEntry() ) ); - connect( evalSaveAs, SIGNAL( clicked() ), this, SLOT( saveas() ) ); - connect( evalList, SIGNAL( highlighted(int) ), this, SLOT( select(int) ) ); + connect( evalDelete, TQT_SIGNAL( clicked() ), this, TQT_SLOT( deleteEntry() ) ); + connect( evalSaveAs, TQT_SIGNAL( clicked() ), this, TQT_SLOT( saveas() ) ); + connect( evalList, TQT_SIGNAL( highlighted(int) ), this, TQT_SLOT( select(int) ) ); KConfig* config = kapp->config(); config->setGroup("General"); - QStringList list = config->readListEntry("EvalSchemes"); + TQStringList list = config->readListEntry("EvalSchemes"); evalList->insertItem( i18n("Current") ); evalList->insertItem( i18n("Default") ); for(int i=0;i<list.count();i++) @@ -52,33 +52,33 @@ EvalDlgImpl::~EvalDlgImpl() void EvalDlgImpl::connectEditLines() { - connect( moveEval1, SIGNAL(textChanged(const QString&)), this, SLOT(updateMove()) ); - connect( moveEval2, SIGNAL(textChanged(const QString&)), this, SLOT(updateMove()) ); - connect( moveEval3, SIGNAL(textChanged(const QString&)), this, SLOT(updateMove()) ); - connect( moveEval4, SIGNAL(textChanged(const QString&)), this, SLOT(updateMove()) ); - connect( moveEval5, SIGNAL(textChanged(const QString&)), this, SLOT(updateMove()) ); - connect( moveEval6, SIGNAL(textChanged(const QString&)), this, SLOT(updateMove()) ); - connect( moveEval7, SIGNAL(textChanged(const QString&)), this, SLOT(updateMove()) ); - connect( moveEval8, SIGNAL(textChanged(const QString&)), this, SLOT(updateMove()) ); - connect( moveEval9, SIGNAL(textChanged(const QString&)), this, SLOT(updateMove()) ); - connect( posEval1, SIGNAL(textChanged(const QString&)), this, SLOT(updateFields()) ); - connect( posEval2, SIGNAL(textChanged(const QString&)), this, SLOT(updateFields()) ); - connect( posEval3, SIGNAL(textChanged(const QString&)), this, SLOT(updateFields()) ); - connect( posEval4, SIGNAL(textChanged(const QString&)), this, SLOT(updateFields()) ); - connect( posEval5, SIGNAL(textChanged(const QString&)), this, SLOT(updateFields()) ); - connect( diffEval2, SIGNAL(textChanged(const QString&)), this, SLOT(updateFields()) ); - connect( diffEval3, SIGNAL(textChanged(const QString&)), this, SLOT(updateFields()) ); - connect( diffEval4, SIGNAL(textChanged(const QString&)), this, SLOT(updateFields()) ); - connect( diffEval5, SIGNAL(textChanged(const QString&)), this, SLOT(updateFields()) ); - connect( rowEval2, SIGNAL(textChanged(const QString&)), this, SLOT(updateInARow()) ); - connect( rowEval3, SIGNAL(textChanged(const QString&)), this, SLOT(updateInARow()) ); - connect( rowEval4, SIGNAL(textChanged(const QString&)), this, SLOT(updateInARow()) ); - connect( rowEval5, SIGNAL(textChanged(const QString&)), this, SLOT(updateInARow()) ); - connect( countEval1, SIGNAL(textChanged(const QString&)), this, SLOT(updateCount()) ); - connect( countEval2, SIGNAL(textChanged(const QString&)), this, SLOT(updateCount()) ); - connect( countEval3, SIGNAL(textChanged(const QString&)), this, SLOT(updateCount()) ); - connect( countEval4, SIGNAL(textChanged(const QString&)), this, SLOT(updateCount()) ); - connect( countEval5, SIGNAL(textChanged(const QString&)), this, SLOT(updateCount()) ); + connect( moveEval1, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateMove()) ); + connect( moveEval2, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateMove()) ); + connect( moveEval3, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateMove()) ); + connect( moveEval4, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateMove()) ); + connect( moveEval5, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateMove()) ); + connect( moveEval6, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateMove()) ); + connect( moveEval7, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateMove()) ); + connect( moveEval8, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateMove()) ); + connect( moveEval9, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateMove()) ); + connect( posEval1, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateFields()) ); + connect( posEval2, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateFields()) ); + connect( posEval3, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateFields()) ); + connect( posEval4, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateFields()) ); + connect( posEval5, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateFields()) ); + connect( diffEval2, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateFields()) ); + connect( diffEval3, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateFields()) ); + connect( diffEval4, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateFields()) ); + connect( diffEval5, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateFields()) ); + connect( rowEval2, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateInARow()) ); + connect( rowEval3, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateInARow()) ); + connect( rowEval4, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateInARow()) ); + connect( rowEval5, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateInARow()) ); + connect( countEval1, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateCount()) ); + connect( countEval2, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateCount()) ); + connect( countEval3, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateCount()) ); + connect( countEval4, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateCount()) ); + connect( countEval5, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateCount()) ); } void EvalDlgImpl::disconnectEditLines() @@ -115,40 +115,40 @@ void EvalDlgImpl::disconnectEditLines() void EvalDlgImpl::updateWidgets() { // Moves - moveEval1->setText( QString::number(_scheme->moveValue(Move::move1)) ); - moveEval2->setText( QString::number(_scheme->moveValue(Move::move2)) ); - moveEval3->setText( QString::number(_scheme->moveValue(Move::move3)) ); - moveEval4->setText( QString::number(_scheme->moveValue(Move::push1with2)) ); - moveEval5->setText( QString::number(_scheme->moveValue(Move::push1with3)) ); - moveEval6->setText( QString::number(_scheme->moveValue(Move::push2)) ); - moveEval7->setText( QString::number(_scheme->moveValue(Move::out1with2)) ); - moveEval8->setText( QString::number(_scheme->moveValue(Move::out1with3)) ); - moveEval9->setText( QString::number(_scheme->moveValue(Move::out2)) ); + moveEval1->setText( TQString::number(_scheme->moveValue(Move::move1)) ); + moveEval2->setText( TQString::number(_scheme->moveValue(Move::move2)) ); + moveEval3->setText( TQString::number(_scheme->moveValue(Move::move3)) ); + moveEval4->setText( TQString::number(_scheme->moveValue(Move::push1with2)) ); + moveEval5->setText( TQString::number(_scheme->moveValue(Move::push1with3)) ); + moveEval6->setText( TQString::number(_scheme->moveValue(Move::push2)) ); + moveEval7->setText( TQString::number(_scheme->moveValue(Move::out1with2)) ); + moveEval8->setText( TQString::number(_scheme->moveValue(Move::out1with3)) ); + moveEval9->setText( TQString::number(_scheme->moveValue(Move::out2)) ); // Position - posEval1->setText( QString::number(_scheme->ringValue(0)) ); - posEval2->setText( QString::number(_scheme->ringValue(1)) ); - posEval3->setText( QString::number(_scheme->ringValue(2)) ); - posEval4->setText( QString::number(_scheme->ringValue(3)) ); - posEval5->setText( QString::number(_scheme->ringValue(4)) ); + posEval1->setText( TQString::number(_scheme->ringValue(0)) ); + posEval2->setText( TQString::number(_scheme->ringValue(1)) ); + posEval3->setText( TQString::number(_scheme->ringValue(2)) ); + posEval4->setText( TQString::number(_scheme->ringValue(3)) ); + posEval5->setText( TQString::number(_scheme->ringValue(4)) ); - diffEval2->setText( QString::number(_scheme->ringDiff(1)) ); - diffEval3->setText( QString::number(_scheme->ringDiff(2)) ); - diffEval4->setText( QString::number(_scheme->ringDiff(3)) ); - diffEval5->setText( QString::number(_scheme->ringDiff(4)) ); + diffEval2->setText( TQString::number(_scheme->ringDiff(1)) ); + diffEval3->setText( TQString::number(_scheme->ringDiff(2)) ); + diffEval4->setText( TQString::number(_scheme->ringDiff(3)) ); + diffEval5->setText( TQString::number(_scheme->ringDiff(4)) ); // InARow - rowEval2->setText( QString::number(_scheme->inARowValue(0)) ); - rowEval3->setText( QString::number(_scheme->inARowValue(1)) ); - rowEval4->setText( QString::number(_scheme->inARowValue(2)) ); - rowEval5->setText( QString::number(_scheme->inARowValue(3)) ); + rowEval2->setText( TQString::number(_scheme->inARowValue(0)) ); + rowEval3->setText( TQString::number(_scheme->inARowValue(1)) ); + rowEval4->setText( TQString::number(_scheme->inARowValue(2)) ); + rowEval5->setText( TQString::number(_scheme->inARowValue(3)) ); // Count - countEval1->setText( QString::number(_scheme->stoneValue(1)) ); - countEval2->setText( QString::number(_scheme->stoneValue(2)) ); - countEval3->setText( QString::number(_scheme->stoneValue(3)) ); - countEval4->setText( QString::number(_scheme->stoneValue(4)) ); - countEval5->setText( QString::number(_scheme->stoneValue(5)) ); + countEval1->setText( TQString::number(_scheme->stoneValue(1)) ); + countEval2->setText( TQString::number(_scheme->stoneValue(2)) ); + countEval3->setText( TQString::number(_scheme->stoneValue(3)) ); + countEval4->setText( TQString::number(_scheme->stoneValue(4)) ); + countEval5->setText( TQString::number(_scheme->stoneValue(5)) ); updateEval(); } @@ -232,12 +232,12 @@ void EvalDlgImpl::deleteEntry() // You cannot delete Pseudo Items 0 (Current) and 1 (Default) if (i>1) { - QString name = evalList->text(i); + TQString name = evalList->text(i); evalList->removeItem(i); KConfig* config = kapp->config(); config->setGroup("General"); - QStringList list = config->readListEntry("EvalSchemes"); + TQStringList list = config->readListEntry("EvalSchemes"); list.remove(name); config->writeEntry("EvalSchemes", list); config->sync(); @@ -246,15 +246,15 @@ void EvalDlgImpl::deleteEntry() void EvalDlgImpl::saveas() { - KLineEditDlg dlg(i18n("Name for scheme:"), QString::null, this); + KLineEditDlg dlg(i18n("Name for scheme:"), TQString::null, this); dlg.setCaption(i18n("Save Scheme")); if (dlg.exec()) { - QString name=dlg.text(); + TQString name=dlg.text(); KConfig* config = kapp->config(); config->setGroup("General"); - QStringList list = config->readListEntry("EvalSchemes"); - QListBoxItem *it = evalList->findItem(name); + TQStringList list = config->readListEntry("EvalSchemes"); + TQListBoxItem *it = evalList->findItem(name); if (!it) { evalList->insertItem(name); it = evalList->findItem(name); @@ -272,7 +272,7 @@ void EvalDlgImpl::saveas() void EvalDlgImpl::select(int i) { - QString name = evalList->text(i); + TQString name = evalList->text(i); delete _scheme; _scheme = 0; diff --git a/kenolaba/EvalDlgImpl.h b/kenolaba/EvalDlgImpl.h index 70c903fb..e7e4cb0d 100644 --- a/kenolaba/EvalDlgImpl.h +++ b/kenolaba/EvalDlgImpl.h @@ -16,7 +16,7 @@ class EvalDlgImpl: public EvalDlg Q_OBJECT public: - EvalDlgImpl(QWidget* parent, Board* board); + EvalDlgImpl(TQWidget* parent, Board* board); ~EvalDlgImpl(); EvalScheme* evalScheme() { return _scheme; } diff --git a/kenolaba/EvalScheme.cpp b/kenolaba/EvalScheme.cpp index 18ba5b43..d884f398 100644 --- a/kenolaba/EvalScheme.cpp +++ b/kenolaba/EvalScheme.cpp @@ -24,7 +24,7 @@ static int defaultInARowValue[InARowCounter::inARowCount]= { 2, 5, 4, 3 }; /** * Constructor: Set Default values */ -EvalScheme::EvalScheme(QString n) +EvalScheme::EvalScheme(TQString n) { _name = n; setDefaults(); @@ -76,11 +76,11 @@ void EvalScheme::setDefaults() void EvalScheme::read(KConfig *config) { - QString confSection = QString("%1 Evaluation Scheme").arg(_name); + TQString confSection = TQString("%1 Evaluation Scheme").arg(_name); config->setGroup(confSection); - QStringList list; - QString tmp; + TQStringList list; + TQString tmp; list = config->readListEntry("StoneValues"); if (list.count()>0) { @@ -117,10 +117,10 @@ void EvalScheme::read(KConfig *config) void EvalScheme::save(KConfig* config) { - QString confSection = QString("%1 Evaluation Scheme").arg(_name); + TQString confSection = TQString("%1 Evaluation Scheme").arg(_name); config->setGroup(confSection); - QString entry; + TQString entry; entry.sprintf("%d,%d,%d,%d,%d", _stoneValue[1], _stoneValue[2], _stoneValue[3], _stoneValue[4], _stoneValue[5]); @@ -128,12 +128,12 @@ void EvalScheme::save(KConfig* config) entry.sprintf("%d", _moveValue[0]); for(int i=1;i<Move::typeCount;i++) - entry += QString(", %1").arg( _moveValue[i] ); + entry += TQString(", %1").arg( _moveValue[i] ); config->writeEntry("MoveValues", entry); entry.sprintf("%d", _inARowValue[0]); for(int i=1;i<InARowCounter::inARowCount;i++) - entry += QString(", %1").arg( _inARowValue[i] ); + entry += TQString(", %1").arg( _inARowValue[i] ); config->writeEntry("InARowValues", entry); entry.sprintf("%d,%d,%d,%d,%d", _ringValue[0], _ringValue[1], @@ -182,7 +182,7 @@ void EvalScheme::setInARowValue(int stones, int value) * */ -EvalScheme* EvalScheme::create(QString scheme) +EvalScheme* EvalScheme::create(TQString scheme) { int pos = scheme.find('='); if (pos<0) return 0; @@ -190,7 +190,7 @@ EvalScheme* EvalScheme::create(QString scheme) EvalScheme* evalScheme = new EvalScheme( scheme.left(pos) ); evalScheme->setDefaults(); - QStringList list = QStringList::split( QString(","), scheme.right(pos+1) ); + TQStringList list = TQStringList::split( TQString(","), scheme.right(pos+1) ); int i=0; while(i<list.count()) { @@ -210,22 +210,22 @@ EvalScheme* EvalScheme::create(QString scheme) return evalScheme; } -QString EvalScheme::ascii() +TQString EvalScheme::ascii() { - QString res; + TQString res; int i; res.sprintf("%s=%d", _name.ascii(), _stoneValue[1]); for(i=1;i<6;i++) - res += QString(",%1").arg( _stoneValue[i] ); + res += TQString(",%1").arg( _stoneValue[i] ); for(i=0;i<Move::typeCount;i++) - res += QString(",%1").arg( _moveValue[i] ); + res += TQString(",%1").arg( _moveValue[i] ); for(i=0;i<InARowCounter::inARowCount;i++) - res += QString(",%1").arg( _inARowValue[i] ); + res += TQString(",%1").arg( _inARowValue[i] ); for(i=0;i<5;i++) - res += QString(",%1").arg( _ringValue[i] ); + res += TQString(",%1").arg( _ringValue[i] ); for(i=0;i<5;i++) - res += QString(",%1").arg( _ringDiff[i] ); + res += TQString(",%1").arg( _ringDiff[i] ); return res; } diff --git a/kenolaba/EvalScheme.h b/kenolaba/EvalScheme.h index 0efcafb8..3a9982c5 100644 --- a/kenolaba/EvalScheme.h +++ b/kenolaba/EvalScheme.h @@ -10,7 +10,7 @@ #ifndef _EVALSCHEME_H_ #define _EVALSCHEME_H_ -#include <qstring.h> +#include <tqstring.h> #include "Move.h" @@ -25,7 +25,7 @@ class KConfig; class EvalScheme { public: - EvalScheme(QString); + EvalScheme(TQString); EvalScheme(EvalScheme&); ~EvalScheme() {} @@ -33,17 +33,17 @@ class EvalScheme void read(KConfig*); void save(KConfig*); - static EvalScheme* create(QString); - QString ascii(); + static EvalScheme* create(TQString); + TQString ascii(); - void setName(QString n) { _name = n; } + void setName(TQString n) { _name = n; } void setRingValue(int ring, int value); void setRingDiff(int ring, int value); void setStoneValue(int stoneDiff, int value); void setMoveValue(int type, int value); void setInARowValue(int stones, int value); - QString name() { return _name; } + TQString name() { return _name; } int ringValue(int r) { return (r>=0 && r<5) ? _ringValue[r] : 0; } int ringDiff(int r) { return (r>0 && r<5) ? _ringDiff[r] : 0; } int stoneValue(int s) { return (s>0 && s<6) ? _stoneValue[s] : 0; } @@ -55,7 +55,7 @@ class EvalScheme int _stoneValue[6], _moveValue[Move::none]; int _inARowValue[InARowCounter::inARowCount]; - QString _name; + TQString _name; }; #endif // _EVALSCHEME_H_ diff --git a/kenolaba/Move.cpp b/kenolaba/Move.cpp index 40bc3938..27e7b53a 100644 --- a/kenolaba/Move.cpp +++ b/kenolaba/Move.cpp @@ -7,14 +7,14 @@ #include <assert.h> #include <stdio.h> -#include <qstring.h> +#include <tqstring.h> #include <klocale.h> #include "Move.h" #include "Board.h" -const QString nameOfDir(int dir) +const TQString nameOfDir(int dir) { dir = dir % 6; return @@ -23,22 +23,22 @@ const QString nameOfDir(int dir) (dir == 3) ? i18n("LeftDown") : (dir == 4) ? i18n("Left") : (dir == 5) ? i18n("LeftUp") : - (dir == 0) ? i18n("RightUp") : QString("??"); + (dir == 0) ? i18n("RightUp") : TQString("??"); } -QString nameOfPos(int p) +TQString nameOfPos(int p) { static char tmp[3]; tmp[0] = 'A' + (p-12)/11; tmp[1] = '1' + (p-12)%11; tmp[2] = 0; - return QString( tmp ); + return TQString( tmp ); } -QString Move::name() const +TQString Move::name() const { - QString s,tmp; + TQString s,tmp; /* sideway moves... */ if (type == left3 || type == right3) { @@ -74,7 +74,7 @@ QString Move::name() const s+= (type == left2) ? nameOfDir(direction-1): nameOfDir(direction+1); } else if (type == none) { - s = QString("??"); + s = TQString("??"); } else { s = nameOfPos( field ); @@ -82,7 +82,7 @@ QString Move::name() const s += nameOfDir(direction); tmp = (type <3 ) ? i18n("Out") : - (type <6 ) ? i18n("Push") : QString(""); + (type <6 ) ? i18n("Push") : TQString(""); if (!tmp.isEmpty()) { s += '/'; s += tmp; diff --git a/kenolaba/Move.h b/kenolaba/Move.h index 1226d969..5cde59e2 100644 --- a/kenolaba/Move.h +++ b/kenolaba/Move.h @@ -7,7 +7,7 @@ #ifndef _MOVE_H_ #define _MOVE_H_ -#include <qstring.h> +#include <tqstring.h> class Move { @@ -35,7 +35,7 @@ class Move static int maxMoveType() { return move1; } - QString name() const; + TQString name() const; void print() const; diff --git a/kenolaba/Network.cpp b/kenolaba/Network.cpp index e12f6b5e..0f031e99 100644 --- a/kenolaba/Network.cpp +++ b/kenolaba/Network.cpp @@ -61,9 +61,9 @@ Network::Network(int port) return; } - sn = new QSocketNotifier( fd, QSocketNotifier::Read ); - QObject::connect( sn, SIGNAL(activated(int)), - this, SLOT(gotConnection()) ); + sn = new TQSocketNotifier( fd, TQSocketNotifier::Read ); + TQObject::connect( sn, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(gotConnection()) ); } Network::~Network() diff --git a/kenolaba/Network.h b/kenolaba/Network.h index d5251cc6..59861825 100644 --- a/kenolaba/Network.h +++ b/kenolaba/Network.h @@ -10,9 +10,9 @@ #include <sys/types.h> #include <netinet/in.h> -#include <qobject.h> -#include <qptrlist.h> -#include <qsocketnotifier.h> +#include <tqobject.h> +#include <tqptrlist.h> +#include <tqsocketnotifier.h> class Listener { public: @@ -49,10 +49,10 @@ class Network: public QObject private: bool sendString(struct sockaddr_in sin, char* str, int len); - QPtrList<Listener> listeners; + TQPtrList<Listener> listeners; struct sockaddr_in mySin; int fd, myPort; - QSocketNotifier *sn; + TQSocketNotifier *sn; }; #endif diff --git a/kenolaba/Spy.cpp b/kenolaba/Spy.cpp index 07f17702..b10892cc 100644 --- a/kenolaba/Spy.cpp +++ b/kenolaba/Spy.cpp @@ -4,9 +4,9 @@ */ -#include <qgroupbox.h> -#include <qlayout.h> -#include <qlabel.h> +#include <tqgroupbox.h> +#include <tqlayout.h> +#include <tqlabel.h> #include <klocale.h> #include <kapplication.h> @@ -19,69 +19,69 @@ Spy::Spy(Board& b) { int i; - top = new QVBoxLayout(this, 5); + top = new TQVBoxLayout(this, 5); - QLabel *l = new QLabel(this); + TQLabel *l = new TQLabel(this); l->setText( i18n("Actual examined position:") ); l->setFixedHeight( l->sizeHint().height() ); l->setAlignment( AlignVCenter | AlignLeft ); top->addWidget( l ); - QHBoxLayout* b1 = new QHBoxLayout(); + TQHBoxLayout* b1 = new TQHBoxLayout(); top->addLayout( b1, 10 ); for(i=0;i<BoardCount;i++) { - QVBoxLayout *b2 = new QVBoxLayout(); + TQVBoxLayout *b2 = new TQVBoxLayout(); b1->addLayout( b2 ); actBoard[i] = new BoardWidget(board,this); - actLabel[i] = new QLabel(this); + actLabel[i] = new TQLabel(this); actLabel[i]->setText("---"); - // actLabel[i]->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + // actLabel[i]->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); actLabel[i]->setAlignment( AlignHCenter | AlignVCenter); actLabel[i]->setFixedHeight( actLabel[i]->sizeHint().height() ); b2->addWidget( actBoard[i] ); b2->addWidget( actLabel[i] ); - connect( actBoard[i], SIGNAL(mousePressed()), this, SLOT(nextStep()) ); + connect( actBoard[i], TQT_SIGNAL(mousePressed()), this, TQT_SLOT(nextStep()) ); } - l = new QLabel(this); + l = new TQLabel(this); l->setText( i18n("Best move so far:") ); l->setFixedHeight( l->sizeHint().height() ); l->setAlignment( AlignVCenter | AlignLeft ); top->addWidget( l ); - b1 = new QHBoxLayout(); + b1 = new TQHBoxLayout(); top->addLayout( b1, 10 ); for(i=0;i<BoardCount;i++) { - QVBoxLayout *b2 = new QVBoxLayout(); + TQVBoxLayout *b2 = new TQVBoxLayout(); b1->addLayout( b2 ); bestBoard[i] = new BoardWidget(board,this); - bestLabel[i] = new QLabel(this); + bestLabel[i] = new TQLabel(this); bestLabel[i]->setText("---"); - // bestLabel[i]->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + // bestLabel[i]->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); bestLabel[i]->setAlignment( AlignHCenter | AlignVCenter); bestLabel[i]->setFixedHeight( bestLabel[i]->sizeHint().height() ); b2->addWidget( bestBoard[i] ); b2->addWidget( bestLabel[i] ); - connect( bestBoard[i], SIGNAL(mousePressed()), this, SLOT(nextStep()) ); + connect( bestBoard[i], TQT_SIGNAL(mousePressed()), this, TQT_SLOT(nextStep()) ); } - connect( &board, SIGNAL(update(int,int,Move&,bool)), - this, SLOT(update(int,int,Move&,bool)) ); - connect( &board, SIGNAL(updateBest(int,int,Move&,bool)), - this, SLOT(updateBest(int,int,Move&,bool)) ); + connect( &board, TQT_SIGNAL(update(int,int,Move&,bool)), + this, TQT_SLOT(update(int,int,Move&,bool)) ); + connect( &board, TQT_SIGNAL(updateBest(int,int,Move&,bool)), + this, TQT_SLOT(updateBest(int,int,Move&,bool)) ); top->activate(); setCaption(i18n("Spy")); // KWM::setDecoration(winId(), 2); resize(500,300); } -void Spy::keyPressEvent(QKeyEvent *) +void Spy::keyPressEvent(TQKeyEvent *) { nextStep(); } @@ -139,7 +139,7 @@ void Spy::updateBest(int depth, int value, Move& m, bool cutoff) board.playMove(m); bestBoard[depth+1]->updatePosition(true); - QString tmp; + TQString tmp; tmp.setNum(value); if (cutoff) tmp += " (CutOff)"; bestLabel[depth+1]->setText(tmp); diff --git a/kenolaba/Spy.h b/kenolaba/Spy.h index f69d99d3..d2a63cbf 100644 --- a/kenolaba/Spy.h +++ b/kenolaba/Spy.h @@ -7,7 +7,7 @@ #define _SPY_H_ -#include <qlayout.h> +#include <tqlayout.h> #include "Board.h" @@ -26,7 +26,7 @@ public: void clearActBoards(); - void keyPressEvent(QKeyEvent *e); + void keyPressEvent(TQKeyEvent *e); public slots: void update(int,int,Move&,bool); @@ -36,9 +36,9 @@ public slots: private: bool next; Board &board; - QBoxLayout *top; + TQBoxLayout *top; BoardWidget *actBoard[BoardCount], *bestBoard[BoardCount]; - QLabel *actLabel[BoardCount], *bestLabel[BoardCount]; + TQLabel *actLabel[BoardCount], *bestLabel[BoardCount]; }; diff --git a/kenolaba/kenolaba.cpp b/kenolaba/kenolaba.cpp index e59aa9d7..821fb19e 100644 --- a/kenolaba/kenolaba.cpp +++ b/kenolaba/kenolaba.cpp @@ -1,6 +1,6 @@ /* Start point */ -#include <qobject.h> +#include <tqobject.h> #include <kapplication.h> #include <klocale.h> diff --git a/kfouleggs/board.cpp b/kfouleggs/board.cpp index 836c7e1e..5383c619 100644 --- a/kfouleggs/board.cpp +++ b/kfouleggs/board.cpp @@ -9,7 +9,7 @@ using namespace KGrid2D; -FEBoard::FEBoard(bool graphic, QWidget *parent) +FEBoard::FEBoard(bool graphic, TQWidget *parent) : Board(graphic, new GiftPool(parent), parent), _field(matrix().width(), matrix().height()), _chainedPuyos(4) { @@ -126,7 +126,7 @@ uint FEBoard::gift() bool FEBoard::putGift(uint n) { - QMemArray<bool> free(matrix().width()); + TQMemArray<bool> free(matrix().width()); // garbage blocks are put randomly on conlumns with more than 5 free lines. uint nbFree = 0; diff --git a/kfouleggs/board.h b/kfouleggs/board.h index e0889b3b..da5a6275 100644 --- a/kfouleggs/board.h +++ b/kfouleggs/board.h @@ -8,7 +8,7 @@ class FEBoard : public Board { Q_OBJECT public: - FEBoard(bool graphic, QWidget *parent); + FEBoard(bool graphic, TQWidget *parent); void copy(const GenericTetris &); void start(const GTInitData &); @@ -37,7 +37,7 @@ class FEBoard : public Board bool putGift(uint); KGrid2D::Square<int> _field; - QMemArray<uint> _groups, _chainedPuyos; + TQMemArray<uint> _groups, _chainedPuyos; uint _nbPuyos, _chained, _giftRest, _lastChained; }; diff --git a/kfouleggs/field.cpp b/kfouleggs/field.cpp index 9d7abe85..ae9bcdce 100644 --- a/kfouleggs/field.cpp +++ b/kfouleggs/field.cpp @@ -1,7 +1,7 @@ #include "field.h" #include "field.moc" -#include <qwhatsthis.h> +#include <tqwhatsthis.h> #include <klocale.h> #include <kgamelcd.h> @@ -10,11 +10,11 @@ #include "board.h" -FEField::FEField(QWidget *parent) +FEField::FEField(TQWidget *parent) : Field(parent) { Board *b = static_cast<Board *>(board); - QWhatsThis::add(b->giftPool(), i18n("Display the amount of foul eggs sent by your opponent.")); + TQWhatsThis::add(b->giftPool(), i18n("Display the amount of foul eggs sent by your opponent.")); } void FEField::removedUpdated() @@ -45,17 +45,17 @@ void FEField::settingsChanged() lcd->show(); if ( CommonPrefs::showDetailedRemoved() ) { - QWhatsThis::add(removedList, + TQWhatsThis::add(removedList, i18n("Display the number of removed groups (\"puyos\") classified by the number of chained removal.")); for (uint i=0; i<4; i++) { KGameLCD *lcd = new KGameLCD(6, removedList); - QString s = (i==3 ? ">3" : QString::number(i)); + TQString s = (i==3 ? ">3" : TQString::number(i)); removedList->append(s, lcd); uint nb = static_cast<const FEBoard *>(board)->nbChainedPuyos(i); lcd->displayInt(nb); lcd->show(); } } else - QWhatsThis::add(removedList, + TQWhatsThis::add(removedList, i18n("Display the number of removed groups (\"puyos\").")); } diff --git a/kfouleggs/field.h b/kfouleggs/field.h index df7812f2..a1c9824e 100644 --- a/kfouleggs/field.h +++ b/kfouleggs/field.h @@ -9,7 +9,7 @@ class FEField : public Field { Q_OBJECT public: - FEField(QWidget *parent); + FEField(TQWidget *parent); private slots: virtual void removedUpdated(); diff --git a/kfouleggs/main.cpp b/kfouleggs/main.cpp index 4fbee4c7..89295d08 100644 --- a/kfouleggs/main.cpp +++ b/kfouleggs/main.cpp @@ -65,7 +65,7 @@ FEFactory::FEFactory() : CommonFactory(MAIN_DATA, BASE_BOARD_INFO, COMMON_BOARD_INFO) {} -BaseInterface *FEFactory::createInterface(QWidget *parent) +BaseInterface *FEFactory::createInterface(TQWidget *parent) { return new Interface(MP_GAME_INFO, parent); } diff --git a/kfouleggs/main.h b/kfouleggs/main.h index 5831d546..52108b2d 100644 --- a/kfouleggs/main.h +++ b/kfouleggs/main.h @@ -15,11 +15,11 @@ class FEFactory : public CommonFactory FEFactory(); protected: - virtual BaseBoard *createBoard(bool graphic, QWidget *parent) + virtual BaseBoard *createBoard(bool graphic, TQWidget *parent) { return new FEBoard(graphic, parent); } - virtual BaseField *createField(QWidget *parent) + virtual BaseField *createField(TQWidget *parent) { return new FEField(parent); } - virtual BaseInterface *createInterface(QWidget *parent); + virtual BaseInterface *createInterface(TQWidget *parent); virtual AI *createAI() { return new FEAI; } }; diff --git a/kfouleggs/piece.cpp b/kfouleggs/piece.cpp index 3c676f1c..bb5aad42 100644 --- a/kfouleggs/piece.cpp +++ b/kfouleggs/piece.cpp @@ -2,8 +2,8 @@ #include <math.h> -#include <qpainter.h> -#include <qbitmap.h> +#include <tqpainter.h> +#include <tqbitmap.h> #include <klocale.h> @@ -19,45 +19,45 @@ const char *FEPieceInfo::DEFAULT_COLORS[NB_NORM_BLOCK_TYPES + 1] = { "#64C864", "#64C8C8", "#C86464", "#C864C8", "#C8C8C8" }; -QColor FEPieceInfo::defaultColor(uint i) const +TQColor FEPieceInfo::defaultColor(uint i) const { - if ( i>=nbColors() ) return QColor(); - return QColor(DEFAULT_COLORS[i]); + if ( i>=nbColors() ) return TQColor(); + return TQColor(DEFAULT_COLORS[i]); } -QString FEPieceInfo::colorLabel(uint i) const +TQString FEPieceInfo::colorLabel(uint i) const { return (i==NB_NORM_BLOCK_TYPES ? i18n("Garbage color:") : i18n("Color #%1:").arg(i+1)); } -void FEPieceInfo::draw(QPixmap *pixmap, uint blockType, uint, +void FEPieceInfo::draw(TQPixmap *pixmap, uint blockType, uint, bool lighted) const { - QColor col = color(blockType); + TQColor col = color(blockType); if (lighted) col = col.light(); pixmap->fill(col); } -void FEPieceInfo::setMask(QPixmap *pixmap, uint blockMode) const +void FEPieceInfo::setMask(TQPixmap *pixmap, uint blockMode) const { Q_ASSERT( pixmap->width()==pixmap->height() ); // drawing code assumes that - QBitmap bitmap(pixmap->size(), true); - QPainter p(&bitmap); + TQBitmap bitmap(pixmap->size(), true); + TQPainter p(&bitmap); p.setBrush(Qt::color1); - p.setPen( QPen(Qt::NoPen) ); + p.setPen( TQPen(Qt::NoPen) ); // base circle int w = pixmap->width(); int d = (int)((sqrt(2)-2./3)*w); - QRect cr = QRect(0, 0, d, d); - cr.moveCenter(QPoint(w/2, w/2)); + TQRect cr = TQRect(0, 0, d, d); + cr.moveCenter(TQPoint(w/2, w/2)); p.drawEllipse(cr); if (blockMode) { int a = (int)(w/(3.*sqrt(2))); int ra = 2*w/3+1; - cr = QRect(0, 0, ra, ra); + cr = TQRect(0, 0, ra, ra); // first drawing with color1 if ( blockMode & BaseBoard::Up ) p.drawRect( 0, 0, w, a); @@ -68,19 +68,19 @@ void FEPieceInfo::setMask(QPixmap *pixmap, uint blockMode) const // second drawing with color0 p.setBrush(Qt::color0); if ( (blockMode & BaseBoard::Up) || (blockMode & BaseBoard::Left) ) { - cr.moveCenter(QPoint(0, 0)); + cr.moveCenter(TQPoint(0, 0)); p.drawEllipse(cr); } if ( (blockMode & BaseBoard::Right) || (blockMode & BaseBoard::Up) ) { - cr.moveCenter(QPoint(w-1, 0)); + cr.moveCenter(TQPoint(w-1, 0)); p.drawEllipse(cr); } if ( (blockMode & BaseBoard::Down) || (blockMode & BaseBoard::Right) ){ - cr.moveCenter(QPoint(w-1, w-1)); + cr.moveCenter(TQPoint(w-1, w-1)); p.drawEllipse(cr); } if ( (blockMode & BaseBoard::Left) || (blockMode & BaseBoard::Down) ) { - cr.moveCenter(QPoint(0, w-1)); + cr.moveCenter(TQPoint(0, w-1)); p.drawEllipse(cr); } } diff --git a/kfouleggs/piece.h b/kfouleggs/piece.h index ba90e902..e7b23e1e 100644 --- a/kfouleggs/piece.h +++ b/kfouleggs/piece.h @@ -27,12 +27,12 @@ class FEPieceInfo : public GPieceInfo virtual uint nbBlockModes() const { return NB_BLOCK_MODES; } virtual uint nbColors() const { return NB_NORM_BLOCK_TYPES + 1; } - virtual QString colorLabel(uint i) const; - virtual QColor defaultColor(uint i) const; + virtual TQString colorLabel(uint i) const; + virtual TQColor defaultColor(uint i) const; private: - void draw(QPixmap *, uint blockType, uint blockMode, bool lighted) const; - void setMask(QPixmap *, uint blockMode) const; + void draw(TQPixmap *, uint blockType, uint blockMode, bool lighted) const; + void setMask(TQPixmap *, uint blockMode) const; enum { NB_BLOCKS = 2, NB_NORM_BLOCK_TYPES = 4, diff --git a/kgoldrunner/src/kgoldrunner.cpp b/kgoldrunner/src/kgoldrunner.cpp index 6e8cfb3c..13300f9e 100644 --- a/kgoldrunner/src/kgoldrunner.cpp +++ b/kgoldrunner/src/kgoldrunner.cpp @@ -3,8 +3,8 @@ */ #include <kprinter.h> -#include <qpainter.h> -#include <qpaintdevicemetrics.h> +#include <tqpainter.h> +#include <tqpaintdevicemetrics.h> #include <kglobal.h> #include <klocale.h> @@ -88,10 +88,10 @@ KGoldrunner::KGoldrunner() initStatusBar(); // Connect the game actions to the menu and toolbar displays. - connect(game, SIGNAL (setEditMenu (bool)), SLOT (setEditMenu (bool))); - connect(game, SIGNAL (markRuleType (char)), SLOT (markRuleType (char))); - connect(game, SIGNAL (hintAvailable(bool)), SLOT (adjustHintAction(bool))); - connect(game, SIGNAL (defaultEditObj()), SLOT (defaultEditObj())); + connect(game, TQT_SIGNAL (setEditMenu (bool)), TQT_SLOT (setEditMenu (bool))); + connect(game, TQT_SIGNAL (markRuleType (char)), TQT_SLOT (markRuleType (char))); + connect(game, TQT_SIGNAL (hintAvailable(bool)), TQT_SLOT (adjustHintAction(bool))); + connect(game, TQT_SIGNAL (defaultEditObj()), TQT_SLOT (defaultEditObj())); // Apply the saved mainwindow settings, if any, and ask the mainwindow // to automatically save settings if changed: window size, toolbar @@ -157,22 +157,22 @@ void KGoldrunner::setupActions() KAction * newAction = KStdGameAction:: gameNew ( game, - SLOT(startLevelOne()), actionCollection()); + TQT_SLOT(startLevelOne()), actionCollection()); newAction-> setText (i18n("&New Game...")); KAction * loadGame = KStdGameAction:: load ( - game, SLOT(loadGame()), actionCollection()); + game, TQT_SLOT(loadGame()), actionCollection()); loadGame-> setText (i18n("&Load Saved Game...")); (void) new KAction ( i18n("&Play Any Level..."), 0, - game, SLOT(startAnyLevel()), actionCollection(), + game, TQT_SLOT(startAnyLevel()), actionCollection(), "play_any"); (void) new KAction ( i18n("Play &Next Level..."), 0, game, - SLOT(startNextLevel()), actionCollection(), + TQT_SLOT(startNextLevel()), actionCollection(), "play_next"); // Save Game... @@ -181,7 +181,7 @@ void KGoldrunner::setupActions() saveGame = KStdGameAction:: save ( - game, SLOT(saveGame()), actionCollection()); + game, TQT_SLOT(saveGame()), actionCollection()); saveGame-> setText (i18n("&Save Game...")); saveGame-> setShortcut (Key_S); // Alternate key. @@ -193,20 +193,20 @@ void KGoldrunner::setupActions() myPause = KStdGameAction:: pause ( - this, SLOT(stopStart()), actionCollection()); + this, TQT_SLOT(stopStart()), actionCollection()); myPause-> setShortcut (Key_Escape); // Alternate key. highScore = KStdGameAction:: highscores ( - game, SLOT(showHighScores()), actionCollection()); + game, TQT_SLOT(showHighScores()), actionCollection()); hintAction = new KAction ( i18n("&Get Hint"), "ktip", 0, - game, SLOT(showHint()), actionCollection(), + game, TQT_SLOT(showHint()), actionCollection(), "get_hint"); killHero = new KAction ( i18n("&Kill Hero"), Key_Q, - game, SLOT(herosDead()), actionCollection(), + game, TQT_SLOT(herosDead()), actionCollection(), "kill_hero"); // Quit @@ -214,7 +214,7 @@ void KGoldrunner::setupActions() (void) KStdGameAction:: quit ( - this, SLOT(close()), actionCollection()); + this, TQT_SLOT(close()), actionCollection()); /**************************************************************************/ /*************************** GAME EDITOR MENU **************************/ @@ -228,17 +228,17 @@ void KGoldrunner::setupActions() (void) new KAction ( i18n("&Create Level"), 0, - game, SLOT(createLevel()), actionCollection(), + game, TQT_SLOT(createLevel()), actionCollection(), "create"); (void) new KAction ( i18n("&Edit Any Level..."), 0, - game, SLOT(updateLevel()), actionCollection(), + game, TQT_SLOT(updateLevel()), actionCollection(), "edit_any"); (void) new KAction ( i18n("Edit &Next Level..."), 0, - game, SLOT(updateNext()), actionCollection(), + game, TQT_SLOT(updateNext()), actionCollection(), "edit_next"); // Save Edits... @@ -249,20 +249,20 @@ void KGoldrunner::setupActions() saveEdits = new KAction ( i18n("&Save Edits..."), 0, - game, SLOT(saveLevelFile()), actionCollection(), + game, TQT_SLOT(saveLevelFile()), actionCollection(), "save_edits"); saveEdits->setEnabled (FALSE); // Nothing to save, yet. (void) new KAction ( i18n("&Move Level..."), 0, - game, SLOT(moveLevelFile()), actionCollection(), + game, TQT_SLOT(moveLevelFile()), actionCollection(), "move_level"); (void) new KAction ( i18n("&Delete Level..."), 0, game, - SLOT(deleteLevelFile()), actionCollection(), + TQT_SLOT(deleteLevelFile()), actionCollection(), "delete_level"); // Create a Game @@ -272,13 +272,13 @@ void KGoldrunner::setupActions() (void) new KAction ( i18n("Create Game..."), 0, - this, SLOT(createGame()), actionCollection(), + this, TQT_SLOT(createGame()), actionCollection(), "create_game"); (void) new KAction ( i18n("Edit Game Info..."), 0, this, - SLOT(editGameInfo()), actionCollection(), + TQT_SLOT(editGameInfo()), actionCollection(), "edit_game"); /**************************************************************************/ @@ -290,27 +290,27 @@ void KGoldrunner::setupActions() setKGoldrunner = new KRadioAction ( "K&Goldrunner", 0, // Default Shift+G - this, SLOT(lsKGoldrunner()), actionCollection(), + this, TQT_SLOT(lsKGoldrunner()), actionCollection(), "kgoldrunner"); setAppleII = new KRadioAction ( "&Apple II", 0, // Default Shift+A - this, SLOT(lsApple2()), actionCollection(), + this, TQT_SLOT(lsApple2()), actionCollection(), "apple_2"); setIceCave = new KRadioAction ( i18n("&Ice Cave"), 0, // Default Shift+I - this, SLOT(lsIceCave()), actionCollection(), + this, TQT_SLOT(lsIceCave()), actionCollection(), "ice_cave"); setMidnight = new KRadioAction ( i18n("&Midnight"), 0, // Default Shift+M - this, SLOT(lsMidnight()), actionCollection(), + this, TQT_SLOT(lsMidnight()), actionCollection(), "midnight"); setKDEKool = new KRadioAction ( i18n("&KDE Kool"), 0, // Default Shift+K - this, SLOT(lsKDEKool()), actionCollection(), + this, TQT_SLOT(lsKDEKool()), actionCollection(), "kde_kool"); setKGoldrunner-> setExclusiveGroup ("landscapes"); @@ -332,13 +332,13 @@ void KGoldrunner::setupActions() i18n("&Mouse Controls Hero"), 0, this, - SLOT(setMouseMode()), actionCollection(), + TQT_SLOT(setMouseMode()), actionCollection(), "mouse_mode"); setKeyboard = new KRadioAction ( i18n("&Keyboard Controls Hero"), 0, this, - SLOT(setKeyBoardMode()), actionCollection(), + TQT_SLOT(setKeyBoardMode()), actionCollection(), "keyboard_mode"); setMouse-> setExclusiveGroup ("control"); @@ -355,27 +355,27 @@ void KGoldrunner::setupActions() KRadioAction * nSpeed = new KRadioAction ( i18n("Normal Speed"), 0, - this, SLOT(normalSpeed()), actionCollection(), + this, TQT_SLOT(normalSpeed()), actionCollection(), "normal_speed"); KRadioAction * bSpeed = new KRadioAction ( i18n("Beginner Speed"), 0, - this, SLOT(beginSpeed()), actionCollection(), + this, TQT_SLOT(beginSpeed()), actionCollection(), "beginner_speed"); KRadioAction * cSpeed = new KRadioAction ( i18n("Champion Speed"), 0, - this, SLOT(champSpeed()), actionCollection(), + this, TQT_SLOT(champSpeed()), actionCollection(), "champion_speed"); (void) new KAction ( // Repeatable action. i18n("Increase Speed"), Key_Plus, - this, SLOT(incSpeed()), actionCollection(), + this, TQT_SLOT(incSpeed()), actionCollection(), "increase_speed"); (void) new KAction ( // Repeatable action. i18n("Decrease Speed"), Key_Minus, - this, SLOT(decSpeed()), actionCollection(), + this, TQT_SLOT(decSpeed()), actionCollection(), "decrease_speed"); nSpeed-> setExclusiveGroup ("speed"); @@ -390,12 +390,12 @@ void KGoldrunner::setupActions() tradRules = new KRadioAction ( i18n("&Traditional Rules"), 0, - this, SLOT(setTradRules()), actionCollection(), + this, TQT_SLOT(setTradRules()), actionCollection(), "trad_rules"); kgrRules = new KRadioAction ( i18n("K&Goldrunner Rules"), 0, - this, SLOT(setKGrRules()), actionCollection(), + this, TQT_SLOT(setKGrRules()), actionCollection(), "kgr_rules"); tradRules-> setExclusiveGroup ("rules"); @@ -409,12 +409,12 @@ void KGoldrunner::setupActions() (void) new KAction ( i18n("Larger Playing Area"), 0, - this, SLOT(makeLarger()), actionCollection(), + this, TQT_SLOT(makeLarger()), actionCollection(), "larger_area"); (void) new KAction ( i18n("Smaller Playing Area"), 0, - this, SLOT(makeSmaller()), actionCollection(), + this, TQT_SLOT(makeSmaller()), actionCollection(), "smaller_area"); // Configure Shortcuts... @@ -422,10 +422,10 @@ void KGoldrunner::setupActions() // -------------------------- KStdAction::keyBindings ( - this, SLOT(optionsConfigureKeys()), + this, TQT_SLOT(optionsConfigureKeys()), actionCollection()); // KStdAction::configureToolbars ( - // this, SLOT(optionsConfigureToolbars()), + // this, TQT_SLOT(optionsConfigureToolbars()), // actionCollection()); /**************************************************************************/ @@ -435,19 +435,19 @@ void KGoldrunner::setupActions() // Two-handed KB controls and alternate one-handed controls for the hero. (void) new KAction (i18n("Move Up"), Key_Up, - this, SLOT(goUp()), actionCollection(), "move_up"); + this, TQT_SLOT(goUp()), actionCollection(), "move_up"); (void) new KAction (i18n("Move Right"), Key_Right, - this, SLOT(goR()), actionCollection(), "move_right"); + this, TQT_SLOT(goR()), actionCollection(), "move_right"); (void) new KAction (i18n("Move Down"), Key_Down, - this, SLOT(goDown()), actionCollection(), "move_down"); + this, TQT_SLOT(goDown()), actionCollection(), "move_down"); (void) new KAction (i18n("Move Left"), Key_Left, - this, SLOT(goL()), actionCollection(), "move_left"); + this, TQT_SLOT(goL()), actionCollection(), "move_left"); (void) new KAction (i18n("Stop"), Key_Space, - this, SLOT(stop()), actionCollection(), "stop"); + this, TQT_SLOT(stop()), actionCollection(), "stop"); (void) new KAction (i18n("Dig Right"), Key_C, - this, SLOT(digR()), actionCollection(), "dig_right"); + this, TQT_SLOT(digR()), actionCollection(), "dig_right"); (void) new KAction (i18n("Dig Left"), Key_Z, - this, SLOT(digL()), actionCollection(), "dig_left"); + this, TQT_SLOT(digL()), actionCollection(), "dig_left"); // Alternate one-handed controls. Set up in "kgoldrunnerui.rc". @@ -463,31 +463,31 @@ void KGoldrunner::setupActions() // Authors' debugging aids. (void) new KAction (i18n("Step"), Key_Period, - game, SLOT(doStep()), actionCollection(), "do_step"); + game, TQT_SLOT(doStep()), actionCollection(), "do_step"); (void) new KAction (i18n("Test Bug Fix"), Key_B, - game, SLOT(bugFix()), actionCollection(), "bug_fix"); + game, TQT_SLOT(bugFix()), actionCollection(), "bug_fix"); (void) new KAction (i18n("Show Positions"), Key_D, - game, SLOT(showFigurePositions()), actionCollection(), "step"); + game, TQT_SLOT(showFigurePositions()), actionCollection(), "step"); (void) new KAction (i18n("Start Logging"), Key_G, - game, SLOT(startLogging()), actionCollection(), "logging"); + game, TQT_SLOT(startLogging()), actionCollection(), "logging"); (void) new KAction (i18n("Show Hero"), Key_H, - game, SLOT(showHeroState()), actionCollection(), "show_hero"); + game, TQT_SLOT(showHeroState()), actionCollection(), "show_hero"); (void) new KAction (i18n("Show Object"), Key_Question, - game, SLOT(showObjectState()), actionCollection(), "show_obj"); + game, TQT_SLOT(showObjectState()), actionCollection(), "show_obj"); (void) new KAction (i18n("Show Enemy") + "0", Key_0, - this, SLOT(showEnemy0()), actionCollection(), "show_enemy_0"); + this, TQT_SLOT(showEnemy0()), actionCollection(), "show_enemy_0"); (void) new KAction (i18n("Show Enemy") + "1", Key_1, - this, SLOT(showEnemy1()), actionCollection(), "show_enemy_1"); + this, TQT_SLOT(showEnemy1()), actionCollection(), "show_enemy_1"); (void) new KAction (i18n("Show Enemy") + "2", Key_2, - this, SLOT(showEnemy2()), actionCollection(), "show_enemy_2"); + this, TQT_SLOT(showEnemy2()), actionCollection(), "show_enemy_2"); (void) new KAction (i18n("Show Enemy") + "3", Key_3, - this, SLOT(showEnemy3()), actionCollection(), "show_enemy_3"); + this, TQT_SLOT(showEnemy3()), actionCollection(), "show_enemy_3"); (void) new KAction (i18n("Show Enemy") + "4", Key_4, - this, SLOT(showEnemy4()), actionCollection(), "show_enemy_4"); + this, TQT_SLOT(showEnemy4()), actionCollection(), "show_enemy_4"); (void) new KAction (i18n("Show Enemy") + "5", Key_5, - this, SLOT(showEnemy5()), actionCollection(), "show_enemy_5"); + this, TQT_SLOT(showEnemy5()), actionCollection(), "show_enemy_5"); (void) new KAction (i18n("Show Enemy") + "6", Key_6, - this, SLOT(showEnemy6()), actionCollection(), "show_enemy_6"); + this, TQT_SLOT(showEnemy6()), actionCollection(), "show_enemy_6"); #endif /**************************************************************************/ @@ -503,9 +503,9 @@ void KGoldrunner::setupActions() void KGoldrunner::initStatusBar() { - QString s = statusBar()->fontInfo().family(); // Set bold font. + TQString s = statusBar()->fontInfo().family(); // Set bold font. int i = statusBar()->fontInfo().pointSize(); - statusBar()->setFont (QFont (s, i, QFont::Bold)); + statusBar()->setFont (TQFont (s, i, TQFont::Bold)); statusBar()->setSizeGripEnabled (FALSE); // Use Settings menu ... @@ -513,7 +513,7 @@ void KGoldrunner::initStatusBar() statusBar()->insertItem ("", ID_SCORE); statusBar()->insertItem ("", ID_LEVEL); statusBar()->insertItem ("", ID_HINTAVL); - statusBar()->insertItem ("", ID_MSG, QSizePolicy::Horizontally); + statusBar()->insertItem ("", ID_MSG, TQSizePolicy::Horizontally); showLives (5); // Start with 5 lives. showScore (0); @@ -529,15 +529,15 @@ void KGoldrunner::initStatusBar() statusBar()->setItemFixed (ID_SCORE, -1); statusBar()->setItemFixed (ID_LEVEL, -1); - connect(game, SIGNAL (showLives (long)), SLOT (showLives (long))); - connect(game, SIGNAL (showScore (long)), SLOT (showScore (long))); - connect(game, SIGNAL (showLevel (int)), SLOT (showLevel (int))); - connect(game, SIGNAL (gameFreeze (bool)), SLOT (gameFreeze (bool))); + connect(game, TQT_SIGNAL (showLives (long)), TQT_SLOT (showLives (long))); + connect(game, TQT_SIGNAL (showScore (long)), TQT_SLOT (showScore (long))); + connect(game, TQT_SIGNAL (showLevel (int)), TQT_SLOT (showLevel (int))); + connect(game, TQT_SIGNAL (gameFreeze (bool)), TQT_SLOT (gameFreeze (bool))); } void KGoldrunner::showLives (long newLives) { - QString tmp; + TQString tmp; tmp.setNum (newLives); if (newLives < 100) tmp = tmp.rightJustify (3, '0'); @@ -548,7 +548,7 @@ void KGoldrunner::showLives (long newLives) void KGoldrunner::showScore (long newScore) { - QString tmp; + TQString tmp; tmp.setNum (newScore); if (newScore < 10000) tmp = tmp.rightJustify (5, '0'); @@ -559,7 +559,7 @@ void KGoldrunner::showScore (long newScore) void KGoldrunner::showLevel (int newLevelNo) { - QString tmp; + TQString tmp; tmp.setNum (newLevelNo); if (newLevelNo < 100) tmp = tmp.rightJustify (3, '0'); @@ -731,7 +731,7 @@ void KGoldrunner::readProperties(KConfig *config) config->setGroup ("Game"); // Prevents a compiler warning. printf ("I am in KGoldrunner::readProperties.\n"); - // QString qqq = config->readEntry("qqq"); + // TQString qqq = config->readEntry("qqq"); } void KGoldrunner::optionsShowToolbar() @@ -805,13 +805,13 @@ void KGoldrunner::optionsPreferences() // } } -void KGoldrunner::changeStatusbar(const QString& text) +void KGoldrunner::changeStatusbar(const TQString& text) { // display the text on the statusbar statusBar()->message(text); } -void KGoldrunner::changeCaption(const QString& text) +void KGoldrunner::changeCaption(const TQString& text) { // display the text on the caption setCaption(text); @@ -838,9 +838,9 @@ bool KGoldrunner::getDirectories() KStandardDirs * dirs = new KStandardDirs(); #ifdef QT3 - QString myDir = "kgoldrunner"; + TQString myDir = "kgoldrunner"; #else - QString myDir = "kgoldrun"; + TQString myDir = "kgoldrun"; #endif // Find the KGoldrunner Users' Guide, English version (en). @@ -943,36 +943,36 @@ void KGoldrunner::setKey (KBAction movement) /********************** MAKE A TOOLBAR FOR THE EDITOR **********************/ /******************************************************************************/ -#include <qwmatrix.h> +#include <tqwmatrix.h> void KGoldrunner::makeEditToolbar() { // Set up the pixmaps for the editable objects. - QPixmap pixmap; - QImage image; + TQPixmap pixmap; + TQImage image; - QPixmap brickbg = view->getPixmap (BRICK); - QPixmap fbrickbg = view->getPixmap (FBRICK); + TQPixmap brickbg = view->getPixmap (BRICK); + TQPixmap fbrickbg = view->getPixmap (FBRICK); - QPixmap freebg = view->getPixmap (FREE); - QPixmap nuggetbg = view->getPixmap (NUGGET); - QPixmap polebg = view->getPixmap (POLE); - QPixmap betonbg = view->getPixmap (BETON); - QPixmap ladderbg = view->getPixmap (LADDER); - QPixmap hladderbg = view->getPixmap (HLADDER); - QPixmap edherobg = view->getPixmap (HERO); - QPixmap edenemybg = view->getPixmap (ENEMY); + TQPixmap freebg = view->getPixmap (FREE); + TQPixmap nuggetbg = view->getPixmap (NUGGET); + TQPixmap polebg = view->getPixmap (POLE); + TQPixmap betonbg = view->getPixmap (BETON); + TQPixmap ladderbg = view->getPixmap (LADDER); + TQPixmap hladderbg = view->getPixmap (HLADDER); + TQPixmap edherobg = view->getPixmap (HERO); + TQPixmap edenemybg = view->getPixmap (ENEMY); if (usesBigPixmaps()) { // Scale up the pixmaps (to give cleaner looking - // icons than leaving it for QToolButton to do). - QWMatrix w; + // icons than leaving it for TQToolButton to do). + TQWMatrix w; w = w.scale (2.0, 2.0); // The pixmaps shown on the buttons used to remain small and incorrectly // painted, in KDE, in spite of the 2x (32x32) scaling. "insertButton" - // calls QIconSet, to generate a set of icons from each pixmapx, then + // calls TQIconSet, to generate a set of icons from each pixmapx, then // seems to select the small size to paint on the button. The following // line forces all icons, large and small, to be size 32x32 in advance. - QIconSet::setIconSize (QIconSet::Small, QSize (32, 32)); + TQIconSet::setIconSize (TQIconSet::Small, TQSize (32, 32)); brickbg = brickbg.xForm (w); fbrickbg = fbrickbg.xForm (w); @@ -990,7 +990,7 @@ void KGoldrunner::makeEditToolbar() editToolbar = new KToolBar (this, Qt::DockTop, TRUE, "Editor", TRUE); // Choose a colour that enhances visibility of the KGoldrunner pixmaps. - // editToolbar->setPalette (QPalette (QColor (150, 150, 230))); + // editToolbar->setPalette (TQPalette (TQColor (150, 150, 230))); // editToolbar->setHorizontallyStretchable (TRUE); // Not effective in KDE. @@ -999,51 +999,51 @@ void KGoldrunner::makeEditToolbar() editToolbar->insertSeparator(); - editToolbar->insertButton ("filenew", 0, SIGNAL(clicked()), game, - SLOT(createLevel()), TRUE, i18n("&Create a Level")); - editToolbar->insertButton ("fileopen", 1, SIGNAL(clicked()), game, - SLOT(updateLevel()), TRUE, i18n("&Edit Any Level...")); - editToolbar->insertButton ("filesave", 2, SIGNAL(clicked()), game, - SLOT(saveLevelFile()),TRUE, i18n("&Save Edits...")); + editToolbar->insertButton ("filenew", 0, TQT_SIGNAL(clicked()), game, + TQT_SLOT(createLevel()), TRUE, i18n("&Create a Level")); + editToolbar->insertButton ("fileopen", 1, TQT_SIGNAL(clicked()), game, + TQT_SLOT(updateLevel()), TRUE, i18n("&Edit Any Level...")); + editToolbar->insertButton ("filesave", 2, TQT_SIGNAL(clicked()), game, + TQT_SLOT(saveLevelFile()),TRUE, i18n("&Save Edits...")); editToolbar->insertSeparator(); editToolbar->insertSeparator(); - editToolbar->insertButton ("ktip", 3, SIGNAL(clicked()), game, - SLOT(editNameAndHint()),TRUE,i18n("Edit Name/Hint")); + editToolbar->insertButton ("ktip", 3, TQT_SIGNAL(clicked()), game, + TQT_SLOT(editNameAndHint()),TRUE,i18n("Edit Name/Hint")); editToolbar->insertSeparator(); editToolbar->insertSeparator(); - editToolbar->insertButton (freebg, (int)FREE, SIGNAL(clicked()), this, - SLOT(freeSlot()), TRUE, i18n("Empty space")); + editToolbar->insertButton (freebg, (int)FREE, TQT_SIGNAL(clicked()), this, + TQT_SLOT(freeSlot()), TRUE, i18n("Empty space")); editToolbar->insertSeparator(); - editToolbar->insertButton (edherobg, (int)HERO, SIGNAL(clicked()), this, - SLOT (edheroSlot()), TRUE, i18n("Hero")); + editToolbar->insertButton (edherobg, (int)HERO, TQT_SIGNAL(clicked()), this, + TQT_SLOT (edheroSlot()), TRUE, i18n("Hero")); editToolbar->insertSeparator(); - editToolbar->insertButton (edenemybg, (int)ENEMY, SIGNAL(clicked()), this, - SLOT (edenemySlot()), TRUE, i18n("Enemy")); + editToolbar->insertButton (edenemybg, (int)ENEMY, TQT_SIGNAL(clicked()), this, + TQT_SLOT (edenemySlot()), TRUE, i18n("Enemy")); editToolbar->insertSeparator(); - editToolbar->insertButton (brickbg, (int)BRICK, SIGNAL(clicked()), this, - SLOT (brickSlot()), TRUE, i18n("Brick (can dig)")); + editToolbar->insertButton (brickbg, (int)BRICK, TQT_SIGNAL(clicked()), this, + TQT_SLOT (brickSlot()), TRUE, i18n("Brick (can dig)")); editToolbar->insertSeparator(); - editToolbar->insertButton (betonbg, (int)BETON, SIGNAL(clicked()), this, - SLOT (betonSlot()), TRUE, i18n("Concrete (cannot dig)")); + editToolbar->insertButton (betonbg, (int)BETON, TQT_SIGNAL(clicked()), this, + TQT_SLOT (betonSlot()), TRUE, i18n("Concrete (cannot dig)")); editToolbar->insertSeparator(); - editToolbar->insertButton (fbrickbg, (int)FBRICK, SIGNAL(clicked()), this, - SLOT (fbrickSlot()), TRUE, i18n("Trap (can fall through)")); + editToolbar->insertButton (fbrickbg, (int)FBRICK, TQT_SIGNAL(clicked()), this, + TQT_SLOT (fbrickSlot()), TRUE, i18n("Trap (can fall through)")); editToolbar->insertSeparator(); - editToolbar->insertButton (ladderbg, (int)LADDER, SIGNAL(clicked()), this, - SLOT (ladderSlot()), TRUE, i18n("Ladder")); + editToolbar->insertButton (ladderbg, (int)LADDER, TQT_SIGNAL(clicked()), this, + TQT_SLOT (ladderSlot()), TRUE, i18n("Ladder")); editToolbar->insertSeparator(); - editToolbar->insertButton (hladderbg, (int)HLADDER, SIGNAL(clicked()), this, - SLOT (hladderSlot()), TRUE, i18n("Hidden ladder")); + editToolbar->insertButton (hladderbg, (int)HLADDER, TQT_SIGNAL(clicked()), this, + TQT_SLOT (hladderSlot()), TRUE, i18n("Hidden ladder")); editToolbar->insertSeparator(); - editToolbar->insertButton (polebg, (int)POLE, SIGNAL(clicked()), this, - SLOT (poleSlot()), TRUE, i18n("Pole (or bar)")); + editToolbar->insertButton (polebg, (int)POLE, TQT_SIGNAL(clicked()), this, + TQT_SLOT (poleSlot()), TRUE, i18n("Pole (or bar)")); editToolbar->insertSeparator(); - editToolbar->insertButton (nuggetbg, (int)NUGGET, SIGNAL(clicked()), this, - SLOT (nuggetSlot()), TRUE, i18n("Gold nugget")); + editToolbar->insertButton (nuggetbg, (int)NUGGET, TQT_SIGNAL(clicked()), this, + TQT_SLOT (nuggetSlot()), TRUE, i18n("Gold nugget")); editToolbar->setToggle ((int) FREE, TRUE); editToolbar->setToggle ((int) HERO, TRUE); diff --git a/kgoldrunner/src/kgoldrunner.h b/kgoldrunner/src/kgoldrunner.h index 57123596..358a5561 100644 --- a/kgoldrunner/src/kgoldrunner.h +++ b/kgoldrunner/src/kgoldrunner.h @@ -130,8 +130,8 @@ private slots: void optionsPreferences(); void newToolbarConfig(); - void changeStatusbar(const QString& text); - void changeCaption(const QString& text); + void changeStatusbar(const TQString& text); + void changeCaption(const TQString& text); void showLevel (int); // Show the current level number. void showLives (long); // Show how many lives are remaining. @@ -156,9 +156,9 @@ private: KGrGame * game; bool getDirectories(); // Get directory paths, as below. - QString systemHTMLDir; // Where the manual is stored. - QString systemDataDir; // Where the system levels are stored. - QString userDataDir; // Where the user levels are stored. + TQString systemHTMLDir; // Where the manual is stored. + TQString systemDataDir; // Where the system levels are stored. + TQString userDataDir; // Where the user levels are stored. KAction * saveGame; // Save game, level, lives and score. diff --git a/kgoldrunner/src/kgrcanvas.cpp b/kgoldrunner/src/kgrcanvas.cpp index 6104939e..111913a1 100644 --- a/kgoldrunner/src/kgrcanvas.cpp +++ b/kgoldrunner/src/kgrcanvas.cpp @@ -34,11 +34,11 @@ class KGoldrunner; -KGrCanvas::KGrCanvas (QWidget * parent, const char *name) - : QCanvasView (0, parent, name) +KGrCanvas::KGrCanvas (TQWidget * parent, const char *name) + : TQCanvasView (0, parent, name) { setBackgroundMode (NoBackground); - m = new QCursor (); // For handling the mouse. + m = new TQCursor (); // For handling the mouse. scaleStep = STEP; // Initial scale is 1:1. baseScale = scaleStep; @@ -57,12 +57,12 @@ KGrCanvas::~KGrCanvas() { } -void KGrCanvas::changeLandscape (const QString & name) +void KGrCanvas::changeLandscape (const TQString & name) { for (int i = 0; strcmp (colourScheme [i], "") != 0; i++) { if (colourScheme [i] == name) { - // Change XPM colours and re-draw the tile-pictures used by QCanvas. + // Change XPM colours and re-draw the tile-pictures used by TQCanvas. changeColours (& colourScheme [i]); makeTiles(); @@ -85,11 +85,11 @@ void KGrCanvas::changeLandscape (const QString & name) } } - borderB->setBrush (QBrush (borderColor)); - borderL->setBrush (QBrush (borderColor)); - borderR->setBrush (QBrush (borderColor)); + borderB->setBrush (TQBrush (borderColor)); + borderL->setBrush (TQBrush (borderColor)); + borderR->setBrush (TQBrush (borderColor)); - QString t = title->text(); + TQString t = title->text(); makeTitle (); setTitle (t); @@ -117,7 +117,7 @@ bool KGrCanvas::changeSize (int d) return FALSE; } - QWMatrix wm = worldMatrix(); + TQWMatrix wm = worldMatrix(); double wmScale = 1.0; // Set the scale back to 1:1 and calculate the new scale factor. @@ -132,11 +132,11 @@ bool KGrCanvas::changeSize (int d) setWorldMatrix (wm); // Force the title size and position to be re-calculated. - QString t = title->text(); + TQString t = title->text(); makeTitle (); setTitle (t); - // Fit the QCanvasView and its frame to the canvas. + // Fit the TQCanvasView and its frame to the canvas. int frame = frameWidth()*2; setFixedSize ((FIELDWIDTH + 4) * 4 * scaleStep + frame, (FIELDHEIGHT + 4) * 4 * scaleStep + frame); @@ -175,7 +175,7 @@ void KGrCanvas::paintCell (int x, int y, char type, int offset) tileNumber = tileNumber + offset; // Offsets 1-9 are for digging sequence. - // In KGoldrunner, the top-left visible cell is [1,1] --- in QCanvas [2,2]. + // In KGoldrunner, the top-left visible cell is [1,1] --- in TQCanvas [2,2]. x++; y++; field->setTile (x, y, tileNumber); // Paint cell with required pixmap. } @@ -184,56 +184,56 @@ void KGrCanvas::setBaseScale () { // Synchronise the desktop font size with the initial canvas scale. baseScale = scaleStep; - QString t = title->text(); + TQString t = title->text(); makeTitle (); setTitle (t); } -void KGrCanvas::setTitle (QString newTitle) +void KGrCanvas::setTitle (TQString newTitle) { title->setText (newTitle); } void KGrCanvas::makeTitle () { - // This uses a calculated QLabel and QFont size because a QCanvasText + // This uses a calculated TQLabel and TQFont size because a QCanvasText // object does not always display scaled-up fonts cleanly (in Qt 3.1.1). if (title != 0) title->close (TRUE); // Close and delete previous title. - title = new QLabel ("", this); + title = new TQLabel ("", this); title->setFixedWidth (((FIELDWIDTH * cw + 2 * bw) * scaleStep) / STEP); title->setFixedHeight ((mw * scaleStep) / STEP); title->move (0, 0); title->setPaletteBackgroundColor (borderColor); title->setPaletteForegroundColor (textColor); - title->setFont (QFont (fontInfo().family(), - (baseFontSize * scaleStep) / baseScale, QFont::Bold)); + title->setFont (TQFont (fontInfo().family(), + (baseFontSize * scaleStep) / baseScale, TQFont::Bold)); title->setAlignment (Qt::AlignCenter); title->raise(); title->show(); } -void KGrCanvas::contentsMousePressEvent (QMouseEvent * m) { +void KGrCanvas::contentsMousePressEvent (TQMouseEvent * m) { emit mouseClick (m->button ()); } -void KGrCanvas::contentsMouseReleaseEvent (QMouseEvent * m) { +void KGrCanvas::contentsMouseReleaseEvent (TQMouseEvent * m) { emit mouseLetGo (m->button ()); } -QPoint KGrCanvas::getMousePos () +TQPoint KGrCanvas::getMousePos () { int i, j; int fw = frameWidth(); int cell = 4 * scaleStep; - QPoint p = mapFromGlobal (m->pos()); + TQPoint p = mapFromGlobal (m->pos()); - // In KGoldrunner, the top-left visible cell is [1,1] --- in QCanvas [2,2]. + // In KGoldrunner, the top-left visible cell is [1,1] --- in TQCanvas [2,2]. i = ((p.x() - fw) / cell) - 1; j = ((p.y() - fw) / cell) - 1; - return (QPoint (i, j)); + return (TQPoint (i, j)); } void KGrCanvas::setMousePos (int i, int j) @@ -241,19 +241,19 @@ void KGrCanvas::setMousePos (int i, int j) int fw = frameWidth(); int cell = 4 * scaleStep; - // In KGoldrunner, the top-left visible cell is [1,1] --- in QCanvas [2,2]. + // In KGoldrunner, the top-left visible cell is [1,1] --- in TQCanvas [2,2]. i++; j++; - //m->setPos (mapToGlobal (QPoint (i * 4 * STEP + 8, j * 4 * STEP + 8))); - //m->setPos (mapToGlobal (QPoint (i * 5 * STEP + 10, j * 5 * STEP + 10))); + //m->setPos (mapToGlobal (TQPoint (i * 4 * STEP + 8, j * 4 * STEP + 8))); + //m->setPos (mapToGlobal (TQPoint (i * 5 * STEP + 10, j * 5 * STEP + 10))); m->setPos (mapToGlobal ( - QPoint (i * cell + fw + cell / 2, j * cell + fw + cell / 2))); + TQPoint (i * cell + fw + cell / 2, j * cell + fw + cell / 2))); } void KGrCanvas::makeHeroSprite (int i, int j, int startFrame) { - heroSprite = new QCanvasSprite (heroArray, field); + heroSprite = new TQCanvasSprite (heroArray, field); - // In KGoldrunner, the top-left visible cell is [1,1] --- in QCanvas [2,2]. + // In KGoldrunner, the top-left visible cell is [1,1] --- in TQCanvas [2,2]. i++; j++; heroSprite->move (i * 4 * STEP, j * 4 * STEP, startFrame); heroSprite->setZ (1); @@ -267,11 +267,11 @@ void KGrCanvas::setHeroVisible (bool newState) void KGrCanvas::makeEnemySprite (int i, int j, int startFrame) { - QCanvasSprite * enemySprite = new QCanvasSprite (enemyArray, field); + TQCanvasSprite * enemySprite = new TQCanvasSprite (enemyArray, field); enemySprites->append (enemySprite); - // In KGoldrunner, the top-left visible cell is [1,1] --- in QCanvas [2,2]. + // In KGoldrunner, the top-left visible cell is [1,1] --- in TQCanvas [2,2]. i++; j++; enemySprite->move (i * 4 * STEP, j * 4 * STEP, startFrame); enemySprite->setZ (2); @@ -280,7 +280,7 @@ void KGrCanvas::makeEnemySprite (int i, int j, int startFrame) void KGrCanvas::moveHero (int x, int y, int frame) { - // In KGoldrunner, the top-left visible cell is [1,1] --- in QCanvas [2,2]. + // In KGoldrunner, the top-left visible cell is [1,1] --- in TQCanvas [2,2]. heroSprite->move (x + 4 * STEP, y + 4 * STEP, frame); updateCanvas(); } @@ -291,7 +291,7 @@ void KGrCanvas::moveEnemy (int id, int x, int y, int frame, int nuggets) frame = frame + goldEnemy; // show him with gold outline. } - // In KGoldrunner, the top-left visible cell is [1,1] --- in QCanvas [2,2]. + // In KGoldrunner, the top-left visible cell is [1,1] --- in TQCanvas [2,2]. enemySprites->at(id)->move (x + 4 * STEP, y + 4 * STEP, frame); updateCanvas(); } @@ -301,10 +301,10 @@ void KGrCanvas::deleteEnemySprites() enemySprites->clear(); } -QPixmap KGrCanvas::getPixmap (char type) +TQPixmap KGrCanvas::getPixmap (char type) { - QPixmap pic (bgw, bgh, bgd); - QPainter p (& pic); + TQPixmap pic (bgw, bgh, bgd); + TQPainter p (& pic); int tileNumber; // Get a pixmap from the tile-array for use on an edit-button. @@ -347,30 +347,30 @@ void KGrCanvas::initView() brickbg = 8; // Solid brick - 1st pixmap. fbrickbg = 15; // False brick - 8th pixmap (for editing). - QPixmap pixmap; - QImage image; + TQPixmap pixmap; + TQImage image; - pixmap = QPixmap (hgbrick_xpm); + pixmap = TQPixmap (hgbrick_xpm); bgw = pixmap.width(); // Save dimensions for "getPixmap". bgh = pixmap.height(); bgd = pixmap.depth(); // Assemble the background and editing pixmaps into a strip (18 pixmaps). - bgPix = QPixmap ((brickbg + 10) * bgw, bgh, bgd); + bgPix = TQPixmap ((brickbg + 10) * bgw, bgh, bgd); makeTiles(); // Fill the strip with 18 tiles. // Define the canvas as an array of tiles. Default tile is 0 (free space). int frame = frameWidth()*2; - field = new QCanvas ((FIELDWIDTH+border) * bgw, (FIELDHEIGHT+border) * bgh); + field = new TQCanvas ((FIELDWIDTH+border) * bgw, (FIELDHEIGHT+border) * bgh); field->setTiles (bgPix, (FIELDWIDTH+border), (FIELDHEIGHT+border), bgw, bgh); // Embed the canvas in the view and make it occupy the whole of the view. setCanvas (field); - setVScrollBarMode (QScrollView::AlwaysOff); - setHScrollBarMode (QScrollView::AlwaysOff); + setVScrollBarMode (TQScrollView::AlwaysOff); + setHScrollBarMode (TQScrollView::AlwaysOff); setFixedSize (field->width() + frame, field->height() + frame); ////////////////////////////////////////////////////////////////////////// @@ -379,41 +379,41 @@ void KGrCanvas::initView() // climb up ladder (2) and fall (2) --- total 20. // ////////////////////////////////////////////////////////////////////////// - // Convert the pixmap strip for hero animation into a QCanvasPixmapArray. - pixmap = QPixmap (hero_xpm); + // Convert the pixmap strip for hero animation into a TQCanvasPixmapArray. + pixmap = TQPixmap (hero_xpm); image = pixmap.convertToImage (); #ifdef QT3 - QPixmap pm; - QValueList<QPixmap> pmList; + TQPixmap pm; + TQValueList<TQPixmap> pmList; for (int i = 0; i < 20; i++) { pm.convertFromImage (image.copy (i * 16, 0, 16, 16)); pmList.append (pm); } - heroArray = new QCanvasPixmapArray (pmList); // Hot spots all (0,0). + heroArray = new TQCanvasPixmapArray (pmList); // Hot spots all (0,0). #else - QPixmap * pm; - QPoint * pt; - QList<QPixmap> pmList; - QList<QPoint> ptList; + TQPixmap * pm; + TQPoint * pt; + QList<TQPixmap> pmList; + QList<TQPoint> ptList; - pt = new QPoint (0, 0); // "Hot spot" not used in KGoldrunner. + pt = new TQPoint (0, 0); // "Hot spot" not used in KGoldrunner. for (int i = 0; i < 20; i++) { - pm = new QPixmap (); + pm = new TQPixmap (); pm->convertFromImage (image.copy (i * 16, 0, 16, 16)); pmList.append (pm); ptList.append (pt); } - heroArray = new QCanvasPixmapArray (pmList, ptList); + heroArray = new TQCanvasPixmapArray (pmList, ptList); #endif - // Convert pixmap strips for enemy animations into a QCanvasPixmapArray. + // Convert pixmap strips for enemy animations into a TQCanvasPixmapArray. // First convert the pixmaps for enemies with no gold ... - pixmap = QPixmap (enemy1_xpm); + pixmap = TQPixmap (enemy1_xpm); image = pixmap.convertToImage (); pmList.clear(); @@ -427,7 +427,7 @@ void KGrCanvas::initView() ptList.clear(); for (int i = 0; i < 20; i++) { - pm = new QPixmap (); + pm = new TQPixmap (); pm->convertFromImage (image.copy (i * 16, 0, 16, 16)); pmList.append (pm); ptList.append (pt); @@ -435,7 +435,7 @@ void KGrCanvas::initView() #endif // ... then convert the gold-carrying enemies. - pixmap = QPixmap (enemy2_xpm); + pixmap = TQPixmap (enemy2_xpm); image = pixmap.convertToImage (); #ifdef QT3 @@ -444,16 +444,16 @@ void KGrCanvas::initView() pmList.append (pm); } - enemyArray = new QCanvasPixmapArray (pmList); // Hot spots all (0,0). + enemyArray = new TQCanvasPixmapArray (pmList); // Hot spots all (0,0). #else for (int i = 0; i < 20; i++) { - pm = new QPixmap (); + pm = new TQPixmap (); pm->convertFromImage (image.copy (i * 16, 0, 16, 16)); pmList.append (pm); ptList.append (pt); } - enemyArray = new QCanvasPixmapArray (pmList, ptList); + enemyArray = new TQCanvasPixmapArray (pmList, ptList); #endif goldEnemy = 20; // Offset of gold-carrying frames. @@ -467,29 +467,29 @@ void KGrCanvas::initView() // Create an empty list of enemy sprites. #ifdef QT3 - enemySprites = new QPtrList<QCanvasSprite> (); + enemySprites = new TQPtrList<TQCanvasSprite> (); #else - enemySprites = new QList<QCanvasSprite> (); + enemySprites = new QList<TQCanvasSprite> (); #endif enemySprites->setAutoDelete(TRUE); } void KGrCanvas::makeTiles () { - QPainter p (& bgPix); + TQPainter p (& bgPix); // First draw the single pixmaps (8 tiles) ... - p.drawPixmap (freebg * bgw, 0, QPixmap (hgbrick_xpm)); // Free space. - p.drawPixmap (nuggetbg * bgw, 0, QPixmap (nugget_xpm)); // Nugget. - p.drawPixmap (polebg * bgw, 0, QPixmap (pole_xpm)); // Pole or bar. - p.drawPixmap (ladderbg * bgw, 0, QPixmap (ladder_xpm)); // Ladder. - p.drawPixmap (hladderbg * bgw, 0, QPixmap (hladder_xpm)); // Hidden laddr. - p.drawPixmap (edherobg * bgw, 0, QPixmap (edithero_xpm)); // Static hero. - p.drawPixmap (edenemybg * bgw, 0, QPixmap (editenemy_xpm)); // Static enemy. - p.drawPixmap (betonbg * bgw, 0, QPixmap (beton_xpm)); // Concrete. + p.drawPixmap (freebg * bgw, 0, TQPixmap (hgbrick_xpm)); // Free space. + p.drawPixmap (nuggetbg * bgw, 0, TQPixmap (nugget_xpm)); // Nugget. + p.drawPixmap (polebg * bgw, 0, TQPixmap (pole_xpm)); // Pole or bar. + p.drawPixmap (ladderbg * bgw, 0, TQPixmap (ladder_xpm)); // Ladder. + p.drawPixmap (hladderbg * bgw, 0, TQPixmap (hladder_xpm)); // Hidden laddr. + p.drawPixmap (edherobg * bgw, 0, TQPixmap (edithero_xpm)); // Static hero. + p.drawPixmap (edenemybg * bgw, 0, TQPixmap (editenemy_xpm)); // Static enemy. + p.drawPixmap (betonbg * bgw, 0, TQPixmap (beton_xpm)); // Concrete. // ... then add the 10 brick pixmaps. - p.drawPixmap (brickbg * bgw, 0, QPixmap (bricks_xpm)); // Bricks. + p.drawPixmap (brickbg * bgw, 0, TQPixmap (bricks_xpm)); // Bricks. p.end(); } @@ -500,7 +500,7 @@ void KGrCanvas::makeBorder () // Allow some overlap to prevent slits appearing when using "changeSize". colour = borderColor; - // The first rectangle is actually a QLabel drawn by "makeTitle()". + // The first rectangle is actually a TQLabel drawn by "makeTitle()". // borderT = drawRectangle (11, 0, 0, FIELDWIDTH*cw + 2*bw, mw); borderB = drawRectangle (11, 0, FIELDHEIGHT*cw + bw + lw, FIELDWIDTH*cw + 2*bw, mw); @@ -509,19 +509,19 @@ void KGrCanvas::makeBorder () mw, FIELDHEIGHT*cw + 2*lw + 2); // Draw inside edges of border, in the same way. - colour = QColor (black); + colour = TQColor (black); drawRectangle (10, bw-lw, bw-lw-1, FIELDWIDTH*cw + 2*lw, lw+1); drawRectangle (10, bw-lw, FIELDHEIGHT*cw + bw, FIELDWIDTH*cw + 2*lw, lw+1); drawRectangle (10, bw - lw, bw, lw, FIELDHEIGHT*cw); drawRectangle (10, FIELDWIDTH*cw + bw, bw, lw, FIELDHEIGHT*cw); } -QCanvasRectangle * KGrCanvas::drawRectangle (int z, int x, int y, int w, int h) +TQCanvasRectangle * KGrCanvas::drawRectangle (int z, int x, int y, int w, int h) { - QCanvasRectangle * r = new QCanvasRectangle (x, y, w, h, field); + TQCanvasRectangle * r = new TQCanvasRectangle (x, y, w, h, field); - r->setBrush (QBrush (colour)); - r->setPen (QPen (NoPen)); + r->setBrush (TQBrush (colour)); + r->setPen (TQPen (NoPen)); r->setZ (z); r->show(); @@ -541,13 +541,13 @@ void KGrCanvas::changeColours (const char * colours []) recolourObject (beton_xpm, colours); recolourObject (bricks_xpm, colours); - borderColor = QColor (colours [1]); - textColor = QColor (colours [2]); + borderColor = TQColor (colours [1]); + textColor = TQColor (colours [2]); - KGrThumbNail::backgroundColor = QColor (QString(colours [3]).right(7)); - KGrThumbNail::brickColor = QColor (QString(colours [6]).right(7)); - KGrThumbNail::ladderColor = QColor (QString(colours [9]).right(7)); - KGrThumbNail::poleColor = QColor (QString(colours [11]).right(7)); + KGrThumbNail::backgroundColor = TQColor (TQString(colours [3]).right(7)); + KGrThumbNail::brickColor = TQColor (TQString(colours [6]).right(7)); + KGrThumbNail::ladderColor = TQColor (TQString(colours [9]).right(7)); + KGrThumbNail::poleColor = TQColor (TQString(colours [11]).right(7)); } void KGrCanvas::recolourObject (const char * object [], const char * colours []) diff --git a/kgoldrunner/src/kgrcanvas.h b/kgoldrunner/src/kgrcanvas.h index 02b89bed..2c0ab270 100644 --- a/kgoldrunner/src/kgrcanvas.h +++ b/kgoldrunner/src/kgrcanvas.h @@ -22,22 +22,22 @@ #include <config.h> #endif -#include <qcursor.h> -#include <qcanvas.h> -#include <qlabel.h> -#include <qimage.h> -#include <qpainter.h> +#include <tqcursor.h> +#include <tqcanvas.h> +#include <tqlabel.h> +#include <tqimage.h> +#include <tqpainter.h> class KGrCanvas : public QCanvasView { Q_OBJECT public: - KGrCanvas (QWidget * parent = 0, const char *name = 0); + KGrCanvas (TQWidget * parent = 0, const char *name = 0); virtual ~KGrCanvas(); - void changeLandscape (const QString & name); + void changeLandscape (const TQString & name); - QPoint getMousePos (); + TQPoint getMousePos (); void setMousePos (int, int); bool changeSize (int); @@ -45,7 +45,7 @@ public: void updateCanvas (); void paintCell (int, int, char, int offset = 0); - void setTitle (QString); + void setTitle (TQString); void makeHeroSprite (int, int, int); void setHeroVisible (bool); @@ -55,55 +55,55 @@ public: void moveEnemy (int, int, int, int, int); void deleteEnemySprites(); - QPixmap getPixmap (char type); + TQPixmap getPixmap (char type); signals: void mouseClick (int); void mouseLetGo (int); protected: - void contentsMousePressEvent (QMouseEvent *); - void contentsMouseReleaseEvent (QMouseEvent *); + void contentsMousePressEvent (TQMouseEvent *); + void contentsMouseReleaseEvent (TQMouseEvent *); private: - QCursor * m; + TQCursor * m; - QCanvas * field; - QCanvasView * fieldView; + TQCanvas * field; + TQCanvasView * fieldView; int scaleStep; // Current scale-factor of canvas. int baseScale; // Starting scale-factor of canvas. int baseFontSize; int border; // Number of tiles allowed for border. int cw, bw, lw, mw; // Dimensions (in pixels) of the border. - QColor borderColor, textColor; // Border colours. - QLabel * title; // Title and top part of border. - QCanvasRectangle * borderB; // Bottom part of border. - QCanvasRectangle * borderL; // Left-hand part of border. - QCanvasRectangle * borderR; // Right-hand part of border. + TQColor borderColor, textColor; // Border colours. + TQLabel * title; // Title and top part of border. + TQCanvasRectangle * borderB; // Bottom part of border. + TQCanvasRectangle * borderL; // Left-hand part of border. + TQCanvasRectangle * borderR; // Right-hand part of border. int freebg, nuggetbg, polebg, ladderbg, hladderbg; int edherobg, edenemybg, betonbg, brickbg, fbrickbg; int bgw, bgh, bgd; - QPixmap bgPix; + TQPixmap bgPix; - QCanvasPixmapArray * heroArray; - QCanvasPixmapArray * enemyArray; + TQCanvasPixmapArray * heroArray; + TQCanvasPixmapArray * enemyArray; int goldEnemy; - QCanvasSprite * heroSprite; + TQCanvasSprite * heroSprite; #ifdef QT3 - QPtrList<QCanvasSprite> * enemySprites; + TQPtrList<TQCanvasSprite> * enemySprites; #else - QList<QCanvasSprite> * enemySprites; + QList<TQCanvasSprite> * enemySprites; #endif void initView(); void makeTiles(); void makeBorder(); void makeTitle(); - QColor colour; - QCanvasRectangle * drawRectangle (int, int, int, int, int); + TQColor colour; + TQCanvasRectangle * drawRectangle (int, int, int, int, int); void changeColours (const char * colours []); void recolourObject (const char * object [], const char * colours []); }; diff --git a/kgoldrunner/src/kgrdialog.cpp b/kgoldrunner/src/kgrdialog.cpp index 61ca2f29..632eb617 100644 --- a/kgoldrunner/src/kgrdialog.cpp +++ b/kgoldrunner/src/kgrdialog.cpp @@ -28,14 +28,14 @@ #ifdef KGR_PORTABLE KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, - QPtrList<KGrCollection> & gamesList, KGrGame * theGame, - QWidget * parent, const char * name) - : QDialog (parent, name, TRUE, + TQPtrList<KGrCollection> & gamesList, KGrGame * theGame, + TQWidget * parent, const char * name) + : TQDialog (parent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, - QPtrList<KGrCollection> & gamesList, KGrGame * theGame, - QWidget * parent, const char * name) + TQPtrList<KGrCollection> & gamesList, KGrGame * theGame, + TQWidget * parent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Select Game"), KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help, KDialogBase::Ok, parent, name) @@ -52,66 +52,66 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, #ifdef KGR_PORTABLE int margin = 10; int spacing = 10; - QWidget * dad = this; + TQWidget * dad = this; #else int margin = marginHint(); int spacing = spacingHint(); - QWidget * dad = plainPage(); + TQWidget * dad = plainPage(); #endif - QVBoxLayout * mainLayout = new QVBoxLayout (dad, margin, spacing); + TQVBoxLayout * mainLayout = new TQVBoxLayout (dad, margin, spacing); - collnL = new QLabel (i18n("List of games:"), dad); + collnL = new TQLabel (i18n("List of games:"), dad); mainLayout->addWidget (collnL); - colln = new QListBox (dad); + colln = new TQListBox (dad); mainLayout->addWidget (colln); - QHBox * gameInfo = new QHBox (dad); + TQHBox * gameInfo = new TQHBox (dad); mainLayout->addWidget (gameInfo); gameInfo->setSpacing (spacing); - collnN = new QLabel ("", gameInfo); // Name of selected collection. - QFont f = collnN->font(); + collnN = new TQLabel ("", gameInfo); // Name of selected collection. + TQFont f = collnN->font(); f.setBold (TRUE); collnN->setFont (f); - collnA = new QPushButton (i18n("More Info"), gameInfo); + collnA = new TQPushButton (i18n("More Info"), gameInfo); - collnD = new QLabel ("", dad); // Description of collection. + collnD = new TQLabel ("", dad); // Description of collection. mainLayout->addWidget (collnD); - QFrame * separator = new QFrame (dad); - separator->setFrameStyle (QFrame::HLine + QFrame::Sunken); + TQFrame * separator = new TQFrame (dad); + separator->setFrameStyle (TQFrame::HLine + TQFrame::Sunken); mainLayout->addWidget (separator); if ((action == SL_START) || (action == SL_UPD_GAME)) { dad-> setCaption (i18n("Select Game")); - QLabel * startMsg = new QLabel + TQLabel * startMsg = new QLabel ("<b>" + i18n("Level 1 of the selected game is:") + "</b>", dad); mainLayout->addWidget (startMsg); } else { dad-> setCaption (i18n("Select Game/Level")); - QLabel * selectLev = new QLabel (i18n("Select level:"), dad); + TQLabel * selectLev = new TQLabel (i18n("Select level:"), dad); mainLayout->addWidget (selectLev); } - QGridLayout * grid = new QGridLayout (3, 2, -1); + TQGridLayout * grid = new TQGridLayout (3, 2, -1); mainLayout->addLayout (grid); // Initial range 1->150, small step 1, big step 10 and default value 1. - number = new QScrollBar (1, 150, 1, 10, 1, - QScrollBar::Horizontal, dad); + number = new TQScrollBar (1, 150, 1, 10, 1, + TQScrollBar::Horizontal, dad); grid->addWidget (number, 1, 1); - QHBox * numberPair = new QHBox (dad); + TQHBox * numberPair = new TQHBox (dad); grid->addWidget (numberPair, 2, 1); numberPair->setSpacing (spacing); - numberL = new QLabel (i18n("Level number:"), numberPair); - display = new QLineEdit (numberPair); + numberL = new TQLabel (i18n("Level number:"), numberPair); + display = new TQLineEdit (numberPair); - levelNH = new QPushButton (i18n("Edit Level Name && Hint"), dad); + levelNH = new TQPushButton (i18n("Edit Level Name && Hint"), dad); mainLayout->addWidget (levelNH); - slName = new QLabel ("", dad); + slName = new TQLabel ("", dad); grid->addWidget (slName, 3, 1); thumbNail = new KGrThumbNail (dad); grid->addMultiCellWidget (thumbNail, 1, 3, 2, 2); @@ -122,15 +122,15 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, thumbNail-> setFixedHeight ((FIELDHEIGHT * cellSize) + 2); #ifdef KGR_PORTABLE - QHBox * buttons = new QHBox (this); + TQHBox * buttons = new TQHBox (this); mainLayout->addWidget (buttons); buttons->setSpacing (spacing); // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. - HELP = new QPushButton (i18n("Help"), buttons); - OK = new QPushButton (i18n("&OK"), buttons); - CANCEL = new QPushButton (i18n("&Cancel"), buttons); + HELP = new TQPushButton (i18n("Help"), buttons); + OK = new TQPushButton (i18n("&OK"), buttons); + CANCEL = new TQPushButton (i18n("&Cancel"), buttons); - QPoint p = parent->mapToGlobal (QPoint (0,0)); + TQPoint p = parent->mapToGlobal (TQPoint (0,0)); // Base the geometry of the dialog box on the playing area. int cell = parent->width() / (FIELDWIDTH + 4); @@ -149,7 +149,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, slSetCollections (defaultGame); // Vary the dialog according to the action. - QString OKText = ""; + TQString OKText = ""; switch (slAction) { case SL_START: // Must start at level 1, but can choose a collection. OKText = i18n("Start Game"); @@ -208,41 +208,41 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, } // Paint a thumbnail sketch of the level. - thumbNail->setFrameStyle (QFrame::Box | QFrame::Plain); + thumbNail->setFrameStyle (TQFrame::Box | TQFrame::Plain); thumbNail->setLineWidth (1); slPaintLevel(); thumbNail->show(); - connect (colln, SIGNAL (highlighted (int)), this, SLOT (slColln (int))); - connect (collnA, SIGNAL (clicked ()), this, SLOT (slAboutColln ())); + connect (colln, TQT_SIGNAL (highlighted (int)), this, TQT_SLOT (slColln (int))); + connect (collnA, TQT_SIGNAL (clicked ()), this, TQT_SLOT (slAboutColln ())); - connect (display, SIGNAL (textChanged (const QString &)), - this, SLOT (slUpdate (const QString &))); + connect (display, TQT_SIGNAL (textChanged (const TQString &)), + this, TQT_SLOT (slUpdate (const TQString &))); - connect (number, SIGNAL (valueChanged(int)), this, SLOT(slShowLevel(int))); + connect (number, TQT_SIGNAL (valueChanged(int)), this, TQT_SLOT(slShowLevel(int))); // Only enable name and hint dialog here if saving a new or edited level. // At other times the name and hint have not been loaded or initialised yet. if ((slAction == SL_CREATE) || (slAction == SL_SAVE)) { - connect (levelNH, SIGNAL (clicked()), game, SLOT (editNameAndHint())); + connect (levelNH, TQT_SIGNAL (clicked()), game, TQT_SLOT (editNameAndHint())); } else { levelNH->setEnabled (FALSE); levelNH->hide(); } - connect (colln, SIGNAL (highlighted (int)), this, SLOT (slPaintLevel ())); - connect (number, SIGNAL (sliderReleased()), this, SLOT (slPaintLevel())); - connect (number, SIGNAL (nextLine()), this, SLOT (slPaintLevel())); - connect (number, SIGNAL (prevLine()), this, SLOT (slPaintLevel())); - connect (number, SIGNAL (nextPage()), this, SLOT (slPaintLevel())); - connect (number, SIGNAL (prevPage()), this, SLOT (slPaintLevel())); + connect (colln, TQT_SIGNAL (highlighted (int)), this, TQT_SLOT (slPaintLevel ())); + connect (number, TQT_SIGNAL (sliderReleased()), this, TQT_SLOT (slPaintLevel())); + connect (number, TQT_SIGNAL (nextLine()), this, TQT_SLOT (slPaintLevel())); + connect (number, TQT_SIGNAL (prevLine()), this, TQT_SLOT (slPaintLevel())); + connect (number, TQT_SIGNAL (nextPage()), this, TQT_SLOT (slPaintLevel())); + connect (number, TQT_SIGNAL (prevPage()), this, TQT_SLOT (slPaintLevel())); #ifdef KGR_PORTABLE // Set the exits from this dialog box. - connect (OK, SIGNAL (clicked ()), this, SLOT (accept ())); - connect (CANCEL, SIGNAL (clicked ()), this, SLOT (reject ())); - connect (HELP, SIGNAL (clicked ()), this, SLOT (slotHelp ())); + connect (OK, TQT_SIGNAL (clicked ()), this, TQT_SLOT (accept ())); + connect (CANCEL, TQT_SIGNAL (clicked ()), this, TQT_SLOT (reject ())); + connect (HELP, TQT_SIGNAL (clicked ()), this, TQT_SLOT (slotHelp ())); #endif } @@ -343,7 +343,7 @@ void KGrSLDialog::slColln (int i) collnD->setText (i18n("1 level, uses Traditional rules.", "%n levels, uses Traditional rules.", levCnt)); #else - QString levCnt; + TQString levCnt; levCnt = levCnt.setNum (collections.at(n)->nLevels); if (collections.at(n)->settings == 'K') collnD->setText (levCnt + i18n(" levels, uses KGoldrunner rules.")); @@ -373,16 +373,16 @@ void KGrSLDialog::slAboutColln () void KGrSLDialog::slShowLevel (int i) { // Display the level number as the slider is moved. - QString tmp; + TQString tmp; tmp.setNum(i); tmp = tmp.rightJustify(3,'0'); display->setText(tmp); } -void KGrSLDialog::slUpdate (const QString & text) +void KGrSLDialog::slUpdate (const TQString & text) { // Move the slider when a valid level number is entered. - QString s = text; + TQString s = text; bool ok = FALSE; int n = s.toInt (&ok); if (ok) { @@ -410,7 +410,7 @@ void KGrSLDialog::slPaintLevel () void KGrSLDialog::slotHelp () { // Help for "Select Game and Level" dialog box. - QString s = + TQString s = i18n("The main button at the bottom echoes the " "menu action you selected. Click it after choosing " "a game and level - or use \"Cancel\"."); @@ -485,13 +485,13 @@ void KGrSLDialog::slotHelp () *******************************************************************************/ #ifdef KGR_PORTABLE -KGrNHDialog::KGrNHDialog(const QString & levelName, const QString & levelHint, - QWidget * parent, const char * name) - : QDialog (parent, name, TRUE, +KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, + TQWidget * parent, const char * name) + : TQDialog (parent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else -KGrNHDialog::KGrNHDialog(const QString & levelName, const QString & levelHint, - QWidget * parent, const char * name) +KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, + TQWidget * parent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Edit Name & Hint"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent, name) @@ -500,45 +500,45 @@ KGrNHDialog::KGrNHDialog(const QString & levelName, const QString & levelHint, #ifdef KGR_PORTABLE int margin = 10; int spacing = 10; - QWidget * dad = this; + TQWidget * dad = this; #else int margin = marginHint(); int spacing = spacingHint(); - QWidget * dad = plainPage(); + TQWidget * dad = plainPage(); #endif - QVBoxLayout * mainLayout = new QVBoxLayout (dad, margin, spacing); + TQVBoxLayout * mainLayout = new TQVBoxLayout (dad, margin, spacing); - QLabel * nameL = new QLabel (i18n("Name of level:"), dad); + TQLabel * nameL = new TQLabel (i18n("Name of level:"), dad); mainLayout->addWidget (nameL); - nhName = new QLineEdit (dad); + nhName = new TQLineEdit (dad); mainLayout->addWidget (nhName); - QLabel * mleL = new QLabel (i18n("Hint for level:"), dad); + TQLabel * mleL = new TQLabel (i18n("Hint for level:"), dad); mainLayout->addWidget (mleL); // Set up a widget to hold the wrapped text, using \n for paragraph breaks. #ifdef QT3 - mle = new QTextEdit (dad); + mle = new TQTextEdit (dad); mle-> setTextFormat (PlainText); #else - mle = new QMultiLineEdit (dad); + mle = new TQMultiLineEdit (dad); #endif mainLayout->addWidget (mle); #ifdef KGR_PORTABLE - QHBox * buttons = new QHBox (dad); + TQHBox * buttons = new TQHBox (dad); mainLayout->addWidget (buttons); buttons->setSpacing (spacing); // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. - QPushButton * OK = new QPushButton (i18n("&OK"), buttons); - QPushButton * CANCEL = new QPushButton (i18n("&Cancel"), buttons); + TQPushButton * OK = new TQPushButton (i18n("&OK"), buttons); + TQPushButton * CANCEL = new TQPushButton (i18n("&Cancel"), buttons); dad-> setCaption (i18n("Edit Name & Hint")); #endif // Base the geometry of the text box on the playing area. - QPoint p = parent->mapToGlobal (QPoint (0,0)); + QPoint p = parent->mapToGlobal (TQPoint (0,0)); int c = parent->width() / (FIELDWIDTH + 4); dad-> move (p.x()+4*c, p.y()+4*c); mle-> setMinimumSize ((FIELDWIDTH*c/2), (FIELDHEIGHT/2)*c); @@ -546,7 +546,7 @@ KGrNHDialog::KGrNHDialog(const QString & levelName, const QString & levelHint, // Configure the text box. mle-> setAlignment (AlignLeft); #ifndef QT3 - mle-> setWordWrap (QMultiLineEdit::WidgetWidth); + mle-> setWordWrap (TQMultiLineEdit::WidgetWidth); mle-> setFixedVisibleLines (9); #endif @@ -557,8 +557,8 @@ KGrNHDialog::KGrNHDialog(const QString & levelName, const QString & levelHint, // OK-> setAccel (Key_Return); // No! We need it in "mle" box. CANCEL-> setAccel (Key_Escape); - connect (OK, SIGNAL (clicked ()), dad, SLOT (accept ())); - connect (CANCEL, SIGNAL (clicked ()), dad, SLOT (reject ())); + connect (OK, TQT_SIGNAL (clicked ()), dad, TQT_SLOT (accept ())); + connect (CANCEL, TQT_SIGNAL (clicked ()), dad, TQT_SLOT (reject ())); #endif } @@ -572,14 +572,14 @@ KGrNHDialog::~KGrNHDialog() #ifdef KGR_PORTABLE KGrECDialog::KGrECDialog (int action, int collnIndex, - QPtrList<KGrCollection> & gamesList, - QWidget * parent, const char * name) - : QDialog (parent, name, TRUE, + TQPtrList<KGrCollection> & gamesList, + TQWidget * parent, const char * name) + : TQDialog (parent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrECDialog::KGrECDialog (int action, int collnIndex, - QPtrList<KGrCollection> & gamesList, - QWidget * parent, const char * name) + TQPtrList<KGrCollection> & gamesList, + TQWidget * parent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Edit Game Info"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent, name) @@ -591,56 +591,56 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, #ifdef KGR_PORTABLE int margin = 10; int spacing = 10; - QWidget * dad = this; + TQWidget * dad = this; #else int margin = marginHint(); int spacing = spacingHint(); - QWidget * dad = plainPage(); + TQWidget * dad = plainPage(); #endif - QVBoxLayout * mainLayout = new QVBoxLayout (dad, margin, spacing); + TQVBoxLayout * mainLayout = new TQVBoxLayout (dad, margin, spacing); - QHBox * nameBox = new QHBox (dad); + TQHBox * nameBox = new TQHBox (dad); mainLayout->addWidget (nameBox); nameBox->setSpacing (spacing); - nameL = new QLabel (i18n("Name of game:"), nameBox); - ecName = new QLineEdit (nameBox); + nameL = new TQLabel (i18n("Name of game:"), nameBox); + ecName = new TQLineEdit (nameBox); - QHBox * prefixBox = new QHBox (dad); + TQHBox * prefixBox = new TQHBox (dad); mainLayout->addWidget (prefixBox); prefixBox->setSpacing (spacing); - prefixL = new QLabel (i18n("File name prefix:"), prefixBox); - ecPrefix = new QLineEdit (prefixBox); + prefixL = new TQLabel (i18n("File name prefix:"), prefixBox); + ecPrefix = new TQLineEdit (prefixBox); - ecGrp = new QButtonGroup (1, QButtonGroup::Horizontal, 0, dad); + ecGrp = new TQButtonGroup (1, TQButtonGroup::Horizontal, 0, dad); mainLayout->addWidget (ecGrp); - ecTradB = new QRadioButton (i18n("Traditional rules"), ecGrp); - ecKGrB = new QRadioButton (i18n("KGoldrunner rules"), ecGrp); + ecTradB = new TQRadioButton (i18n("Traditional rules"), ecGrp); + ecKGrB = new TQRadioButton (i18n("KGoldrunner rules"), ecGrp); - nLevL = new QLabel (i18n( "0 levels" ), dad); + nLevL = new TQLabel (i18n( "0 levels" ), dad); mainLayout->addWidget (nLevL); - mleL = new QLabel (i18n("About this game:"), dad); + mleL = new TQLabel (i18n("About this game:"), dad); mainLayout->addWidget (mleL); // Set up a widget to hold the wrapped text, using \n for paragraph breaks. #ifdef QT3 - mle = new QTextEdit (dad); + mle = new TQTextEdit (dad); mle-> setTextFormat (PlainText); #else - mle = new QMultiLineEdit (dad); + mle = new TQMultiLineEdit (dad); #endif mainLayout->addWidget (mle); #ifdef KGR_PORTABLE - QHBox * buttons = new QHBox (dad); + TQHBox * buttons = new TQHBox (dad); mainLayout->addWidget (buttons); buttons->setSpacing (spacing); // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. - OK = new QPushButton (i18n("&OK"), buttons); - CANCEL = new QPushButton (i18n("&Cancel"), buttons); + OK = new TQPushButton (i18n("&OK"), buttons); + CANCEL = new TQPushButton (i18n("&Cancel"), buttons); - QPoint p = parent->mapToGlobal (QPoint (0,0)); + TQPoint p = parent->mapToGlobal (TQPoint (0,0)); // Base the geometry of the dialog box on the playing area. int cell = parent->width() / (FIELDWIDTH + 4); @@ -655,7 +655,7 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, setCaption (i18n("Edit Game Info")); } - QString OKText = ""; + TQString OKText = ""; if (action == SL_UPD_GAME) { // Edit existing collection. ecName-> setText (collections.at(defaultGame)->name); ecPrefix-> setText (collections.at(defaultGame)->prefix); @@ -696,7 +696,7 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, // Configure the edit box. mle-> setAlignment (AlignLeft); #ifndef QT3 - mle-> setWordWrap (QMultiLineEdit::WidgetWidth); + mle-> setWordWrap (TQMultiLineEdit::WidgetWidth); mle-> setFixedVisibleLines (8); #endif @@ -709,8 +709,8 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, mle-> setText (""); } - connect (ecKGrB, SIGNAL (clicked ()), this, SLOT (ecSetKGr ())); - connect (ecTradB, SIGNAL (clicked ()), this, SLOT (ecSetTrad ())); + connect (ecKGrB, TQT_SIGNAL (clicked ()), this, TQT_SLOT (ecSetKGr ())); + connect (ecTradB, TQT_SIGNAL (clicked ()), this, TQT_SLOT (ecSetTrad ())); #ifdef KGR_PORTABLE OK-> setGeometry (10, 145 + mle->height(), 100, 25); @@ -721,8 +721,8 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, dad-> resize (300, 175 + mle->height()); - connect (OK, SIGNAL (clicked ()), this, SLOT (accept())); - connect (CANCEL, SIGNAL (clicked ()), this, SLOT (reject())); + connect (OK, TQT_SIGNAL (clicked ()), this, TQT_SLOT (accept())); + connect (CANCEL, TQT_SIGNAL (clicked ()), this, TQT_SLOT (reject())); #endif } @@ -748,15 +748,15 @@ void KGrECDialog::ecSetTrad () {ecSetRules ('T');} *******************************************************************************/ #ifdef KGR_PORTABLE -KGrLGDialog::KGrLGDialog (QFile * savedGames, - QPtrList<KGrCollection> & collections, - QWidget * parent, const char * name) - : QDialog (parent, name, TRUE, +KGrLGDialog::KGrLGDialog (TQFile * savedGames, + TQPtrList<KGrCollection> & collections, + TQWidget * parent, const char * name) + : TQDialog (parent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else -KGrLGDialog::KGrLGDialog (QFile * savedGames, - QPtrList<KGrCollection> & collections, - QWidget * parent, const char * name) +KGrLGDialog::KGrLGDialog (TQFile * savedGames, + TQPtrList<KGrCollection> & collections, + TQWidget * parent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Select Saved Game"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent, name) @@ -765,20 +765,20 @@ KGrLGDialog::KGrLGDialog (QFile * savedGames, #ifdef KGR_PORTABLE int margin = 10; int spacing = 10; - QWidget * dad = this; + TQWidget * dad = this; #else int margin = marginHint(); int spacing = spacingHint(); - QWidget * dad = plainPage(); + TQWidget * dad = plainPage(); #endif - QVBoxLayout * mainLayout = new QVBoxLayout (dad, margin, spacing); + TQVBoxLayout * mainLayout = new TQVBoxLayout (dad, margin, spacing); - QLabel * lgHeader = new QLabel ( + TQLabel * lgHeader = new TQLabel ( i18n("Game Level/Lives/Score " "Day Date Time "), dad); - lgList = new QListBox (dad); + lgList = new TQListBox (dad); #ifdef KGR_PORTABLE QFont f ("courier", 12); #else @@ -793,17 +793,17 @@ KGrLGDialog::KGrLGDialog (QFile * savedGames, mainLayout-> addWidget (lgList); #ifdef KGR_PORTABLE - QHBox * buttons = new QHBox (dad); + TQHBox * buttons = new TQHBox (dad); buttons-> setSpacing (spacing); // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. - QPushButton * OK = new QPushButton (i18n("&OK"), buttons); - QPushButton * CANCEL = new QPushButton (i18n("&Cancel"), buttons); + TQPushButton * OK = new TQPushButton (i18n("&OK"), buttons); + TQPushButton * CANCEL = new TQPushButton (i18n("&Cancel"), buttons); mainLayout-> addWidget (buttons); dad-> setCaption (i18n("Select Saved Game")); // Base the geometry of the list box on the playing area. - QPoint p = parent->mapToGlobal (QPoint (0,0)); + QPoint p = parent->mapToGlobal (TQPoint (0,0)); int c = parent->width() / (FIELDWIDTH + 4); dad-> move (p.x()+2*c, p.y()+2*c); lgList-> setMinimumHeight ((FIELDHEIGHT/2)*c); @@ -842,10 +842,10 @@ KGrLGDialog::KGrLGDialog (QFile * savedGames, lgList-> setSelected (0, TRUE); lgHighlight = 0; - connect (lgList, SIGNAL (highlighted (int)), this, SLOT (lgSelect (int))); + connect (lgList, TQT_SIGNAL (highlighted (int)), this, TQT_SLOT (lgSelect (int))); #ifdef KGR_PORTABLE - connect (OK, SIGNAL (clicked ()), this, SLOT (accept ())); - connect (CANCEL, SIGNAL (clicked ()), this, SLOT (reject ())); + connect (OK, TQT_SIGNAL (clicked ()), this, TQT_SLOT (accept ())); + connect (CANCEL, TQT_SIGNAL (clicked ()), this, TQT_SLOT (reject ())); #endif } @@ -858,11 +858,11 @@ void KGrLGDialog::lgSelect (int n) *********************** CENTRALISED MESSAGE FUNCTIONS ************************ *******************************************************************************/ -void KGrMessage::information (QWidget * parent, const QString &caption, const QString &text) +void KGrMessage::information (TQWidget * parent, const TQString &caption, const TQString &text) { #ifdef KGR_PORTABLE // Force Qt to do word-wrapping (but it ignores "\n" line-breaks). - QMessageBox::information (parent, caption, + TQMessageBox::information (parent, caption, "<qt>" + text + "</qt>"); #else // KDE does word-wrapping and will observe "\n" line-breaks. @@ -870,14 +870,14 @@ void KGrMessage::information (QWidget * parent, const QString &caption, const QS #endif } -int KGrMessage::warning (QWidget * parent, QString caption, QString text, - QString label0, QString label1, QString label2) +int KGrMessage::warning (TQWidget * parent, TQString caption, TQString text, + TQString label0, TQString label1, TQString label2) { int ans = 0; #ifdef KGR_PORTABLE // Display a box with 2 or 3 buttons, depending on if label2 is empty or not. // Force Qt to do word-wrapping (but it ignores "\n" line-breaks). - ans = QMessageBox::warning (parent, caption, + ans = TQMessageBox::warning (parent, caption, "<qt>" + text + "</qt>", label0, label1, label2, 0, (label2.isEmpty()) ? 1 : 2); @@ -906,56 +906,56 @@ int KGrMessage::warning (QWidget * parent, QString caption, QString text, /********************** WORD-WRAPPED MESSAGE BOX ************************/ /******************************************************************************/ -void KGrMessage::wrapped (QWidget * parent, QString title, QString contents) +void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents) { #ifndef KGR_PORTABLE KMessageBox::information (parent, contents, title); #else - QDialog * mm = new QDialog (parent, "wrappedMessage", TRUE, + TQDialog * mm = new TQDialog (parent, "wrappedMessage", TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title); int margin = 10; int spacing = 10; - QVBoxLayout * mainLayout = new QVBoxLayout (mm, margin, spacing); + TQVBoxLayout * mainLayout = new TQVBoxLayout (mm, margin, spacing); // Make text background grey not white (i.e. same as widget background). QPalette pl = mm->palette(); #ifdef QT3 - pl.setColor (QColorGroup::Base, mm->paletteBackgroundColor()); + pl.setColor (TQColorGroup::Base, mm->paletteBackgroundColor()); #else - pl.setColor (QColorGroup::Base, mm->backgroundColor()); + pl.setColor (TQColorGroup::Base, mm->backgroundColor()); #endif mm-> setPalette (pl); // Set up a widget to hold the wrapped text, using \n for paragraph breaks. #ifdef QT3 - QTextEdit * mle = new QTextEdit (mm); + TQTextEdit * mle = new TQTextEdit (mm); mle-> setTextFormat (PlainText); #else - QMultiLineEdit * mle = new QMultiLineEdit (mm); + TQMultiLineEdit * mle = new TQMultiLineEdit (mm); #endif mainLayout->addWidget (mle); // Button is for Qt-only portability. NOT COMPILED in KDE environment. - QPushButton * OK = new QPushButton (i18n("&OK"), mm); + TQPushButton * OK = new TQPushButton (i18n("&OK"), mm); mainLayout->addWidget (OK, Qt::AlignHCenter); mm-> setCaption (title); // Base the geometry of the text box on the playing area. - QPoint p = parent->mapToGlobal (QPoint (0,0)); + QPoint p = parent->mapToGlobal (TQPoint (0,0)); int c = parent->width() / (FIELDWIDTH + 4); mm-> move (p.x()+4*c, p.y()+4*c); mle-> setMinimumSize ((FIELDWIDTH*c/2), (FIELDHEIGHT/2)*c); OK-> setMaximumWidth (3*c); - mle-> setFrameStyle (QFrame::NoFrame); + mle-> setFrameStyle (TQFrame::NoFrame); mle-> setAlignment (AlignLeft); mle-> setReadOnly (TRUE); mle-> setText (contents); #ifndef QT3 - mle-> setWordWrap (QMultiLineEdit::WidgetWidth); + mle-> setWordWrap (TQMultiLineEdit::WidgetWidth); mle-> setFixedVisibleLines (10); if (mle-> numLines() < 10) { mle-> setFixedVisibleLines (mle->numLines()); @@ -963,7 +963,7 @@ void KGrMessage::wrapped (QWidget * parent, QString title, QString contents) #endif OK-> setAccel (Key_Return); - connect (OK, SIGNAL (clicked ()), mm, SLOT (accept ())); + connect (OK, TQT_SIGNAL (clicked ()), mm, TQT_SLOT (accept ())); mm-> exec (); diff --git a/kgoldrunner/src/kgrdialog.h b/kgoldrunner/src/kgrdialog.h index 2e2e847c..860328eb 100644 --- a/kgoldrunner/src/kgrdialog.h +++ b/kgoldrunner/src/kgrdialog.h @@ -10,13 +10,13 @@ #ifndef KGRDIALOG_QT_H #define KGRDIALOG_QT_H -// If portable version, use QDialog and QMessageBox. +// If portable version, use TQDialog and TQMessageBox. // If KDE version, use KDialogBase and KMessageBox. #ifdef KGR_PORTABLE -#include <qdialog.h> +#include <tqdialog.h> #define KGR_DIALOG QDialog -#include <qmessagebox.h> +#include <tqmessagebox.h> #else #include <klocale.h> @@ -25,22 +25,22 @@ #include <kmessagebox.h> #endif -#include <qlayout.h> +#include <tqlayout.h> -#include <qlistbox.h> -#include <qscrollbar.h> -#include <qlineedit.h> -#include <qhbox.h> -#include <qpushbutton.h> -#include <qbuttongroup.h> -#include <qradiobutton.h> +#include <tqlistbox.h> +#include <tqscrollbar.h> +#include <tqlineedit.h> +#include <tqhbox.h> +#include <tqpushbutton.h> +#include <tqbuttongroup.h> +#include <tqradiobutton.h> #ifdef QT3 -#include <qtextedit.h> +#include <tqtextedit.h> #else -#include <qmultilineedit.h> +#include <tqmultilineedit.h> #endif -#include <qptrlist.h> +#include <tqptrlist.h> /** @author Ian Wadham and Marco Krüger @@ -60,8 +60,8 @@ class KGrSLDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase Q_OBJECT public: KGrSLDialog (int action, int requestedLevel, int collnIndex, - QPtrList<KGrCollection> & gamesList, KGrGame * theGame, - QWidget * parent = 0, const char *name = 0); + TQPtrList<KGrCollection> & gamesList, KGrGame * theGame, + TQWidget * parent = 0, const char *name = 0); ~KGrSLDialog(); int selectedLevel() {return (number->value());} @@ -72,37 +72,37 @@ private slots: void slColln (int i); void slAboutColln (); void slShowLevel (int i); - void slUpdate (const QString & text); + void slUpdate (const TQString & text); void slPaintLevel (); void slotHelp (); // Will replace KDE slotHelp(). private: int slAction; - QPtrList<KGrCollection> collections; // List of games. + TQPtrList<KGrCollection> collections; // List of games. int defaultLevel; int defaultGame; int slCollnIndex; KGrGame * game; KGrCollection * collection; - QWidget * slParent; - - QLabel * collnL; - QListBox * colln; - QLabel * collnN; - QLabel * collnD; - QPushButton * collnA; - - QLabel * numberL; - QLineEdit * display; - QScrollBar * number; - QPushButton * levelNH; - QLabel * slName; + TQWidget * slParent; + + TQLabel * collnL; + TQListBox * colln; + TQLabel * collnN; + TQLabel * collnD; + TQPushButton * collnA; + + TQLabel * numberL; + TQLineEdit * display; + TQScrollBar * number; + TQPushButton * levelNH; + TQLabel * slName; KGrThumbNail * thumbNail; #ifdef KGR_PORTABLE - QPushButton * OK; - QPushButton * HELP; - QPushButton * CANCEL; + TQPushButton * OK; + TQPushButton * HELP; + TQPushButton * CANCEL; #endif }; @@ -114,19 +114,19 @@ class KGrNHDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase { Q_OBJECT public: - KGrNHDialog (const QString & levelName, const QString & levelHint, - QWidget * parent = 0, const char * name = 0); + KGrNHDialog (const TQString & levelName, const TQString & levelHint, + TQWidget * parent = 0, const char * name = 0); ~KGrNHDialog(); QString getName() {return (nhName->text());} QString getHint() {return (mle->text());} private: - QLineEdit * nhName; + TQLineEdit * nhName; #ifdef QT3 - QTextEdit * mle; + TQTextEdit * mle; #else - QMultiLineEdit * mle; + TQMultiLineEdit * mle; #endif }; @@ -139,8 +139,8 @@ class KGrECDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase Q_OBJECT public: KGrECDialog (int action, int collnIndex, - QPtrList<KGrCollection> & gamesList, - QWidget *parent = 0, const char *name = 0); + TQPtrList<KGrCollection> & gamesList, + TQWidget *parent = 0, const char *name = 0); ~KGrECDialog(); QString getName() {return (ecName->text());} @@ -154,28 +154,28 @@ private slots: void ecSetTrad(); private: - QPtrList<KGrCollection> collections; // List of existing games. + TQPtrList<KGrCollection> collections; // List of existing games. int defaultGame; - QLabel * nameL; - QLineEdit * ecName; - QLabel * prefixL; - QLineEdit * ecPrefix; - QButtonGroup * ecGrp; - QRadioButton * ecKGrB; - QRadioButton * ecTradB; - QLabel * nLevL; + TQLabel * nameL; + TQLineEdit * ecName; + TQLabel * prefixL; + TQLineEdit * ecPrefix; + TQButtonGroup * ecGrp; + TQRadioButton * ecKGrB; + TQRadioButton * ecTradB; + TQLabel * nLevL; - QLabel * mleL; + TQLabel * mleL; #ifdef QT3 - QTextEdit * mle; + TQTextEdit * mle; #else - QMultiLineEdit * mle; + TQMultiLineEdit * mle; #endif #ifdef KGR_PORTABLE - QPushButton * OK; - QPushButton * CANCEL; + TQPushButton * OK; + TQPushButton * CANCEL; #endif }; @@ -183,22 +183,22 @@ private: *************** DIALOG TO SELECT A SAVED GAME TO BE RE-LOADED **************** *******************************************************************************/ -#include <qfile.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqtextstream.h> class KGrLGDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase { Q_OBJECT public: - KGrLGDialog (QFile * savedGames, QPtrList<KGrCollection> & collections, - QWidget * parent, const char * name); - QString getCurrentText() {return (lgList->currentText());} + KGrLGDialog (TQFile * savedGames, TQPtrList<KGrCollection> & collections, + TQWidget * parent, const char * name); + TQString getCurrentText() {return (lgList->currentText());} private slots: void lgSelect (int n); private: - QListBox * lgList; + TQListBox * lgList; int lgHighlight; }; @@ -209,10 +209,10 @@ private: class KGrMessage : public QDialog { public: - static void information (QWidget * parent, const QString &caption, const QString &text); - static int warning (QWidget * parent, QString caption, QString text, - QString label0, QString label1, QString label2 = ""); - static void wrapped (QWidget * parent, QString caption, QString text); + static void information (TQWidget * parent, const TQString &caption, const TQString &text); + static int warning (TQWidget * parent, TQString caption, TQString text, + TQString label0, TQString label1, TQString label2 = ""); + static void wrapped (TQWidget * parent, TQString caption, TQString text); }; #endif diff --git a/kgoldrunner/src/kgrfigure.cpp b/kgoldrunner/src/kgrfigure.cpp index 08fc91d4..0dcb68af 100644 --- a/kgoldrunner/src/kgrfigure.cpp +++ b/kgoldrunner/src/kgrfigure.cpp @@ -31,8 +31,8 @@ KGrFigure :: KGrFigure (int px, int py) nuggets = 0; status = STANDING; - walkTimer = new QTimer (this); - fallTimer = new QTimer (this); + walkTimer = new TQTimer (this); + fallTimer = new TQTimer (this); } // Initialise the global settings flags. @@ -310,8 +310,8 @@ KGrHero :: KGrHero (KGrCanvas * view, int x, int y) walkFrozen = FALSE; fallFrozen = FALSE; - connect (walkTimer, SIGNAL (timeout ()), SLOT (walkTimeDone ())); - connect (fallTimer, SIGNAL (timeout ()), SLOT (fallTimeDone ())); + connect (walkTimer, TQT_SIGNAL (timeout ()), TQT_SLOT (walkTimeDone ())); + connect (fallTimer, TQT_SIGNAL (timeout ()), TQT_SLOT (fallTimeDone ())); } int KGrHero::WALKDELAY = 0; @@ -711,7 +711,7 @@ void KGrHero::digRight(){ } #ifdef QT3 -void KGrHero::setEnemyList(QPtrList<KGrEnemy> *e) +void KGrHero::setEnemyList(TQPtrList<KGrEnemy> *e) #else void KGrHero::setEnemyList(QList<KGrEnemy> *e) #endif @@ -816,10 +816,10 @@ KGrEnemy :: KGrEnemy (KGrCanvas * view, int x, int y) fallFrozen = FALSE; captiveFrozen = FALSE; - captiveTimer = new QTimer (this); - connect (captiveTimer,SIGNAL(timeout()),SLOT(captiveTimeDone())); - connect (walkTimer, SIGNAL (timeout ()), SLOT (walkTimeDone ())); - connect (fallTimer, SIGNAL (timeout ()), SLOT (fallTimeDone ())); + captiveTimer = new TQTimer (this); + connect (captiveTimer,TQT_SIGNAL(timeout()),TQT_SLOT(captiveTimeDone())); + connect (walkTimer, TQT_SIGNAL (timeout ()), TQT_SLOT (walkTimeDone ())); + connect (fallTimer, TQT_SIGNAL (timeout ()), TQT_SLOT (fallTimeDone ())); } int KGrEnemy::WALKDELAY = 0; @@ -1671,7 +1671,7 @@ bool KGrEnemy::willNotFall (int x, int y) } #ifdef QT3 -void KGrEnemy::setEnemyList(QPtrList<KGrEnemy> *e) +void KGrEnemy::setEnemyList(TQPtrList<KGrEnemy> *e) #else void KGrEnemy::setEnemyList(QList<KGrEnemy> *e) #endif diff --git a/kgoldrunner/src/kgrfigure.h b/kgoldrunner/src/kgrfigure.h index e6ee0f2e..12551418 100644 --- a/kgoldrunner/src/kgrfigure.h +++ b/kgoldrunner/src/kgrfigure.h @@ -17,16 +17,16 @@ // Obsolete - #include <iostream.h> #include <iostream> -#include <qimage.h> +#include <tqimage.h> #ifdef QT3 -#include <qptrlist.h> +#include <tqptrlist.h> #else -#include <qlist.h> +#include <tqlist.h> #endif -#include <qpainter.h> -#include <qpixmap.h> -#include <qtimer.h> -#include <qwidget.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqtimer.h> +#include <tqwidget.h> #include <stdlib.h> // für Zufallsfunktionen class KGrCanvas; @@ -76,8 +76,8 @@ protected: int walkCounter; int nuggets; int actualPixmap; // ArrayPos der zu zeichnenden Pixmap - QTimer *walkTimer; - QTimer *fallTimer; + TQTimer *walkTimer; + TQTimer *fallTimer; KGrObject *(*playfield)[30][22]; Status status; @@ -112,7 +112,7 @@ public: void digRight(); void startWalk(); #ifdef QT3 - void setEnemyList(QPtrList<KGrEnemy> *); + void setEnemyList(TQPtrList<KGrEnemy> *); #else void setEnemyList(QList<KGrEnemy> *); #endif @@ -129,7 +129,7 @@ public: private: #ifdef QT3 - QPtrList<KGrEnemy> *enemies; + TQPtrList<KGrEnemy> *enemies; #else QList<KGrEnemy> *enemies; #endif @@ -167,7 +167,7 @@ public: void showFigure(); void startSearching(); #ifdef QT3 - void setEnemyList(QPtrList<KGrEnemy> *); + void setEnemyList(TQPtrList<KGrEnemy> *); #else void setEnemyList(QList<KGrEnemy> *); #endif @@ -184,10 +184,10 @@ private: int birthX, birthY; int searchStatus; int captiveCounter; - QTimer *captiveTimer; + TQTimer *captiveTimer; bool canWalkUp(); #ifdef QT3 - QPtrList<KGrEnemy> *enemies; + TQPtrList<KGrEnemy> *enemies; #else QList<KGrEnemy> *enemies; #endif diff --git a/kgoldrunner/src/kgrgame.cpp b/kgoldrunner/src/kgrgame.cpp index 93164d88..985d0783 100644 --- a/kgoldrunner/src/kgrgame.cpp +++ b/kgoldrunner/src/kgrgame.cpp @@ -37,7 +37,7 @@ /*********************** KGOLDRUNNER GAME CLASS *************************/ /******************************************************************************/ -KGrGame::KGrGame (KGrCanvas * theView, QString theSystemDir, QString theUserDir) +KGrGame::KGrGame (KGrCanvas * theView, TQString theSystemDir, TQString theUserDir) { view = theView; systemDataDir = theSystemDir; @@ -63,17 +63,17 @@ KGrGame::KGrGame (KGrCanvas * theView, QString theSystemDir, QString theUserDir) modalFreeze = FALSE; messageFreeze = FALSE; - connect (hero, SIGNAL (gotNugget(int)), SLOT (incScore(int))); - connect (hero, SIGNAL (caughtHero()), SLOT (herosDead())); - connect (hero, SIGNAL (haveAllNuggets()), SLOT (showHiddenLadders())); - connect (hero, SIGNAL (leaveLevel()), SLOT (goUpOneLevel())); + connect (hero, TQT_SIGNAL (gotNugget(int)), TQT_SLOT (incScore(int))); + connect (hero, TQT_SIGNAL (caughtHero()), TQT_SLOT (herosDead())); + connect (hero, TQT_SIGNAL (haveAllNuggets()), TQT_SLOT (showHiddenLadders())); + connect (hero, TQT_SIGNAL (leaveLevel()), TQT_SLOT (goUpOneLevel())); - dyingTimer = new QTimer (this); - connect (dyingTimer, SIGNAL (timeout()), SLOT (finalBreath())); + dyingTimer = new TQTimer (this); + connect (dyingTimer, TQT_SIGNAL (timeout()), TQT_SLOT (finalBreath())); // Get the mouse position every 40 msec. It is used to steer the hero. - mouseSampler = new QTimer (this); - connect (mouseSampler, SIGNAL(timeout()), SLOT (readMousePos ())); + mouseSampler = new TQTimer (this); + connect (mouseSampler, TQT_SIGNAL(timeout()), TQT_SLOT (readMousePos ())); mouseSampler->start (40, FALSE); srand(1); // initialisiere Random-Generator @@ -142,7 +142,7 @@ void KGrGame::herosDead() // Game over: display the "ENDE" screen. emit showLives (lives); freeze(); - QString gameOver = "<NOBR><B>" + i18n("GAME OVER !!!") + "</B></NOBR>"; + TQString gameOver = "<NOBR><B>" + i18n("GAME OVER !!!") + "</B></NOBR>"; KGrMessage::information (view, collection->name, gameOver); checkHighScore(); // Check if there is a high score for this game. @@ -294,18 +294,18 @@ void KGrGame::setBlankLevel(bool playable) editObjArray[i+1][j+1] = FREE; } for (int j=0;j<30;j++) { - //playfield[j][0]=new KGrBeton(QPixmap ()); + //playfield[j][0]=new KGrBeton(TQPixmap ()); playfield[j][0]=new KGrObject (BETON); editObjArray[j][0] = BETON; - //playfield[j][21]=new KGrBeton(QPixmap ()); + //playfield[j][21]=new KGrBeton(TQPixmap ()); playfield[j][21]=new KGrObject (BETON); editObjArray[j][21] = BETON; } for (int i=0;i<22;i++) { - //playfield[0][i]=new KGrBeton(QPixmap ()); + //playfield[0][i]=new KGrBeton(TQPixmap ()); playfield[0][i]=new KGrObject (BETON); editObjArray[0][i] = BETON; - //playfield[29][i]=new KGrBeton(QPixmap ()); + //playfield[29][i]=new KGrBeton(TQPixmap ()); playfield[29][i]=new KGrObject (BETON); editObjArray[29][i] = BETON; } @@ -391,7 +391,7 @@ void KGrGame::startTutorial() void KGrGame::showHint() { // Put out a hint for this level. - QString caption = i18n("Hint"); + TQString caption = i18n("Hint"); if (levelHint.length() > 0) myMessage (view, caption, levelHint); @@ -403,7 +403,7 @@ void KGrGame::showHint() int KGrGame::loadLevel (int levelNo) { int i,j; - QFile openlevel; + TQFile openlevel; if (! openLevelFile (levelNo, openlevel)) { return 0; @@ -426,8 +426,8 @@ int KGrGame::loadLevel (int levelNo) int c = openlevel.getch(); levelName = ""; levelHint = ""; - QCString levelNameC = ""; - QCString levelHintC = ""; + TQCString levelNameC = ""; + TQCString levelHintC = ""; i = 1; while ((c = openlevel.getch()) != EOF) { switch (i) { @@ -456,8 +456,8 @@ int KGrGame::loadLevel (int levelNo) levelHint = i18n((const char *) levelHintC.left(len-1)); // Disconnect edit-mode slots from signals from "view". - disconnect (view, SIGNAL (mouseClick(int)), 0, 0); - disconnect (view, SIGNAL (mouseLetGo(int)), 0, 0); + disconnect (view, TQT_SIGNAL (mouseClick(int)), 0, 0); + disconnect (view, TQT_SIGNAL (mouseLetGo(int)), 0, 0); if (newLevel) { hero->setEnemyList (&enemies); @@ -491,7 +491,7 @@ int KGrGame::loadLevel (int levelNo) view->setMousePos (startI, startJ); // Connect play-mode slot to signal from "view". - connect (view, SIGNAL(mouseClick(int)), SLOT(doDig(int))); + connect (view, TQT_SIGNAL(mouseClick(int)), TQT_SLOT(doDig(int))); // Re-enable player input. loading = FALSE; @@ -499,10 +499,10 @@ int KGrGame::loadLevel (int levelNo) return 1; } -bool KGrGame::openLevelFile (int levelNo, QFile & openlevel) +bool KGrGame::openLevelFile (int levelNo, TQFile & openlevel) { - QString filePath; - QString msg; + TQString filePath; + TQString msg; filePath = getFilePath (owner, collection, levelNo); @@ -554,9 +554,9 @@ void KGrGame::changeObject (unsigned char kind, int i, int j) enemy->setPlayfield(&playfield); enemy->enemyId = enemyCount++; enemies.append(enemy); - connect(enemy, SIGNAL(lostNugget()), SLOT(loseNugget())); - connect(enemy, SIGNAL(trapped(int)), SLOT(incScore(int))); - connect(enemy, SIGNAL(killed(int)), SLOT(incScore(int))); + connect(enemy, TQT_SIGNAL(lostNugget()), TQT_SLOT(loseNugget())); + connect(enemy, TQT_SIGNAL(trapped(int)), TQT_SLOT(incScore(int))); + connect(enemy, TQT_SIGNAL(killed(int)), TQT_SLOT(incScore(int))); } else { // Starting a level again after losing. enemy=enemies.at(enemyCount); @@ -650,9 +650,9 @@ void KGrGame::startPlaying () { } } -QString KGrGame::getFilePath (Owner o, KGrCollection * colln, int lev) +TQString KGrGame::getFilePath (Owner o, KGrCollection * colln, int lev) { - QString filePath; + TQString filePath; if (lev == 0) { // End of game: show the "ENDE" screen. @@ -660,7 +660,7 @@ QString KGrGame::getFilePath (Owner o, KGrCollection * colln, int lev) filePath = "level000.grl"; } else { - filePath.setNum (lev); // Convert INT -> QString. + filePath.setNum (lev); // Convert INT -> TQString. filePath = filePath.rightJustify (3,'0'); // Add 0-2 zeros at left. filePath.append (".grl"); // Add KGoldrunner level-suffix. filePath.prepend (colln->prefix); // Add collection file-prefix. @@ -671,9 +671,9 @@ QString KGrGame::getFilePath (Owner o, KGrCollection * colln, int lev) return (filePath); } -QString KGrGame::getTitle() +TQString KGrGame::getTitle() { - QString levelTitle; + TQString levelTitle; if (level == 0) { // Generate a special title: end of game or creating a new level. if (! editMode) @@ -695,7 +695,7 @@ QString KGrGame::getTitle() void KGrGame::readMousePos() { - QPoint p; + TQPoint p; int i, j; // If loading a level for play or editing, ignore mouse-position input. @@ -778,10 +778,10 @@ void KGrGame::saveGame() // Save game ID, score and level. "level, not as they are now.")); } - QDate today = QDate::currentDate(); - QTime now = QTime::currentTime(); - QString saved; - QString day; + TQDate today = TQDate::currentDate(); + TQTime now = TQTime::currentTime(); + TQString saved; + TQString day; #ifdef QT3 day = today.shortDayName(today.dayOfWeek()); #else @@ -794,8 +794,8 @@ void KGrGame::saveGame() // Save game ID, score and level. today.year(), today.month(), today.day(), now.hour(), now.minute()); - QFile file1 (userDataDir + "savegame.dat"); - QFile file2 (userDataDir + "savegame.tmp"); + TQFile file1 (userDataDir + "savegame.dat"); + TQFile file2 (userDataDir + "savegame.tmp"); if (! file2.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Save Game"), @@ -803,7 +803,7 @@ void KGrGame::saveGame() // Save game ID, score and level. .arg(userDataDir + "savegame.tmp")); return; } - QTextStream text2 (&file2); + TQTextStream text2 (&file2); text2 << saved; if (file1.exists()) { @@ -814,7 +814,7 @@ void KGrGame::saveGame() // Save game ID, score and level. return; } - QTextStream text1 (&file1); + TQTextStream text1 (&file1); int n = 30; // Limit the file to the last 30 saves. while ((! text1.endData()) && (--n > 0)) { saved = text1.readLine() + "\n"; @@ -825,7 +825,7 @@ void KGrGame::saveGame() // Save game ID, score and level. file2.close(); - QDir dir; + TQDir dir; dir.rename (file2.name(), file1.name(), TRUE); KGrMessage::information (view, i18n("Save Game"), i18n("Your game has been saved.")); @@ -837,7 +837,7 @@ void KGrGame::loadGame() // Re-load game, score and level. return; } - QFile savedGames (userDataDir + "savegame.dat"); + TQFile savedGames (userDataDir + "savegame.dat"); if (! savedGames.exists()) { // Use myMessage() because it stops the game while the message appears. myMessage (view, i18n("Load Game"), @@ -859,17 +859,17 @@ void KGrGame::loadGame() // Re-load game, score and level. freeze(); } - QString s; + TQString s; KGrLGDialog * lg = new KGrLGDialog (&savedGames, collections, view, "loadDialog"); - if (lg->exec() == QDialog::Accepted) { + if (lg->exec() == TQDialog::Accepted) { s = lg->getCurrentText(); } bool found = FALSE; - QString pr; + TQString pr; int lev; int i; int imax = collections.count(); @@ -932,8 +932,8 @@ void KGrGame::checkHighScore() return; // Look for user's high-score file or for a released high-score file. - QFile high1 (userDataDir + "hi_" + collection->prefix + ".dat"); - QDataStream s1; + TQFile high1 (userDataDir + "hi_" + collection->prefix + ".dat"); + TQDataStream s1; if (! high1.exists()) { high1.setName (systemDataDir + "hi_" + collection->prefix + ".dat"); @@ -945,7 +945,7 @@ void KGrGame::checkHighScore() // If a previous high score file exists, check the current score against it. if (prevHigh) { if (! high1.open (IO_ReadOnly)) { - QString high1_name = high1.name(); + TQString high1_name = high1.name(); KGrMessage::information (view, i18n("Check for High Score"), i18n("Cannot open file '%1' for read-only.").arg(high1_name)); return; @@ -981,8 +981,8 @@ void KGrGame::checkHighScore() /* If we have come this far, we have a new high score to record. */ /* ************************************************************* */ - QFile high2 (userDataDir + "hi_" + collection->prefix + ".tmp"); - QDataStream s2; + TQFile high2 (userDataDir + "hi_" + collection->prefix + ".tmp"); + TQDataStream s2; if (! high2.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Check for High Score"), @@ -992,21 +992,21 @@ void KGrGame::checkHighScore() } // Dialog to ask the user to enter their name. - QDialog * hsn = new QDialog (view, "hsNameDialog", TRUE, + TQDialog * hsn = new TQDialog (view, "hsNameDialog", TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title); int margin = 10; int spacing = 10; - QVBoxLayout * mainLayout = new QVBoxLayout (hsn, margin, spacing); + TQVBoxLayout * mainLayout = new TQVBoxLayout (hsn, margin, spacing); - QLabel * hsnMessage = new QLabel ( + TQLabel * hsnMessage = new TQLabel ( i18n("<b>Congratulations !!!</b> " "You have achieved a high " "score in this game. Please enter your name so that " "it may be enshrined in the KGoldrunner Hall of Fame."), hsn); - QLineEdit * hsnUser = new QLineEdit (hsn); - QPushButton * OK = new KPushButton (KStdGuiItem::ok(), hsn); + TQLineEdit * hsnUser = new TQLineEdit (hsn); + TQPushButton * OK = new KPushButton (KStdGuiItem::ok(), hsn); mainLayout-> addWidget (hsnMessage); mainLayout-> addWidget (hsnUser); @@ -1014,14 +1014,14 @@ void KGrGame::checkHighScore() hsn-> setCaption (i18n("Save High Score")); - QPoint p = view->mapToGlobal (QPoint (0,0)); + QPoint p = view->mapToGlobal (TQPoint (0,0)); hsn-> move (p.x() + 50, p.y() + 50); OK-> setAccel (Key_Return); hsnUser-> setFocus(); // Set the keyboard input on. - connect (hsnUser, SIGNAL (returnPressed ()), hsn, SLOT (accept ())); - connect (OK, SIGNAL (clicked ()), hsn, SLOT (accept ())); + connect (hsnUser, TQT_SIGNAL (returnPressed ()), hsn, TQT_SLOT (accept ())); + connect (OK, TQT_SIGNAL (clicked ()), hsn, TQT_SLOT (accept ())); while (TRUE) { hsn->exec(); @@ -1034,12 +1034,12 @@ void KGrGame::checkHighScore() delete hsn; - QDate today = QDate::currentDate(); - QString hsDate; + TQDate today = TQDate::currentDate(); + TQString hsDate; #ifdef QT3 - QString day = today.shortDayName(today.dayOfWeek()); + TQString day = today.shortDayName(today.dayOfWeek()); #else - QString day = today.dayName(today.dayOfWeek()); + TQString day = today.dayName(today.dayOfWeek()); #endif hsDate = hsDate.sprintf ("%s %04d-%02d-%02d", @@ -1100,7 +1100,7 @@ void KGrGame::checkHighScore() high2.close(); - QDir dir; + TQDir dir; dir.rename (high2.name(), userDataDir + "hi_" + collection->prefix + ".dat", TRUE); KGrMessage::information (view, i18n("Save High Score"), @@ -1124,8 +1124,8 @@ void KGrGame::showHighScores() int n = 0; // Look for user's high-score file or for a released high-score file. - QFile high1 (userDataDir + "hi_" + collection->prefix + ".dat"); - QDataStream s1; + TQFile high1 (userDataDir + "hi_" + collection->prefix + ".dat"); + TQDataStream s1; if (! high1.exists()) { high1.setName (systemDataDir + "hi_" + collection->prefix + ".dat"); @@ -1138,25 +1138,25 @@ void KGrGame::showHighScores() } if (! high1.open (IO_ReadOnly)) { - QString high1_name = high1.name(); + TQString high1_name = high1.name(); KGrMessage::information (view, i18n("Show High Scores"), i18n("Cannot open file '%1' for read-only.").arg(high1_name)); return; } - QDialog * hs = new QDialog (view, "hsDialog", TRUE, + TQDialog * hs = new TQDialog (view, "hsDialog", TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title); int margin = 10; int spacing = 10; - QVBoxLayout * mainLayout = new QVBoxLayout (hs, margin, spacing); + TQVBoxLayout * mainLayout = new TQVBoxLayout (hs, margin, spacing); - QLabel * hsHeader = new QLabel (i18n ( + TQLabel * hsHeader = new TQLabel (i18n ( "<center><h2>KGoldrunner Hall of Fame</h2></center><br>" "<center><h3>\"%1\" Game</h3></center>") .arg(collection->name), hs); - QLabel * hsColHeader = new QLabel ( + TQLabel * hsColHeader = new TQLabel ( i18n(" Name " "Level Score Date"), hs); #ifdef KGR_PORTABLE @@ -1168,11 +1168,11 @@ void KGrGame::showHighScores() f. setBold (TRUE); hsColHeader-> setFont (f); - QLabel * hsLine [10]; + TQLabel * hsLine [10]; - QHBox * buttons = new QHBox (hs); + TQHBox * buttons = new TQHBox (hs); buttons-> setSpacing (spacing); - QPushButton * OK = new KPushButton (KStdGuiItem::close(), buttons); + TQPushButton * OK = new KPushButton (KStdGuiItem::close(), buttons); mainLayout-> addWidget (hsHeader); mainLayout-> addWidget (hsColHeader); @@ -1197,13 +1197,13 @@ void KGrGame::showHighScores() s1 >> prevScore; s1 >> prevDate; - // QString::sprintf expects UTF-8 encoding in its string arguments, so + // TQString::sprintf expects UTF-8 encoding in its string arguments, so // prevUser has been saved on file as UTF-8 to allow non=ASCII chars // in the user's name (e.g. "Krüger" is encoded as "Krüger" in UTF-8). line = line.sprintf (hsFormat, n+1, prevUser, prevLevel, prevScore, prevDate); - hsLine [n] = new QLabel (line, hs); + hsLine [n] = new TQLabel (line, hs); hsLine [n]->setFont (f); mainLayout->addWidget (hsLine [n]); @@ -1212,18 +1212,18 @@ void KGrGame::showHighScores() n++; } - QFrame * separator = new QFrame (hs); - separator->setFrameStyle (QFrame::HLine + QFrame::Sunken); + TQFrame * separator = new TQFrame (hs); + separator->setFrameStyle (TQFrame::HLine + TQFrame::Sunken); mainLayout->addWidget (separator); OK-> setMaximumWidth (100); mainLayout-> addWidget (buttons); - QPoint p = view->mapToGlobal (QPoint (0,0)); + QPoint p = view->mapToGlobal (TQPoint (0,0)); hs-> move (p.x() + 50, p.y() + 50); // Start up the dialog box. - connect (OK, SIGNAL (clicked ()), hs, SLOT (accept ())); + connect (OK, TQT_SIGNAL (clicked ()), hs, TQT_SLOT (accept ())); hs-> exec(); delete hs; @@ -1302,7 +1302,7 @@ void KGrGame::showEnemyState(int enemyId) void KGrGame::showObjectState() { - QPoint p; + TQPoint p; int i, j; KGrObject * myObject; @@ -1439,7 +1439,7 @@ void KGrGame::updateNext() void KGrGame::loadEditLevel (int lev) { int i, j; - QFile levelFile; + TQFile levelFile; if (! openLevelFile (lev, levelFile)) return; @@ -1461,8 +1461,8 @@ void KGrGame::loadEditLevel (int lev) // Read a newline character, then read in the level name and hint (if any). int c = levelFile.getch(); - QCString levelHintC = ""; - QCString levelNameC = ""; + TQCString levelHintC = ""; + TQCString levelNameC = ""; levelHint = ""; levelName = ""; i = 1; @@ -1484,11 +1484,11 @@ void KGrGame::loadEditLevel (int lev) // to Unicode (eg. ü to ü). int len = levelHintC.length(); if (len > 0) - levelHint = QString::fromUtf8((const char *) levelHintC.left(len-1)); + levelHint = TQString::fromUtf8((const char *) levelHintC.left(len-1)); len = levelNameC.length(); if (len > 0) - levelName = QString::fromUtf8((const char *) levelNameC); + levelName = TQString::fromUtf8((const char *) levelNameC); editObj = BRICK; // Reset default object. levelFile.close (); @@ -1509,7 +1509,7 @@ void KGrGame::editNameAndHint() // Run a dialog box to create/edit the level name and hint. KGrNHDialog * nh = new KGrNHDialog (levelName, levelHint, view, "NHDialog"); - if (nh->exec() == QDialog::Accepted) { + if (nh->exec() == TQDialog::Accepted) { levelName = nh->getName(); levelHint = nh->getHint(); shouldSave = TRUE; @@ -1525,7 +1525,7 @@ bool KGrGame::saveLevelFile() int selectedLevel = level; int i, j; - QString filePath; + TQString filePath; if (! editMode) { KGrMessage::information (view, i18n("Save Level"), @@ -1555,7 +1555,7 @@ bool KGrGame::saveLevelFile() // Set the name of the output file. filePath = getFilePath (owner, collection, selectedLevel); - QFile levelFile (filePath); + TQFile levelFile (filePath); if ((action == SL_SAVE) && (n == N) && (selectedLevel == level)) { // This is a normal edit: the old file is to be re-written. @@ -1597,7 +1597,7 @@ bool KGrGame::saveLevelFile() levelFile.putch ('\n'); // Save the level name, changing non-ASCII chars to UTF-8 (eg. ü to ü). - QCString levelNameC = levelName.utf8(); + TQCString levelNameC = levelName.utf8(); int len1 = levelNameC.length(); if (len1 > 0) { for (i = 0; i < len1; i++) @@ -1606,7 +1606,7 @@ bool KGrGame::saveLevelFile() } // Save the level hint, changing non-ASCII chars to UTF-8 (eg. ü to ü). - QCString levelHintC = levelHint.utf8(); + TQCString levelHintC = levelHint.utf8(); int len2 = levelHintC.length(); char ch = '\0'; @@ -1682,9 +1682,9 @@ void KGrGame::moveLevelFile () } } - QDir dir; - QString filePath1; - QString filePath2; + TQDir dir; + TQString filePath1; + TQString filePath2; // Save the "fromN" file under a temporary name. filePath1 = getFilePath (USER, collections.at(fromC), fromL); @@ -1752,12 +1752,12 @@ void KGrGame::deleteLevelFile () if (lev == 0) return; - QString filePath; + TQString filePath; // Set the name of the file to be deleted. int n = collnIndex; filePath = getFilePath (USER, collections.at(n), lev); - QFile levelFile (filePath); + TQFile levelFile (filePath); // Delete the file for the selected collection and level. if (levelFile.exists()) { @@ -1828,10 +1828,10 @@ void KGrGame::editCollection (int action) KGrECDialog * ec = new KGrECDialog (action, n, collections, view, "editGameDialog"); - while (ec->exec() == QDialog::Accepted) { // Loop until valid. + while (ec->exec() == TQDialog::Accepted) { // Loop until valid. // Validate the collection details. - QString ecName = ec->getName(); + TQString ecName = ec->getName(); int len = ecName.length(); if (len == 0) { KGrMessage::information (view, i18n("Save Game Info"), @@ -1839,7 +1839,7 @@ void KGrGame::editCollection (int action) continue; } - QString ecPrefix = ec->getPrefix(); + TQString ecPrefix = ec->getPrefix(); if ((action == SL_CR_GAME) || (collections.at(n)->nLevels <= 0)) { // The filename prefix could have been entered, so validate it. len = ecPrefix.length(); @@ -2030,19 +2030,19 @@ void KGrGame::setEditableCell (int i, int j, char type) void KGrGame::showEditLevel() { // Disconnect play-mode slots from signals from "view". - disconnect (view, SIGNAL(mouseClick(int)), 0, 0); - disconnect (view, SIGNAL(mouseLetGo(int)), 0, 0); + disconnect (view, TQT_SIGNAL(mouseClick(int)), 0, 0); + disconnect (view, TQT_SIGNAL(mouseLetGo(int)), 0, 0); // Connect edit-mode slots to signals from "view". - connect (view, SIGNAL(mouseClick(int)), SLOT(doEdit(int))); - connect (view, SIGNAL(mouseLetGo(int)), SLOT(endEdit(int))); + connect (view, TQT_SIGNAL(mouseClick(int)), TQT_SLOT(doEdit(int))); + connect (view, TQT_SIGNAL(mouseLetGo(int)), TQT_SLOT(endEdit(int))); } bool KGrGame::reNumberLevels (int cIndex, int first, int last, int inc) { int i, n, step; - QDir dir; - QString file1, file2; + TQDir dir; + TQString file1, file2; if (inc > 0) { i = last; @@ -2083,7 +2083,7 @@ void KGrGame::setLevel (int lev) void KGrGame::doEdit (int button) { // Mouse button down: start making changes. - QPoint p; + TQPoint p; int i, j; p = view->getMousePos (); @@ -2106,7 +2106,7 @@ void KGrGame::doEdit (int button) void KGrGame::endEdit (int button) { // Mouse button released: finish making changes. - QPoint p; + TQPoint p; int i, j; p = view->getMousePos (); @@ -2144,7 +2144,7 @@ int KGrGame::selectLevel (int action, int requestedLevel) // Create and run a modal dialog box to select a game and level. KGrSLDialog * sl = new KGrSLDialog (action, requestedLevel, collnIndex, collections, this, view, "levelDialog"); - while (sl->exec() == QDialog::Accepted) { + while (sl->exec() == TQDialog::Accepted) { selectedGame = sl->selectedGame(); selectedLevel = 0; // In case the selection is invalid. if (collections.at(selectedGame)->owner == SYSTEM) { @@ -2226,26 +2226,26 @@ bool KGrGame::ownerOK (Owner o) /********************** CLASS TO DISPLAY THUMBNAIL ***********************/ /******************************************************************************/ -KGrThumbNail::KGrThumbNail (QWidget * parent, const char * name) - : QFrame (parent, name) +KGrThumbNail::KGrThumbNail (TQWidget * parent, const char * name) + : TQFrame (parent, name) { // Let the parent do all the work. We need a class here so that - // QFrame::drawContents (QPainter *) can be re-implemented and + // TQFrame::drawContents (TQPainter *) can be re-implemented and // the thumbnail can be automatically re-painted when required. } -QColor KGrThumbNail::backgroundColor = QColor ("#dddddd"); -QColor KGrThumbNail::brickColor = QColor ("#ff0000"); -QColor KGrThumbNail::ladderColor = QColor ("#ddcc00"); -QColor KGrThumbNail::poleColor = QColor ("#aa7700"); +TQColor KGrThumbNail::backgroundColor = TQColor ("#dddddd"); +TQColor KGrThumbNail::brickColor = TQColor ("#ff0000"); +TQColor KGrThumbNail::ladderColor = TQColor ("#ddcc00"); +TQColor KGrThumbNail::poleColor = TQColor ("#aa7700"); -void KGrThumbNail::setFilePath (QString & fp, QLabel * sln) +void KGrThumbNail::setFilePath (TQString & fp, TQLabel * sln) { filePath = fp; // Keep safe copies of file lName = sln; // path and level name field. } -void KGrThumbNail::drawContents (QPainter * p) // Activated via "paintEvent". +void KGrThumbNail::drawContents (TQPainter * p) // Activated via "paintEvent". { QFile openFile; QPen pen = p->pen(); @@ -2259,7 +2259,7 @@ void KGrThumbNail::drawContents (QPainter * p) // Activated via "paintEvent". openFile.setName (filePath); if ((! openFile.exists()) || (! openFile.open (IO_ReadOnly))) { // There is no file, so fill the thumbnail with "FREE" cells. - p->drawRect (QRect(fw, fw, FIELDWIDTH*n, FIELDHEIGHT*n)); + p->drawRect (TQRect(fw, fw, FIELDWIDTH*n, FIELDHEIGHT*n)); return; } @@ -2301,7 +2301,7 @@ void KGrThumbNail::drawContents (QPainter * p) // Activated via "paintEvent". // For a nugget, add just a vertical touch of yellow (2-3 pixels). if (obj == NUGGET) { int k = (n/2)+fw; - // pen.setColor (QColor("#ffff00")); + // pen.setColor (TQColor("#ffff00")); pen.setColor (ladderColor); p->setPen (pen); p->drawLine (i*n+k, j*n+k, i*n+k, j*n+(n-1)+fw); @@ -2311,7 +2311,7 @@ void KGrThumbNail::drawContents (QPainter * p) // Activated via "paintEvent". // Absorb a newline character, then read in the level name (if any). int c = openFile.getch(); - QCString s = ""; + TQCString s = ""; while ((c = openFile.getch()) != EOF) { if (c == '\n') // Level name is on one line. break; @@ -2330,7 +2330,7 @@ void KGrThumbNail::drawContents (QPainter * p) // Activated via "paintEvent". /******************************************************************************/ // NOTE: Macros "myStr" and "myChar", defined in "kgrgame.h", are used -// to smooth out differences between Qt 1 and Qt2 QString classes. +// to smooth out differences between Qt 1 and Qt2 TQString classes. bool KGrGame::initCollections () { @@ -2381,9 +2381,9 @@ void KGrGame::mapCollections() } const QFileInfoList * files = d.entryInfoList - (colln->prefix + "???.grl", QDir::Files, QDir::Name); + (colln->prefix + "???.grl", TQDir::Files, TQDir::Name); QFileInfoListIterator i (* files); - QFileInfo * file; + TQFileInfo * file; if ((files->count() <= 0) && (colln->nLevels > 0)) { KGrMessage::information (view, i18n("Check Games & Levels"), @@ -2403,7 +2403,7 @@ void KGrGame::mapCollections() while (TRUE) { // Work out what the file name should be, based on the level no. - fileName2.setNum (lev); // Convert to QString. + fileName2.setNum (lev); // Convert to TQString. fileName2 = fileName2.rightJustify (3,'0'); // Add zeros. fileName2.append (".grl"); // Add level-suffix. fileName2.prepend (colln->prefix); // Add colln. prefix. @@ -2450,7 +2450,7 @@ bool KGrGame::loadCollections (Owner o) filePath = ((o == SYSTEM)? systemDataDir : userDataDir) + "games.dat"; - QFile c (filePath); + TQFile c (filePath); if (! c.exists()) { // If the user has not yet created a collection, don't worry. @@ -2506,7 +2506,7 @@ bool KGrGame::loadCollections (Owner o) collections.append (new KGrCollection (o, i18n((const char *) name), // Translate now. prefix, settings, nLevels, - QString::fromUtf8((const char *) line))); + TQString::fromUtf8((const char *) line))); name = ""; prefix = ""; settings = ' '; nLevels = -1; } else if (ch >= 0) { @@ -2537,7 +2537,7 @@ bool KGrGame::saveCollections (Owner o) filePath = ((o == SYSTEM)? systemDataDir : userDataDir) + "games.dat"; - QFile c (filePath); + TQFile c (filePath); // Open the output file. if (! c.open (IO_WriteOnly)) { @@ -2563,7 +2563,7 @@ bool KGrGame::saveCollections (Owner o) len = colln->about.length(); if (len > 0) { - QCString aboutC = colln->about.utf8(); + TQCString aboutC = colln->about.utf8(); len = aboutC.length(); // Might be longer now. for (i = 0; i < len; i++) { ch = aboutC[i]; @@ -2588,7 +2588,7 @@ bool KGrGame::saveCollections (Owner o) /********************** WORD-WRAPPED MESSAGE BOX ************************/ /******************************************************************************/ -void KGrGame::myMessage (QWidget * parent, QString title, QString contents) +void KGrGame::myMessage (TQWidget * parent, TQString title, TQString contents) { // Halt the game while the message is displayed. setMessageFreeze (TRUE); @@ -2603,8 +2603,8 @@ void KGrGame::myMessage (QWidget * parent, QString title, QString contents) /*********************** COLLECTION DATA CLASS **************************/ /******************************************************************************/ -KGrCollection::KGrCollection (Owner o, const QString & n, const QString & p, - const char s, int nl, const QString & a) +KGrCollection::KGrCollection (Owner o, const TQString & n, const TQString & p, + const char s, int nl, const TQString & a) { // Holds information about a collection of KGoldrunner levels (i.e. a game). owner = o; name = n; prefix = p; settings = s; nLevels = nl; about = a; diff --git a/kgoldrunner/src/kgrgame.h b/kgoldrunner/src/kgrgame.h index 86144ef6..18003e3c 100644 --- a/kgoldrunner/src/kgrgame.h +++ b/kgoldrunner/src/kgrgame.h @@ -12,29 +12,29 @@ // Macros to smooth out the differences between Qt 1 and Qt 2 classes. // -// "myStr" converts a QString object to a C language "char*" character string. -// "myChar" extracts a C language character (type "char") from a QString object. +// "myStr" converts a TQString object to a C language "char*" character string. +// "myChar" extracts a C language character (type "char") from a TQString object. // "endData" checks for an end-of-file condition. // #define myStr latin1 #define myChar(i) at((i)).latin1() #define endData atEnd -#include <qobject.h> +#include <tqobject.h> #ifdef QT3 -#include <qptrlist.h> +#include <tqptrlist.h> #else -#include <qlist.h> +#include <tqlist.h> #endif -#include <qstring.h> +#include <tqstring.h> -#include <qdir.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qdatastream.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqdatastream.h> -#include <qcolor.h> +#include <tqcolor.h> /** Sets up games and levels in KGoldrunner and controls the play. @@ -51,7 +51,7 @@ class KGrGame : public QObject { Q_OBJECT public: - KGrGame (KGrCanvas * theView, QString theSystemDir, QString theUserDir); + KGrGame (KGrCanvas * theView, TQString theSystemDir, TQString theUserDir); ~KGrGame(); bool initCollections(); @@ -71,7 +71,7 @@ public: void setEditObj (char newEditObj); // Set object for editor to paint. - QString getFilePath (Owner o, KGrCollection * colln, int lev); + TQString getFilePath (Owner o, KGrCollection * colln, int lev); public slots: void startLevelOne(); // Start any game from level 1. @@ -117,7 +117,7 @@ private slots: private: void setBlankLevel (bool playable); int loadLevel (int levelNo); - bool openLevelFile (int levelNo, QFile & openlevel); + bool openLevelFile (int levelNo, TQFile & openlevel); void changeObject (unsigned char kind, int i, int j); void createObject (KGrObject *o, char picType, int x, int y); void setTimings (); @@ -155,7 +155,7 @@ private: int startI, startJ; // The hero's starting position. #ifdef QT3 - QPtrList<KGrEnemy> enemies; // The list of enemies. + TQPtrList<KGrEnemy> enemies; // The list of enemies. #else QList<KGrEnemy> enemies; // The list of enemies. #endif @@ -170,8 +170,8 @@ private: bool modalFreeze; // Stop game during dialog. bool messageFreeze; // Stop game during message. - QTimer * mouseSampler; // Timer for mouse tracking. - QTimer * dyingTimer; // For pause when the hero dies. + TQTimer * mouseSampler; // Timer for mouse tracking. + TQTimer * dyingTimer; // For pause when the hero dies. int lgHighlight; // Row selected in "loadGame()". @@ -230,10 +230,10 @@ private: bool ownerOK (Owner o); // Pixmaps for repainting objects as they are edited. - QPixmap digpix[10]; - QPixmap brickbg, fbrickbg; - QPixmap freebg, nuggetbg, polebg, betonbg, ladderbg, hladderbg; - QPixmap edherobg, edenemybg; + TQPixmap digpix[10]; + TQPixmap brickbg, fbrickbg; + TQPixmap freebg, nuggetbg, polebg, betonbg, ladderbg, hladderbg; + TQPixmap edherobg, edenemybg; private slots: void doEdit(int); // For mouse-click when in edit-mode. @@ -247,7 +247,7 @@ private: // Note that a collection of KGoldrunner levels is the same thing as a "game". #ifdef QT3 - QPtrList<KGrCollection> collections; // List of ALL collections. + TQPtrList<KGrCollection> collections; // List of ALL collections. #else QList<KGrCollection> collections; // List of ALL collections. #endif @@ -264,7 +264,7 @@ private: /********************** WORD-WRAPPED MESSAGE BOX ************************/ /******************************************************************************/ - void myMessage (QWidget * parent, QString title, QString contents); + void myMessage (TQWidget * parent, TQString title, TQString contents); }; /******************************************************************************/ @@ -274,18 +274,18 @@ private: class KGrThumbNail : public QFrame { public: - KGrThumbNail (QWidget *parent = 0, const char *name = 0); - void setFilePath (QString &, QLabel *); // Set filepath and name field. + KGrThumbNail (TQWidget *parent = 0, const char *name = 0); + void setFilePath (TQString &, TQLabel *); // Set filepath and name field. - static QColor backgroundColor; - static QColor brickColor; - static QColor ladderColor; - static QColor poleColor; + static TQColor backgroundColor; + static TQColor brickColor; + static TQColor ladderColor; + static TQColor poleColor; protected: - void drawContents (QPainter *); // Draw a preview of a level. - QString filePath; - QLabel * lName; + void drawContents (TQPainter *); // Draw a preview of a level. + TQString filePath; + TQLabel * lName; }; /******************************************************************************/ @@ -296,8 +296,8 @@ protected: class KGrCollection { public: - KGrCollection (Owner o, const QString & n, const QString & p, - const char s, int nl, const QString & a); + KGrCollection (Owner o, const TQString & n, const TQString & p, + const char s, int nl, const TQString & a); Owner owner; // Collection owner: "System" or "User". QString name; // Collection name. QString prefix; // Collection's filename prefix. diff --git a/kgoldrunner/src/kgrobject.cpp b/kgoldrunner/src/kgrobject.cpp index 948fd540..277dbc6a 100644 --- a/kgoldrunner/src/kgrobject.cpp +++ b/kgoldrunner/src/kgrobject.cpp @@ -105,8 +105,8 @@ KGrBrick::KGrBrick (char objType, int i, int j, KGrCanvas * view) dig_counter = 0; holeFrozen = FALSE; iamA = BRICK; - timer = new QTimer (this); - connect (timer, SIGNAL (timeout ()), SLOT (timeDone ())); + timer = new TQTimer (this); + connect (timer, TQT_SIGNAL (timeout ()), TQT_SLOT (timeDone ())); } void KGrBrick::dig (void) diff --git a/kgoldrunner/src/kgrobject.h b/kgoldrunner/src/kgrobject.h index a48eba88..cc262d0d 100644 --- a/kgoldrunner/src/kgrobject.h +++ b/kgoldrunner/src/kgrobject.h @@ -21,7 +21,7 @@ // Obsolete - #include <iostream.h> #include <iostream> -#include <qtimer.h> +#include <tqtimer.h> #include <stdlib.h> // for random class KGrCanvas; @@ -91,7 +91,7 @@ private: int dig_counter; int hole_counter; bool holeFrozen; - QTimer *timer; + TQTimer *timer; }; class KGrHladder : public KGrFree diff --git a/kjumpingcube/kcubeboxwidget.cpp b/kjumpingcube/kcubeboxwidget.cpp index 98f305d9..bca13210 100644 --- a/kjumpingcube/kcubeboxwidget.cpp +++ b/kjumpingcube/kcubeboxwidget.cpp @@ -23,15 +23,15 @@ #include <kapplication.h> #include <kconfig.h> -#include <qlayout.h> -#include <qtimer.h> +#include <tqlayout.h> +#include <tqtimer.h> #include <assert.h> #include <kcursor.h> #include "prefs.h" -KCubeBoxWidget::KCubeBoxWidget(const int d,QWidget *parent,const char *name) - : QWidget(parent,name), +KCubeBoxWidget::KCubeBoxWidget(const int d,TQWidget *parent,const char *name) + : TQWidget(parent,name), CubeBoxBase<KCubeWidget>(d) { init(); @@ -39,8 +39,8 @@ KCubeBoxWidget::KCubeBoxWidget(const int d,QWidget *parent,const char *name) -KCubeBoxWidget::KCubeBoxWidget(CubeBox& box,QWidget *parent,const char *name) - :QWidget(parent,name), +KCubeBoxWidget::KCubeBoxWidget(CubeBox& box,TQWidget *parent,const char *name) + :TQWidget(parent,name), CubeBoxBase<KCubeWidget>(box.dim()) { init(); @@ -57,8 +57,8 @@ KCubeBoxWidget::KCubeBoxWidget(CubeBox& box,QWidget *parent,const char *name) -KCubeBoxWidget::KCubeBoxWidget(const KCubeBoxWidget& box,QWidget *parent,const char *name) - :QWidget(parent,name), +KCubeBoxWidget::KCubeBoxWidget(const KCubeBoxWidget& box,TQWidget *parent,const char *name) + :TQWidget(parent,name), CubeBoxBase<KCubeWidget>(box.dim()) { init(); @@ -198,7 +198,7 @@ void KCubeBoxWidget::getHint() cubes[row][column]->showHint(); } -void KCubeBoxWidget::setColor(Player player,QPalette color) +void KCubeBoxWidget::setColor(Player player,TQPalette color) { KCubeWidget::setColor((Cube::Owner)player,color); @@ -255,9 +255,9 @@ void KCubeBoxWidget::saveProperties(KConfigBase* config) // save current player config->writeEntry("onTurn",(int)currentPlayer); - QStrList list; + TQStrList list; list.setAutoDelete(true); - QString owner, value, key; + TQString owner, value, key; int cubeDim=dim(); for(int row=0; row < cubeDim ; row++) @@ -277,9 +277,9 @@ void KCubeBoxWidget::saveProperties(KConfigBase* config) void KCubeBoxWidget::readProperties(KConfigBase* config) { - QStrList list; + TQStrList list; list.setAutoDelete(true); - QString owner, value, key; + TQString owner, value, key; setDim(config->readNumEntry("CubeDim",5)); int cubeDim=dim(); @@ -413,7 +413,7 @@ int KCubeBoxWidget::skill() const return brain.skill(); } -QPalette KCubeBoxWidget::color(Player forWhom) +TQPalette KCubeBoxWidget::color(Player forWhom) { return KCubeWidget::color((KCubeWidget::Owner)forWhom); } @@ -429,18 +429,18 @@ void KCubeBoxWidget::init() currentPlayer=One; moveDelay=100; - moveTimer=new QTimer(this); + moveTimer=new TQTimer(this); computerPlOne=false; computerPlTwo=false; KCubeWidget::enableClicks(true); loadSettings(); - connect(moveTimer,SIGNAL(timeout()),SLOT(nextLoopStep())); - connect(this,SIGNAL(startedThinking()),SLOT(setWaitCursor())); - connect(this,SIGNAL(stoppedThinking()),SLOT(setNormalCursor())); - connect(this,SIGNAL(startedMoving()),SLOT(setWaitCursor())); - connect(this,SIGNAL(stoppedMoving()),SLOT(setNormalCursor())); - connect(this,SIGNAL(playerWon(int)),SLOT(stopActivities())); + connect(moveTimer,TQT_SIGNAL(timeout()),TQT_SLOT(nextLoopStep())); + connect(this,TQT_SIGNAL(startedThinking()),TQT_SLOT(setWaitCursor())); + connect(this,TQT_SIGNAL(stoppedThinking()),TQT_SLOT(setNormalCursor())); + connect(this,TQT_SIGNAL(startedMoving()),TQT_SLOT(setWaitCursor())); + connect(this,TQT_SIGNAL(stoppedMoving()),TQT_SLOT(setNormalCursor())); + connect(this,TQT_SIGNAL(playerWon(int)),TQT_SLOT(stopActivities())); setNormalCursor(); @@ -453,7 +453,7 @@ void KCubeBoxWidget::initCubes() int i,j; // create Layout - layout=new QGridLayout(this,s,s); + layout=new TQGridLayout(this,s,s); for(i=0;i<s;i++) @@ -476,8 +476,8 @@ void KCubeBoxWidget::initCubes() cubes[i][j]->setCoordinates(i,j); layout->addWidget(cubes[i][j],i,j); cubes[i][j]->show(); - connect(cubes[i][j],SIGNAL(clicked(int,int,bool)),SLOT(stopHint())); - connect(cubes[i][j],SIGNAL(clicked(int,int,bool)),SLOT(checkClick(int,int,bool))); + connect(cubes[i][j],TQT_SIGNAL(clicked(int,int,bool)),TQT_SLOT(stopHint())); + connect(cubes[i][j],TQT_SIGNAL(clicked(int,int,bool)),TQT_SLOT(checkClick(int,int,bool))); } // initialize cubes @@ -504,9 +504,9 @@ void KCubeBoxWidget::initCubes() } -QSize KCubeBoxWidget::sizeHint() const +TQSize KCubeBoxWidget::sizeHint() const { - return QSize(400,400); + return TQSize(400,400); } void KCubeBoxWidget::deleteCubes() diff --git a/kjumpingcube/kcubeboxwidget.h b/kjumpingcube/kcubeboxwidget.h index ff2f4ac0..ca532244 100644 --- a/kjumpingcube/kcubeboxwidget.h +++ b/kjumpingcube/kcubeboxwidget.h @@ -25,7 +25,7 @@ #include "cubeboxbase.h" #include "kcubewidget.h" #include "brain.h" -#include <qwidget.h> +#include <tqwidget.h> class QGridLayout; class CubeBox; @@ -48,14 +48,14 @@ struct Loop }; -class KCubeBoxWidget : public QWidget , public CubeBoxBase<KCubeWidget> +class KCubeBoxWidget : public TQWidget , public CubeBoxBase<KCubeWidget> { Q_OBJECT public: - KCubeBoxWidget(const int dim=1,QWidget *parent=0,const char *name=0); + KCubeBoxWidget(const int dim=1,TQWidget *parent=0,const char *name=0); - KCubeBoxWidget(CubeBox& box, QWidget *parent=0,const char *name=0); - KCubeBoxWidget(const KCubeBoxWidget& box,QWidget *parent=0,const char *name=0); + KCubeBoxWidget(CubeBox& box, TQWidget *parent=0,const char *name=0); + KCubeBoxWidget(const KCubeBoxWidget& box,TQWidget *parent=0,const char *name=0); virtual ~KCubeBoxWidget(); KCubeBoxWidget& operator= (CubeBox& box); @@ -75,7 +75,7 @@ public: * @param forWhom for which player the color should be set * @param color color for player one */ - void setColor(Player forWhom,QPalette color); + void setColor(Player forWhom,TQPalette color); /** * sets number of Cubes in a row/column to 'size'. */ @@ -100,7 +100,7 @@ public: bool isMoving() const; /** returns current Color for Player ´forWhom´ */ - QPalette color(Player forWhom); + TQPalette color(Player forWhom); /** * checks if 'player' is a computerplayer an computes next move if TRUE @@ -130,7 +130,7 @@ signals: void stoppedThinking(); protected: - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; virtual void deleteCubes(); virtual void initCubes(); @@ -146,11 +146,11 @@ protected slots: private: void init(); - QGridLayout *layout; + TQGridLayout *layout; CubeBox *undoBox; Brain brain; - QTimer *moveTimer; + TQTimer *moveTimer; int moveDelay; Loop loop; /** */ diff --git a/kjumpingcube/kcubewidget.cpp b/kjumpingcube/kcubewidget.cpp index f23e3cce..d9500084 100644 --- a/kjumpingcube/kcubewidget.cpp +++ b/kjumpingcube/kcubewidget.cpp @@ -21,8 +21,8 @@ **************************************************************************** */ #include "kcubewidget.h" -#include <qpainter.h> -#include <qtimer.h> +#include <tqpainter.h> +#include <tqtimer.h> #include <kapplication.h> #include <kdebug.h> @@ -31,8 +31,8 @@ ** static elements ** ** ****************************************************** */ bool KCubeWidget::_clicksAllowed=true; -QPalette KCubeWidget::color1; -QPalette KCubeWidget::color2; +TQPalette KCubeWidget::color1; +TQPalette KCubeWidget::color2; void KCubeWidget::enableClicks(bool flag) @@ -41,7 +41,7 @@ void KCubeWidget::enableClicks(bool flag) } -void KCubeWidget::setColor(Owner forWhom, QPalette newPalette) +void KCubeWidget::setColor(Owner forWhom, TQPalette newPalette) { if(forWhom==One) { @@ -53,9 +53,9 @@ void KCubeWidget::setColor(Owner forWhom, QPalette newPalette) } } -QPalette KCubeWidget::color(Owner forWhom) +TQPalette KCubeWidget::color(Owner forWhom) { - QPalette color; + TQPalette color; if(forWhom==One) { color=color1; @@ -73,9 +73,9 @@ QPalette KCubeWidget::color(Owner forWhom) ** public functions ** ** ****************************************************** */ -KCubeWidget::KCubeWidget(QWidget* parent,const char* name +KCubeWidget::KCubeWidget(TQWidget* parent,const char* name ,Owner owner,int value,int max) - : QFrame(parent,name), + : TQFrame(parent,name), Cube(owner,value,max) { setFrameStyle(Panel|Raised); @@ -86,9 +86,9 @@ KCubeWidget::KCubeWidget(QWidget* parent,const char* name //initialize hintTimer // will be automatically destroyed by the parent - hintTimer = new QTimer(this); + hintTimer = new TQTimer(this); hintCounter=0; - connect(hintTimer,SIGNAL(timeout()),SLOT(hint())); + connect(hintTimer,TQT_SIGNAL(timeout()),TQT_SLOT(hint())); setPalette(kapp->palette()); @@ -234,7 +234,7 @@ void KCubeWidget::hint() ** Event handler ** ** ****************************************************** */ -void KCubeWidget::mouseReleaseEvent(QMouseEvent *e) +void KCubeWidget::mouseReleaseEvent(TQMouseEvent *e) { // only accept click if it was inside this cube if(e->x()< 0 || e->x() > width() || e->y() < 0 || e->y() > height()) @@ -249,19 +249,19 @@ void KCubeWidget::mouseReleaseEvent(QMouseEvent *e) -void KCubeWidget::drawContents(QPainter *painter) +void KCubeWidget::drawContents(TQPainter *painter) { - QRect contents=contentsRect(); - QPixmap buffer(contents.size()); + TQRect contents=contentsRect(); + TQPixmap buffer(contents.size()); buffer.fill(this,contents.topLeft()); - QPainter *p=new QPainter; + TQPainter *p=new QPainter; p->begin(&buffer); int h=contents.height(); int w=contents.width(); int circleSize=(h<w?h:w)/7; int points=value(); - QBrush brush("black"); - QPen pen("black"); + TQBrush brush("black"); + TQPen pen("black"); p->setBrush(brush); p->setPen(pen); switch(points) @@ -333,7 +333,7 @@ void KCubeWidget::drawContents(QPainter *painter) default: kdDebug() << "cube had value " << points << endl; - QString s; + TQString s; s.sprintf("%d",points); p->drawText(w/2,h/2,s); break; diff --git a/kjumpingcube/kcubewidget.h b/kjumpingcube/kcubewidget.h index f0d8d8cd..463a7d89 100644 --- a/kjumpingcube/kcubewidget.h +++ b/kjumpingcube/kcubewidget.h @@ -22,7 +22,7 @@ #ifndef KCUBEWIDGET_H #define KCUBEWIDGET_H -#include <qframe.h> +#include <tqframe.h> #include "cube.h" class QPalette; @@ -32,13 +32,13 @@ class QTimer; /** * */ -class KCubeWidget : public QFrame , public Cube +class KCubeWidget : public TQFrame , public Cube { Q_OBJECT public: /** constructs a new KCubeWidget*/ - KCubeWidget(QWidget* parent=0,const char* name=0 + KCubeWidget(TQWidget* parent=0,const char* name=0 ,Owner owner=Cube::Nobody,int value=1,int max=0); virtual ~KCubeWidget(); @@ -74,8 +74,8 @@ public: /** enables or disables possibility to click a cube*/ static void enableClicks(bool flag); - static void setColor(Owner forWhom, QPalette newPalette); - static QPalette color(Owner forWhom); + static void setColor(Owner forWhom, TQPalette newPalette); + static TQPalette color(Owner forWhom); public slots: /** resets the Cube to default values */ @@ -88,10 +88,10 @@ signals: protected: /** checks, if mouseclick was inside this cube*/ - virtual void mouseReleaseEvent(QMouseEvent*); + virtual void mouseReleaseEvent(TQMouseEvent*); /** refreshs the contents of the Cube */ - virtual void drawContents(QPainter*); + virtual void drawContents(TQPainter*); @@ -108,11 +108,11 @@ private: int _row; int _column; - QTimer *hintTimer; + TQTimer *hintTimer; static bool _clicksAllowed; - static QPalette color1; - static QPalette color2; + static TQPalette color1; + static TQPalette color2; }; diff --git a/kjumpingcube/kjumpingcube.cpp b/kjumpingcube/kjumpingcube.cpp index 13619d99..f63665af 100644 --- a/kjumpingcube/kjumpingcube.cpp +++ b/kjumpingcube/kjumpingcube.cpp @@ -29,7 +29,7 @@ #include "prefs.h" -#include <qregexp.h> +#include <tqregexp.h> #include <klocale.h> #include <kfiledialog.h> @@ -49,24 +49,24 @@ KJumpingCube::KJumpingCube() : view(new KCubeBoxWidget(5, this, "KCubeBoxWidget")) { - connect(view,SIGNAL(playerChanged(int)),SLOT(changePlayer(int))); - connect(view,SIGNAL(stoppedMoving()),SLOT(disableStop())); - connect(view,SIGNAL(stoppedThinking()),SLOT(disableStop())); - connect(view,SIGNAL(startedMoving()),SLOT(enableStop_Moving())); - connect(view,SIGNAL(startedThinking()),SLOT(enableStop_Thinking())); - connect(view,SIGNAL(playerWon(int)),SLOT(showWinner(int))); + connect(view,TQT_SIGNAL(playerChanged(int)),TQT_SLOT(changePlayer(int))); + connect(view,TQT_SIGNAL(stoppedMoving()),TQT_SLOT(disableStop())); + connect(view,TQT_SIGNAL(stoppedThinking()),TQT_SLOT(disableStop())); + connect(view,TQT_SIGNAL(startedMoving()),TQT_SLOT(enableStop_Moving())); + connect(view,TQT_SIGNAL(startedThinking()),TQT_SLOT(enableStop_Thinking())); + connect(view,TQT_SIGNAL(playerWon(int)),TQT_SLOT(showWinner(int))); // tell the KMainWindow that this is indeed the main widget setCentralWidget(view); // init statusbar - QString s = i18n("Current player:"); + TQString s = i18n("Current player:"); statusBar()->insertItem(s,ID_STATUS_TURN_TEXT, false); statusBar()->changeItem(s,ID_STATUS_TURN_TEXT); statusBar()->setItemAlignment (ID_STATUS_TURN_TEXT, AlignLeft | AlignVCenter); statusBar()->setFixedHeight( statusBar()->sizeHint().height() ); - currentPlayer = new QWidget(this, "currentPlayer"); + currentPlayer = new TQWidget(this, "currentPlayer"); currentPlayer->setFixedWidth(40); statusBar()->addWidget(currentPlayer, ID_STATUS_TURN, false); statusBar()->setItemAlignment(ID_STATUS_TURN, AlignLeft | AlignVCenter); @@ -76,19 +76,19 @@ KJumpingCube::KJumpingCube() } void KJumpingCube::initKAction() { - KStdGameAction::gameNew(this, SLOT(newGame()), actionCollection()); - KStdGameAction::load(this, SLOT(openGame()), actionCollection()); - KStdGameAction::save(this, SLOT(save()), actionCollection()); - KStdGameAction::saveAs(this, SLOT(saveAs()), actionCollection()); - KStdGameAction::quit(this, SLOT(close()), actionCollection()); + KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection()); + KStdGameAction::load(this, TQT_SLOT(openGame()), actionCollection()); + KStdGameAction::save(this, TQT_SLOT(save()), actionCollection()); + KStdGameAction::saveAs(this, TQT_SLOT(saveAs()), actionCollection()); + KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); - hintAction = KStdGameAction::hint(view, SLOT(getHint()), actionCollection()); + hintAction = KStdGameAction::hint(view, TQT_SLOT(getHint()), actionCollection()); stopAction = new KAction(i18n("Stop &Thinking"), "stop", - Qt::Key_Escape, this, SLOT(stop()), actionCollection(), "game_stop"); + Qt::Key_Escape, this, TQT_SLOT(stop()), actionCollection(), "game_stop"); stopAction->setEnabled(false); - undoAction = KStdGameAction::undo(this, SLOT(undo()), actionCollection()); + undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); undoAction->setEnabled(false); - KStdAction::preferences(this, SLOT(showOptions()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(showOptions()), actionCollection()); setupGUI(); } @@ -114,7 +114,7 @@ void KJumpingCube::saveGame(bool saveAs) return; // check filename - QRegExp pattern("*.kjc",true,true); + TQRegExp pattern("*.kjc",true,true); if(!pattern.exactMatch(url.filename())) { url.setFileName( url.filename()+".kjc" ); @@ -122,9 +122,9 @@ void KJumpingCube::saveGame(bool saveAs) if(KIO::NetAccess::exists(url,false,this)) { - QString mes=i18n("The file %1 exists.\n" + TQString mes=i18n("The file %1 exists.\n" "Do you want to overwrite it?").arg(url.url()); - result = KMessageBox::warningContinueCancel(this, mes, QString::null, i18n("Overwrite")); + result = KMessageBox::warningContinueCancel(this, mes, TQString::null, i18n("Overwrite")); if(result==KMessageBox::Cancel) return; } @@ -146,7 +146,7 @@ void KJumpingCube::saveGame(bool saveAs) if(KIO::NetAccess::upload( tempFile.name(),gameURL,this )) { - QString s=i18n("game saved as %1"); + TQString s=i18n("game saved as %1"); s=s.arg(gameURL.url()); statusBar()->message(s,MESSAGE_TIME); } @@ -168,21 +168,21 @@ void KJumpingCube::openGame() return; if(!KIO::NetAccess::exists(url,true,this)) { - QString mes=i18n("The file %1 does not exist!").arg(url.url()); + TQString mes=i18n("The file %1 does not exist!").arg(url.url()); KMessageBox::sorry(this,mes); fileOk=false; } } while(!fileOk); - QString tempFile; + TQString tempFile; if( KIO::NetAccess::download( url, tempFile, this ) ) { KSimpleConfig config(tempFile,true); config.setGroup("KJumpingCube"); if(!config.hasKey("Version")) { - QString mes=i18n("The file %1 isn't a KJumpingCube gamefile!") + TQString mes=i18n("The file %1 isn't a KJumpingCube gamefile!") .arg(url.url()); KMessageBox::sorry(this,mes); return; @@ -227,7 +227,7 @@ void KJumpingCube::changePlayer(int newPlayer) } void KJumpingCube::showWinner(int player) { - QString s=i18n("Winner is Player %1!").arg(player); + TQString s=i18n("Winner is Player %1!").arg(player); KMessageBox::information(this,s,i18n("Winner")); view->reset(); } @@ -270,7 +270,7 @@ void KJumpingCube::showOptions(){ KConfigDialog *dialog = new KConfigDialog(this, "settings", Prefs::self(), KDialogBase::Swallow); dialog->addPage(new Settings(0, "General"), i18n("General"), "package_settings"); - connect(dialog, SIGNAL(settingsChanged()), view, SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), view, TQT_SLOT(loadSettings())); dialog->show(); } diff --git a/kjumpingcube/kjumpingcube.h b/kjumpingcube/kjumpingcube.h index 7ed961c7..3d2774f4 100644 --- a/kjumpingcube/kjumpingcube.h +++ b/kjumpingcube/kjumpingcube.h @@ -49,7 +49,7 @@ public: private: KCubeBoxWidget *view; - QWidget *currentPlayer; + TQWidget *currentPlayer; KAction *undoAction, *stopAction, *hintAction; KURL gameURL; diff --git a/klickety/board.cpp b/klickety/board.cpp index 92969d6e..b60e766a 100644 --- a/klickety/board.cpp +++ b/klickety/board.cpp @@ -6,13 +6,13 @@ using namespace KGrid2D; -void KLBoard::contentsMouseReleaseEvent(QMouseEvent *e) +void KLBoard::contentsMouseReleaseEvent(TQMouseEvent *e) { if ( e->button()!=LeftButton || blocked ) return; - QCanvasItemList list = canvas()->collisions(e->pos()); + TQCanvasItemList list = canvas()->collisions(e->pos()); if ( list.count()==0 ) return; - QCanvasSprite *spr = static_cast<QCanvasSprite *>(list.first()); + TQCanvasSprite *spr = static_cast<TQCanvasSprite *>(list.first()); Coord c = findSprite(spr); field.fill(0); addRemoved = findGroup(field, c); @@ -26,7 +26,7 @@ void KLBoard::contentsMouseReleaseEvent(QMouseEvent *e) } } -KLBoard::KLBoard(QWidget *parent) +KLBoard::KLBoard(TQWidget *parent) : BaseBoard(true, parent), field(matrix().width(), matrix().height()), empty(matrix().width()), @@ -52,7 +52,7 @@ void KLBoard::start(const GTInitData &data) showBoard(true); } -Coord KLBoard::findSprite(QCanvasSprite *spr) const +Coord KLBoard::findSprite(TQCanvasSprite *spr) const { for (uint i=0; i<matrix().width(); i++) for (uint j=0; j<matrix().height(); j++) { @@ -111,7 +111,7 @@ bool KLBoard::doSlide(bool doAll, bool first, bool lineByLine) for (uint j=0; j<firstClearLine(); j++) { // compute uint h = 0; - QMemArray<uint> heights(matrix().width()); + TQMemArray<uint> heights(matrix().width()); for (uint i=1; i<matrix().width(); i++) { // first column cannot slide Coord src(i, j); if ( toSlide(src) ) h++; @@ -157,7 +157,7 @@ bool KLBoard::afterAfterRemove() { // check if there are remaining groups field.fill(0); - QMemArray<uint> groups = findGroups(field, 2, true); + TQMemArray<uint> groups = findGroups(field, 2, true); blocked = false; return groups.size()!=0; } diff --git a/klickety/board.h b/klickety/board.h index d239f83d..472556b7 100644 --- a/klickety/board.h +++ b/klickety/board.h @@ -8,7 +8,7 @@ class KLBoard : public BaseBoard { Q_OBJECT public: - KLBoard(QWidget *parent); + KLBoard(TQWidget *parent); void start(const GTInitData &data); @@ -18,11 +18,11 @@ class KLBoard : public BaseBoard private: KGrid2D::Square<int> field; bool sliding; - QMemArray<bool> empty; + TQMemArray<bool> empty; uint addRemoved; bool blocked; - KGrid2D::Coord findSprite(QCanvasSprite *) const; + KGrid2D::Coord findSprite(TQCanvasSprite *) const; AfterRemoveResult afterRemove(bool doAll, bool first); bool afterAfterRemove(); bool toBeRemoved(const KGrid2D::Coord &) const; @@ -32,7 +32,7 @@ class KLBoard : public BaseBoard bool doSlide(bool doAll, bool first, bool lineByLine); void computeInfos(); - void contentsMouseReleaseEvent(QMouseEvent *); + void contentsMouseReleaseEvent(TQMouseEvent *); }; #endif diff --git a/klickety/field.cpp b/klickety/field.cpp index 4b85a3fe..67533acc 100644 --- a/klickety/field.cpp +++ b/klickety/field.cpp @@ -1,8 +1,8 @@ #include "field.h" #include "field.moc" -#include <qwhatsthis.h> -#include <qlayout.h> +#include <tqwhatsthis.h> +#include <tqlayout.h> #include <kapplication.h> #include <klocale.h> @@ -11,13 +11,13 @@ #include "base/board.h" -Field::Field(QWidget *parent) - : QWidget(parent, "field"), BaseField(this) +Field::Field(TQWidget *parent) + : TQWidget(parent, "field"), BaseField(this) { KGameLCDList *sc = new KGameLCDList(i18n("Remaining blocks"), this); showScore = new KGameLCD(3, sc); sc->append(showScore); - QWhatsThis::add(sc, i18n("<qt>Display the number of remaining " + TQWhatsThis::add(sc, i18n("<qt>Display the number of remaining " "blocks.<br/>" "It turns <font color=\"blue\">blue" "</font> if it is a highscore " @@ -28,17 +28,17 @@ Field::Field(QWidget *parent) KGameLCDList *et = new KGameLCDList(i18n("Elapsed time"), this); elapsedTime = new KGameLCDClock(et); - connect(board, SIGNAL(firstBlockClicked()), elapsedTime, SLOT(start())); + connect(board, TQT_SIGNAL(firstBlockClicked()), elapsedTime, TQT_SLOT(start())); et->append(elapsedTime); lcds->addWidget(et, 5, 0); lcds->setRowStretch(6, 1); - connect(board, SIGNAL(scoreUpdated()), SLOT(scoreUpdatedSlot())); - connect(board, SIGNAL(gameOverSignal()), SLOT(gameOver())); + connect(board, TQT_SIGNAL(scoreUpdated()), TQT_SLOT(scoreUpdatedSlot())); + connect(board, TQT_SIGNAL(gameOverSignal()), TQT_SLOT(gameOver())); settingsChanged(); - connect(parent, SIGNAL(settingsChanged()), SLOT(settingsChanged())); - QTimer::singleShot(0, this, SLOT(start())); + connect(parent, TQT_SIGNAL(settingsChanged()), TQT_SLOT(settingsChanged())); + TQTimer::singleShot(0, this, TQT_SLOT(start())); } void Field::pause() @@ -52,7 +52,7 @@ void Field::pause() void Field::start() { - init(false, false, true, true, QString::null); + init(false, false, true, true, TQString::null); GTInitData data; data.seed = kapp->random(); BaseField::start(data); diff --git a/klickety/field.h b/klickety/field.h index 67e6529b..7f1acb4f 100644 --- a/klickety/field.h +++ b/klickety/field.h @@ -1,18 +1,18 @@ #ifndef KL_FIELD_H #define KL_FIELD_H -#include <qwidget.h> +#include <tqwidget.h> #include "base/field.h" #include "base/inter.h" class KGameLCDClock; -class Field : public QWidget, public BaseField, public BaseInterface +class Field : public TQWidget, public BaseField, public BaseInterface { Q_OBJECT public: - Field(QWidget *parent); + Field(TQWidget *parent); private slots: void scoreUpdatedSlot() { scoreUpdated(); } diff --git a/klickety/highscores.cpp b/klickety/highscores.cpp index 6c49952e..62a2e28b 100644 --- a/klickety/highscores.cpp +++ b/klickety/highscores.cpp @@ -23,5 +23,5 @@ bool KLHighscores::isStrictlyLess(const Score &s1, const Score &s2) const void KLHighscores::additionalQueryItems(KURL &url, const Score &s) const { uint time = s.data("time").toUInt(); - addToQueryURL(url, "scoreTime", QString::number(time)); + addToQueryURL(url, "scoreTime", TQString::number(time)); } diff --git a/klickety/main.h b/klickety/main.h index e5b335f8..54443103 100644 --- a/klickety/main.h +++ b/klickety/main.h @@ -13,9 +13,9 @@ class KLFactory : public BaseFactory KLFactory(); protected: - virtual BaseBoard *createBoard(bool, QWidget *parent) + virtual BaseBoard *createBoard(bool, TQWidget *parent) { return new KLBoard(parent); } - virtual BaseInterface *createInterface(QWidget *parent) + virtual BaseInterface *createInterface(TQWidget *parent) { return new Field(parent); } }; diff --git a/klickety/piece.cpp b/klickety/piece.cpp index 4a33910b..fcc2fdff 100644 --- a/klickety/piece.cpp +++ b/klickety/piece.cpp @@ -1,6 +1,6 @@ #include "piece.h" -#include <qpainter.h> +#include <tqpainter.h> #include <klocale.h> #include "base/board.h" @@ -9,26 +9,26 @@ const char *KLPieceInfo::DEFAULT_COLORS[NB_BLOCK_TYPES] = { "#C86464", "#64C864", "#6464C8", "#C8C864", "#C864C8" }; -QColor KLPieceInfo::defaultColor(uint i) const +TQColor KLPieceInfo::defaultColor(uint i) const { - if ( i>=nbColors() ) return QColor(); - return QColor(DEFAULT_COLORS[i]); + if ( i>=nbColors() ) return TQColor(); + return TQColor(DEFAULT_COLORS[i]); } -QString KLPieceInfo::colorLabel(uint i) const +TQString KLPieceInfo::colorLabel(uint i) const { return i18n("Color #%1:").arg(i+1); } -void KLPieceInfo::draw(QPixmap *pixmap, uint blockType, uint bMode, +void KLPieceInfo::draw(TQPixmap *pixmap, uint blockType, uint bMode, bool lighted) const { - QColor col = color(blockType); + TQColor col = color(blockType); if (lighted) col = col.light(); pixmap->fill(col); - QPainter p(pixmap); - QRect r = pixmap->rect(); + TQPainter p(pixmap); + TQRect r = pixmap->rect(); p.setPen(col.dark()); if ( !(bMode & BaseBoard::Up) ) @@ -42,11 +42,11 @@ void KLPieceInfo::draw(QPixmap *pixmap, uint blockType, uint bMode, p.setPen(col.dark(110)); if (bMode & BaseBoard::Up) - p.drawLine(r.topLeft()+QPoint(1,0), r.topRight()+QPoint(-1,0)); + p.drawLine(r.topLeft()+TQPoint(1,0), r.topRight()+TQPoint(-1,0)); if (bMode & BaseBoard::Down) - p.drawLine(r.bottomLeft()+QPoint(1,0), r.bottomRight()+QPoint(-1,0)); + p.drawLine(r.bottomLeft()+TQPoint(1,0), r.bottomRight()+TQPoint(-1,0)); if (bMode & BaseBoard::Left) - p.drawLine(r.topLeft()+QPoint(0,1), r.bottomLeft()+QPoint(0,-1)); + p.drawLine(r.topLeft()+TQPoint(0,1), r.bottomLeft()+TQPoint(0,-1)); if (bMode & BaseBoard::Right) - p.drawLine(r.topRight()+QPoint(0,1), r.bottomRight()+QPoint(0,-1)); + p.drawLine(r.topRight()+TQPoint(0,1), r.bottomRight()+TQPoint(0,-1)); } diff --git a/klickety/piece.h b/klickety/piece.h index b7d192f0..6966ff80 100644 --- a/klickety/piece.h +++ b/klickety/piece.h @@ -24,11 +24,11 @@ class KLPieceInfo : public GPieceInfo virtual uint nbBlockModes() const { return 1+4+6+4+1; } virtual uint nbColors() const { return NB_BLOCK_TYPES; } - virtual QString colorLabel(uint i) const; - virtual QColor defaultColor(uint i) const; + virtual TQString colorLabel(uint i) const; + virtual TQColor defaultColor(uint i) const; protected: - void draw(QPixmap *, uint blockType, uint blockMode, + void draw(TQPixmap *, uint blockType, uint blockMode, bool lighted) const; private: diff --git a/klines/ballpainter.cpp b/klines/ballpainter.cpp index 06380a6f..76156f11 100644 --- a/klines/ballpainter.cpp +++ b/klines/ballpainter.cpp @@ -17,10 +17,10 @@ #include <kapplication.h> #include <kmessagebox.h> //#include "shotcounter.h" -#include <qpainter.h> +#include <tqpainter.h> #include "linesboard.h" -//#include <qcolor.h> -#include <qjpegio.h> +//#include <tqcolor.h> +#include <tqjpegio.h> #include <kstandarddirs.h> #include <klocale.h> #include <stdlib.h> @@ -37,7 +37,7 @@ int colorLinesArr[NCOLORS] = BallPainter::BallPainter() - : QObject(), backgroundPix(0) + : TQObject(), backgroundPix(0) { createPix(); } @@ -59,11 +59,11 @@ void BallPainter::deletePix() void BallPainter::createPix() { - backgroundPix = new QPixmap( + backgroundPix = new TQPixmap( locate( "appdata", "field.jpg" )); - QPixmap *balls = new QPixmap( + TQPixmap *balls = new TQPixmap( locate( "appdata", "balls.jpg" )); - QPixmap *fire = new QPixmap( + TQPixmap *fire = new TQPixmap( locate( "appdata", "fire.jpg" )); if (balls->isNull() ||backgroundPix->isNull() || fire->isNull() ) { KMessageBox::error(0, i18n("Unable to find graphics. Check your installation."), i18n("Error")); @@ -75,8 +75,8 @@ void BallPainter::createPix() { for(int t=0; t<PIXTIME + FIREBALLS + BOOMBALLS + 1 ; t++) { - imgCash[c][t] = new QPixmap(CELLSIZE, CELLSIZE); - QPainter p(imgCash[c][t]); + imgCash[c][t] = new TQPixmap(CELLSIZE, CELLSIZE); + TQPainter p(imgCash[c][t]); p.drawPixmap(0,0,(*backgroundPix),0,0,CELLSIZE,CELLSIZE); p.drawPixmap(1,1,(*balls),t*PIXSIZE,c*PIXSIZE,PIXSIZE,PIXSIZE); if (Prefs::numberedBalls() && (t == NORMALBALL)) @@ -85,17 +85,17 @@ void BallPainter::createPix() p.setPen(Qt::black); else p.setPen(Qt::white); - QString tmp; + TQString tmp; tmp.setNum(c+1); - p.drawText(QRect(0,0,CELLSIZE,CELLSIZE), Qt::AlignCenter, tmp); + p.drawText(TQRect(0,0,CELLSIZE,CELLSIZE), Qt::AlignCenter, tmp); } } } for(int t=0; t < FIREPIX ; t++) { - firePix[t] = new QPixmap(CELLSIZE, CELLSIZE); - QPainter p(firePix[t]); + firePix[t] = new TQPixmap(CELLSIZE, CELLSIZE); + TQPainter p(firePix[t]); p.drawPixmap(0,0,(*backgroundPix),0,0,CELLSIZE,CELLSIZE); p.drawPixmap(1,1,(*fire),t*PIXSIZE,0,PIXSIZE,PIXSIZE); } @@ -104,7 +104,7 @@ void BallPainter::createPix() } -QPixmap BallPainter::GetBall(int color, int animstep, int panim) +TQPixmap BallPainter::GetBall(int color, int animstep, int panim) { // return backgroundPix; diff --git a/klines/ballpainter.h b/klines/ballpainter.h index a0ad2cbb..522a3928 100644 --- a/klines/ballpainter.h +++ b/klines/ballpainter.h @@ -18,8 +18,8 @@ #ifndef BALLPAINTER_H #define BALLPAINTER_H -#include <qobject.h> -#include <qpixmap.h> +#include <tqobject.h> +#include <tqpixmap.h> #include "cfg.h" #define CELLSIZE 32 @@ -27,9 +27,9 @@ class BallPainter : public QObject { Q_OBJECT - QPixmap* imgCash[NCOLORS][PIXTIME + FIREBALLS + BOOMBALLS + 1]; - QPixmap* backgroundPix; - QPixmap* firePix[FIREPIX]; + TQPixmap* imgCash[NCOLORS][PIXTIME + FIREBALLS + BOOMBALLS + 1]; + TQPixmap* backgroundPix; + TQPixmap* firePix[FIREPIX]; public: @@ -39,9 +39,9 @@ public: void deletePix(); void createPix(); - QPixmap GetBall( int color, int animstep, int panim ); - QPixmap GetNormalBall(int color) { return GetBall(color,0,ANIM_NO); } - QPixmap GetBackgroundPix() { return GetBall(NOBALL,0,ANIM_NO); } + TQPixmap GetBall( int color, int animstep, int panim ); + TQPixmap GetNormalBall(int color) { return GetBall(color,0,ANIM_NO); } + TQPixmap GetBackgroundPix() { return GetBall(NOBALL,0,ANIM_NO); } }; #endif diff --git a/klines/field.cpp b/klines/field.cpp index d7be22ca..d8da8ec7 100644 --- a/klines/field.cpp +++ b/klines/field.cpp @@ -19,8 +19,8 @@ #include "cfg.h" #include "field.moc" -Field::Field(QWidget* parent, const char* name) - : QWidget( parent, name ) +Field::Field(TQWidget* parent, const char* name) + : TQWidget( parent, name ) { clearField(); } diff --git a/klines/field.h b/klines/field.h index de9ee8ce..6fb08932 100644 --- a/klines/field.h +++ b/klines/field.h @@ -18,8 +18,8 @@ #ifndef FIELD_H #define FIELD_H -#include <qobject.h> -#include <qwidget.h> +#include <tqobject.h> +#include <tqwidget.h> #include "cell.h" // size of game field #define NUMCELLSW 9 @@ -35,7 +35,7 @@ public: void saveUndo(); protected: - Field(QWidget* parent, const char* name); + Field(TQWidget* parent, const char* name); ~Field(); void putBall(int x, int y, int color); diff --git a/klines/klines.cpp b/klines/klines.cpp index d5f36e35..50d96163 100644 --- a/klines/klines.cpp +++ b/klines/klines.cpp @@ -22,11 +22,11 @@ // The implementation of the KLines widget // -#include <qkeycode.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qtooltip.h> -#include <qstring.h> +#include <tqkeycode.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqtooltip.h> +#include <tqstring.h> #include <stdlib.h> #include <unistd.h> #include <time.h> @@ -64,10 +64,10 @@ KLines::KLines() setCentralWidget( mwidget ); lsb = mwidget->GetLsb(); - connect(lsb, SIGNAL(endTurn()), this, SLOT(makeTurn())); - connect(lsb, SIGNAL(eraseLine(int)), this, SLOT(addScore(int))); - connect(lsb, SIGNAL(endGame()), this, SLOT(endGame())); - connect(lsb, SIGNAL(userTurn()), this, SLOT(userTurn())); + connect(lsb, TQT_SIGNAL(endTurn()), this, TQT_SLOT(makeTurn())); + connect(lsb, TQT_SIGNAL(eraseLine(int)), this, TQT_SLOT(addScore(int))); + connect(lsb, TQT_SIGNAL(endGame()), this, TQT_SLOT(endGame())); + connect(lsb, TQT_SIGNAL(userTurn()), this, TQT_SLOT(userTurn())); lPrompt = mwidget->GetPrompt(); @@ -82,7 +82,7 @@ KLines::KLines() initKAction(); - connect(&demoTimer, SIGNAL(timeout()), this, SLOT(slotDemo())); + connect(&demoTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotDemo())); setFocusPolicy(StrongFocus); setFocus(); @@ -104,21 +104,21 @@ KLines::~KLines() */ void KLines::initKAction() { - KStdGameAction::gameNew(this, SLOT(startGame()), actionCollection()); - act_demo = KStdGameAction::demo(this, SLOT(startDemo()), actionCollection()); + KStdGameAction::gameNew(this, TQT_SLOT(startGame()), actionCollection()); + act_demo = KStdGameAction::demo(this, TQT_SLOT(startDemo()), actionCollection()); act_demo->setText(i18n("Start &Tutorial")); - KStdGameAction::highscores(this, SLOT(viewHighScore()), actionCollection()); - KStdGameAction::quit(this, SLOT(close()), actionCollection()); - endTurnAction = KStdGameAction::endTurn(this, SLOT(makeTurn()), actionCollection()); + KStdGameAction::highscores(this, TQT_SLOT(viewHighScore()), actionCollection()); + KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + endTurnAction = KStdGameAction::endTurn(this, TQT_SLOT(makeTurn()), actionCollection()); showNextAction = new KToggleAction(i18n("&Show Next"), KShortcut(CTRL+Key_P), - this, SLOT(switchPrompt()), actionCollection(), "options_show_next"); + this, TQT_SLOT(switchPrompt()), actionCollection(), "options_show_next"); showNextAction->setCheckedState(i18n("Hide Next")); showNumberedAction = new KToggleAction(i18n("&Use Numbered Balls"), KShortcut(), - this, SLOT(switchNumbered()), actionCollection(), "options_show_numbered"); - undoAction = KStdGameAction::undo(this, SLOT(undo()), actionCollection()); + this, TQT_SLOT(switchNumbered()), actionCollection(), "options_show_numbered"); + undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); levelAction = KStdGameAction::chooseGameType(0, 0, actionCollection()); - QStringList items; + TQStringList items; for (uint i=0; i<Nb_Levels; i++) items.append( i18n(LEVEL[i]) ); levelAction->setItems(items); @@ -128,11 +128,11 @@ void KLines::initKAction() showNumberedAction->setChecked(Prefs::numberedBalls()); lPrompt->setPrompt(Prefs::showNext()); - (void)new KAction(i18n("Move Left"), Key_Left, lsb, SLOT(moveLeft()), actionCollection(), "left"); - (void)new KAction(i18n("Move Right"), Key_Right, lsb, SLOT(moveRight()), actionCollection(), "right"); - (void)new KAction(i18n("Move Up"), Key_Up, lsb, SLOT(moveUp()), actionCollection(), "up"); - (void)new KAction(i18n("Move Down"), Key_Down, lsb, SLOT(moveDown()), actionCollection(), "down"); - (void)new KAction(i18n("Move Ball"), Key_Space, lsb, SLOT(placePlayerBall()), actionCollection(), "place_ball"); + (void)new KAction(i18n("Move Left"), Key_Left, lsb, TQT_SLOT(moveLeft()), actionCollection(), "left"); + (void)new KAction(i18n("Move Right"), Key_Right, lsb, TQT_SLOT(moveRight()), actionCollection(), "right"); + (void)new KAction(i18n("Move Up"), Key_Up, lsb, TQT_SLOT(moveUp()), actionCollection(), "up"); + (void)new KAction(i18n("Move Down"), Key_Down, lsb, TQT_SLOT(moveDown()), actionCollection(), "down"); + (void)new KAction(i18n("Move Ball"), Key_Space, lsb, TQT_SLOT(placePlayerBall()), actionCollection(), "place_ball"); setupGUI( KMainWindow::Save | Keys | StatusBar | Create ); } @@ -212,7 +212,7 @@ void KLines::slotDemo() int ballColors = -1; int clickX = 0; int clickY = 0; - QString msg; + TQString msg; demoStep++; if ((demoStep % 2) == 0) { @@ -413,7 +413,7 @@ void KLines::slotDemo() } } -void KLines::focusOutEvent(QFocusEvent *ev) +void KLines::focusOutEvent(TQFocusEvent *ev) { if (bDemo) { @@ -424,7 +424,7 @@ void KLines::focusOutEvent(QFocusEvent *ev) KMainWindow::focusOutEvent(ev); } -void KLines::focusInEvent(QFocusEvent *ev) +void KLines::focusInEvent(TQFocusEvent *ev) { if (bDemo) { @@ -573,7 +573,7 @@ void KLines::switchUndo(bool bu) undoAction->setEnabled(bu); } -void KLines::keyPressEvent(QKeyEvent *e) +void KLines::keyPressEvent(TQKeyEvent *e) { if (lsb->gameOver() && (e->key() == Qt::Key_Space)) { diff --git a/klines/klines.h b/klines/klines.h index 73720f03..39352b33 100644 --- a/klines/klines.h +++ b/klines/klines.h @@ -34,12 +34,12 @@ public: ~KLines(); protected: - void keyPressEvent(QKeyEvent *e); + void keyPressEvent(TQKeyEvent *e); void initKAction(); void setLevel(int level); - void focusOutEvent(QFocusEvent *); - void focusInEvent(QFocusEvent *); + void focusOutEvent(TQFocusEvent *); + void focusInEvent(TQFocusEvent *); public slots: void startGame(); @@ -65,7 +65,7 @@ private: KSelectAction *levelAction; KToggleAction *showNextAction; KToggleAction *showNumberedAction; - QString levelStr; + TQString levelStr; bool bNewTurn; @@ -80,7 +80,7 @@ private: bool bDemo; int demoStep; - QTimer demoTimer; + TQTimer demoTimer; void searchBallsLine(); void generateRandomBalls(); diff --git a/klines/linesboard.cpp b/klines/linesboard.cpp index 5078b8f9..aefa1a65 100644 --- a/klines/linesboard.cpp +++ b/klines/linesboard.cpp @@ -15,11 +15,11 @@ * * ***************************************************************************/ -#include <qpainter.h> -#include <qcolor.h> -#include <qcursor.h> -#include <qkeycode.h> -#include <qtooltip.h> +#include <tqpainter.h> +#include <tqcolor.h> +#include <tqcursor.h> +#include <tqkeycode.h> +#include <tqtooltip.h> #include <stdlib.h> #include <kapplication.h> @@ -34,7 +34,7 @@ Constructs a LinesBoard widget. */ -LinesBoard::LinesBoard( BallPainter * abPainter, QWidget* parent, const char* name ) +LinesBoard::LinesBoard( BallPainter * abPainter, TQWidget* parent, const char* name ) : Field( parent, name ) { demoLabel = 0; @@ -57,8 +57,8 @@ LinesBoard::LinesBoard( BallPainter * abPainter, QWidget* parent, const char* na setMouseTracking( FALSE ); setFixedSize(wHint(), hHint()); - timer = new QTimer(this); - connect( timer, SIGNAL(timeout()), SLOT(timerSlot()) ); + timer = new TQTimer(this); + connect( timer, TQT_SIGNAL(timeout()), TQT_SLOT(timerSlot()) ); timer->start( TIMERCLOCK, FALSE ); } @@ -183,19 +183,19 @@ void LinesBoard::setGameOver(bool b) } -void LinesBoard::paintEvent( QPaintEvent* ) +void LinesBoard::paintEvent( TQPaintEvent* ) { - QPainter *paint; + TQPainter *paint; KPixmap *pixmap = 0; if (bGameOver) { pixmap = new KPixmap(); pixmap->resize(width(), height()); - paint = new QPainter( pixmap ); + paint = new TQPainter( pixmap ); } else { - paint = new QPainter( this ); + paint = new TQPainter( this ); } for( int y=0; y < NUMCELLSH; y++ ){ @@ -217,16 +217,16 @@ void LinesBoard::paintEvent( QPaintEvent* ) KPixmapEffect::fade(*pixmap, 0.5, Qt::black); - QPainter p(this); + TQPainter p(this); p.drawPixmap(0,0, *pixmap); delete pixmap; - QFont gameover_font = font(); + TQFont gameover_font = font(); gameover_font.setPointSize(48); gameover_font.setBold(true); p.setFont(gameover_font); p.setPen(Qt::white); - QString gameover_text = i18n("Game Over"); + TQString gameover_text = i18n("Game Over"); p.drawText(0, 0, width(), height(), AlignCenter|Qt::WordBreak, gameover_text); } else @@ -234,12 +234,12 @@ void LinesBoard::paintEvent( QPaintEvent* ) if ((focusX >= 0) && (focusX < NUMCELLSW) && (focusY >= 0) && (focusY < NUMCELLSH)) { - QRect r; + TQRect r; r.setX(focusX*CELLSIZE+2); r.setY(focusY*CELLSIZE+2); r.setWidth(CELLSIZE-4); r.setHeight(CELLSIZE-4); - paint->setPen(QPen(Qt::DotLine)); + paint->setPen(TQPen(Qt::DotLine)); paint->drawRect(r); } } @@ -249,7 +249,7 @@ void LinesBoard::paintEvent( QPaintEvent* ) /* Handles mouse press events for the LinesBoard widget. */ -void LinesBoard::mousePressEvent( QMouseEvent* e ) +void LinesBoard::mousePressEvent( TQMouseEvent* e ) { if (bGameOver) return; if ((level == DEMO_LEVEL) && (!bAllowMove) && e->spontaneous()) return; @@ -701,24 +701,24 @@ void LinesBoard::undo() repaint( FALSE ); } -void LinesBoard::showDemoText(const QString &text) +void LinesBoard::showDemoText(const TQString &text) { if (!demoLabel) { - demoLabel = new QLabel(0, "demoTip", WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM ); + demoLabel = new TQLabel(0, "demoTip", WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM ); demoLabel->setMargin(1); demoLabel->setIndent(0); demoLabel->setAutoMask( FALSE ); - demoLabel->setFrameStyle( QFrame::Plain | QFrame::Box ); + demoLabel->setFrameStyle( TQFrame::Plain | TQFrame::Box ); demoLabel->setLineWidth( 1 ); demoLabel->setAlignment( AlignHCenter | AlignTop ); - demoLabel->setPalette(QToolTip::palette()); + demoLabel->setPalette(TQToolTip::palette()); demoLabel->polish(); } demoLabel->setText(text); demoLabel->adjustSize(); - QSize s = demoLabel->sizeHint(); - QPoint p = QPoint(x() + (width()-s.width())/2, y() + (height()-s.height())/2); + TQSize s = demoLabel->sizeHint(); + TQPoint p = TQPoint(x() + (width()-s.width())/2, y() + (height()-s.height())/2); demoLabel->move(mapToGlobal(p)); demoLabel->show(); } @@ -731,20 +731,20 @@ void LinesBoard::hideDemoText() void LinesBoard::demoClick(int x, int y) { - QPoint lDest = QPoint(x*CELLSIZE+(CELLSIZE/2), y*CELLSIZE+(CELLSIZE/2)); - QPoint dest = mapToGlobal(lDest); - QPoint cur = QCursor::pos(); + TQPoint lDest = TQPoint(x*CELLSIZE+(CELLSIZE/2), y*CELLSIZE+(CELLSIZE/2)); + TQPoint dest = mapToGlobal(lDest); + TQPoint cur = TQCursor::pos(); for(int i = 0; i < 25;) { i++; - QPoint p = cur + i*(dest-cur) / 25; - QCursor::setPos(p); - QApplication::flushX(); - QTimer::singleShot(80, this, SLOT(demoClickStep())); + TQPoint p = cur + i*(dest-cur) / 25; + TQCursor::setPos(p); + TQApplication::flushX(); + TQTimer::singleShot(80, this, TQT_SLOT(demoClickStep())); kapp->enter_loop(); } - QCursor::setPos(dest); - QMouseEvent ev(QEvent::MouseButtonPress, lDest, dest, LeftButton, LeftButton); + TQCursor::setPos(dest); + TQMouseEvent ev(TQEvent::MouseButtonPress, lDest, dest, LeftButton, LeftButton); mousePressEvent(&ev); } diff --git a/klines/linesboard.h b/klines/linesboard.h index 044887b4..f5e3ac37 100644 --- a/klines/linesboard.h +++ b/klines/linesboard.h @@ -18,10 +18,10 @@ #ifndef linesboard_h #define linesboard_h -#include <qwidget.h> -#include <qpixmap.h> -#include <qtimer.h> -#include <qlabel.h> +#include <tqwidget.h> +#include <tqpixmap.h> +#include <tqtimer.h> +#include <tqlabel.h> #include <krandomsequence.h> @@ -33,7 +33,7 @@ class LinesBoard : public Field { Q_OBJECT public: - LinesBoard( BallPainter * abPainter, QWidget* parent=0, const char* name=0 ); + LinesBoard( BallPainter * abPainter, TQWidget* parent=0, const char* name=0 ); ~LinesBoard(); int width(); @@ -51,7 +51,7 @@ public: void setLevel(int _level) { level = _level; } void startDemoMode(); void adjustDemoMode(bool allowMove, bool off); - void showDemoText(const QString &); + void showDemoText(const TQString &); void hideDemoText(); void demoClick(int x, int y); void demoAdjust(int a); @@ -89,7 +89,7 @@ private: int level; - QTimer* timer; + TQTimer* timer; // ShotCounter* shCounter; BallPainter* bPainter; bool bGameOver; @@ -97,11 +97,11 @@ private: KRandomSequence rnd_saved; KRandomSequence rnd_demo; - QLabel *demoLabel; + TQLabel *demoLabel; bool bAllowMove; - void paintEvent( QPaintEvent* ); - void mousePressEvent( QMouseEvent* ); + void paintEvent( TQPaintEvent* ); + void mousePressEvent( TQMouseEvent* ); void AnimStart(int panim); void AnimNext(); diff --git a/klines/mwidget.cpp b/klines/mwidget.cpp index a6555835..c883b9ba 100644 --- a/klines/mwidget.cpp +++ b/klines/mwidget.cpp @@ -19,24 +19,24 @@ #include <klocale.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqlabel.h> +#include <tqlayout.h> #include "ballpainter.h" -MainWidget::MainWidget( QWidget* parent, const char* name ) - : QFrame( parent, name ) +MainWidget::MainWidget( TQWidget* parent, const char* name ) + : TQFrame( parent, name ) { - QBoxLayout *grid = new QHBoxLayout( this, 5 ); //(rows,col) + TQBoxLayout *grid = new TQHBoxLayout( this, 5 ); //(rows,col) bPainter = new BallPainter(); lsb = new LinesBoard(bPainter, this); grid->addWidget( lsb ); - QBoxLayout *right = new QVBoxLayout(grid, 2); - QLabel *label = new QLabel(i18n("Next balls:"), this); + TQBoxLayout *right = new TQVBoxLayout(grid, 2); + TQLabel *label = new TQLabel(i18n("Next balls:"), this); lPrompt = new LinesPrompt(bPainter, this); - connect(lPrompt, SIGNAL(PromptPressed()), parent, SLOT(switchPrompt())); + connect(lPrompt, TQT_SIGNAL(PromptPressed()), parent, TQT_SLOT(switchPrompt())); right->addWidget( label, 0, Qt::AlignBottom | Qt::AlignHCenter ); right->addWidget( lPrompt, 0, Qt::AlignTop | Qt::AlignHCenter ); diff --git a/klines/mwidget.h b/klines/mwidget.h index 140ccd51..18f48720 100644 --- a/klines/mwidget.h +++ b/klines/mwidget.h @@ -18,10 +18,10 @@ #ifndef MWIDGET_H #define MWIDGET_H -#include <qwidget.h> -#include <qpixmap.h> -#include <qtimer.h> -#include <qframe.h> +#include <tqwidget.h> +#include <tqpixmap.h> +#include <tqtimer.h> +#include <tqframe.h> #include "linesboard.h" #include "prompt.h" @@ -35,7 +35,7 @@ class MainWidget : public QFrame BallPainter *bPainter; public: - MainWidget( QWidget* parent=0, const char* name=0 ); + MainWidget( TQWidget* parent=0, const char* name=0 ); ~MainWidget(); LinesBoard * GetLsb(); LinesPrompt * GetPrompt(); diff --git a/klines/prompt.cpp b/klines/prompt.cpp index 09c17e2a..7a9ec36a 100644 --- a/klines/prompt.cpp +++ b/klines/prompt.cpp @@ -15,12 +15,12 @@ * * ***************************************************************************/ -#include <qpainter.h> +#include <tqpainter.h> #include "prompt.h" #include "prompt.moc" -LinesPrompt::LinesPrompt( BallPainter * abPainter, QWidget* parent, const char* name ) - : QWidget( parent, name ) +LinesPrompt::LinesPrompt( BallPainter * abPainter, TQWidget* parent, const char* name ) + : TQWidget( parent, name ) { bPainter = abPainter; @@ -47,9 +47,9 @@ int LinesPrompt::height() { return CELLSIZE ; } int LinesPrompt::wPrompt() { return CELLSIZE * 3 ; } int LinesPrompt::hPrompt() { return CELLSIZE ; } -void LinesPrompt::paintEvent( QPaintEvent* ) +void LinesPrompt::paintEvent( TQPaintEvent* ) { - QPainter paint( this ); + TQPainter paint( this ); if(PromptEnabled){ paint.drawPixmap(0, 0, bPainter->GetNormalBall(cb[0]) ); paint.drawPixmap(CELLSIZE, 0, bPainter->GetNormalBall(cb[1]) ); @@ -65,7 +65,7 @@ void LinesPrompt::paintEvent( QPaintEvent* ) /* Handles mouse press events for the LinesPrompt widget. */ -void LinesPrompt::mousePressEvent( QMouseEvent* ) +void LinesPrompt::mousePressEvent( TQMouseEvent* ) { emit PromptPressed(); } diff --git a/klines/prompt.h b/klines/prompt.h index f1e0b026..3ddf6335 100644 --- a/klines/prompt.h +++ b/klines/prompt.h @@ -18,7 +18,7 @@ #ifndef PROMPT_H #define PROMPT_H -#include <qwidget.h> +#include <tqwidget.h> #include "ballpainter.h" class LinesPrompt : public QWidget @@ -29,11 +29,11 @@ class LinesPrompt : public QWidget bool PromptEnabled; int cb[BALLSDROP]; - void paintEvent( QPaintEvent* ); - void mousePressEvent( QMouseEvent* ); + void paintEvent( TQPaintEvent* ); + void mousePressEvent( TQMouseEvent* ); public: - LinesPrompt( BallPainter * abPainter, QWidget * parent=0, const char * name=0 ); + LinesPrompt( BallPainter * abPainter, TQWidget * parent=0, const char * name=0 ); ~LinesPrompt(); void setPrompt(bool enabled); diff --git a/kmahjongg/Background.cpp b/kmahjongg/Background.cpp index 749607b3..432ae5fb 100644 --- a/kmahjongg/Background.cpp +++ b/kmahjongg/Background.cpp @@ -1,6 +1,6 @@ #include "Background.h" -#include <qimage.h> +#include <tqimage.h> Background::Background(): tile(true) { @@ -17,17 +17,17 @@ Background::~Background() { delete backgroundShadowPixmap; } -bool Background::load(const QString &file, short width, short height) { +bool Background::load(const TQString &file, short width, short height) { w=width; h=height; if (file == filename) { return true; } - sourceImage = new QImage(); - backgroundImage = new QImage(); - backgroundPixmap = new QPixmap(); - backgroundShadowPixmap = new QPixmap(); + sourceImage = new TQImage(); + backgroundImage = new TQImage(); + backgroundPixmap = new TQPixmap(); + backgroundShadowPixmap = new TQPixmap(); // try to load the image, return on failure if(!sourceImage->load(file )) @@ -96,13 +96,13 @@ void Background::sourceToBackground() { // blitting. backgroundPixmap->convertFromImage(*backgroundImage); - QImage tmp; + TQImage tmp; tmp.create(backgroundImage->width(), backgroundImage->height(), 32); for (int ys=0; ys < tmp.height(); ys++) { QRgb *src = (QRgb *) backgroundImage->scanLine(ys); QRgb *dst = (QRgb *) tmp.scanLine(ys); for (int xs=0; xs < tmp.width(); xs++) { - *dst=QColor(*src).dark(133).rgb(); + *dst=TQColor(*src).dark(133).rgb(); src++; dst++; } diff --git a/kmahjongg/Background.h b/kmahjongg/Background.h index 095f0f6e..a98d14df 100644 --- a/kmahjongg/Background.h +++ b/kmahjongg/Background.h @@ -1,6 +1,6 @@ #ifndef _BACKGROUND_H #define _BACKGROUND_H -#include <qstring.h> +#include <tqstring.h> class QPixmap; class QImage; @@ -15,20 +15,20 @@ class Background ~Background(); bool tile; - bool load(const QString &file, short width, short height); + bool load(const TQString &file, short width, short height); void sizeChanged(int newW, int newH); void scaleModeChanged(); - QPixmap *getBackground() {return backgroundPixmap;} - QPixmap *getShadowBackground() {return backgroundShadowPixmap;} + TQPixmap *getBackground() {return backgroundPixmap;} + TQPixmap *getShadowBackground() {return backgroundShadowPixmap;} private: void sourceToBackground(); int tileMode; // scale background = 0, tile = 1 - QImage *backgroundImage; - QImage *sourceImage; - QPixmap *backgroundPixmap; - QPixmap *backgroundShadowPixmap; - QString filename; + TQImage *backgroundImage; + TQImage *sourceImage; + TQPixmap *backgroundPixmap; + TQPixmap *backgroundShadowPixmap; + TQString filename; short w; short h; }; diff --git a/kmahjongg/BoardLayout.cpp b/kmahjongg/BoardLayout.cpp index 56659611..8da404ae 100644 --- a/kmahjongg/BoardLayout.cpp +++ b/kmahjongg/BoardLayout.cpp @@ -1,8 +1,8 @@ #include "BoardLayout.h" -#include <qfile.h> -#include <qtextstream.h> -#include <qtextcodec.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqtextcodec.h> @@ -23,13 +23,13 @@ void BoardLayout::clearBoardLayout() { initialiseBoard(); } -bool BoardLayout::saveBoardLayout(const QString where) { - QFile f(where); +bool BoardLayout::saveBoardLayout(const TQString where) { + TQFile f(where); if (!f.open(IO_ReadWrite)) { return false; } - QCString tmp = layoutMagic1_0.utf8(); + TQCString tmp = layoutMagic1_0.utf8(); if (f.writeBlock(tmp, tmp.length()) == -1) { return(false); } @@ -56,20 +56,20 @@ bool BoardLayout::saveBoardLayout(const QString where) { } -bool BoardLayout::loadBoardLayout(const QString from) +bool BoardLayout::loadBoardLayout(const TQString from) { if (from == filename) { return true; } - QFile f(from); - QString all = ""; + TQFile f(from); + TQString all = ""; if ( f.open(IO_ReadOnly) ) { - QTextStream t( &f ); - t.setCodec(QTextCodec::codecForName("UTF-8")); - QString s; + TQTextStream t( &f ); + t.setCodec(TQTextCodec::codecForName("UTF-8")); + TQString s; s = t.readLine(); if (s != layoutMagic1_0) { f.close(); diff --git a/kmahjongg/BoardLayout.h b/kmahjongg/BoardLayout.h index 60048bc9..468bf5bc 100644 --- a/kmahjongg/BoardLayout.h +++ b/kmahjongg/BoardLayout.h @@ -1,10 +1,10 @@ #ifndef __BOARD__LAYOUT_ #define __BOARD__LAYOUT_ -#include <qstring.h> +#include <tqstring.h> #include "KmTypes.h" -const QString layoutMagic1_0 = "kmahjongg-layout-v1.0"; +const TQString layoutMagic1_0 = "kmahjongg-layout-v1.0"; class BoardLayout { @@ -12,8 +12,8 @@ public: BoardLayout(); ~BoardLayout(); - bool loadBoardLayout(const QString from); - bool saveBoardLayout(const QString where); + bool loadBoardLayout(const TQString from); + bool saveBoardLayout(const TQString where); UCHAR getBoardData(short z, short y, short x) {return board[z][y][x];} // is there a tile anywhere above here (top left to bot right quarter) @@ -46,15 +46,15 @@ public: depth = 5 }; enum { maxTiles = (depth*width*height)/4 }; - QString &getFilename() {return filename;} + TQString &getFilename() {return filename;} protected: void initialiseBoard(); private: - QString filename; - QString loadedBoard; + TQString filename; + TQString loadedBoard; UCHAR board[depth][height][width]; unsigned short maxTileNum; }; diff --git a/kmahjongg/Editor.cpp b/kmahjongg/Editor.cpp index 4e141259..d11ff7b2 100644 --- a/kmahjongg/Editor.cpp +++ b/kmahjongg/Editor.cpp @@ -1,8 +1,8 @@ #include <stdlib.h> #include <kapplication.h> -#include <qlayout.h> -#include <qpainter.h> +#include <tqlayout.h> +#include <tqpainter.h> #include "Editor.h" #include "prefs.h" @@ -41,11 +41,11 @@ Editor::Editor ( - QWidget* parent, + TQWidget* parent, const char* name ) : - QDialog( parent, name, true, 0 ), tiles(false) + TQDialog( parent, name, true, 0 ), tiles(false) { clean= true; @@ -61,15 +61,15 @@ Editor::Editor drawFrame->setGeometry( 10, 40 ,sWidth ,sHeight); drawFrame->setMinimumSize( 0, 0 ); drawFrame->setMaximumSize( 32767, 32767 ); - drawFrame->setFocusPolicy( QWidget::NoFocus ); - drawFrame->setBackgroundMode( QWidget::PaletteBackground ); + drawFrame->setFocusPolicy( TQWidget::NoFocus ); + drawFrame->setBackgroundMode( TQWidget::PaletteBackground ); drawFrame->setFrameStyle( 49 ); drawFrame->setMouseTracking(true); // setup the tool bar setupToolbar(); - QVBoxLayout *layout = new QVBoxLayout(this, 1); + TQVBoxLayout *layout = new TQVBoxLayout(this, 1); layout->addWidget(topToolbar,0); layout->addWidget(drawFrame,1); layout->activate(); @@ -78,17 +78,17 @@ Editor::Editor setMinimumSize( sWidth+60, sHeight+60); setMaximumSize( sWidth+60, sHeight+60); - QString tile = Prefs::tileSet(); + TQString tile = Prefs::tileSet(); tiles.loadTileset(tile); // tell the user what we do setCaption(kapp->makeStdCaption(i18n("Edit Board Layout"))); - connect( drawFrame, SIGNAL(mousePressed(QMouseEvent *) ), - SLOT(drawFrameMousePressEvent(QMouseEvent *))); - connect( drawFrame, SIGNAL(mouseMoved(QMouseEvent *) ), - SLOT(drawFrameMouseMovedEvent(QMouseEvent *))); + connect( drawFrame, TQT_SIGNAL(mousePressed(TQMouseEvent *) ), + TQT_SLOT(drawFrameMousePressEvent(TQMouseEvent *))); + connect( drawFrame, TQT_SIGNAL(mouseMoved(TQMouseEvent *) ), + TQT_SLOT(drawFrameMouseMovedEvent(TQMouseEvent *))); statusChanged(); @@ -169,14 +169,14 @@ void Editor::setupToolbar() // status in the toolbar for now (ick) - theLabel = new QLabel(statusText(), topToolbar); + theLabel = new TQLabel(statusText(), topToolbar); int lWidth = theLabel->sizeHint().width(); topToolbar->insertWidget(ID_TOOL_STATUS,lWidth, theLabel ); topToolbar->alignItemRight( ID_TOOL_STATUS, true ); //addToolBar(topToolbar); - connect( topToolbar, SIGNAL(clicked(int) ), SLOT( topToolbarOption(int) ) ); + connect( topToolbar, TQT_SIGNAL(clicked(int) ), TQT_SLOT( topToolbarOption(int) ) ); topToolbar->updateRects(0); topToolbar->setFullSize(true); @@ -245,8 +245,8 @@ void Editor::topToolbarOption(int option) { } -QString Editor::statusText() { - QString buf; +TQString Editor::statusText() { + TQString buf; int x=currPos.x; int y=currPos.y; @@ -323,7 +323,7 @@ bool Editor::saveBoard() { if ( url.isEmpty() ) return false; - QFileInfo f( url.path() ); + TQFileInfo f( url.path() ); if ( f.exists() ) { // if it already exists, querie the user for replacement int res=KMessageBox::warningContinueCancel(this, @@ -356,7 +356,7 @@ bool Editor::testSave() int res; res=KMessageBox::warningYesNoCancel(this, i18n("The board has been modified. Would you " - "like to save the changes?"),QString::null,KStdGuiItem::save(),KStdGuiItem::dontSave()); + "like to save the changes?"),TQString::null,KStdGuiItem::save(),KStdGuiItem::dontSave()); if (res == KMessageBox::Yes) { // yes to save @@ -375,12 +375,12 @@ bool Editor::testSave() // The main paint event, draw in the grid and blit in // the tiles as specified by the layout. -void Editor::paintEvent( QPaintEvent* ) { +void Editor::paintEvent( TQPaintEvent* ) { // first we layer on a background grid - QPixmap buff; - QPixmap *dest=drawFrame->getPreviewPixmap(); + TQPixmap buff; + TQPixmap *dest=drawFrame->getPreviewPixmap(); buff.resize(dest->width(), dest->height()); drawBackground(&buff); drawTiles(&buff); @@ -389,12 +389,12 @@ void Editor::paintEvent( QPaintEvent* ) { drawFrame->repaint(false); } -void Editor::drawBackground(QPixmap *pixmap) { +void Editor::drawBackground(TQPixmap *pixmap) { - QPainter p(pixmap); + TQPainter p(pixmap); // blast in a white background - p.fillRect(0,0,pixmap->width(), pixmap->height(), QColor(white)); + p.fillRect(0,0,pixmap->width(), pixmap->height(), TQColor(white)); // now put in a grid of tile quater width squares @@ -412,11 +412,11 @@ void Editor::drawBackground(QPixmap *pixmap) { } } -void Editor::drawTiles(QPixmap *dest) { +void Editor::drawTiles(TQPixmap *dest) { - QPainter p(dest); + TQPainter p(dest); - QString tile1 = Prefs::tileSet(); + TQString tile1 = Prefs::tileSet(); tiles.loadTileset(tile1); @@ -437,7 +437,7 @@ void Editor::drawTiles(QPixmap *dest) { if (theBoard.getBoardData(z, y, x) != '1') { continue; } - QPixmap *t; + TQPixmap *t; tile=(z*BoardLayout::depth)+ (y*BoardLayout::height)+ (x*BoardLayout::width); @@ -486,7 +486,7 @@ void Editor::drawTiles(QPixmap *dest) { // we return a result too. void Editor::transformPointToPosition( - const QPoint& point, + const TQPoint& point, POSITION& MouseClickPos, bool align) { @@ -551,7 +551,7 @@ void Editor::transformPointToPosition( // we swallow the draw frames mouse clicks and process here -void Editor::drawFrameMousePressEvent( QMouseEvent* e ) +void Editor::drawFrameMousePressEvent( TQMouseEvent* e ) { POSITION mPos; @@ -608,7 +608,7 @@ void Editor::drawCursor(POSITION &p, bool visible) // we swallow the draw frames mouse moves and process here -void Editor::drawFrameMouseMovedEvent( QMouseEvent* e ){ +void Editor::drawFrameMouseMovedEvent( TQMouseEvent* e ){ POSITION mPos; diff --git a/kmahjongg/Editor.h b/kmahjongg/Editor.h index 5ced0daf..edc8f912 100644 --- a/kmahjongg/Editor.h +++ b/kmahjongg/Editor.h @@ -1,8 +1,8 @@ #ifndef _EditorLoadBase_H #define _EditorLoadBase_H -#include <qdialog.h> -#include <qframe.h> +#include <tqdialog.h> +#include <tqframe.h> #include <ktoolbar.h> #include <kstatusbar.h> #include <kfiledialog.h> @@ -22,7 +22,7 @@ public: Editor ( - QWidget* parent = NULL, + TQWidget* parent = NULL, const char* name = NULL ); @@ -32,25 +32,25 @@ public: protected slots: void topToolbarOption(int w); - void drawFrameMousePressEvent ( QMouseEvent* ); - void drawFrameMouseMovedEvent ( QMouseEvent *); + void drawFrameMousePressEvent ( TQMouseEvent* ); + void drawFrameMouseMovedEvent ( TQMouseEvent *); protected: enum {remove=98, insert=99, move=100}; - void paintEvent( QPaintEvent* pa ); + void paintEvent( TQPaintEvent* pa ); void setupToolbar(); void loadBoard(); bool saveBoard(); void newBoard(); - void drawBackground(QPixmap *to); - void drawTiles(QPixmap *to); + void drawBackground(TQPixmap *to); + void drawTiles(TQPixmap *to); bool testSave(); - void transformPointToPosition(const QPoint &, POSITION &, bool align); + void transformPointToPosition(const TQPoint &, POSITION &, bool align); void drawCursor(POSITION &p, bool visible); bool canInsert(POSITION &p); void statusChanged(); - QString statusText(); + TQString statusText(); private: int mode; int numTiles; @@ -60,7 +60,7 @@ private: BoardLayout theBoard; bool clean; POSITION currPos; - QLabel *theLabel; + TQLabel *theLabel; private: }; diff --git a/kmahjongg/GameTimer.cpp b/kmahjongg/GameTimer.cpp index 5eb827d9..f3ce4f52 100644 --- a/kmahjongg/GameTimer.cpp +++ b/kmahjongg/GameTimer.cpp @@ -11,20 +11,20 @@ // Constructs a GameTimer widget with a parent and a name. // -GameTimer::GameTimer( QWidget *parent, const char *name ) - : QLCDNumber( parent, name ) +GameTimer::GameTimer( TQWidget *parent, const char *name ) + : TQLCDNumber( parent, name ) { showingColon = false; setNumDigits(7); - setFrameStyle(QFrame::Panel | QFrame::Sunken); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(TQFrame::Panel | TQFrame::Sunken); + setFrameStyle(TQFrame::NoFrame); timerMode = stopped; showTime(); // display the current time1 startTimer( 500 ); // 1/2 second timer events } -// QObject timer call back implementation -void GameTimer::timerEvent( QTimerEvent * ) +// TQObject timer call back implementation +void GameTimer::timerEvent( TQTimerEvent * ) { if (timerMode == running) theTimer=theTimer.addMSecs(500); @@ -38,7 +38,7 @@ void GameTimer::timerEvent( QTimerEvent * ) void GameTimer::showTime() { - QString s; + TQString s; showingColon = !showingColon; // toggle/blink colon switch(timerMode) { diff --git a/kmahjongg/GameTimer.h b/kmahjongg/GameTimer.h index 6cde5d11..10d97e13 100644 --- a/kmahjongg/GameTimer.h +++ b/kmahjongg/GameTimer.h @@ -16,23 +16,23 @@ #ifndef KM_GAME_TIMER #define KM_GAME_TIMER -#include <qlcdnumber.h> -#include <qdatetime.h> +#include <tqlcdnumber.h> +#include <tqdatetime.h> enum TimerMode {running = -53 , stopped= -54 , paused = -55}; -class GameTimer: public QLCDNumber +class GameTimer: public TQLCDNumber { Q_OBJECT public: - GameTimer( QWidget *parent=0, const char *name=0 ); + GameTimer( TQWidget *parent=0, const char *name=0 ); int toInt(); - QString toString() {return theTimer.toString();} + TQString toString() {return theTimer.toString();} void fromString(const char *); protected: // event handlers - void timerEvent( QTimerEvent * ); + void timerEvent( TQTimerEvent * ); public slots: void start(); diff --git a/kmahjongg/HighScore.cpp b/kmahjongg/HighScore.cpp index 2e55c15a..f59e782b 100644 --- a/kmahjongg/HighScore.cpp +++ b/kmahjongg/HighScore.cpp @@ -3,20 +3,20 @@ #include "HighScore.moc" -#include <qlabel.h> -#include <qfileinfo.h> +#include <tqlabel.h> +#include <tqfileinfo.h> #include <kmessagebox.h> #include "klocale.h" #include <kstandarddirs.h> #include <kiconloader.h> -#include <qlineedit.h> -#include <qcombobox.h> +#include <tqlineedit.h> +#include <tqcombobox.h> #include <kapplication.h> #include <kpushbutton.h> #include <kstdguiitem.h> -static const QString highScoreMagic1_0 = "kmahjongg-scores-v1.0"; -static const QString highScoreMagic1_1 = "kmahjongg-scores-v1.1"; +static const TQString highScoreMagic1_0 = "kmahjongg-scores-v1.0"; +static const TQString highScoreMagic1_1 = "kmahjongg-scores-v1.1"; static const char * highScoreFilename = "/kmahjonggHiscores"; @@ -43,11 +43,11 @@ int defTimes[numScores] = {ages, ages-1, ages-2, ages-3, HighScore::HighScore ( - QWidget* parent, + TQWidget* parent, const char* name ) : - QDialog( parent, name, true, 0 ) + TQDialog( parent, name, true, 0 ) { // form the target name @@ -55,10 +55,10 @@ HighScore::HighScore filename = locateLocal("appdata", highScoreFilename); - QFont fnt; + TQFont fnt; // Number - QLabel* qtarch_Label_3; - qtarch_Label_3 = new QLabel( this, "Label_3" ); + TQLabel* qtarch_Label_3; + qtarch_Label_3 = new TQLabel( this, "Label_3" ); qtarch_Label_3->setGeometry( 10, 45, 30, 30 ); qtarch_Label_3->setFrameStyle( 50 ); qtarch_Label_3->setText( i18n("Pos") ); @@ -70,8 +70,8 @@ HighScore::HighScore // name - QLabel* qtarch_Label_4; - qtarch_Label_4 = new QLabel( this, "Label_4" ); + TQLabel* qtarch_Label_4; + qtarch_Label_4 = new TQLabel( this, "Label_4" ); qtarch_Label_4->setGeometry( 40, 45, 150, 30 ); qtarch_Label_4->setFrameStyle( 50 ); qtarch_Label_4->setText( i18n("Name") ); @@ -79,24 +79,24 @@ HighScore::HighScore // board number - QLabel* boardTitle; - boardTitle= new QLabel( this, "" ); + TQLabel* boardTitle; + boardTitle= new TQLabel( this, "" ); boardTitle->setGeometry( 190, 45, 80, 30 ); boardTitle->setFrameStyle( 50 ); boardTitle->setText( i18n("Board") ); boardTitle->setFont(fnt); // score - QLabel* qtarch_Label_5; - qtarch_Label_5 = new QLabel( this, "Label_5" ); + TQLabel* qtarch_Label_5; + qtarch_Label_5 = new TQLabel( this, "Label_5" ); qtarch_Label_5->setGeometry( 270, 45, 70, 30 ); qtarch_Label_5->setFrameStyle( 50 ); qtarch_Label_5->setText( i18n("Score") ); qtarch_Label_5->setFont(fnt); // time - QLabel* qtarch_Label_6; - qtarch_Label_6 = new QLabel( this, "Label_6" ); + TQLabel* qtarch_Label_6; + qtarch_Label_6 = new TQLabel( this, "Label_6" ); qtarch_Label_6->setGeometry( 340, 45, 70, 30 ); qtarch_Label_6->setFrameStyle( 50 ); qtarch_Label_6->setText( i18n("Time") ); @@ -107,22 +107,22 @@ HighScore::HighScore for (int row=0; row<numScores; row++) addRow(row); - QPushButton* qtarch_PushButton_1; + TQPushButton* qtarch_PushButton_1; qtarch_PushButton_1 = new KPushButton( KStdGuiItem::ok(), this, "PushButton_1" ); qtarch_PushButton_1->setGeometry( 110+35, 340+50, 100, 30 ); qtarch_PushButton_1->setMinimumSize( 0, 0 ); qtarch_PushButton_1->setMaximumSize( 32767, 32767 ); - qtarch_PushButton_1->setFocusPolicy( QWidget::TabFocus ); + qtarch_PushButton_1->setFocusPolicy( TQWidget::TabFocus ); qtarch_PushButton_1->setAutoRepeat( false ); qtarch_PushButton_1->setAutoResize( false ); qtarch_PushButton_1->setDefault(true); - QPushButton* resetBtn; - resetBtn= new QPushButton( this, "resetBtn" ); + TQPushButton* resetBtn; + resetBtn= new TQPushButton( this, "resetBtn" ); resetBtn->setGeometry( 10, 5, 25, 25); resetBtn->setMinimumSize( 0, 0 ); resetBtn->setMaximumSize( 32767, 32767 ); - resetBtn->setFocusPolicy( QWidget::TabFocus ); + resetBtn->setFocusPolicy( TQWidget::TabFocus ); //resetBtn->setText(i18n( "Reset" )); resetBtn->setAutoRepeat( false ); resetBtn->setAutoResize( false ); @@ -136,23 +136,23 @@ HighScore::HighScore /* off screen. it is moved over and placed in position when a */ /* new name is added */ - lineEdit = new QLineEdit(this, ""); + lineEdit = new TQLineEdit(this, ""); lineEdit->setGeometry( 50, 40+(20*30), 190, 30 ); - lineEdit->setFocusPolicy(QWidget::StrongFocus); + lineEdit->setFocusPolicy(TQWidget::StrongFocus); lineEdit->setFrame(true); - lineEdit->setEchoMode(QLineEdit::Normal); + lineEdit->setEchoMode(TQLineEdit::Normal); lineEdit->setText(""); // the drop down for the board names - combo = new QComboBox( false, this, "combo" ); + combo = new TQComboBox( false, this, "combo" ); combo->setGeometry( 65, 5, 220, 25 ); combo->setMinimumSize( 0, 0 ); combo->setMaximumSize( 32767, 32767 ); - combo->setFocusPolicy( QWidget::StrongFocus ); + combo->setFocusPolicy( TQWidget::StrongFocus ); combo->setSizeLimit( 10 ); combo->setAutoResize( false ); - connect( combo, SIGNAL(activated(int)), SLOT(selectionChanged(int)) ); + connect( combo, TQT_SIGNAL(activated(int)), TQT_SLOT(selectionChanged(int)) ); resize( 350+70,390+45 ); @@ -166,12 +166,12 @@ HighScore::HighScore selectedLine = -1; - connect(lineEdit, SIGNAL( textChanged(const QString &)), - SLOT( nameChanged(const QString &))); + connect(lineEdit, TQT_SIGNAL( textChanged(const TQString &)), + TQT_SLOT( nameChanged(const TQString &))); - connect(qtarch_PushButton_1, SIGNAL(clicked()), SLOT(reject())); - connect(resetBtn, SIGNAL(clicked()), SLOT(reset())); + connect(qtarch_PushButton_1, TQT_SIGNAL(clicked()), TQT_SLOT(reject())); + connect(resetBtn, TQT_SIGNAL(clicked()), TQT_SLOT(reset())); } // free up the table structures @@ -202,7 +202,7 @@ void HighScore::loadTables() { char buff[1024]; // open the file, on error set up the default table - FILE *fp = fopen( QFile::encodeName(highScoreFile()), "r"); + FILE *fp = fopen( TQFile::encodeName(highScoreFile()), "r"); if (fp == NULL) goto error; @@ -235,7 +235,7 @@ void HighScore::loadTables() { fgets(buff, sizeof(buff), fp); if (buff[strlen(buff)-1] == '\n') buff[strlen(buff)-1] = '\0'; - t->entries[e].name=QString::fromUtf8(buff,-1); + t->entries[e].name=TQString::fromUtf8(buff,-1); } } @@ -261,7 +261,7 @@ void HighScore::saveTables() { // open the outrput file, with naff error handling - FILE *fp = fopen( QFile::encodeName(highScoreFile()), "w"); + FILE *fp = fopen( TQFile::encodeName(highScoreFile()), "w"); if (fp == NULL) return; @@ -294,7 +294,7 @@ void HighScore::saveTables() { // current table to the specified board. Create it if it does not // exist. -void HighScore::selectTable(const QString &board) { +void HighScore::selectTable(const TQString &board) { TableInstance *pos = tables; @@ -335,10 +335,10 @@ void HighScore::selectTable(const QString &board) { void HighScore::addRow(int num) { - QFont tmp; + TQFont tmp; // game number - numbersWidgets[num] = new QLabel( this); + numbersWidgets[num] = new TQLabel( this); numbersWidgets[num]->setGeometry( 10, 75+(num*30), 30, 30 ); numbersWidgets[num]->setFrameStyle( 50 ); numbersWidgets[num]->setAlignment( AlignRight | AlignVCenter ); @@ -346,19 +346,19 @@ void HighScore::addRow(int num) { // name - namesWidgets[num] = new QLabel( this); + namesWidgets[num] = new TQLabel( this); namesWidgets[num]->setGeometry( 40, 75+(num*30), 150, 30 ); namesWidgets[num]->setFrameStyle( 50 ); namesWidgets[num]->setAlignment( 289 ); // board - boardWidgets[num] = new QLabel( this); + boardWidgets[num] = new TQLabel( this); boardWidgets[num]->setGeometry( 190, 75+(num*30), 80, 30 ); boardWidgets[num]->setFrameStyle( 50 ); boardWidgets[num]->setAlignment( 289 ); // score - scoresWidgets[num] = new QLabel( this); + scoresWidgets[num] = new TQLabel( this); scoresWidgets[num]->setGeometry( 270, 75+(num*30), 70, 30 ); scoresWidgets[num]->setFrameStyle( 50 ); tmp = scoresWidgets[num]->font(); @@ -366,7 +366,7 @@ void HighScore::addRow(int num) { scoresWidgets[num]->setFont(tmp); // elapsed time - elapsedWidgets[num] = new QLabel( this); + elapsedWidgets[num] = new TQLabel( this); elapsedWidgets[num]->setGeometry( 270+70, 75+(num*30), 70, 30 ); elapsedWidgets[num]->setFrameStyle( 50 ); tmp = elapsedWidgets[num]->font(); @@ -376,9 +376,9 @@ void HighScore::addRow(int num) { } -void HighScore::copyTableToScreen(const QString &name) { +void HighScore::copyTableToScreen(const TQString &name) { char buff[256]; - QString base; + TQString base; getBoardName(name, base); selectTable(base); for (int p=0; p<numScores;p++) { @@ -399,15 +399,15 @@ void HighScore::copyTableToScreen(const QString &name) { repaint(false); } -int HighScore::exec(QString &layout) { +int HighScore::exec(TQString &layout) { copyTableToScreen(layout); - return(QDialog::exec()); + return(TQDialog::exec()); } -void HighScore::checkHighScore(int s, int e, long gameNum, QString &name) { +void HighScore::checkHighScore(int s, int e, long gameNum, TQString &name) { int pos; - QString board; + TQString board; getBoardName(name, board); // make this board name the current one! @@ -455,7 +455,7 @@ void HighScore::checkHighScore(int s, int e, long gameNum, QString &name) { } -void HighScore::nameChanged(const QString &s) { +void HighScore::nameChanged(const TQString &s) { if (selectedLine == -1) return; @@ -468,13 +468,13 @@ void HighScore::nameChanged(const QString &s) { } -void HighScore::getBoardName(QString in, QString &out) { +void HighScore::getBoardName(TQString in, TQString &out) { - QFileInfo fi( in ); + TQFileInfo fi( in ); out = fi.baseName(); } -void HighScore::setComboTo(const QString &to) { +void HighScore::setComboTo(const TQString &to) { for (int p=0; p<combo->count(); p++) { if (combo->text(p) == to) combo->setCurrentItem(p); @@ -504,7 +504,7 @@ void HighScore::reset() { return ; // delete the file - res = unlink( QFile::encodeName(highScoreFile())); + res = unlink( TQFile::encodeName(highScoreFile())); // wipe ou the in memory list of tables TableInstance *t, *d; @@ -535,7 +535,7 @@ void HighScore::reset() { copyTableToScreen("default"); } -QString &HighScore::highScoreFile() { +TQString &HighScore::highScoreFile() { return filename; } diff --git a/kmahjongg/HighScore.h b/kmahjongg/HighScore.h index 5db36819..87256826 100644 --- a/kmahjongg/HighScore.h +++ b/kmahjongg/HighScore.h @@ -2,7 +2,7 @@ #ifndef HighScore_included #define HighScore_included -#include <qdialog.h> +#include <tqdialog.h> class QLineEdit; @@ -12,7 +12,7 @@ class QLabel; const int numScores = 10; typedef struct HiScoreEntry { - QString name; + TQString name; long board; long score; long elapsed; @@ -20,7 +20,7 @@ typedef struct HiScoreEntry { }; typedef struct TableInstance { - QString name; + TQString name; HiScoreEntry entries[numScores]; TableInstance *next; }; @@ -34,41 +34,41 @@ public: HighScore ( - QWidget* parent = NULL, + TQWidget* parent = NULL, const char* name = NULL ); virtual ~HighScore(); - int exec(QString &layout); + int exec(TQString &layout); - void checkHighScore(int score, int elapsed, long game, QString &board); + void checkHighScore(int score, int elapsed, long game, TQString &board); public slots: void selectionChanged(int); protected slots: - void nameChanged(const QString &s); + void nameChanged(const TQString &s); void reset(); private: void addRow(int num); // generate one table row void loadTables(); // initialise from saved void saveTables(); // save to disc. - void getBoardName(QString in, QString &out); - void selectTable(const QString &name); - void setComboTo(const QString &to); - void copyTableToScreen(const QString &name); + void getBoardName(TQString in, TQString &out); + void selectTable(const TQString &name); + void setComboTo(const TQString &to); + void copyTableToScreen(const TQString &name); QString &highScoreFile(); int selectedLine; - QLineEdit *lineEdit; - QLabel* numbersWidgets[numScores]; - QLabel* boardWidgets[numScores]; - QLabel* namesWidgets[numScores]; - QLabel* scoresWidgets[numScores]; - QLabel* elapsedWidgets[numScores]; - QComboBox* combo; - QString filename; + TQLineEdit *lineEdit; + TQLabel* numbersWidgets[numScores]; + TQLabel* boardWidgets[numScores]; + TQLabel* namesWidgets[numScores]; + TQLabel* scoresWidgets[numScores]; + TQLabel* elapsedWidgets[numScores]; + TQComboBox* combo; + TQString filename; TableInstance *tables; TableInstance *currTable; diff --git a/kmahjongg/Preview.cpp b/kmahjongg/Preview.cpp index edd8ef79..11fbcdbd 100644 --- a/kmahjongg/Preview.cpp +++ b/kmahjongg/Preview.cpp @@ -7,33 +7,33 @@ #include <kstdguiitem.h> #include <kimageio.h> -#include <qcombobox.h> -#include <qhgroupbox.h> -#include <qimage.h> -#include <qregexp.h> -#include <qpainter.h> -#include <qvbox.h> +#include <tqcombobox.h> +#include <tqhgroupbox.h> +#include <tqimage.h> +#include <tqregexp.h> +#include <tqpainter.h> +#include <tqvbox.h> #include "prefs.h" #include "Preview.h" static const char * themeMagicV1_0= "kmahjongg-theme-v1.0"; -Preview::Preview(QWidget* parent) : KDialogBase(parent), m_tiles(true) +Preview::Preview(TQWidget* parent) : KDialogBase(parent), m_tiles(true) { KPushButton *loadButton; - QGroupBox *group; - QVBox *page; + TQGroupBox *group; + TQVBox *page; - page = new QVBox(this); + page = new TQVBox(this); - group = new QHGroupBox(page); + group = new TQHGroupBox(page); - m_combo = new QComboBox(false, group); - connect(m_combo, SIGNAL(activated(int)), SLOT(selectionChanged(int))); + m_combo = new TQComboBox(false, group); + connect(m_combo, TQT_SIGNAL(activated(int)), TQT_SLOT(selectionChanged(int))); loadButton = new KPushButton(i18n("Load..."), group); - connect( loadButton, SIGNAL(clicked()), SLOT(load()) ); + connect( loadButton, TQT_SIGNAL(clicked()), TQT_SLOT(load()) ); m_drawFrame = new FrameImage(page); m_drawFrame->setFixedSize(310, 236); @@ -73,10 +73,10 @@ void Preview::markUnchanged() void Preview::initialise(const PreviewType type) { - QString extension; - QString tile = Prefs::tileSet(); - QString back = Prefs::background(); - QString layout = Prefs::layout(); + TQString extension; + TQString tile = Prefs::tileSet(); + TQString back = Prefs::background(); + TQString layout = Prefs::layout(); // set up the concept of the current file. Initialised to the preferences // value initially. Set the caption to indicate what we are doing @@ -130,13 +130,13 @@ void Preview::initialise(const PreviewType type) // get rid of files from the last invocation m_combo->clear(); - QStringList names; - QStringList::const_iterator it, itEnd; + TQStringList names; + TQStringList::const_iterator it, itEnd; it = m_fileList.begin(); itEnd = m_fileList.end(); for ( ; it != itEnd; ++it) { - QFileInfo fi(*it); + TQFileInfo fi(*it); names << fi.baseName(); } @@ -158,7 +158,7 @@ void Preview::slotOk() { } void Preview::load() { - KURL url = KFileDialog::getOpenURL(QString::null, m_fileSelector, this, i18n("Open Board Layout" )); + KURL url = KFileDialog::getOpenURL(TQString::null, m_fileSelector, this, i18n("Open Board Layout" )); if ( !url.isEmpty() ) { m_selectedFile = url.path(); drawPreview(); @@ -174,9 +174,9 @@ void Preview::load() { void Preview::drawPreview() { - QString tile = Prefs::tileSet(); - QString back = Prefs::background(); - QString layout = Prefs::layout(); + TQString tile = Prefs::tileSet(); + TQString back = Prefs::background(); + TQString layout = Prefs::layout(); switch (m_previewType) { @@ -197,12 +197,12 @@ void Preview::drawPreview() // specified bits in (layout, background and tileset if (!m_selectedFile.isEmpty()) { - QString backRaw, layoutRaw, tilesetRaw, magic; + TQString backRaw, layoutRaw, tilesetRaw, magic; - QFile in(m_selectedFile); + TQFile in(m_selectedFile); if (in.open(IO_ReadOnly)) { - QTextStream stream(&in); + TQTextStream stream(&in); magic = stream.readLine(); if (magic != themeMagicV1_0) { @@ -217,7 +217,7 @@ void Preview::drawPreview() tile = tilesetRaw; tile.replace(":", "/kmahjongg/pics/"); - if (!QFile::exists(tile)) + if (!TQFile::exists(tile)) { tile = tilesetRaw; tile = "pics/" + tile.right(tile.length() - tile.find(":") - 1 ); @@ -226,7 +226,7 @@ void Preview::drawPreview() back = backRaw; back.replace(":", "/kmahjongg/pics/"); - if (!QFile::exists(back)) + if (!TQFile::exists(back)) { back = backRaw; back = "pics/" + back.right(back.length() - back.find(":") - 1); @@ -235,7 +235,7 @@ void Preview::drawPreview() layout = layoutRaw; layout.replace(":", "/kmahjongg/pics/"); - if (!QFile::exists(layout)) + if (!TQFile::exists(layout)) { layout = layoutRaw; layout = "pics/" + layout.right(layout.length() - layout.find(":") - 1); @@ -254,7 +254,7 @@ void Preview::drawPreview() renderTiles(tile, layout); } -void Preview::paintEvent( QPaintEvent* ){ +void Preview::paintEvent( TQPaintEvent* ){ m_drawFrame->repaint(false); } @@ -296,11 +296,11 @@ void Preview::applyChange() } // Render the background to the pixmap. -void Preview::renderBackground(const QString &bg) { - QImage img; - QImage tmp; - QPixmap *p; - QPixmap *b; +void Preview::renderBackground(const TQString &bg) { + TQImage img; + TQImage tmp; + TQPixmap *p; + TQPixmap *b; p = m_drawFrame->getPreviewPixmap(); m_back.load(bg, p->width(), p->height()); b = m_back.getBackground(); @@ -310,11 +310,11 @@ void Preview::renderBackground(const QString &bg) { // This method draws a mini-tiled board with no tiles missing. -void Preview::renderTiles(const QString &file, const QString &layout) { +void Preview::renderTiles(const TQString &file, const TQString &layout) { m_tiles.loadTileset(file, true); m_boardLayout.loadBoardLayout(layout); - QPixmap *dest = m_drawFrame->getPreviewPixmap(); + TQPixmap *dest = m_drawFrame->getPreviewPixmap(); int xOffset = m_tiles.width()/2; int yOffset = m_tiles.height()/2; short tile = 0; @@ -332,7 +332,7 @@ void Preview::renderTiles(const QString &file, const QString &layout) { if (m_boardLayout.getBoardData(z, y, x) != '1') { continue; } - QPixmap *t = m_tiles.unselectedPixmaps(tile); + TQPixmap *t = m_tiles.unselectedPixmaps(tile); // Only one compilcation. Since we render top to bottom , left // to right situations arise where...: @@ -364,14 +364,14 @@ void Preview::renderTiles(const QString &file, const QString &layout) { // this really does not belong here. It will be fixed in v1.1 onwards void Preview::saveTheme() { - QString tile = Prefs::tileSet(); - QString back = Prefs::background(); - QString layout = Prefs::layout(); + TQString tile = Prefs::tileSet(); + TQString back = Prefs::background(); + TQString layout = Prefs::layout(); - QString with = ":"; + TQString with = ":"; // we want to replace any path in the default store // with a + - QRegExp p(locate("data_dir", "/kmahjongg/pics/")); + TQRegExp p(locate("data_dir", "/kmahjongg/pics/")); back.replace(p,with); tile.replace(p,with); @@ -394,7 +394,7 @@ void Preview::saveTheme() { } // Are we over writing an existin file, or was a directory selected? - QFileInfo f( url.path() ); + TQFileInfo f( url.path() ); if( f.isDir() ) return; if (f.exists()) { @@ -402,11 +402,11 @@ void Preview::saveTheme() { int res=KMessageBox::warningContinueCancel(this, i18n("A file with that name " "already exists. Do you " - "wish to overwrite it?"),QString::null,i18n("Overwrite")); + "wish to overwrite it?"),TQString::null,i18n("Overwrite")); if (res != KMessageBox::Continue) return ; } - FILE *outFile = fopen( QFile::encodeName(url.path()), "w" ); + FILE *outFile = fopen( TQFile::encodeName(url.path()), "w" ); if (outFile == NULL) { KMessageBox::sorry(this, i18n("Could not write to file. Aborting.")); @@ -421,11 +421,11 @@ void Preview::saveTheme() { fclose(outFile); } -FrameImage::FrameImage (QWidget *parent, const char *name) - : QFrame(parent, name) +FrameImage::FrameImage (TQWidget *parent, const char *name) + : TQFrame(parent, name) { rx = -1; - thePixmap = new QPixmap(); + thePixmap = new TQPixmap(); } FrameImage::~FrameImage() @@ -434,20 +434,20 @@ FrameImage::~FrameImage() } void FrameImage::setGeometry(int x, int y, int w, int h) { - QFrame::setGeometry(x,y,w,h); + TQFrame::setGeometry(x,y,w,h); thePixmap->resize(size()); } -void FrameImage::paintEvent( QPaintEvent* pa ) +void FrameImage::paintEvent( TQPaintEvent* pa ) { - QFrame::paintEvent(pa); + TQFrame::paintEvent(pa); - QPainter p(this); + TQPainter p(this); - QPen line; + TQPen line; line.setStyle(DotLine); line.setWidth(2); line.setColor(yellow); @@ -502,11 +502,11 @@ void FrameImage::setRect(int x,int y,int w,int h, int s, int t) // Pass on the mouse presed event to our owner -void FrameImage::mousePressEvent(QMouseEvent *m) { +void FrameImage::mousePressEvent(TQMouseEvent *m) { mousePressed(m); } -void FrameImage::mouseMoveEvent(QMouseEvent *e) { +void FrameImage::mouseMoveEvent(TQMouseEvent *e) { mouseMoved(e); } diff --git a/kmahjongg/Preview.h b/kmahjongg/Preview.h index 4f58e2cd..00629c8b 100644 --- a/kmahjongg/Preview.h +++ b/kmahjongg/Preview.h @@ -3,7 +3,7 @@ #include <kdialogbase.h> -#include <qframe.h> +#include <tqframe.h> #include "Tileset.h" #include "BoardLayout.h" @@ -16,20 +16,20 @@ class FrameImage: public QFrame { Q_OBJECT public: - FrameImage(QWidget *parent=NULL, const char *name = NULL); + FrameImage(TQWidget *parent=NULL, const char *name = NULL); ~FrameImage(); void setGeometry(int x, int y, int w, int h); - QPixmap *getPreviewPixmap() {return thePixmap;} + TQPixmap *getPreviewPixmap() {return thePixmap;} void setRect(int x, int y, int w, int h, int ss, int type); signals: - void mousePressed(QMouseEvent *e); - void mouseMoved(QMouseEvent *e); + void mousePressed(TQMouseEvent *e); + void mouseMoved(TQMouseEvent *e); protected: - void mousePressEvent(QMouseEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void paintEvent( QPaintEvent* pa ); + void mousePressEvent(TQMouseEvent *e); + void mouseMoveEvent(TQMouseEvent *e); + void paintEvent( TQPaintEvent* pa ); private: - QPixmap *thePixmap; + TQPixmap *thePixmap; int rx; int ry; int rw; @@ -47,7 +47,7 @@ class Preview: public KDialogBase public: enum PreviewType {background, tileset, board, theme}; - Preview(QWidget* parent); + Preview(TQWidget* parent); ~Preview(); void initialise(const PreviewType type); @@ -57,18 +57,18 @@ protected: void markUnchanged(); void markChanged(); bool isChanged(); - QPixmap *getPreviewPixmap() {return m_drawFrame->getPreviewPixmap(); } + TQPixmap *getPreviewPixmap() {return m_drawFrame->getPreviewPixmap(); } virtual void drawPreview(); void applyChange() ; - void renderBackground(const QString &bg); - void renderTiles(const QString &file, const QString &layout); - void paintEvent( QPaintEvent* pa ); + void renderBackground(const TQString &bg); + void renderTiles(const TQString &file, const TQString &layout); + void paintEvent( TQPaintEvent* pa ); signals: void boardRedraw(bool); - void loadTileset(const QString &); - void loadBackground(const QString &, bool); - void loadBoard(const QString &); + void loadTileset(const TQString &); + void loadBackground(const TQString &, bool); + void loadBoard(const TQString &); void layoutChange(); public slots: @@ -83,22 +83,22 @@ private slots: protected: FrameImage *m_drawFrame; - QComboBox *m_combo; + TQComboBox *m_combo; - QString m_selectedFile; + TQString m_selectedFile; Tileset m_tiles; BoardLayout m_boardLayout; Background m_back; private: - QString m_fileSelector; + TQString m_fileSelector; bool m_changed; - QStringList m_fileList; + TQStringList m_fileList; PreviewType m_previewType; - QString m_themeBack; - QString m_themeLayout; - QString m_themeTileset; + TQString m_themeBack; + TQString m_themeLayout; + TQString m_themeTileset; }; #endif diff --git a/kmahjongg/Tileset.cpp b/kmahjongg/Tileset.cpp index c29f9701..b7e04f4e 100644 --- a/kmahjongg/Tileset.cpp +++ b/kmahjongg/Tileset.cpp @@ -1,7 +1,7 @@ #include <stdlib.h> #include "Tileset.h" -#include <qimage.h> +#include <tqimage.h> #define mini_width 20 @@ -94,7 +94,7 @@ Tileset::~Tileset() { // method returns the address of the byte after the copied image // and can be used to fill a larger array of tiles. -QRgb *Tileset::copyTileImage(short tileX, short tileY, QRgb *to, QImage &from) { +QRgb *Tileset::copyTileImage(short tileX, short tileY, QRgb *to, TQImage &from) { QRgb *dest = to; QRgb *src; @@ -118,7 +118,7 @@ QRgb *Tileset::copyTileImage(short tileX, short tileY, QRgb *to, QImage &from) { QRgb *Tileset::createTile(short x, short y, - QRgb *det, QImage &allTiles , QRgb *face) { + QRgb *det, TQImage &allTiles , QRgb *face) { QRgb *image ; QRgb *to = det; @@ -173,10 +173,10 @@ QRgb *Tileset::createTile(short x, short y, // version, which can be used for mini tile requirements. // this gives us a small tile for previews and showing // removed tiles. -void Tileset::createPixmap(QRgb *src, QPixmap &dest, bool scale, bool shadow) +void Tileset::createPixmap(QRgb *src, TQPixmap &dest, bool scale, bool shadow) { - QImage buff; + TQImage buff; QRgb *line; buff.create(w, h, 32); @@ -187,7 +187,7 @@ void Tileset::createPixmap(QRgb *src, QPixmap &dest, bool scale, bool shadow) if (shadow) { for (int spos=0; spos <w; spos++) { - line[spos] = QColor(line[spos]).dark(133).rgb(); + line[spos] = TQColor(line[spos]).dark(133).rgb(); } } @@ -208,10 +208,10 @@ void Tileset::createPixmap(QRgb *src, QPixmap &dest, bool scale, bool shadow) // --------------------------------------------------------- -bool Tileset::loadTileset( const QString& tilesetPath, const bool isPreview) +bool Tileset::loadTileset( const TQString& tilesetPath, const bool isPreview) { - QImage qiTiles; + TQImage qiTiles; QRgb *unsel; QRgb *sel; QRgb *nextSel=0; diff --git a/kmahjongg/Tileset.h b/kmahjongg/Tileset.h index 45bc9281..3c09a37c 100644 --- a/kmahjongg/Tileset.h +++ b/kmahjongg/Tileset.h @@ -2,16 +2,16 @@ #define _TILE_SET_H_ -#include <qbitmap.h> +#include <tqbitmap.h> class Tileset { public: Tileset(bool scaled=false); ~Tileset(); - bool loadTileset(const QString &filesetPath, const bool isPreview = false); - QRgb *createTile(short x, short y, QRgb *dst, QImage &src , QRgb *face); - QRgb *copyTileImage(short tileX, short tileY, QRgb *to, QImage &from); + bool loadTileset(const TQString &filesetPath, const bool isPreview = false); + QRgb *createTile(short x, short y, QRgb *dst, TQImage &src , QRgb *face); + QRgb *copyTileImage(short tileX, short tileY, QRgb *to, TQImage &from); void setScaled(bool sc) {isScaled = sc; divisor = (sc) ? 2 : 1;} @@ -26,28 +26,28 @@ class Tileset { short qHeight() {return qh/divisor;} - QPixmap *selectedPixmaps(int num) { + TQPixmap *selectedPixmaps(int num) { if (!isScaled) return &(selectedPix[num]); else return &(selectedMiniPix[num]); } - QPixmap *unselectedPixmaps(int num) { + TQPixmap *unselectedPixmaps(int num) { if (!isScaled) return &(unselectedPix[num]); else return &(unselectedMiniPix[num]); } - QPixmap *selectedShadowPixmaps(int num) { + TQPixmap *selectedShadowPixmaps(int num) { if (!isScaled) return &(selectedShadowPix[num]); else return &(selectedShadowMiniPix[num]); } - QPixmap *unselectedShadowPixmaps(int num) { + TQPixmap *unselectedShadowPixmaps(int num) { if (!isScaled) return &(unselectedShadowPix[num]); else @@ -57,12 +57,12 @@ class Tileset { protected: enum { maxTiles=45 }; - void createPixmap(QRgb *src, QPixmap &dest, bool scale, bool shadow); + void createPixmap(QRgb *src, TQPixmap &dest, bool scale, bool shadow); private: - QBitmap maskBits; // xbm mask for the tile - QBitmap maskBitsMini; // xbm mask for the tile + TQBitmap maskBits; // xbm mask for the tile + TQBitmap maskBitsMini; // xbm mask for the tile QRgb* tiles; // Buffer containing all tiles (unselected glyphs) QRgb* selectedTiles; // Buffer containing all tiles (selected glyphs) @@ -70,15 +70,15 @@ class Tileset { // in version 0.5 we have moved ftom using images and calculating // masks etc, to using pixmaps and letting the blt do the hard work, // in hardware. - QPixmap selectedPix[maxTiles]; // selected tiles - QPixmap unselectedPix[maxTiles]; // unselected tiles - QPixmap selectedMiniPix[maxTiles]; // selected tiles - QPixmap unselectedMiniPix[maxTiles]; // unselected tiles + TQPixmap selectedPix[maxTiles]; // selected tiles + TQPixmap unselectedPix[maxTiles]; // unselected tiles + TQPixmap selectedMiniPix[maxTiles]; // selected tiles + TQPixmap unselectedMiniPix[maxTiles]; // unselected tiles - QPixmap selectedShadowPix[maxTiles]; // selected tiles as above in shadow - QPixmap unselectedShadowPix[maxTiles]; // unselected tiles - QPixmap selectedShadowMiniPix[maxTiles]; // selected tiles - QPixmap unselectedShadowMiniPix[maxTiles]; // unselected tiles + TQPixmap selectedShadowPix[maxTiles]; // selected tiles as above in shadow + TQPixmap unselectedShadowPix[maxTiles]; // unselected tiles + TQPixmap selectedShadowMiniPix[maxTiles]; // selected tiles + TQPixmap unselectedShadowMiniPix[maxTiles]; // unselected tiles @@ -96,7 +96,7 @@ class Tileset { short qh; // quarter tile height used in 3d rendering short s; // buffer size for tile (width*height) - QString filename; // cache the last file loaded to save reloading it + TQString filename; // cache the last file loaded to save reloading it bool isScaled; int divisor; }; diff --git a/kmahjongg/boardwidget.cpp b/kmahjongg/boardwidget.cpp index 9c3355ea..c8a5cd61 100644 --- a/kmahjongg/boardwidget.cpp +++ b/kmahjongg/boardwidget.cpp @@ -3,25 +3,25 @@ #include <kmessagebox.h> #include <kapplication.h> -#include <qtimer.h> -#include <qpainter.h> +#include <tqtimer.h> +#include <tqpainter.h> #include <klocale.h> #include <kstandarddirs.h> -#include <qfile.h> +#include <tqfile.h> #include <kconfig.h> /** * Constructor. * Loads tileset and background bitmaps. */ -BoardWidget::BoardWidget( QWidget* parent, const char *name ) - : QWidget( parent, name ), theTiles(false) +BoardWidget::BoardWidget( TQWidget* parent, const char *name ) + : TQWidget( parent, name ), theTiles(false) { - setBackgroundColor( QColor( 0,0,0 ) ); + setBackgroundColor( TQColor( 0,0,0 ) ); - timer = new QTimer(this); - connect( timer, SIGNAL(timeout()), - this, SLOT(helpMoveTimeout()) ); + timer = new TQTimer(this); + connect( timer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(helpMoveTimeout()) ); TimerState = Stop; gamePaused = false; @@ -39,7 +39,7 @@ BoardWidget::BoardWidget( QWidget* parent, const char *name ) updateBackBuffer=true; // Load tileset. First try to load the last use tileset - QString tFile; + TQString tFile; getFileOrDefault(Prefs::tileSet(), "tileset", tFile); if (!loadTileset(tFile)){ @@ -95,13 +95,13 @@ void BoardWidget::saveSettings(){ //config->writePathEntry("Layout_file", layout); } -void BoardWidget::getFileOrDefault(QString filename, QString type, QString &res) +void BoardWidget::getFileOrDefault(TQString filename, TQString type, TQString &res) { - QString picsPos = "pics/"; + TQString picsPos = "pics/"; picsPos += "default."; picsPos += type; - if (QFile::exists(filename)) { + if (TQFile::exists(filename)) { res = filename; } else { @@ -156,7 +156,7 @@ void BoardWidget::calcShadow(int e, int y, int x, int &l, int &t, int &c) { // if a second shadow botton left to top right is rendered over it // then the shadow becomes a box (ie in the middle of the run) -void BoardWidget::shadowTopLeft(int depth, int sx, int sy, int rx, int ry, QPixmap *src, bool flag) { +void BoardWidget::shadowTopLeft(int depth, int sx, int sy, int rx, int ry, TQPixmap *src, bool flag) { if (depth) { int shadowPixels= (depth+1) * theTiles.shadowSize(); int xOffset=theTiles.qWidth()-shadowPixels; @@ -181,7 +181,7 @@ void BoardWidget::shadowTopLeft(int depth, int sx, int sy, int rx, int ry, QPixm } // Second triangular shadow generator see above -void BoardWidget::shadowBotRight(int depth, int sx, int sy, int rx, int ry, QPixmap *src, bool flag) { +void BoardWidget::shadowBotRight(int depth, int sx, int sy, int rx, int ry, TQPixmap *src, bool flag) { if (depth) { int shadowPixels= (depth+1) * theTiles.shadowSize(); int xOffset=theTiles.qWidth(); @@ -211,7 +211,7 @@ void BoardWidget::shadowBotRight(int depth, int sx, int sy, int rx, int ry, QPix -void BoardWidget::shadowArea(int z, int y, int x, int sx, int sy,int rx, int ry, QPixmap *src) +void BoardWidget::shadowArea(int z, int y, int x, int sx, int sy,int rx, int ry, TQPixmap *src) { // quick check to see if we are obscured if (z < BoardLayout::depth-1) { @@ -246,9 +246,9 @@ void BoardWidget::shadowArea(int z, int y, int x, int sx, int sy,int rx, int ry, } // --------------------------------------------------------- -void BoardWidget::paintEvent( QPaintEvent* pa ) +void BoardWidget::paintEvent( TQPaintEvent* pa ) { - QPixmap *back; + TQPixmap *back; int xx = pa->rect().left(); int xheight = pa->rect().height(); @@ -317,8 +317,8 @@ void BoardWidget::paintEvent( QPaintEvent* pa ) if (!Game.tilePresent(z,y,x)) continue; - QPixmap *t; - QPixmap *s; + TQPixmap *t; + TQPixmap *s; if (Game.hilighted[z][y][x]) { t= theTiles.selectedPixmaps( Game.Board[z][y][x]-TILE_OFFSET); @@ -438,8 +438,8 @@ void BoardWidget::stackTiles(unsigned char t, unsigned short h, unsigned short x { int ss = theTiles.shadowSize(); - QPainter p(&backBuffer); - QPen line; + TQPainter p(&backBuffer); + TQPen line; p.setBackgroundMode(OpaqueMode); p.setBackgroundColor(black); @@ -456,10 +456,10 @@ void BoardWidget::stackTiles(unsigned char t, unsigned short h, unsigned short x p.drawLine(x2, y+ss, x2, y2); p.drawLine(x+1, y2, x2, y2); - // p.fillRect(x+1, y+ss+1, theTiles.width()-ss-2, theTiles.height()-ss-2, QBrush(lightGray)); + // p.fillRect(x+1, y+ss+1, theTiles.width()-ss-2, theTiles.height()-ss-2, TQBrush(lightGray)); for (unsigned short pos=0; pos < h; pos++) { - QPixmap *p = theTiles.unselectedPixmaps(t-TILE_OFFSET); + TQPixmap *p = theTiles.unselectedPixmaps(t-TILE_OFFSET); bitBlt( &backBuffer, x+(pos*ss), y-(pos*ss), p, 0,0, p->width(), p->height(), CopyROP ); } @@ -633,7 +633,7 @@ void BoardWidget::demoMoveTimeout() break; } // restart timer - QTimer::singleShot( ANIMSPEED, this, SLOT( demoMoveTimeout() ) ); + TQTimer::singleShot( ANIMSPEED, this, TQT_SLOT( demoMoveTimeout() ) ); } } @@ -667,7 +667,7 @@ void BoardWidget::matchAnimationTimeout() } } if( TimerState == Match ) - QTimer::singleShot( ANIMSPEED, this, SLOT( matchAnimationTimeout() ) ); + TQTimer::singleShot( ANIMSPEED, this, TQT_SLOT( matchAnimationTimeout() ) ); } // --------------------------------------------------------- void BoardWidget::stopMatchAnimation() @@ -1618,7 +1618,7 @@ void BoardWidget::removeTile( POSITION& Pos , bool doRepaint) } // --------------------------------------------------------- -void BoardWidget::mousePressEvent ( QMouseEvent* event ) +void BoardWidget::mousePressEvent ( TQMouseEvent* event ) { if (gamePaused) return; @@ -1708,7 +1708,7 @@ void BoardWidget::mousePressEvent ( QMouseEvent* event ) @param MouseClickPos Output: Position in game board */ void BoardWidget::transformPointToPosition( - const QPoint& point, + const TQPoint& point, POSITION& MouseClickPos ) { @@ -1788,7 +1788,7 @@ bool BoardWidget::loadBoard( ) } // --------------------------------------------------------- -void BoardWidget::setStatusText( const QString & pszText ) +void BoardWidget::setStatusText( const TQString & pszText ) { emit statusTextChanged( pszText, gameGenerationNum ); } @@ -1797,7 +1797,7 @@ void BoardWidget::setStatusText( const QString & pszText ) // --------------------------------------------------------- bool BoardWidget::loadBackground( - const QString& pszFileName, + const TQString& pszFileName, bool bShowError ) { @@ -1919,7 +1919,7 @@ void BoardWidget::initialiseRemovedTiles() { } // --------------------------------------------------------- -bool BoardWidget::loadTileset(const QString &path) { +bool BoardWidget::loadTileset(const TQString &path) { if (theTiles.loadTileset(path)) { Prefs::setTileSet(path); @@ -1931,7 +1931,7 @@ bool BoardWidget::loadTileset(const QString &path) { } -bool BoardWidget::loadBoardLayout(const QString &file) { +bool BoardWidget::loadBoardLayout(const TQString &file) { if (theBoardLayout.loadBoardLayout(file)) { Prefs::setLayout(file); Prefs::writeConfig(); diff --git a/kmahjongg/boardwidget.h b/kmahjongg/boardwidget.h index 4c042c38..3fe7c3b7 100644 --- a/kmahjongg/boardwidget.h +++ b/kmahjongg/boardwidget.h @@ -1,8 +1,8 @@ #ifndef BOARDWIDGET_H #define BOARDWIDGET_H -#include <qwidget.h> -#include <qevent.h> +#include <tqwidget.h> +#include <tqevent.h> #include <krandomsequence.h> @@ -91,7 +91,7 @@ class BoardWidget : public QWidget Q_OBJECT public: - BoardWidget( QWidget* parent = 0, const char *name = 0 ); + BoardWidget( TQWidget* parent = 0, const char *name = 0 ); ~BoardWidget(); void calculateNewGame(int num = -1 ); @@ -107,8 +107,8 @@ class BoardWidget : public QWidget void setShowMatch( bool ); void tileSizeChanged(); long getGameNum() {return gameGenerationNum;} - QString &getBoardName(){return theBoardLayout.getFilename();} - QString &getLayoutName() {return theBoardLayout.getFilename();} + TQString &getBoardName(){return theBoardLayout.getFilename();} + TQString &getLayoutName() {return theBoardLayout.getFilename();} public slots: @@ -122,14 +122,14 @@ class BoardWidget : public QWidget void demoMoveTimeout(); void matchAnimationTimeout(); void setDisplayedWidth(); - bool loadTileset ( const QString & ); - bool loadBoardLayout( const QString& ); + bool loadTileset ( const TQString & ); + bool loadBoardLayout( const TQString& ); bool loadBoard ( ); void updateScaleMode (); void drawBoard(bool deferUpdate = true); - bool loadBackground ( const QString&, bool bShowError = true ); + bool loadBackground ( const TQString&, bool bShowError = true ); signals: - void statusTextChanged ( const QString&, long ); + void statusTextChanged ( const TQString&, long ); void tileNumberChanged ( int iMaximum, int iCurrent, int iLeft ); void demoModeChanged ( bool bActive ); @@ -137,14 +137,14 @@ class BoardWidget : public QWidget void gameOver(unsigned short removed, unsigned short cheats); protected: - void getFileOrDefault(QString filename, QString type, QString &res); - void shadowArea(int z, int y, int x, int sx, int sy, int rx, int ry, QPixmap *src); - void shadowTopLeft(int depth, int sx, int sy, int rx, int ry,QPixmap *src, bool flag); - void shadowBotRight(int depth, int sx, int sy, int rx, int ry,QPixmap *src, bool flag); - void paintEvent ( QPaintEvent* ); - void mousePressEvent ( QMouseEvent* ); - - void setStatusText ( const QString& ); + void getFileOrDefault(TQString filename, TQString type, TQString &res); + void shadowArea(int z, int y, int x, int sx, int sy, int rx, int ry, TQPixmap *src); + void shadowTopLeft(int depth, int sx, int sy, int rx, int ry,TQPixmap *src, bool flag); + void shadowBotRight(int depth, int sx, int sy, int rx, int ry,TQPixmap *src, bool flag); + void paintEvent ( TQPaintEvent* ); + void mousePressEvent ( TQMouseEvent* ); + + void setStatusText ( const TQString& ); void cancelUserSelectedTiles(); void drawTileNumber(); @@ -153,7 +153,7 @@ class BoardWidget : public QWidget void removeTile ( POSITION& , bool refresh = true); void setRemovedTilePair(POSITION &a, POSITION &b); void clearRemovedTilePair(POSITION &a, POSITION &b); - void transformPointToPosition( const QPoint&, POSITION& ); + void transformPointToPosition( const TQPoint&, POSITION& ); bool isMatchingTile( POSITION&, POSITION& ); bool generateStartPosition2(); @@ -197,10 +197,10 @@ class BoardWidget : public QWidget bool showMatch; bool showHelp; - QTimer *timer; + TQTimer *timer; // offscreen draw area. - QPixmap backBuffer; // pixmap to render to + TQPixmap backBuffer; // pixmap to render to diff --git a/kmahjongg/kmahjongg.cpp b/kmahjongg/kmahjongg.cpp index 7c18ed50..dd49fedd 100644 --- a/kmahjongg/kmahjongg.cpp +++ b/kmahjongg/kmahjongg.cpp @@ -57,7 +57,7 @@ int is_paused = 0; /** Constructor. */ -KMahjongg::KMahjongg( QWidget* parent, const char *name) +KMahjongg::KMahjongg( TQWidget* parent, const char *name) : KMainWindow(parent, name) { boardEditor = 0; @@ -80,37 +80,37 @@ KMahjongg::KMahjongg( QWidget* parent, const char *name) bDemoModeActive = false; - connect( bw, SIGNAL( statusTextChanged(const QString&, long) ), - SLOT( showStatusText(const QString&, long) ) ); + connect( bw, TQT_SIGNAL( statusTextChanged(const TQString&, long) ), + TQT_SLOT( showStatusText(const TQString&, long) ) ); - connect( bw, SIGNAL( tileNumberChanged(int,int,int) ), - SLOT( showTileNumber(int,int,int) ) ); + connect( bw, TQT_SIGNAL( tileNumberChanged(int,int,int) ), + TQT_SLOT( showTileNumber(int,int,int) ) ); - connect( bw, SIGNAL( demoModeChanged(bool) ), - SLOT( demoModeChanged(bool) ) ); + connect( bw, TQT_SIGNAL( demoModeChanged(bool) ), + TQT_SLOT( demoModeChanged(bool) ) ); - connect( bw, SIGNAL( gameOver(unsigned short , unsigned short)), this, - SLOT( gameOver(unsigned short , unsigned short))); + connect( bw, TQT_SIGNAL( gameOver(unsigned short , unsigned short)), this, + TQT_SLOT( gameOver(unsigned short , unsigned short))); - connect(bw, SIGNAL(gameCalculated()), - this, SLOT(timerReset())); + connect(bw, TQT_SIGNAL(gameCalculated()), + this, TQT_SLOT(timerReset())); // Make connections for the preview load dialog - connect( previewLoad, SIGNAL( boardRedraw(bool) ), - bw, SLOT( drawBoard(bool) ) ); + connect( previewLoad, TQT_SIGNAL( boardRedraw(bool) ), + bw, TQT_SLOT( drawBoard(bool) ) ); - connect( previewLoad, SIGNAL( layoutChange() ), - this, SLOT( newGame() ) ); + connect( previewLoad, TQT_SIGNAL( layoutChange() ), + this, TQT_SLOT( newGame() ) ); - connect( previewLoad, SIGNAL( loadBackground(const QString&, bool) ), - bw, SLOT(loadBackground(const QString&, bool) ) ); + connect( previewLoad, TQT_SIGNAL( loadBackground(const TQString&, bool) ), + bw, TQT_SLOT(loadBackground(const TQString&, bool) ) ); - connect( previewLoad, SIGNAL( loadTileset(const QString &) ), - bw, SLOT(loadTileset(const QString&) ) ); - connect( previewLoad, SIGNAL( loadBoard(const QString&) ), - SLOT(loadBoardLayout(const QString&) ) ); + connect( previewLoad, TQT_SIGNAL( loadTileset(const TQString &) ), + bw, TQT_SLOT(loadTileset(const TQString&) ) ); + connect( previewLoad, TQT_SIGNAL( loadBoard(const TQString&) ), + TQT_SLOT(loadBoardLayout(const TQString&) ) ); startNewGame( ); @@ -128,41 +128,41 @@ KMahjongg::~KMahjongg() void KMahjongg::setupKAction() { // game - KStdGameAction::gameNew(this, SLOT(newGame()), actionCollection()); - KStdGameAction::load(this, SLOT(loadGame()), actionCollection()); - KStdGameAction::save(this, SLOT(saveGame()), actionCollection()); - KStdGameAction::quit(this, SLOT(close()), actionCollection()); - KStdGameAction::restart(this, SLOT(restartGame()), actionCollection()); - new KAction(i18n("New Numbered Game..."), "newnum", 0, this, SLOT(startNewNumeric()), actionCollection(), "game_new_numeric"); - new KAction(i18n("Open Th&eme..."), 0, this, SLOT(openTheme()), actionCollection(), "game_open_theme"); - new KAction(i18n("Open &Tileset..."), 0, this, SLOT(openTileset()), actionCollection(), "game_open_tileset"); - new KAction(i18n("Open &Background..."), 0, this, SLOT(openBackground()), actionCollection(), "game_open_background"); - new KAction(i18n("Open La&yout..."), 0, this, SLOT(openLayout()), actionCollection(), "game_open_layout"); - new KAction(i18n("Sa&ve Theme..."), 0, this, SLOT(saveTheme()), actionCollection(), "game_save_theme"); + KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection()); + KStdGameAction::load(this, TQT_SLOT(loadGame()), actionCollection()); + KStdGameAction::save(this, TQT_SLOT(saveGame()), actionCollection()); + KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdGameAction::restart(this, TQT_SLOT(restartGame()), actionCollection()); + new KAction(i18n("New Numbered Game..."), "newnum", 0, this, TQT_SLOT(startNewNumeric()), actionCollection(), "game_new_numeric"); + new KAction(i18n("Open Th&eme..."), 0, this, TQT_SLOT(openTheme()), actionCollection(), "game_open_theme"); + new KAction(i18n("Open &Tileset..."), 0, this, TQT_SLOT(openTileset()), actionCollection(), "game_open_tileset"); + new KAction(i18n("Open &Background..."), 0, this, TQT_SLOT(openBackground()), actionCollection(), "game_open_background"); + new KAction(i18n("Open La&yout..."), 0, this, TQT_SLOT(openLayout()), actionCollection(), "game_open_layout"); + new KAction(i18n("Sa&ve Theme..."), 0, this, TQT_SLOT(saveTheme()), actionCollection(), "game_save_theme"); // originally "file" ends here - KStdGameAction::hint(bw, SLOT(helpMove()), actionCollection()); - new KAction(i18n("Shu&ffle"), "reload", 0, bw, SLOT(shuffle()), actionCollection(), "move_shuffle"); - demoAction = KStdGameAction::demo(this, SLOT(demoMode()), actionCollection()); - showMatchingTilesAction = new KToggleAction(i18n("Show &Matching Tiles"), 0, this, SLOT(showMatchingTiles()), actionCollection(), "options_show_matching_tiles"); + KStdGameAction::hint(bw, TQT_SLOT(helpMove()), actionCollection()); + new KAction(i18n("Shu&ffle"), "reload", 0, bw, TQT_SLOT(shuffle()), actionCollection(), "move_shuffle"); + demoAction = KStdGameAction::demo(this, TQT_SLOT(demoMode()), actionCollection()); + showMatchingTilesAction = new KToggleAction(i18n("Show &Matching Tiles"), 0, this, TQT_SLOT(showMatchingTiles()), actionCollection(), "options_show_matching_tiles"); showMatchingTilesAction->setCheckedState(i18n("Hide &Matching Tiles")); showMatchingTilesAction->setChecked(Prefs::showMatchingTiles()); bw->setShowMatch( Prefs::showMatchingTiles() ); - KStdGameAction::highscores(this, SLOT(showHighscores()), actionCollection()); - pauseAction = KStdGameAction::pause(this, SLOT(pause()), actionCollection()); + KStdGameAction::highscores(this, TQT_SLOT(showHighscores()), actionCollection()); + pauseAction = KStdGameAction::pause(this, TQT_SLOT(pause()), actionCollection()); // TODO: store the background ; open on startup // TODO: same about layout // TODO: same about theme // move - undoAction = KStdGameAction::undo(this, SLOT(undo()), actionCollection()); - redoAction = KStdGameAction::redo(this, SLOT(redo()), actionCollection()); + undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); + redoAction = KStdGameAction::redo(this, TQT_SLOT(redo()), actionCollection()); // edit - new KAction(i18n("&Board Editor"), 0, this, SLOT(slotBoardEditor()), actionCollection(), "edit_board_editor"); + new KAction(i18n("&Board Editor"), 0, this, TQT_SLOT(slotBoardEditor()), actionCollection(), "edit_board_editor"); // settings - KStdAction::preferences(this, SLOT(showSettings()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection()); setupGUI(); } @@ -177,18 +177,18 @@ void KMahjongg::setupStatusBar() // as compilation), in case someone comes up with a better fix. // pStatusBar->setInsertOrder( KStatusBar::RightToLeft ); - tilesLeftLabel= new QLabel("Removed: 0000/0000", statusBar()); - tilesLeftLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + tilesLeftLabel= new TQLabel("Removed: 0000/0000", statusBar()); + tilesLeftLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); statusBar()->addWidget(tilesLeftLabel, tilesLeftLabel->sizeHint().width(), ID_STATUS_GAME); - gameNumLabel = new QLabel("Game: 000000000000000000000", statusBar()); - gameNumLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + gameNumLabel = new TQLabel("Game: 000000000000000000000", statusBar()); + gameNumLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); statusBar()->addWidget(gameNumLabel, gameNumLabel->sizeHint().width(), ID_STATUS_TILENUMBER); - statusLabel= new QLabel("Kmahjongg", statusBar()); - statusLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + statusLabel= new TQLabel("Kmahjongg", statusBar()); + statusLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); statusBar()->addWidget(statusLabel, statusLabel->sizeHint().width(), ID_STATUS_MESSAGE); // pStatusBar->setAlignment( ID_STATUS_TILENUMBER, AlignCenter ); @@ -198,7 +198,7 @@ void KMahjongg::setDisplayedWidth() { bw->setDisplayedWidth(); /* setFixedSize( bw->size() + - QSize( 2, (!statusBar()->isHidden() ? statusBar()->height() : 0) + TQSize( 2, (!statusBar()->isHidden() ? statusBar()->height() : 0) + 2 + menuBar()->height() ) ); toolBar()->setFixedWidth(bw->width());*/ toolBar()->alignItemRight( ID_GAME_TIMER, true ); @@ -238,8 +238,8 @@ void KMahjongg::showSettings(){ KConfigDialog *dialog = new KConfigDialog(this, "settings", Prefs::self(), KDialogBase::Swallow); dialog->addPage(new Settings(0, "General"), i18n("General"), "package_settings"); - connect(dialog, SIGNAL(settingsChanged()), bw, SLOT(loadSettings())); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(setDisplayedWidth())); + connect(dialog, TQT_SIGNAL(settingsChanged()), bw, TQT_SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(setDisplayedWidth())); dialog->show(); } @@ -394,10 +394,10 @@ void KMahjongg::gameOver( } // --------------------------------------------------------- -void KMahjongg::showStatusText( const QString &msg, long board ) +void KMahjongg::showStatusText( const TQString &msg, long board ) { statusLabel->setText(msg); - QString str = i18n("Game number: %1").arg(board); + TQString str = i18n("Game number: %1").arg(board); gameNumLabel->setText(str); } @@ -406,8 +406,8 @@ void KMahjongg::showStatusText( const QString &msg, long board ) void KMahjongg::showTileNumber( int iMaximum, int iCurrent, int iLeft ) { // Hmm... seems iCurrent is the number of remaining tiles, not removed ... - //QString szBuffer = i18n("Removed: %1/%2").arg(iCurrent).arg(iMaximum); - QString szBuffer = i18n("Removed: %1/%2 Combinations left: %3").arg(iMaximum-iCurrent).arg(iMaximum).arg(iLeft); + //TQString szBuffer = i18n("Removed: %1/%2").arg(iCurrent).arg(iMaximum); + TQString szBuffer = i18n("Removed: %1/%2 Combinations left: %3").arg(iMaximum-iCurrent).arg(iMaximum).arg(iLeft); tilesLeftLabel->setText(szBuffer); // Update here since undo allow is effected by demo mode @@ -445,7 +445,7 @@ void KMahjongg::demoModeChanged( bool bActive) } } -void KMahjongg::loadBoardLayout(const QString &file) { +void KMahjongg::loadBoardLayout(const TQString &file) { bw->loadBoardLayout(file); } @@ -458,7 +458,7 @@ void KMahjongg::tileSizeChanged() { void KMahjongg::loadGame() { GAMEDATA in; char buffer[1024]; - QString fname; + TQString fname; // Get the name of the file to load KURL url = KFileDialog::getOpenURL( NULL, "*.kmgame", this, i18n("Load Game" ) ); @@ -469,7 +469,7 @@ void KMahjongg::loadGame() { KIO::NetAccess::download( url, fname, this ); // open the file for reading - FILE *outFile = fopen( QFile::encodeName(fname), "r"); + FILE *outFile = fopen( TQFile::encodeName(fname), "r"); if (outFile == NULL) { KMessageBox::sorry(this, i18n("Could not read from file. Aborting.")); @@ -537,7 +537,7 @@ void KMahjongg::saveGame() { return; } - FILE *outFile = fopen( QFile::encodeName(url.path()), "w"); + FILE *outFile = fopen( TQFile::encodeName(url.path()), "w"); if (outFile == NULL) { KMessageBox::sorry(this, i18n("Could not write to file. Aborting.")); diff --git a/kmahjongg/kmahjongg.h b/kmahjongg/kmahjongg.h index a4b3ac3f..ce4ef504 100644 --- a/kmahjongg/kmahjongg.h +++ b/kmahjongg/kmahjongg.h @@ -53,16 +53,16 @@ class KMahjongg : public KMainWindow Q_OBJECT public: - KMahjongg( QWidget* parent = 0, const char *name = 0); + KMahjongg( TQWidget* parent = 0, const char *name = 0); ~KMahjongg(); public slots: void startNewGame( int num = -1 ); - void showStatusText ( const QString& , long); + void showStatusText ( const TQString& , long); void showTileNumber( int iMaximum, int iCurrent, int iLeft ); void demoModeChanged( bool bActive ); void gameOver( unsigned short removed, unsigned short cheats); - void loadBoardLayout(const QString&); + void loadBoardLayout(const TQString&); void setDisplayedWidth(); void newGame(); void timerReset(); @@ -99,9 +99,9 @@ private: unsigned long gameElapsedTime; BoardWidget* bw; - QLabel *gameNumLabel; - QLabel *tilesLeftLabel; - QLabel *statusLabel; + TQLabel *gameNumLabel; + TQLabel *tilesLeftLabel; + TQLabel *statusLabel; GameTimer *gameTimer; HighScore *theHighScores; diff --git a/kmines/defines.h b/kmines/defines.h index 145a29cc..0a2074e4 100644 --- a/kmines/defines.h +++ b/kmines/defines.h @@ -19,7 +19,7 @@ #ifndef DEFINES_H #define DEFINES_H -#include <qcolor.h> +#include <tqcolor.h> class Level diff --git a/kmines/dialogs.cpp b/kmines/dialogs.cpp index d02b2eea..ad956c30 100644 --- a/kmines/dialogs.cpp +++ b/kmines/dialogs.cpp @@ -19,16 +19,16 @@ #include "dialogs.h" #include "dialogs.moc" -#include <qpixmap.h> -#include <qvgroupbox.h> -#include <qlayout.h> -#include <qhbox.h> -#include <qvbox.h> -#include <qgrid.h> -#include <qlabel.h> -#include <qtimer.h> -#include <qwhatsthis.h> -#include <qcheckbox.h> +#include <tqpixmap.h> +#include <tqvgroupbox.h> +#include <tqlayout.h> +#include <tqhbox.h> +#include <tqvbox.h> +#include <tqgrid.h> +#include <tqlabel.h> +#include <tqtimer.h> +#include <tqwhatsthis.h> +#include <tqcheckbox.h> #include <klocale.h> #include <kmessagebox.h> @@ -56,12 +56,12 @@ const char **Smiley::XPM_NAMES[NbMoods] = { void Smiley::setMood(Mood mood) { - QPixmap p(XPM_NAMES[mood]); + TQPixmap p(XPM_NAMES[mood]); setPixmap(p); } //----------------------------------------------------------------------------- -DigitalClock::DigitalClock(QWidget *parent) +DigitalClock::DigitalClock(TQWidget *parent) : KGameLCDClock(parent, "digital_clock") { setFrameStyle(Panel | Sunken); @@ -120,40 +120,40 @@ const uint CustomConfig::maxHeight = 50; const uint CustomConfig::minHeight = 5; CustomConfig::CustomConfig() - : QWidget(0, "custom_config_widget"), _block(false) + : TQWidget(0, "custom_config_widget"), _block(false) { - QVBoxLayout *top = new QVBoxLayout(this, KDialog::spacingHint()); + TQVBoxLayout *top = new TQVBoxLayout(this, KDialog::spacingHint()); _width = new KIntNumInput(this, "kcfg_CustomWidth"); _width->setLabel(i18n("Width:")); _width->setRange(minWidth, maxWidth); - connect(_width, SIGNAL(valueChanged(int)), SLOT(updateNbMines())); + connect(_width, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(updateNbMines())); top->addWidget(_width); _height = new KIntNumInput(this, "kcfg_CustomHeight"); _height->setLabel(i18n("Height:")); _height->setRange(minWidth, maxWidth); - connect(_height, SIGNAL(valueChanged(int)), SLOT(updateNbMines())); + connect(_height, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(updateNbMines())); top->addWidget(_height); _mines = new KIntNumInput(this, "kcfg_CustomMines"); _mines->setLabel(i18n("No. of mines:")); _mines->setRange(1, Level::maxNbMines(maxWidth, maxHeight)); - connect(_mines, SIGNAL(valueChanged(int)), SLOT(updateNbMines())); + connect(_mines, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(updateNbMines())); top->addWidget(_mines); top->addSpacing(2 * KDialog::spacingHint()); // combo to choose level - QHBoxLayout *hbox = new QHBoxLayout(top); - QLabel *label = new QLabel(i18n("Choose level:"), this); + TQHBoxLayout *hbox = new TQHBoxLayout(top); + TQLabel *label = new TQLabel(i18n("Choose level:"), this); hbox->addWidget(label); _gameType = new KComboBox(false, this); - connect(_gameType, SIGNAL(activated(int)), SLOT(typeChosen(int))); + connect(_gameType, TQT_SIGNAL(activated(int)), TQT_SLOT(typeChosen(int))); for (uint i=0; i<=Level::NB_TYPES; i++) _gameType->insertItem(i18n(Level::LABELS[i])); hbox->addWidget(_gameType); - hbox->addWidget(new QWidget(this), 1); + hbox->addWidget(new TQWidget(this), 1); top->addStretch(1); } @@ -209,34 +209,34 @@ static const char *MOUSE_ACTION_LABELS[Settings::EnumMouseAction::COUNT-1] = { }; GameConfig::GameConfig() - : QWidget(0, "game_config_widget"), _magicDialogEnabled(false) + : TQWidget(0, "game_config_widget"), _magicDialogEnabled(false) { - QVBoxLayout *top = new QVBoxLayout(this, KDialog::spacingHint()); + TQVBoxLayout *top = new TQVBoxLayout(this, KDialog::spacingHint()); - QCheckBox *cb = new QCheckBox(i18n("Enable ? mark"), this, "kcfg_UncertainMark"); + TQCheckBox *cb = new TQCheckBox(i18n("Enable ? mark"), this, "kcfg_UncertainMark"); top->addWidget(cb); - cb = new QCheckBox(i18n("Enable keyboard"), this, "kcfg_KeyboardGame"); + cb = new TQCheckBox(i18n("Enable keyboard"), this, "kcfg_KeyboardGame"); top->addWidget(cb); - cb = new QCheckBox(i18n("Pause if window loses focus"), this, "kcfg_PauseFocus"); + cb = new TQCheckBox(i18n("Pause if window loses focus"), this, "kcfg_PauseFocus"); top->addWidget(cb); - cb = new QCheckBox(i18n("\"Magic\" reveal"), this, "kcfg_MagicReveal"); - QWhatsThis::add(cb, i18n("Set flags and reveal squares where they are trivial.")); - connect(cb, SIGNAL(toggled(bool)), SLOT(magicModified(bool))); + cb = new TQCheckBox(i18n("\"Magic\" reveal"), this, "kcfg_MagicReveal"); + TQWhatsThis::add(cb, i18n("Set flags and reveal squares where they are trivial.")); + connect(cb, TQT_SIGNAL(toggled(bool)), TQT_SLOT(magicModified(bool))); top->addWidget(cb); top->addSpacing(2 * KDialog::spacingHint()); - QHBoxLayout *hbox = new QHBoxLayout(top); - QVGroupBox *gb = new QVGroupBox(i18n("Mouse Bindings"), this); + TQHBoxLayout *hbox = new TQHBoxLayout(top); + TQVGroupBox *gb = new TQVGroupBox(i18n("Mouse Bindings"), this); hbox->addWidget(gb); - QGrid *grid = new QGrid(2, gb); + TQGrid *grid = new TQGrid(2, gb); grid->setSpacing(KDialog::spacingHint()); for (uint i=0; i< Settings::EnumButton::COUNT; i++) { - (void)new QLabel(i18n(MOUSE_BUTTON_LABELS[i]), grid); - QComboBox *cb = new QComboBox(false, grid, MOUSE_CONFIG_NAMES[i]); + (void)new TQLabel(i18n(MOUSE_BUTTON_LABELS[i]), grid); + TQComboBox *cb = new TQComboBox(false, grid, MOUSE_CONFIG_NAMES[i]); for (uint k=0; k< (Settings::EnumMouseAction::COUNT-1); k++) cb->insertItem(i18n(MOUSE_ACTION_LABELS[k])); cb->setCurrentItem(i); @@ -249,7 +249,7 @@ GameConfig::GameConfig() void GameConfig::magicModified(bool on) { if ( !_magicDialogEnabled || !on ) return; - KMessageBox::information(this, i18n("When the \"magic\" reveal is on, you lose the ability to enter the highscores."), QString::null, "magic_reveal_warning"); + KMessageBox::information(this, i18n("When the \"magic\" reveal is on, you lose the ability to enter the highscores."), TQString::null, "magic_reveal_warning"); } //----------------------------------------------------------------------------- @@ -269,21 +269,21 @@ static const char *N_COLOR_CONFIG_NAMES[KMines::NB_N_COLORS] = { }; AppearanceConfig::AppearanceConfig() - : QWidget(0, "appearance_config_widget") + : TQWidget(0, "appearance_config_widget") { - QVBoxLayout *top = new QVBoxLayout(this, KDialog::spacingHint()); + TQVBoxLayout *top = new TQVBoxLayout(this, KDialog::spacingHint()); - QHBoxLayout *hbox = new QHBoxLayout(top); - QGrid *grid = new QGrid(2, this); + TQHBoxLayout *hbox = new TQHBoxLayout(top); + TQGrid *grid = new TQGrid(2, this); grid->setSpacing(KDialog::spacingHint()); hbox->addWidget(grid); for (uint i=0; i<Settings::EnumType::COUNT; i++) { - (void)new QLabel(i18n(COLOR_LABELS[i]), grid); + (void)new TQLabel(i18n(COLOR_LABELS[i]), grid); KColorButton *cb = new KColorButton(grid, COLOR_CONFIG_NAMES[i]); cb->setFixedWidth(100); } for (uint i=0; i<NB_N_COLORS; i++) { - (void)new QLabel(i18n("%n mine color:", "%n mines color:", i+1), grid); + (void)new TQLabel(i18n("%n mine color:", "%n mines color:", i+1), grid); KColorButton *cb = new KColorButton(grid, N_COLOR_CONFIG_NAMES[i]); cb->setFixedWidth(100); } diff --git a/kmines/dialogs.h b/kmines/dialogs.h index 12dde5ac..15321a49 100644 --- a/kmines/dialogs.h +++ b/kmines/dialogs.h @@ -19,7 +19,7 @@ #ifndef DIALOGS_H #define DIALOGS_H -#include <qpushbutton.h> +#include <tqpushbutton.h> #include <kgamelcd.h> #include <kexthighscore.h> @@ -31,12 +31,12 @@ class KComboBox; class KIntNumInput; //----------------------------------------------------------------------------- -class Smiley : public QPushButton, public KMines +class Smiley : public TQPushButton, public KMines { Q_OBJECT public: - Smiley(QWidget *parent, const char *name = 0) - : QPushButton(QString::null, parent, name) {} + Smiley(TQWidget *parent, const char *name = 0) + : TQPushButton(TQString::null, parent, name) {} public slots: void setMood(Mood); @@ -50,7 +50,7 @@ class DigitalClock : public KGameLCDClock { Q_OBJECT public: - DigitalClock(QWidget *parent); + DigitalClock(TQWidget *parent); void reset(bool customGame); @@ -73,7 +73,7 @@ class DigitalClock : public KGameLCDClock }; //----------------------------------------------------------------------------- -class CustomConfig : public QWidget, public KMines +class CustomConfig : public TQWidget, public KMines { Q_OBJECT public: @@ -97,7 +97,7 @@ class CustomConfig : public QWidget, public KMines }; //----------------------------------------------------------------------------- -class GameConfig : public QWidget, public KMines +class GameConfig : public TQWidget, public KMines { Q_OBJECT public: @@ -115,7 +115,7 @@ class GameConfig : public QWidget, public KMines }; -class AppearanceConfig : public QWidget, public KMines +class AppearanceConfig : public TQWidget, public KMines { Q_OBJECT public: diff --git a/kmines/field.cpp b/kmines/field.cpp index 1f3b3dfd..ff3b4e46 100644 --- a/kmines/field.cpp +++ b/kmines/field.cpp @@ -21,9 +21,9 @@ #include <math.h> -#include <qlayout.h> -#include <qtimer.h> -#include <qpainter.h> +#include <tqlayout.h> +#include <tqtimer.h> +#include <tqpainter.h> #include <klocale.h> #include <knotifyclient.h> @@ -44,22 +44,22 @@ const Field::ActionData Field::ACTION_DATA[Nb_Actions] = { { "UnsetUncertain", "unset_uncertain", I18N_NOOP("Question mark unset") } }; -Field::Field(QWidget *parent) +Field::Field(TQWidget *parent) : FieldFrame(parent), _state(Init), _solvingState(Regular), _level(Level::Easy) {} void Field::readSettings() { if ( inside(_cursor) ) { - QPainter p(this); + TQPainter p(this); drawCase(p, _cursor); } if ( Settings::magicReveal() ) emit setCheating(); } -QSize Field::sizeHint() const +TQSize Field::sizeHint() const { - return QSize(2*frameWidth() + _level.width()*Settings::caseSize(), + return TQSize(2*frameWidth() + _level.width()*Settings::caseSize(), 2*frameWidth() + _level.height()*Settings::caseSize()); } @@ -70,7 +70,7 @@ void Field::setLevel(const Level &level) adjustSize(); } -void Field::setReplayField(const QString &field) +void Field::setReplayField(const TQString &field) { setState(Replaying); initReplay(field); @@ -97,9 +97,9 @@ void Field::reset(bool init) update(); } -void Field::paintEvent(QPaintEvent *e) +void Field::paintEvent(TQPaintEvent *e) { - QPainter painter(this); + TQPainter painter(this); drawFrame(&painter); if ( _state==Paused ) return; @@ -115,27 +115,27 @@ void Field::paintEvent(QPaintEvent *e) void Field::changeCase(const Coord &p, CaseState newState) { BaseField::changeCase(p, newState); - QPainter painter(this); + TQPainter painter(this); drawCase(painter, p); if ( isActive() ) emit updateStatus( hasMine(p) ); } -QPoint Field::toPoint(const Coord &p) const +TQPoint Field::toPoint(const Coord &p) const { - QPoint qp; + TQPoint qp; qp.setX( p.first*Settings::caseSize() + frameWidth() ); qp.setY( p.second*Settings::caseSize() + frameWidth() ); return qp; } -Coord Field::fromPoint(const QPoint &qp) const +Coord Field::fromPoint(const TQPoint &qp) const { double i = (double)(qp.x() - frameWidth()) / Settings::caseSize(); double j = (double)(qp.y() - frameWidth()) / Settings::caseSize(); return Coord((int)floor(i), (int)floor(j)); } -int Field::mapMouseButton(QMouseEvent *e) const +int Field::mapMouseButton(TQMouseEvent *e) const { switch (e->button()) { case Qt::LeftButton: return Settings::mouseAction(Settings::EnumButton::left); @@ -162,7 +162,7 @@ void Field::revealActions(bool press) } } -void Field::mousePressEvent(QMouseEvent *e) +void Field::mousePressEvent(TQMouseEvent *e) { if ( !isActive() || (_currentAction!=Settings::EnumMouseAction::None) ) return; @@ -175,7 +175,7 @@ void Field::mousePressEvent(QMouseEvent *e) revealActions(true); } -void Field::mouseReleaseEvent(QMouseEvent *e) +void Field::mouseReleaseEvent(TQMouseEvent *e) { if ( !isActive() ) return; @@ -199,7 +199,7 @@ void Field::mouseReleaseEvent(QMouseEvent *e) } } -void Field::mouseMoveEvent(QMouseEvent *e) +void Field::mouseMoveEvent(TQMouseEvent *e) { if ( !isActive() ) return; @@ -215,7 +215,7 @@ void Field::mouseMoveEvent(QMouseEvent *e) void Field::pressCase(const Coord &c, bool pressed) { if ( state(c)==Covered ) { - QPainter painter(this); + TQPainter painter(this); drawCase(painter, c, pressed); } } @@ -224,7 +224,7 @@ void Field::pressClearFunction(const Coord &p, bool pressed) { pressCase(p, pressed); CoordList n = coveredNeighbours(p); - QPainter painter(this); + TQPainter painter(this); for (CoordList::const_iterator it=n.begin(); it!=n.end(); ++it) drawCase(painter, *it, pressed); } @@ -233,7 +233,7 @@ void Field::keyboardAutoReveal() { _cursor_back = _cursor; pressClearFunction(_cursor_back, true); - QTimer::singleShot(50, this, SLOT(keyboardAutoRevealSlot())); + TQTimer::singleShot(50, this, TQT_SLOT(keyboardAutoRevealSlot())); } void Field::keyboardAutoRevealSlot() @@ -385,7 +385,7 @@ void Field::placeCursor(const Coord &p) Coord old = _cursor; _cursor = p; if ( Settings::keyboardGame() ) { - QPainter painter(this); + TQPainter painter(this); drawCase(painter, old); drawCase(painter, _cursor); } @@ -394,7 +394,7 @@ void Field::placeCursor(const Coord &p) void Field::resetAdvised() { if ( !inside(_advisedCoord) ) return; - QPainter p(this); + TQPainter p(this); Coord tmp = _advisedCoord; _advisedCoord = Coord(-1, -1); drawCase(p, tmp); @@ -407,16 +407,16 @@ void Field::setAdvised(const Coord &c, double proba) _advisedCoord = c; _advisedProba = proba; if ( inside(c) ) { - QPainter p(this); + TQPainter p(this); drawCase(p, c); } } -void Field::drawCase(QPainter &painter, const Coord &c, bool pressed) const +void Field::drawCase(TQPainter &painter, const Coord &c, bool pressed) const { Q_ASSERT( inside(c) ); - QString text; + TQString text; uint nbMines = 0; PixmapType type = NoPixmap; diff --git a/kmines/field.h b/kmines/field.h index 32b959fe..7e079d65 100644 --- a/kmines/field.h +++ b/kmines/field.h @@ -36,12 +36,12 @@ class Field : public FieldFrame, public BaseField static const ActionData ACTION_DATA[Nb_Actions]; public: - Field(QWidget *parent); + Field(TQWidget *parent); - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; void setLevel(const Level &level); - void setReplayField(const QString &field); + void setReplayField(const TQString &field); const Level &level() const { return _level; } void reset(bool init); @@ -74,10 +74,10 @@ class Field : public FieldFrame, public BaseField void addAction(const KGrid2D::Coord &, Field::ActionType); protected: - void paintEvent(QPaintEvent *); - void mousePressEvent(QMouseEvent *); - void mouseReleaseEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); + void paintEvent(TQPaintEvent *); + void mousePressEvent(TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *); private slots: void keyboardAutoRevealSlot(); @@ -104,13 +104,13 @@ class Field : public FieldFrame, public BaseField void changeCase(const KGrid2D::Coord &, CaseState newState); void addMarkAction(const KGrid2D::Coord &, CaseState newS, CaseState oldS); - QPoint toPoint(const KGrid2D::Coord &) const; - KGrid2D::Coord fromPoint(const QPoint &) const; + TQPoint toPoint(const KGrid2D::Coord &) const; + KGrid2D::Coord fromPoint(const TQPoint &) const; - void drawCase(QPainter &, const KGrid2D::Coord &, + void drawCase(TQPainter &, const KGrid2D::Coord &, bool forcePressed = false) const; - int mapMouseButton(QMouseEvent *) const; + int mapMouseButton(TQMouseEvent *) const; void resetAdvised(); void setState(GameState); }; diff --git a/kmines/frame.cpp b/kmines/frame.cpp index a502b87d..6c9446c2 100644 --- a/kmines/frame.cpp +++ b/kmines/frame.cpp @@ -18,18 +18,18 @@ #include "frame.h" -#include <qpainter.h> -#include <qbitmap.h> -#include <qstyle.h> -#include <qdrawutil.h> +#include <tqpainter.h> +#include <tqbitmap.h> +#include <tqstyle.h> +#include <tqdrawutil.h> #include "settings.h" -FieldFrame::FieldFrame(QWidget *parent) - : QFrame(parent, "field"), _button(0) +FieldFrame::FieldFrame(TQWidget *parent) + : TQFrame(parent, "field"), _button(0) { - setFrameStyle( QFrame::Box | QFrame::Raised ); + setFrameStyle( TQFrame::Box | TQFrame::Raised ); setLineWidth(2); setMidLineWidth(2); } @@ -39,7 +39,7 @@ void FieldFrame::adjustSize() setFixedSize(sizeHint()); _button.resize(Settings::caseSize(), Settings::caseSize()); - QBitmap mask; + TQBitmap mask; for (uint i=0; i<Nb_Pixmap_Types; i++) { drawPixmap(mask, (PixmapType)i, true); drawPixmap(_pixmaps[i], (PixmapType)i, false); @@ -51,22 +51,22 @@ void FieldFrame::adjustSize() _advised[i].setMask(mask); } - QFont f = font(); + TQFont f = font(); f.setPointSize(QMAX(1, Settings::caseSize()-6)); f.setBold(true); setFont(f); } -void FieldFrame::initPixmap(QPixmap &pix, bool mask) const +void FieldFrame::initPixmap(TQPixmap &pix, bool mask) const { pix.resize(Settings::caseSize(), Settings::caseSize()); if (mask) pix.fill(color0); } -void FieldFrame::drawPixmap(QPixmap &pix, PixmapType type, bool mask) const +void FieldFrame::drawPixmap(TQPixmap &pix, PixmapType type, bool mask) const { initPixmap(pix, mask); - QPainter p(&pix); + TQPainter p(&pix); if ( type==FlagPixmap ) { p.setWindow(0, 0, 16, 16); @@ -84,7 +84,7 @@ void FieldFrame::drawPixmap(QPixmap &pix, PixmapType type, bool mask) const p.setWindow(0, 0, 20, 20); if ( type==ExplodedPixmap ) p.fillRect(2, 2, 16, 16, (mask ? color1 : Settings::color(Settings::EnumType::explosion))); - QPen pen(mask ? color1 : black, 1); + TQPen pen(mask ? color1 : black, 1); p.setPen(pen); p.setBrush(mask ? color1 : black); p.drawLine(10,3,10,18); @@ -107,37 +107,37 @@ void FieldFrame::drawPixmap(QPixmap &pix, PixmapType type, bool mask) const } } -void FieldFrame::drawAdvised(QPixmap &pix, uint i, bool mask) const +void FieldFrame::drawAdvised(TQPixmap &pix, uint i, bool mask) const { initPixmap(pix, mask); - QPainter p(&pix); + TQPainter p(&pix); p.setWindow(0, 0, 16, 16); - p.setPen( QPen(mask ? color1 : Settings::mineColor(i), 2) ); + p.setPen( TQPen(mask ? color1 : Settings::mineColor(i), 2) ); p.drawRect(3, 3, 11, 11); } -void FieldFrame::drawBox(QPainter &painter, const QPoint &p, - bool pressed, PixmapType type, const QString &text, +void FieldFrame::drawBox(TQPainter &painter, const TQPoint &p, + bool pressed, PixmapType type, const TQString &text, uint nbMines, int advised, bool hasFocus) const { qDrawShadePanel(&painter, p.x(), p.y(), _button.width(), _button.height(), colorGroup(), pressed, 2, - &colorGroup().brush(QColorGroup::Background)); + &colorGroup().brush(TQColorGroup::Background)); if (hasFocus) { painter.translate(p.x(), p.y()); - QRect fbr = style().subRect(QStyle::SR_PushButtonFocusRect, &_button); - style().drawPrimitive(QStyle::PE_FocusRect, &painter, fbr, - colorGroup(), QStyle::Style_Enabled); + TQRect fbr = style().subRect(TQStyle::SR_PushButtonFocusRect, &_button); + style().drawPrimitive(TQStyle::PE_FocusRect, &painter, fbr, + colorGroup(), TQStyle::Style_Enabled); painter.resetXForm(); } - QRect r(p, _button.size()); - const QPixmap *pixmap = (type==NoPixmap ? 0 : &_pixmaps[type]); - QColor color = (nbMines==0 ? black : Settings::mineColor(nbMines-1)); + TQRect r(p, _button.size()); + const TQPixmap *pixmap = (type==NoPixmap ? 0 : &_pixmaps[type]); + TQColor color = (nbMines==0 ? black : Settings::mineColor(nbMines-1)); style().drawItem(&painter, r, AlignCenter, colorGroup(), true, pixmap, text, -1, &color); if ( advised!=-1 ) style().drawItem(&painter, r, AlignCenter, colorGroup(), true, - &_advised[advised], QString::null); + &_advised[advised], TQString::null); } diff --git a/kmines/frame.h b/kmines/frame.h index 91dc1541..280b94c4 100644 --- a/kmines/frame.h +++ b/kmines/frame.h @@ -19,18 +19,18 @@ #ifndef FRAME_H #define FRAME_H -#include <qframe.h> -#include <qpixmap.h> -#include <qpushbutton.h> +#include <tqframe.h> +#include <tqpixmap.h> +#include <tqpushbutton.h> #include "defines.h" class QPainter; -class FieldFrame : public QFrame, public KMines +class FieldFrame : public TQFrame, public KMines { public: - FieldFrame(QWidget *parent); + FieldFrame(TQWidget *parent); protected: enum PixmapType { FlagPixmap = 0, MinePixmap, ExplodedPixmap, @@ -38,19 +38,19 @@ class FieldFrame : public QFrame, public KMines NoPixmap = Nb_Pixmap_Types }; enum { Nb_Advised = 5 }; - void drawBox(QPainter &, const QPoint &, bool pressed, - PixmapType, const QString &text, + void drawBox(TQPainter &, const TQPoint &, bool pressed, + PixmapType, const TQString &text, uint nbMines, int advised, bool hasFocus) const; virtual void adjustSize(); private: - QPushButton _button; - QPixmap _pixmaps[Nb_Pixmap_Types]; - QPixmap _advised[Nb_Advised]; + TQPushButton _button; + TQPixmap _pixmaps[Nb_Pixmap_Types]; + TQPixmap _advised[Nb_Advised]; - void drawPixmap(QPixmap &, PixmapType, bool mask) const; - void drawAdvised(QPixmap &, uint i, bool mask) const; - void initPixmap(QPixmap &, bool mask) const; + void drawPixmap(TQPixmap &, PixmapType, bool mask) const; + void drawAdvised(TQPixmap &, uint i, bool mask) const; + void initPixmap(TQPixmap &, bool mask) const; }; #endif diff --git a/kmines/highscores.cpp b/kmines/highscores.cpp index c0e40c10..565e9bf7 100644 --- a/kmines/highscores.cpp +++ b/kmines/highscores.cpp @@ -38,7 +38,7 @@ ExtManager::ExtManager() setShowStatistics(true); const uint RANGE[16] = { 1, 3120, 3180, 3240, 3300, 3360, 3420, 3480, 3510, 3540, 3550, 3560, 3570, 3580, 3590, 3600 }; - QMemArray<uint> s; + TQMemArray<uint> s; s.duplicate(RANGE, 16); setScoreHistogram(s, ScoreBound); @@ -46,7 +46,7 @@ ExtManager::ExtManager() addScoreItem("nb_actions", item); } -QString ExtManager::gameTypeLabel(uint gameType, LabelType type) const +TQString ExtManager::gameTypeLabel(uint gameType, LabelType type) const { const Level::Data &data = Level::DATA[gameType]; switch (type) { @@ -55,12 +55,12 @@ QString ExtManager::gameTypeLabel(uint gameType, LabelType type) const case I18N: return i18n(Level::LABELS[gameType]); case WW: return data.wwLabel; } - return QString::null; + return TQString::null; } void ExtManager::convertLegacy(uint gameType) { - QString group; + TQString group; switch ((Level::Type)gameType) { case Level::Easy: group = "Easy level"; break; case Level::Normal: group = "Normal level"; break; @@ -69,7 +69,7 @@ void ExtManager::convertLegacy(uint gameType) } KConfigGroupSaver cg(kapp->config(), group); - QString name = cg.config()->readEntry("Name", QString::null); + TQString name = cg.config()->readEntry("Name", TQString::null); if ( name.isNull() ) return; if ( name.isEmpty() ) name = i18n("anonymous"); uint minutes = cg.config()->readUnsignedNumEntry("Min", 0); diff --git a/kmines/highscores.h b/kmines/highscores.h index d1f577a7..5de69535 100644 --- a/kmines/highscores.h +++ b/kmines/highscores.h @@ -31,7 +31,7 @@ class KDE_EXPORT ExtManager : public Manager ExtManager(); private: - QString gameTypeLabel(uint gameTye, LabelType) const; + TQString gameTypeLabel(uint gameTye, LabelType) const; void convertLegacy(uint gameType); bool isStrictlyLess(const Score &s1, const Score &s2) const; }; diff --git a/kmines/kzoommainwindow.cpp b/kmines/kzoommainwindow.cpp index 115d5175..4e1b85a5 100644 --- a/kmines/kzoommainwindow.cpp +++ b/kmines/kzoommainwindow.cpp @@ -30,11 +30,11 @@ KZoomMainWindow::KZoomMainWindow(uint min, uint max, uint step, const char *name { installEventFilter(this); - _zoomInAction = KStdAction::zoomIn(this, SLOT(zoomIn()), actionCollection()); + _zoomInAction = KStdAction::zoomIn(this, TQT_SLOT(zoomIn()), actionCollection()); _zoomOutAction = - KStdAction::zoomOut(this, SLOT(zoomOut()), actionCollection()); + KStdAction::zoomOut(this, TQT_SLOT(zoomOut()), actionCollection()); _menu = - KStdAction::showMenubar(this, SLOT(toggleMenubar()), actionCollection()); + KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); } void KZoomMainWindow::init(const char *popupName) @@ -48,32 +48,32 @@ void KZoomMainWindow::init(const char *popupName) // context popup if (popupName) { - QPopupMenu *popup = - static_cast<QPopupMenu *>(factory()->container(popupName, this)); + TQPopupMenu *popup = + static_cast<TQPopupMenu *>(factory()->container(popupName, this)); Q_ASSERT(popup); if (popup) KContextMenuManager::insert(this, popup); } } -void KZoomMainWindow::addWidget(QWidget *widget) +void KZoomMainWindow::addWidget(TQWidget *widget) { widget->adjustSize(); - QWidget *tlw = widget->topLevelWidget(); + TQWidget *tlw = widget->topLevelWidget(); KZoomMainWindow *zm = static_cast<KZoomMainWindow *>(tlw->qt_cast("KZoomMainWindow")); Q_ASSERT(zm); zm->_widgets.append(widget); - connect(widget, SIGNAL(destroyed()), zm, SLOT(widgetDestroyed())); + connect(widget, TQT_SIGNAL(destroyed()), zm, TQT_SLOT(widgetDestroyed())); } void KZoomMainWindow::widgetDestroyed() { - _widgets.remove(static_cast<const QWidget *>(sender())); + _widgets.remove(static_cast<const TQWidget *>(sender())); } -bool KZoomMainWindow::eventFilter(QObject *o, QEvent *e) +bool KZoomMainWindow::eventFilter(TQObject *o, TQEvent *e) { - if ( e->type()==QEvent::LayoutHint ) + if ( e->type()==TQEvent::LayoutHint ) setFixedSize(minimumSize()); // because K/QMainWindow // does not manage fixed central widget // with hidden menubar... @@ -84,7 +84,7 @@ void KZoomMainWindow::setZoom(uint zoom) { _zoom = zoom; writeZoomSetting(_zoom); - QPtrListIterator<QWidget> it(_widgets); + TQPtrListIterator<TQWidget> it(_widgets); for (; it.current(); ++it) (*it)->adjustSize();; _zoomOutAction->setEnabled( _zoom>_minZoom ); diff --git a/kmines/kzoommainwindow.h b/kmines/kzoommainwindow.h index da8ec96c..d5c80bd4 100644 --- a/kmines/kzoommainwindow.h +++ b/kmines/kzoommainwindow.h @@ -51,7 +51,7 @@ public: * widget is called whenever the zoom is changed. * This function assumes that the topLevelWidget() is the KZoomMainWindow. */ - static void addWidget(QWidget *widget); + static void addWidget(TQWidget *widget); uint zoom() const { return _zoom; } @@ -69,7 +69,7 @@ protected: void init(const char *popupName = 0); virtual void setZoom(uint zoom); - virtual bool eventFilter(QObject *o, QEvent *e); + virtual bool eventFilter(TQObject *o, TQEvent *e); virtual bool queryExit(); /** You need to implement this method since different application @@ -115,7 +115,7 @@ private slots: private: uint _zoom, _zoomStep, _minZoom, _maxZoom; - QPtrList<QWidget> _widgets; + TQPtrList<TQWidget> _widgets; KAction *_zoomInAction, *_zoomOutAction; KToggleAction *_menu; diff --git a/kmines/main.cpp b/kmines/main.cpp index 52620887..6752e7a5 100644 --- a/kmines/main.cpp +++ b/kmines/main.cpp @@ -19,7 +19,7 @@ #include "main.h" #include "main.moc" -#include <qptrvector.h> +#include <tqptrvector.h> #include <kaccel.h> #include <kapplication.h> @@ -43,17 +43,17 @@ #include "dialogs.h" const MainWidget::KeyData MainWidget::KEY_DATA[NB_KEYS] = { -{I18N_NOOP("Move Up"), "keyboard_moveup", Key_Up, SLOT(moveUp())}, -{I18N_NOOP("Move Down"), "keyboard_movedown", Key_Down, SLOT(moveDown())}, -{I18N_NOOP("Move Right"), "keyboard_moveright", Key_Right, SLOT(moveRight())}, -{I18N_NOOP("Move Left"), "keyboard_moveleft", Key_Left, SLOT(moveLeft())}, -{I18N_NOOP("Move at Left Edge"), "keyboard_leftedge", Key_Home, SLOT(moveLeftEdge())}, -{I18N_NOOP("Move at Right Edge"), "keyboard_rightedge", Key_End, SLOT(moveRightEdge())}, -{I18N_NOOP("Move at Top Edge"), "keyboard_topedge", Key_PageUp, SLOT(moveTop())}, -{I18N_NOOP("Move at Bottom Edge"), "keyboard_bottomedge", Key_PageDown, SLOT(moveBottom())}, -{I18N_NOOP("Reveal Mine"), "keyboard_revealmine", Key_Space, SLOT(reveal())}, -{I18N_NOOP("Mark Mine"), "keyboard_markmine", Key_W, SLOT(mark())}, -{I18N_NOOP("Automatic Reveal"), "keyboard_autoreveal", Key_Return, SLOT(autoReveal())} +{I18N_NOOP("Move Up"), "keyboard_moveup", Key_Up, TQT_SLOT(moveUp())}, +{I18N_NOOP("Move Down"), "keyboard_movedown", Key_Down, TQT_SLOT(moveDown())}, +{I18N_NOOP("Move Right"), "keyboard_moveright", Key_Right, TQT_SLOT(moveRight())}, +{I18N_NOOP("Move Left"), "keyboard_moveleft", Key_Left, TQT_SLOT(moveLeft())}, +{I18N_NOOP("Move at Left Edge"), "keyboard_leftedge", Key_Home, TQT_SLOT(moveLeftEdge())}, +{I18N_NOOP("Move at Right Edge"), "keyboard_rightedge", Key_End, TQT_SLOT(moveRightEdge())}, +{I18N_NOOP("Move at Top Edge"), "keyboard_topedge", Key_PageUp, TQT_SLOT(moveTop())}, +{I18N_NOOP("Move at Bottom Edge"), "keyboard_bottomedge", Key_PageDown, TQT_SLOT(moveBottom())}, +{I18N_NOOP("Reveal Mine"), "keyboard_revealmine", Key_Space, TQT_SLOT(reveal())}, +{I18N_NOOP("Mark Mine"), "keyboard_markmine", Key_W, TQT_SLOT(mark())}, +{I18N_NOOP("Automatic Reveal"), "keyboard_autoreveal", Key_Return, TQT_SLOT(autoReveal())} }; @@ -63,17 +63,17 @@ MainWidget::MainWidget() KNotifyClient::startDaemon(); _status = new Status(this); - connect(_status, SIGNAL(gameStateChangedSignal(KMines::GameState)), - SLOT(gameStateChanged(KMines::GameState))); - connect(_status, SIGNAL(pause()), SLOT(pause())); + connect(_status, TQT_SIGNAL(gameStateChangedSignal(KMines::GameState)), + TQT_SLOT(gameStateChanged(KMines::GameState))); + connect(_status, TQT_SIGNAL(pause()), TQT_SLOT(pause())); // Game & Popup - KStdGameAction::gameNew(_status, SLOT(restartGame()), actionCollection()); - _pause = KStdGameAction::pause(_status, SLOT(pauseGame()), + KStdGameAction::gameNew(_status, TQT_SLOT(restartGame()), actionCollection()); + _pause = KStdGameAction::pause(_status, TQT_SLOT(pauseGame()), actionCollection()); - KStdGameAction::highscores(this, SLOT(showHighscores()), + KStdGameAction::highscores(this, TQT_SLOT(showHighscores()), actionCollection()); - KStdGameAction::quit(qApp, SLOT(quit()), actionCollection()); + KStdGameAction::quit(qApp, TQT_SLOT(quit()), actionCollection()); // keyboard _keybCollection = new KActionCollection(this); @@ -84,40 +84,40 @@ MainWidget::MainWidget() } // Settings - KStdAction::preferences(this, SLOT(configureSettings()), + KStdAction::preferences(this, TQT_SLOT(configureSettings()), actionCollection()); - KStdAction::keyBindings(this, SLOT(configureKeys()), actionCollection()); - KStdAction::configureNotifications(this, SLOT(configureNotifications()), + KStdAction::keyBindings(this, TQT_SLOT(configureKeys()), actionCollection()); + KStdAction::configureNotifications(this, TQT_SLOT(configureNotifications()), actionCollection()); - KStdGameAction::configureHighscores(this, SLOT(configureHighscores()), + KStdGameAction::configureHighscores(this, TQT_SLOT(configureHighscores()), actionCollection()); // Levels _levels = KStdGameAction::chooseGameType(0, 0, actionCollection()); - QStringList list; + TQStringList list; for (uint i=0; i<=Level::NB_TYPES; i++) list += i18n(Level::LABELS[i]); _levels->setItems(list); - connect(_levels, SIGNAL(activated(int)), _status, SLOT(newGame(int))); + connect(_levels, TQT_SIGNAL(activated(int)), _status, TQT_SLOT(newGame(int))); // Adviser _advise = - KStdGameAction::hint(_status, SLOT(advise()), actionCollection()); - _solve = KStdGameAction::solve(_status, SLOT(solve()), actionCollection()); - (void)new KAction(i18n("Solving Rate..."), 0, _status, SLOT(solveRate()), + KStdGameAction::hint(_status, TQT_SLOT(advise()), actionCollection()); + _solve = KStdGameAction::solve(_status, TQT_SLOT(solve()), actionCollection()); + (void)new KAction(i18n("Solving Rate..."), 0, _status, TQT_SLOT(solveRate()), actionCollection(), "solve_rate"); // Log (void)new KAction(KGuiItem(i18n("View Log"), "viewmag"), 0, - _status, SLOT(viewLog()), + _status, TQT_SLOT(viewLog()), actionCollection(), "log_view"); (void)new KAction(KGuiItem(i18n("Replay Log"), "player_play"), - 0, _status, SLOT(replayLog()), + 0, _status, TQT_SLOT(replayLog()), actionCollection(), "log_replay"); (void)new KAction(KGuiItem(i18n("Save Log..."), "filesave"), 0, - _status, SLOT(saveLog()), + _status, TQT_SLOT(saveLog()), actionCollection(), "log_save"); (void)new KAction(KGuiItem(i18n("Load Log..."), "fileopen"), 0, - _status, SLOT(loadLog()), + _status, TQT_SLOT(loadLog()), actionCollection(), "log_load"); setupGUI( KMainWindow::Save | Create ); @@ -146,9 +146,9 @@ void MainWidget::showHighscores() KExtHighscore::show(this); } -void MainWidget::focusOutEvent(QFocusEvent *e) +void MainWidget::focusOutEvent(TQFocusEvent *e) { - if ( Settings::pauseFocus() && e->reason()==QFocusEvent::ActiveWindow + if ( Settings::pauseFocus() && e->reason()==TQFocusEvent::ActiveWindow && _status->isPlaying() ) pause(); KMainWindow::focusOutEvent(e); } @@ -163,7 +163,7 @@ void MainWidget::configureSettings() dialog->addPage(new AppearanceConfig, i18n("Appearance"), "style"); CustomConfig *cc = new CustomConfig; dialog->addPage(cc, i18n("Custom Game"), "package_settings"); - connect(dialog, SIGNAL(settingsChanged()), SLOT(settingsChanged())); + connect(dialog, TQT_SIGNAL(settingsChanged()), TQT_SLOT(settingsChanged())); dialog->show(); cc->init(); gc->init(); @@ -177,8 +177,8 @@ void MainWidget::configureHighscores() void MainWidget::settingsChanged() { bool enabled = Settings::keyboardGame(); - QValueList<KAction *> list = _keybCollection->actions(); - QValueList<KAction *>::Iterator it; + TQValueList<KAction *> list = _keybCollection->actions(); + TQValueList<KAction *>::Iterator it; for (it = list.begin(); it!=list.end(); ++it) (*it)->setEnabled(enabled); _status->settingsChanged(); diff --git a/kmines/main.h b/kmines/main.h index 21ec28b1..8cae018a 100644 --- a/kmines/main.h +++ b/kmines/main.h @@ -45,7 +45,7 @@ class MainWidget : public KZoomMainWindow, public KMines void pause(); protected: - virtual void focusOutEvent(QFocusEvent *); + virtual void focusOutEvent(TQFocusEvent *); virtual bool queryExit(); private: diff --git a/kmines/solver/bfield.cpp b/kmines/solver/bfield.cpp index d6c03643..24f5221f 100644 --- a/kmines/solver/bfield.cpp +++ b/kmines/solver/bfield.cpp @@ -58,7 +58,7 @@ void BaseField::reset(uint width, uint height, uint nbMines) fill(tmp); } -bool BaseField::checkField(uint w, uint h, uint nb, const QString &s) +bool BaseField::checkField(uint w, uint h, uint nb, const TQString &s) { if ( s.length()!=w*h ) return false; uint n = 0; @@ -69,7 +69,7 @@ bool BaseField::checkField(uint w, uint h, uint nb, const QString &s) return ( n==nb ); } -void BaseField::initReplay(const QString &s) +void BaseField::initReplay(const TQString &s) { Q_ASSERT( checkField(width(), height(), _nbMines, s) ); @@ -212,9 +212,9 @@ void BaseField::doMark(const Coord &c) changeCase(c, Marked); } -QCString BaseField::string() const +TQCString BaseField::string() const { - QCString s(size()); + TQCString s(size()); for (uint i=0; i<size(); i++) s[i] = (hasMine(coord(i)) ? '1' : '0'); return s; diff --git a/kmines/solver/bfield.h b/kmines/solver/bfield.h index 9c91d41c..a4849ced 100644 --- a/kmines/solver/bfield.h +++ b/kmines/solver/bfield.h @@ -19,7 +19,7 @@ #ifndef BASE_FIELD_H #define BASE_FIELD_H -#include <qcstring.h> +#include <tqcstring.h> #include <krandomsequence.h> #include <kgrid2d.h> @@ -36,8 +36,8 @@ class BaseField : public KGrid2D::Square<KMines::Case>, public KMines void reset(uint width, uint height, uint nbMines); static bool checkField(uint width, uint height, uint nbMines, - const QString &field); - void initReplay(const QString &field); // string == "0100011011000101..." + const TQString &field); + void initReplay(const TQString &field); // string == "0100011011000101..." // -------------------------- // interface used by the solver @@ -56,7 +56,7 @@ class BaseField : public KGrid2D::Square<KMines::Case>, public KMines // ------------------------- uint nbMarked() const { return _nbMarked; } - QCString string() const; + TQCString string() const; void showAllMines(bool won); diff --git a/kmines/solver/solver.cpp b/kmines/solver/solver.cpp index 00807fca..f8607b79 100644 --- a/kmines/solver/solver.cpp +++ b/kmines/solver/solver.cpp @@ -23,9 +23,9 @@ #include <algorithm> #include <assert.h> -#include <qtimer.h> -#include <qlayout.h> -#include <qlabel.h> +#include <tqtimer.h> +#include <tqlayout.h> +#include <tqlabel.h> #include <kprogress.h> #include <klocale.h> @@ -50,8 +50,8 @@ class SolverPrivate #endif }; -Solver::Solver(QObject *parent) - : QObject(parent) +Solver::Solver(TQObject *parent) + : TQObject(parent) { d = new SolverPrivate; @@ -174,7 +174,7 @@ bool Solver::solveStep() } if (_inOneStep) return solveStep(); - else QTimer::singleShot(0, this, SLOT(solveStep())); + else TQTimer::singleShot(0, this, TQT_SLOT(solveStep())); return false; } @@ -186,24 +186,24 @@ bool Solver::solveOneStep(BaseField &field) //----------------------------------------------------------------------------- -SolvingRateDialog::SolvingRateDialog(const BaseField &field, QWidget *parent) +SolvingRateDialog::SolvingRateDialog(const BaseField &field, TQWidget *parent) : KDialogBase(Plain, i18n("Compute Solving Rate"), Ok|Close, Close, parent, "compute_solving_rate", true, true), _refField(field) { - connect(&_solver, SIGNAL(solvingDone(bool)), SLOT(solvingDone(bool))); + connect(&_solver, TQT_SIGNAL(solvingDone(bool)), TQT_SLOT(solvingDone(bool))); KGuiItem item = KStdGuiItem::ok(); item.setText(i18n("Start")); setButtonOK(item); - QVBoxLayout *top = new QVBoxLayout(plainPage(), 0, spacingHint()); - QLabel *label = new QLabel(i18n("Width: %1").arg(field.width()), + TQVBoxLayout *top = new TQVBoxLayout(plainPage(), 0, spacingHint()); + TQLabel *label = new TQLabel(i18n("Width: %1").arg(field.width()), plainPage()); top->addWidget(label); - label = new QLabel(i18n("Height: %1").arg(field.height()), plainPage()); + label = new TQLabel(i18n("Height: %1").arg(field.height()), plainPage()); top->addWidget(label); - label = new QLabel(i18n("Mines: %1 (%2%)").arg(field.nbMines()) + label = new TQLabel(i18n("Mines: %1 (%2%)").arg(field.nbMines()) .arg( field.nbMines() * 100.0 / field.size()), plainPage()); top->addWidget(label); @@ -215,7 +215,7 @@ SolvingRateDialog::SolvingRateDialog(const BaseField &field, QWidget *parent) _progress->setFormat("%v"); top->addWidget(_progress); - _label = new QLabel(i18n("Success rate:"), plainPage()); + _label = new TQLabel(i18n("Success rate:"), plainPage()); top->addWidget(_label); } @@ -225,7 +225,7 @@ void SolvingRateDialog::slotOk() _i = 0; _success = 0; _progress->setValue(0); - QTimer::singleShot(0, this, SLOT(step())); + TQTimer::singleShot(0, this, TQT_SLOT(step())); } void SolvingRateDialog::step() @@ -245,5 +245,5 @@ void SolvingRateDialog::solvingDone(bool success) _label->setText(i18n("Success rate: %1%") .arg(_success * 100.0 / _i, 0, 'f', 3)); _progress->advance(1); - QTimer::singleShot(0, this, SLOT(step())); + TQTimer::singleShot(0, this, TQT_SLOT(step())); } diff --git a/kmines/solver/solver.h b/kmines/solver/solver.h index f076874e..22d6c591 100644 --- a/kmines/solver/solver.h +++ b/kmines/solver/solver.h @@ -33,7 +33,7 @@ class Solver : public QObject { Q_OBJECT public: - Solver(QObject *parent = 0); + Solver(TQObject *parent = 0); ~Solver(); /** A method to advice a point placement */ @@ -63,7 +63,7 @@ class SolvingRateDialog : public KDialogBase { Q_OBJECT public: - SolvingRateDialog(const BaseField &field, QWidget *parent); + SolvingRateDialog(const BaseField &field, TQWidget *parent); private slots: void step(); @@ -75,7 +75,7 @@ class SolvingRateDialog : public KDialogBase BaseField _field; Solver _solver; uint _i, _success; - QLabel *_label; + TQLabel *_label; KProgress *_progress; static const uint NB_STEPS = 200; diff --git a/kmines/solver/test.cpp b/kmines/solver/test.cpp index dd56d7a0..ed42da70 100644 --- a/kmines/solver/test.cpp +++ b/kmines/solver/test.cpp @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) for(pmi = pm.begin(); pmi != pm.end(); ++pmi) pic[pmi->second.second][pmi->second.first] = pmi->first; - QString s; + TQString s; for(uint i=0;i<H;++i) { for(uint j=0;j<W;++j) cout << s.sprintf("%+.02f ", pic[i][j]).latin1(); diff --git a/kmines/status.cpp b/kmines/status.cpp index a3d5f061..ec9dfc3e 100644 --- a/kmines/status.cpp +++ b/kmines/status.cpp @@ -19,13 +19,13 @@ #include "status.h" #include "status.moc" -#include <qpainter.h> -#include <qpixmap.h> -#include <qwhatsthis.h> -#include <qlayout.h> -#include <qwidgetstack.h> -#include <qtextedit.h> -#include <qtimer.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqwhatsthis.h> +#include <tqlayout.h> +#include <tqwidgetstack.h> +#include <tqtextedit.h> +#include <tqtimer.h> #include <kapplication.h> #include <klocale.h> @@ -45,27 +45,27 @@ #include "version.h" -Status::Status(QWidget *parent) - : QWidget(parent, "status"), _oldLevel(Level::Easy) +Status::Status(TQWidget *parent) + : TQWidget(parent, "status"), _oldLevel(Level::Easy) { - _timer = new QTimer(this); - connect(_timer, SIGNAL(timeout()), SLOT(replayStep())); + _timer = new TQTimer(this); + connect(_timer, TQT_SIGNAL(timeout()), TQT_SLOT(replayStep())); _solver = new Solver(this); - connect(_solver, SIGNAL(solvingDone(bool)), SLOT(solvingDone(bool))); + connect(_solver, TQT_SIGNAL(solvingDone(bool)), TQT_SLOT(solvingDone(bool))); // top layout - QGridLayout *top = new QGridLayout(this, 2, 5, 10, 10); + TQGridLayout *top = new TQGridLayout(this, 2, 5, 10, 10); top->setColStretch(1, 1); top->setColStretch(3, 1); // status bar // mines left LCD left = new KGameLCD(5, this); - left->setFrameStyle(QFrame::Panel | QFrame::Sunken); + left->setFrameStyle(TQFrame::Panel | TQFrame::Sunken); left->setDefaultBackgroundColor(black); left->setDefaultColor(white); - QWhatsThis::add(left, i18n("<qt>Mines left.<br/>" + TQWhatsThis::add(left, i18n("<qt>Mines left.<br/>" "It turns <font color=\"red\">red</font> " "when you have flagged more cases than " "present mines.</qt>")); @@ -73,14 +73,14 @@ Status::Status(QWidget *parent) // smiley smiley = new Smiley(this); - connect(smiley, SIGNAL(clicked()), SLOT(smileyClicked())); - smiley->setFocusPolicy(QWidget::NoFocus); - QWhatsThis::add(smiley, i18n("Press to start a new game")); + connect(smiley, TQT_SIGNAL(clicked()), TQT_SLOT(smileyClicked())); + smiley->setFocusPolicy(TQWidget::NoFocus); + TQWhatsThis::add(smiley, i18n("Press to start a new game")); top->addWidget(smiley, 0, 2); // digital clock LCD dg = new DigitalClock(this); - QWhatsThis::add(dg, i18n("<qt>Time elapsed.<br/>" + TQWhatsThis::add(dg, i18n("<qt>Time elapsed.<br/>" "It turns <font color=\"blue\">blue</font> " "if it is a highscore " "and <font color=\"red\">red</font> " @@ -88,32 +88,32 @@ Status::Status(QWidget *parent) top->addWidget(dg, 0, 4); // mines field - _fieldContainer = new QWidget(this); - QGridLayout *g = new QGridLayout(_fieldContainer, 1, 1); + _fieldContainer = new TQWidget(this); + TQGridLayout *g = new TQGridLayout(_fieldContainer, 1, 1); _field = new Field(_fieldContainer); _field->readSettings(); g->addWidget(_field, 0, 0, AlignCenter); - connect( _field, SIGNAL(updateStatus(bool)), SLOT(updateStatus(bool)) ); - connect(_field, SIGNAL(gameStateChanged(GameState)), - SLOT(gameStateChangedSlot(GameState)) ); - connect(_field, SIGNAL(setMood(Mood)), smiley, SLOT(setMood(Mood))); - connect(_field, SIGNAL(setCheating()), dg, SLOT(setCheating())); - connect(_field,SIGNAL(addAction(const KGrid2D::Coord &, Field::ActionType)), - SLOT(addAction(const KGrid2D::Coord &, Field::ActionType))); - QWhatsThis::add(_field, i18n("Mines field.")); + connect( _field, TQT_SIGNAL(updateStatus(bool)), TQT_SLOT(updateStatus(bool)) ); + connect(_field, TQT_SIGNAL(gameStateChanged(GameState)), + TQT_SLOT(gameStateChangedSlot(GameState)) ); + connect(_field, TQT_SIGNAL(setMood(Mood)), smiley, TQT_SLOT(setMood(Mood))); + connect(_field, TQT_SIGNAL(setCheating()), dg, TQT_SLOT(setCheating())); + connect(_field,TQT_SIGNAL(addAction(const KGrid2D::Coord &, Field::ActionType)), + TQT_SLOT(addAction(const KGrid2D::Coord &, Field::ActionType))); + TQWhatsThis::add(_field, i18n("Mines field.")); // resume button - _resumeContainer = new QWidget(this); - g = new QGridLayout(_resumeContainer, 1, 1); - QFont f = font(); + _resumeContainer = new TQWidget(this); + g = new TQGridLayout(_resumeContainer, 1, 1); + TQFont f = font(); f.setBold(true); - QPushButton *pb - = new QPushButton(i18n("Press to Resume"), _resumeContainer); + TQPushButton *pb + = new TQPushButton(i18n("Press to Resume"), _resumeContainer); pb->setFont(f); - connect(pb, SIGNAL(clicked()), SIGNAL(pause())); + connect(pb, TQT_SIGNAL(clicked()), TQT_SIGNAL(pause())); g->addWidget(pb, 0, 0, AlignCenter); - _stack = new QWidgetStack(this); + _stack = new TQWidgetStack(this); _stack->addWidget(_fieldContainer); _stack->addWidget(_resumeContainer); _stack->raiseWidget(_fieldContainer); @@ -176,7 +176,7 @@ void Status::settingsChanged() void Status::updateStatus(bool mine) { int r = _field->nbMines() - _field->nbMarked(); - QColor color = (r<0 && !_field->isSolved() ? red : white); + TQColor color = (r<0 && !_field->isSolved() ? red : white); left->setColor(color); left->display(r); @@ -207,14 +207,14 @@ void Status::setGameOver(bool won) if ( Settings::magicReveal() ) _logRoot.setAttribute("complete_reveal", "true"); - QString sa = "none"; + TQString sa = "none"; if ( _field->solvingState()==Solved ) sa = "solving"; else if ( _field->solvingState()==Advised ) sa = "advising"; _logRoot.setAttribute("solver", sa); - QDomElement f = _log.createElement("Field"); + TQDomElement f = _log.createElement("Field"); _logRoot.appendChild(f); - QDomText data = _log.createTextNode(_field->string()); + TQDomText data = _log.createTextNode(_field->string()); f.appendChild(data); } @@ -235,10 +235,10 @@ void Status::setPlaying() // game log const Level &level = _field->level(); - _log = QDomDocument("kmineslog"); + _log = TQDomDocument("kmineslog"); _logRoot = _log.createElement("kmineslog"); _logRoot.setAttribute("version", SHORT_VERSION); - QDateTime date = QDateTime::currentDateTime(); + TQDateTime date = TQDateTime::currentDateTime(); _logRoot.setAttribute("date", date.toString(Qt::ISODate)); _logRoot.setAttribute("width", level.width()); _logRoot.setAttribute("height", level.height()); @@ -250,7 +250,7 @@ void Status::setPlaying() void Status::gameStateChanged(GameState state, bool won) { - QWidget *w = _fieldContainer; + TQWidget *w = _fieldContainer; switch (state) { case Playing: @@ -282,7 +282,7 @@ void Status::gameStateChanged(GameState state, bool won) void Status::addAction(const KGrid2D::Coord &c, Field::ActionType type) { - QDomElement action = _log.createElement("Action"); + TQDomElement action = _log.createElement("Action"); action.setAttribute("time", dg->pretty()); action.setAttribute("column", c.first); action.setAttribute("line", c.second); @@ -296,7 +296,7 @@ void Status::advise() int res = KMessageBox::warningContinueCancel(this, i18n("When the solver gives " "you advice, your score will not be added to the highscores."), - QString::null, QString::null, "advice_warning"); + TQString::null, TQString::null, "advice_warning"); if ( res==KMessageBox::Cancel ) return; dg->setCheating(); float probability; @@ -326,7 +326,7 @@ void Status::viewLog() { KDialogBase d(this, "view_log", true, i18n("View Game Log"), KDialogBase::Close, KDialogBase::Close); - QTextEdit *view = new QTextEdit(&d); + TQTextEdit *view = new TQTextEdit(&d); view->setReadOnly(true); view->setTextFormat(PlainText); view->setText(_log.toString()); @@ -337,7 +337,7 @@ void Status::viewLog() void Status::saveLog() { - KURL url = KFileDialog::getSaveURL(QString::null, QString::null, this); + KURL url = KFileDialog::getSaveURL(TQString::null, TQString::null, this); if ( url.isEmpty() ) return; if ( KIO::NetAccess::exists(url, false, this) ) { KGuiItem gi = KStdGuiItem::save(); @@ -356,13 +356,13 @@ void Status::saveLog() void Status::loadLog() { - KURL url = KFileDialog::getOpenURL(QString::null, QString::null, this); + KURL url = KFileDialog::getOpenURL(TQString::null, TQString::null, this); if ( url.isEmpty() ) return; - QString tmpFile; + TQString tmpFile; bool success = false; - QDomDocument doc; + TQDomDocument doc; if( KIO::NetAccess::download(url, tmpFile, this) ) { - QFile file(tmpFile); + TQFile file(tmpFile); if ( file.open(IO_ReadOnly) ) { int errorLine; bool ok = doc.setContent(&file, 0, &errorLine); @@ -390,11 +390,11 @@ void Status::loadLog() } } -bool Status::checkLog(const QDomDocument &doc) +bool Status::checkLog(const TQDomDocument &doc) { // check root element if ( doc.doctype().name()!="kmineslog" ) return false; - QDomElement root = doc.namedItem("kmineslog").toElement(); + TQDomElement root = doc.namedItem("kmineslog").toElement(); if ( root.isNull() ) return false; bool ok; uint w = root.attribute("width").toUInt(&ok); @@ -407,24 +407,24 @@ bool Status::checkLog(const QDomDocument &doc) if ( !ok || nb==0 || nb>Level::maxNbMines(w, h) ) return false; // check field - QDomElement field = root.namedItem("Field").toElement(); + TQDomElement field = root.namedItem("Field").toElement(); if ( field.isNull() ) return false; - QString ftext = field.text(); + TQString ftext = field.text(); if ( !BaseField::checkField(w, h, nb, ftext) ) return false; // check action list - QDomElement list = root.namedItem("ActionList").toElement(); + TQDomElement list = root.namedItem("ActionList").toElement(); if ( list.isNull() ) return false; - QDomNodeList actions = list.elementsByTagName("Action"); + TQDomNodeList actions = list.elementsByTagName("Action"); if ( actions.count()==0 ) return false; for (uint i=0; i<actions.count(); i++) { - QDomElement a = actions.item(i).toElement(); + TQDomElement a = actions.item(i).toElement(); if ( a.isNull() ) return false; uint i0 = a.attribute("line").toUInt(&ok); if ( !ok || i0>=h ) return false; uint j = a.attribute("column").toUInt(&ok); if ( !ok || j>=w ) return false; - QString type = a.attribute("type"); + TQString type = a.attribute("type"); uint k = 0; for (; k<Field::Nb_Actions; k++) if ( type==Field::ACTION_DATA[k].name ) break; @@ -441,11 +441,11 @@ void Status::replayLog() uint h = _logRoot.attribute("height").toUInt(); uint n = _logRoot.attribute("mines").toUInt(); Level level(w, h, n); - QDomNode f = _logRoot.namedItem("Field"); + TQDomNode f = _logRoot.namedItem("Field"); _oldLevel = _field->level(); newGame(level); _field->setReplayField(f.toElement().text()); - QString s = _logRoot.attribute("complete_reveal"); + TQString s = _logRoot.attribute("complete_reveal"); _completeReveal = ( s=="true" ); f = _logRoot.namedItem("ActionList"); @@ -458,16 +458,16 @@ void Status::replayStep() { if ( _index>=_actions.count() ) { _timer->stop(); - _actions = QDomNodeList(); + _actions = TQDomNodeList(); return; } _timer->changeInterval(200); - QDomElement a = _actions.item(_index).toElement(); + TQDomElement a = _actions.item(_index).toElement(); dg->setTime(a.attribute("time")); uint i = a.attribute("column").toUInt(); uint j = a.attribute("line").toUInt(); - QString type = a.attribute("type"); + TQString type = a.attribute("type"); for (uint k=0; k<Field::Nb_Actions; k++) if ( type==Field::ACTION_DATA[k].name ) { _field->doAction((Field::ActionType)k, diff --git a/kmines/status.h b/kmines/status.h index 6fd06a76..4249fe82 100644 --- a/kmines/status.h +++ b/kmines/status.h @@ -19,7 +19,7 @@ #ifndef STATUS_H #define STATUS_H -#include <qdom.h> +#include <tqdom.h> #include "field.h" @@ -30,11 +30,11 @@ class Solver; class QWidgetStack; class QTimer; -class Status : public QWidget, public KMines +class Status : public TQWidget, public KMines { Q_OBJECT public : - Status(QWidget *parent); + Status(TQWidget *parent); const Level ¤tLevel() const { return _field->level(); } bool isPlaying() const { return _field->gameState()==Playing; } @@ -84,28 +84,28 @@ class Status : public QWidget, public KMines private: Field *_field; - QWidget *_fieldContainer, *_resumeContainer; - QWidgetStack *_stack; + TQWidget *_fieldContainer, *_resumeContainer; + TQWidgetStack *_stack; Smiley *smiley; KGameLCD *left; DigitalClock *dg; Solver *_solver; - QDomDocument _log; - QDomElement _logRoot, _logList; - QDomNodeList _actions; + TQDomDocument _log; + TQDomElement _logRoot, _logList; + TQDomNodeList _actions; uint _index; bool _completeReveal; Level _oldLevel; - QTimer *_timer; + TQTimer *_timer; void setGameOver(bool won); void setStopped(); void setPlaying(); void newGame(const Level &); void gameStateChanged(GameState, bool won); - static bool checkLog(const QDomDocument &); + static bool checkLog(const TQDomDocument &); }; #endif // STATUS_H diff --git a/knetwalk/src/cell.cpp b/knetwalk/src/cell.cpp index 4d561cec..a08b0d78 100644 --- a/knetwalk/src/cell.cpp +++ b/knetwalk/src/cell.cpp @@ -12,8 +12,8 @@ * GNU General Public License for more details. * ***************************************************************************/ -#include <qpainter.h> -#include <qimage.h> +#include <tqpainter.h> +#include <tqimage.h> #include <kglobal.h> #include <kiconloader.h> @@ -26,7 +26,7 @@ Cell::PixmapMap Cell::disconnectedpixmap; void Cell::initPixmaps() { - typedef QMap<int, QString> NamesMap; + typedef TQMap<int, TQString> NamesMap; NamesMap names; names[L] = "0001"; names[D] = "0010"; @@ -46,10 +46,10 @@ void Cell::initPixmaps() NamesMap::ConstIterator it; for(it = names.constBegin(); it != names.constEnd(); ++it) { - connectedpixmap[it.key()]=new QPixmap(KGlobal::iconLoader()->loadIcon( + connectedpixmap[it.key()]=new TQPixmap(KGlobal::iconLoader()->loadIcon( locate("data","knetwalk/cable"+it.data()+".png"), KIcon::NoGroup, 32) ); - QImage image = connectedpixmap[it.key()]->convertToImage(); + TQImage image = connectedpixmap[it.key()]->convertToImage(); for(int y = 0; y < image.height(); y++) { QRgb* line = (QRgb*)image.scanLine(y); @@ -65,11 +65,11 @@ void Cell::initPixmaps() } } } - disconnectedpixmap[it.key()] = new QPixmap(image); + disconnectedpixmap[it.key()] = new TQPixmap(image); } } -Cell::Cell(QWidget* parent, int i) : QWidget(parent, 0, WNoAutoErase) +Cell::Cell(TQWidget* parent, int i) : TQWidget(parent, 0, WNoAutoErase) { angle = 0; light = 0; @@ -146,7 +146,7 @@ void Cell::setLight(int l) update(); } -void Cell::paintEvent(QPaintEvent*) +void Cell::paintEvent(TQPaintEvent*) { if(changed) { @@ -157,12 +157,12 @@ void Cell::paintEvent(QPaintEvent*) pixmap = KGlobal::iconLoader()->loadIcon(locate("data", "knetwalk/background.png"), KIcon::NoGroup, 32); } - QPainter paint; + TQPainter paint; paint.begin(&pixmap); if(light) { - paint.setPen(QPen(white, 5)); + paint.setPen(TQPen(white, 5)); paint.drawLine(0, width() - light, width(), 2 * width() - light); } @@ -181,7 +181,7 @@ void Cell::paintEvent(QPaintEvent*) else paint.drawPixmap(int(-offset), int(-offset), *disconnectedpixmap[ddirs]); paint.resetXForm(); - QPixmap pix; + TQPixmap pix; if(root) { @@ -201,7 +201,7 @@ void Cell::paintEvent(QPaintEvent*) bitBlt(this, 0, 0, &pixmap); } -void Cell::mousePressEvent(QMouseEvent* e) +void Cell::mousePressEvent(TQMouseEvent* e) { if(e->button() == LeftButton) emit lClicked(iindex); diff --git a/knetwalk/src/cell.h b/knetwalk/src/cell.h index 2dd5009c..8e51e349 100644 --- a/knetwalk/src/cell.h +++ b/knetwalk/src/cell.h @@ -15,15 +15,15 @@ #ifndef CELL_H #define CELL_H -#include <qpixmap.h> -#include <qwidget.h> +#include <tqpixmap.h> +#include <tqwidget.h> class Cell : public QWidget { Q_OBJECT public: enum Dirs { Free = 0, U = 1, R = 2, D = 4, L = 8, None = 16 }; - Cell(QWidget* parent, int i); + Cell(TQWidget* parent, int i); int index() const; void rotate(int a); void setDirs(Dirs d); @@ -41,10 +41,10 @@ class Cell : public QWidget void rClicked(int); void mClicked(int); protected: - virtual void paintEvent(QPaintEvent*); - virtual void mousePressEvent(QMouseEvent*); + virtual void paintEvent(TQPaintEvent*); + virtual void mousePressEvent(TQMouseEvent*); private: - typedef QMap<int, QPixmap*> PixmapMap; + typedef TQMap<int, TQPixmap*> PixmapMap; static PixmapMap connectedpixmap; static PixmapMap disconnectedpixmap; int angle; @@ -55,7 +55,7 @@ class Cell : public QWidget bool root; bool locked; Dirs ddirs; - QPixmap pixmap; + TQPixmap pixmap; }; #endif diff --git a/knetwalk/src/highscores.cpp b/knetwalk/src/highscores.cpp index 28742662..4bcbf922 100644 --- a/knetwalk/src/highscores.cpp +++ b/knetwalk/src/highscores.cpp @@ -31,14 +31,14 @@ namespace KExtHighscore setShowStatistics(true); */ const uint RANGE[16] = { 0, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160 }; - QMemArray<uint> s; + TQMemArray<uint> s; s.duplicate(RANGE, 16); setScoreHistogram(s, ScoreNotBound); //Item *item = new Item((uint)0, i18n("Clicks"), Qt::AlignRight); //addScoreItem("nb_actions", item); } - QString ExtManager::gameTypeLabel(uint gameType, LabelType /*type*/) const + TQString ExtManager::gameTypeLabel(uint gameType, LabelType /*type*/) const { /*const Level::Data &data = Level::DATA[gameType]; switch (type) { @@ -47,13 +47,13 @@ namespace KExtHighscore case I18N: return i18n(level[gameType]); case WW: return data.wwLabel; } - return QString::null;*/ + return TQString::null;*/ return i18n(levels[gameType]); } void ExtManager::convertLegacy(uint gameType) { - QString group; + TQString group; switch (gameType) { case Settings::EnumSkill::Novice: group = "Novice level"; break; @@ -64,7 +64,7 @@ namespace KExtHighscore } KConfigGroupSaver cg(kapp->config(), group); - QString name = cg.config()->readEntry("Name", QString::null); + TQString name = cg.config()->readEntry("Name", TQString::null); if ( name.isNull() ) return; if ( name.isEmpty() ) name = i18n("anonymous"); int score = cg.config()->readNumEntry("score", 0); diff --git a/knetwalk/src/highscores.h b/knetwalk/src/highscores.h index c9f4f7af..67ff21ae 100644 --- a/knetwalk/src/highscores.h +++ b/knetwalk/src/highscores.h @@ -27,7 +27,7 @@ namespace KExtHighscore ExtManager(); private: - QString gameTypeLabel(uint gameTye, LabelType) const; + TQString gameTypeLabel(uint gameTye, LabelType) const; void convertLegacy(uint gameType); bool isStrictlyLess(const Score &s1, const Score &s2) const; }; diff --git a/knetwalk/src/mainwindow.cpp b/knetwalk/src/mainwindow.cpp index 15e615ed..17fa9b82 100644 --- a/knetwalk/src/mainwindow.cpp +++ b/knetwalk/src/mainwindow.cpp @@ -12,20 +12,20 @@ * GNU General Public License for more details. * ***************************************************************************/ -#include <qaction.h> -#include <qapplication.h> -#include <qeventloop.h> -#include <qgrid.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qprocess.h> -#include <qpushbutton.h> -#include <qsettings.h> -#include <qsound.h> -#include <qtimer.h> -#include <qtoolbutton.h> -#include <qwhatsthis.h> +#include <tqaction.h> +#include <tqapplication.h> +#include <tqeventloop.h> +#include <tqgrid.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqprocess.h> +#include <tqpushbutton.h> +#include <tqsettings.h> +#include <tqsound.h> +#include <tqtimer.h> +#include <tqtoolbutton.h> +#include <tqwhatsthis.h> #include <stdio.h> #include <stdlib.h> @@ -50,9 +50,9 @@ #include "cell.h" #include "mainwindow.h" -static QMap<Cell::Dirs, Cell::Dirs> contrdirs; +static TQMap<Cell::Dirs, Cell::Dirs> contrdirs; -MainWindow::MainWindow(QWidget *parent, const char* name, WFlags /*fl*/) : +MainWindow::MainWindow(TQWidget *parent, const char* name, WFlags /*fl*/) : KMainWindow(parent, name, WStyle_NoBorder) { m_clickcount = 0; @@ -64,14 +64,14 @@ MainWindow::MainWindow(QWidget *parent, const char* name, WFlags /*fl*/) : KNotifyClient::startDaemon(); - KStdGameAction::gameNew(this, SLOT(slotNewGame()), actionCollection()); + KStdGameAction::gameNew(this, TQT_SLOT(slotNewGame()), actionCollection()); - KStdGameAction::highscores(this, SLOT(showHighscores()), actionCollection()); - KStdGameAction::quit(this, SLOT(close()), actionCollection()); - KStdGameAction::configureHighscores(this, SLOT(configureHighscores()), actionCollection()); + KStdGameAction::highscores(this, TQT_SLOT(showHighscores()), actionCollection()); + KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdGameAction::configureHighscores(this, TQT_SLOT(configureHighscores()), actionCollection()); m_levels = KStdGameAction::chooseGameType(0, 0, actionCollection()); - QStringList lst; + TQStringList lst; lst += i18n("Novice"); lst += i18n("Normal"); lst += i18n("Expert"); @@ -83,10 +83,10 @@ MainWindow::MainWindow(QWidget *parent, const char* name, WFlags /*fl*/) : statusBar()->insertItem("abcdefghijklmnopqrst: 0 ",1); setAutoSaveSettings(); createGUI(); - connect(m_levels, SIGNAL(activated(int)), this, SLOT(newGame(int))); + connect(m_levels, TQT_SIGNAL(activated(int)), this, TQT_SLOT(newGame(int))); - QWhatsThis::add(this, i18n("<h3>Rules of the Game</h3>" + TQWhatsThis::add(this, i18n("<h3>Rules of the Game</h3>" "<p>You are the system administrator and your goal" " is to connect each computer to the central server." "<p>Click the right mouse button to turn the cable" @@ -98,8 +98,8 @@ MainWindow::MainWindow(QWidget *parent, const char* name, WFlags /*fl*/) : const int cellsize = 32; const int gridsize = cellsize * MasterBoardSize + 2; - QGrid* grid = new QGrid(MasterBoardSize, this); - grid->setFrameStyle(QFrame::Panel | QFrame::Sunken); + TQGrid* grid = new TQGrid(MasterBoardSize, this); + grid->setFrameStyle(TQFrame::Panel | TQFrame::Sunken); grid->setFixedSize(gridsize, gridsize); setCentralWidget(grid); @@ -108,9 +108,9 @@ MainWindow::MainWindow(QWidget *parent, const char* name, WFlags /*fl*/) : { board[i] = new Cell(grid, i); board[i]->setFixedSize(cellsize, cellsize); - connect(board[i], SIGNAL(lClicked(int)), SLOT(lClicked(int))); - connect(board[i], SIGNAL(rClicked(int)), SLOT(rClicked(int))); - connect(board[i], SIGNAL(mClicked(int)), SLOT(mClicked(int))); + connect(board[i], TQT_SIGNAL(lClicked(int)), TQT_SLOT(lClicked(int))); + connect(board[i], TQT_SIGNAL(rClicked(int)), TQT_SLOT(rClicked(int))); + connect(board[i], TQT_SIGNAL(mClicked(int)), TQT_SLOT(mClicked(int))); } srand(time(0)); @@ -148,8 +148,8 @@ void MainWindow::newGame(int sk) Settings::writeConfig(); m_clickcount = 0; - QString clicks = i18n("Click: %1"); - statusBar()->changeItem(clicks.arg(QString::number(m_clickcount)),1); + TQString clicks = i18n("Click: %1"); + statusBar()->changeItem(clicks.arg(TQString::number(m_clickcount)),1); KNotifyClient::event(winId(), "startsound", i18n("New Game")); for(int i = 0; i < MasterBoardSize * MasterBoardSize; i++) @@ -276,7 +276,7 @@ void MainWindow::addRandomDir(CellList& list) Cell* dcell = dCell(cell); Cell* lcell = lCell(cell); - typedef QMap<Cell::Dirs, Cell*> CellMap; + typedef TQMap<Cell::Dirs, Cell*> CellMap; CellMap freecells; if(ucell && ucell->dirs() == Cell::Free) freecells[Cell::U] = ucell; @@ -359,9 +359,9 @@ void MainWindow::rotate(int index, bool toleft) updateConnections(); for(int i = 0; i < 14; i++) { - kapp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput); - QTimer::singleShot(20, board[index], SLOT(update())); - kapp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput | QEventLoop::WaitForMore); + kapp->eventLoop()->processEvents(TQEventLoop::ExcludeUserInput); + TQTimer::singleShot(20, board[index], TQT_SLOT(update())); + kapp->eventLoop()->processEvents(TQEventLoop::ExcludeUserInput | TQEventLoop::WaitForMore); board[index]->rotate(toleft ? -6 : 6); } @@ -369,8 +369,8 @@ void MainWindow::rotate(int index, bool toleft) KNotifyClient::event(winId(), "connectsound"); m_clickcount++; - QString clicks = i18n("Click: %1"); - statusBar()->changeItem(clicks.arg(QString::number(m_clickcount)),1); + TQString clicks = i18n("Click: %1"); + statusBar()->changeItem(clicks.arg(TQString::number(m_clickcount)),1); if (isGameOver()) { @@ -388,10 +388,10 @@ void MainWindow::blink(int index) { for(int i = 0; i < board[index]->width() * 2; i += 2) { - kapp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput); - QTimer::singleShot(20, board[index], SLOT(update())); - kapp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput | - QEventLoop::WaitForMore); + kapp->eventLoop()->processEvents(TQEventLoop::ExcludeUserInput); + TQTimer::singleShot(20, board[index], TQT_SLOT(update())); + kapp->eventLoop()->processEvents(TQEventLoop::ExcludeUserInput | + TQEventLoop::WaitForMore); board[index]->setLight(i); } board[index]->setLight(0); @@ -408,7 +408,7 @@ bool MainWindow::isGameOver() return true; } -void MainWindow::closeEvent(QCloseEvent* event) +void MainWindow::closeEvent(TQCloseEvent* event) { event->accept(); } diff --git a/knetwalk/src/mainwindow.h b/knetwalk/src/mainwindow.h index c28b6ed6..622db60c 100644 --- a/knetwalk/src/mainwindow.h +++ b/knetwalk/src/mainwindow.h @@ -28,9 +28,9 @@ class MainWindow : public KMainWindow { Q_OBJECT public: - MainWindow(QWidget *parent=0, const char* name=0, WFlags fl=0); + MainWindow(TQWidget *parent=0, const char* name=0, WFlags fl=0); protected: - virtual void closeEvent(QCloseEvent*); + virtual void closeEvent(TQCloseEvent*); private: //enum Skill { Novice, Normal, Expert, Master }; enum BoardSize @@ -45,7 +45,7 @@ class MainWindow : public KMainWindow NumHighscores = 10, MinimumNumCells = 20 }; - typedef QValueList<Cell*> CellList; + typedef TQValueList<Cell*> CellList; public slots: void slotNewGame(); void newGame(int); @@ -64,30 +64,30 @@ class MainWindow : public KMainWindow Cell* lCell(Cell* cell) const; Cell* rCell(Cell* cell) const; bool isGameOver(); - bool startBrowser(const QString& url); + bool startBrowser(const TQString& url); bool updateConnections(); void blink(int index); void rotate(int index, bool toleft); void addRandomDir(CellList& list); - void dialog(const QString& caption, const QString& text); + void dialog(const TQString& caption, const TQString& text); private: bool wrapped; Cell* root; Cell* board[MasterBoardSize * MasterBoardSize]; - QSound* clicksound; - QSound* connectsound; - QSound* startsound; - QSound* turnsound; - QSound* winsound; + TQSound* clicksound; + TQSound* connectsound; + TQSound* startsound; + TQSound* turnsound; + TQSound* winsound; - QString username; - QString soundpath; - QAction* soundaction; - QStringList highscores; - QLCDNumber* lcd; - QPopupMenu* gamemenu; - QPopupMenu* skillmenu; + TQString username; + TQString soundpath; + TQAction* soundaction; + TQStringList highscores; + TQLCDNumber* lcd; + TQPopupMenu* gamemenu; + TQPopupMenu* skillmenu; int m_clickcount; KSelectAction* m_levels; diff --git a/kolf/ball.cpp b/kolf/ball.cpp index 8adaa8cb..9ac849bc 100644 --- a/kolf/ball.cpp +++ b/kolf/ball.cpp @@ -1,6 +1,6 @@ -#include <qcanvas.h> -#include <qcolor.h> -#include <qpen.h> +#include <tqcanvas.h> +#include <tqcolor.h> +#include <tqpen.h> #include <kapplication.h> #include <kdebug.h> @@ -15,8 +15,8 @@ #include "game.h" #include "ball.h" -Ball::Ball(QCanvas *canvas) - : QCanvasEllipse(canvas) +Ball::Ball(TQCanvas *canvas) + : TQCanvasEllipse(canvas) { m_doDetect = true; m_collisionLock = false; @@ -29,9 +29,9 @@ Ball::Ball(QCanvas *canvas) m_placeOnGround = false; m_forceStillGoing = false; frictionMultiplier = 1.0; - QFont font(kapp->font()); + TQFont font(kapp->font()); //font.setPixelSize(10); - label = new QCanvasText("", font, canvas); + label = new TQCanvasText("", font, canvas); label->setColor(white); label->setVisible(false); @@ -98,7 +98,7 @@ void Ball::friction() void Ball::setVelocity(double vx, double vy) { - QCanvasEllipse::setVelocity(vx, vy); + TQCanvasEllipse::setVelocity(vx, vy); if (vx == 0 && vy == 0) { @@ -123,7 +123,7 @@ void Ball::setVector(const Vector &newVector) return; } - QCanvasEllipse::setVelocity(cos(newVector.direction()) * newVector.magnitude(), -sin(newVector.direction()) * newVector.magnitude()); + TQCanvasEllipse::setVelocity(cos(newVector.direction()) * newVector.magnitude(), -sin(newVector.direction()) * newVector.magnitude()); } void Ball::moveBy(double dx, double dy) @@ -132,7 +132,7 @@ void Ball::moveBy(double dx, double dy) double oldy; oldx = x(); oldy = y(); - QCanvasEllipse::moveBy(dx, dy); + TQCanvasEllipse::moveBy(dx, dy); if (game && !game->isPaused()) collisionDetect(oldx, oldy); @@ -145,7 +145,7 @@ void Ball::moveBy(double dx, double dy) void Ball::doAdvance() { - QCanvasEllipse::advance(1); + TQCanvasEllipse::advance(1); } namespace Lines @@ -221,17 +221,17 @@ void Ball::collisionDetect(double oldx, double oldy) const double minSpeed = .06; - QCanvasItemList m_list = collisions(true); + TQCanvasItemList m_list = collisions(true); - // please don't ask why QCanvas doesn't actually sort its list; + // please don't ask why TQCanvas doesn't actually sort its list; // it just doesn't. m_list.sort(); this->m_list = m_list; - for (QCanvasItemList::Iterator it = m_list.begin(); it != m_list.end(); ++it) + for (TQCanvasItemList::Iterator it = m_list.begin(); it != m_list.end(); ++it) { - QCanvasItem *item = *it; + TQCanvasItem *item = *it; if (item->rtti() == Rtti_NoCollision || item->rtti() == Rtti_Putter) continue; @@ -258,7 +258,7 @@ void Ball::collisionDetect(double oldx, double oldy) Vector bvector = oball->curVector(); m_vector -= bvector; - Vector unit1 = Vector(QPoint(x(), y()), QPoint(oball->x(), oball->y())); + Vector unit1 = Vector(TQPoint(x(), y()), TQPoint(oball->x(), oball->y())); unit1 = unit1.unit(); Vector unit2 = m_vector.unit(); @@ -286,8 +286,8 @@ void Ball::collisionDetect(double oldx, double oldy) { //kdDebug(12007) << "collided with WallPoint\n"; // iterate through the rst - QPtrList<WallPoint> points; - for (QCanvasItemList::Iterator pit = it; pit != m_list.end(); ++pit) + TQPtrList<WallPoint> points; + for (TQCanvasItemList::Iterator pit = it; pit != m_list.end(); ++pit) { if ((*pit)->rtti() == Rtti_WallPoint) { @@ -309,9 +309,9 @@ void Ball::collisionDetect(double oldx, double oldy) { //kdDebug(12007) << "-----\n"; const Wall *parentWall = iterpoint->parentWall(); - const QPoint qp(iterpoint->x() + parentWall->x(), iterpoint->y() + parentWall->y()); + const TQPoint qp(iterpoint->x() + parentWall->x(), iterpoint->y() + parentWall->y()); const Point p(qp.x(), qp.y()); - const QPoint qother = QPoint(parentWall->startPoint() == qp? parentWall->endPoint() : parentWall->startPoint()) + QPoint(parentWall->x(), parentWall->y()); + const TQPoint qother = TQPoint(parentWall->startPoint() == qp? parentWall->endPoint() : parentWall->startPoint()) + TQPoint(parentWall->x(), parentWall->y()); const Point other(qother.x(), qother.y()); // vector of wall @@ -371,7 +371,7 @@ void Ball::collisionDetect(double oldx, double oldy) } } - for (QCanvasItemList::Iterator it = m_list.begin(); it != m_list.end(); ++it) + for (TQCanvasItemList::Iterator it = m_list.begin(); it != m_list.end(); ++it) { CanvasItem *citem = dynamic_cast<CanvasItem *>(*it); if (citem && citem->terrainCollisions()) @@ -393,15 +393,15 @@ void Ball::collisionDetect(double oldx, double oldy) wallCheck: { // check if I went through a wall - QCanvasItemList items; + TQCanvasItemList items; if (game) items = game->canvas()->allItems(); - for (QCanvasItemList::Iterator i = items.begin(); i != items.end(); ++i) + for (TQCanvasItemList::Iterator i = items.begin(); i != items.end(); ++i) { if ((*i)->rtti() != Rtti_Wall) continue; - QCanvasItem *item = (*i); + TQCanvasItem *item = (*i); Wall *wall = dynamic_cast<Wall*>(item); if (!wall || !wall->isVisible()) continue; @@ -446,20 +446,20 @@ void Ball::hideInfo() label->setVisible(false); } -void Ball::setName(const QString &name) +void Ball::setName(const TQString &name) { label->setText(name); } -void Ball::setCanvas(QCanvas *c) +void Ball::setCanvas(TQCanvas *c) { - QCanvasEllipse::setCanvas(c); + TQCanvasEllipse::setCanvas(c); label->setCanvas(c); } void Ball::setVisible(bool yes) { - QCanvasEllipse::setVisible(yes); + TQCanvasEllipse::setVisible(yes); label->setVisible(yes && game && game->isInfoShowing()); } diff --git a/kolf/ball.h b/kolf/ball.h index 098d82ef..a4252ec5 100644 --- a/kolf/ball.h +++ b/kolf/ball.h @@ -1,8 +1,8 @@ #ifndef KOLF_BALL_H #define KOLF_BALL_H -#include <qcanvas.h> -#include <qcolor.h> +#include <tqcanvas.h> +#include <tqcolor.h> #include <math.h> @@ -11,10 +11,10 @@ enum BallState { Rolling = 0, Stopped, Holed }; -class Ball : public QCanvasEllipse, public CanvasItem +class Ball : public TQCanvasEllipse, public CanvasItem { public: - Ball(QCanvas *canvas); + Ball(TQCanvas *canvas); virtual void aboutToDie(); BallState currentState(); @@ -32,8 +32,8 @@ public: BallState curState() const { return state; } void setState(BallState newState); - QColor color() const { return m_color; } - void setColor(QColor color) { m_color = color; setBrush(color); } + TQColor color() const { return m_color; } + void setColor(TQColor color) { m_color = color; setBrush(color); } void setMoved(bool yes) { m_moved = yes; } bool moved() const { return m_moved; } @@ -69,13 +69,13 @@ public: virtual void showInfo(); virtual void hideInfo(); - virtual void setName(const QString &); - virtual void setCanvas(QCanvas *c); + virtual void setName(const TQString &); + virtual void setCanvas(TQCanvas *c); virtual void setVisible(bool yes); private: BallState state; - QColor m_color; + TQColor m_color; long int collisionId; double frictionMultiplier; @@ -95,9 +95,9 @@ private: bool m_collisionLock; bool m_doDetect; - QCanvasItemList m_list; + TQCanvasItemList m_list; - QCanvasText *label; + TQCanvasText *label; }; diff --git a/kolf/canvasitem.cpp b/kolf/canvasitem.cpp index 5e39257c..e8f199e3 100644 --- a/kolf/canvasitem.cpp +++ b/kolf/canvasitem.cpp @@ -1,21 +1,21 @@ -#include <qcanvas.h> +#include <tqcanvas.h> #include <kconfig.h> #include "game.h" #include "canvasitem.h" -QCanvasRectangle *CanvasItem::onVStrut() +TQCanvasRectangle *CanvasItem::onVStrut() { - QCanvasItem *qthis = dynamic_cast<QCanvasItem *>(this); + TQCanvasItem *qthis = dynamic_cast<TQCanvasItem *>(this); if (!qthis) return 0; - QCanvasItemList l = qthis->collisions(true); + TQCanvasItemList l = qthis->collisions(true); l.sort(); bool aboveVStrut = false; CanvasItem *item = 0; - QCanvasItem *qitem = 0; - for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) + TQCanvasItem *qitem = 0; + for (TQCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) { item = dynamic_cast<CanvasItem *>(*it); if (item) @@ -30,7 +30,7 @@ QCanvasRectangle *CanvasItem::onVStrut() } } - QCanvasRectangle *ritem = dynamic_cast<QCanvasRectangle *>(qitem); + TQCanvasRectangle *ritem = dynamic_cast<TQCanvasRectangle *>(qitem); return aboveVStrut && ritem? ritem : 0; } @@ -40,7 +40,7 @@ void CanvasItem::save(KConfig *cfg) cfg->writeEntry("dummykey", true); } -void CanvasItem::playSound(QString file, double vol) +void CanvasItem::playSound(TQString file, double vol) { if (game) game->playSound(file, vol); diff --git a/kolf/canvasitem.h b/kolf/canvasitem.h index e7a37cb6..ed897d27 100644 --- a/kolf/canvasitem.h +++ b/kolf/canvasitem.h @@ -1,7 +1,7 @@ #ifndef KOLF_CANVASITEM_H #define KOLF_CANVASITEM_H -#include <qcanvas.h> +#include <tqcanvas.h> #include "config.h" @@ -30,7 +30,7 @@ public: /** * called if the item is made by user while editing, with the item that was selected on the hole; */ - virtual void selectedItem(QCanvasItem * /*item*/) {} + virtual void selectedItem(TQCanvasItem * /*item*/) {} /** * called after the item is moved the very first time by the game */ @@ -107,7 +107,7 @@ public: /** * update your Z value (this is called by various things when perhaps the value should change) if this is called by a vStrut, it will pass 'this'. */ - virtual void updateZ(QCanvasRectangle * /*vStrut*/ = 0) {}; + virtual void updateZ(TQCanvasRectangle * /*vStrut*/ = 0) {}; /** * clean up for prettyness */ @@ -125,11 +125,11 @@ public: * returns a Config that can be used to configure this item by the user. * The default implementation returns one that says 'No configuration options'. */ - virtual Config *config(QWidget *parent) { return new DefaultConfig(parent); } + virtual Config *config(TQWidget *parent) { return new DefaultConfig(parent); } /** * returns other items that should be moveable (besides this one of course). */ - virtual QPtrList<QCanvasItem> moveableItems() const { return QPtrList<QCanvasItem>(); } + virtual TQPtrList<TQCanvasItem> moveableItems() const { return TQPtrList<TQCanvasItem>(); } /** * returns whether this can be moved by the user while editing. */ @@ -142,7 +142,7 @@ public: * call to play sound (ie, playSound("wall") plays kdedir/share/apps/kolf/sounds/wall.wav). * optionally, specify vol to be between 0-1, for no sound to full volume, respectively. */ - void playSound(QString file, double vol = 1); + void playSound(TQString file, double vol = 1); /** * called on ball's collision. Return if terrain collisions should be processed. @@ -160,8 +160,8 @@ public: */ virtual bool cornerResize() const { return false; } - QString name() const { return m_name; } - void setName(const QString &newname) { m_name = newname; } + TQString name() const { return m_name; } + void setName(const TQString &newname) { m_name = newname; } protected: /** @@ -172,10 +172,10 @@ protected: /** * returns the highest vertical strut the item is on */ - QCanvasRectangle *onVStrut(); + TQCanvasRectangle *onVStrut(); private: - QString m_name; + TQString m_name; int id; }; diff --git a/kolf/config.cpp b/kolf/config.cpp index 7652cf40..7c333755 100644 --- a/kolf/config.cpp +++ b/kolf/config.cpp @@ -1,13 +1,13 @@ -#include <qlabel.h> -#include <qlayout.h> +#include <tqlabel.h> +#include <tqlayout.h> #include <kdialog.h> #include <klocale.h> #include "config.h" -Config::Config(QWidget *parent, const char *name) - : QFrame(parent, name) +Config::Config(TQWidget *parent, const char *name) + : TQFrame(parent, name) { startedUp = false; } @@ -33,14 +33,14 @@ void Config::changed() emit modified(); } -MessageConfig::MessageConfig(QString text, QWidget *parent, const char *name) +MessageConfig::MessageConfig(TQString text, TQWidget *parent, const char *name) : Config(parent, name) { - QVBoxLayout *layout = new QVBoxLayout(this, marginHint(), spacingHint()); - layout->addWidget(new QLabel(text, this)); + TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); + layout->addWidget(new TQLabel(text, this)); } -DefaultConfig::DefaultConfig(QWidget *parent, const char *name) +DefaultConfig::DefaultConfig(TQWidget *parent, const char *name) : MessageConfig(i18n("No configuration options"), parent, name) { } diff --git a/kolf/config.h b/kolf/config.h index 07c68938..4e0f26a6 100644 --- a/kolf/config.h +++ b/kolf/config.h @@ -1,14 +1,14 @@ #ifndef KOLF_CONFIG_H #define KOLF_CONFIG_H -#include <qframe.h> +#include <tqframe.h> class Config : public QFrame { Q_OBJECT public: - Config(QWidget *parent, const char *name = 0); + Config(TQWidget *parent, const char *name = 0); void ctorDone(); signals: @@ -27,7 +27,7 @@ class MessageConfig : public Config Q_OBJECT public: - MessageConfig(QString text, QWidget *parent, const char *name = 0); + MessageConfig(TQString text, TQWidget *parent, const char *name = 0); }; // internal @@ -36,7 +36,7 @@ class DefaultConfig : public MessageConfig Q_OBJECT public: - DefaultConfig(QWidget *parent, const char *name = 0); + DefaultConfig(TQWidget *parent, const char *name = 0); }; #endif diff --git a/kolf/editor.cpp b/kolf/editor.cpp index 4cf6e61a..ae9cde32 100644 --- a/kolf/editor.cpp +++ b/kolf/editor.cpp @@ -1,39 +1,39 @@ #include <kdialog.h> #include <klistbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qwidget.h> -#include <qframe.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqwidget.h> +#include <tqframe.h> #include "editor.h" #include "game.h" -Editor::Editor(ObjectList *list, QWidget *parent, const char *name) - : QWidget(parent, name) +Editor::Editor(ObjectList *list, TQWidget *parent, const char *name) + : TQWidget(parent, name) { this->list = list; config = 0; - hlayout = new QHBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + hlayout = new TQHBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - QVBoxLayout *vlayout = new QVBoxLayout(hlayout, KDialog::spacingHint()); - vlayout->addWidget(new QLabel(i18n("Add object:"), this)); + TQVBoxLayout *vlayout = new TQVBoxLayout(hlayout, KDialog::spacingHint()); + vlayout->addWidget(new TQLabel(i18n("Add object:"), this)); listbox = new KListBox(this, "Listbox"); vlayout->addWidget(listbox); hlayout->setStretchFactor(vlayout, 2); - QStringList items; + TQStringList items; Object *obj = 0; for (obj = list->first(); obj; obj = list->next()) items.append(obj->name()); listbox->insertStringList(items); - connect(listbox, SIGNAL(executed(QListBoxItem *)), SLOT(listboxExecuted(QListBoxItem *))); + connect(listbox, TQT_SIGNAL(executed(TQListBoxItem *)), TQT_SLOT(listboxExecuted(TQListBoxItem *))); } -void Editor::listboxExecuted(QListBoxItem * /*item*/) +void Editor::listboxExecuted(TQListBoxItem * /*item*/) { int curItem = listbox->currentItem(); if (curItem < 0) @@ -51,10 +51,10 @@ void Editor::setItem(CanvasItem *item) config->ctorDone(); hlayout->addWidget(config); hlayout->setStretchFactor(config, 2); - config->setFrameStyle(QFrame::Box | QFrame::Raised); + config->setFrameStyle(TQFrame::Box | TQFrame::Raised); config->setLineWidth(1); config->show(); - connect(config, SIGNAL(modified()), this, SIGNAL(changed())); + connect(config, TQT_SIGNAL(modified()), this, TQT_SIGNAL(changed())); } #include "editor.moc" diff --git a/kolf/editor.h b/kolf/editor.h index 4d5a3ac5..cfe998e6 100644 --- a/kolf/editor.h +++ b/kolf/editor.h @@ -1,7 +1,7 @@ #ifndef EDITOR_H_INCLUDED #define EDITOR_H_INCLUDED -#include <qwidget.h> +#include <tqwidget.h> #include "game.h" @@ -15,7 +15,7 @@ class Editor : public QWidget Q_OBJECT public: - Editor(ObjectList *list, QWidget * = 0, const char * = 0); + Editor(ObjectList *list, TQWidget * = 0, const char * = 0); signals: void changed(); @@ -25,11 +25,11 @@ public slots: void setItem(CanvasItem *); private slots: - void listboxExecuted(QListBoxItem *); + void listboxExecuted(TQListBoxItem *); private: ObjectList *list; - QHBoxLayout *hlayout; + TQHBoxLayout *hlayout; KListBox *listbox; Config *config; }; diff --git a/kolf/floater.cpp b/kolf/floater.cpp index 73612bc8..ff42398a 100644 --- a/kolf/floater.cpp +++ b/kolf/floater.cpp @@ -1,5 +1,5 @@ -#include <qlabel.h> -#include <qslider.h> +#include <tqlabel.h> +#include <tqslider.h> #include <kconfig.h> @@ -39,14 +39,14 @@ void FloaterGuide::setPoints(int xa, int ya, int xb, int yb) } } -Config *FloaterGuide::config(QWidget *parent) +Config *FloaterGuide::config(TQWidget *parent) { return floater->config(parent); } ///////////////////////// -Floater::Floater(QRect rect, QCanvas *canvas) +Floater::Floater(TQRect rect, TQCanvas *canvas) : Bridge(rect, canvas), speedfactor(16) { wall = 0; @@ -55,7 +55,7 @@ Floater::Floater(QRect rect, QCanvas *canvas) haventMoved = true; wall = new FloaterGuide(this, canvas); wall->setPoints(100, 100, 200, 200); - wall->setPen(QPen(wall->pen().color().light(), wall->pen().width() - 1)); + wall->setPen(TQPen(wall->pen().color().light(), wall->pen().width() - 1)); move(wall->endPoint().x(), wall->endPoint().y()); setTopWallVisible(false); @@ -95,7 +95,7 @@ void Floater::advance(int phase) if (phase == 1 && (xVelocity() || yVelocity())) { - if (Vector(origin, QPoint(x(), y())).magnitude() > vector.magnitude()) + if (Vector(origin, TQPoint(x(), y())).magnitude() > vector.magnitude()) { vector.setDirection(vector.direction() + M_PI); origin = (origin == wall->startPoint()? wall->endPoint() : wall->startPoint()); @@ -107,8 +107,8 @@ void Floater::advance(int phase) void Floater::reset() { - QPoint start = wall->startPoint() + QPoint(wall->x(), wall->y()); - QPoint end = wall->endPoint() + QPoint(wall->x(), wall->y()); + TQPoint start = wall->startPoint() + TQPoint(wall->x(), wall->y()); + TQPoint end = wall->endPoint() + TQPoint(wall->x(), wall->y()); vector = Vector(end, start); origin = end; @@ -117,9 +117,9 @@ void Floater::reset() setSpeed(speed); } -QPtrList<QCanvasItem> Floater::moveableItems() const +TQPtrList<TQCanvasItem> Floater::moveableItems() const { - QPtrList<QCanvasItem> ret(wall->moveableItems()); + TQPtrList<TQCanvasItem> ret(wall->moveableItems()); ret.append(wall); ret.append(point); return ret; @@ -167,8 +167,8 @@ void Floater::moveBy(double dx, double dy) if (!isEnabled()) return; - QCanvasItemList l = collisions(false); - for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) + TQCanvasItemList l = collisions(false); + for (TQCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) { CanvasItem *item = dynamic_cast<CanvasItem *>(*it); @@ -197,7 +197,7 @@ void Floater::moveBy(double dx, double dy) // this call must come after we have tested for collisions, otherwise we skip them when saving! // that's a bad thing - QCanvasRectangle::moveBy(dx, dy); + TQCanvasRectangle::moveBy(dx, dy); // because we don't do Bridge::moveBy(); topWall->move(x(), y()); @@ -211,20 +211,20 @@ void Floater::moveBy(double dx, double dy) void Floater::saveState(StateDB *db) { - db->setPoint(QPoint(x(), y())); + db->setPoint(TQPoint(x(), y())); } void Floater::loadState(StateDB *db) { - const QPoint moveTo = db->point(); + const TQPoint moveTo = db->point(); move(moveTo.x(), moveTo.y()); } void Floater::save(KConfig *cfg) { cfg->writeEntry("speed", speed); - cfg->writeEntry("startPoint", QPoint(wall->startPoint().x() + wall->x(), wall->startPoint().y() + wall->y())); - cfg->writeEntry("endPoint", QPoint(wall->endPoint().x() + wall->x(), wall->endPoint().y() + wall->y())); + cfg->writeEntry("startPoint", TQPoint(wall->startPoint().x() + wall->x(), wall->startPoint().y() + wall->y())); + cfg->writeEntry("endPoint", TQPoint(wall->endPoint().x() + wall->x(), wall->endPoint().y() + wall->y())); doSave(cfg); } @@ -233,9 +233,9 @@ void Floater::load(KConfig *cfg) { move(firstPoint.x(), firstPoint.y()); - QPoint start(wall->startPoint() + QPoint(wall->x(), wall->y())); + TQPoint start(wall->startPoint() + TQPoint(wall->x(), wall->y())); start = cfg->readPointEntry("startPoint", &start); - QPoint end(wall->endPoint() + QPoint(wall->x(), wall->y())); + TQPoint end(wall->endPoint() + TQPoint(wall->x(), wall->y())); end = cfg->readPointEntry("endPoint", &end); wall->setPoints(start.x(), start.y(), end.x(), end.y()); wall->move(0, 0); @@ -248,24 +248,24 @@ void Floater::load(KConfig *cfg) void Floater::firstMove(int x, int y) { - firstPoint = QPoint(x, y); + firstPoint = TQPoint(x, y); } ///////////////////////// -FloaterConfig::FloaterConfig(Floater *floater, QWidget *parent) +FloaterConfig::FloaterConfig(Floater *floater, TQWidget *parent) : BridgeConfig(floater, parent) { this->floater = floater; m_vlayout->addStretch(); - m_vlayout->addWidget(new QLabel(i18n("Moving speed"), this)); - QHBoxLayout *hlayout = new QHBoxLayout(m_vlayout, spacingHint()); - hlayout->addWidget(new QLabel(i18n("Slow"), this)); - QSlider *slider = new QSlider(0, 20, 2, floater->curSpeed(), Qt::Horizontal, this); + m_vlayout->addWidget(new TQLabel(i18n("Moving speed"), this)); + TQHBoxLayout *hlayout = new TQHBoxLayout(m_vlayout, spacingHint()); + hlayout->addWidget(new TQLabel(i18n("Slow"), this)); + TQSlider *slider = new TQSlider(0, 20, 2, floater->curSpeed(), Qt::Horizontal, this); hlayout->addWidget(slider); - hlayout->addWidget(new QLabel(i18n("Fast"), this)); - connect(slider, SIGNAL(valueChanged(int)), this, SLOT(speedChanged(int))); + hlayout->addWidget(new TQLabel(i18n("Fast"), this)); + connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(speedChanged(int))); } void FloaterConfig::speedChanged(int news) diff --git a/kolf/floater.h b/kolf/floater.h index 486f3bc0..c22a8084 100644 --- a/kolf/floater.h +++ b/kolf/floater.h @@ -9,7 +9,7 @@ class FloaterConfig : public BridgeConfig Q_OBJECT public: - FloaterConfig(Floater *floater, QWidget *parent); + FloaterConfig(Floater *floater, TQWidget *parent); private slots: void speedChanged(int news); @@ -21,10 +21,10 @@ private: class FloaterGuide : public Wall { public: - FloaterGuide(Floater *floater, QCanvas *canvas) : Wall(canvas) { this->floater = floater; almostDead = false; } + FloaterGuide(Floater *floater, TQCanvas *canvas) : Wall(canvas) { this->floater = floater; almostDead = false; } virtual void setPoints(int xa, int ya, int xb, int yb); virtual void moveBy(double dx, double dy); - virtual Config *config(QWidget *parent); + virtual Config *config(TQWidget *parent); virtual void aboutToDelete(); virtual void aboutToDie(); @@ -36,7 +36,7 @@ private: class Floater : public Bridge { public: - Floater(QRect rect, QCanvas *canvas); + Floater(TQRect rect, TQCanvas *canvas); virtual bool collision(Ball *ball, long int id) { Bridge::collision(ball, id); return false; } virtual void saveState(StateDB *db); virtual void loadState(StateDB *db); @@ -51,8 +51,8 @@ public: virtual void editModeChanged(bool changed); virtual bool moveable() const { return false; } virtual void moveBy(double dx, double dy); - virtual Config *config(QWidget *parent) { return new FloaterConfig(this, parent); } - virtual QPtrList<QCanvasItem> moveableItems() const; + virtual Config *config(TQWidget *parent) { return new FloaterConfig(this, parent); } + virtual TQPtrList<TQCanvasItem> moveableItems() const; virtual void advance(int phase); void setSpeed(int news); int curSpeed() const { return speed; } @@ -64,18 +64,18 @@ private: int speedfactor; int speed; FloaterGuide *wall; - QPoint origin; + TQPoint origin; Vector vector; bool noUpdateZ; bool haventMoved; - QPoint firstPoint; + TQPoint firstPoint; }; class FloaterObj : public Object { public: FloaterObj() { m_name = i18n("Floater"); m__name = "floater"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Floater(QRect(0, 0, 80, 40), canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Floater(TQRect(0, 0, 80, 40), canvas); } }; #endif diff --git a/kolf/game.cpp b/kolf/game.cpp index 55b324ce..d76ec2bc 100644 --- a/kolf/game.cpp +++ b/kolf/game.cpp @@ -15,36 +15,36 @@ #include <kprinter.h> #include <kstandarddirs.h> -#include <qbrush.h> -#include <qcanvas.h> -#include <qcheckbox.h> -#include <qcolor.h> -#include <qcursor.h> -#include <qevent.h> -#include <qfont.h> -#include <qfontmetrics.h> -#include <qimage.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qmap.h> -#include <qpainter.h> -#include <qpaintdevicemetrics.h> -#include <qpen.h> -#include <qpixmap.h> -#include <qpixmapcache.h> -#include <qpoint.h> -#include <qpointarray.h> -#include <qrect.h> -#include <qsimplerichtext.h> -#include <qsize.h> -#include <qslider.h> -#include <qspinbox.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qtimer.h> -#include <qtooltip.h> -#include <qvaluelist.h> -#include <qwhatsthis.h> +#include <tqbrush.h> +#include <tqcanvas.h> +#include <tqcheckbox.h> +#include <tqcolor.h> +#include <tqcursor.h> +#include <tqevent.h> +#include <tqfont.h> +#include <tqfontmetrics.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqmap.h> +#include <tqpainter.h> +#include <tqpaintdevicemetrics.h> +#include <tqpen.h> +#include <tqpixmap.h> +#include <tqpixmapcache.h> +#include <tqpoint.h> +#include <tqpointarray.h> +#include <tqrect.h> +#include <tqsimplerichtext.h> +#include <tqsize.h> +#include <tqslider.h> +#include <tqspinbox.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqtimer.h> +#include <tqtooltip.h> +#include <tqvaluelist.h> +#include <tqwhatsthis.h> #include <math.h> #include <stdlib.h> @@ -56,32 +56,32 @@ #include "game.h" -inline QString makeGroup(int id, int hole, QString name, int x, int y) +inline TQString makeGroup(int id, int hole, TQString name, int x, int y) { - return QString("%1-%2@%3,%4|%5").arg(hole).arg(name).arg(x).arg(y).arg(id); + return TQString("%1-%2@%3,%4|%5").arg(hole).arg(name).arg(x).arg(y).arg(id); } -inline QString makeStateGroup(int id, const QString &name) +inline TQString makeStateGroup(int id, const TQString &name) { - return QString("%1|%2").arg(name).arg(id); + return TQString("%1|%2").arg(name).arg(id); } ///////////////////////// -RectPoint::RectPoint(QColor color, RectItem *rect, QCanvas *canvas) - : QCanvasEllipse(canvas) +RectPoint::RectPoint(TQColor color, RectItem *rect, TQCanvas *canvas) + : TQCanvasEllipse(canvas) { setZ(9999); setSize(10, 10); this->rect = rect; - setBrush(QBrush(color)); + setBrush(TQBrush(color)); setSizeFactor(1.0); dontmove = false; } void RectPoint::moveBy(double dx, double dy) { - QCanvasEllipse::moveBy(dx, dy); + TQCanvasEllipse::moveBy(dx, dy); if (dontmove) { @@ -89,7 +89,7 @@ void RectPoint::moveBy(double dx, double dy) return; } - QCanvasItem *qitem = dynamic_cast<QCanvasItem *>(rect); + TQCanvasItem *qitem = dynamic_cast<TQCanvasItem *>(rect); if (!qitem) return; @@ -101,7 +101,7 @@ void RectPoint::moveBy(double dx, double dy) rect->newSize(nw, nh); } -Config *RectPoint::config(QWidget *parent) +Config *RectPoint::config(TQWidget *parent) { CanvasItem *citem = dynamic_cast<CanvasItem *>(rect); if (citem) @@ -112,11 +112,11 @@ Config *RectPoint::config(QWidget *parent) ///////////////////////// -Arrow::Arrow(QCanvas *canvas) - : QCanvasLine(canvas) +Arrow::Arrow(TQCanvas *canvas) + : TQCanvasLine(canvas) { - line1 = new QCanvasLine(canvas); - line2 = new QCanvasLine(canvas); + line1 = new TQCanvasLine(canvas); + line2 = new TQCanvasLine(canvas); m_angle = 0; m_length = 20; @@ -128,30 +128,30 @@ Arrow::Arrow(QCanvas *canvas) setVisible(false); } -void Arrow::setPen(QPen p) +void Arrow::setPen(TQPen p) { - QCanvasLine::setPen(p); + TQCanvasLine::setPen(p); line1->setPen(p); line2->setPen(p); } void Arrow::setZ(double newz) { - QCanvasLine::setZ(newz); + TQCanvasLine::setZ(newz); line1->setZ(newz); line2->setZ(newz); } void Arrow::setVisible(bool yes) { - QCanvasLine::setVisible(yes); + TQCanvasLine::setVisible(yes); line1->setVisible(yes); line2->setVisible(yes); } void Arrow::moveBy(double dx, double dy) { - QCanvasLine::moveBy(dx, dy); + TQCanvasLine::moveBy(dx, dy); line1->moveBy(dx, dy); line2->moveBy(dx, dy); } @@ -164,12 +164,12 @@ void Arrow::aboutToDie() void Arrow::updateSelf() { - QPoint start = startPoint(); - QPoint end(m_length * cos(m_angle), m_length * sin(m_angle)); + TQPoint start = startPoint(); + TQPoint end(m_length * cos(m_angle), m_length * sin(m_angle)); if (m_reversed) { - QPoint tmp(start); + TQPoint tmp(start); start = end; end = tmp; } @@ -181,40 +181,40 @@ void Arrow::updateSelf() const double angle1 = m_angle - M_PI / 2 - 1; line1->move(end.x() + x(), end.y() + y()); start = end; - end = QPoint(lineLen * cos(angle1), lineLen * sin(angle1)); + end = TQPoint(lineLen * cos(angle1), lineLen * sin(angle1)); line1->setPoints(0, 0, end.x(), end.y()); const double angle2 = m_angle + M_PI / 2 + 1; line2->move(start.x() + x(), start.y() + y()); - end = QPoint(lineLen * cos(angle2), lineLen * sin(angle2)); + end = TQPoint(lineLen * cos(angle2), lineLen * sin(angle2)); line2->setPoints(0, 0, end.x(), end.y()); } ///////////////////////// -BridgeConfig::BridgeConfig(Bridge *bridge, QWidget *parent) +BridgeConfig::BridgeConfig(Bridge *bridge, TQWidget *parent) : Config(parent) { this->bridge = bridge; - m_vlayout = new QVBoxLayout(this, marginHint(), spacingHint()); - QGridLayout *layout = new QGridLayout(m_vlayout, 2, 3, spacingHint()); - layout->addWidget(new QLabel(i18n("Walls on:"), this), 0, 0); - top = new QCheckBox(i18n("&Top"), this); + m_vlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); + TQGridLayout *layout = new TQGridLayout(m_vlayout, 2, 3, spacingHint()); + layout->addWidget(new TQLabel(i18n("Walls on:"), this), 0, 0); + top = new TQCheckBox(i18n("&Top"), this); layout->addWidget(top, 0, 1); - connect(top, SIGNAL(toggled(bool)), this, SLOT(topWallChanged(bool))); + connect(top, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(topWallChanged(bool))); top->setChecked(bridge->topWallVisible()); - bot = new QCheckBox(i18n("&Bottom"), this); + bot = new TQCheckBox(i18n("&Bottom"), this); layout->addWidget(bot, 1, 1); - connect(bot, SIGNAL(toggled(bool)), this, SLOT(botWallChanged(bool))); + connect(bot, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(botWallChanged(bool))); bot->setChecked(bridge->botWallVisible()); - left = new QCheckBox(i18n("&Left"), this); + left = new TQCheckBox(i18n("&Left"), this); layout->addWidget(left, 1, 0); - connect(left, SIGNAL(toggled(bool)), this, SLOT(leftWallChanged(bool))); + connect(left, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(leftWallChanged(bool))); left->setChecked(bridge->leftWallVisible()); - right = new QCheckBox(i18n("&Right"), this); + right = new TQCheckBox(i18n("&Right"), this); layout->addWidget(right, 1, 2); - connect(right, SIGNAL(toggled(bool)), this, SLOT(rightWallChanged(bool))); + connect(right, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(rightWallChanged(bool))); right->setChecked(bridge->rightWallVisible()); } @@ -244,11 +244,11 @@ void BridgeConfig::rightWallChanged(bool yes) ///////////////////////// -Bridge::Bridge(QRect rect, QCanvas *canvas) - : QCanvasRectangle(rect, canvas) +Bridge::Bridge(TQRect rect, TQCanvas *canvas) + : TQCanvasRectangle(rect, canvas) { - QColor color("#92772D"); - setBrush(QBrush(color)); + TQColor color("#92772D"); + setBrush(TQBrush(color)); setPen(NoPen); setZ(998); @@ -298,9 +298,9 @@ void Bridge::setGame(KolfGame *game) rightWall->setGame(game); } -void Bridge::setWallColor(QColor color) +void Bridge::setWallColor(TQColor color) { - topWall->setPen(QPen(color.dark(), 3)); + topWall->setPen(TQPen(color.dark(), 3)); botWall->setPen(topWall->pen()); leftWall->setPen(topWall->pen()); rightWall->setPen(topWall->pen()); @@ -327,7 +327,7 @@ void Bridge::editModeChanged(bool changed) void Bridge::moveBy(double dx, double dy) { - QCanvasRectangle::moveBy(dx, dy); + TQCanvasRectangle::moveBy(dx, dy); point->dontMove(); point->move(x() + width(), y() + height()); @@ -337,8 +337,8 @@ void Bridge::moveBy(double dx, double dy) leftWall->move(x(), y()); rightWall->move(x(), y()); - QCanvasItemList list = collisions(true); - for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) + TQCanvasItemList list = collisions(true); + for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) { CanvasItem *citem = dynamic_cast<CanvasItem *>(*it); if (citem) @@ -375,9 +375,9 @@ void Bridge::doSave(KConfig *cfg) cfg->writeEntry("rightWallVisible", rightWallVisible()); } -QPtrList<QCanvasItem> Bridge::moveableItems() const +TQPtrList<TQCanvasItem> Bridge::moveableItems() const { - QPtrList<QCanvasItem> ret; + TQPtrList<TQCanvasItem> ret; ret.append(point); return ret; } @@ -389,7 +389,7 @@ void Bridge::newSize(int width, int height) void Bridge::setSize(int width, int height) { - QCanvasRectangle::setSize(width, height); + TQCanvasRectangle::setSize(width, height); topWall->setPoints(0, 0, width, 0); botWall->setPoints(0, height, width, height); @@ -401,23 +401,23 @@ void Bridge::setSize(int width, int height) ///////////////////////// -WindmillConfig::WindmillConfig(Windmill *windmill, QWidget *parent) +WindmillConfig::WindmillConfig(Windmill *windmill, TQWidget *parent) : BridgeConfig(windmill, parent) { this->windmill = windmill; m_vlayout->addStretch(); - QCheckBox *check = new QCheckBox(i18n("Windmill on bottom"), this); + TQCheckBox *check = new TQCheckBox(i18n("Windmill on bottom"), this); check->setChecked(windmill->bottom()); - connect(check, SIGNAL(toggled(bool)), this, SLOT(endChanged(bool))); + connect(check, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(endChanged(bool))); m_vlayout->addWidget(check); - QHBoxLayout *hlayout = new QHBoxLayout(m_vlayout, spacingHint()); - hlayout->addWidget(new QLabel(i18n("Slow"), this)); - QSlider *slider = new QSlider(1, 10, 1, windmill->curSpeed(), Qt::Horizontal, this); + TQHBoxLayout *hlayout = new TQHBoxLayout(m_vlayout, spacingHint()); + hlayout->addWidget(new TQLabel(i18n("Slow"), this)); + TQSlider *slider = new TQSlider(1, 10, 1, windmill->curSpeed(), Qt::Horizontal, this); hlayout->addWidget(slider); - hlayout->addWidget(new QLabel(i18n("Fast"), this)); - connect(slider, SIGNAL(valueChanged(int)), this, SLOT(speedChanged(int))); + hlayout->addWidget(new TQLabel(i18n("Fast"), this)); + connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(speedChanged(int))); endChanged(check->isChecked()); } @@ -449,11 +449,11 @@ void WindmillConfig::endChanged(bool bottom) ///////////////////////// -Windmill::Windmill(QRect rect, QCanvas *canvas) +Windmill::Windmill(TQRect rect, TQCanvas *canvas) : Bridge(rect, canvas), speedfactor(16), m_bottom(true) { guard = new WindmillGuard(canvas); - guard->setPen(QPen(black, 5)); + guard->setPen(TQPen(black, 5)); guard->setVisible(true); guard->setAlwaysShow(true); setSpeed(5); @@ -583,12 +583,12 @@ void WindmillGuard::advance(int phase) ///////////////////////// -Sign::Sign(QCanvas *canvas) - : Bridge(QRect(0, 0, 110, 40), canvas) +Sign::Sign(TQCanvas *canvas) + : Bridge(TQRect(0, 0, 110, 40), canvas) { setZ(998.8); m_text = m_untranslatedText = i18n("New Text"); - setBrush(QBrush(white)); + setBrush(TQBrush(white)); setWallColor(black); setWallZ(z() + .01); @@ -613,7 +613,7 @@ void Sign::save(KConfig *cfg) doSave(cfg); } -void Sign::setText(const QString &text) +void Sign::setText(const TQString &text) { m_text = text; m_untranslatedText = text; @@ -621,36 +621,36 @@ void Sign::setText(const QString &text) update(); } -void Sign::draw(QPainter &painter) +void Sign::draw(TQPainter &painter) { Bridge::draw(painter); - painter.setPen(QPen(black, 1)); - QSimpleRichText txt(m_text, kapp->font()); + painter.setPen(TQPen(black, 1)); + TQSimpleRichText txt(m_text, kapp->font()); const int indent = wallPen().width() + 3; txt.setWidth(width() - 2*indent); - QColorGroup colorGroup; - colorGroup.setColor(QColorGroup::Foreground, black); - colorGroup.setColor(QColorGroup::Text, black); - colorGroup.setColor(QColorGroup::Background, black); - colorGroup.setColor(QColorGroup::Base, black); - txt.draw(&painter, x() + indent, y(), QRect(x() + indent, y(), width() - indent, height() - indent), colorGroup); + TQColorGroup colorGroup; + colorGroup.setColor(TQColorGroup::Foreground, black); + colorGroup.setColor(TQColorGroup::Text, black); + colorGroup.setColor(TQColorGroup::Background, black); + colorGroup.setColor(TQColorGroup::Base, black); + txt.draw(&painter, x() + indent, y(), TQRect(x() + indent, y(), width() - indent, height() - indent), colorGroup); } ///////////////////////// -SignConfig::SignConfig(Sign *sign, QWidget *parent) +SignConfig::SignConfig(Sign *sign, TQWidget *parent) : BridgeConfig(sign, parent) { this->sign = sign; m_vlayout->addStretch(); - m_vlayout->addWidget(new QLabel(i18n("Sign HTML:"), this)); + m_vlayout->addWidget(new TQLabel(i18n("Sign HTML:"), this)); KLineEdit *name = new KLineEdit(sign->text(), this); m_vlayout->addWidget(name); - connect(name, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged(const QString &))); + connect(name, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(textChanged(const TQString &))); } -void SignConfig::textChanged(const QString &text) +void SignConfig::textChanged(const TQString &text) { sign->setText(text); changed(); @@ -658,27 +658,27 @@ void SignConfig::textChanged(const QString &text) ///////////////////////// -EllipseConfig::EllipseConfig(Ellipse *ellipse, QWidget *parent) +EllipseConfig::EllipseConfig(Ellipse *ellipse, TQWidget *parent) : Config(parent), slow1(0), fast1(0), slow2(0), fast2(0), slider1(0), slider2(0) { this->ellipse = ellipse; - m_vlayout = new QVBoxLayout(this, marginHint(), spacingHint()); + m_vlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); - QCheckBox *check = new QCheckBox(i18n("Enable show/hide"), this); + TQCheckBox *check = new TQCheckBox(i18n("Enable show/hide"), this); m_vlayout->addWidget(check); - connect(check, SIGNAL(toggled(bool)), this, SLOT(check1Changed(bool))); + connect(check, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(check1Changed(bool))); check->setChecked(ellipse->changeEnabled()); - QHBoxLayout *hlayout = new QHBoxLayout(m_vlayout, spacingHint()); - slow1 = new QLabel(i18n("Slow"), this); + TQHBoxLayout *hlayout = new TQHBoxLayout(m_vlayout, spacingHint()); + slow1 = new TQLabel(i18n("Slow"), this); hlayout->addWidget(slow1); - slider1 = new QSlider(1, 100, 5, 100 - ellipse->changeEvery(), Qt::Horizontal, this); + slider1 = new TQSlider(1, 100, 5, 100 - ellipse->changeEvery(), Qt::Horizontal, this); hlayout->addWidget(slider1); - fast1 = new QLabel(i18n("Fast"), this); + fast1 = new TQLabel(i18n("Fast"), this); hlayout->addWidget(fast1); - connect(slider1, SIGNAL(valueChanged(int)), this, SLOT(value1Changed(int))); + connect(slider1, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(value1Changed(int))); check1Changed(ellipse->changeEnabled()); @@ -726,8 +726,8 @@ void EllipseConfig::check2Changed(bool on) ///////////////////////// -Ellipse::Ellipse(QCanvas *canvas) - : QCanvasEllipse(canvas) +Ellipse::Ellipse(TQCanvas *canvas) + : TQCanvasEllipse(canvas) { savingDone(); setChangeEnabled(false); @@ -753,21 +753,21 @@ void Ellipse::setChangeEnabled(bool changeEnabled) setVisible(true); } -QPtrList<QCanvasItem> Ellipse::moveableItems() const +TQPtrList<TQCanvasItem> Ellipse::moveableItems() const { - QPtrList<QCanvasItem> ret; + TQPtrList<TQCanvasItem> ret; ret.append(point); return ret; } void Ellipse::newSize(int width, int height) { - QCanvasEllipse::setSize(width, height); + TQCanvasEllipse::setSize(width, height); } void Ellipse::moveBy(double dx, double dy) { - QCanvasEllipse::moveBy(dx, dy); + TQCanvasEllipse::moveBy(dx, dy); point->dontMove(); point->move(x() + width() / 2, y() + height() / 2); @@ -781,7 +781,7 @@ void Ellipse::editModeChanged(bool changed) void Ellipse::advance(int phase) { - QCanvasEllipse::advance(phase); + TQCanvasEllipse::advance(phase); if (phase == 1 && m_changeEnabled && !dontHide) { @@ -812,7 +812,7 @@ void Ellipse::save(KConfig *cfg) cfg->writeEntry("height", height()); } -Config *Ellipse::config(QWidget *parent) +Config *Ellipse::config(TQWidget *parent) { return new EllipseConfig(this, parent); } @@ -830,18 +830,18 @@ void Ellipse::savingDone() ///////////////////////// -Puddle::Puddle(QCanvas *canvas) +Puddle::Puddle(TQCanvas *canvas) : Ellipse(canvas) { setSize(45, 30); - QBrush brush; - QPixmap pic; + TQBrush brush; + TQPixmap pic; - if (!QPixmapCache::find("puddle", pic)) + if (!TQPixmapCache::find("puddle", pic)) { pic.load(locate("appdata", "pics/puddle.png")); - QPixmapCache::insert("puddle", pic); + TQPixmapCache::insert("puddle", pic); } brush.setPixmap(pic); @@ -859,7 +859,7 @@ bool Puddle::collision(Ball *ball, long int /*id*/) { if (ball->isVisible()) { - QCanvasRectangle i(QRect(ball->x(), ball->y(), 1, 1), canvas()); + TQCanvasRectangle i(TQRect(ball->x(), ball->y(), 1, 1), canvas()); i.setVisible(true); // is center of ball in? @@ -883,18 +883,18 @@ bool Puddle::collision(Ball *ball, long int /*id*/) ///////////////////////// -Sand::Sand(QCanvas *canvas) +Sand::Sand(TQCanvas *canvas) : Ellipse(canvas) { setSize(45, 40); - QBrush brush; - QPixmap pic; + TQBrush brush; + TQPixmap pic; - if (!QPixmapCache::find("sand", pic)) + if (!TQPixmapCache::find("sand", pic)) { pic.load(locate("appdata", "pics/sand.png")); - QPixmapCache::insert("sand", pic); + TQPixmapCache::insert("sand", pic); } brush.setPixmap(pic); @@ -910,7 +910,7 @@ Sand::Sand(QCanvas *canvas) bool Sand::collision(Ball *ball, long int /*id*/) { - QCanvasRectangle i(QRect(ball->x(), ball->y(), 1, 1), canvas()); + TQCanvasRectangle i(TQRect(ball->x(), ball->y(), 1, 1), canvas()); i.setVisible(true); // is center of ball in? @@ -930,19 +930,19 @@ bool Sand::collision(Ball *ball, long int /*id*/) ///////////////////////// -Putter::Putter(QCanvas *canvas) - : QCanvasLine(canvas) +Putter::Putter(TQCanvas *canvas) + : TQCanvasLine(canvas) { m_showGuideLine = true; oneDegree = M_PI / 180; len = 9; angle = 0; - guideLine = new QCanvasLine(canvas); - guideLine->setPen(QPen(white, 1, QPen::DotLine)); + guideLine = new TQCanvasLine(canvas); + guideLine->setPen(TQPen(white, 1, TQPen::DotLine)); guideLine->setZ(998.8); - setPen(QPen(black, 4)); + setPen(TQPen(black, 4)); putterWidth = 11; maxAngle = 2 * M_PI; @@ -964,7 +964,7 @@ void Putter::hideInfo() void Putter::moveBy(double dx, double dy) { - QCanvasLine::moveBy(dx, dy); + TQCanvasLine::moveBy(dx, dy); guideLine->move(x(), y()); } @@ -976,7 +976,7 @@ void Putter::setShowGuideLine(bool yes) void Putter::setVisible(bool yes) { - QCanvasLine::setVisible(yes); + TQCanvasLine::setVisible(yes); guideLine->setVisible(m_showGuideLine? yes : false); } @@ -1028,8 +1028,8 @@ void Putter::finishMe() midPoint.setX(cos(angle) * len); midPoint.setY(-sin(angle) * len); - QPoint start; - QPoint end; + TQPoint start; + TQPoint end; if (midPoint.y() || !midPoint.x()) { @@ -1053,12 +1053,12 @@ void Putter::finishMe() ///////////////////////// -Bumper::Bumper(QCanvas *canvas) - : QCanvasEllipse(20, 20, canvas) +Bumper::Bumper(TQCanvas *canvas) + : TQCanvasEllipse(20, 20, canvas) { setZ(-25); - firstColor = QColor("#E74804"); + firstColor = TQColor("#E74804"); secondColor = firstColor.light(); count = 0; @@ -1078,7 +1078,7 @@ void Bumper::aboutToDie() void Bumper::moveBy(double dx, double dy) { - QCanvasEllipse::moveBy(dx, dy); + TQCanvasEllipse::moveBy(dx, dy); //const double insideLen = (double)(width() - inside->width()) / 2.0; inside->move(x(), y()); } @@ -1090,7 +1090,7 @@ void Bumper::editModeChanged(bool changed) void Bumper::advance(int phase) { - QCanvasEllipse::advance(phase); + TQCanvasEllipse::advance(phase); if (phase == 1) { @@ -1113,8 +1113,8 @@ bool Bumper::collision(Ball *ball, long int /*id*/) if (speed > 8) speed = 8; - const QPoint start(x(), y()); - const QPoint end(ball->x(), ball->y()); + const TQPoint start(x(), y()); + const TQPoint end(ball->x(), ball->y()); Vector betweenVector(start, end); betweenVector.setMagnitude(speed); @@ -1134,8 +1134,8 @@ bool Bumper::collision(Ball *ball, long int /*id*/) ///////////////////////// -Hole::Hole(QColor color, QCanvas *canvas) - : QCanvasEllipse(15, 15, canvas) +Hole::Hole(TQColor color, TQCanvas *canvas) + : TQCanvasEllipse(15, 15, canvas) { setZ(998.1); setPen(black); @@ -1146,7 +1146,7 @@ bool Hole::collision(Ball *ball, long int /*id*/) { bool wasCenter = false; - switch (result(QPoint(ball->x(), ball->y()), ball->curVector().magnitude(), &wasCenter)) + switch (result(TQPoint(ball->x(), ball->y()), ball->curVector().magnitude(), &wasCenter)) { case Result_Holed: place(ball, wasCenter); @@ -1159,13 +1159,13 @@ bool Hole::collision(Ball *ball, long int /*id*/) return true; } -HoleResult Hole::result(QPoint p, double s, bool * /*wasCenter*/) +HoleResult Hole::result(TQPoint p, double s, bool * /*wasCenter*/) { const double longestRadius = width() > height()? width() : height(); if (s > longestRadius / 5.0) return Result_Miss; - QCanvasRectangle i(QRect(p, QSize(1, 1)), canvas()); + TQCanvasRectangle i(TQRect(p, TQSize(1, 1)), canvas()); i.setVisible(true); // is center of ball in cup? @@ -1179,19 +1179,19 @@ HoleResult Hole::result(QPoint p, double s, bool * /*wasCenter*/) ///////////////////////// -Cup::Cup(QCanvas *canvas) - : Hole(QColor("#808080"), canvas) +Cup::Cup(TQCanvas *canvas) + : Hole(TQColor("#808080"), canvas) { - if (!QPixmapCache::find("cup", pixmap)) + if (!TQPixmapCache::find("cup", pixmap)) { pixmap.load(locate("appdata", "pics/cup.png")); - QPixmapCache::insert("cup", pixmap); + TQPixmapCache::insert("cup", pixmap); } } -void Cup::draw(QPainter &p) +void Cup::draw(TQPainter &p) { - p.drawPixmap(QPoint(x() - width() / 2, y() - height() / 2), pixmap); + p.drawPixmap(TQPoint(x() - width() / 2, y() - height() / 2), pixmap); } bool Cup::place(Ball *ball, bool /*wasCenter*/) @@ -1214,7 +1214,7 @@ void Cup::save(KConfig *cfg) ///////////////////////// -BlackHole::BlackHole(QCanvas *canvas) +BlackHole::BlackHole(TQCanvas *canvas) : Hole(black, canvas), exitDeg(0) { infoLine = 0; @@ -1222,16 +1222,16 @@ BlackHole::BlackHole(QCanvas *canvas) m_maxSpeed = 5.0; runs = 0; - const QColor myColor((QRgb)(kapp->random() % 0x01000000)); + const TQColor myColor((QRgb)(kapp->random() % 0x01000000)); - outside = new QCanvasEllipse(canvas); + outside = new TQCanvasEllipse(canvas); outside->setZ(z() - .001); - outside->setBrush(QBrush(myColor)); + outside->setBrush(TQBrush(myColor)); setBrush(black); exitItem = new BlackHoleExit(this, canvas); - exitItem->setPen(QPen(myColor, 6)); + exitItem->setPen(TQPen(myColor, 6)); exitItem->setX(300); exitItem->setY(100); @@ -1248,9 +1248,9 @@ BlackHole::BlackHole(QCanvas *canvas) void BlackHole::showInfo() { delete infoLine; - infoLine = new QCanvasLine(canvas()); + infoLine = new TQCanvasLine(canvas()); infoLine->setVisible(true); - infoLine->setPen(QPen(exitItem->pen().color(), 2)); + infoLine->setPen(TQPen(exitItem->pen().color(), 2)); infoLine->setZ(10000); infoLine->setPoints(x(), y(), exitItem->x(), exitItem->y()); @@ -1285,7 +1285,7 @@ void BlackHole::updateInfo() void BlackHole::moveBy(double dx, double dy) { - QCanvasEllipse::moveBy(dx, dy); + TQCanvasEllipse::moveBy(dx, dy); outside->move(x(), y()); updateInfo(); } @@ -1300,9 +1300,9 @@ void BlackHole::setExitDeg(int newdeg) finishMe(); } -QPtrList<QCanvasItem> BlackHole::moveableItems() const +TQPtrList<TQCanvasItem> BlackHole::moveableItems() const { - QPtrList<QCanvasItem> ret; + TQPtrList<TQCanvasItem> ret; ret.append(exitItem); return ret; } @@ -1310,8 +1310,8 @@ QPtrList<QCanvasItem> BlackHole::moveableItems() const BlackHoleTimer::BlackHoleTimer(Ball *ball, double speed, int msec) : m_speed(speed), m_ball(ball) { - QTimer::singleShot(msec, this, SLOT(mySlot())); - QTimer::singleShot(msec / 2, this, SLOT(myMidSlot())); + TQTimer::singleShot(msec, this, TQT_SLOT(mySlot())); + TQTimer::singleShot(msec / 2, this, TQT_SLOT(myMidSlot())); } void BlackHoleTimer::mySlot() @@ -1341,11 +1341,11 @@ bool BlackHole::place(Ball *ball, bool /*wasCenter*/) ball->setVisible(false); ball->setForceStillGoing(true); - double magnitude = Vector(QPoint(x(), y()), QPoint(exitItem->x(), exitItem->y())).magnitude(); + double magnitude = Vector(TQPoint(x(), y()), TQPoint(exitItem->x(), exitItem->y())).magnitude(); BlackHoleTimer *timer = new BlackHoleTimer(ball, speed, magnitude * 2.5 - speed * 35 + 500); - connect(timer, SIGNAL(eject(Ball *, double)), this, SLOT(eject(Ball *, double))); - connect(timer, SIGNAL(halfway()), this, SLOT(halfway())); + connect(timer, TQT_SIGNAL(eject(Ball *, double)), this, TQT_SLOT(eject(Ball *, double))); + connect(timer, TQT_SIGNAL(halfway()), this, TQT_SLOT(halfway())); playSound("blackhole"); return false; @@ -1382,7 +1382,7 @@ void BlackHole::halfway() void BlackHole::load(KConfig *cfg) { - QPoint exit = cfg->readPointEntry("exit", &exit); + TQPoint exit = cfg->readPointEntry("exit", &exit); exitItem->setX(exit.x()); exitItem->setY(exit.y()); exitDeg = cfg->readNumEntry("exitDeg", exitDeg); @@ -1397,9 +1397,9 @@ void BlackHole::load(KConfig *cfg) void BlackHole::finishMe() { double radians = deg2rad(exitDeg); - QPoint midPoint(0, 0); - QPoint start; - QPoint end; + TQPoint midPoint(0, 0); + TQPoint start; + TQPoint end; const int width = 15; if (midPoint.y() || !midPoint.x()) @@ -1423,7 +1423,7 @@ void BlackHole::finishMe() void BlackHole::save(KConfig *cfg) { - cfg->writeEntry("exit", QPoint(exitItem->x(), exitItem->y())); + cfg->writeEntry("exit", TQPoint(exitItem->x(), exitItem->y())); cfg->writeEntry("exitDeg", exitDeg); cfg->writeEntry("minspeed", m_minSpeed); cfg->writeEntry("maxspeed", m_maxSpeed); @@ -1431,8 +1431,8 @@ void BlackHole::save(KConfig *cfg) ///////////////////////// -BlackHoleExit::BlackHoleExit(BlackHole *blackHole, QCanvas *canvas) - : QCanvasLine(canvas) +BlackHoleExit::BlackHoleExit(BlackHole *blackHole, TQCanvas *canvas) + : TQCanvasLine(canvas) { this->blackHole = blackHole; arrow = new Arrow(canvas); @@ -1450,15 +1450,15 @@ void BlackHoleExit::aboutToDie() void BlackHoleExit::moveBy(double dx, double dy) { - QCanvasLine::moveBy(dx, dy); + TQCanvasLine::moveBy(dx, dy); arrow->move(x(), y()); blackHole->updateInfo(); } -void BlackHoleExit::setPen(QPen p) +void BlackHoleExit::setPen(TQPen p) { - QCanvasLine::setPen(p); - arrow->setPen(QPen(p.color(), 1)); + TQCanvasLine::setPen(p); + arrow->setPen(TQPen(p.color(), 1)); } void BlackHoleExit::updateArrowAngle() @@ -1492,42 +1492,42 @@ void BlackHoleExit::hideInfo() arrow->setVisible(false); } -Config *BlackHoleExit::config(QWidget *parent) +Config *BlackHoleExit::config(TQWidget *parent) { return blackHole->config(parent); } ///////////////////////// -BlackHoleConfig::BlackHoleConfig(BlackHole *blackHole, QWidget *parent) +BlackHoleConfig::BlackHoleConfig(BlackHole *blackHole, TQWidget *parent) : Config(parent) { this->blackHole = blackHole; - QVBoxLayout *layout = new QVBoxLayout(this, marginHint(), spacingHint()); - layout->addWidget(new QLabel(i18n("Exiting ball angle:"), this)); - QSpinBox *deg = new QSpinBox(0, 359, 10, this); - deg->setSuffix(QString(" ") + i18n("degrees")); + TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); + layout->addWidget(new TQLabel(i18n("Exiting ball angle:"), this)); + TQSpinBox *deg = new TQSpinBox(0, 359, 10, this); + deg->setSuffix(TQString(" ") + i18n("degrees")); deg->setValue(blackHole->curExitDeg()); deg->setWrapping(true); layout->addWidget(deg); - connect(deg, SIGNAL(valueChanged(int)), this, SLOT(degChanged(int))); + connect(deg, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(degChanged(int))); layout->addStretch(); - QHBoxLayout *hlayout = new QHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new QLabel(i18n("Minimum exit speed:"), this)); + TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); + hlayout->addWidget(new TQLabel(i18n("Minimum exit speed:"), this)); KDoubleNumInput *min = new KDoubleNumInput(this); min->setRange(0, 8, 1, true); hlayout->addWidget(min); - connect(min, SIGNAL(valueChanged(double)), this, SLOT(minChanged(double))); + connect(min, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(minChanged(double))); min->setValue(blackHole->minSpeed()); - hlayout = new QHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new QLabel(i18n("Maximum:"), this)); + hlayout = new TQHBoxLayout(layout, spacingHint()); + hlayout->addWidget(new TQLabel(i18n("Maximum:"), this)); KDoubleNumInput *max = new KDoubleNumInput(this); max->setRange(1, 10, 1, true); hlayout->addWidget(max); - connect(max, SIGNAL(valueChanged(double)), this, SLOT(maxChanged(double))); + connect(max, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(maxChanged(double))); max->setValue(blackHole->maxSpeed()); } @@ -1551,8 +1551,8 @@ void BlackHoleConfig::maxChanged(double news) ///////////////////////// -WallPoint::WallPoint(bool start, Wall *wall, QCanvas *canvas) - : QCanvasEllipse(canvas) +WallPoint::WallPoint(bool start, Wall *wall, TQCanvas *canvas) + : TQCanvasEllipse(canvas) { this->wall = wall; this->start = start; @@ -1563,7 +1563,7 @@ WallPoint::WallPoint(bool start, Wall *wall, QCanvas *canvas) dontmove = false; move(0, 0); - QPoint p; + TQPoint p; if (start) p = wall->startPoint(); else @@ -1578,9 +1578,9 @@ void WallPoint::clean() setSize(7, 7); update(); - QCanvasItem *onPoint = 0; - QCanvasItemList l = collisions(true); - for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) + TQCanvasItem *onPoint = 0; + TQCanvasItemList l = collisions(true); + for (TQCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) if ((*it)->rtti() == rtti()) onPoint = (*it); @@ -1592,7 +1592,7 @@ void WallPoint::clean() void WallPoint::moveBy(double dx, double dy) { - QCanvasEllipse::moveBy(dx, dy); + TQCanvasEllipse::moveBy(dx, dy); if (!editing) updateVisible(); @@ -1629,8 +1629,8 @@ void WallPoint::updateVisible() else { visible = true; - QCanvasItemList l = collisions(true); - for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) + TQCanvasItemList l = collisions(true); + for (TQCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) if ((*it)->rtti() == rtti()) visible = false; } @@ -1651,8 +1651,8 @@ bool WallPoint::collision(Ball *ball, long int id) long int tempLastId = lastId; lastId = id; - QCanvasItemList l = collisions(true); - for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) + TQCanvasItemList l = collisions(true); + for (TQCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) { if ((*it)->rtti() == rtti()) { @@ -1683,8 +1683,8 @@ bool WallPoint::collision(Ball *ball, long int id) { bool weirdBounce = visible; - QPoint relStart(start? wall->startPoint() : wall->endPoint()); - QPoint relEnd(start? wall->endPoint() : wall->startPoint()); + TQPoint relStart(start? wall->startPoint() : wall->endPoint()); + TQPoint relEnd(start? wall->endPoint() : wall->startPoint()); Vector wallVector(relStart, relEnd); wallVector.setDirection(-wallVector.direction()); @@ -1725,8 +1725,8 @@ bool WallPoint::collision(Ball *ball, long int id) ///////////////////////// -Wall::Wall(QCanvas *canvas) - : QCanvasLine(canvas) +Wall::Wall(TQCanvas *canvas) + : TQCanvasLine(canvas) { editing = false; lastId = INT_MAX - 10; @@ -1743,7 +1743,7 @@ Wall::Wall(QCanvas *canvas) endItem = new WallPoint(false, this, canvas); startItem->setVisible(true); endItem->setVisible(true); - setPen(QPen(darkRed, 3)); + setPen(TQPen(darkRed, 3)); setPoints(-15, 10, 15, -5); @@ -1752,7 +1752,7 @@ Wall::Wall(QCanvas *canvas) editModeChanged(false); } -void Wall::selectedItem(QCanvasItem *item) +void Wall::selectedItem(TQCanvasItem *item) { if (item->rtti() == Rtti_WallPoint) { @@ -1777,7 +1777,7 @@ void Wall::setAlwaysShow(bool yes) void Wall::setVisible(bool yes) { - QCanvasLine::setVisible(yes); + TQCanvasLine::setVisible(yes); startItem->setVisible(yes); endItem->setVisible(yes); @@ -1787,21 +1787,21 @@ void Wall::setVisible(bool yes) void Wall::setZ(double newz) { - QCanvasLine::setZ(newz); + TQCanvasLine::setZ(newz); if (startItem) startItem->setZ(newz + .002); if (endItem) endItem->setZ(newz + .001); } -void Wall::setPen(QPen p) +void Wall::setPen(TQPen p) { - QCanvasLine::setPen(p); + TQCanvasLine::setPen(p); if (startItem) - startItem->setBrush(QBrush(p.color())); + startItem->setBrush(TQBrush(p.color())); if (endItem) - endItem->setBrush(QBrush(p.color())); + endItem->setBrush(TQBrush(p.color())); } void Wall::aboutToDie() @@ -1817,9 +1817,9 @@ void Wall::setGame(KolfGame *game) endItem->setGame(game); } -QPtrList<QCanvasItem> Wall::moveableItems() const +TQPtrList<TQCanvasItem> Wall::moveableItems() const { - QPtrList<QCanvasItem> ret; + TQPtrList<TQCanvasItem> ret; ret.append(startItem); ret.append(endItem); return ret; @@ -1827,7 +1827,7 @@ QPtrList<QCanvasItem> Wall::moveableItems() const void Wall::moveBy(double dx, double dy) { - QCanvasLine::moveBy(dx, dy); + TQCanvasLine::moveBy(dx, dy); if (!startItem || !endItem) return; @@ -1840,26 +1840,26 @@ void Wall::moveBy(double dx, double dy) void Wall::setVelocity(double vx, double vy) { - QCanvasLine::setVelocity(vx, vy); + TQCanvasLine::setVelocity(vx, vy); /* startItem->setVelocity(vx, vy); endItem->setVelocity(vx, vy); */ } -QPointArray Wall::areaPoints() const +TQPointArray Wall::areaPoints() const { // editing we want full width for easy moving if (editing) - return QCanvasLine::areaPoints(); + return TQCanvasLine::areaPoints(); - // lessen width, for QCanvasLine::areaPoints() likes + // lessen width, for TQCanvasLine::areaPoints() likes // to make lines _very_ fat :( // from qcanvas.cpp, only the stuff for a line width of 1 taken // it's all squished because I don't want my // line counts to count code I didn't write! - QPointArray p(4); const int xi = int(x()); const int yi = int(y()); const QPoint start = startPoint(); const QPoint end = endPoint(); const int x1 = start.x(); const int x2 = end.x(); const int y1 = start.y(); const int y2 = end.y(); const int dx = QABS(x1-x2); const int dy = QABS(y1-y2); if ( dx > dy ) { p[0] = QPoint(x1+xi,y1+yi-1); p[1] = QPoint(x2+xi,y2+yi-1); p[2] = QPoint(x2+xi,y2+yi+1); p[3] = QPoint(x1+xi,y1+yi+1); } else { p[0] = QPoint(x1+xi-1,y1+yi); p[1] = QPoint(x2+xi-1,y2+yi); p[2] = QPoint(x2+xi+1,y2+yi); p[3] = QPoint(x1+xi+1,y1+yi); } return p; + TQPointArray p(4); const int xi = int(x()); const int yi = int(y()); const TQPoint start = startPoint(); const TQPoint end = endPoint(); const int x1 = start.x(); const int x2 = end.x(); const int y1 = start.y(); const int y2 = end.y(); const int dx = QABS(x1-x2); const int dy = QABS(y1-y2); if ( dx > dy ) { p[0] = TQPoint(x1+xi,y1+yi-1); p[1] = TQPoint(x2+xi,y2+yi-1); p[2] = TQPoint(x2+xi,y2+yi+1); p[3] = TQPoint(x1+xi,y1+yi+1); } else { p[0] = TQPoint(x1+xi-1,y1+yi); p[1] = TQPoint(x2+xi-1,y2+yi); p[2] = TQPoint(x2+xi+1,y2+yi); p[3] = TQPoint(x1+xi+1,y1+yi); } return p; } void Wall::editModeChanged(bool changed) @@ -1934,9 +1934,9 @@ bool Wall::collision(Ball *ball, long int id) void Wall::load(KConfig *cfg) { - QPoint start(startPoint()); + TQPoint start(startPoint()); start = cfg->readPointEntry("startPoint", &start); - QPoint end(endPoint()); + TQPoint end(endPoint()); end = cfg->readPointEntry("endPoint", &end); setPoints(start.x(), start.y(), end.x(), end.y()); @@ -1948,63 +1948,63 @@ void Wall::load(KConfig *cfg) void Wall::save(KConfig *cfg) { - cfg->writeEntry("startPoint", QPoint(startItem->x(), startItem->y())); - cfg->writeEntry("endPoint", QPoint(endItem->x(), endItem->y())); + cfg->writeEntry("startPoint", TQPoint(startItem->x(), startItem->y())); + cfg->writeEntry("endPoint", TQPoint(endItem->x(), endItem->y())); } ///////////////////////// -HoleConfig::HoleConfig(HoleInfo *holeInfo, QWidget *parent) +HoleConfig::HoleConfig(HoleInfo *holeInfo, TQWidget *parent) : Config(parent) { this->holeInfo = holeInfo; - QVBoxLayout *layout = new QVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); - QHBoxLayout *hlayout = new QHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new QLabel(i18n("Course name: "), this)); + TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); + hlayout->addWidget(new TQLabel(i18n("Course name: "), this)); KLineEdit *nameEdit = new KLineEdit(holeInfo->untranslatedName(), this); hlayout->addWidget(nameEdit); - connect(nameEdit, SIGNAL(textChanged(const QString &)), this, SLOT(nameChanged(const QString &))); + connect(nameEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(nameChanged(const TQString &))); - hlayout = new QHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new QLabel(i18n("Course author: "), this)); + hlayout = new TQHBoxLayout(layout, spacingHint()); + hlayout->addWidget(new TQLabel(i18n("Course author: "), this)); KLineEdit *authorEdit = new KLineEdit(holeInfo->author(), this); hlayout->addWidget(authorEdit); - connect(authorEdit, SIGNAL(textChanged(const QString &)), this, SLOT(authorChanged(const QString &))); + connect(authorEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(authorChanged(const TQString &))); layout->addStretch(); - hlayout = new QHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new QLabel(i18n("Par:"), this)); - QSpinBox *par = new QSpinBox(1, 15, 1, this); + hlayout = new TQHBoxLayout(layout, spacingHint()); + hlayout->addWidget(new TQLabel(i18n("Par:"), this)); + TQSpinBox *par = new TQSpinBox(1, 15, 1, this); par->setValue(holeInfo->par()); hlayout->addWidget(par); - connect(par, SIGNAL(valueChanged(int)), this, SLOT(parChanged(int))); + connect(par, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(parChanged(int))); hlayout->addStretch(); - hlayout->addWidget(new QLabel(i18n("Maximum:"), this)); - QSpinBox *maxstrokes = new QSpinBox(holeInfo->lowestMaxStrokes(), 30, 1, this); - QWhatsThis::add(maxstrokes, i18n("Maximum number of strokes player can take on this hole.")); - QToolTip::add(maxstrokes, i18n("Maximum number of strokes")); + hlayout->addWidget(new TQLabel(i18n("Maximum:"), this)); + TQSpinBox *maxstrokes = new TQSpinBox(holeInfo->lowestMaxStrokes(), 30, 1, this); + TQWhatsThis::add(maxstrokes, i18n("Maximum number of strokes player can take on this hole.")); + TQToolTip::add(maxstrokes, i18n("Maximum number of strokes")); maxstrokes->setSpecialValueText(i18n("Unlimited")); maxstrokes->setValue(holeInfo->maxStrokes()); hlayout->addWidget(maxstrokes); - connect(maxstrokes, SIGNAL(valueChanged(int)), this, SLOT(maxStrokesChanged(int))); + connect(maxstrokes, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(maxStrokesChanged(int))); - QCheckBox *check = new QCheckBox(i18n("Show border walls"), this); + TQCheckBox *check = new TQCheckBox(i18n("Show border walls"), this); check->setChecked(holeInfo->borderWalls()); layout->addWidget(check); - connect(check, SIGNAL(toggled(bool)), this, SLOT(borderWallsChanged(bool))); + connect(check, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(borderWallsChanged(bool))); } -void HoleConfig::authorChanged(const QString &newauthor) +void HoleConfig::authorChanged(const TQString &newauthor) { holeInfo->setAuthor(newauthor); changed(); } -void HoleConfig::nameChanged(const QString &newname) +void HoleConfig::nameChanged(const TQString &newname) { holeInfo->setName(newname); holeInfo->setUntranslatedName(newname); @@ -2031,8 +2031,8 @@ void HoleConfig::borderWallsChanged(bool yes) ///////////////////////// -StrokeCircle::StrokeCircle(QCanvas *canvas) - : QCanvasItem(canvas) +StrokeCircle::StrokeCircle(TQCanvas *canvas) + : TQCanvasItem(canvas) { dvalue = 0; dmax = 360; @@ -2056,11 +2056,11 @@ double StrokeCircle::value() return dvalue; } -bool StrokeCircle::collidesWith(const QCanvasItem*) const { return false; } +bool StrokeCircle::collidesWith(const TQCanvasItem*) const { return false; } -bool StrokeCircle::collidesWith(const QCanvasSprite*, const QCanvasPolygonalItem*, const QCanvasRectangle*, const QCanvasEllipse*, const QCanvasText*) const { return false; } +bool StrokeCircle::collidesWith(const TQCanvasSprite*, const TQCanvasPolygonalItem*, const TQCanvasRectangle*, const TQCanvasEllipse*, const TQCanvasText*) const { return false; } -QRect StrokeCircle::boundingRect() const { return QRect(x(), y(), iwidth, iheight); } +TQRect StrokeCircle::boundingRect() const { return TQRect(x(), y(), iwidth, iheight); } void StrokeCircle::setMaxValue(double m) { @@ -2102,7 +2102,7 @@ int StrokeCircle::height() const return iheight; } -void StrokeCircle::draw(QPainter &p) +void StrokeCircle::draw(TQPainter &p) { int al = (int)((dvalue * 360 * 16) / dmax); int length, deg; @@ -2122,16 +2122,16 @@ void StrokeCircle::draw(QPainter &p) length = al; } - p.setBrush(QBrush(black, Qt::NoBrush)); - p.setPen(QPen(white, ithickness / 2)); + p.setBrush(TQBrush(black, Qt::NoBrush)); + p.setPen(TQPen(white, ithickness / 2)); p.drawEllipse(x() + ithickness / 2, y() + ithickness / 2, iwidth - ithickness, iheight - ithickness); - p.setPen(QPen(QColor((int)(0xff * dvalue) / dmax, 0, 0xff - (int)(0xff * dvalue) / dmax), ithickness)); + p.setPen(TQPen(TQColor((int)(0xff * dvalue) / dmax, 0, 0xff - (int)(0xff * dvalue) / dmax), ithickness)); p.drawArc(x() + ithickness / 2, y() + ithickness / 2, iwidth - ithickness, iheight - ithickness, deg, length); - p.setPen(QPen(white, 1)); + p.setPen(TQPen(white, 1)); p.drawEllipse(x(), y(), iwidth, iheight); p.drawEllipse(x() + ithickness, y() + ithickness, iwidth - ithickness * 2, iheight - ithickness * 2); - p.setPen(QPen(white, 3)); + p.setPen(TQPen(white, 3)); p.drawLine(x() + iwidth / 2, y() + iheight - ithickness * 1.5, x() + iwidth / 2, y() + iheight); p.drawLine(x() + iwidth / 4 - iwidth / 20, y() + iheight - iheight / 4 + iheight / 20, x() + iwidth / 4 + iwidth / 20, y() + iheight - iheight / 4 - iheight / 20); p.drawLine(x() + iwidth - iwidth / 4 + iwidth / 20, y() + iheight - iheight / 4 + iheight / 20, x() + iwidth - iwidth / 4 - iwidth / 20, y() + iheight - iheight / 4 - iheight / 20); @@ -2139,8 +2139,8 @@ void StrokeCircle::draw(QPainter &p) ///////////////////////////////////////// -KolfGame::KolfGame(ObjectList *obj, PlayerList *players, QString filename, QWidget *parent, const char *name ) - : QCanvasView(parent, name) +KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWidget *parent, const char *name ) + : TQCanvasView(parent, name) { // for mouse control setMouseTracking(true); @@ -2193,24 +2193,24 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, QString filename, QWidg // in easy storage width = 400; height = 400; - grass = QColor("#35760D"); + grass = TQColor("#35760D"); margin = 10; - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(TQWidget::StrongFocus); setFixedSize(width + 2 * margin, height + 2 * margin); setMargins(margin, margin, margin, margin); - course = new QCanvas(this); + course = new TQCanvas(this); course->setBackgroundColor(white); course->resize(width, height); - QPixmap pic; - if (!QPixmapCache::find("grass", pic)) + TQPixmap pic; + if (!TQPixmapCache::find("grass", pic)) { pic.load(locate("appdata", "pics/grass.png")); - QPixmapCache::insert("grass", pic); + TQPixmapCache::insert("grass", pic); } course->setBackgroundPixmap(pic); @@ -2222,17 +2222,17 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, QString filename, QWidg (*it).ball()->setCanvas(course); // highlighter shows current item - highlighter = new QCanvasRectangle(course); - highlighter->setPen(QPen(yellow, 1)); - highlighter->setBrush(QBrush(NoBrush)); + highlighter = new TQCanvasRectangle(course); + highlighter->setPen(TQPen(yellow, 1)); + highlighter->setBrush(TQBrush(NoBrush)); highlighter->setVisible(false); highlighter->setZ(10000); // shows some info about hole - infoText = new QCanvasText(course); + infoText = new TQCanvasText(course); infoText->setText(""); infoText->setColor(white); - QFont font = kapp->font(); + TQFont font = kapp->font(); font.setPixelSize(12); infoText->move(15, width/2); infoText->setZ(10001); @@ -2276,31 +2276,31 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, QString filename, QWidg // border walls: // horiz - addBorderWall(QPoint(margin, margin), QPoint(width - margin, margin)); - addBorderWall(QPoint(margin, height - margin - 1), QPoint(width - margin, height - margin - 1)); + addBorderWall(TQPoint(margin, margin), TQPoint(width - margin, margin)); + addBorderWall(TQPoint(margin, height - margin - 1), TQPoint(width - margin, height - margin - 1)); // vert - addBorderWall(QPoint(margin, margin), QPoint(margin, height - margin)); - addBorderWall(QPoint(width - margin - 1, margin), QPoint(width - margin - 1, height - margin)); + addBorderWall(TQPoint(margin, margin), TQPoint(margin, height - margin)); + addBorderWall(TQPoint(width - margin - 1, margin), TQPoint(width - margin - 1, height - margin)); - timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(timeout())); + timer = new TQTimer(this); + connect(timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeout())); timerMsec = 300; - fastTimer = new QTimer(this); - connect(fastTimer, SIGNAL(timeout()), this, SLOT(fastTimeout())); + fastTimer = new TQTimer(this); + connect(fastTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(fastTimeout())); fastTimerMsec = 11; - autoSaveTimer = new QTimer(this); - connect(autoSaveTimer, SIGNAL(timeout()), this, SLOT(autoSaveTimeout())); + autoSaveTimer = new TQTimer(this); + connect(autoSaveTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(autoSaveTimeout())); autoSaveMsec = 5 * 1000 * 60; // 5 min autosave // setUseAdvancedPutting() sets maxStrength! setUseAdvancedPutting(false); putting = false; - putterTimer = new QTimer(this); - connect(putterTimer, SIGNAL(timeout()), this, SLOT(putterTimeout())); + putterTimer = new TQTimer(this); + connect(putterTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(putterTimeout())); putterTimerMsec = 20; } @@ -2311,7 +2311,7 @@ void KolfGame::startFirstHole(int hole) { for (; scoreboardHoles < curHole; ++scoreboardHoles) { - cfg->setGroup(QString("%1-hole@-50,-50|0").arg(scoreboardHoles + 1)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(scoreboardHoles + 1)); emit newHole(cfg->readNumEntry("par", 3)); } @@ -2330,7 +2330,7 @@ void KolfGame::startFirstHole(int hole) unPause(); } -void KolfGame::setFilename(const QString &filename) +void KolfGame::setFilename(const TQString &filename) { this->filename = filename; delete cfg; @@ -2378,7 +2378,7 @@ void KolfGame::unPause() putterTimer->start(putterTimerMsec); } -void KolfGame::addBorderWall(QPoint start, QPoint end) +void KolfGame::addBorderWall(TQPoint start, TQPoint end) { Wall *wall = new Wall(course); wall->setPoints(start.x(), start.y(), end.x(), end.y()); @@ -2392,18 +2392,18 @@ void KolfGame::updateHighlighter() { if (!selectedItem) return; - QRect rect = selectedItem->boundingRect(); + TQRect rect = selectedItem->boundingRect(); highlighter->move(rect.x() + 1, rect.y() + 1); highlighter->setSize(rect.width(), rect.height()); } -void KolfGame::handleMouseDoubleClickEvent(QMouseEvent *e) +void KolfGame::handleMouseDoubleClickEvent(TQMouseEvent *e) { // allow two fast single clicks handleMousePressEvent(e); } -void KolfGame::handleMousePressEvent(QMouseEvent *e) +void KolfGame::handleMousePressEvent(TQMouseEvent *e) { if (m_ignoreEvents) return; @@ -2415,7 +2415,7 @@ void KolfGame::handleMousePressEvent(QMouseEvent *e) storedMousePos = e->pos(); - QCanvasItemList list = course->collisions(e->pos()); + TQCanvasItemList list = course->collisions(e->pos()); if (list.first() == highlighter) list.pop_front(); @@ -2459,7 +2459,7 @@ void KolfGame::handleMousePressEvent(QMouseEvent *e) emit newSelectedItem(citem); highlighter->setVisible(true); - QRect rect = selectedItem->boundingRect(); + TQRect rect = selectedItem->boundingRect(); highlighter->move(rect.x() + 1, rect.y() + 1); highlighter->setSize(rect.width(), rect.height()); } @@ -2483,45 +2483,45 @@ void KolfGame::handleMousePressEvent(QMouseEvent *e) setFocus(); } -QPoint KolfGame::viewportToViewport(const QPoint &p) +TQPoint KolfGame::viewportToViewport(const TQPoint &p) { // for some reason viewportToContents doesn't work right - return p - QPoint(margin, margin); + return p - TQPoint(margin, margin); } // the following four functions are needed to handle both // border presses and regular in-course presses -void KolfGame::mouseReleaseEvent(QMouseEvent * e) +void KolfGame::mouseReleaseEvent(TQMouseEvent * e) { - QMouseEvent fixedEvent (QEvent::MouseButtonRelease, viewportToViewport(viewportToContents(e->pos())), e->button(), e->state()); + TQMouseEvent fixedEvent (TQEvent::MouseButtonRelease, viewportToViewport(viewportToContents(e->pos())), e->button(), e->state()); handleMouseReleaseEvent(&fixedEvent); } -void KolfGame::mousePressEvent(QMouseEvent * e) +void KolfGame::mousePressEvent(TQMouseEvent * e) { - QMouseEvent fixedEvent (QEvent::MouseButtonPress, viewportToViewport(viewportToContents(e->pos())), e->button(), e->state()); + TQMouseEvent fixedEvent (TQEvent::MouseButtonPress, viewportToViewport(viewportToContents(e->pos())), e->button(), e->state()); handleMousePressEvent(&fixedEvent); } -void KolfGame::mouseDoubleClickEvent(QMouseEvent * e) +void KolfGame::mouseDoubleClickEvent(TQMouseEvent * e) { - QMouseEvent fixedEvent (QEvent::MouseButtonDblClick, viewportToViewport(viewportToContents(e->pos())), e->button(), e->state()); + TQMouseEvent fixedEvent (TQEvent::MouseButtonDblClick, viewportToViewport(viewportToContents(e->pos())), e->button(), e->state()); handleMouseDoubleClickEvent(&fixedEvent); } -void KolfGame::mouseMoveEvent(QMouseEvent * e) +void KolfGame::mouseMoveEvent(TQMouseEvent * e) { - QMouseEvent fixedEvent (QEvent::MouseMove, viewportToViewport(viewportToContents(e->pos())), e->button(), e->state()); + TQMouseEvent fixedEvent (TQEvent::MouseMove, viewportToViewport(viewportToContents(e->pos())), e->button(), e->state()); handleMouseMoveEvent(&fixedEvent); } -void KolfGame::handleMouseMoveEvent(QMouseEvent *e) +void KolfGame::handleMouseMoveEvent(TQMouseEvent *e) { if (inPlay || !putter || m_ignoreEvents) return; - QPoint mouse = e->pos(); + TQPoint mouse = e->pos(); // mouse moving of putter if (!editing) @@ -2535,7 +2535,7 @@ void KolfGame::handleMouseMoveEvent(QMouseEvent *e) // lets change the cursor to a hand // if we're hovering over something - QCanvasItemList list = course->collisions(e->pos()); + TQCanvasItemList list = course->collisions(e->pos()); if (list.count() > 0) setCursor(KCursor::handCursor()); else @@ -2552,8 +2552,8 @@ void KolfGame::handleMouseMoveEvent(QMouseEvent *e) highlighter->moveBy(-(double)moveX, -(double)moveY); movingItem->moveBy(-(double)moveX, -(double)moveY); - QRect brect = movingItem->boundingRect(); - emit newStatusText(QString("%1x%2").arg(brect.x()).arg(brect.y())); + TQRect brect = movingItem->boundingRect(); + emit newStatusText(TQString("%1x%2").arg(brect.x()).arg(brect.y())); storedMousePos = mouse; } @@ -2563,18 +2563,18 @@ void KolfGame::updateMouse() if (!m_useMouse || ((stroking || putting) && m_useAdvancedPutting)) return; - const QPoint cursor = viewportToViewport(viewportToContents(mapFromGlobal(QCursor::pos()))); - const QPoint ball((*curPlayer).ball()->x(), (*curPlayer).ball()->y()); + const TQPoint cursor = viewportToViewport(viewportToContents(mapFromGlobal(TQCursor::pos()))); + const TQPoint ball((*curPlayer).ball()->x(), (*curPlayer).ball()->y()); putter->setAngle(-Vector(cursor, ball).direction()); } -void KolfGame::handleMouseReleaseEvent(QMouseEvent *e) +void KolfGame::handleMouseReleaseEvent(TQMouseEvent *e) { setCursor(KCursor::arrowCursor()); if (editing) { - emit newStatusText(QString::null); + emit newStatusText(TQString::null); moving = false; } @@ -2592,7 +2592,7 @@ void KolfGame::handleMouseReleaseEvent(QMouseEvent *e) setFocus(); } -void KolfGame::keyPressEvent(QKeyEvent *e) +void KolfGame::keyPressEvent(TQKeyEvent *e) { if (inPlay || editing || m_ignoreEvents) return; @@ -2645,7 +2645,7 @@ void KolfGame::setShowInfo(bool yes) if (m_showInfo) { - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { CanvasItem *citem = dynamic_cast<CanvasItem *>(item); @@ -2660,7 +2660,7 @@ void KolfGame::setShowInfo(bool yes) } else { - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { CanvasItem *citem = dynamic_cast<CanvasItem *>(item); @@ -2719,7 +2719,7 @@ void KolfGame::puttPress() } } -void KolfGame::keyReleaseEvent(QKeyEvent *e) +void KolfGame::keyReleaseEvent(TQKeyEvent *e) { if (e->isAutoRepeat() || m_ignoreEvents) return; @@ -2736,7 +2736,7 @@ void KolfGame::keyReleaseEvent(QKeyEvent *e) citem = citem->itemToDelete(); if (!citem) return; - QCanvasItem *item = dynamic_cast<QCanvasItem *>(citem); + TQCanvasItem *item = dynamic_cast<TQCanvasItem *>(citem); if (citem && citem->deleteable()) { lastDelId = citem->curId(); @@ -2785,7 +2785,7 @@ void KolfGame::timeout() // later undo the shot for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) { - if (!course->rect().contains(QPoint((*it).ball()->x(), (*it).ball()->y()))) + if (!course->rect().contains(TQPoint((*it).ball()->x(), (*it).ball()->y()))) { (*it).ball()->setState(Stopped); @@ -2808,7 +2808,7 @@ void KolfGame::timeout() if (curState == Stopped && inPlay) { inPlay = false; - QTimer::singleShot(0, this, SLOT(shotDone())); + TQTimer::singleShot(0, this, TQT_SLOT(shotDone())); } if (curState == Holed && inPlay) @@ -2842,12 +2842,12 @@ void KolfGame::timeout() (*curPlayer).addStrokeToHole(curHole); emit scoreChanged((*curPlayer).id(), curHole, (*curPlayer).score(curHole)); } - QTimer::singleShot(600, this, SLOT(holeDone())); + TQTimer::singleShot(600, this, TQT_SLOT(holeDone())); } else { inPlay = false; - QTimer::singleShot(0, this, SLOT(shotDone())); + TQTimer::singleShot(0, this, TQT_SLOT(shotDone())); } } } @@ -3036,7 +3036,7 @@ void KolfGame::recreateStateList() { stateDB.clear(); - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { @@ -3063,7 +3063,7 @@ void KolfGame::undoShot() void KolfGame::loadStateList() { - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { @@ -3132,11 +3132,11 @@ void KolfGame::shotDone() { ball->setPlaceOnGround(false); - QStringList options; - const QString placeOutside = i18n("Drop Outside of Hazard"); - const QString rehit = i18n("Rehit From Last Location"); + TQStringList options; + const TQString placeOutside = i18n("Drop Outside of Hazard"); + const TQString rehit = i18n("Rehit From Last Location"); options << placeOutside << rehit; - const QString choice = KComboBoxDialog::getItem(i18n("What would you like to do for your next shot?"), i18n("%1 is in a Hazard").arg((*it).name()), options, placeOutside, "hazardOptions"); + const TQString choice = KComboBoxDialog::getItem(i18n("What would you like to do for your next shot?"), i18n("%1 is in a Hazard").arg((*it).name()), options, placeOutside, "hazardOptions"); if (choice == placeOutside) { @@ -3146,11 +3146,11 @@ void KolfGame::shotDone() while (1) { - QCanvasItemList list = ball->collisions(true); + TQCanvasItemList list = ball->collisions(true); bool keepMoving = false; while (!list.isEmpty()) { - QCanvasItem *item = list.first(); + TQCanvasItem *item = list.first(); if (item->rtti() == Rtti_DontPlaceOn) keepMoving = true; @@ -3216,11 +3216,11 @@ void KolfGame::shotDone() if (allPlayersDone()) { startNextHole(); - QTimer::singleShot(100, this, SLOT(emitMax())); + TQTimer::singleShot(100, this, TQT_SLOT(emitMax())); return; } - QTimer::singleShot(100, this, SLOT(emitMax())); + TQTimer::singleShot(100, this, TQT_SLOT(emitMax())); } } @@ -3261,7 +3261,7 @@ void KolfGame::startBall(const Vector &vector) (*curPlayer).ball()->setState(Rolling); (*curPlayer).ball()->setVector(vector); - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { CanvasItem *citem = dynamic_cast<CanvasItem *>(item); @@ -3429,7 +3429,7 @@ void KolfGame::startNextHole() for (; scoreboardHoles < curHole; ++scoreboardHoles) { - cfg->setGroup(QString("%1-hole@-50,-50|0").arg(scoreboardHoles + 1)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(scoreboardHoles + 1)); emit newHole(cfg->readNumEntry("par", 3)); } @@ -3451,8 +3451,8 @@ void KolfGame::startNextHole() void KolfGame::showInfo() { - QString text = i18n("Hole %1: par %2, maximum %3 strokes").arg(curHole).arg(holeInfo.par()).arg(holeInfo.maxStrokes()); - infoText->move((width - QFontMetrics(infoText->font()).width(text)) / 2, infoText->y()); + TQString text = i18n("Hole %1: par %2, maximum %3 strokes").arg(curHole).arg(holeInfo.par()).arg(holeInfo.maxStrokes()); + infoText->move((width - TQFontMetrics(infoText->font()).width(text)) / 2, infoText->y()); infoText->setText(text); // I hate this text! Let's not show it //infoText->setVisible(true); @@ -3463,11 +3463,11 @@ void KolfGame::showInfo() void KolfGame::showInfoDlg(bool addDontShowAgain) { KMessageBox::information(parentWidget(), - i18n("Course name: %1").arg(holeInfo.name()) + QString("\n") - + i18n("Created by %1").arg(holeInfo.author()) + QString("\n") + i18n("Course name: %1").arg(holeInfo.name()) + TQString("\n") + + i18n("Created by %1").arg(holeInfo.author()) + TQString("\n") + i18n("%1 holes").arg(highestHole), i18n("Course Information"), - addDontShowAgain? holeInfo.name() + QString(" ") + holeInfo.author() : QString::null); + addDontShowAgain? holeInfo.name() + TQString(" ") + holeInfo.author() : TQString::null); } void KolfGame::hideInfo() @@ -3475,14 +3475,14 @@ void KolfGame::hideInfo() infoText->setText(""); infoText->setVisible(false); - emit newStatusText(QString::null); + emit newStatusText(TQString::null); } void KolfGame::openFile() { Object *curObj = 0; - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { CanvasItem *citem = dynamic_cast<CanvasItem *>(item); @@ -3514,20 +3514,20 @@ void KolfGame::openFile() holeInfo.setUntranslatedName(cfg->readEntryUntranslated("Name", holeInfo.untranslatedName())); emit titleChanged(holeInfo.name()); - cfg->setGroup(QString("%1-hole@-50,-50|0").arg(curHole)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(curHole)); curPar = cfg->readNumEntry("par", 3); holeInfo.setPar(curPar); holeInfo.borderWallsChanged(cfg->readBoolEntry("borderWalls", holeInfo.borderWalls())); holeInfo.setMaxStrokes(cfg->readNumEntry("maxstrokes", 10)); bool hasFinalLoad = cfg->readBoolEntry("hasFinalLoad", true); - QStringList missingPlugins; - QStringList groups = cfg->groupList(); + TQStringList missingPlugins; + TQStringList groups = cfg->groupList(); int numItems = 0; int _highestHole = 0; - for (QStringList::Iterator it = groups.begin(); it != groups.end(); ++it) + for (TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it) { // [<holeNum>-<name>@<x>,<y>|<id>] cfg->setGroup(*it); @@ -3539,7 +3539,7 @@ void KolfGame::openFile() _highestHole = holeNum; const int atIndex = (*it).find("@"); - const QString name = (*it).mid(dashIndex + 1, atIndex - (dashIndex + 1)); + const TQString name = (*it).mid(dashIndex + 1, atIndex - (dashIndex + 1)); if (holeNum != curHole) { @@ -3575,7 +3575,7 @@ void KolfGame::openFile() if (name != curObj->_name()) continue; - QCanvasItem *newItem = curObj->newObject(course); + TQCanvasItem *newItem = curObj->newObject(course); items.append(newItem); CanvasItem *canvasItem = dynamic_cast<CanvasItem *>(newItem); @@ -3616,7 +3616,7 @@ void KolfGame::openFile() if (!missingPlugins.empty()) { - KMessageBox::informationList(this, QString("<p><http://katzbrown.com/kolf/Plugins/></p><p>") + i18n("This hole uses the following plugins, which you do not have installed:") + QString("</p>"), missingPlugins, QString::null, QString("%1 warning").arg(holeInfo.untranslatedName() + QString::number(curHole))); + KMessageBox::informationList(this, TQString("<p><http://katzbrown.com/kolf/Plugins/></p><p>") + i18n("This hole uses the following plugins, which you do not have installed:") + TQString("</p>"), missingPlugins, TQString::null, TQString("%1 warning").arg(holeInfo.untranslatedName() + TQString::number(curHole))); } lastDelId = -1; @@ -3640,9 +3640,9 @@ void KolfGame::openFile() } // do it down here; if !hasFinalLoad, do it up there! - QCanvasItem *qcanvasItem = 0; - QPtrList<CanvasItem> todo; - QPtrList<QCanvasItem> qtodo; + TQCanvasItem *qcanvasItem = 0; + TQPtrList<CanvasItem> todo; + TQPtrList<TQCanvasItem> qtodo; if (hasFinalLoad) { for (qcanvasItem = items.first(); qcanvasItem; qcanvasItem = items.next()) @@ -3657,7 +3657,7 @@ void KolfGame::openFile() } else { - QString group = makeGroup(item->curId(), curHole, item->name(), (int)qcanvasItem->x(), (int)qcanvasItem->y()); + TQString group = makeGroup(item->curId(), curHole, item->name(), (int)qcanvasItem->x(), (int)qcanvasItem->y()); cfg->setGroup(group); item->load(cfg); } @@ -3702,9 +3702,9 @@ void KolfGame::openFile() setModified(false); } -void KolfGame::addItemsToMoveableList(QPtrList<QCanvasItem> list) +void KolfGame::addItemsToMoveableList(TQPtrList<TQCanvasItem> list) { - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = list.first(); item; item = list.next()) extraMoveable.append(item); } @@ -3717,7 +3717,7 @@ void KolfGame::addItemToFastAdvancersList(CanvasItem *item) void KolfGame::addNewObject(Object *newObj) { - QCanvasItem *newItem = newObj->newObject(course); + TQCanvasItem *newItem = newObj->newObject(course); items.append(newItem); newItem->setVisible(true); @@ -3733,7 +3733,7 @@ void KolfGame::addNewObject(Object *newObj) for (;; ++i) { bool found = false; - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { CanvasItem *citem = dynamic_cast<CanvasItem *>(item); @@ -3864,7 +3864,7 @@ void KolfGame::resetHoleScores() void KolfGame::clearHole() { - QCanvasItem *qcanvasItem = 0; + TQCanvasItem *qcanvasItem = 0; for (qcanvasItem = items.first(); qcanvasItem; qcanvasItem = items.next()) { CanvasItem *citem = dynamic_cast<CanvasItem *>(qcanvasItem); @@ -3907,7 +3907,7 @@ void KolfGame::switchHole(int hole) toggleEditMode(); } -void KolfGame::switchHole(const QString &holestring) +void KolfGame::switchHole(const TQString &holestring) { bool ok; int hole = holestring.toInt(&ok); @@ -3946,7 +3946,7 @@ void KolfGame::save() { if (filename.isNull()) { - QString newfilename = KFileDialog::getSaveFileName(":kourses", "application/x-kourse", this, i18n("Pick Kolf Course to Save To")); + TQString newfilename = KFileDialog::getSaveFileName(":kourses", "application/x-kourse", this, i18n("Pick Kolf Course to Save To")); if (newfilename.isNull()) return; @@ -3961,7 +3961,7 @@ void KolfGame::save() bool hasFinalLoad = false; fastAdvancedExist = false; - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { CanvasItem *citem = dynamic_cast<CanvasItem *>(item); @@ -3973,10 +3973,10 @@ void KolfGame::save() } } - QStringList groups = cfg->groupList(); + TQStringList groups = cfg->groupList(); // wipe out all groups from this hole - for (QStringList::Iterator it = groups.begin(); it != groups.end(); ++it) + for (TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it) { int holeNum = (*it).left((*it).find("-")).toInt(); if (holeNum == curHole) @@ -3995,7 +3995,7 @@ void KolfGame::save() } // save where ball starts (whiteBall tells all) - cfg->setGroup(QString("%1-ball@%2,%3").arg(curHole).arg((int)whiteBall->x()).arg((int)whiteBall->y())); + cfg->setGroup(TQString("%1-ball@%2,%3").arg(curHole).arg((int)whiteBall->x()).arg((int)whiteBall->y())); cfg->writeEntry("dummykey", true); cfg->setGroup("0-course@-50,-50"); @@ -4003,7 +4003,7 @@ void KolfGame::save() cfg->writeEntry("Name", holeInfo.untranslatedName()); // save hole info - cfg->setGroup(QString("%1-hole@-50,-50|0").arg(curHole)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(curHole)); cfg->writeEntry("par", holeInfo.par()); cfg->writeEntry("maxstrokes", holeInfo.maxStrokes()); cfg->writeEntry("borderWalls", holeInfo.borderWalls()); @@ -4054,7 +4054,7 @@ void KolfGame::toggleEditMode() } // alert our items - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { CanvasItem *citem = dynamic_cast<CanvasItem *>(item); @@ -4085,7 +4085,7 @@ void KolfGame::toggleEditMode() inPlay = false; } -void KolfGame::playSound(QString file, double vol) +void KolfGame::playSound(TQString file, double vol) { if (m_sound) { @@ -4103,10 +4103,10 @@ void KolfGame::playSound(QString file, double vol) } } - file = soundDir + file + QString::fromLatin1(".wav"); + file = soundDir + file + TQString::fromLatin1(".wav"); // not needed when all of the files are in the distribution - //if (!QFile::exists(file)) + //if (!TQFile::exists(file)) //return; KPlayObjectFactory factory(artsServer.server()); @@ -4141,29 +4141,29 @@ void HoleInfo::borderWallsChanged(bool yes) void KolfGame::print(KPrinter &pr) { - QPainter p(&pr); + TQPainter p(&pr); - QPaintDeviceMetrics metrics(&pr); + TQPaintDeviceMetrics metrics(&pr); // translate to center p.translate(metrics.width() / 2 - course->rect().width() / 2, metrics.height() / 2 - course->rect().height() / 2); - QPixmap pix(width, height); - QPainter pixp(&pix); + TQPixmap pix(width, height); + TQPainter pixp(&pix); course->drawArea(course->rect(), &pixp); p.drawPixmap(0, 0, pix); - p.setPen(QPen(black, 2)); + p.setPen(TQPen(black, 2)); p.drawRect(course->rect()); p.resetXForm(); if (pr.option("kde-kolf-title") == "true") { - QString text = i18n("%1 - Hole %2; by %3").arg(holeInfo.name()).arg(curHole).arg(holeInfo.author()); - QFont font(kapp->font()); + TQString text = i18n("%1 - Hole %2; by %3").arg(holeInfo.name()).arg(curHole).arg(holeInfo.author()); + TQFont font(kapp->font()); font.setPointSize(18); - QRect rect = QFontMetrics(font).boundingRect(text); + TQRect rect = TQFontMetrics(font).boundingRect(text); p.setFont(font); p.drawText(metrics.width() / 2 - rect.width() / 2, metrics.height() / 2 - course->rect().height() / 2 -20 - rect.height(), text); @@ -4207,7 +4207,7 @@ void KolfGame::setSound(bool yes) m_sound = yes; } -void KolfGame::courseInfo(CourseInfo &info, const QString& filename) +void KolfGame::courseInfo(CourseInfo &info, const TQString& filename) { KConfig cfg(filename); cfg.setGroup("0-course@-50,-50"); @@ -4219,7 +4219,7 @@ void KolfGame::courseInfo(CourseInfo &info, const QString& filename) unsigned int par= 0; while (1) { - QString group = QString("%1-hole@-50,-50|0").arg(hole); + TQString group = TQString("%1-hole@-50,-50|0").arg(hole); if (!cfg.hasGroup(group)) { hole--; @@ -4246,15 +4246,15 @@ void KolfGame::scoresFromSaved(KConfig *config, PlayerList &players) for (int i = 1; i <= numPlayers; ++i) { // this is same as in kolf.cpp, but we use saved game values - config->setGroup(QString::number(i)); + config->setGroup(TQString::number(i)); players.append(Player()); players.last().ball()->setColor(config->readEntry("Color", "#ffffff")); players.last().setName(config->readEntry("Name")); players.last().setId(i); - QStringList scores(config->readListEntry("Scores")); - QValueList<int> intscores; - for (QStringList::Iterator it = scores.begin(); it != scores.end(); ++it) + TQStringList scores(config->readListEntry("Scores")); + TQValueList<int> intscores; + for (TQStringList::Iterator it = scores.begin(); it != scores.end(); ++it) intscores.append((*it).toInt()); players.last().setScores(intscores); @@ -4264,8 +4264,8 @@ void KolfGame::scoresFromSaved(KConfig *config, PlayerList &players) void KolfGame::saveScores(KConfig *config) { // wipe out old player info - QStringList groups = config->groupList(); - for (QStringList::Iterator it = groups.begin(); it != groups.end(); ++it) + TQStringList groups = config->groupList(); + for (TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it) { // this deletes all int groups, ie, the player info groups bool ok = false; @@ -4281,14 +4281,14 @@ void KolfGame::saveScores(KConfig *config) for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) { - config->setGroup(QString::number((*it).id())); + config->setGroup(TQString::number((*it).id())); config->writeEntry("Name", (*it).name()); config->writeEntry("Color", (*it).ball()->color().name()); - QStringList scores; - QValueList<int> intscores = (*it).scores(); - for (QValueList<int>::Iterator it = intscores.begin(); it != intscores.end(); ++it) - scores.append(QString::number(*it)); + TQStringList scores; + TQValueList<int> intscores = (*it).scores(); + for (TQValueList<int>::Iterator it = intscores.begin(); it != intscores.end(); ++it) + scores.append(TQString::number(*it)); config->writeEntry("Scores", scores); } diff --git a/kolf/game.h b/kolf/game.h index afb13b3c..71698e34 100644 --- a/kolf/game.h +++ b/kolf/game.h @@ -10,18 +10,18 @@ #include <math.h> -#include <qcanvas.h> -#include <qpainter.h> -#include <qcolor.h> -#include <qframe.h> -#include <qlayout.h> -#include <qmap.h> -#include <qpen.h> -#include <qpoint.h> -#include <qpointarray.h> -#include <qrect.h> -#include <qstringlist.h> -#include <qvaluelist.h> +#include <tqcanvas.h> +#include <tqpainter.h> +#include <tqcolor.h> +#include <tqframe.h> +#include <tqlayout.h> +#include <tqmap.h> +#include <tqpen.h> +#include <tqpoint.h> +#include <tqpointarray.h> +#include <tqrect.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> #include "object.h" #include "config.h" @@ -55,12 +55,12 @@ public: void loadState(KConfig *cfg); int id; - QPoint spot; + TQPoint spot; BallState state; bool beginningOfHole; int score; }; -class BallStateList : public QValueList<BallStateInfo> +class BallStateList : public TQValueList<BallStateInfo> { public: int hole; @@ -75,10 +75,10 @@ public: Player() : m_ball(new Ball(0)) {}; Ball *ball() const { return m_ball; } void setBall(Ball *ball) { m_ball = ball; } - BallStateInfo stateInfo(int hole) const { BallStateInfo ret; ret.spot = QPoint(m_ball->x(), m_ball->y()); ret.state = m_ball->curState(); ret.score = score(hole); ret.beginningOfHole = m_ball->beginningOfHole(); ret.id = m_id; return ret; } + BallStateInfo stateInfo(int hole) const { BallStateInfo ret; ret.spot = TQPoint(m_ball->x(), m_ball->y()); ret.state = m_ball->curState(); ret.score = score(hole); ret.beginningOfHole = m_ball->beginningOfHole(); ret.id = m_id; return ret; } - QValueList<int> scores() const { return m_scores; } - void setScores(const QValueList<int> &newScores) { m_scores = newScores; } + TQValueList<int> scores() const { return m_scores; } + void setScores(const TQValueList<int> &newScores) { m_scores = newScores; } int score(int hole) const { return (*m_scores.at(hole - 1)); } int lastScore() const { return m_scores.last(); } int firstScore() const { return m_scores.first(); } @@ -90,24 +90,24 @@ public: void addHole() { m_scores.append(0); } unsigned int numHoles() const { return m_scores.count(); } - QString name() const { return m_name; } - void setName(const QString &name) { m_name = name; m_ball->setName(name); } + TQString name() const { return m_name; } + void setName(const TQString &name) { m_name = name; m_ball->setName(name); } void setId(int id) { m_id = id; } int id() const { return m_id; } private: Ball *m_ball; - QValueList<int> m_scores; - QString m_name; + TQValueList<int> m_scores; + TQString m_name; int m_id; }; -typedef QValueList<Player> PlayerList; +typedef TQValueList<Player> PlayerList; class Arrow : public QCanvasLine { public: - Arrow(QCanvas *canvas); + Arrow(TQCanvas *canvas); void setAngle(double newAngle) { m_angle = newAngle; } double angle() const { return m_angle; } void setLength(double newLength) { m_length = newLength; } @@ -115,7 +115,7 @@ public: void setReversed(bool yes) { m_reversed = yes; } bool reversed() const { return m_reversed; } virtual void setVisible(bool); - virtual void setPen(QPen p); + virtual void setPen(TQPen p); void aboutToDie(); virtual void moveBy(double, double); void updateSelf(); @@ -125,8 +125,8 @@ private: double m_angle; double m_length; bool m_reversed; - QCanvasLine *line1; - QCanvasLine *line2; + TQCanvasLine *line1; + TQCanvasLine *line2; }; class RectPoint; @@ -136,13 +136,13 @@ public: virtual void newSize(int /*width*/, int /*height*/) {}; }; -class RectPoint : public QCanvasEllipse, public CanvasItem +class RectPoint : public TQCanvasEllipse, public CanvasItem { public: - RectPoint(QColor color, RectItem *, QCanvas *canvas); + RectPoint(TQColor color, RectItem *, TQCanvas *canvas); void dontMove() { dontmove = true; } virtual void moveBy(double dx, double dy); - virtual Config *config(QWidget *parent); + virtual Config *config(TQWidget *parent); virtual bool deleteable() const { return false; } virtual bool cornerResize() const { return true; } virtual CanvasItem *itemToDelete() { return dynamic_cast<CanvasItem *>(rect); } @@ -156,10 +156,10 @@ private: bool dontmove; }; -class Ellipse : public QCanvasEllipse, public CanvasItem, public RectItem +class Ellipse : public TQCanvasEllipse, public CanvasItem, public RectItem { public: - Ellipse(QCanvas *canvas); + Ellipse(TQCanvas *canvas); virtual void advance(int phase); int changeEvery() const { return m_changeEvery; } @@ -171,7 +171,7 @@ public: virtual void aboutToSave(); virtual void savingDone(); - virtual QPtrList<QCanvasItem> moveableItems() const; + virtual TQPtrList<TQCanvasItem> moveableItems() const; virtual void newSize(int width, int height); virtual void moveBy(double dx, double dy); @@ -181,7 +181,7 @@ public: virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); - virtual Config *config(QWidget *parent); + virtual Config *config(TQWidget *parent); protected: RectPoint *point; @@ -197,7 +197,7 @@ class EllipseConfig : public Config Q_OBJECT public: - EllipseConfig(Ellipse *ellipse, QWidget *); + EllipseConfig(Ellipse *ellipse, TQWidget *); private slots: void value1Changed(int news); @@ -206,22 +206,22 @@ private slots: void check2Changed(bool on); protected: - QVBoxLayout *m_vlayout; + TQVBoxLayout *m_vlayout; private: - QLabel *slow1; - QLabel *fast1; - QLabel *slow2; - QLabel *fast2; - QSlider *slider1; - QSlider *slider2; + TQLabel *slow1; + TQLabel *fast1; + TQLabel *slow2; + TQLabel *fast2; + TQSlider *slider1; + TQSlider *slider2; Ellipse *ellipse; }; class Puddle : public Ellipse { public: - Puddle(QCanvas *canvas); + Puddle(TQCanvas *canvas); virtual bool collision(Ball *ball, long int id); virtual int rtti() const { return Rtti_DontPlaceOn; } }; @@ -229,36 +229,36 @@ class PuddleObj : public Object { public: PuddleObj() { m_name = i18n("Puddle"); m__name = "puddle"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Puddle(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Puddle(canvas); } }; class Sand : public Ellipse { public: - Sand(QCanvas *canvas); + Sand(TQCanvas *canvas); virtual bool collision(Ball *ball, long int id); }; class SandObj : public Object { public: SandObj() { m_name = i18n("Sand"); m__name = "sand"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Sand(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Sand(canvas); } }; -class Inside : public QCanvasEllipse, public CanvasItem +class Inside : public TQCanvasEllipse, public CanvasItem { public: - Inside(CanvasItem *item, QCanvas *canvas) : QCanvasEllipse(canvas) { this->item = item; } + Inside(CanvasItem *item, TQCanvas *canvas) : TQCanvasEllipse(canvas) { this->item = item; } virtual bool collision(Ball *ball, long int id) { return item->collision(ball, id); } protected: CanvasItem *item; }; -class Bumper : public QCanvasEllipse, public CanvasItem +class Bumper : public TQCanvasEllipse, public CanvasItem { public: - Bumper(QCanvas *canvas); + Bumper(TQCanvas *canvas); virtual void advance(int phase); virtual void aboutToDie(); @@ -268,8 +268,8 @@ public: virtual bool collision(Ball *ball, long int id); protected: - QColor firstColor; - QColor secondColor; + TQColor firstColor; + TQColor secondColor; Inside *inside; private: @@ -279,38 +279,38 @@ class BumperObj : public Object { public: BumperObj() { m_name = i18n("Bumper"); m__name = "bumper"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Bumper(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Bumper(canvas); } }; -class Hole : public QCanvasEllipse, public CanvasItem +class Hole : public TQCanvasEllipse, public CanvasItem { public: - Hole(QColor color, QCanvas *canvas); + Hole(TQColor color, TQCanvas *canvas); virtual bool place(Ball * /*ball*/, bool /*wasCenter*/) { return true; }; virtual bool collision(Ball *ball, long int id); protected: - virtual HoleResult result(const QPoint, double, bool *wasCenter); + virtual HoleResult result(const TQPoint, double, bool *wasCenter); }; class Cup : public Hole { public: - Cup(QCanvas *canvas); + Cup(TQCanvas *canvas); virtual bool place(Ball *ball, bool wasCenter); virtual void save(KConfig *cfg); virtual bool canBeMovedByOthers() const { return true; } - virtual void draw(QPainter &painter); + virtual void draw(TQPainter &painter); protected: - QPixmap pixmap; + TQPixmap pixmap; }; class CupObj : public Object { public: CupObj() { m_name = i18n("Cup"); m__name = "cup"; m_addOnNewHole = true; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Cup(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Cup(canvas); } }; class BlackHole; @@ -319,7 +319,7 @@ class BlackHoleConfig : public Config Q_OBJECT public: - BlackHoleConfig(BlackHole *blackHole, QWidget *parent); + BlackHoleConfig(BlackHole *blackHole, TQWidget *parent); private slots: void degChanged(int); @@ -329,22 +329,22 @@ private slots: private: BlackHole *blackHole; }; -class BlackHoleExit : public QCanvasLine, public CanvasItem +class BlackHoleExit : public TQCanvasLine, public CanvasItem { public: - BlackHoleExit(BlackHole *blackHole, QCanvas *canvas); + BlackHoleExit(BlackHole *blackHole, TQCanvas *canvas); virtual int rtti() const { return Rtti_NoCollision; } virtual void aboutToDie(); virtual void moveBy(double dx, double dy); virtual bool deleteable() const { return false; } virtual bool canBeMovedByOthers() const { return true; } virtual void editModeChanged(bool editing); - virtual void setPen(QPen p); + virtual void setPen(TQPen p); virtual void showInfo(); virtual void hideInfo(); void updateArrowAngle(); void updateArrowLength(); - virtual Config *config(QWidget *parent); + virtual Config *config(TQWidget *parent); BlackHole *blackHole; protected: @@ -369,12 +369,12 @@ protected: double m_speed; Ball *m_ball; }; -class BlackHole : public QObject, public Hole +class BlackHole : public TQObject, public Hole { Q_OBJECT public: - BlackHole(QCanvas *canvas); + BlackHole(TQCanvas *canvas); virtual bool canBeMovedByOthers() const { return true; } virtual void aboutToDie(); virtual void showInfo(); @@ -382,8 +382,8 @@ public: virtual bool place(Ball *ball, bool wasCenter); virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); - virtual Config *config(QWidget *parent) { return new BlackHoleConfig(this, parent); } - virtual QPtrList<QCanvasItem> moveableItems() const; + virtual Config *config(TQWidget *parent) { return new BlackHoleConfig(this, parent); } + virtual TQPtrList<TQCanvasItem> moveableItems() const; double minSpeed() const { return m_minSpeed; } double maxSpeed() const { return m_maxSpeed; } void setMinSpeed(double news) { m_minSpeed = news; exitItem->updateArrowLength(); } @@ -411,32 +411,32 @@ protected: private: int runs; - QCanvasLine *infoLine; - QCanvasEllipse *outside; + TQCanvasLine *infoLine; + TQCanvasEllipse *outside; void finishMe(); }; class BlackHoleObj : public Object { public: BlackHoleObj() { m_name = i18n("Black Hole"); m__name = "blackhole"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new BlackHole(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new BlackHole(canvas); } }; class WallPoint; -class Wall : public QCanvasLine, public CanvasItem +class Wall : public TQCanvasLine, public CanvasItem { public: - Wall(QCanvas *canvas); + Wall(TQCanvas *canvas); virtual void aboutToDie(); double dampening; void setAlwaysShow(bool yes); virtual void setZ(double newz); - virtual void setPen(QPen p); + virtual void setPen(TQPen p); virtual bool collision(Ball *ball, long int id); virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); - virtual void selectedItem(QCanvasItem *item); + virtual void selectedItem(TQCanvasItem *item); virtual void editModeChanged(bool changed); virtual void moveBy(double dx, double dy); virtual void setVelocity(double vx, double vy); @@ -444,14 +444,14 @@ public: // must reimp because we gotta move the end items, // and we do that in moveBy() - virtual void setPoints(int xa, int ya, int xb, int yb) { QCanvasLine::setPoints(xa, ya, xb, yb); moveBy(0, 0); } + virtual void setPoints(int xa, int ya, int xb, int yb) { TQCanvasLine::setPoints(xa, ya, xb, yb); moveBy(0, 0); } virtual int rtti() const { return Rtti_Wall; } - virtual QPtrList<QCanvasItem> moveableItems() const; + virtual TQPtrList<TQCanvasItem> moveableItems() const; virtual void setGame(KolfGame *game); virtual void setVisible(bool); - virtual QPointArray areaPoints() const; + virtual TQPointArray areaPoints() const; protected: WallPoint *startItem; @@ -463,10 +463,10 @@ private: friend class WallPoint; }; -class WallPoint : public QCanvasEllipse, public CanvasItem +class WallPoint : public TQCanvasEllipse, public CanvasItem { public: - WallPoint(bool start, Wall *wall, QCanvas *canvas); + WallPoint(bool start, Wall *wall, TQCanvas *canvas); void setAlwaysShow(bool yes) { alwaysShow = yes; updateVisible(); } virtual void editModeChanged(bool changed); virtual void moveBy(double dx, double dy); @@ -475,7 +475,7 @@ public: virtual bool collision(Ball *ball, long int id); virtual CanvasItem *itemToDelete() { return wall; } virtual void clean(); - virtual Config *config(QWidget *parent) { return wall->config(parent); } + virtual Config *config(TQWidget *parent) { return wall->config(parent); } void dontMove() { dontmove = true; }; void updateVisible(); @@ -498,13 +498,13 @@ class WallObj : public Object { public: WallObj() { m_name = i18n("Wall"); m__name = "wall"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Wall(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Wall(canvas); } }; -class Putter : public QCanvasLine, public CanvasItem +class Putter : public TQCanvasLine, public CanvasItem { public: - Putter(QCanvas *canvas); + Putter(TQCanvas *canvas); void go(Direction, Amount amount = Amount_Normal); void setOrigin(int x, int y); int curLen() const { return len; } @@ -525,15 +525,15 @@ public: void setShowGuideLine(bool yes); private: - QPoint midPoint; + TQPoint midPoint; double maxAngle; double angle; double oneDegree; - QMap<Ball *, double> angleMap; + TQMap<Ball *, double> angleMap; int len; void finishMe(); int putterWidth; - QCanvasLine *guideLine; + TQCanvasLine *guideLine; bool m_showGuideLine; }; @@ -543,7 +543,7 @@ class BridgeConfig : public Config Q_OBJECT public: - BridgeConfig(Bridge *bridge, QWidget *); + BridgeConfig(Bridge *bridge, TQWidget *); protected slots: void topWallChanged(bool); @@ -552,19 +552,19 @@ protected slots: void rightWallChanged(bool); protected: - QVBoxLayout *m_vlayout; - QCheckBox *top; - QCheckBox *bot; - QCheckBox *left; - QCheckBox *right; + TQVBoxLayout *m_vlayout; + TQCheckBox *top; + TQCheckBox *bot; + TQCheckBox *left; + TQCheckBox *right; private: Bridge *bridge; }; -class Bridge : public QCanvasRectangle, public CanvasItem, public RectItem +class Bridge : public TQCanvasRectangle, public CanvasItem, public RectItem { public: - Bridge(QRect rect, QCanvas *canvas); + Bridge(TQRect rect, TQCanvas *canvas); virtual bool collision(Ball *ball, long int id); virtual void aboutToDie(); virtual void editModeChanged(bool changed); @@ -576,12 +576,12 @@ public: void doSave(KConfig *cfg); virtual void newSize(int width, int height); virtual void setGame(KolfGame *game); - virtual Config *config(QWidget *parent) { return new BridgeConfig(this, parent); } + virtual Config *config(TQWidget *parent) { return new BridgeConfig(this, parent); } void setSize(int width, int height); - virtual QPtrList<QCanvasItem> moveableItems() const; + virtual TQPtrList<TQCanvasItem> moveableItems() const; - void setWallColor(QColor color); - QPen wallPen() const { return topWall->pen(); } + void setWallColor(TQColor color); + TQPen wallPen() const { return topWall->pen(); } double wallZ() const { return topWall->z(); } void setWallZ(double); @@ -606,7 +606,7 @@ class BridgeObj : public Object { public: BridgeObj() { m_name = i18n("Bridge"); m__name = "bridge"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Bridge(QRect(0, 0, 80, 40), canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Bridge(TQRect(0, 0, 80, 40), canvas); } }; class Sign; @@ -615,10 +615,10 @@ class SignConfig : public BridgeConfig Q_OBJECT public: - SignConfig(Sign *sign, QWidget *parent); + SignConfig(Sign *sign, TQWidget *parent); private slots: - void textChanged(const QString &); + void textChanged(const TQString &); private: Sign *sign; @@ -626,31 +626,31 @@ private: class Sign : public Bridge { public: - Sign(QCanvas *canvas); - void setText(const QString &text); - QString text() const { return m_text; } - virtual void draw(QPainter &painter); + Sign(TQCanvas *canvas); + void setText(const TQString &text); + TQString text() const { return m_text; } + virtual void draw(TQPainter &painter); virtual bool vStrut() const { return false; } - virtual Config *config(QWidget *parent) { return new SignConfig(this, parent); } + virtual Config *config(TQWidget *parent) { return new SignConfig(this, parent); } virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); protected: - QString m_text; - QString m_untranslatedText; + TQString m_text; + TQString m_untranslatedText; }; class SignObj : public Object { public: SignObj() { m_name = i18n("Sign"); m__name = "sign"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Sign(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Sign(canvas); } }; class Windmill; class WindmillGuard : public Wall { public: - WindmillGuard(QCanvas *canvas) : Wall(canvas) {}; + WindmillGuard(TQCanvas *canvas) : Wall(canvas) {}; void setBetween(int newmin, int newmax) { max = newmax; min = newmin; } virtual void advance(int phase); @@ -663,7 +663,7 @@ class WindmillConfig : public BridgeConfig Q_OBJECT public: - WindmillConfig(Windmill *windmill, QWidget *parent); + WindmillConfig(Windmill *windmill, TQWidget *parent); private slots: void speedChanged(int news); @@ -675,13 +675,13 @@ private: class Windmill : public Bridge { public: - Windmill(QRect rect, QCanvas *canvas); + Windmill(TQRect rect, TQCanvas *canvas); virtual void aboutToDie(); virtual void newSize(int width, int height); virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); virtual void setGame(KolfGame *game); - virtual Config *config(QWidget *parent) { return new WindmillConfig(this, parent); } + virtual Config *config(TQWidget *parent) { return new WindmillConfig(this, parent); } void setSize(int width, int height); virtual void moveBy(double dx, double dy); void setSpeed(int news); @@ -701,7 +701,7 @@ class WindmillObj : public Object { public: WindmillObj() { m_name = i18n("Windmill"); m__name = "windmill"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Windmill(QRect(0, 0, 80, 40), canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Windmill(TQRect(0, 0, 80, 40), canvas); } }; class HoleInfo; @@ -710,13 +710,13 @@ class HoleConfig : public Config Q_OBJECT public: - HoleConfig(HoleInfo *holeInfo, QWidget *); + HoleConfig(HoleInfo *holeInfo, TQWidget *); private slots: - void authorChanged(const QString &); + void authorChanged(const TQString &); void parChanged(int); void maxStrokesChanged(int); - void nameChanged(const QString &); + void nameChanged(const TQString &); void borderWallsChanged(bool); private: @@ -733,22 +733,22 @@ public: int lowestMaxStrokes() const { return m_lowestMaxStrokes; } int maxStrokes() const { return m_maxStrokes; } bool hasMaxStrokes() const { return m_maxStrokes != m_lowestMaxStrokes; } - void setAuthor(QString newauthor) { m_author = newauthor; } - QString author() const { return m_author; } + void setAuthor(TQString newauthor) { m_author = newauthor; } + TQString author() const { return m_author; } - void setName(QString newname) { m_name = newname; } - void setUntranslatedName(QString newname) { m_untranslatedName = newname; } - QString name() const { return m_name; } - QString untranslatedName() const { return m_untranslatedName; } + void setName(TQString newname) { m_name = newname; } + void setUntranslatedName(TQString newname) { m_untranslatedName = newname; } + TQString name() const { return m_name; } + TQString untranslatedName() const { return m_untranslatedName; } - virtual Config *config(QWidget *parent) { return new HoleConfig(this, parent); } + virtual Config *config(TQWidget *parent) { return new HoleConfig(this, parent); } void borderWallsChanged(bool yes); bool borderWalls() const { return m_borderWalls; } private: - QString m_author; - QString m_name; - QString m_untranslatedName; + TQString m_author; + TQString m_name; + TQString m_untranslatedName; bool m_borderWalls; int m_par; int m_maxStrokes; @@ -758,7 +758,7 @@ private: class StrokeCircle : public QCanvasItem { public: - StrokeCircle(QCanvas *canvas); + StrokeCircle(TQCanvas *canvas); void setValue(double v); double value(); @@ -768,10 +768,10 @@ public: int thickness() const; int width() const; int height() const; - virtual void draw(QPainter &p); - virtual QRect boundingRect() const; - virtual bool collidesWith(const QCanvasItem*) const; - virtual bool collidesWith(const QCanvasSprite*, const QCanvasPolygonalItem*, const QCanvasRectangle*, const QCanvasEllipse*, const QCanvasText*) const; + virtual void draw(TQPainter &p); + virtual TQRect boundingRect() const; + virtual bool collidesWith(const TQCanvasItem*) const; + virtual bool collidesWith(const TQCanvasSprite*, const TQCanvasPolygonalItem*, const TQCanvasRectangle*, const TQCanvasEllipse*, const TQCanvasText*) const; private: double dvalue, dmax; @@ -780,12 +780,12 @@ private: struct KDE_EXPORT CourseInfo { - CourseInfo(const QString &_name, const QString &_untranslatedName, const QString &_author, unsigned int _holes, unsigned int _par) { name = _name; untranslatedName = _untranslatedName, author = _author; holes = _holes; par = _par; } + CourseInfo(const TQString &_name, const TQString &_untranslatedName, const TQString &_author, unsigned int _holes, unsigned int _par) { name = _name; untranslatedName = _untranslatedName, author = _author; holes = _holes; par = _par; } CourseInfo(); - QString name; - QString untranslatedName; - QString author; + TQString name; + TQString untranslatedName; + TQString author; unsigned int holes; unsigned int par; }; @@ -795,14 +795,14 @@ class KDE_EXPORT KolfGame : public QCanvasView Q_OBJECT public: - KolfGame(ObjectList *obj, PlayerList *players, QString filename, QWidget *parent=0, const char *name=0 ); + KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWidget *parent=0, const char *name=0 ); ~KolfGame(); void setObjects(ObjectList *obj) { this->obj = obj; } - void setFilename(const QString &filename); - QString curFilename() const { return filename; } + void setFilename(const TQString &filename); + TQString curFilename() const { return filename; } void emitLargestHole() { emit largestHole(highestHole); } - QCanvas *canvas() const { return course; } - void removeItem(QCanvasItem *item) { items.setAutoDelete(false); items.removeRef(item); } + TQCanvas *canvas() const { return course; } + void removeItem(TQCanvasItem *item) { items.setAutoDelete(false); items.removeRef(item); } // returns whether it was a cancel bool askSave(bool); bool isEditing() const { return editing; } @@ -815,18 +815,18 @@ public: void ballMoved(); void updateHighlighter(); void updateCourse() { course->update(); } - QCanvasItem *curSelectedItem() const { return selectedItem; } + TQCanvasItem *curSelectedItem() const { return selectedItem; } void setBorderWalls(bool); void setInPlay(bool yes) { inPlay = yes; } bool isInPlay() { return inPlay; } bool isInfoShowing() { return m_showInfo; } void stoppedBall(); - QString courseName() const { return holeInfo.name(); } + TQString courseName() const { return holeInfo.name(); } void hidePutter() { putter->setVisible(false); } void ignoreEvents(bool ignore) { m_ignoreEvents = ignore; } static void scoresFromSaved(KConfig *, PlayerList &players); - static void courseInfo(CourseInfo &info, const QString &filename); + static void courseInfo(CourseInfo &info, const TQString &filename); public slots: void pause(); @@ -837,13 +837,13 @@ public slots: void addNewObject(Object *newObj); void addNewHole(); void switchHole(int); - void switchHole(const QString &); + void switchHole(const TQString &); void nextHole(); void prevHole(); void firstHole(); void lastHole(); void randHole(); - void playSound(QString file, double vol = 1); + void playSound(TQString file, double vol = 1); void showInfoDlg(bool = false); void resetHole(); void clearHole(); @@ -865,7 +865,7 @@ signals: void holesDone(); void newHole(int); void parChanged(int, int); - void titleChanged(const QString &); + void titleChanged(const TQString &); void largestHole(int); void scoreChanged(int, int, int); void newPlayersTurn(Player *); @@ -876,10 +876,10 @@ signals: void editingEnded(); void inPlayStart(); void inPlayEnd(); - void maxStrokesReached(const QString &); + void maxStrokesReached(const TQString &); void currentHole(int); void modifiedChanged(bool); - void newStatusText(const QString &); + void newStatusText(const TQString &); private slots: void shotDone(); @@ -888,45 +888,45 @@ private slots: void fastTimeout(); void putterTimeout(); void autoSaveTimeout(); - void addItemsToMoveableList(QPtrList<QCanvasItem>); + void addItemsToMoveableList(TQPtrList<TQCanvasItem>); void addItemToFastAdvancersList(CanvasItem *); void hideInfo(); void emitMax(); protected: - void mouseMoveEvent(QMouseEvent *e); - void mousePressEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - void mouseDoubleClickEvent(QMouseEvent *e); + void mouseMoveEvent(TQMouseEvent *e); + void mousePressEvent(TQMouseEvent *e); + void mouseReleaseEvent(TQMouseEvent *e); + void mouseDoubleClickEvent(TQMouseEvent *e); - void handleMousePressEvent(QMouseEvent *e); - void handleMouseDoubleClickEvent(QMouseEvent *e); - void handleMouseMoveEvent(QMouseEvent *e); - void handleMouseReleaseEvent(QMouseEvent *e); - void keyPressEvent(QKeyEvent *e); - void keyReleaseEvent(QKeyEvent *e); + void handleMousePressEvent(TQMouseEvent *e); + void handleMouseDoubleClickEvent(TQMouseEvent *e); + void handleMouseMoveEvent(TQMouseEvent *e); + void handleMouseReleaseEvent(TQMouseEvent *e); + void keyPressEvent(TQKeyEvent *e); + void keyReleaseEvent(TQKeyEvent *e); - QPoint viewportToViewport(const QPoint &p); + TQPoint viewportToViewport(const TQPoint &p); private: - QCanvas *course; + TQCanvas *course; Putter *putter; PlayerList *players; PlayerList::Iterator curPlayer; Ball *whiteBall; StrokeCircle *strokeCircle; - QTimer *timer; - QTimer *autoSaveTimer; - QTimer *fastTimer; - QTimer *putterTimer; + TQTimer *timer; + TQTimer *autoSaveTimer; + TQTimer *fastTimer; + TQTimer *putterTimer; bool regAdv; ObjectList *obj; - QPtrList<QCanvasItem> items; - QPtrList<QCanvasItem> extraMoveable; - QPtrList<Wall> borderWalls; + TQPtrList<TQCanvasItem> items; + TQPtrList<TQCanvasItem> extraMoveable; + TQPtrList<Wall> borderWalls; int timerMsec; int autoSaveMsec; @@ -952,7 +952,7 @@ private: int height; int width; int margin; - QColor grass; + TQColor grass; int advancePeriod; @@ -960,32 +960,32 @@ private: bool paused; - QString filename; + TQString filename; bool recalcHighestHole; void openFile(); bool strict; bool editing; - QPoint storedMousePos; + TQPoint storedMousePos; bool moving; bool dragging; - QCanvasItem *movingItem; - QCanvasItem *selectedItem; - QCanvasRectangle *highlighter; + TQCanvasItem *movingItem; + TQCanvasItem *selectedItem; + TQCanvasRectangle *highlighter; // sound KArtsDispatcher artsDispatcher; KArtsServer artsServer; - QPtrList<KPlayObject> oldPlayObjects; + TQPtrList<KPlayObject> oldPlayObjects; bool m_sound; bool soundedOnce; - QString soundDir; + TQString soundDir; bool m_ignoreEvents; HoleInfo holeInfo; - QCanvasText *infoText; + TQCanvasText *infoText; void showInfo(); StateDB stateDB; @@ -1006,7 +1006,7 @@ private: KConfig *cfg; - inline void addBorderWall(QPoint start, QPoint end); + inline void addBorderWall(TQPoint start, TQPoint end); void shotStart(); void startBall(const Vector &vector); @@ -1017,10 +1017,10 @@ private: bool m_useMouse; bool m_useAdvancedPutting; - QPtrList<CanvasItem> fastAdvancers; + TQPtrList<CanvasItem> fastAdvancers; bool fastAdvancedExist; - QString playerWhoMaxed; + TQString playerWhoMaxed; }; #endif diff --git a/kolf/kcomboboxdialog.cpp b/kolf/kcomboboxdialog.cpp index 03e0701b..1e18e0b2 100644 --- a/kolf/kcomboboxdialog.cpp +++ b/kolf/kcomboboxdialog.cpp @@ -22,9 +22,9 @@ // used in advertising or otherwise to promote the sale, use or other dealings // in this Software without prior written authorization from the author(s). -#include <qcheckbox.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> #include <klocale.h> #include <kcombobox.h> @@ -34,11 +34,11 @@ #include "kcomboboxdialog.h" -KComboBoxDialog::KComboBoxDialog( const QString &_text, const QStringList &_items, const QString& _value, bool showDontAskAgain, QWidget *parent ) - : KDialogBase( Plain, QString::null, Ok, Ok, parent, 0L, true, true ) +KComboBoxDialog::KComboBoxDialog( const TQString &_text, const TQStringList &_items, const TQString& _value, bool showDontAskAgain, TQWidget *parent ) + : KDialogBase( Plain, TQString::null, Ok, Ok, parent, 0L, true, true ) { - QVBoxLayout *topLayout = new QVBoxLayout( plainPage(), marginHint(), spacingHint() ); - QLabel *label = new QLabel(_text, plainPage() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( plainPage(), marginHint(), spacingHint() ); + TQLabel *label = new TQLabel(_text, plainPage() ); topLayout->addWidget( label, 1 ); combo = new KHistoryCombo( plainPage() ); @@ -48,7 +48,7 @@ KComboBoxDialog::KComboBoxDialog( const QString &_text, const QStringList &_item if (showDontAskAgain) { - dontAskAgainCheckBox = new QCheckBox( i18n("&Do not ask again"), plainPage() ); + dontAskAgainCheckBox = new TQCheckBox( i18n("&Do not ask again"), plainPage() ); topLayout->addWidget( dontAskAgainCheckBox, 1 ); } else @@ -63,7 +63,7 @@ KComboBoxDialog::~KComboBoxDialog() { } -QString KComboBoxDialog::text() const +TQString KComboBoxDialog::text() const { return combo->currentText(); } @@ -76,14 +76,14 @@ bool KComboBoxDialog::dontAskAgainChecked() return false; } -QString KComboBoxDialog::getItem( const QString &_text, const QStringList &_items, const QString& _value, const QString &dontAskAgainName, QWidget *parent ) +TQString KComboBoxDialog::getItem( const TQString &_text, const TQStringList &_items, const TQString& _value, const TQString &dontAskAgainName, TQWidget *parent ) { - return getItem( _text, QString::null, _items, _value, dontAskAgainName, parent ); + return getItem( _text, TQString::null, _items, _value, dontAskAgainName, parent ); } -QString KComboBoxDialog::getItem( const QString &_text, const QString &_caption, const QStringList &_items, const QString& _value, const QString &dontAskAgainName, QWidget *parent ) +TQString KComboBoxDialog::getItem( const TQString &_text, const TQString &_caption, const TQStringList &_items, const TQString& _value, const TQString &dontAskAgainName, TQWidget *parent ) { - QString prevAnswer; + TQString prevAnswer; if ( !dontAskAgainName.isEmpty() ) { KConfig *config = KGlobal::config(); @@ -100,7 +100,7 @@ QString KComboBoxDialog::getItem( const QString &_text, const QString &_caption, dlg.exec(); - const QString text = dlg.text(); + const TQString text = dlg.text(); if (dlg.dontAskAgainChecked()) { @@ -115,17 +115,17 @@ QString KComboBoxDialog::getItem( const QString &_text, const QString &_caption, return text; } -QString KComboBoxDialog::getText(const QString &_caption, const QString &_text, const QString &_value, bool *ok, QWidget *parent, const QString &configName, KConfig *config) +TQString KComboBoxDialog::getText(const TQString &_caption, const TQString &_text, const TQString &_value, bool *ok, TQWidget *parent, const TQString &configName, KConfig *config) { - KComboBoxDialog dlg(_text, QStringList(), _value, false, parent); + KComboBoxDialog dlg(_text, TQStringList(), _value, false, parent); if ( !_caption.isNull() ) dlg.setCaption( _caption ); KHistoryCombo * const box = dlg.comboBox(); box->setEditable(true); - const QString historyItem = QString("%1History").arg(configName); - const QString completionItem = QString("%1Completion").arg(configName); + const TQString historyItem = TQString("%1History").arg(configName); + const TQString completionItem = TQString("%1Completion").arg(configName); if(!configName.isNull()) { diff --git a/kolf/kcomboboxdialog.h b/kolf/kcomboboxdialog.h index e835c0aa..fdd74840 100644 --- a/kolf/kcomboboxdialog.h +++ b/kolf/kcomboboxdialog.h @@ -25,7 +25,7 @@ #ifndef KCOMBOBOX_DIALOG_H #define KCOMBOBOX_DIALOG_H -#include <qstringlist.h> +#include <tqstringlist.h> #include <kdialogbase.h> #include <kglobal.h> @@ -34,7 +34,7 @@ class QCheckBox; class KHistoryCombo; /** - * Dialog for user to choose an item from a QStringList. + * Dialog for user to choose an item from a TQStringList. */ class KComboBoxDialog : public KDialogBase @@ -51,13 +51,13 @@ public: * @param _text Text of the label * @param _value Initial value of the combobox */ - KComboBoxDialog( const QString &_text, const QStringList& _items, const QString& _value = QString::null, bool showDontAskAgain = false, QWidget *parent = 0 ); + KComboBoxDialog( const TQString &_text, const TQStringList& _items, const TQString& _value = TQString::null, bool showDontAskAgain = false, TQWidget *parent = 0 ); virtual ~KComboBoxDialog(); /** * @return the value the user chose */ - QString text() const; + TQString text() const; /** * @return the line edit widget @@ -70,9 +70,9 @@ public: * @param _text Text of the label * @param _items Items in the combobox * @param _value Initial value of the inputline - * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use QString::null to disable + * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use TQString::null to disable */ - static QString getItem( const QString &_text, const QStringList &_items, const QString& _value = QString::null, const QString &dontAskAgainName = QString::null, QWidget *parent = 0 ); + static TQString getItem( const TQString &_text, const TQStringList &_items, const TQString& _value = TQString::null, const TQString &dontAskAgainName = TQString::null, TQWidget *parent = 0 ); /** * Static convenience function to get input from the user. @@ -82,9 +82,9 @@ public: * @param _text Text of the label * @param _items Items in the combobox * @param _value Initial value of the inputline - * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use QString::null to disable + * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use TQString::null to disable */ - static QString getItem( const QString &_text, const QString &_caption, const QStringList &_items, const QString& _value = QString::null, const QString &dontAskAgainName = QString::null, QWidget *parent = 0 ); + static TQString getItem( const TQString &_text, const TQString &_caption, const TQStringList &_items, const TQString& _value = TQString::null, const TQString &dontAskAgainName = TQString::null, TQWidget *parent = 0 ); /** * Static convenience method. @@ -99,15 +99,15 @@ public: * @param configName Name of the dialog for saving the completion and history * @parma config KConfig for saving the completion and history */ - static QString getText(const QString &_caption, const QString &_text, - const QString &_value = QString::null, - bool *ok = 0, QWidget *parent = 0, - const QString &configName = QString::null, + static TQString getText(const TQString &_caption, const TQString &_text, + const TQString &_value = TQString::null, + bool *ok = 0, TQWidget *parent = 0, + const TQString &configName = TQString::null, KConfig *config = KGlobal::config()); protected: KHistoryCombo *combo; - QCheckBox *dontAskAgainCheckBox; + TQCheckBox *dontAskAgainCheckBox; bool dontAskAgainChecked(); }; diff --git a/kolf/kolf.cpp b/kolf/kolf.cpp index 33155b6a..696ddc72 100644 --- a/kolf/kolf.cpp +++ b/kolf/kolf.cpp @@ -19,21 +19,21 @@ #include <kstdgameaction.h> #include <kstdguiitem.h> -#include <qcolor.h> -#include <qevent.h> -#include <qfile.h> -#include <qobject.h> -#include <qmap.h> -#include <qpoint.h> -#include <qtimer.h> -#include <qptrlist.h> -#include <qpixmap.h> -#include <qpixmapcache.h> -#include <qfileinfo.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qlayout.h> -#include <qwidget.h> +#include <tqcolor.h> +#include <tqevent.h> +#include <tqfile.h> +#include <tqobject.h> +#include <tqmap.h> +#include <tqpoint.h> +#include <tqtimer.h> +#include <tqptrlist.h> +#include <tqpixmap.h> +#include <tqpixmapcache.h> +#include <tqfileinfo.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqlayout.h> +#include <tqwidget.h> #include <stdlib.h> @@ -62,10 +62,10 @@ Kolf::Kolf() obj = new ObjectList; initPlugins(); - filename = QString::null; - dummy = new QWidget(this); + filename = TQString::null; + dummy = new TQWidget(this); setCentralWidget(dummy); - layout = new QGridLayout(dummy, 3, 1); + layout = new TQGridLayout(dummy, 3, 1); resize(420, 480); } @@ -79,75 +79,75 @@ Kolf::~Kolf() void Kolf::initGUI() { - newAction = KStdGameAction::gameNew(this, SLOT(newGame()), actionCollection()); - newAction->setText(newAction->text() + QString("...")); + newAction = KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection()); + newAction->setText(newAction->text() + TQString("...")); - endAction = KStdGameAction::end(this, SLOT(closeGame()), actionCollection()); - printAction = KStdGameAction::print(this, SLOT(print()), actionCollection()); + endAction = KStdGameAction::end(this, TQT_SLOT(closeGame()), actionCollection()); + printAction = KStdGameAction::print(this, TQT_SLOT(print()), actionCollection()); - (void) KStdGameAction::quit(this, SLOT(close()), actionCollection()); - saveAction = KStdAction::save(this, SLOT(save()), actionCollection(), "game_save"); + (void) KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + saveAction = KStdAction::save(this, TQT_SLOT(save()), actionCollection(), "game_save"); saveAction->setText(i18n("Save &Course")); - saveAsAction = KStdAction::saveAs(this, SLOT(saveAs()), actionCollection(), "game_save_as"); + saveAsAction = KStdAction::saveAs(this, TQT_SLOT(saveAs()), actionCollection(), "game_save_as"); saveAsAction->setText(i18n("Save &Course As...")); - saveGameAction = new KAction(i18n("&Save Game"), 0, this, SLOT(saveGame()), actionCollection(), "savegame"); - saveGameAsAction = new KAction(i18n("&Save Game As..."), 0, this, SLOT(saveGameAs()), actionCollection(), "savegameas"); + saveGameAction = new KAction(i18n("&Save Game"), 0, this, TQT_SLOT(saveGame()), actionCollection(), "savegame"); + saveGameAsAction = new KAction(i18n("&Save Game As..."), 0, this, TQT_SLOT(saveGameAs()), actionCollection(), "savegameas"); - loadGameAction = KStdGameAction::load(this, SLOT(loadGame()), actionCollection()); + loadGameAction = KStdGameAction::load(this, TQT_SLOT(loadGame()), actionCollection()); loadGameAction->setText(i18n("Load Saved Game...")); - highScoreAction = KStdGameAction::highscores(this, SLOT(showHighScores()), actionCollection()); + highScoreAction = KStdGameAction::highscores(this, TQT_SLOT(showHighScores()), actionCollection()); - editingAction = new KToggleAction(i18n("&Edit"), "pencil", CTRL+Key_E, this, SLOT(emptySlot()), actionCollection(), "editing"); - newHoleAction = new KAction(i18n("&New"), "filenew", CTRL+SHIFT+Key_N, this, SLOT(emptySlot()), actionCollection(), "newhole"); - clearHoleAction = new KAction(KStdGuiItem::clear().text(), "locationbar_erase", CTRL+Key_Delete, this, SLOT(emptySlot()), actionCollection(), "clearhole"); - resetHoleAction = new KAction(i18n("&Reset"), CTRL+Key_R, this, SLOT(emptySlot()), actionCollection(), "resethole"); - undoShotAction = KStdAction::undo(this, SLOT(emptySlot()), actionCollection(), "undoshot"); + editingAction = new KToggleAction(i18n("&Edit"), "pencil", CTRL+Key_E, this, TQT_SLOT(emptySlot()), actionCollection(), "editing"); + newHoleAction = new KAction(i18n("&New"), "filenew", CTRL+SHIFT+Key_N, this, TQT_SLOT(emptySlot()), actionCollection(), "newhole"); + clearHoleAction = new KAction(KStdGuiItem::clear().text(), "locationbar_erase", CTRL+Key_Delete, this, TQT_SLOT(emptySlot()), actionCollection(), "clearhole"); + resetHoleAction = new KAction(i18n("&Reset"), CTRL+Key_R, this, TQT_SLOT(emptySlot()), actionCollection(), "resethole"); + undoShotAction = KStdAction::undo(this, TQT_SLOT(emptySlot()), actionCollection(), "undoshot"); undoShotAction->setText(i18n("&Undo Shot")); - //replayShotAction = new KAction(i18n("&Replay Shot"), 0, this, SLOT(emptySlot()), actionCollection(), "replay"); + //replayShotAction = new KAction(i18n("&Replay Shot"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "replay"); - holeAction = new KListAction(i18n("Switch to Hole"), 0, this, SLOT(emptySlot()), actionCollection(), "switchhole"); - nextAction = new KAction(i18n("&Next Hole"), "forward", KStdAccel::shortcut(KStdAccel::Forward), this, SLOT(emptySlot()), actionCollection(), "nexthole"); - prevAction = new KAction(i18n("&Previous Hole"), "back", KStdAccel::shortcut(KStdAccel::Back), this, SLOT(emptySlot()), actionCollection(), "prevhole"); - firstAction = new KAction(i18n("&First Hole"), "gohome", KStdAccel::shortcut(KStdAccel::Home), this, SLOT(emptySlot()), actionCollection(), "firsthole"); - lastAction = new KAction(i18n("&Last Hole"), CTRL+SHIFT+Key_End, this, SLOT(emptySlot()), actionCollection(), "lasthole"); - randAction = new KAction(i18n("&Random Hole"), "goto", 0, this, SLOT(emptySlot()), actionCollection(), "randhole"); + holeAction = new KListAction(i18n("Switch to Hole"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "switchhole"); + nextAction = new KAction(i18n("&Next Hole"), "forward", KStdAccel::shortcut(KStdAccel::Forward), this, TQT_SLOT(emptySlot()), actionCollection(), "nexthole"); + prevAction = new KAction(i18n("&Previous Hole"), "back", KStdAccel::shortcut(KStdAccel::Back), this, TQT_SLOT(emptySlot()), actionCollection(), "prevhole"); + firstAction = new KAction(i18n("&First Hole"), "gohome", KStdAccel::shortcut(KStdAccel::Home), this, TQT_SLOT(emptySlot()), actionCollection(), "firsthole"); + lastAction = new KAction(i18n("&Last Hole"), CTRL+SHIFT+Key_End, this, TQT_SLOT(emptySlot()), actionCollection(), "lasthole"); + randAction = new KAction(i18n("&Random Hole"), "goto", 0, this, TQT_SLOT(emptySlot()), actionCollection(), "randhole"); - useMouseAction = new KToggleAction(i18n("Enable &Mouse for Moving Putter"), 0, this, SLOT(emptySlot()), actionCollection(), "usemouse"); + useMouseAction = new KToggleAction(i18n("Enable &Mouse for Moving Putter"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "usemouse"); useMouseAction->setCheckedState(i18n("Disable &Mouse for Moving Putter")); - connect(useMouseAction, SIGNAL(toggled(bool)), this, SLOT(useMouseChanged(bool))); + connect(useMouseAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(useMouseChanged(bool))); KConfig *config = kapp->config(); config->setGroup("Settings"); useMouseAction->setChecked(config->readBoolEntry("useMouse", true)); - useAdvancedPuttingAction = new KToggleAction(i18n("Enable &Advanced Putting"), 0, this, SLOT(emptySlot()), actionCollection(), "useadvancedputting"); + useAdvancedPuttingAction = new KToggleAction(i18n("Enable &Advanced Putting"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "useadvancedputting"); useAdvancedPuttingAction->setCheckedState(i18n("Disable &Advanced Putting")); - connect(useAdvancedPuttingAction, SIGNAL(toggled(bool)), this, SLOT(useAdvancedPuttingChanged(bool))); + connect(useAdvancedPuttingAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(useAdvancedPuttingChanged(bool))); useAdvancedPuttingAction->setChecked(config->readBoolEntry("useAdvancedPutting", false)); - showInfoAction = new KToggleAction(i18n("Show &Info"), "info", CTRL+Key_I, this, SLOT(emptySlot()), actionCollection(), "showinfo"); + showInfoAction = new KToggleAction(i18n("Show &Info"), "info", CTRL+Key_I, this, TQT_SLOT(emptySlot()), actionCollection(), "showinfo"); showInfoAction->setCheckedState(i18n("Hide &Info")); - connect(showInfoAction, SIGNAL(toggled(bool)), this, SLOT(showInfoChanged(bool))); + connect(showInfoAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showInfoChanged(bool))); showInfoAction->setChecked(config->readBoolEntry("showInfo", false)); - showGuideLineAction = new KToggleAction(i18n("Show Putter &Guideline"), 0, this, SLOT(emptySlot()), actionCollection(), "showguideline"); + showGuideLineAction = new KToggleAction(i18n("Show Putter &Guideline"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "showguideline"); showGuideLineAction->setCheckedState(i18n("Hide Putter &Guideline")); - connect(showGuideLineAction, SIGNAL(toggled(bool)), this, SLOT(showGuideLineChanged(bool))); + connect(showGuideLineAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showGuideLineChanged(bool))); showGuideLineAction->setChecked(config->readBoolEntry("showGuideLine", true)); - KToggleAction *act=new KToggleAction(i18n("Enable All Dialog Boxes"), 0, this, SLOT(enableAllMessages()), actionCollection(), "enableAll"); + KToggleAction *act=new KToggleAction(i18n("Enable All Dialog Boxes"), 0, this, TQT_SLOT(enableAllMessages()), actionCollection(), "enableAll"); act->setCheckedState(i18n("Disable All Dialog Boxes")); - soundAction = new KToggleAction(i18n("Play &Sounds"), 0, this, SLOT(emptySlot()), actionCollection(), "sound"); - connect(soundAction, SIGNAL(toggled(bool)), this, SLOT(soundChanged(bool))); + soundAction = new KToggleAction(i18n("Play &Sounds"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "sound"); + connect(soundAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(soundChanged(bool))); soundAction->setChecked(config->readBoolEntry("sound", true)); - (void) new KAction(i18n("&Reload Plugins"), 0, this, SLOT(initPlugins()), actionCollection(), "reloadplugins"); - (void) new KAction(i18n("Show &Plugins"), 0, this, SLOT(showPlugins()), actionCollection(), "showplugins"); + (void) new KAction(i18n("&Reload Plugins"), 0, this, TQT_SLOT(initPlugins()), actionCollection(), "reloadplugins"); + (void) new KAction(i18n("Show &Plugins"), 0, this, TQT_SLOT(showPlugins()), actionCollection(), "showplugins"); - aboutAction = new KAction(i18n("&About Course"), 0, this, SLOT(emptySlot()), actionCollection(), "aboutcourse"); - tutorialAction = new KAction(i18n("&Tutorial"), 0, this, SLOT(tutorial()), actionCollection(), "tutorial"); + aboutAction = new KAction(i18n("&About Course"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "aboutcourse"); + tutorialAction = new KAction(i18n("&Tutorial"), 0, this, TQT_SLOT(tutorial()), actionCollection(), "tutorial"); statusBar(); setupGUI(); @@ -169,7 +169,7 @@ void Kolf::startNewGame() if (loadedGame.isNull()) { dialog = new NewGameDialog(filename.isNull(), dummy, "New Game Dialog"); - if (dialog->exec() != QDialog::Accepted) + if (dialog->exec() != TQDialog::Accepted) goto end; } @@ -202,7 +202,7 @@ void Kolf::startNewGame() if (isTutorial) filename = KGlobal::dirs()->findResource("appdata", "tutorial.kolf"); else - filename = config.readEntry("Course", QString::null); + filename = config.readEntry("Course", TQString::null); if (filename.isNull()) return; @@ -223,40 +223,40 @@ void Kolf::startNewGame() game = new KolfGame(obj, &players, filename, dummy); game->setStrict(competition); - connect(game, SIGNAL(newHole(int)), scoreboard, SLOT(newHole(int))); - connect(game, SIGNAL(scoreChanged(int, int, int)), scoreboard, SLOT(setScore(int, int, int))); - connect(game, SIGNAL(parChanged(int, int)), scoreboard, SLOT(parChanged(int, int))); - connect(game, SIGNAL(modifiedChanged(bool)), this, SLOT(updateModified(bool))); - connect(game, SIGNAL(newPlayersTurn(Player *)), this, SLOT(newPlayersTurn(Player *))); - connect(game, SIGNAL(holesDone()), this, SLOT(gameOver())); - connect(game, SIGNAL(checkEditing()), this, SLOT(checkEditing())); - connect(game, SIGNAL(editingStarted()), this, SLOT(editingStarted())); - connect(game, SIGNAL(editingEnded()), this, SLOT(editingEnded())); - connect(game, SIGNAL(inPlayStart()), this, SLOT(inPlayStart())); - connect(game, SIGNAL(inPlayEnd()), this, SLOT(inPlayEnd())); - connect(game, SIGNAL(maxStrokesReached(const QString &)), this, SLOT(maxStrokesReached(const QString &))); - connect(game, SIGNAL(largestHole(int)), this, SLOT(updateHoleMenu(int))); - connect(game, SIGNAL(titleChanged(const QString &)), this, SLOT(titleChanged(const QString &))); - connect(game, SIGNAL(newStatusText(const QString &)), this, SLOT(newStatusText(const QString &))); - connect(game, SIGNAL(currentHole(int)), this, SLOT(setCurrentHole(int))); - connect(holeAction, SIGNAL(activated(const QString &)), game, SLOT(switchHole(const QString &))); - connect(nextAction, SIGNAL(activated()), game, SLOT(nextHole())); - connect(prevAction, SIGNAL(activated()), game, SLOT(prevHole())); - connect(firstAction, SIGNAL(activated()), game, SLOT(firstHole())); - connect(lastAction, SIGNAL(activated()), game, SLOT(lastHole())); - connect(randAction, SIGNAL(activated()), game, SLOT(randHole())); - connect(editingAction, SIGNAL(activated()), game, SLOT(toggleEditMode())); - connect(newHoleAction, SIGNAL(activated()), game, SLOT(addNewHole())); - connect(clearHoleAction, SIGNAL(activated()), game, SLOT(clearHole())); - connect(resetHoleAction, SIGNAL(activated()), game, SLOT(resetHole())); - connect(undoShotAction, SIGNAL(activated()), game, SLOT(undoShot())); - //connect(replayShotAction, SIGNAL(activated()), game, SLOT(replay())); - connect(aboutAction, SIGNAL(activated()), game, SLOT(showInfoDlg())); - connect(useMouseAction, SIGNAL(toggled(bool)), game, SLOT(setUseMouse(bool))); - connect(useAdvancedPuttingAction, SIGNAL(toggled(bool)), game, SLOT(setUseAdvancedPutting(bool))); - connect(soundAction, SIGNAL(toggled(bool)), game, SLOT(setSound(bool))); - connect(showGuideLineAction, SIGNAL(toggled(bool)), game, SLOT(setShowGuideLine(bool))); - connect(showInfoAction, SIGNAL(toggled(bool)), game, SLOT(setShowInfo(bool))); + connect(game, TQT_SIGNAL(newHole(int)), scoreboard, TQT_SLOT(newHole(int))); + connect(game, TQT_SIGNAL(scoreChanged(int, int, int)), scoreboard, TQT_SLOT(setScore(int, int, int))); + connect(game, TQT_SIGNAL(parChanged(int, int)), scoreboard, TQT_SLOT(parChanged(int, int))); + connect(game, TQT_SIGNAL(modifiedChanged(bool)), this, TQT_SLOT(updateModified(bool))); + connect(game, TQT_SIGNAL(newPlayersTurn(Player *)), this, TQT_SLOT(newPlayersTurn(Player *))); + connect(game, TQT_SIGNAL(holesDone()), this, TQT_SLOT(gameOver())); + connect(game, TQT_SIGNAL(checkEditing()), this, TQT_SLOT(checkEditing())); + connect(game, TQT_SIGNAL(editingStarted()), this, TQT_SLOT(editingStarted())); + connect(game, TQT_SIGNAL(editingEnded()), this, TQT_SLOT(editingEnded())); + connect(game, TQT_SIGNAL(inPlayStart()), this, TQT_SLOT(inPlayStart())); + connect(game, TQT_SIGNAL(inPlayEnd()), this, TQT_SLOT(inPlayEnd())); + connect(game, TQT_SIGNAL(maxStrokesReached(const TQString &)), this, TQT_SLOT(maxStrokesReached(const TQString &))); + connect(game, TQT_SIGNAL(largestHole(int)), this, TQT_SLOT(updateHoleMenu(int))); + connect(game, TQT_SIGNAL(titleChanged(const TQString &)), this, TQT_SLOT(titleChanged(const TQString &))); + connect(game, TQT_SIGNAL(newStatusText(const TQString &)), this, TQT_SLOT(newStatusText(const TQString &))); + connect(game, TQT_SIGNAL(currentHole(int)), this, TQT_SLOT(setCurrentHole(int))); + connect(holeAction, TQT_SIGNAL(activated(const TQString &)), game, TQT_SLOT(switchHole(const TQString &))); + connect(nextAction, TQT_SIGNAL(activated()), game, TQT_SLOT(nextHole())); + connect(prevAction, TQT_SIGNAL(activated()), game, TQT_SLOT(prevHole())); + connect(firstAction, TQT_SIGNAL(activated()), game, TQT_SLOT(firstHole())); + connect(lastAction, TQT_SIGNAL(activated()), game, TQT_SLOT(lastHole())); + connect(randAction, TQT_SIGNAL(activated()), game, TQT_SLOT(randHole())); + connect(editingAction, TQT_SIGNAL(activated()), game, TQT_SLOT(toggleEditMode())); + connect(newHoleAction, TQT_SIGNAL(activated()), game, TQT_SLOT(addNewHole())); + connect(clearHoleAction, TQT_SIGNAL(activated()), game, TQT_SLOT(clearHole())); + connect(resetHoleAction, TQT_SIGNAL(activated()), game, TQT_SLOT(resetHole())); + connect(undoShotAction, TQT_SIGNAL(activated()), game, TQT_SLOT(undoShot())); + //connect(replayShotAction, TQT_SIGNAL(activated()), game, TQT_SLOT(replay())); + connect(aboutAction, TQT_SIGNAL(activated()), game, TQT_SLOT(showInfoDlg())); + connect(useMouseAction, TQT_SIGNAL(toggled(bool)), game, TQT_SLOT(setUseMouse(bool))); + connect(useAdvancedPuttingAction, TQT_SIGNAL(toggled(bool)), game, TQT_SLOT(setUseAdvancedPutting(bool))); + connect(soundAction, TQT_SIGNAL(toggled(bool)), game, TQT_SLOT(setSound(bool))); + connect(showGuideLineAction, TQT_SIGNAL(toggled(bool)), game, TQT_SLOT(setShowGuideLine(bool))); + connect(showInfoAction, TQT_SIGNAL(toggled(bool)), game, TQT_SLOT(setShowInfo(bool))); game->setUseMouse(useMouseAction->isChecked()); game->setUseAdvancedPutting(useAdvancedPuttingAction->isChecked()); @@ -299,23 +299,23 @@ void Kolf::startNewGame() void Kolf::newGame() { isTutorial = false; - filename = QString::null; + filename = TQString::null; startNewGame(); } void Kolf::tutorial() { - QString newfilename = KGlobal::dirs()->findResource("appdata", "tutorial.kolfgame"); + TQString newfilename = KGlobal::dirs()->findResource("appdata", "tutorial.kolfgame"); if (newfilename.isNull()) return; - filename = QString::null; + filename = TQString::null; loadedGame = newfilename; isTutorial = true; startNewGame(); - loadedGame = QString::null; + loadedGame = TQString::null; } void Kolf::closeGame() @@ -327,12 +327,12 @@ void Kolf::closeGame() game->pause(); } - filename = QString::null; + filename = TQString::null; editingEnded(); delete game; game = 0; - loadedGame = QString::null; + loadedGame = TQString::null; editingAction->setChecked(false); setEditingEnabled(false); @@ -353,10 +353,10 @@ void Kolf::closeGame() loadGameAction->setEnabled(true); tutorialAction->setEnabled(true); - titleChanged(QString::null); + titleChanged(TQString::null); updateModified(false); - QTimer::singleShot(100, this, SLOT(createSpacer())); + TQTimer::singleShot(100, this, TQT_SLOT(createSpacer())); } void Kolf::createSpacer() @@ -386,14 +386,14 @@ void Kolf::gameOver() int curScore = 1; // names of people who had the lowest score - QStringList names; + TQStringList names; HighScoreList highScores; int scoreBoardIndex = 1; while (curScore != 0) { - QString curName; + TQString curName; // name taken as a reference and filled out curScore = scoreboard->total(scoreBoardIndex, curName); @@ -430,7 +430,7 @@ void Kolf::gameOver() { if (names.count() > 1) { - QString winners = names.join(i18n(" and ")); + TQString winners = names.join(i18n(" and ")); KMessageBox::information(this, i18n("%1 tied").arg(winners)); } else @@ -448,13 +448,13 @@ void Kolf::gameOver() CourseInfo courseInfo; game->courseInfo(courseInfo, game->curFilename()); - scoreDialog->setConfigGroup(courseInfo.untranslatedName + QString(" Highscores")); + scoreDialog->setConfigGroup(courseInfo.untranslatedName + TQString(" Highscores")); for (HighScoreList::Iterator it = highScores.begin(); it != highScores.end(); ++it) { KScoreDialog::FieldInfo info; info[KScoreDialog::Name] = (*it).name; - info[KScoreDialog::Custom1] = QString::number(curPar); + info[KScoreDialog::Custom1] = TQString::number(curPar); scoreDialog->addScore((*it).score, info, false, true); } @@ -463,7 +463,7 @@ void Kolf::gameOver() scoreDialog->show(); } - QTimer::singleShot(700, this, SLOT(closeGame())); + TQTimer::singleShot(700, this, TQT_SLOT(closeGame())); } void Kolf::showHighScores() @@ -474,7 +474,7 @@ void Kolf::showHighScores() CourseInfo courseInfo; game->courseInfo(courseInfo, game->curFilename()); - scoreDialog->setConfigGroup(courseInfo.untranslatedName + QString(" Highscores")); + scoreDialog->setConfigGroup(courseInfo.untranslatedName + TQString(" Highscores")); scoreDialog->setComment(i18n("High Scores for %1").arg(courseInfo.name)); scoreDialog->show(); } @@ -495,7 +495,7 @@ void Kolf::save() void Kolf::saveAs() { - QString newfilename = KFileDialog::getSaveFileName(":kourses", "application/x-kourse", this, i18n("Pick Kolf Course to Save To")); + TQString newfilename = KFileDialog::getSaveFileName(":kourses", "application/x-kourse", this, i18n("Pick Kolf Course to Save To")); if (!newfilename.isNull()) { filename = newfilename; @@ -507,7 +507,7 @@ void Kolf::saveAs() void Kolf::saveGameAs() { - QString newfilename = KFileDialog::getSaveFileName(":savedkolf", "application/x-kolf", this, i18n("Pick Saved Game to Save To")); + TQString newfilename = KFileDialog::getSaveFileName(":savedkolf", "application/x-kolf", this, i18n("Pick Saved Game to Save To")); if (newfilename.isNull()) return; @@ -537,7 +537,7 @@ void Kolf::saveGame() void Kolf::loadGame() { - loadedGame = KFileDialog::getOpenFileName(":savedkolf", QString::fromLatin1("application/x-kolf"), this, i18n("Pick Kolf Saved Game")); + loadedGame = KFileDialog::getOpenFileName(":savedkolf", TQString::fromLatin1("application/x-kolf"), this, i18n("Pick Kolf Saved Game")); if (loadedGame.isNull()) return; @@ -549,11 +549,11 @@ void Kolf::loadGame() // called by main for commmand line files void Kolf::openURL(KURL url) { - QString target; + TQString target; if (KIO::NetAccess::download(url, target, this)) { isTutorial = false; - QString mimeType = KMimeType::findByPath(target)->name(); + TQString mimeType = KMimeType::findByPath(target)->name(); if (mimeType == "application/x-kourse") filename = target; else if (mimeType == "application/x-kolf") @@ -564,7 +564,7 @@ void Kolf::openURL(KURL url) return; } - QTimer::singleShot(10, this, SLOT(startNewGame())); + TQTimer::singleShot(10, this, TQT_SLOT(startNewGame())); } else closeGame(); @@ -582,7 +582,7 @@ void Kolf::newPlayersTurn(Player *player) scoreboard->setCurrentCell(player->id() - 1, game->currentHole() - 1); } -void Kolf::newStatusText(const QString &text) +void Kolf::newStatusText(const TQString &text) { if (text.isEmpty()) statusBar()->message(tempStatusBarText); @@ -594,10 +594,10 @@ void Kolf::editingStarted() { delete editor; editor = new Editor(obj, dummy, "Editor"); - connect(editor, SIGNAL(addNewItem(Object *)), game, SLOT(addNewObject(Object *))); - connect(editor, SIGNAL(changed()), game, SLOT(setModified())); - connect(editor, SIGNAL(addNewItem(Object *)), this, SLOT(setHoleFocus())); - connect(game, SIGNAL(newSelectedItem(CanvasItem *)), editor, SLOT(setItem(CanvasItem *))); + connect(editor, TQT_SIGNAL(addNewItem(Object *)), game, TQT_SLOT(addNewObject(Object *))); + connect(editor, TQT_SIGNAL(changed()), game, TQT_SLOT(setModified())); + connect(editor, TQT_SIGNAL(addNewItem(Object *)), this, TQT_SLOT(setHoleFocus())); + connect(game, TQT_SIGNAL(newSelectedItem(CanvasItem *)), editor, TQT_SLOT(setItem(CanvasItem *))); scoreboard->hide(); @@ -641,16 +641,16 @@ void Kolf::inPlayEnd() setHoleMovementEnabled(true); } -void Kolf::maxStrokesReached(const QString &name) +void Kolf::maxStrokesReached(const TQString &name) { KMessageBox::sorry(this, i18n("%1's score has reached the maximum for this hole.").arg(name)); } void Kolf::updateHoleMenu(int largest) { - QStringList items; + TQStringList items; for (int i = 1; i <= largest; ++i) - items.append(QString::number(i)); + items.append(TQString::number(i)); // setItems for some reason enables the action bool shouldbe = holeAction->isEnabled(); @@ -711,7 +711,7 @@ void Kolf::updateModified(bool mod) titleChanged(title); } -void Kolf::titleChanged(const QString &newTitle) +void Kolf::titleChanged(const TQString &newTitle) { title = newTitle; setCaption(title, courseModified); @@ -785,7 +785,7 @@ void Kolf::initPlugins() void Kolf::showPlugins() { - QString text = QString("<h2>%1</h2><ol>").arg(i18n("Currently Loaded Plugins")); + TQString text = TQString("<h2>%1</h2><ol>").arg(i18n("Currently Loaded Plugins")); Object *object = 0; for (object = plugins.first(); object; object = plugins.next()) { diff --git a/kolf/kolf.h b/kolf/kolf.h index 8a2c6d78..035448ab 100644 --- a/kolf/kolf.h +++ b/kolf/kolf.h @@ -4,11 +4,11 @@ #include <kmainwindow.h> #include <kurl.h> -#include <qmap.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qwidget.h> -#include <qvaluelist.h> +#include <tqmap.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqwidget.h> +#include <tqvaluelist.h> #include <kdemacros.h> #include "game.h" @@ -59,10 +59,10 @@ protected slots: void setHoleFocus() { game->setFocus(); } void inPlayStart(); void inPlayEnd(); - void maxStrokesReached(const QString &); + void maxStrokesReached(const TQString &); void updateHoleMenu(int); - void titleChanged(const QString &); - void newStatusText(const QString &); + void titleChanged(const TQString &); + void newStatusText(const TQString &); void showInfoChanged(bool); void useMouseChanged(bool); void useAdvancedPuttingChanged(bool); @@ -79,15 +79,15 @@ protected slots: void setCurrentHole(int); private: - QWidget *dummy; + TQWidget *dummy; KolfGame *game; Editor *editor; KolfGame *spacer; void initGUI(); - QString filename; + TQString filename; PlayerList players; PlayerList spacerPlayers; - QGridLayout *layout; + TQGridLayout *layout; ScoreBoard *scoreboard; KToggleAction *editingAction; KAction *newHoleAction; @@ -127,21 +127,21 @@ private: // contains subset of obj ObjectList plugins; - QString loadedGame; + TQString loadedGame; bool isTutorial; bool courseModified; - QString title; - QString tempStatusBarText; + TQString title; + TQString tempStatusBarText; }; struct HighScore { HighScore() {} - HighScore(const QString &name, int score) { this->name = name; this->score = score; } - QString name; + HighScore(const TQString &name, int score) { this->name = name; this->score = score; } + TQString name; int score; }; -typedef QValueList<HighScore> HighScoreList; +typedef TQValueList<HighScore> HighScoreList; #endif diff --git a/kolf/kvolumecontrol.cpp b/kolf/kvolumecontrol.cpp index 11d0be15..e2aaa464 100644 --- a/kolf/kvolumecontrol.cpp +++ b/kolf/kvolumecontrol.cpp @@ -6,13 +6,13 @@ #include "kvolumecontrol.h" KVolumeControl::KVolumeControl(Arts::SoundServerV2 server, KPlayObject *parent) - : QObject(parent) + : TQObject(parent) { init(server); } KVolumeControl::KVolumeControl(double vol, Arts::SoundServerV2 server, KPlayObject *parent) - : QObject(parent) + : TQObject(parent) { init(server); setVolume(vol); diff --git a/kolf/kvolumecontrol.h b/kolf/kvolumecontrol.h index 3f0306a8..ab7632f4 100644 --- a/kolf/kvolumecontrol.h +++ b/kolf/kvolumecontrol.h @@ -4,7 +4,7 @@ #include <arts/kplayobject.h> #include <arts/artsflow.h> #include <kdebug.h> -#include <qobject.h> +#include <tqobject.h> class KVolumeControl : public QObject { diff --git a/kolf/main.cpp b/kolf/main.cpp index 3a63c1f1..e9e8498a 100644 --- a/kolf/main.cpp +++ b/kolf/main.cpp @@ -1,5 +1,5 @@ -#include <qcstring.h> -#include <qfile.h> +#include <tqcstring.h> +#include <tqfile.h> #include <kapplication.h> #include <klocale.h> @@ -50,8 +50,8 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) { KCmdLineArgs::enable_i18n(); - QString filename(QFile::decodeName(args->getOption("course-info"))); - if (QFile::exists(filename)) + TQString filename(TQFile::decodeName(args->getOption("course-info"))); + if (TQFile::exists(filename)) { CourseInfo info; KolfGame::courseInfo(info, filename); @@ -70,7 +70,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) } } - QApplication::setColorSpec(QApplication::ManyColor); + TQApplication::setColorSpec(TQApplication::ManyColor); KApplication a; KGlobal::locale()->insertCatalogue("libkdegames"); diff --git a/kolf/newgame.cpp b/kolf/newgame.cpp index d038185e..22c6b785 100644 --- a/kolf/newgame.cpp +++ b/kolf/newgame.cpp @@ -12,30 +12,30 @@ #include <kfiledialog.h> #include <kurllabel.h> -#include <qcheckbox.h> -#include <qevent.h> -#include <qframe.h> -#include <qpen.h> -#include <qlayout.h> -#include <qlabel.h> +#include <tqcheckbox.h> +#include <tqevent.h> +#include <tqframe.h> +#include <tqpen.h> +#include <tqlayout.h> +#include <tqlabel.h> #include <klistbox.h> -#include <qstyle.h> -#include <qrect.h> -#include <qmap.h> -#include <qpainter.h> -#include <qpixmapcache.h> -#include <qwidget.h> -#include <qscrollview.h> -#include <qvaluelist.h> -#include <qptrlist.h> -#include <qstringlist.h> -#include <qstring.h> -#include <qvbox.h> +#include <tqstyle.h> +#include <tqrect.h> +#include <tqmap.h> +#include <tqpainter.h> +#include <tqpixmapcache.h> +#include <tqwidget.h> +#include <tqscrollview.h> +#include <tqvaluelist.h> +#include <tqptrlist.h> +#include <tqstringlist.h> +#include <tqstring.h> +#include <tqvbox.h> #include "newgame.h" #include "game.h" -NewGameDialog::NewGameDialog(bool enableCourses, QWidget *parent, const char *_name) +NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_name) : KDialogBase(KDialogBase::TreeList, i18n("New Game"), Ok | Cancel, Ok, parent, _name) { this->enableCourses = enableCourses; @@ -47,34 +47,34 @@ NewGameDialog::NewGameDialog(bool enableCourses, QWidget *parent, const char *_n startColors << yellow << blue << red << lightGray << cyan << darkBlue << magenta << darkGray << darkMagenta << darkYellow; playerPage = addPage(i18n("Players")); - QVBoxLayout *bigLayout = new QVBoxLayout(playerPage, marginHint(), spacingHint()); + TQVBoxLayout *bigLayout = new TQVBoxLayout(playerPage, marginHint(), spacingHint()); addButton = new KPushButton(i18n("&New Player"), playerPage); bigLayout->addWidget(addButton); - connect(addButton, SIGNAL(clicked()), this, SLOT(addPlayer())); + connect(addButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(addPlayer())); - scroller = new QScrollView(playerPage); + scroller = new TQScrollView(playerPage); bigLayout->addWidget(scroller); - layout = new QVBox(scroller->viewport()); - if (!QPixmapCache::find("grass", grass)) + layout = new TQVBox(scroller->viewport()); + if (!TQPixmapCache::find("grass", grass)) { grass.load(locate("appdata", "pics/grass.png")); - QPixmapCache::insert("grass", grass); + TQPixmapCache::insert("grass", grass); } scroller->viewport()->setBackgroundPixmap(grass); scroller->addChild(layout); - QMap<QString, QString> entries = config->entryMap("New Game Dialog"); + TQMap<TQString, TQString> entries = config->entryMap("New Game Dialog"); unsigned int i = 0; - for (QMap<QString, QString>::Iterator it = entries.begin(); it != entries.end(); ++it) + for (TQMap<TQString, TQString>::Iterator it = entries.begin(); it != entries.end(); ++it) { if (i > startColors.count()) return; addPlayer(); editors.last()->setName(it.key().right(it.key().length() - 1)); - editors.last()->setColor(QColor(it.data())); + editors.last()->setColor(TQColor(it.data())); ++i; } @@ -89,13 +89,13 @@ NewGameDialog::NewGameDialog(bool enableCourses, QWidget *parent, const char *_n if (enableCourses) { coursePage = addPage(i18n("Course"), i18n("Choose Course to Play")); - QVBoxLayout *coursePageLayout = new QVBoxLayout(coursePage, marginHint(), spacingHint()); + TQVBoxLayout *coursePageLayout = new TQVBoxLayout(coursePage, marginHint(), spacingHint()); KURLLabel *coursesLink = new KURLLabel("http://web.mit.edu/~jasonkb/www/kolf/", "http://web.mit.edu/~jasonkb/www/kolf/", coursePage); - connect(coursesLink, SIGNAL(leftClickedURL(const QString &)), kapp, SLOT(invokeBrowser(const QString &))); + connect(coursesLink, TQT_SIGNAL(leftClickedURL(const TQString &)), kapp, TQT_SLOT(invokeBrowser(const TQString &))); coursePageLayout->addWidget(coursesLink); - QHBoxLayout *hlayout = new QHBoxLayout(coursePageLayout, spacingHint()); + TQHBoxLayout *hlayout = new TQHBoxLayout(coursePageLayout, spacingHint()); // following use this group config->setGroup("New Game Dialog Mode"); @@ -104,14 +104,14 @@ NewGameDialog::NewGameDialog(bool enableCourses, QWidget *parent, const char *_n externCourses = config->readListEntry("extra"); /// course loading - QStringList items = externCourses + KGlobal::dirs()->findAllResources("appdata", "courses/*"); - QStringList nameList; - const QString lastCourse(config->readEntry("course", "")); + TQStringList items = externCourses + KGlobal::dirs()->findAllResources("appdata", "courses/*"); + TQStringList nameList; + const TQString lastCourse(config->readEntry("course", "")); int curItem = 0; i = 0; - for (QStringList::Iterator it = items.begin(); it != items.end(); ++it, ++i) + for (TQStringList::Iterator it = items.begin(); it != items.end(); ++it, ++i) { - QString file = *it; + TQString file = *it; CourseInfo curinfo; KolfGame::courseInfo(curinfo, file); info[file] = curinfo; @@ -122,47 +122,47 @@ NewGameDialog::NewGameDialog(bool enableCourses, QWidget *parent, const char *_n curItem = i; } - const QString newName(i18n("Create New")); - info[QString::null] = CourseInfo(newName, newName, i18n("You"), 0, 0); - names.append(QString::null); + const TQString newName(i18n("Create New")); + info[TQString::null] = CourseInfo(newName, newName, i18n("You"), 0, 0); + names.append(TQString::null); nameList.append(newName); courseList = new KListBox(coursePage); hlayout->addWidget(courseList); courseList->insertStringList(nameList); courseList->setCurrentItem(curItem); - connect(courseList, SIGNAL(highlighted(int)), this, SLOT(courseSelected(int))); - connect(courseList, SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); + connect(courseList, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(courseSelected(int))); + connect(courseList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(selectionChanged())); - QVBoxLayout *detailLayout = new QVBoxLayout(hlayout, spacingHint()); - name = new QLabel(coursePage); + TQVBoxLayout *detailLayout = new TQVBoxLayout(hlayout, spacingHint()); + name = new TQLabel(coursePage); detailLayout->addWidget(name); - author = new QLabel(coursePage); + author = new TQLabel(coursePage); detailLayout->addWidget(author); - QHBoxLayout *minorLayout = new QHBoxLayout(detailLayout, spacingHint()); - par = new QLabel(coursePage); + TQHBoxLayout *minorLayout = new TQHBoxLayout(detailLayout, spacingHint()); + par = new TQLabel(coursePage); minorLayout->addWidget(par); - holes = new QLabel(coursePage); + holes = new TQLabel(coursePage); minorLayout->addWidget(holes); detailLayout->addStretch(); KPushButton *scores = new KPushButton(i18n("Highscores"), coursePage); - connect(scores, SIGNAL(clicked()), this, SLOT(showHighscores())); + connect(scores, TQT_SIGNAL(clicked()), this, TQT_SLOT(showHighscores())); detailLayout->addWidget(scores); detailLayout->addStretch(); detailLayout->addWidget(new KSeparator(coursePage)); - minorLayout = new QHBoxLayout(detailLayout, spacingHint()); + minorLayout = new TQHBoxLayout(detailLayout, spacingHint()); KPushButton *addCourseButton = new KPushButton(i18n("Add..."), coursePage); minorLayout->addWidget(addCourseButton); - connect(addCourseButton, SIGNAL(clicked()), this, SLOT(addCourse())); + connect(addCourseButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(addCourse())); remove = new KPushButton(i18n("Remove"), coursePage); minorLayout->addWidget(remove); - connect(remove, SIGNAL(clicked()), this, SLOT(removeCourse())); + connect(remove, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeCourse())); courseSelected(curItem); selectionChanged(); @@ -170,13 +170,13 @@ NewGameDialog::NewGameDialog(bool enableCourses, QWidget *parent, const char *_n // options page optionsPage = addPage(i18n("Options"), i18n("Game Options")); - QVBoxLayout *vlayout = new QVBoxLayout(optionsPage, marginHint(), spacingHint()); + TQVBoxLayout *vlayout = new TQVBoxLayout(optionsPage, marginHint(), spacingHint()); - mode = new QCheckBox(i18n("&Strict mode"), optionsPage); + mode = new TQCheckBox(i18n("&Strict mode"), optionsPage); vlayout->addWidget(mode); mode->setChecked(config->readBoolEntry("competition", false)); - QLabel *desc = new QLabel(i18n("In strict mode, undo, editing, and switching holes is not allowed. This is generally for competition. Only in strict mode are highscores kept."), optionsPage); + TQLabel *desc = new TQLabel(i18n("In strict mode, undo, editing, and switching holes is not allowed. This is generally for competition. Only in strict mode are highscores kept."), optionsPage); desc->setTextFormat(RichText); vlayout->addWidget(desc); } @@ -199,7 +199,7 @@ void NewGameDialog::slotOk() PlayerEditor *curEditor = 0; int i = 0; for (curEditor = editors.first(); curEditor; curEditor = editors.next(), ++i) - config->writeEntry(QString::number(i) + curEditor->name(), curEditor->color().name()); + config->writeEntry(TQString::number(i) + curEditor->name(), curEditor->color().name()); config->sync(); @@ -212,7 +212,7 @@ void NewGameDialog::courseSelected(int index) CourseInfo &curinfo = info[currentCourse]; - name->setText(QString("<strong>%1</strong>").arg(curinfo.name)); + name->setText(TQString("<strong>%1</strong>").arg(curinfo.name)); author->setText(i18n("By %1").arg(curinfo.author)); par->setText(i18n("Par %1").arg(curinfo.par)); @@ -223,7 +223,7 @@ void NewGameDialog::showHighscores() { KScoreDialog *scoreDialog = new KScoreDialog(KScoreDialog::Name | KScoreDialog::Custom1 | KScoreDialog::Score, this); scoreDialog->addField(KScoreDialog::Custom1, i18n("Par"), "Par"); - scoreDialog->setConfigGroup(info[currentCourse].untranslatedName + QString(" Highscores")); + scoreDialog->setConfigGroup(info[currentCourse].untranslatedName + TQString(" Highscores")); scoreDialog->setComment(i18n("High Scores for %1").arg(info[currentCourse].name)); scoreDialog->show(); } @@ -234,7 +234,7 @@ void NewGameDialog::removeCourse() if (curItem < 0) return; - QString file = *names.at(curItem); + TQString file = *names.at(curItem); if (externCourses.contains(file) < 1) return; @@ -253,11 +253,11 @@ void NewGameDialog::selectionChanged() void NewGameDialog::addCourse() { - QStringList files = KFileDialog::getOpenFileNames(":kourses", QString::fromLatin1("application/x-kourse"), this, i18n("Pick Kolf Course")); + TQStringList files = KFileDialog::getOpenFileNames(":kourses", TQString::fromLatin1("application/x-kourse"), this, i18n("Pick Kolf Course")); bool hasDuplicates = false; - for (QStringList::Iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) + for (TQStringList::Iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) { if (names.contains(*fileIt) > 0) { @@ -289,7 +289,7 @@ void NewGameDialog::addPlayer() editors.append(new PlayerEditor(i18n("Player %1").arg(editors.count() + 1), *startColors.at(editors.count()), layout)); editors.last()->show(); - connect(editors.last(), SIGNAL(deleteEditor(PlayerEditor *)), this, SLOT(deleteEditor(PlayerEditor *))); + connect(editors.last(), TQT_SIGNAL(deleteEditor(PlayerEditor *)), this, TQT_SLOT(deleteEditor(PlayerEditor *))); enableButtons(); } @@ -311,15 +311,15 @@ void NewGameDialog::enableButtons() ///////////////////////// -PlayerEditor::PlayerEditor(QString startName, QColor startColor, QWidget *parent, const char *_name) - : QWidget(parent, _name) +PlayerEditor::PlayerEditor(TQString startName, TQColor startColor, TQWidget *parent, const char *_name) + : TQWidget(parent, _name) { - QHBoxLayout *layout = new QHBoxLayout(this, KDialogBase::spacingHint()); + TQHBoxLayout *layout = new TQHBoxLayout(this, KDialogBase::spacingHint()); - if (!QPixmapCache::find("grass", grass)) + if (!TQPixmapCache::find("grass", grass)) { grass.load(locate("appdata", "pics/grass.png")); - QPixmapCache::insert("grass", grass); + TQPixmapCache::insert("grass", grass); } setBackgroundPixmap(grass); @@ -336,7 +336,7 @@ PlayerEditor::PlayerEditor(QString startName, QColor startColor, QWidget *parent remove->setAutoMask(true); layout->addWidget(remove); remove->setBackgroundPixmap(grass); - connect(remove, SIGNAL(clicked()), this, SLOT(removeMe())); + connect(remove, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeMe())); } void PlayerEditor::removeMe() diff --git a/kolf/newgame.h b/kolf/newgame.h index b9770a80..3259846f 100644 --- a/kolf/newgame.h +++ b/kolf/newgame.h @@ -5,14 +5,14 @@ #include <klineedit.h> #include <kcolorbutton.h> -#include <qcheckbox.h> -#include <qcolor.h> -#include <qptrlist.h> -#include <qstring.h> +#include <tqcheckbox.h> +#include <tqcolor.h> +#include <tqptrlist.h> +#include <tqstring.h> #include <kpushbutton.h> -#include <qstringlist.h> -#include <qvaluelist.h> -#include <qwidget.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> +#include <tqwidget.h> #include "game.h" @@ -29,11 +29,11 @@ class PlayerEditor : public QWidget Q_OBJECT public: - PlayerEditor(QString name = QString::null, QColor = red, QWidget *parent = 0, const char *_name = 0); - QColor color() { return colorButton->color(); } - QString name() { return editor->text(); } - void setColor(QColor col) { colorButton->setColor(col); } - void setName(const QString &newname) { editor->setText(newname); } + PlayerEditor(TQString name = TQString::null, TQColor = red, TQWidget *parent = 0, const char *_name = 0); + TQColor color() { return colorButton->color(); } + TQString name() { return editor->text(); } + void setColor(TQColor col) { colorButton->setColor(col); } + void setName(const TQString &newname) { editor->setText(newname); } signals: void deleteEditor(PlayerEditor *editor); @@ -44,7 +44,7 @@ private slots: private: KLineEdit *editor; KColorButton *colorButton; - QPixmap grass; + TQPixmap grass; }; class NewGameDialog : public KDialogBase @@ -52,10 +52,10 @@ class NewGameDialog : public KDialogBase Q_OBJECT public: - NewGameDialog(bool enableCourses, QWidget *parent, const char *_name = 0); - QPtrList<PlayerEditor> *players() { return &editors; } + NewGameDialog(bool enableCourses, TQWidget *parent, const char *_name = 0); + TQPtrList<PlayerEditor> *players() { return &editors; } bool competition() { return mode->isChecked(); } - QString course() { return currentCourse; } + TQString course() { return currentCourse; } public slots: void deleteEditor(PlayerEditor *); @@ -72,32 +72,32 @@ private slots: void showHighscores(); private: - QVBox *layout; + TQVBox *layout; KPushButton *addButton; - QFrame *playerPage; - QScrollView *scroller; - QFrame *coursePage; - QFrame *optionsPage; - QValueList<QColor> startColors; - QPtrList<PlayerEditor> editors; + TQFrame *playerPage; + TQScrollView *scroller; + TQFrame *coursePage; + TQFrame *optionsPage; + TQValueList<TQColor> startColors; + TQPtrList<PlayerEditor> editors; KPushButton *remove; - QCheckBox *mode; + TQCheckBox *mode; - QPixmap grass; + TQPixmap grass; - QStringList names; - QStringList externCourses; - QMap<QString, CourseInfo> info; + TQStringList names; + TQStringList externCourses; + TQMap<TQString, CourseInfo> info; - QStringList extraCourses; + TQStringList extraCourses; KListBox *courseList; - QLabel *name; - QLabel *author; - QLabel *par; - QLabel *holes; + TQLabel *name; + TQLabel *author; + TQLabel *par; + TQLabel *holes; - QString currentCourse; + TQString currentCourse; void enableButtons(); bool enableCourses; diff --git a/kolf/object.h b/kolf/object.h index a2bf2ef1..1ef52c55 100644 --- a/kolf/object.h +++ b/kolf/object.h @@ -3,28 +3,28 @@ #ifndef KOLF_OBJECT_H #define KOLF_OBJECT_H -#include <qcanvas.h> -#include <qstring.h> -#include <qobject.h> +#include <tqcanvas.h> +#include <tqstring.h> +#include <tqobject.h> class Object : public QObject { Q_OBJECT public: - Object(QObject *parent = 0, const char *name = 0) : QObject(parent, name) { m_addOnNewHole = false; } - virtual QCanvasItem *newObject(QCanvas * /*canvas*/) { return 0; } - QString name() { return m_name; } - QString _name() { return m__name; } - QString author() { return m_author; } + Object(TQObject *parent = 0, const char *name = 0) : TQObject(parent, name) { m_addOnNewHole = false; } + virtual TQCanvasItem *newObject(TQCanvas * /*canvas*/) { return 0; } + TQString name() { return m_name; } + TQString _name() { return m__name; } + TQString author() { return m_author; } bool addOnNewHole() { return m_addOnNewHole; } protected: - QString m_name; - QString m__name; - QString m_author; + TQString m_name; + TQString m__name; + TQString m_author; bool m_addOnNewHole; }; -typedef QPtrList<Object> ObjectList; +typedef TQPtrList<Object> ObjectList; #endif diff --git a/kolf/objects/poolball/poolball.cpp b/kolf/objects/poolball/poolball.cpp index a5ca80ec..c2fe0718 100644 --- a/kolf/objects/poolball/poolball.cpp +++ b/kolf/objects/poolball/poolball.cpp @@ -1,9 +1,9 @@ -#include <qbrush.h> -#include <qcolor.h> -#include <qcanvas.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpainter.h> +#include <tqbrush.h> +#include <tqcolor.h> +#include <tqcanvas.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpainter.h> #include <klocale.h> #include <klibloader.h> @@ -17,9 +17,9 @@ #include "poolball.h" K_EXPORT_COMPONENT_FACTORY(libkolfpoolball, PoolBallFactory) -QObject *PoolBallFactory::createObject (QObject *, const char *, const char *, const QStringList &) { return new PoolBallObj; } +TQObject *PoolBallFactory::createObject (TQObject *, const char *, const char *, const TQStringList &) { return new PoolBallObj; } -PoolBall::PoolBall(QCanvas *canvas) +PoolBall::PoolBall(TQCanvas *canvas) : Ball(canvas) { setBrush(black); @@ -33,7 +33,7 @@ void PoolBall::save(KConfig *cfg) void PoolBall::saveState(StateDB *db) { - db->setPoint(QPoint(x(), y())); + db->setPoint(TQPoint(x(), y())); } void PoolBall::load(KConfig *cfg) @@ -48,20 +48,20 @@ void PoolBall::loadState(StateDB *db) setState(Stopped); } -void PoolBall::draw(QPainter &p) +void PoolBall::draw(TQPainter &p) { // we should draw the number here Ball::draw(p); } -PoolBallConfig::PoolBallConfig(PoolBall *poolBall, QWidget *parent) +PoolBallConfig::PoolBallConfig(PoolBall *poolBall, TQWidget *parent) : Config(parent), m_poolBall(poolBall) { - QVBoxLayout *layout = new QVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); layout->addStretch(); - QLabel *num = new QLabel(i18n("Number:"), this); + TQLabel *num = new TQLabel(i18n("Number:"), this); layout->addWidget(num); KIntNumInput *slider = new KIntNumInput(m_poolBall->number(), this); slider->setRange(1, 15); @@ -69,7 +69,7 @@ PoolBallConfig::PoolBallConfig(PoolBall *poolBall, QWidget *parent) layout->addStretch(); - connect(slider, SIGNAL(valueChanged(int)), this, SLOT(numberChanged(int))); + connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(numberChanged(int))); } void PoolBallConfig::numberChanged(int newNumber) @@ -78,7 +78,7 @@ void PoolBallConfig::numberChanged(int newNumber) changed(); } -Config *PoolBall::config(QWidget *parent) +Config *PoolBall::config(TQWidget *parent) { return new PoolBallConfig(this, parent); } diff --git a/kolf/objects/poolball/poolball.h b/kolf/objects/poolball/poolball.h index eeb851b2..82b1dd68 100644 --- a/kolf/objects/poolball/poolball.h +++ b/kolf/objects/poolball/poolball.h @@ -1,9 +1,9 @@ #ifndef KOLFPOOLBALL_H #define KOLFPOOLBALL_H -#include <qcanvas.h> -#include <qobject.h> -#include <qpainter.h> +#include <tqcanvas.h> +#include <tqobject.h> +#include <tqpainter.h> #include <klibloader.h> @@ -15,21 +15,21 @@ class StateDB; class KConfig; -class PoolBallFactory : KLibFactory { Q_OBJECT public: QObject *createObject(QObject *, const char *, const char *, const QStringList & = QStringList()); }; +class PoolBallFactory : KLibFactory { Q_OBJECT public: TQObject *createObject(TQObject *, const char *, const char *, const TQStringList & = TQStringList()); }; class PoolBall : public Ball { public: - PoolBall(QCanvas *canvas); + PoolBall(TQCanvas *canvas); virtual bool deleteable() const { return true; } - virtual Config *config(QWidget *parent); + virtual Config *config(TQWidget *parent); virtual void saveState(StateDB *); virtual void save(KConfig *cfg); virtual void loadState(StateDB *); virtual void load(KConfig *cfg); - virtual void draw(QPainter &); + virtual void draw(TQPainter &); virtual bool fastAdvance() const { return true; } int number() const { return m_number; } @@ -44,7 +44,7 @@ class PoolBallConfig : public Config Q_OBJECT public: - PoolBallConfig(PoolBall *poolBall, QWidget *parent); + PoolBallConfig(PoolBall *poolBall, TQWidget *parent); private slots: void numberChanged(int); @@ -57,7 +57,7 @@ class PoolBallObj : public Object { public: PoolBallObj() { m_name = i18n("Pool Ball"); m__name = "poolball"; m_author = "Jason Katz-Brown"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new PoolBall(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new PoolBall(canvas); } }; #endif diff --git a/kolf/objects/test/test.cpp b/kolf/objects/test/test.cpp index 2c3d564f..d417f552 100644 --- a/kolf/objects/test/test.cpp +++ b/kolf/objects/test/test.cpp @@ -1,9 +1,9 @@ -#include <qbrush.h> -#include <qcolor.h> -#include <qcanvas.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qslider.h> +#include <tqbrush.h> +#include <tqcolor.h> +#include <tqcanvas.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqslider.h> #include <klocale.h> #include <klibloader.h> @@ -14,11 +14,11 @@ #include "test.h" K_EXPORT_COMPONENT_FACTORY(libkolftest, TestFactory) -QObject *TestFactory::createObject (QObject * /*parent*/, const char * /*name*/, const char * /*classname*/, const QStringList & /*args*/) +TQObject *TestFactory::createObject (TQObject * /*parent*/, const char * /*name*/, const char * /*classname*/, const TQStringList & /*args*/) { return new TestObj; } -Test::Test(QCanvas *canvas) - : QCanvasEllipse(60, 40, canvas), count(0), m_switchEvery(20) +Test::Test(TQCanvas *canvas) + : TQCanvasEllipse(60, 40, canvas), count(0), m_switchEvery(20) { // force to the bottom of other objects setZ(-100000); @@ -29,7 +29,7 @@ Test::Test(QCanvas *canvas) void Test::advance(int phase) { - QCanvasEllipse::advance(phase); + TQCanvasEllipse::advance(phase); // phase is either 0 or 1, only calls with 1 should be handled if (phase == 1) @@ -39,11 +39,11 @@ void Test::advance(int phase) if (count % m_switchEvery == 0) { // random color - const QColor myColor((QRgb)(kapp->random() % 0x01000000)); + const TQColor myColor((QRgb)(kapp->random() % 0x01000000)); // set the brush, so our shape is drawn // with the random color - setBrush(QBrush(myColor)); + setBrush(TQBrush(myColor)); count = 0; } @@ -65,26 +65,26 @@ void Test::load(KConfig *cfg) setSwitchEvery(cfg->readNumEntry("switchEvery", 50)); } -TestConfig::TestConfig(Test *test, QWidget *parent) +TestConfig::TestConfig(Test *test, TQWidget *parent) : Config(parent), m_test(test) { - QVBoxLayout *layout = new QVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); layout->addStretch(); - layout->addWidget(new QLabel(i18n("Flash speed"), this)); + layout->addWidget(new TQLabel(i18n("Flash speed"), this)); - QHBoxLayout *hlayout = new QHBoxLayout(layout, spacingHint()); - QLabel *slow = new QLabel(i18n("Slow"), this); + TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); + TQLabel *slow = new TQLabel(i18n("Slow"), this); hlayout->addWidget(slow); - QSlider *slider = new QSlider(1, 100, 5, 101 - m_test->switchEvery(), Qt::Horizontal, this); + TQSlider *slider = new TQSlider(1, 100, 5, 101 - m_test->switchEvery(), Qt::Horizontal, this); hlayout->addWidget(slider); - QLabel *fast = new QLabel(i18n("Fast"), this); + TQLabel *fast = new TQLabel(i18n("Fast"), this); hlayout->addWidget(fast); layout->addStretch(); - connect(slider, SIGNAL(valueChanged(int)), this, SLOT(switchEveryChanged(int))); + connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(switchEveryChanged(int))); } void TestConfig::switchEveryChanged(int news) @@ -96,7 +96,7 @@ void TestConfig::switchEveryChanged(int news) changed(); } -Config *Test::config(QWidget *parent) +Config *Test::config(TQWidget *parent) { return new TestConfig(this, parent); } diff --git a/kolf/objects/test/test.h b/kolf/objects/test/test.h index 3086a578..06e9f30a 100644 --- a/kolf/objects/test/test.h +++ b/kolf/objects/test/test.h @@ -1,8 +1,8 @@ #ifndef KOLFTEST_H #define KOLFTEST_H -#include <qcanvas.h> -#include <qobject.h> +#include <tqcanvas.h> +#include <tqobject.h> #include <klibloader.h> @@ -11,14 +11,14 @@ class KConfig; -class TestFactory : KLibFactory { Q_OBJECT public: QObject *createObject(QObject *, const char *, const char *, const QStringList & = QStringList()); }; +class TestFactory : KLibFactory { Q_OBJECT public: TQObject *createObject(TQObject *, const char *, const char *, const TQStringList & = TQStringList()); }; -class Test : public QCanvasEllipse, public CanvasItem +class Test : public TQCanvasEllipse, public CanvasItem { public: - Test(QCanvas *canvas); + Test(TQCanvas *canvas); - virtual Config *config(QWidget *parent); + virtual Config *config(TQWidget *parent); virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); @@ -37,7 +37,7 @@ class TestConfig : public Config Q_OBJECT public: - TestConfig(Test *test, QWidget *parent); + TestConfig(Test *test, TQWidget *parent); private slots: void switchEveryChanged(int news); @@ -50,7 +50,7 @@ class TestObj : public Object { public: TestObj() { m_name = i18n("Flash"); m__name = "flash"; m_author = "Jason Katz-Brown"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Test(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Test(canvas); } }; #endif diff --git a/kolf/pluginloader.cpp b/kolf/pluginloader.cpp index 23d1a494..8cf39d69 100644 --- a/kolf/pluginloader.cpp +++ b/kolf/pluginloader.cpp @@ -1,8 +1,8 @@ -#include <qstring.h> -#include <qvaluelist.h> -#include <qstringlist.h> -#include <qfile.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqstringlist.h> +#include <tqfile.h> +#include <tqobject.h> #include <kdebug.h> #include <kglobal.h> @@ -16,18 +16,18 @@ ObjectList *PluginLoader::loadAll() { ObjectList *ret = new ObjectList; - QStringList libs; - QStringList files = KGlobal::dirs()->findAllResources("appdata", "*.plugin", false, true); + TQStringList libs; + TQStringList files = KGlobal::dirs()->findAllResources("appdata", "*.plugin", false, true); - for (QStringList::Iterator it = files.begin(); it != files.end(); ++it) + for (TQStringList::Iterator it = files.begin(); it != files.end(); ++it) { KSimpleConfig cfg(*it); - QString filename(cfg.readEntry("Filename", "")); + TQString filename(cfg.readEntry("Filename", "")); libs.append(filename); } - for (QStringList::Iterator it = libs.begin(); it != libs.end(); ++it) + for (TQStringList::Iterator it = libs.begin(); it != libs.end(); ++it) { Object *newObject = load(*it); if (newObject) @@ -37,7 +37,7 @@ ObjectList *PluginLoader::loadAll() return ret; } -Object *PluginLoader::load(const QString &filename) +Object *PluginLoader::load(const TQString &filename) { KLibFactory *factory = KLibLoader::self()->factory(filename.latin1()); @@ -47,7 +47,7 @@ Object *PluginLoader::load(const QString &filename) return 0; } - QObject *newObject = factory->create(0, "objectInstance", "Object"); + TQObject *newObject = factory->create(0, "objectInstance", "Object"); if (!newObject) { diff --git a/kolf/pluginloader.h b/kolf/pluginloader.h index 8d43db66..bd9f52e1 100644 --- a/kolf/pluginloader.h +++ b/kolf/pluginloader.h @@ -2,12 +2,12 @@ #define PLUGINLOADER_H #include <object.h> -#include <qstring.h> +#include <tqstring.h> namespace PluginLoader { ObjectList *loadAll(); - Object *load(const QString &); + Object *load(const TQString &); } #endif diff --git a/kolf/printdialogpage.cpp b/kolf/printdialogpage.cpp index 1fc6ad37..e8733c81 100644 --- a/kolf/printdialogpage.cpp +++ b/kolf/printdialogpage.cpp @@ -1,6 +1,6 @@ -#include <qcheckbox.h> -#include <qlayout.h> -#include <qwidget.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqwidget.h> #include <klocale.h> #include <kdialog.h> @@ -8,26 +8,26 @@ #include "printdialogpage.h" -PrintDialogPage::PrintDialogPage(QWidget *parent, const char *name) +PrintDialogPage::PrintDialogPage(TQWidget *parent, const char *name) : KPrintDialogPage( parent, name ) { setTitle(i18n("Kolf Options")); - QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - titleCheck = new QCheckBox(i18n("Draw title text"), this); + titleCheck = new TQCheckBox(i18n("Draw title text"), this); titleCheck->setChecked(true); layout->addWidget(titleCheck); } -void PrintDialogPage::getOptions(QMap<QString, QString> &opts, bool /*incldef*/) +void PrintDialogPage::getOptions(TQMap<TQString, TQString> &opts, bool /*incldef*/) { opts["kde-kolf-title"] = titleCheck->isChecked()? "true" : "false"; } -void PrintDialogPage::setOptions(const QMap<QString, QString> &opts) +void PrintDialogPage::setOptions(const TQMap<TQString, TQString> &opts) { - QString setting = opts["kde-kolf-title"]; + TQString setting = opts["kde-kolf-title"]; if (!!setting) titleCheck->setChecked(setting == "true"); } diff --git a/kolf/printdialogpage.h b/kolf/printdialogpage.h index 047454a2..4376055c 100644 --- a/kolf/printdialogpage.h +++ b/kolf/printdialogpage.h @@ -2,8 +2,8 @@ #define PRINTDIALOGPAGE_H #include <kdeprint/kprintdialogpage.h> -#include <qmap.h> -#include <qstring.h> +#include <tqmap.h> +#include <tqstring.h> class QCheckBox; class QWidget; @@ -13,15 +13,15 @@ class PrintDialogPage : public KPrintDialogPage Q_OBJECT public: - PrintDialogPage(QWidget *parent = 0, const char *name = 0); + PrintDialogPage(TQWidget *parent = 0, const char *name = 0); //reimplement virtual functions - void getOptions(QMap<QString, QString> &opts, bool incldef = false); - void setOptions(const QMap<QString, QString> &opts); + void getOptions(TQMap<TQString, TQString> &opts, bool incldef = false); + void setOptions(const TQMap<TQString, TQString> &opts); private: - QCheckBox *bgCheck; - QCheckBox *titleCheck; + TQCheckBox *bgCheck; + TQCheckBox *titleCheck; }; #endif diff --git a/kolf/scoreboard.cpp b/kolf/scoreboard.cpp index a750156f..61ff9926 100644 --- a/kolf/scoreboard.cpp +++ b/kolf/scoreboard.cpp @@ -1,23 +1,23 @@ #include <kdebug.h> #include <klocale.h> -#include <qlayout.h> -#include <qtable.h> -#include <qwidget.h> -#include <qheader.h> -#include <qstring.h> +#include <tqlayout.h> +#include <tqtable.h> +#include <tqwidget.h> +#include <tqheader.h> +#include <tqstring.h> #include "scoreboard.h" -ScoreBoard::ScoreBoard(QWidget *parent, const char *name) - : QTable(1, 1, parent, name) +ScoreBoard::ScoreBoard(TQWidget *parent, const char *name) + : TQTable(1, 1, parent, name) { vh = verticalHeader(); hh = horizontalHeader(); vh->setLabel(numRows() - 1, i18n("Par")); hh->setLabel(numCols() - 1, i18n("Total")); - setFocusPolicy(QWidget::NoFocus); + setFocusPolicy(TQWidget::NoFocus); setRowReadOnly(0, true); setRowReadOnly(1, true); } @@ -26,15 +26,15 @@ void ScoreBoard::newHole(int par) { int _numCols = numCols(); insertColumns(_numCols - 1); - hh->setLabel(numCols() - 2, QString::number(numCols() - 1)); - setText(numRows() - 1, numCols() - 2, QString::number(par)); + hh->setLabel(numCols() - 2, TQString::number(numCols() - 1)); + setText(numRows() - 1, numCols() - 2, TQString::number(par)); setColumnWidth(numCols() - 2, 40); // update total int tot = 0; for (int i = 0; i < numCols() - 1; ++i) tot += text(numRows() - 1, i).toInt(); - setText(numRows() - 1, numCols() - 1, QString::number(tot)); + setText(numRows() - 1, numCols() - 1, TQString::number(tot)); // shrink cell... setColumnWidth(numCols() - 2, 3); @@ -42,7 +42,7 @@ void ScoreBoard::newHole(int par) adjustColumn(numCols() - 2); } -void ScoreBoard::newPlayer(const QString &name) +void ScoreBoard::newPlayer(const TQString &name) { //kdDebug(12007) << "name of new player is " << name << endl; insertRows(numRows() - 1); @@ -53,10 +53,10 @@ void ScoreBoard::newPlayer(const QString &name) void ScoreBoard::setScore(int id, int hole, int score) { //kdDebug(12007) << "set score\n"; - setText(id - 1, hole - 1, score > 0? QString::number(score) : QString("")); + setText(id - 1, hole - 1, score > 0? TQString::number(score) : TQString("")); - QString name; - setText(id - 1, numCols() - 1, QString::number(total(id, name))); + TQString name; + setText(id - 1, numCols() - 1, TQString::number(total(id, name))); if (hole >= numCols() - 2) ensureCellVisible(id - 1, numCols() - 1); else @@ -72,16 +72,16 @@ void ScoreBoard::setScore(int id, int hole, int score) void ScoreBoard::parChanged(int hole, int par) { - setText(numRows() - 1, hole - 1, QString::number(par)); + setText(numRows() - 1, hole - 1, TQString::number(par)); // update total int tot = 0; for (int i = 0; i < numCols() - 1; ++i) tot += text(numRows() - 1, i).toInt(); - setText(numRows() - 1, numCols() - 1, QString::number(tot)); + setText(numRows() - 1, numCols() - 1, TQString::number(tot)); } -int ScoreBoard::total(int id, QString &name) +int ScoreBoard::total(int id, TQString &name) { int tot = 0; for (int i = 0; i < numCols() - 1; i++) diff --git a/kolf/scoreboard.h b/kolf/scoreboard.h index b9dc78f4..618069dd 100644 --- a/kolf/scoreboard.h +++ b/kolf/scoreboard.h @@ -1,7 +1,7 @@ #ifndef SCOREBOARD_H #define SCOREBOARD_H -#include <qtable.h> +#include <tqtable.h> class QWidget; class QHeader; @@ -11,19 +11,19 @@ class ScoreBoard : public QTable Q_OBJECT public: - ScoreBoard(QWidget *parent = 0, const char *name = 0); - int total(int id, QString &name); + ScoreBoard(TQWidget *parent = 0, const char *name = 0); + int total(int id, TQString &name); public slots: void newHole(int); - void newPlayer(const QString &name); + void newPlayer(const TQString &name); void setScore(int id, int hole, int score); void parChanged(int hole, int par); private: - QTable *table; - QHeader *vh; - QHeader *hh; + TQTable *table; + TQHeader *vh; + TQHeader *hh; }; #endif diff --git a/kolf/slope.cpp b/kolf/slope.cpp index e2becea1..a6a1abf1 100644 --- a/kolf/slope.cpp +++ b/kolf/slope.cpp @@ -1,9 +1,9 @@ -#include <qbitmap.h> -#include <qcheckbox.h> -#include <qlabel.h> -#include <qimage.h> -#include <qpixmapcache.h> -#include <qwhatsthis.h> +#include <tqbitmap.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqimage.h> +#include <tqpixmapcache.h> +#include <tqwhatsthis.h> #include <kapplication.h> #include <kcombobox.h> @@ -14,8 +14,8 @@ #include "slope.h" -Slope::Slope(QRect rect, QCanvas *canvas) - : QCanvasRectangle(rect, canvas), type(KImageEffect::VerticalGradient), grade(4), reversed(false), color(QColor("#327501")) +Slope::Slope(TQRect rect, TQCanvas *canvas) + : TQCanvasRectangle(rect, canvas), type(KImageEffect::VerticalGradient), grade(4), reversed(false), color(TQColor("#327501")) { stuckOnGround = false; showingInfo = false; @@ -34,17 +34,17 @@ Slope::Slope(QRect rect, QCanvas *canvas) setZ(-50); - if (!QPixmapCache::find("grass", grass)) + if (!TQPixmapCache::find("grass", grass)) { grass.load(locate("appdata", "pics/grass.png")); - QPixmapCache::insert("grass", grass); + TQPixmapCache::insert("grass", grass); } point = new RectPoint(color.light(), this, canvas); - QFont font(kapp->font()); + TQFont font(kapp->font()); font.setPixelSize(18); - text = new QCanvasText(canvas); + text = new TQCanvasText(canvas); text->setZ(99999.99); text->setFont(font); text->setColor(white); @@ -103,9 +103,9 @@ void Slope::clearArrows() arrows.setAutoDelete(false); } -QPtrList<QCanvasItem> Slope::moveableItems() const +TQPtrList<TQCanvasItem> Slope::moveableItems() const { - QPtrList<QCanvasItem> ret; + TQPtrList<TQCanvasItem> ret; ret.append(point); return ret; } @@ -128,7 +128,7 @@ void Slope::newSize(int width, int height) { if (type == KImageEffect::EllipticGradient) { - QCanvasRectangle::setSize(width, width); + TQCanvasRectangle::setSize(width, width); // move point back to good spot moveBy(0, 0); @@ -136,7 +136,7 @@ void Slope::newSize(int width, int height) game->updateHighlighter(); } else - QCanvasRectangle::setSize(width, height); + TQCanvasRectangle::setSize(width, height); updatePixmap(); updateZ(); @@ -144,7 +144,7 @@ void Slope::newSize(int width, int height) void Slope::moveBy(double dx, double dy) { - QCanvasRectangle::moveBy(dx, dy); + TQCanvasRectangle::moveBy(dx, dy); point->dontMove(); point->move(x() + width(), y() + height()); @@ -156,7 +156,7 @@ void Slope::moveBy(double dx, double dy) void Slope::moveArrow() { int xavg = 0, yavg = 0; - QPointArray r = areaPoints(); + TQPointArray r = areaPoints(); for (unsigned int i = 0; i < r.size(); ++i) { xavg += r[i].x(); @@ -183,14 +183,14 @@ void Slope::editModeChanged(bool changed) moveBy(0, 0); } -void Slope::updateZ(QCanvasRectangle *vStrut) +void Slope::updateZ(TQCanvasRectangle *vStrut) { const int area = (height() * width()); const int defaultz = -50; double newZ = 0; - QCanvasRectangle *rect = 0; + TQCanvasRectangle *rect = 0; if (!stuckOnGround) rect = vStrut? vStrut : onVStrut(); @@ -214,10 +214,10 @@ void Slope::load(KConfig *cfg) reversed = cfg->readBoolEntry("reversed", reversed); // bypass updatePixmap which newSize normally does - QCanvasRectangle::setSize(cfg->readNumEntry("width", width()), cfg->readNumEntry("height", height())); + TQCanvasRectangle::setSize(cfg->readNumEntry("width", width()), cfg->readNumEntry("height", height())); updateZ(); - QString gradientType = cfg->readEntry("gradient", gradientKeys[type]); + TQString gradientType = cfg->readEntry("gradient", gradientKeys[type]); setGradient(gradientType); } @@ -231,44 +231,44 @@ void Slope::save(KConfig *cfg) cfg->writeEntry("stuckOnGround", stuckOnGround); } -void Slope::draw(QPainter &painter) +void Slope::draw(TQPainter &painter) { painter.drawPixmap(x(), y(), pixmap); } -QPointArray Slope::areaPoints() const +TQPointArray Slope::areaPoints() const { switch (type) { case KImageEffect::CrossDiagonalGradient: { - QPointArray ret(3); - ret[0] = QPoint((int)x(), (int)y()); - ret[1] = QPoint((int)x() + width(), (int)y() + height()); - ret[2] = reversed? QPoint((int)x() + width(), y()) : QPoint((int)x(), (int)y() + height()); + TQPointArray ret(3); + ret[0] = TQPoint((int)x(), (int)y()); + ret[1] = TQPoint((int)x() + width(), (int)y() + height()); + ret[2] = reversed? TQPoint((int)x() + width(), y()) : TQPoint((int)x(), (int)y() + height()); return ret; } case KImageEffect::DiagonalGradient: { - QPointArray ret(3); - ret[0] = QPoint((int)x() + width(), (int)y()); - ret[1] = QPoint((int)x(), (int)y() + height()); - ret[2] = !reversed? QPoint((int)x() + width(), y() + height()) : QPoint((int)x(), (int)y()); + TQPointArray ret(3); + ret[0] = TQPoint((int)x() + width(), (int)y()); + ret[1] = TQPoint((int)x(), (int)y() + height()); + ret[2] = !reversed? TQPoint((int)x() + width(), y() + height()) : TQPoint((int)x(), (int)y()); return ret; } case KImageEffect::EllipticGradient: { - QPointArray ret; + TQPointArray ret; ret.makeEllipse((int)x(), (int)y(), width(), height()); return ret; } default: - return QCanvasRectangle::areaPoints(); + return TQCanvasRectangle::areaPoints(); } } @@ -290,8 +290,8 @@ bool Slope::collision(Ball *ball, long int /*id*/) slopeAngle = atan((double)width() / (double)height()); else if (circle) { - const QPoint start(x() + (int)width() / 2.0, y() + (int)height() / 2.0); - const QPoint end((int)ball->x(), (int)ball->y()); + const TQPoint start(x() + (int)width() / 2.0, y() + (int)height() / 2.0); + const TQPoint end((int)ball->x(), (int)ball->y()); Vector betweenVector(start, end); const double factor = betweenVector.magnitude() / ((double)width() / 2.0); @@ -339,9 +339,9 @@ bool Slope::collision(Ball *ball, long int /*id*/) return false; } -void Slope::setGradient(QString text) +void Slope::setGradient(TQString text) { - for (QMap<KImageEffect::GradientType, QString>::Iterator it = gradientKeys.begin(); it != gradientKeys.end(); ++it) + for (TQMap<KImageEffect::GradientType, TQString>::Iterator it = gradientKeys.begin(); it != gradientKeys.end(); ++it) { if (it.data() == text) { @@ -351,7 +351,7 @@ void Slope::setGradient(QString text) } // extra forgiveness ;-) (note it's i18n keys) - for (QMap<KImageEffect::GradientType, QString>::Iterator it = gradientI18nKeys.begin(); it != gradientI18nKeys.end(); ++it) + for (TQMap<KImageEffect::GradientType, TQString>::Iterator it = gradientI18nKeys.begin(); it != gradientI18nKeys.end(); ++it) { if (it.data() == text) { @@ -385,28 +385,28 @@ void Slope::updatePixmap() const bool diag = type == KImageEffect::DiagonalGradient || type == KImageEffect::CrossDiagonalGradient; const bool circle = type == KImageEffect::EllipticGradient; - const QColor darkColor = color.dark(100 + grade * (circle? 20 : 10)); - const QColor lightColor = diag || circle? color.light(110 + (diag? 5 : .5) * grade) : color; + const TQColor darkColor = color.dark(100 + grade * (circle? 20 : 10)); + const TQColor lightColor = diag || circle? color.light(110 + (diag? 5 : .5) * grade) : color; // hack only for circles const bool _reversed = circle? !reversed : reversed; - QImage gradientImage = KImageEffect::gradient(QSize(width(), height()), _reversed? darkColor : lightColor, _reversed? lightColor : darkColor, type); + TQImage gradientImage = KImageEffect::gradient(TQSize(width(), height()), _reversed? darkColor : lightColor, _reversed? lightColor : darkColor, type); - QPixmap qpixmap(width(), height()); - QPainter p(&qpixmap); - p.drawTiledPixmap(QRect(0, 0, width(), height()), grass); + TQPixmap qpixmap(width(), height()); + TQPainter p(&qpixmap); + p.drawTiledPixmap(TQRect(0, 0, width(), height()), grass); p.end(); const double length = sqrt(width() * width() + height() * height()) / 4; if (circle) { - const QColor otherLightColor = color.light(110 + 15 * grade); - const QColor otherDarkColor = darkColor.dark(110 + 20 * grade); - QImage otherGradientImage = KImageEffect::gradient(QSize(width(), height()), reversed? otherDarkColor : otherLightColor, reversed? otherLightColor : otherDarkColor, KImageEffect::DiagonalGradient); + const TQColor otherLightColor = color.light(110 + 15 * grade); + const TQColor otherDarkColor = darkColor.dark(110 + 20 * grade); + TQImage otherGradientImage = KImageEffect::gradient(TQSize(width(), height()), reversed? otherDarkColor : otherLightColor, reversed? otherLightColor : otherDarkColor, KImageEffect::DiagonalGradient); - QImage grassImage(qpixmap.convertToImage()); + TQImage grassImage(qpixmap.convertToImage()); - QImage finalGradientImage = KImageEffect::blend(otherGradientImage, gradientImage, .60); + TQImage finalGradientImage = KImageEffect::blend(otherGradientImage, gradientImage, .60); pixmap.convertFromImage(KImageEffect::blend(grassImage, finalGradientImage, .40)); // make arrows @@ -475,7 +475,7 @@ void Slope::updatePixmap() KPixmap kpixmap = qpixmap; (void) KPixmapEffect::intensity(kpixmap, ratio); - QImage grassImage(kpixmap.convertToImage()); + TQImage grassImage(kpixmap.convertToImage()); // okay, now we have a grass image that's // appropriately lit, and a gradient; @@ -488,20 +488,20 @@ void Slope::updatePixmap() arrows.append(arrow); } - text->setText(QString::number(grade)); + text->setText(TQString::number(grade)); if (diag || circle) { // make cleared bitmap - QBitmap bitmap(pixmap.width(), pixmap.height(), true); - QPainter bpainter(&bitmap); + TQBitmap bitmap(pixmap.width(), pixmap.height(), true); + TQPainter bpainter(&bitmap); bpainter.setBrush(color1); - QPointArray r = areaPoints(); + TQPointArray r = areaPoints(); // shift all the points for (unsigned int i = 0; i < r.count(); ++i) { - QPoint &p = r[i]; + TQPoint &p = r[i]; p.setX(p.x() - x()); p.setY(p.y() - y()); } @@ -517,15 +517,15 @@ void Slope::updatePixmap() ///////////////////////// -SlopeConfig::SlopeConfig(Slope *slope, QWidget *parent) +SlopeConfig::SlopeConfig(Slope *slope, TQWidget *parent) : Config(parent) { this->slope = slope; - QVBoxLayout *layout = new QVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); KComboBox *gradient = new KComboBox(this); - QStringList items; - QString curText; - for (QMap<KImageEffect::GradientType, QString>::Iterator it = slope->gradientI18nKeys.begin(); it != slope->gradientI18nKeys.end(); ++it) + TQStringList items; + TQString curText; + for (TQMap<KImageEffect::GradientType, TQString>::Iterator it = slope->gradientI18nKeys.begin(); it != slope->gradientI18nKeys.end(); ++it) { if (it.key() == slope->curType()) curText = it.data(); @@ -534,31 +534,31 @@ SlopeConfig::SlopeConfig(Slope *slope, QWidget *parent) gradient->insertStringList(items); gradient->setCurrentText(curText); layout->addWidget(gradient); - connect(gradient, SIGNAL(activated(const QString &)), this, SLOT(setGradient(const QString &))); + connect(gradient, TQT_SIGNAL(activated(const TQString &)), this, TQT_SLOT(setGradient(const TQString &))); layout->addStretch(); - QCheckBox *reversed = new QCheckBox(i18n("Reverse direction"), this); + TQCheckBox *reversed = new TQCheckBox(i18n("Reverse direction"), this); reversed->setChecked(slope->isReversed()); layout->addWidget(reversed); - connect(reversed, SIGNAL(toggled(bool)), this, SLOT(setReversed(bool))); + connect(reversed, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setReversed(bool))); - QHBoxLayout *hlayout = new QHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new QLabel(i18n("Grade:"), this)); + TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); + hlayout->addWidget(new TQLabel(i18n("Grade:"), this)); KDoubleNumInput *grade = new KDoubleNumInput(this); grade->setRange(0, 8, 1, true); grade->setValue(slope->curGrade()); hlayout->addWidget(grade); - connect(grade, SIGNAL(valueChanged(double)), this, SLOT(gradeChanged(double))); + connect(grade, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(gradeChanged(double))); - QCheckBox *stuck = new QCheckBox(i18n("Unmovable"), this); - QWhatsThis::add(stuck, i18n("Whether or not this slope can be moved by other objects, like floaters.")); + TQCheckBox *stuck = new TQCheckBox(i18n("Unmovable"), this); + TQWhatsThis::add(stuck, i18n("Whether or not this slope can be moved by other objects, like floaters.")); stuck->setChecked(slope->isStuckOnGround()); layout->addWidget(stuck); - connect(stuck, SIGNAL(toggled(bool)), this, SLOT(setStuckOnGround(bool))); + connect(stuck, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setStuckOnGround(bool))); } -void SlopeConfig::setGradient(const QString &text) +void SlopeConfig::setGradient(const TQString &text) { slope->setGradient(text); changed(); diff --git a/kolf/slope.h b/kolf/slope.h index d638354f..1bca5e5e 100644 --- a/kolf/slope.h +++ b/kolf/slope.h @@ -11,10 +11,10 @@ class SlopeConfig : public Config Q_OBJECT public: - SlopeConfig(Slope *slope, QWidget *parent); + SlopeConfig(Slope *slope, TQWidget *parent); private slots: - void setGradient(const QString &text); + void setGradient(const TQString &text); void setReversed(bool); void setStuckOnGround(bool); void gradeChanged(double); @@ -23,10 +23,10 @@ private: Slope *slope; }; -class Slope : public QCanvasRectangle, public CanvasItem, public RectItem +class Slope : public TQCanvasRectangle, public CanvasItem, public RectItem { public: - Slope(QRect rect, QCanvas *canvas); + Slope(TQRect rect, TQCanvas *canvas); virtual void aboutToDie(); virtual int rtti() const { return 1031; } @@ -34,22 +34,22 @@ public: virtual void hideInfo(); virtual void editModeChanged(bool changed); virtual bool canBeMovedByOthers() const { return !stuckOnGround; } - virtual QPtrList<QCanvasItem> moveableItems() const; - virtual Config *config(QWidget *parent) { return new SlopeConfig(this, parent); } + virtual TQPtrList<TQCanvasItem> moveableItems() const; + virtual Config *config(TQWidget *parent) { return new SlopeConfig(this, parent); } void setSize(int, int); virtual void newSize(int width, int height); virtual void moveBy(double dx, double dy); - virtual void draw(QPainter &painter); - virtual QPointArray areaPoints() const; + virtual void draw(TQPainter &painter); + virtual TQPointArray areaPoints() const; - void setGradient(QString text); + void setGradient(TQString text); KImageEffect::GradientType curType() const { return type; } void setGrade(double grade); double curGrade() const { return grade; } - void setColor(QColor color) { this->color = color; updatePixmap(); } + void setColor(TQColor color) { this->color = color; updatePixmap(); } void setReversed(bool reversed) { this->reversed = reversed; updatePixmap(); } bool isReversed() const { return reversed; } @@ -62,10 +62,10 @@ public: virtual bool collision(Ball *ball, long int id); virtual bool terrainCollisions() const; - QMap<KImageEffect::GradientType, QString> gradientI18nKeys; - QMap<KImageEffect::GradientType, QString> gradientKeys; + TQMap<KImageEffect::GradientType, TQString> gradientI18nKeys; + TQMap<KImageEffect::GradientType, TQString> gradientKeys; - virtual void updateZ(QCanvasRectangle *vStrut = 0); + virtual void updateZ(TQCanvasRectangle *vStrut = 0); void moveArrow(); @@ -75,16 +75,16 @@ private: bool showingInfo; double grade; bool reversed; - QColor color; - QPixmap pixmap; + TQColor color; + TQPixmap pixmap; void updatePixmap(); bool stuckOnGround; - QPixmap grass; + TQPixmap grass; void clearArrows(); - QPtrList<Arrow> arrows; - QCanvasText *text; + TQPtrList<Arrow> arrows; + TQCanvasText *text; RectPoint *point; }; @@ -92,7 +92,7 @@ class SlopeObj : public Object { public: SlopeObj() { m_name = i18n("Slope"); m__name = "slope"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Slope(QRect(0, 0, 40, 40), canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Slope(TQRect(0, 0, 40, 40), canvas); } }; #endif diff --git a/kolf/statedb.h b/kolf/statedb.h index 522d147f..397eb588 100644 --- a/kolf/statedb.h +++ b/kolf/statedb.h @@ -1,23 +1,23 @@ #ifndef KOLF_STATEDB_H #define KOLF_STATEDB_H -#include <qmap.h> -#include <qstring.h> -#include <qpoint.h> +#include <tqmap.h> +#include <tqstring.h> +#include <tqpoint.h> // items can save their per-game states here // most don't have to do anything class StateDB { public: - void setPoint(const QPoint &point) { points[curName] = point; } - QPoint point() { return points[curName]; } - void setName(const QString &name) { curName = name; } + void setPoint(const TQPoint &point) { points[curName] = point; } + TQPoint point() { return points[curName]; } + void setName(const TQString &name) { curName = name; } void clear() { points.clear(); } private: - QMap<QString, QPoint> points; - QString curName; + TQMap<TQString, TQPoint> points; + TQString curName; }; #endif diff --git a/kolf/vector.cpp b/kolf/vector.cpp index f4c05262..0a3458b9 100644 --- a/kolf/vector.cpp +++ b/kolf/vector.cpp @@ -5,7 +5,7 @@ // this and vector.h by Ryan Cummings // Creates a vector with between two points -Vector::Vector(const QPoint &source, const QPoint &dest) { +Vector::Vector(const TQPoint &source, const TQPoint &dest) { _magnitude = sqrt(pow(source.x() - dest.x(), 2) + pow(source.y() - dest.y(), 2)); _direction = atan2(source.y() - dest.y(), source.x() - dest.x()); } @@ -94,12 +94,12 @@ void Vector::setComponents(double x, double y) { _magnitude = sqrt((x * x) + (y * y)); } -void debugPoint(const QString &text, const Point &p) +void debugPoint(const TQString &text, const Point &p) { kdDebug(12007) << text << " (" << p.x << ", " << p.y << ")" << endl; } -void debugVector(const QString &text, const Vector &p) +void debugVector(const TQString &text, const Vector &p) { // debug degrees kdDebug(12007) << text << " (magnitude: " << p.magnitude() << ", direction: " << p.direction() << ", direction (deg): " << (360L / (2L * M_PI)) * p.direction() << ")" << endl; diff --git a/kolf/vector.h b/kolf/vector.h index 1da7328b..bca39c0c 100644 --- a/kolf/vector.h +++ b/kolf/vector.h @@ -3,7 +3,7 @@ #include <math.h> -#include <qpoint.h> +#include <tqpoint.h> class Point { @@ -24,7 +24,7 @@ public: double y; }; -void debugPoint(const QString &, const Point &); +void debugPoint(const TQString &, const Point &); // This and vector.cpp by Ryan Cummings @@ -33,7 +33,7 @@ class Vector { public: // Normal constructors Vector(double magnitude, double direction) { _magnitude = magnitude; _direction = direction; } - Vector(const QPoint& source, const QPoint& dest); + Vector(const TQPoint& source, const TQPoint& dest); Vector(const Point& source, const Point& dest); Vector(); @@ -87,6 +87,6 @@ class Vector { double _direction; }; -void debugVector(const QString &, const Vector &); +void debugVector(const TQString &, const Vector &); #endif diff --git a/konquest/Konquest.cc b/konquest/Konquest.cc index 90a6b6c6..da6275c4 100644 --- a/konquest/Konquest.cc +++ b/konquest/Konquest.cc @@ -19,7 +19,7 @@ main(int argc, char **argv) KCmdLineArgs::init( argc, argv, &aboutData ); KApplication a; - QApplication::setGlobalMouseTracking( true ); + TQApplication::setGlobalMouseTracking( true ); KGlobal::locale()->insertCatalogue("libkdegames"); if (a.isRestored()) diff --git a/konquest/fleetdlg.cc b/konquest/fleetdlg.cc index 0117f74d..1c7e3fdf 100644 --- a/konquest/fleetdlg.cc +++ b/konquest/fleetdlg.cc @@ -1,4 +1,4 @@ -#include <qlayout.h> +#include <tqlayout.h> #include <kapplication.h> #include <klocale.h> #include <math.h> @@ -8,11 +8,11 @@ #include "fleetdlg.h" -FleetDlgListViewItem::FleetDlgListViewItem(QListView *parent, QString s1, QString s2, QString s3, QString s4, QString s5) : QListViewItem(parent, s1, s2, s3, s4, s5) +FleetDlgListViewItem::FleetDlgListViewItem(TQListView *parent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5) : TQListViewItem(parent, s1, s2, s3, s4, s5) { } -int FleetDlgListViewItem::compare(QListViewItem *i, int col, bool) const +int FleetDlgListViewItem::compare(TQListViewItem *i, int col, bool) const { if (col == 1) { @@ -35,8 +35,8 @@ int FleetDlgListViewItem::compare(QListViewItem *i, int col, bool) const } -FleetDlg::FleetDlg( QWidget *parent, AttackFleetList *fleets ) - : QDialog(parent, "FleetDlg", true ), fleetList(fleets) +FleetDlg::FleetDlg( TQWidget *parent, AttackFleetList *fleets ) + : TQDialog(parent, "FleetDlg", true ), fleetList(fleets) { setCaption( kapp->makeStdCaption(i18n("Fleet Overview")) ); @@ -52,8 +52,8 @@ FleetDlg::FleetDlg( QWidget *parent, AttackFleetList *fleets ) okButton->setMinimumSize( okButton->sizeHint() ); okButton->setDefault(true); - QVBoxLayout *layout1 = new QVBoxLayout( this ); - QHBoxLayout *layout2 = new QHBoxLayout; + TQVBoxLayout *layout1 = new TQVBoxLayout( this ); + TQHBoxLayout *layout2 = new QHBoxLayout; layout1->addWidget( fleetTable, 1 ); layout1->addLayout( layout2 ); @@ -62,7 +62,7 @@ FleetDlg::FleetDlg( QWidget *parent, AttackFleetList *fleets ) layout2->addWidget( okButton ); layout2->addStretch( 2 ); - connect( okButton, SIGNAL(clicked()), this, SLOT(accept()) ); + connect( okButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()) ); init(); @@ -79,10 +79,10 @@ FleetDlg::init() while( (curFleet = nextFleet())) { fleetNumber++; new FleetDlgListViewItem(fleetTable, - QString("%1").arg(fleetNumber), + TQString("%1").arg(fleetNumber), curFleet->destination->getName(), - QString("%1").arg(curFleet->getShipCount()), - QString("%1").arg(KGlobal::locale()->formatNumber(curFleet->killPercentage, 3)), - QString("%1").arg((int)ceil(curFleet->arrivalTurn))); + TQString("%1").arg(curFleet->getShipCount()), + TQString("%1").arg(KGlobal::locale()->formatNumber(curFleet->killPercentage, 3)), + TQString("%1").arg((int)ceil(curFleet->arrivalTurn))); } } diff --git a/konquest/fleetdlg.h b/konquest/fleetdlg.h index abab1957..7937f69e 100644 --- a/konquest/fleetdlg.h +++ b/konquest/fleetdlg.h @@ -3,27 +3,27 @@ #include <klistview.h> -#include <qdialog.h> +#include <tqdialog.h> #include "gamecore.h" class FleetDlgListViewItem : public QListViewItem { public: - FleetDlgListViewItem(QListView *parent, QString s1, QString s2, QString s3, QString s4, QString s5); - int compare(QListViewItem *i, int col, bool) const; + FleetDlgListViewItem(TQListView *parent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5); + int compare(TQListViewItem *i, int col, bool) const; }; -class FleetDlg : public QDialog { +class FleetDlg : public TQDialog { public: - FleetDlg( QWidget *parent, AttackFleetList *fleets ); + FleetDlg( TQWidget *parent, AttackFleetList *fleets ); private: void init(); AttackFleetList *fleetList; - QListView *fleetTable; + TQListView *fleetTable; }; #endif diff --git a/konquest/gameboard.cc b/konquest/gameboard.cc index 75e440d7..47f77faa 100644 --- a/konquest/gameboard.cc +++ b/konquest/gameboard.cc @@ -1,14 +1,14 @@ -#include <qlayout.h> -#include <qcolor.h> -#include <qlabel.h> -#include <qslider.h> -#include <qevent.h> -#include <qkeycode.h> -#include <qlistbox.h> -#include <qpushbutton.h> -#include <qlineedit.h> -#include <qvalidator.h> -#include <qtextedit.h> +#include <tqlayout.h> +#include <tqcolor.h> +#include <tqlabel.h> +#include <tqslider.h> +#include <tqevent.h> +#include <tqkeycode.h> +#include <tqlistbox.h> +#include <tqpushbutton.h> +#include <tqlineedit.h> +#include <tqvalidator.h> +#include <tqtextedit.h> #include <kapplication.h> #include <klocale.h> @@ -33,11 +33,11 @@ /********************************************************************* Game Board *********************************************************************/ -GameBoard::GameBoard( QWidget *parent ) - : QWidget( parent ), gameInProgress( false ), gameState( NONE ) +GameBoard::GameBoard( TQWidget *parent ) + : TQWidget( parent ), gameInProgress( false ), gameState( NONE ) { - QColorGroup cg( white, black, green.light(), green.dark(), green, green.dark(75), green.dark() ); - QPalette palette( cg, cg, cg ); + TQColorGroup cg( white, black, green.light(), green.dark(), green, green.dark(75), green.dark() ); + TQPalette palette( cg, cg, cg ); neutralPlayer = Player::createNeutralPlayer(); map = new Map; @@ -49,34 +49,34 @@ GameBoard::GameBoard( QWidget *parent ) // Create the widgets in the main window //******************************************************************** mapWidget = new ConquestMap( map, this ); - msgWidget = new QTextEdit( this ); + msgWidget = new TQTextEdit( this ); msgWidget->setTextFormat(LogText); msgWidget->setMinimumHeight(100); - msgWidget->setHScrollBarMode(QScrollView::AlwaysOff); - msgWidget->setPaper(QBrush(Qt::black)); + msgWidget->setHScrollBarMode(TQScrollView::AlwaysOff); + msgWidget->setPaper(TQBrush(Qt::black)); planetInfo = new PlanetInfo( this, palette ); - gameMessage = new QLabel( this ); + gameMessage = new TQLabel( this ); gameMessage->setPalette( palette ); - turnCounter = new QLabel( this ); + turnCounter = new TQLabel( this ); turnCounter->setPalette( palette ); turnCounter->setText( "Turn" ); turnCounter->setMaximumHeight( turnCounter->sizeHint().height() ); - endTurn = new QPushButton( i18n("End Turn"), this ); + endTurn = new TQPushButton( i18n("End Turn"), this ); endTurn->setFixedSize( endTurn->sizeHint() ); endTurn->setPalette( palette ); - shipCountEdit = new QLineEdit( this ); + shipCountEdit = new TQLineEdit( this ); IntValidator *v = new IntValidator( 1, 32767, this ); shipCountEdit->setValidator( v ); shipCountEdit->setMinimumSize( 40, 0 ); shipCountEdit->setMaximumSize( 32767, 40 ); shipCountEdit->setEnabled(false); shipCountEdit->setPalette( palette ); - shipCountEdit->setEchoMode( QLineEdit::Password ); + shipCountEdit->setEchoMode( TQLineEdit::Password ); - splashScreen = new QLabel( this ); - splashScreen->setPixmap(QPixmap(IMAGE_SPLASH)); + splashScreen = new TQLabel( this ); + splashScreen->setPixmap(TQPixmap(IMAGE_SPLASH)); splashScreen->setGeometry( 0, 0, 600, 550 ); setMinimumSize( 600, 600 ); @@ -88,10 +88,10 @@ GameBoard::GameBoard( QWidget *parent ) //******************************************************************** // Layout the main window //******************************************************************** - QHBoxLayout *layout1 = new QHBoxLayout( this ); - QVBoxLayout *layout2 = new QVBoxLayout; - QHBoxLayout *layout3 = new QHBoxLayout; - QVBoxLayout *layout4 = new QVBoxLayout; + TQHBoxLayout *layout1 = new TQHBoxLayout( this ); + TQVBoxLayout *layout2 = new QVBoxLayout; + TQHBoxLayout *layout3 = new QHBoxLayout; + TQVBoxLayout *layout4 = new QVBoxLayout; layout1->addLayout( layout2 ); layout2->addLayout( layout3 ); @@ -119,10 +119,10 @@ GameBoard::GameBoard( QWidget *parent ) //********************************************************************** // Set up signal/slot connections //********************************************************************** - connect( mapWidget, SIGNAL( planetSelected(Planet *) ), this, SLOT(planetSelected(Planet *)) ); - connect( shipCountEdit, SIGNAL(returnPressed()), this, SLOT(newShipCount()) ); - connect( endTurn, SIGNAL( clicked() ), this, SLOT( nextPlayer() ) ); - connect( mapWidget, SIGNAL( planetHighlighted(Planet *)), planetInfo, SLOT(showPlanet(Planet *)) ); + connect( mapWidget, TQT_SIGNAL( planetSelected(Planet *) ), this, TQT_SLOT(planetSelected(Planet *)) ); + connect( shipCountEdit, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(newShipCount()) ); + connect( endTurn, TQT_SIGNAL( clicked() ), this, TQT_SLOT( nextPlayer() ) ); + connect( mapWidget, TQT_SIGNAL( planetHighlighted(Planet *)), planetInfo, TQT_SLOT(showPlanet(Planet *)) ); changeGameBoard( false ); } @@ -137,9 +137,9 @@ GameBoard::~GameBoard() } #if 0 -QSize GameBoard::sizeHint() const +TQSize GameBoard::sizeHint() const { - return QSize( 600, 550 ); + return TQSize( 600, 550 ); } #endif @@ -147,7 +147,7 @@ QSize GameBoard::sizeHint() const // Keyboard Event handlers //************************************************************************ void -GameBoard::keyPressEvent( QKeyEvent *e ) +GameBoard::keyPressEvent( TQKeyEvent *e ) { // Check for the escape key if( e->key() == Key_Escape ) { @@ -173,7 +173,7 @@ GameBoard::keyPressEvent( QKeyEvent *e ) } PlanetListIterator planetSearch( planets ); - QString planetName; + TQString planetName; planetName += toupper( e->ascii() ); @@ -312,7 +312,7 @@ GameBoard::turn() CoreLogic cl; double dist = cl.distance( sourcePlanet, destPlanet ); - QString msg; + TQString msg; msg = i18n("The distance from Planet %1 to Planet %2 is %3 light years.\n" "A ship leaving this turn will arrive on turn %4") .arg(sourcePlanet->getName()) @@ -430,7 +430,7 @@ GameBoard::turn() break; } - QString turnStr; + TQString turnStr; turnStr = i18n("Turn #: %1 of %2").arg(turnNumber).arg(lastTurn); turnCounter->setText( turnStr ); @@ -553,13 +553,13 @@ GameBoard::findWinner() } void -GameBoard::gameMsg(const QString &msg, Player *player, Planet *planet, Player *planetPlayer) +GameBoard::gameMsg(const TQString &msg, Player *player, Planet *planet, Player *planetPlayer) { bool isHumanInvolved = false; - QString color = "white"; - QString colorMsg = msg; - QString plainMsg = msg; + TQString color = "white"; + TQString colorMsg = msg; + TQString plainMsg = msg; if (player) { @@ -576,8 +576,8 @@ GameBoard::gameMsg(const QString &msg, Player *player, Planet *planet, Player *p if (!planetPlayer->isAiPlayer() && !planetPlayer->isNeutral()) isHumanInvolved = true; - QString color = planetPlayer->getColor().name(); - colorMsg = colorMsg.arg(QString("<font color=\"%1\">%2</font>").arg(color, planet->getName())); + TQString color = planetPlayer->getColor().name(); + colorMsg = colorMsg.arg(TQString("<font color=\"%1\">%2</font>").arg(color, planet->getName())); plainMsg = plainMsg.arg(planet->getName()); } msgWidget->append(("<qt><font color=\"white\">Turn %1:</font> <font color=\""+color+"\">").arg(turnNumber)+colorMsg+"</font></qt>"); @@ -627,7 +627,7 @@ GameBoard::scanForSurvivors() while( (plr = nextActivePlayer()) ) { if( !plr->isInPlay() ) { // Player has bitten the dust - QString msg; + TQString msg; msg = i18n("The once mighty empire of %1 has fallen in ruins."); gameMsg(msg, plr); } @@ -637,7 +637,7 @@ GameBoard::scanForSurvivors() while( (plr = nextInactivePlayer()) ) { if( plr->isInPlay() ) { // Player has bitten the dust - QString msg; + TQString msg; msg = i18n("The fallen empire of %1 has staggered back to life."); gameMsg(msg, plr); } @@ -658,7 +658,7 @@ GameBoard::doFleetArrival( AttackFleet *arrivingFleet ) if (!arrivingFleet->owner->isAiPlayer()) { arrivingFleet->destination->getFleet().absorb(arrivingFleet); - QString msg; + TQString msg; msg = i18n("Reinforcements (%1 ships) have arrived for planet %2.") .arg(arrivingFleet->getShipCount()); gameMsg(msg, 0, arrivingFleet->destination); @@ -702,7 +702,7 @@ GameBoard::doFleetArrival( AttackFleet *arrivingFleet ) if( planetHolds ) { prizePlanet.getPlayer()->statEnemyFleetsDestroyed(1); - QString msg; + TQString msg; msg = i18n("Planet %2 has held against an attack from %1."); gameMsg(msg, attacker.owner, &prizePlanet); } else { @@ -711,7 +711,7 @@ GameBoard::doFleetArrival( AttackFleet *arrivingFleet ) arrivingFleet->destination->conquer( arrivingFleet ); - QString msg; + TQString msg; msg = i18n("Planet %2 has fallen to %1."); gameMsg(msg, attacker.owner, &prizePlanet, defender); } @@ -865,7 +865,7 @@ GameBoard::planetSelected( Planet *planet ) void GameBoard::newShipCount() { - QString temp( shipCountEdit->text() ); + TQString temp( shipCountEdit->text() ); bool ok; switch( gameState ) { diff --git a/konquest/gameboard.h b/konquest/gameboard.h index 5e3cddfa..4b30b0b1 100644 --- a/konquest/gameboard.h +++ b/konquest/gameboard.h @@ -1,7 +1,7 @@ #ifndef _GAMEBOARD_H_ #define _GAMEBOARD_H_ -#include <qwidget.h> +#include <tqwidget.h> #include "planet_info.h" #include "map_widget.h" @@ -26,12 +26,12 @@ class GameBoard : public QWidget Q_OBJECT public: - GameBoard( QWidget *parent ); + GameBoard( TQWidget *parent ); virtual ~GameBoard(); bool isGameInProgress(void) const { return gameInProgress; } -// virtual QSize sizeHint() const; +// virtual TQSize sizeHint() const; protected slots: void startNewGame(); @@ -54,7 +54,7 @@ signals: // Event Handlers //*************************************************************** protected: - virtual void keyPressEvent( QKeyEvent * ); + virtual void keyPressEvent( TQKeyEvent * ); private: void turn(); @@ -66,13 +66,13 @@ private: void doFleetArrival( AttackFleet *arrivingFleet ); void scanForSurvivors(); - void gameMsg(const QString &msg, Player *player = 0, Planet *planet = 0, Player *planetPlayer = 0); + void gameMsg(const TQString &msg, Player *player = 0, Planet *planet = 0, Player *planetPlayer = 0); void changeGameBoard( bool inPlay ); void cleanupGame(); Player *findWinner(); - QString playerString(Player *player = 0); + TQString playerString(Player *player = 0); //*************************************************************** // Game State information @@ -86,12 +86,12 @@ private: //*************************************************************** ConquestMap *mapWidget; PlanetInfo *planetInfo; - QLabel *gameMessage; - QLabel *turnCounter; - QPushButton *endTurn; - QLineEdit *shipCountEdit; - QLabel *splashScreen; - QTextEdit *msgWidget; + TQLabel *gameMessage; + TQLabel *turnCounter; + TQPushButton *endTurn; + TQLineEdit *shipCountEdit; + TQLabel *splashScreen; + TQTextEdit *msgWidget; //*************************************************************** diff --git a/konquest/gamecore.cc b/konquest/gamecore.cc index 843c1a92..3706cf68 100644 --- a/konquest/gamecore.cc +++ b/konquest/gamecore.cc @@ -68,7 +68,7 @@ CoreLogic::roll() Map::Map() - : QObject( 0, 0 ), freezeUpdates( false ), + : TQObject( 0, 0 ), freezeUpdates( false ), rows( BOARD_ROWS ), columns( BOARD_COLS ), hasSelectedSector( false ) { @@ -78,7 +78,7 @@ Map::Map() for( int y = 0; y < columns; y++ ) { grid[x][y] = Sector( this, x, y ); - connect( &grid[x][y], SIGNAL( update() ), this, SLOT( childSectorUpdate() )); + connect( &grid[x][y], TQT_SIGNAL( update() ), this, TQT_SLOT( childSectorUpdate() )); } } } @@ -94,13 +94,13 @@ Map::populateMap( PlayerList &players, Player *neutral, Freeze(); int index = 0; - QString names( "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*(),.<>;:[]{}/?-+\\|" ); + TQString names( "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*(),.<>;:[]{}/?-+\\|" ); // Create a planet for each player Player *plr; for( plr = players.first(); plr != 0; plr = players.next() ) { - QString newName( names.mid( index++, 1 ) ); + TQString newName( names.mid( index++, 1 ) ); Sector § = findRandomFreeSector(); Planet *plrPlanet = Planet::createPlayerPlanet( sect, plr, newName ); @@ -109,7 +109,7 @@ Map::populateMap( PlayerList &players, Player *neutral, for( int x = 0; x < numNeutralPlanets; x++ ) { - QString newName( names.mid( index++, 1 ) ); + TQString newName( names.mid( index++, 1 ) ); Sector § = findRandomFreeSector(); Planet *neutralPlanet = Planet::createNeutralPlanet( sect, neutral, newName ); @@ -242,16 +242,16 @@ const int Map::getColumns() const //--------------------------------------------------------------------------- Sector::Sector() -: QObject(0,0), planet( NULL ), parentMap(NULL ), x(0), y(0) +: TQObject(0,0), planet( NULL ), parentMap(NULL ), x(0), y(0) {} Sector::Sector( Map *newParentMap, int xPos, int yPos ) -: QObject(0,0), planet(NULL), parentMap( newParentMap ), x(xPos), y(yPos) +: TQObject(0,0), planet(NULL), parentMap( newParentMap ), x(xPos), y(yPos) { } Sector::Sector( const Sector & other ) -: QObject(0,0), planet(other.planet), parentMap(other.parentMap), x(other.x), y(other.y) +: TQObject(0,0), planet(other.planet), parentMap(other.parentMap), x(other.x), y(other.y) { } @@ -265,7 +265,7 @@ void Sector::setPlanet( Planet *newPlanet ) { planet = newPlanet; - connect( planet, SIGNAL( update() ), this, SLOT( childPlanetUpdate() ) ); + connect( planet, TQT_SIGNAL( update() ), this, TQT_SLOT( childPlanetUpdate() ) ); emit update(); } @@ -320,9 +320,9 @@ int Sector::getColumn() // class Planet //--------------------------------------------------------------------------- -Planet::Planet( QString planetName, Sector &newParentSector, Player *initialOwner, +Planet::Planet( TQString planetName, Sector &newParentSector, Player *initialOwner, int newProd, double newKillP, double newMorale ) - : QObject(0,0), name(planetName), owner(initialOwner), parentSector(newParentSector), + : TQObject(0,0), name(planetName), owner(initialOwner), parentSector(newParentSector), homeFleet( this, newProd ), killPercentage(newKillP), morale( newMorale ), productionRate(newProd) @@ -333,7 +333,7 @@ Planet::Planet( QString planetName, Sector &newParentSector, Player *initialOwne Planet::~Planet() {} Planet * -Planet::createPlayerPlanet( Sector &parentSector, Player *initialOwner, QString planetName ) +Planet::createPlayerPlanet( Sector &parentSector, Player *initialOwner, TQString planetName ) { CoreLogic clogic; @@ -344,7 +344,7 @@ Planet::createPlayerPlanet( Sector &parentSector, Player *initialOwner, QString } Planet * -Planet::createNeutralPlanet( Sector &parentSector, Player *initialOwner, QString planetName ) +Planet::createNeutralPlanet( Sector &parentSector, Player *initialOwner, TQString planetName ) { CoreLogic clogic; double morale = clogic.generateMorale(); @@ -414,7 +414,7 @@ Planet::getPlayer() const return owner; } -const QString & +const TQString & Planet::getName() const { return name; @@ -454,7 +454,7 @@ Planet::turn() //--------------------------------------------------------------------------- // class Player //--------------------------------------------------------------------------- -Player::Player( QString newName, QColor newColor, int newPlrNum, bool isAi ) : name( newName ), color( newColor ), +Player::Player( TQString newName, TQColor newColor, int newPlrNum, bool isAi ) : name( newName ), color( newColor ), playerNum( newPlrNum ), inPlay( true ), aiPlayer( isAi ), shipsBuilt(0), planetsConquered(0), fleetsLaunched(0), enemyFleetsDestroyed(0), enemyShipsDestroyed(0) { @@ -473,7 +473,7 @@ Player::operator==( const Player &otherPlayer ) const return false; } -QString & +TQString & Player::getName() { return name; @@ -482,20 +482,20 @@ Player::getName() QString Player::getColoredName() { - return QString("<font color=\"%1\">%2</font>").arg(color.name(), name); + return TQString("<font color=\"%1\">%2</font>").arg(color.name(), name); } -Player *Player::createPlayer( QString newName, QColor color, int playerNum, bool isAi ) +Player *Player::createPlayer( TQString newName, TQColor color, int playerNum, bool isAi ) { return new Player( newName, color, playerNum, isAi ); } Player *Player::createNeutralPlayer() { - return new Player( QString::null, gray, NEUTRAL_PLAYER_NUMBER, false ); + return new Player( TQString::null, gray, NEUTRAL_PLAYER_NUMBER, false ); } -QColor &Player::getColor() +TQColor &Player::getColor() { return color; } diff --git a/konquest/gamecore.h b/konquest/gamecore.h index c8c7c39a..03683a08 100644 --- a/konquest/gamecore.h +++ b/konquest/gamecore.h @@ -3,10 +3,10 @@ #include <krandomsequence.h> -#include <qobject.h> -#include <qstring.h> -#include <qcolor.h> -#include <qptrlist.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqcolor.h> +#include <tqptrlist.h> // Board Size Constants #define BOARD_ROWS 16 @@ -111,20 +111,20 @@ class Player : public QObject { public: - Player( QString newName, QColor color, int number, bool isAi ); + Player( TQString newName, TQColor color, int number, bool isAi ); virtual ~Player(); enum { NEUTRAL_PLAYER_NUMBER = -1 }; public: - QString &getName(); - QString getColoredName(); - QColor &getColor(); + TQString &getName(); + TQString getColoredName(); + TQColor &getColor(); bool isNeutral(); - QPtrList<AttackFleet> &getAttackList(); + TQPtrList<AttackFleet> &getAttackList(); // factory functions - static Player *createPlayer( QString newName, QColor newColor, int playerNum, bool isAi ); + static Player *createPlayer( TQString newName, TQColor newColor, int playerNum, bool isAi ); static Player *createNeutralPlayer(); bool NewAttack( Planet *sourcePlanet, Planet *destPlanet, int shipCount, int departureTurn ); @@ -135,13 +135,13 @@ public: void setInPlay( bool ); private: - QString name; - QColor color; + TQString name; + TQColor color; int playerNum; bool inPlay; bool aiPlayer; - QPtrList<AttackFleet> attackList; + TQPtrList<AttackFleet> attackList; // statistics counters int shipsBuilt; @@ -177,7 +177,7 @@ class Planet : public QObject private: - Planet( QString planetName, Sector &newParentSector, + Planet( TQString planetName, Sector &newParentSector, Player *initialOwner, int newProd, double newKillP, double newMorale ); @@ -185,13 +185,13 @@ public: virtual ~Planet(); static Planet *createPlayerPlanet( Sector &parentSector, - Player *initialOwner, QString planetName ); + Player *initialOwner, TQString planetName ); static Planet *createNeutralPlanet( Sector &parentSector, - Player *initialOwner, QString planetName ); + Player *initialOwner, TQString planetName ); Sector &getSector() const; Player *getPlayer() const; - const QString &getName() const; + const TQString &getName() const; DefenseFleet &getFleet(); double getKillPercentage(); @@ -211,7 +211,7 @@ signals: void selected(); private: - QString name; + TQString name; Player *owner; Sector &parentSector; DefenseFleet homeFleet; @@ -279,8 +279,8 @@ public: const int getRows() const; const int getColumns() const; - void populateMap( QPtrList<Player> &players, Player *neutral, - int numNeutralPlanets, QPtrList<Planet> &thePlanets ); + void populateMap( TQPtrList<Player> &players, Player *neutral, + int numNeutralPlanets, TQPtrList<Planet> &thePlanets ); void clearMap(); bool selectedSector( int &x, int &y ) const; @@ -318,13 +318,13 @@ protected: //--------------------------------------------------------------------------------- // Typedefs //--------------------------------------------------------------------------------- -typedef QPoint Coordinate; // Gotta start using this instead of int x,y crap -typedef QPtrList<AttackFleet> AttackFleetList; -typedef QPtrListIterator<AttackFleet> AttackFleetListIterator; -typedef QPtrList<Player> PlayerList; -typedef QPtrList<Planet> PlanetList; -typedef QPtrListIterator<Player> PlayerListIterator; -typedef QPtrListIterator<Planet> PlanetListIterator; +typedef TQPoint Coordinate; // Gotta start using this instead of int x,y crap +typedef TQPtrList<AttackFleet> AttackFleetList; +typedef TQPtrListIterator<AttackFleet> AttackFleetListIterator; +typedef TQPtrList<Player> PlayerList; +typedef TQPtrList<Planet> PlanetList; +typedef TQPtrListIterator<Player> PlayerListIterator; +typedef TQPtrListIterator<Planet> PlanetListIterator; #endif // _GAMECORE_H_ diff --git a/konquest/gameenddlg.cc b/konquest/gameenddlg.cc index 080a8477..2295acd9 100644 --- a/konquest/gameenddlg.cc +++ b/konquest/gameenddlg.cc @@ -1,7 +1,7 @@ -#include <qlabel.h> -#include <qlayout.h> -#include <qslider.h> -#include <qvbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqslider.h> +#include <tqvbox.h> #include <kapplication.h> #include <kconfig.h> @@ -11,23 +11,23 @@ #include "gameenddlg.h" #include "gameenddlg.moc" -GameEndDlg::GameEndDlg( QWidget *parent ) +GameEndDlg::GameEndDlg( TQWidget *parent ) : KDialogBase( i18n("Out of Turns"), KDialogBase::Yes|KDialogBase::No, KDialogBase::Yes, KDialogBase::No, parent, "end_game_dialog", true, true ) { - QVBox *page = makeVBoxMainWidget(); + TQVBox *page = makeVBoxMainWidget(); // Create controls - QLabel *label1 = new QLabel( i18n("This is the last turn.\nDo you wish to add extra turns?")+"\n\n", page ); + TQLabel *label1 = new TQLabel( i18n("This is the last turn.\nDo you wish to add extra turns?")+"\n\n", page ); label1->setAlignment( AlignCenter ); - turnCountLbl = new QLabel( page ); - turnCount = new QSlider( 1, 40, 1, 5, Qt::Horizontal, page ); + turnCountLbl = new TQLabel( page ); + turnCount = new TQSlider( 1, 40, 1, 5, Qt::Horizontal, page ); - KGuiItem addTurns(i18n("&Add Turns"), QString::null, QString::null, + KGuiItem addTurns(i18n("&Add Turns"), TQString::null, TQString::null, i18n("Add the specified number of turns to the game and continue playing.")); - KGuiItem gameOver(i18n("&Game Over"), QString::null, QString::null, + KGuiItem gameOver(i18n("&Game Over"), TQString::null, TQString::null, i18n("Terminate the current game.")); setButtonGuiItem(KDialogBase::Yes, addTurns); @@ -35,7 +35,7 @@ GameEndDlg::GameEndDlg( QWidget *parent ) init(); - connect( turnCount, SIGNAL(valueChanged( int )), this, SLOT(turnCountChange( int )) ); + connect( turnCount, TQT_SIGNAL(valueChanged( int )), this, TQT_SLOT(turnCountChange( int )) ); } GameEndDlg::~GameEndDlg() @@ -71,6 +71,6 @@ GameEndDlg::extraTurns() void GameEndDlg::turnCountChange( int newTurnCount ) { - QString newLbl = i18n("Extra turns: %1").arg( newTurnCount ); + TQString newLbl = i18n("Extra turns: %1").arg( newTurnCount ); turnCountLbl->setText( newLbl); } diff --git a/konquest/gameenddlg.h b/konquest/gameenddlg.h index d1c982e3..975bc830 100644 --- a/konquest/gameenddlg.h +++ b/konquest/gameenddlg.h @@ -11,7 +11,7 @@ class GameEndDlg : public KDialogBase Q_OBJECT public: - GameEndDlg( QWidget *parent ); + GameEndDlg( TQWidget *parent ); virtual ~GameEndDlg(); int extraTurns(); @@ -24,8 +24,8 @@ private slots: void slotYes(); private: - QSlider *turnCount; - QLabel *turnCountLbl; + TQSlider *turnCount; + TQLabel *turnCountLbl; }; #endif // _GAMEENDDLG_H_ diff --git a/konquest/int_validator.cc b/konquest/int_validator.cc index 85fd1779..12f707c6 100644 --- a/konquest/int_validator.cc +++ b/konquest/int_validator.cc @@ -3,8 +3,8 @@ #include "int_validator.h" #include "int_validator.moc" -IntValidator::IntValidator( QWidget *parent, const char *name ) : - QValidator( parent, name ) +IntValidator::IntValidator( TQWidget *parent, const char *name ) : + TQValidator( parent, name ) { #ifdef INT_MIN v_bottom = INT_MIN; @@ -14,8 +14,8 @@ IntValidator::IntValidator( QWidget *parent, const char *name ) : v_top = INT_MIN; } -IntValidator::IntValidator( int bottom, int top, QWidget *parent, const char *name ) : -QValidator( parent, name ) +IntValidator::IntValidator( int bottom, int top, TQWidget *parent, const char *name ) : +TQValidator( parent, name ) { v_bottom = bottom; v_top = top; @@ -23,23 +23,23 @@ QValidator( parent, name ) IntValidator::~IntValidator() {} -QValidator::State -IntValidator::validate( QString &input, int & ) const +TQValidator::State +IntValidator::validate( TQString &input, int & ) const { if( input.isEmpty() ) { - return QValidator::Valid; + return TQValidator::Valid; } else { bool ok; int value = input.toInt( &ok ); if( !ok ) - return QValidator::Invalid; + return TQValidator::Invalid; if( value < v_bottom || value > v_top ) - return QValidator::Valid; + return TQValidator::Valid; - return QValidator::Acceptable; + return TQValidator::Acceptable; } } diff --git a/konquest/int_validator.h b/konquest/int_validator.h index e5973fee..6cb67bcb 100644 --- a/konquest/int_validator.h +++ b/konquest/int_validator.h @@ -1,7 +1,7 @@ #ifndef _INT_VALIDATOR_H_ #define _INT_VALIDATOR_H_ -#include <qvalidator.h> +#include <tqvalidator.h> class IntValidator : public QValidator @@ -9,12 +9,12 @@ class IntValidator : public QValidator Q_OBJECT public: - IntValidator( QWidget *parent, const char *name = 0 ); - IntValidator( int bottom, int top, QWidget *parent, const char *name = 0 ); + IntValidator( TQWidget *parent, const char *name = 0 ); + IntValidator( int bottom, int top, TQWidget *parent, const char *name = 0 ); virtual ~IntValidator(); - virtual QValidator::State validate( QString &, int & ) const; + virtual TQValidator::State validate( TQString &, int & ) const; virtual void setRange( int bottom, int top ); diff --git a/konquest/mainwin.cc b/konquest/mainwin.cc index 496d3ac0..866cd936 100644 --- a/konquest/mainwin.cc +++ b/konquest/mainwin.cc @@ -1,6 +1,6 @@ #include <config.h> -#include <qpushbutton.h> +#include <tqpushbutton.h> #include <kapplication.h> #include <klocale.h> @@ -37,18 +37,18 @@ MainWindow::~MainWindow() void MainWindow::setupKAction() { - KStdGameAction::gameNew( gameBoard, SLOT( startNewGame() ), actionCollection() ); - KStdGameAction::quit( this, SLOT( close() ), actionCollection() ); - endAction = KStdGameAction::end( gameBoard, SLOT( shutdownGame() ), actionCollection() ); + KStdGameAction::gameNew( gameBoard, TQT_SLOT( startNewGame() ), actionCollection() ); + KStdGameAction::quit( this, TQT_SLOT( close() ), actionCollection() ); + endAction = KStdGameAction::end( gameBoard, TQT_SLOT( shutdownGame() ), actionCollection() ); endAction->setEnabled(false); //AB: there is no icon for disabled - KToolBar::insertButton shows the //different state - KAction not :-( - measureAction = new KAction( i18n("&Measure Distance"), "ruler", 0, gameBoard, SLOT( measureDistance() ), actionCollection(), "game_measure" ); + measureAction = new KAction( i18n("&Measure Distance"), "ruler", 0, gameBoard, TQT_SLOT( measureDistance() ), actionCollection(), "game_measure" ); measureAction->setEnabled(false); - standingAction = new KAction( i18n("&Show Standings"), "help", 0, gameBoard, SLOT( showScores() ), actionCollection(), "game_scores" ); + standingAction = new KAction( i18n("&Show Standings"), "help", 0, gameBoard, TQT_SLOT( showScores() ), actionCollection(), "game_scores" ); standingAction->setEnabled(false); - fleetAction = new KAction( i18n("&Fleet Overview"), "launch", 0, gameBoard, SLOT( showFleets() ), actionCollection(), "game_fleets" ); + fleetAction = new KAction( i18n("&Fleet Overview"), "launch", 0, gameBoard, TQT_SLOT( showFleets() ), actionCollection(), "game_fleets" ); fleetAction->setEnabled(false); toolBar()->setBarPos( KToolBar::Left ); toolBar()->setMovingEnabled( false ); @@ -60,7 +60,7 @@ MainWindow::setupGameBoard() gameBoard = new GameBoard( this ); setCentralWidget(gameBoard); - connect( gameBoard, SIGNAL( newGameState( GameState )), this, SLOT( gameStateChange( GameState ) ) ); + connect( gameBoard, TQT_SIGNAL( newGameState( GameState )), this, TQT_SLOT( gameStateChange( GameState ) ) ); } diff --git a/konquest/map_widget.cc b/konquest/map_widget.cc index 9bb1a632..a8aa33de 100644 --- a/konquest/map_widget.cc +++ b/konquest/map_widget.cc @@ -1,6 +1,6 @@ -#include <qpixmap.h> -#include <qpainter.h> -#include <qcolor.h> +#include <tqpixmap.h> +#include <tqpainter.h> +#include <tqcolor.h> #include <kapplication.h> #include <kiconloader.h> @@ -9,8 +9,8 @@ #include <kglobal.h> #include "map_widget.moc" -ConquestMap::ConquestMap( Map *newMap, QWidget *parent ) - : QGridView( parent ), +ConquestMap::ConquestMap( Map *newMap, TQWidget *parent ) + : TQGridView( parent ), SECTOR_HEIGHT( 28 ), SECTOR_WIDTH( 28 ), BOARD_HEIGHT( newMap->getRows() * SECTOR_HEIGHT ), BOARD_WIDTH( newMap->getColumns() * SECTOR_WIDTH ), @@ -32,10 +32,10 @@ ConquestMap::ConquestMap( Map *newMap, QWidget *parent ) setMinimumSize( BOARD_HEIGHT, BOARD_WIDTH ); setMaximumSize( BOARD_HEIGHT, BOARD_WIDTH ); - connect( map, SIGNAL( update() ), this, SLOT( mapUpdate() ) ); + connect( map, TQT_SIGNAL( update() ), this, TQT_SLOT( mapUpdate() ) ); - QTimer *timer = new QTimer( this ); - connect( timer, SIGNAL(timeout()), this, SLOT(squareBlink()) ); + TQTimer *timer = new TQTimer( this ); + connect( timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(squareBlink()) ); timer->start( 500, false ); viewport()->setMouseTracking( true ); @@ -52,7 +52,7 @@ ConquestMap::~ConquestMap() void -ConquestMap::contentsMousePressEvent( QMouseEvent *e ) +ConquestMap::contentsMousePressEvent( TQMouseEvent *e ) { int row, col; @@ -66,7 +66,7 @@ ConquestMap::contentsMousePressEvent( QMouseEvent *e ) } void -ConquestMap::contentsMouseMoveEvent( QMouseEvent *e ) +ConquestMap::contentsMouseMoveEvent( TQMouseEvent *e ) { // highlight the square under the mouse int row, col; @@ -82,7 +82,7 @@ ConquestMap::contentsMouseMoveEvent( QMouseEvent *e ) if( (hiLiteRow != -1) && (hiLiteCol != -1) ) { - QPainter p( viewport() ); + TQPainter p( viewport() ); p.translate( hiLiteCol * cellWidth(), hiLiteRow * cellHeight() ); @@ -94,7 +94,7 @@ ConquestMap::contentsMouseMoveEvent( QMouseEvent *e ) } if( map->getSector( row, col ).hasPlanet() ) { - QPainter p( viewport() ); + TQPainter p( viewport() ); p.translate( col * cellWidth(),row * cellHeight() ); @@ -116,7 +116,7 @@ ConquestMap::unselectPlanet() void -ConquestMap::paintCell( QPainter *p, int row, int col ) +ConquestMap::paintCell( TQPainter *p, int row, int col ) { drawSector( p, map->getSector( row, col ) ); } @@ -128,7 +128,7 @@ ConquestMap::squareBlink() int row, col; if( map->selectedSector( row, col ) ) { - QPainter p( this, true ); + TQPainter p( this, true ); p.translate( col * cellWidth(), row * cellHeight() ); @@ -154,13 +154,13 @@ ConquestMap::mapUpdate() void -ConquestMap::drawSector( QPainter *p, Sector §or, bool borderStrobe, bool highlight ) +ConquestMap::drawSector( TQPainter *p, Sector §or, bool borderStrobe, bool highlight ) { - QColor labelColor( white ); - QPoint labelCorner; + TQColor labelColor( white ); + TQPoint labelCorner; if( sector.hasPlanet() ) { - QPixmap pm; + TQPixmap pm; // simple (pathetic) way to "randomize" // the planet graphic @@ -168,49 +168,49 @@ ConquestMap::drawSector( QPainter *p, Sector §or, bool borderStrobe, bool hi // name more visible (hard coded pixel offsets) switch( ((sector.getRow()+sector.getColumn()) % 9) + 1 ) { case 1 : - pm = QPixmap( IMAGE_PLANET_1 ); - labelCorner = QPoint( 18, 14 ); + pm = TQPixmap( IMAGE_PLANET_1 ); + labelCorner = TQPoint( 18, 14 ); break; case 2 : - pm = QPixmap( IMAGE_PLANET_2 ); - labelCorner = QPoint( 2, 14 ); + pm = TQPixmap( IMAGE_PLANET_2 ); + labelCorner = TQPoint( 2, 14 ); break; case 3 : - pm = QPixmap( IMAGE_PLANET_3 ); - labelCorner = QPoint( 2, 26 ); + pm = TQPixmap( IMAGE_PLANET_3 ); + labelCorner = TQPoint( 2, 26 ); break; case 4 : - pm = QPixmap( IMAGE_PLANET_4 ); - labelCorner = QPoint( 18, 26 ); + pm = TQPixmap( IMAGE_PLANET_4 ); + labelCorner = TQPoint( 18, 26 ); break; case 5 : - pm = QPixmap( IMAGE_PLANET_5 ); - labelCorner = QPoint( 18, 26 ); + pm = TQPixmap( IMAGE_PLANET_5 ); + labelCorner = TQPoint( 18, 26 ); break; case 6 : - pm = QPixmap( IMAGE_PLANET_6 ); - labelCorner = QPoint( 18, 26 ); + pm = TQPixmap( IMAGE_PLANET_6 ); + labelCorner = TQPoint( 18, 26 ); break; case 7 : - pm = QPixmap( IMAGE_PLANET_7 ); - labelCorner = QPoint( 18, 26 ); + pm = TQPixmap( IMAGE_PLANET_7 ); + labelCorner = TQPoint( 18, 26 ); break; case 8 : - pm = QPixmap( IMAGE_PLANET_8 ); - labelCorner = QPoint( 18, 26 ); + pm = TQPixmap( IMAGE_PLANET_8 ); + labelCorner = TQPoint( 18, 26 ); break; case 9 : - pm = QPixmap( IMAGE_PLANET_9 ); - labelCorner = QPoint( 18, 26 ); + pm = TQPixmap( IMAGE_PLANET_9 ); + labelCorner = TQPoint( 18, 26 ); break; } - QPoint pos; + TQPoint pos; pos.setX( ( SECTOR_HEIGHT / 2 ) - ( pm.height() / 2 ) ); pos.setY( ( SECTOR_WIDTH / 2 ) - ( pm.width() / 2 ) ); - p->drawPixmap( pos, pm, QRect(0, 0, pm.height(), pm.width() ) ); + p->drawPixmap( pos, pm, TQRect(0, 0, pm.height(), pm.width() ) ); p->setFont( labelFont ); p->setPen( labelColor ); @@ -218,20 +218,20 @@ ConquestMap::drawSector( QPainter *p, Sector §or, bool borderStrobe, bool hi p->drawText( labelCorner, sector.getPlanet()->getName() ); if( borderStrobe ) { - QPen gridPen( sector.getPlanet()->getPlayer()->getColor() ); + TQPen gridPen( sector.getPlanet()->getPlayer()->getColor() ); p->setPen( gridPen ); } else if( highlight ) { - QPen gridPen( white ); + TQPen gridPen( white ); p->setPen( gridPen ); } else { - QPen gridPen( gridColor ); + TQPen gridPen( gridColor ); p->setPen( gridPen ); } } else { p->eraseRect( 0, 0, SECTOR_WIDTH, SECTOR_HEIGHT ); - QPen gridPen( gridColor ); + TQPen gridPen( gridColor ); p->setPen( gridPen ); } diff --git a/konquest/map_widget.h b/konquest/map_widget.h index 052d6e9d..ed8d98f3 100644 --- a/konquest/map_widget.h +++ b/konquest/map_widget.h @@ -2,13 +2,13 @@ #define _MAP_WIDGET_H -#include <qwidget.h> -#include <qframe.h> -#include <qpixmap.h> +#include <tqwidget.h> +#include <tqframe.h> +#include <tqpixmap.h> -#include <qgridview.h> +#include <tqgridview.h> -#include <qtimer.h> +#include <tqtimer.h> #include "gamecore.h" #include "images.h" @@ -19,7 +19,7 @@ class ConquestMap : public QGridView // Constructors public: - ConquestMap( Map *newMap, QWidget *parent = 0 ); + ConquestMap( Map *newMap, TQWidget *parent = 0 ); virtual ~ConquestMap(); // Interface @@ -27,9 +27,9 @@ public: void unselectPlanet(); protected: - virtual void contentsMousePressEvent( QMouseEvent *e ); - virtual void contentsMouseMoveEvent( QMouseEvent *e ); - virtual void paintCell( QPainter *p, int row, int col ); + virtual void contentsMousePressEvent( TQMouseEvent *e ); + virtual void contentsMouseMoveEvent( TQMouseEvent *e ); + virtual void paintCell( TQPainter *p, int row, int col ); private slots: void mapUpdate(); @@ -46,11 +46,11 @@ private: const int BOARD_HEIGHT; const int BOARD_WIDTH; - void drawSector( QPainter *, Sector &, bool borderStrobe = true, bool highlight = false ); + void drawSector( TQPainter *, Sector &, bool borderStrobe = true, bool highlight = false ); Map *map; - QColor gridColor; - QFont labelFont; + TQColor gridColor; + TQFont labelFont; int hiLiteRow, hiLiteCol; }; diff --git a/konquest/minimap.cc b/konquest/minimap.cc index eee1237b..a287ab79 100644 --- a/konquest/minimap.cc +++ b/konquest/minimap.cc @@ -1,5 +1,5 @@ -#include <qpixmap.h> -#include <qpainter.h> +#include <tqpixmap.h> +#include <tqpainter.h> #include <kapplication.h> #include <kiconloader.h> @@ -7,8 +7,8 @@ #include "minimap.h" #include "minimap.moc" -MiniMap::MiniMap( QWidget *parent, const char *name ) - : QGridView( parent, name ), +MiniMap::MiniMap( TQWidget *parent, const char *name ) + : TQGridView( parent, name ), SECTOR_HEIGHT( 12 ), SECTOR_WIDTH( 12 ), BOARD_HEIGHT( 10 * SECTOR_HEIGHT ), BOARD_WIDTH( 10 * SECTOR_WIDTH ), @@ -39,7 +39,7 @@ MiniMap::setMap(Map *newMap) setMinimumSize( BOARD_HEIGHT, BOARD_WIDTH ); setMaximumSize( BOARD_HEIGHT, BOARD_WIDTH ); - connect( map, SIGNAL( update() ), this, SLOT( mapUpdate() ) ); + connect( map, TQT_SIGNAL( update() ), this, TQT_SLOT( mapUpdate() ) ); } MiniMap::~MiniMap() @@ -48,7 +48,7 @@ MiniMap::~MiniMap() void -MiniMap::paintCell( QPainter *p, int row, int col ) +MiniMap::paintCell( TQPainter *p, int row, int col ) { drawSector( p, map->getSector( row, col ) ); } @@ -61,9 +61,9 @@ MiniMap::mapUpdate() void -MiniMap::drawSector( QPainter *p, Sector §or ) +MiniMap::drawSector( TQPainter *p, Sector §or ) { - QRect r( 0, 0, SECTOR_WIDTH, SECTOR_HEIGHT ); + TQRect r( 0, 0, SECTOR_WIDTH, SECTOR_HEIGHT ); p->setPen( black ); p->setBrush( black ); diff --git a/konquest/minimap.h b/konquest/minimap.h index 9d205abb..886e247c 100644 --- a/konquest/minimap.h +++ b/konquest/minimap.h @@ -1,11 +1,11 @@ #ifndef _MINIMAP_H #define _MINIMAP_H -#include <qwidget.h> -#include <qframe.h> -#include <qpixmap.h> -#include <qgridview.h> -#include <qtimer.h> +#include <tqwidget.h> +#include <tqframe.h> +#include <tqpixmap.h> +#include <tqgridview.h> +#include <tqtimer.h> #include "gamecore.h" #include "images.h" @@ -17,13 +17,13 @@ class MiniMap : public QGridView // Constructors public: - MiniMap( QWidget *parent = 0, const char* name = 0 ); + MiniMap( TQWidget *parent = 0, const char* name = 0 ); virtual ~MiniMap(); void setMap( Map *newMap ); protected: - void paintCell( QPainter *p, int row, int col ); + void paintCell( TQPainter *p, int row, int col ); private slots: void mapUpdate(); @@ -35,7 +35,7 @@ private: int BOARD_HEIGHT; int BOARD_WIDTH; - void drawSector( QPainter *, Sector & ); + void drawSector( TQPainter *, Sector & ); Map *map; }; diff --git a/konquest/newgamedlg.cc b/konquest/newgamedlg.cc index c1beae4f..232e6415 100644 --- a/konquest/newgamedlg.cc +++ b/konquest/newgamedlg.cc @@ -1,13 +1,13 @@ -#include <qheader.h> -#include <qlayout.h> -#include <qcolor.h> -#include <qlabel.h> -#include <qslider.h> -#include <qevent.h> -#include <qkeycode.h> -#include <qlistview.h> -#include <qpushbutton.h> -#include <qlineedit.h> +#include <tqheader.h> +#include <tqlayout.h> +#include <tqcolor.h> +#include <tqlabel.h> +#include <tqslider.h> +#include <tqevent.h> +#include <tqkeycode.h> +#include <tqlistview.h> +#include <tqpushbutton.h> +#include <tqlineedit.h> #include <kapplication.h> #include <kconfig.h> @@ -25,7 +25,7 @@ New Game Dialog Members ************************************************************************/ -NewGameDlg::NewGameDlg( QWidget *parent, Map *pmap, PlayerList *players, +NewGameDlg::NewGameDlg( TQWidget *parent, Map *pmap, PlayerList *players, Player *neutralPlayer, PlanetList *planets ) : KDialogBase( parent, "new_game_dialog", true, i18n("Start New Game"), KDialogBase::Ok|KDialogBase::Default|KDialogBase::Cancel, KDialogBase::NoDefault, true ), @@ -37,19 +37,19 @@ NewGameDlg::NewGameDlg( QWidget *parent, Map *pmap, PlayerList *players, w->listPlayers->header()->hide(); // w->listPlayers->setMinimumSize( 100, 150 ); w->listPlayers->setSortColumn(-1); - w->listPlayers->setHScrollBarMode(QScrollView::AlwaysOff); + w->listPlayers->setHScrollBarMode(TQScrollView::AlwaysOff); w->sliderPlayers->setMinimumWidth(270); w->sliderPlanets->setMinimumWidth(270); w->newPlayer->setMaxLength( 8 ); - connect(w->sliderPlayers, SIGNAL(valueChanged(int)), this, SLOT(slotPlayerCount(int))); - connect(w->sliderPlanets, SIGNAL(valueChanged(int)), this, SLOT(slotNewMap())); - connect(w->sliderTurns, SIGNAL(valueChanged(int)), this, SLOT(slotTurns())); - connect(w->rejectMap, SIGNAL(clicked()), this, SLOT(slotNewMap())); - connect(w->newPlayer, SIGNAL(textChanged(const QString &)), this, SLOT(slotNewPlayer())); - connect(w->newPlayer, SIGNAL(returnPressed()), this, SLOT(slotAddPlayer())); - connect(w->addPlayer, SIGNAL(clicked()), this, SLOT(slotAddPlayer())); + connect(w->sliderPlayers, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotPlayerCount(int))); + connect(w->sliderPlanets, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotNewMap())); + connect(w->sliderTurns, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotTurns())); + connect(w->rejectMap, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewMap())); + connect(w->newPlayer, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotNewPlayer())); + connect(w->newPlayer, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotAddPlayer())); + connect(w->addPlayer, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAddPlayer())); init(); @@ -93,12 +93,12 @@ NewGameDlg::init() // Restore player names int plrNum = 0; - for( QListViewItem *item = w->listPlayers->firstChild(); + for( TQListViewItem *item = w->listPlayers->firstChild(); item; item = item->nextSibling(), plrNum++ ) { - QString key = QString("Player_%1").arg(plrNum); + TQString key = TQString("Player_%1").arg(plrNum); - QString playerName = config->readEntry(key); + TQString playerName = config->readEntry(key); if (playerName.isEmpty()) continue; @@ -120,11 +120,11 @@ NewGameDlg::slotNewPlayer() void NewGameDlg::slotAddPlayer() { - QString playerName = w->newPlayer->text(); + TQString playerName = w->newPlayer->text(); if (playerName.isEmpty()) return; - QListViewItem *item; + TQListViewItem *item; do { item = w->listPlayers->firstChild(); @@ -151,7 +151,7 @@ NewGameDlg::slotAddPlayer() item->setText(1, i18n("Human Player")); item->setText(0, playerName); - w->newPlayer->setText(QString::null); + w->newPlayer->setText(TQString::null); updateMiniMap(); updateLabels(); @@ -160,14 +160,14 @@ NewGameDlg::slotAddPlayer() void NewGameDlg::setPlayerCount(int playerCount) { - QColor PlayerColors[MAX_PLAYERS] = { QColor( 130, 130, 255 ), yellow, red, green, - white, cyan, magenta, QColor( 235, 153, 46 ), - QColor( 106, 157, 104 ), QColor( 131, 153, 128) }; + TQColor PlayerColors[MAX_PLAYERS] = { TQColor( 130, 130, 255 ), yellow, red, green, + white, cyan, magenta, TQColor( 235, 153, 46 ), + TQColor( 106, 157, 104 ), TQColor( 131, 153, 128) }; int i = 0; - QListViewItem *lastItem = 0; - QListViewItem *item = 0; - QListViewItem *nextItem = w->listPlayers->firstChild(); + TQListViewItem *lastItem = 0; + TQListViewItem *item = 0; + TQListViewItem *nextItem = w->listPlayers->firstChild(); while( (item = nextItem) ) { nextItem = item->nextSibling(); @@ -184,11 +184,11 @@ NewGameDlg::setPlayerCount(int playerCount) while(w->listPlayers->childCount() < playerCount) { - QString playerName = i18n("Generated AI player name", "Comp%1").arg(i+1); - QPixmap pm(16,16); - QColor color(PlayerColors[i]); + TQString playerName = i18n("Generated AI player name", "Comp%1").arg(i+1); + TQPixmap pm(16,16); + TQColor color(PlayerColors[i]); pm.fill(color); - QListViewItem *item = new QListViewItem(w->listPlayers, lastItem, playerName, i18n("Computer Player"), "A", color.name()); + TQListViewItem *item = new TQListViewItem(w->listPlayers, lastItem, playerName, i18n("Computer Player"), "A", color.name()); item->setPixmap(0, pm); lastItem = item; i++; @@ -238,7 +238,7 @@ void NewGameDlg::slotOk() { bool hasHumans = false; - for( QListViewItem *item = w->listPlayers->firstChild(); + for( TQListViewItem *item = w->listPlayers->firstChild(); item; item = item->nextSibling() ) { bool ai = (item->text(2) == "A"); @@ -266,11 +266,11 @@ NewGameDlg::save() config->writeEntry("NrOfTurns", w->sliderTurns->value()); int plrNum = 0; - for( QListViewItem *item = w->listPlayers->firstChild(); + for( TQListViewItem *item = w->listPlayers->firstChild(); item; item = item->nextSibling() ) { - QString key = QString("Player_%1").arg(plrNum); - QString playerName = item->text(0); + TQString key = TQString("Player_%1").arg(plrNum); + TQString playerName = item->text(0); bool ai = (item->text(2) == "A"); if (ai) { @@ -307,12 +307,12 @@ NewGameDlg::updateMiniMap() // Make player list // Does the name already exist in the list int plrNum = 0; - for( QListViewItem *item = w->listPlayers->firstChild(); + for( TQListViewItem *item = w->listPlayers->firstChild(); item; item = item->nextSibling() ) { - QString playerName = item->text(0); + TQString playerName = item->text(0); bool ai = (item->text(2) == "A"); - QColor color(item->text(3)); + TQColor color(item->text(3)); plrList->append( Player::createPlayer( playerName, color, plrNum, ai )); plrNum++; } diff --git a/konquest/newgamedlg.h b/konquest/newgamedlg.h index ed2d48d6..6a8c81d4 100644 --- a/konquest/newgamedlg.h +++ b/konquest/newgamedlg.h @@ -17,7 +17,7 @@ class NewGameDlg : public KDialogBase Q_OBJECT public: - NewGameDlg( QWidget *parent, Map *map, PlayerList *playerList, + NewGameDlg( TQWidget *parent, Map *map, PlayerList *playerList, Player *neutralPlayer, PlanetList *planetList ); int turns( void ); diff --git a/konquest/planet_info.cc b/konquest/planet_info.cc index 4c1d4be1..1d178493 100644 --- a/konquest/planet_info.cc +++ b/konquest/planet_info.cc @@ -1,7 +1,7 @@ -#include <qlabel.h> -#include <qlayout.h> -#include <qpalette.h> -#include <qcolor.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpalette.h> +#include <tqcolor.h> #include <kapplication.h> #include <klocale.h> @@ -9,25 +9,25 @@ #include <kglobal.h> #include "planet_info.moc" -PlanetInfo::PlanetInfo( QWidget *parent, QPalette palette ) - : QFrame( parent ) +PlanetInfo::PlanetInfo( TQWidget *parent, TQPalette palette ) + : TQFrame( parent ) { setPalette( palette ); - name = new QLabel( this ); + name = new TQLabel( this ); name->setMinimumWidth( 100 ); - owner = new QLabel( this ); + owner = new TQLabel( this ); owner->setMinimumWidth( 100 ); - ships = new QLabel( this ); + ships = new TQLabel( this ); ships->setMinimumWidth( 100 ); - production = new QLabel( this ); + production = new TQLabel( this ); production->setMinimumWidth( 100 ); - kill_percent = new QLabel( this ); + kill_percent = new TQLabel( this ); kill_percent->setMinimumWidth( 100 ); clearDisplay(); - QVBoxLayout *layout1 = new QVBoxLayout( this ); + TQVBoxLayout *layout1 = new TQVBoxLayout( this ); layout1->addWidget( name ); layout1->addWidget( owner ); @@ -47,7 +47,7 @@ PlanetInfo::~PlanetInfo() emptyPlanetInfoList(); } -QSize PlanetInfo::sizeHint() const +TQSize PlanetInfo::sizeHint() const { int height; @@ -57,7 +57,7 @@ QSize PlanetInfo::sizeHint() const production->sizeHint().height()+ kill_percent->sizeHint().height(); - return QSize( 100, height ); + return TQSize( 100, height ); } void PlanetInfo::setPlanetList( PlanetList &newPlanets ) @@ -90,7 +90,7 @@ void PlanetInfo::rescanPlanets() void PlanetInfo::clearDisplay() { - QString temp; + TQString temp; temp = "<qt>" + i18n("Planet name: "); name->setText( temp ); @@ -124,14 +124,14 @@ void PlanetInfo::showPlanet( Planet *planet ) if( planet->getPlayer()->isNeutral() ) { clearDisplay(); - QString temp; + TQString temp; temp = "<qt>" + i18n("Planet name: %1").arg(planet->getName()); name->setText( temp ); return; } - QString nameToShow = planet->getName(); + TQString nameToShow = planet->getName(); PlanetInfoListIterator itr( planet_stats ); planet_info_buffer *p; @@ -139,7 +139,7 @@ void PlanetInfo::showPlanet( Planet *planet ) while( (p = itr()) ) { if( p->planet == planet ) { - QString temp; + TQString temp; temp = "<qt>" + i18n("Planet name: %1").arg(p->planet->getName()); name->setText( temp ); diff --git a/konquest/planet_info.h b/konquest/planet_info.h index 4080f6b9..3408a499 100644 --- a/konquest/planet_info.h +++ b/konquest/planet_info.h @@ -1,10 +1,10 @@ #ifndef _PLANET_INFO_H_ #define _PLANET_INFO_H_ -#include <qframe.h> -#include <qstring.h> -#include <qptrlist.h> -#include <qpalette.h> +#include <tqframe.h> +#include <tqstring.h> +#include <tqptrlist.h> +#include <tqpalette.h> #include "gamecore.h" @@ -17,20 +17,20 @@ struct planet_info_buffer { float killRate; }; -typedef QPtrList<planet_info_buffer> PlanetInfoList; -typedef QPtrListIterator<planet_info_buffer> PlanetInfoListIterator; +typedef TQPtrList<planet_info_buffer> PlanetInfoList; +typedef TQPtrListIterator<planet_info_buffer> PlanetInfoListIterator; class PlanetInfo : public QFrame { Q_OBJECT public: - PlanetInfo( QWidget *parent, QPalette palette ); + PlanetInfo( TQWidget *parent, TQPalette palette ); virtual ~PlanetInfo(); void setPlanetList( PlanetList &newPlanets ); void rescanPlanets(); - QSize sizeHint() const; + TQSize sizeHint() const; public slots: void showPlanet( Planet * ); @@ -42,11 +42,11 @@ private: PlanetList *planets; PlanetInfoList planet_stats; - QLabel *name; - QLabel *owner; - QLabel *ships; - QLabel *production; - QLabel *kill_percent; + TQLabel *name; + TQLabel *owner; + TQLabel *ships; + TQLabel *production; + TQLabel *kill_percent; }; #endif // _PLANET_INFO_H_ diff --git a/konquest/scoredlg.cc b/konquest/scoredlg.cc index 685ba9c5..7b7eac25 100644 --- a/konquest/scoredlg.cc +++ b/konquest/scoredlg.cc @@ -1,4 +1,4 @@ -#include <qlayout.h> +#include <tqlayout.h> #include <kapplication.h> #include <klocale.h> #include <kpushbutton.h> @@ -6,11 +6,11 @@ #include "scoredlg.h" -ScoreDlgListViewItem::ScoreDlgListViewItem(QListView *parent, QString s1, QString s2, QString s3, QString s4, QString s5, QString s6) : QListViewItem(parent, s1, s2, s3, s4, s5, s6) +ScoreDlgListViewItem::ScoreDlgListViewItem(TQListView *parent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5, TQString s6) : TQListViewItem(parent, s1, s2, s3, s4, s5, s6) { } -int ScoreDlgListViewItem::compare(QListViewItem *i, int col, bool) const +int ScoreDlgListViewItem::compare(TQListViewItem *i, int col, bool) const { if (col == 0) { @@ -27,8 +27,8 @@ int ScoreDlgListViewItem::compare(QListViewItem *i, int col, bool) const } -ScoreDlg::ScoreDlg( QWidget *parent, const QString& title, PlayerList *players ) - : QDialog(parent, "ScoreDlg", true ), plrList(players) +ScoreDlg::ScoreDlg( TQWidget *parent, const TQString& title, PlayerList *players ) + : TQDialog(parent, "ScoreDlg", true ), plrList(players) { setCaption( kapp->makeStdCaption(title) ); @@ -45,8 +45,8 @@ ScoreDlg::ScoreDlg( QWidget *parent, const QString& title, PlayerList *players ) okButton->setMinimumSize( okButton->sizeHint() ); okButton->setDefault(true); - QVBoxLayout *layout1 = new QVBoxLayout( this ); - QHBoxLayout *layout2 = new QHBoxLayout; + TQVBoxLayout *layout1 = new TQVBoxLayout( this ); + TQHBoxLayout *layout2 = new QHBoxLayout; layout1->addWidget( scoreTable, 1 ); layout1->addLayout( layout2 ); @@ -55,7 +55,7 @@ ScoreDlg::ScoreDlg( QWidget *parent, const QString& title, PlayerList *players ) layout2->addWidget( okButton ); layout2->addStretch( 2 ); - connect( okButton, SIGNAL(clicked()), this, SLOT(accept()) ); + connect( okButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()) ); init(); @@ -71,10 +71,10 @@ ScoreDlg::init() for( ;(curPlayer = itr()); ) new ScoreDlgListViewItem(scoreTable, curPlayer->getName(), - QString("%1").arg(curPlayer->getShipsBuilt()), - QString("%1").arg(curPlayer->getPlanetsConquered()), - QString("%1").arg(curPlayer->getFleetsLaunched()), - QString("%1").arg(curPlayer->getEnemyFleetsDestroyed()), - QString("%1").arg(curPlayer->getEnemyShipsDestroyed())); + TQString("%1").arg(curPlayer->getShipsBuilt()), + TQString("%1").arg(curPlayer->getPlanetsConquered()), + TQString("%1").arg(curPlayer->getFleetsLaunched()), + TQString("%1").arg(curPlayer->getEnemyFleetsDestroyed()), + TQString("%1").arg(curPlayer->getEnemyShipsDestroyed())); } diff --git a/konquest/scoredlg.h b/konquest/scoredlg.h index 570a3b36..55eaa926 100644 --- a/konquest/scoredlg.h +++ b/konquest/scoredlg.h @@ -3,28 +3,28 @@ #include <klistview.h> -#include <qdialog.h> +#include <tqdialog.h> #include "gamecore.h" class ScoreDlgListViewItem : public QListViewItem { public: - ScoreDlgListViewItem(QListView *parent, QString s1, QString s2, QString s3, QString s4, QString s5, QString s6); - int compare(QListViewItem *i, int col, bool) const; + ScoreDlgListViewItem(TQListView *parent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5, TQString s6); + int compare(TQListViewItem *i, int col, bool) const; }; class ScoreDlg : public QDialog { public: - ScoreDlg( QWidget *parent, const QString& title, PlayerList *players ); + ScoreDlg( TQWidget *parent, const TQString& title, PlayerList *players ); private: void init(); PlayerList *plrList; - QListView *scoreTable; + TQListView *scoreTable; }; diff --git a/kpat/card.cpp b/kpat/card.cpp index 983a901d..a6529bd1 100644 --- a/kpat/card.cpp +++ b/kpat/card.cpp @@ -21,7 +21,7 @@ #include <math.h> #include <assert.h> -#include <qpainter.h> +#include <tqpainter.h> #include <kdebug.h> @@ -38,14 +38,14 @@ static const char *rank_names[] = {"Ace", "Two", "Three", "Four", "Five", "Six" const int Card::RTTI = 1001; -Card::Card( Rank r, Suit s, QCanvas* _parent ) - : QCanvasRectangle( _parent ), +Card::Card( Rank r, Suit s, TQCanvas* _parent ) + : TQCanvasRectangle( _parent ), m_suit( s ), m_rank( r ), m_source(0), scaleX(1.0), scaleY(1.0), tookDown(false) { // Set the name of the card // FIXME: i18n() - m_name = QString("%1 %2").arg(suit_names[s-1]).arg(rank_names[r-1]).utf8(); + m_name = TQString("%1 %2").arg(suit_names[s-1]).arg(rank_names[r-1]).utf8(); // Default for the card is face up, standard size. m_faceup = true; @@ -77,7 +77,7 @@ Card::~Card() // Return the pixmap of the card // -QPixmap Card::pixmap() const +TQPixmap Card::pixmap() const { return cardMap::self()->image( m_rank, m_suit ); } @@ -96,9 +96,9 @@ void Card::turn( bool _faceup ) // Draw the card on the painter 'p'. // -void Card::draw( QPainter &p ) +void Card::draw( TQPainter &p ) { - QPixmap side; + TQPixmap side; // Get the image to draw (front / back) if( isFaceUp() ) @@ -108,7 +108,7 @@ void Card::draw( QPainter &p ) // Rescale the image if necessary. if (scaleX <= 0.98 || scaleY <= 0.98) { - QWMatrix s; + TQWMatrix s; s.scale( scaleX, scaleY ); side = side.xForm( s ); int xoff = side.width() / 2; @@ -122,7 +122,7 @@ void Card::draw( QPainter &p ) void Card::moveBy(double dx, double dy) { - QCanvasRectangle::moveBy(dx, dy); + TQCanvasRectangle::moveBy(dx, dy); } @@ -215,7 +215,7 @@ int Card::Hz = 0; void Card::setZ(double z) { - QCanvasRectangle::setZ(z); + TQCanvasRectangle::setZ(z); if (z > Hz) Hz = int(z); } @@ -293,7 +293,7 @@ void Card::flipTo(int x2, int y2, int steps) // Advance a card animation one step. This function adds flipping of -// the card to the translation animation that QCanvasRectangle offers. +// the card to the translation animation that TQCanvasRectangle offers. // void Card::advance(int stage) { @@ -322,7 +322,7 @@ void Card::advance(int stage) } // Animate the translation of the card. - QCanvasRectangle::advance(stage); + TQCanvasRectangle::advance(stage); } @@ -344,7 +344,7 @@ void Card::setAnimated(bool anim) setZ(m_destZ); } - QCanvasRectangle::setAnimated(anim); + TQCanvasRectangle::setAnimated(anim); } diff --git a/kpat/card.h b/kpat/card.h index 61f07399..8ec96bb9 100644 --- a/kpat/card.h +++ b/kpat/card.h @@ -27,7 +27,7 @@ #ifndef PATIENCE_CARD #define PATIENCE_CARD -#include <qcanvas.h> +#include <tqcanvas.h> // The following classes are defined in other headers: class cardPos; @@ -38,14 +38,14 @@ class Card; // A list of cards. Used in many places. -typedef QValueList<Card*> CardList; +typedef TQValueList<Card*> CardList; // In kpat, a Card is an object that has at least two purposes: // - It has card properties (Suit, Rank, etc) -// - It is a graphic entity on a QCanvas that can be moved around. +// - It is a graphic entity on a TQCanvas that can be moved around. // -class Card: public QObject, public QCanvasRectangle { +class Card: public TQObject, public TQCanvasRectangle { Q_OBJECT public: @@ -53,19 +53,19 @@ public: enum Rank { None = 0, Ace = 1, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King }; - Card( Rank r, Suit s, QCanvas *parent=0); + Card( Rank r, Suit s, TQCanvas *parent=0); virtual ~Card(); // Properties of the card. Suit suit() const { return m_suit; } Rank rank() const { return m_rank; } - const QString name() const { return m_name; } + const TQString name() const { return m_name; } // Some basic tests. bool isRed() const { return m_suit==Diamonds || m_suit==Hearts; } bool isFaceUp() const { return m_faceup; } - QPixmap pixmap() const; + TQPixmap pixmap() const; void turn(bool faceup = true); @@ -95,14 +95,14 @@ signals: void stoped(Card *c); protected: - void draw( QPainter &p ); // Redraw the card. + void draw( TQPainter &p ); // Redraw the card. void advance(int stage); private: // The card values. Suit m_suit; Rank m_rank; - QString m_name; + TQString m_name; // Grapics properties. bool m_faceup; // True if card lies with the face up. diff --git a/kpat/cardmaps.cpp b/kpat/cardmaps.cpp index 5a2decae..563f4bfe 100644 --- a/kpat/cardmaps.cpp +++ b/kpat/cardmaps.cpp @@ -21,7 +21,7 @@ #include <stdio.h> #include <unistd.h> -#include <qpainter.h> +#include <tqpainter.h> #include <kconfig.h> @@ -35,7 +35,7 @@ #include <klocale.h> #include "version.h" #include <kstaticdeleter.h> -#include <qimage.h> +#include <tqimage.h> #include <kimageeffect.h> #include <kcarddialog.h> #include <kglobalsettings.h> @@ -44,7 +44,7 @@ cardMap *cardMap::_self = 0; static KStaticDeleter<cardMap> cms; -cardMap::cardMap(const QColor &dim) : dimcolor(dim) +cardMap::cardMap(const TQColor &dim) : dimcolor(dim) { assert(!_self); @@ -55,17 +55,17 @@ cardMap::cardMap(const QColor &dim) : dimcolor(dim) KConfig *config = kapp->config(); KConfigGroupSaver cs(config, settings_group ); - QString bg = config->readEntry( "Back", KCardDialog::getDefaultDeck()); + TQString bg = config->readEntry( "Back", KCardDialog::getDefaultDeck()); setBackSide( bg, false); - QString dir = config->readEntry("Cards", KCardDialog::getDefaultCardDir()); + TQString dir = config->readEntry("Cards", KCardDialog::getDefaultCardDir()); setCardDir( dir ); cms.setObject(_self, this); // kdDebug(11111) << "card " << CARDX << " " << CARDY << endl; } -bool cardMap::setCardDir( const QString &dir) +bool cardMap::setCardDir( const TQString &dir) { KConfig *config = kapp->config(); KConfigGroupSaver cs(config, settings_group ); @@ -74,13 +74,13 @@ bool cardMap::setCardDir( const QString &dir) // may take a while (approx. 3 seconds on my AMD K6PR200) bool animate = config->readBoolEntry( "Animation", true); - QWidget* w = 0; - QPainter p; - QTime t1, t2; + TQWidget* w = 0; + TQPainter p; + TQTime t1, t2; - QString imgname = KCardDialog::getCardPath(dir, 11); + TQString imgname = KCardDialog::getCardPath(dir, 11); - QImage image; + TQImage image; image.load(imgname); if( image.isNull()) { kdDebug(11111) << "cannot load card pixmap \"" << imgname << "\" in " << dir << "\n"; @@ -96,15 +96,15 @@ bool cardMap::setCardDir( const QString &dir) card_height = image.height(); const int diff_x_between_cards = QMAX(card_width / 9, 1); - QString wait_message = i18n("please wait, loading cards..."); - QString greeting = i18n("KPatience - a Solitaire game"); + TQString wait_message = i18n("please wait, loading cards..."); + TQString greeting = i18n("KPatience - a Solitaire game"); const int greeting_width = 20 + diff_x_between_cards * 52 + card_width; if( animate ) { - t1 = QTime::currentTime(); - w = new QWidget( 0, "", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool ); - QRect dg = KGlobalSettings::splashScreenDesktopGeometry(); + t1 = TQTime::currentTime(); + w = new TQWidget( 0, "", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool ); + TQRect dg = KGlobalSettings::splashScreenDesktopGeometry(); w->setBackgroundColor( Qt::darkGreen ); w->setGeometry( dg.left() + ( dg.width() - greeting_width ) / 2, dg.top() + ( dg.height() - 180 ) / 2, greeting_width, 180); w->show(); @@ -114,11 +114,11 @@ bool cardMap::setCardDir( const QString &dir) p.drawText(0, 150, greeting_width, 20, Qt::AlignCenter, wait_message ); - p.setFont(QFont("Times", 24)); + p.setFont(TQFont("Times", 24)); p.drawText(0, 0, greeting_width, 40, Qt::AlignCenter, greeting); - p.setPen(QPen(QColor(0, 0, 0), 4)); + p.setPen(TQPen(TQColor(0, 0, 0), 4)); p.setBrush(Qt::NoBrush); p.drawRect(0, 0, greeting_width, 180); p.flush(); @@ -181,7 +181,7 @@ bool cardMap::setCardDir( const QString &dir) { const int time_to_see = 900; p.end(); - t2 = QTime::currentTime(); + t2 = TQTime::currentTime(); if(t1.msecsTo(t2) < time_to_see) usleep((time_to_see-t1.msecsTo(t2))*1000); delete w; @@ -190,7 +190,7 @@ bool cardMap::setCardDir( const QString &dir) return true; } -bool cardMap::setBackSide( const QPixmap &pm, bool scale ) +bool cardMap::setBackSide( const TQPixmap &pm, bool scale ) { if (pm.isNull()) return false; @@ -202,7 +202,7 @@ bool cardMap::setBackSide( const QPixmap &pm, bool scale ) { kdDebug(11111) << "scaling back!!\n"; // scale to fit size - QWMatrix wm; + TQWMatrix wm; wm.scale(((float)(card_width))/back.width(), ((float)(card_height))/back.height()); back = back.xForm(wm); @@ -219,12 +219,12 @@ int cardMap::CARDY() { return self()->card_height; // 96; } -QPixmap cardMap::backSide() const +TQPixmap cardMap::backSide() const { return back; } -QPixmap cardMap::image( Card::Rank _rank, Card::Suit _suit, bool inverted) const +TQPixmap cardMap::image( Card::Rank _rank, Card::Suit _suit, bool inverted) const { if( 1 <= _rank && _rank <= 13 && 1 <= _suit && _suit <= 4 ) diff --git a/kpat/cardmaps.h b/kpat/cardmaps.h index 8bc8d92c..0a2a284a 100644 --- a/kpat/cardmaps.h +++ b/kpat/cardmaps.h @@ -28,7 +28,7 @@ class cardMap public: static cardMap *self(); - cardMap(const QColor &dimcolor); + cardMap(const TQColor &dimcolor); static int CARDX(); static int CARDY(); @@ -36,21 +36,21 @@ public: static const int NumColors = 4; static const int CardsPerColor = 13; - QPixmap image( Card::Rank _rank, Card::Suit _suit, bool inverted = false) const; - QPixmap backSide() const; - bool setCardDir( const QString &dir); - bool setBackSide( const QPixmap & _pix, bool scale = true); + TQPixmap image( Card::Rank _rank, Card::Suit _suit, bool inverted = false) const; + TQPixmap backSide() const; + bool setCardDir( const TQString &dir); + bool setBackSide( const TQPixmap & _pix, bool scale = true); private: cardMap(); struct { - QPixmap normal; - QPixmap inverted; + TQPixmap normal; + TQPixmap inverted; } img[ CardsPerColor ][ NumColors ]; - QPixmap back; - QColor dimcolor; + TQPixmap back; + TQColor dimcolor; int card_width, card_height; static cardMap *_self; diff --git a/kpat/dealer.cpp b/kpat/dealer.cpp index 2100ae2e..365e7411 100644 --- a/kpat/dealer.cpp +++ b/kpat/dealer.cpp @@ -6,7 +6,7 @@ #include "kmainwindow.h" #include <kapplication.h> #include <kpixmapeffect.h> -#include <qtimer.h> +#include <tqtimer.h> #include <kaction.h> #include <klocale.h> #include "cardmaps.h" @@ -56,7 +56,7 @@ Dealer *Dealer::s_instance = 0; Dealer::Dealer( KMainWindow* _parent , const char* _name ) - : QCanvasView( 0, _parent, _name ), + : TQCanvasView( 0, _parent, _name ), towait(0), myActions(0), ademo(0), @@ -69,7 +69,7 @@ Dealer::Dealer( KMainWindow* _parent , const char* _name ) _autodrop(true), _gameRecorded(false) { - setResizePolicy(QScrollView::Manual); + setResizePolicy(TQScrollView::Manual); setVScrollBarMode(AlwaysOff); setHScrollBarMode(AlwaysOff); @@ -81,9 +81,9 @@ Dealer::Dealer( KMainWindow* _parent , const char* _name ) undoList.setAutoDelete(true); - demotimer = new QTimer(this); + demotimer = new TQTimer(this); - connect(demotimer, SIGNAL(timeout()), SLOT(demo())); + connect(demotimer, TQT_SIGNAL(timeout()), TQT_SLOT(demo())); assert(!s_instance); s_instance = this; @@ -96,7 +96,7 @@ const Dealer *Dealer::instance() } -void Dealer::setBackgroundPixmap(const QPixmap &background, const QColor &midcolor) +void Dealer::setBackgroundPixmap(const TQPixmap &background, const TQColor &midcolor) { _midcolor = midcolor; canvas()->setBackgroundPixmap(background); @@ -108,36 +108,36 @@ void Dealer::setBackgroundPixmap(const QPixmap &background, const QColor &midcol void Dealer::setupActions() { - QPtrList<KAction> actionlist; + TQPtrList<KAction> actionlist; kdDebug(11111) << "setupActions " << actions() << endl; if (actions() & Dealer::Hint) { - ahint = new KAction( i18n("&Hint"), QString::fromLatin1("wizard"), Key_H, this, - SLOT(hint()), + ahint = new KAction( i18n("&Hint"), TQString::fromLatin1("wizard"), Key_H, this, + TQT_SLOT(hint()), parent()->actionCollection(), "game_hint"); actionlist.append(ahint); } else ahint = 0; if (actions() & Dealer::Demo) { - ademo = new KToggleAction( i18n("&Demo"), QString::fromLatin1("1rightarrow"), CTRL+Key_D, this, - SLOT(toggleDemo()), + ademo = new KToggleAction( i18n("&Demo"), TQString::fromLatin1("1rightarrow"), CTRL+Key_D, this, + TQT_SLOT(toggleDemo()), parent()->actionCollection(), "game_demo"); actionlist.append(ademo); } else ademo = 0; if (actions() & Dealer::Redeal) { - aredeal = new KAction (i18n("&Redeal"), QString::fromLatin1("queue"), 0, this, - SLOT(redeal()), + aredeal = new KAction (i18n("&Redeal"), TQString::fromLatin1("queue"), 0, this, + TQT_SLOT(redeal()), parent()->actionCollection(), "game_redeal"); actionlist.append(aredeal); } else aredeal = 0; - parent()->guiFactory()->plugActionList( parent(), QString::fromLatin1("game_actions"), actionlist); + parent()->guiFactory()->plugActionList( parent(), TQString::fromLatin1("game_actions"), actionlist); } Dealer::~Dealer() @@ -145,7 +145,7 @@ Dealer::~Dealer() if (!_won) countLoss(); clearHints(); - parent()->guiFactory()->unplugActionList( parent(), QString::fromLatin1("game_actions")); + parent()->guiFactory()->unplugActionList( parent(), TQString::fromLatin1("game_actions")); while (!piles.isEmpty()) delete piles.first(); // removes itself @@ -156,7 +156,7 @@ Dealer::~Dealer() KMainWindow *Dealer::parent() const { - return dynamic_cast<KMainWindow*>(QCanvasView::parent()); + return dynamic_cast<KMainWindow*>(TQCanvasView::parent()); } @@ -252,7 +252,7 @@ bool Dealer::isMoving(Card *c) const return movingCards.find(c) != movingCards.end(); } -void Dealer::contentsMouseMoveEvent(QMouseEvent* e) +void Dealer::contentsMouseMoveEvent(TQMouseEvent* e) { if (movingCards.isEmpty()) return; @@ -266,9 +266,9 @@ void Dealer::contentsMouseMoveEvent(QMouseEvent* e) } PileList sources; - QCanvasItemList list = canvas()->collisions(movingCards.first()->rect()); + TQCanvasItemList list = canvas()->collisions(movingCards.first()->rect()); - for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) + for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) { if ((*it)->rtti() == Card::RTTI) { Card *c = dynamic_cast<Card*>(*it); @@ -320,21 +320,21 @@ void Dealer::mark(Card *c) void Dealer::unmarkAll() { - for (QCanvasItemList::Iterator it = marked.begin(); it != marked.end(); ++it) + for (TQCanvasItemList::Iterator it = marked.begin(); it != marked.end(); ++it) { (*it)->setSelected(false); } marked.clear(); } -void Dealer::contentsMousePressEvent(QMouseEvent* e) +void Dealer::contentsMousePressEvent(TQMouseEvent* e) { unmarkAll(); stopDemo(); if (waiting()) return; - QCanvasItemList list = canvas()->collisions(e->pos()); + TQCanvasItemList list = canvas()->collisions(e->pos()); kdDebug(11111) << "mouse pressed " << list.count() << " " << canvas()->allItems().count() << endl; moved = false; @@ -373,22 +373,22 @@ void Dealer::contentsMousePressEvent(QMouseEvent* e) class Hit { public: Pile *source; - QRect intersect; + TQRect intersect; bool top; }; -typedef QValueList<Hit> HitList; +typedef TQValueList<Hit> HitList; -void Dealer::contentsMouseReleaseEvent( QMouseEvent *e) +void Dealer::contentsMouseReleaseEvent( TQMouseEvent *e) { if (!moved) { if (!movingCards.isEmpty()) { movingCards.first()->source()->moveCardsBack(movingCards); movingCards.clear(); } - QCanvasItemList list = canvas()->collisions(e->pos()); + TQCanvasItemList list = canvas()->collisions(e->pos()); if (list.isEmpty()) return; - QCanvasItemList::Iterator it = list.begin(); + TQCanvasItemList::Iterator it = list.begin(); if ((*it)->rtti() == Card::RTTI) { Card *c = dynamic_cast<Card*>(*it); assert(c); @@ -418,10 +418,10 @@ void Dealer::contentsMouseReleaseEvent( QMouseEvent *e) unmarkAll(); - QCanvasItemList list = canvas()->collisions(movingCards.first()->rect()); + TQCanvasItemList list = canvas()->collisions(movingCards.first()->rect()); HitList sources; - for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) + for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) { if ((*it)->rtti() == Card::RTTI) { Card *c = dynamic_cast<Card*>(*it); @@ -499,7 +499,7 @@ void Dealer::contentsMouseReleaseEvent( QMouseEvent *e) canvas()->update(); } -void Dealer::contentsMouseDoubleClickEvent( QMouseEvent*e ) +void Dealer::contentsMouseDoubleClickEvent( TQMouseEvent*e ) { stopDemo(); unmarkAll(); @@ -510,10 +510,10 @@ void Dealer::contentsMouseDoubleClickEvent( QMouseEvent*e ) movingCards.first()->source()->moveCardsBack(movingCards); movingCards.clear(); } - QCanvasItemList list = canvas()->collisions(e->pos()); + TQCanvasItemList list = canvas()->collisions(e->pos()); if (list.isEmpty()) return; - QCanvasItemList::Iterator it = list.begin(); + TQCanvasItemList::Iterator it = list.begin(); if ((*it)->rtti() != Card::RTTI) return; Card *c = dynamic_cast<Card*>(*it); @@ -526,12 +526,12 @@ void Dealer::contentsMouseDoubleClickEvent( QMouseEvent*e ) } } -QSize Dealer::minimumCardSize() const +TQSize Dealer::minimumCardSize() const { return minsize; } -void Dealer::resizeEvent(QResizeEvent *e) +void Dealer::resizeEvent(TQResizeEvent *e) { int x = width(); int y = height(); @@ -570,7 +570,7 @@ void Dealer::resizeEvent(QResizeEvent *e) if (!e) updateScrollBars(); else - QCanvasView::resizeEvent(e); + TQCanvasView::resizeEvent(e); } bool Dealer::cardClicked(Card *c) { @@ -613,7 +613,7 @@ void Dealer::startNew() if ( aredeal ) aredeal->setEnabled( true ); toldAboutLostGame = false; - minsize = QSize(0,0); + minsize = TQSize(0,0); _won = false; _waiting = 0; _gameRecorded=false; @@ -622,8 +622,8 @@ void Dealer::startNew() kdDebug(11111) << "startNew unmarkAll\n"; unmarkAll(); kdDebug(11111) << "startNew setAnimated(false)\n"; - QCanvasItemList list = canvas()->allItems(); - for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) { + TQCanvasItemList list = canvas()->allItems(); + for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) { if ((*it)->rtti() == Card::RTTI) static_cast<Card*>(*it)->disconnect(); @@ -638,7 +638,7 @@ void Dealer::startNew() restart(); takeState(); Card *towait = 0; - for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) { + for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) { if ((*it)->rtti() == Card::RTTI) { towait = static_cast<Card*>(*it); if (towait->animated()) @@ -650,7 +650,7 @@ void Dealer::startNew() if (!towait) takeState(); else - connect(towait, SIGNAL(stoped(Card*)), SLOT(slotTakeState(Card *))); + connect(towait, TQT_SIGNAL(stoped(Card*)), TQT_SLOT(slotTakeState(Card *))); resizeEvent(0); } @@ -660,7 +660,7 @@ void Dealer::slotTakeState(Card *c) { takeState(); } -void Dealer::enlargeCanvas(QCanvasRectangle *c) +void Dealer::enlargeCanvas(TQCanvasRectangle *c) { if (!c->isVisible() || c->animated()) return; @@ -702,7 +702,7 @@ public: y == rhs.y && z == rhs.z && faceup == rhs.faceup && source_index == rhs.source_index && tookdown == rhs.tookdown); } - void fillNode(QDomElement &e) const { + void fillNode(TQDomElement &e) const { e.setAttribute("value", it->rank()); e.setAttribute("suit", it->suit()); e.setAttribute("source", source->index()); @@ -715,7 +715,7 @@ public: } }; -typedef class QValueList<CardState> CardStateList; +typedef class TQValueList<CardState> CardStateList; bool operator==( const State & st1, const State & st2) { return st1.cards == st2.cards && st1.gameData == st2.gameData; @@ -723,10 +723,10 @@ bool operator==( const State & st1, const State & st2) { State *Dealer::getState() { - QCanvasItemList list = canvas()->allItems(); + TQCanvasItemList list = canvas()->allItems(); State * st = new State; - for (QCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it) + for (TQCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it) { if ((*it)->rtti() == Card::RTTI) { Card *c = dynamic_cast<Card*>(*it); @@ -758,9 +758,9 @@ State *Dealer::getState() void Dealer::setState(State *st) { CardStateList * n = &st->cards; - QCanvasItemList list = canvas()->allItems(); + TQCanvasItemList list = canvas()->allItems(); - for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) + for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) { if ((*it)->rtti() == Pile::RTTI) { Pile *p = dynamic_cast<Pile*>(*it); @@ -827,32 +827,32 @@ void Dealer::takeState() ademo->setEnabled( false ); if ( aredeal ) aredeal->setEnabled( false ); - QTimer::singleShot(400, this, SIGNAL(gameLost())); + TQTimer::singleShot(400, this, TQT_SIGNAL(gameLost())); toldAboutLostGame = true; return; } } if (!demoActive() && !waiting()) - QTimer::singleShot(TIME_BETWEEN_MOVES, this, SLOT(startAutoDrop())); + TQTimer::singleShot(TIME_BETWEEN_MOVES, this, TQT_SLOT(startAutoDrop())); emit undoPossible(undoList.count() > 1 && !waiting()); } -void Dealer::saveGame(QDomDocument &doc) { - QDomElement dealer = doc.createElement("dealer"); +void Dealer::saveGame(TQDomDocument &doc) { + TQDomElement dealer = doc.createElement("dealer"); doc.appendChild(dealer); dealer.setAttribute("id", _id); - dealer.setAttribute("number", QString::number(gameNumber())); - QString data = getGameState(); + dealer.setAttribute("number", TQString::number(gameNumber())); + TQString data = getGameState(); if (!data.isEmpty()) dealer.setAttribute("data", data); - dealer.setAttribute("moves", QString::number(getMoves())); + dealer.setAttribute("moves", TQString::number(getMoves())); bool taken[1000]; memset(taken, 0, sizeof(taken)); - QCanvasItemList list = canvas()->allItems(); - for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) + TQCanvasItemList list = canvas()->allItems(); + for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) { if ((*it)->rtti() == Pile::RTTI) { Pile *p = dynamic_cast<Pile*>(*it); @@ -863,7 +863,7 @@ void Dealer::saveGame(QDomDocument &doc) { } taken[p->index()] = true; - QDomElement pile = doc.createElement("pile"); + TQDomElement pile = doc.createElement("pile"); pile.setAttribute("index", p->index()); CardList cards = p->cards(); @@ -871,7 +871,7 @@ void Dealer::saveGame(QDomDocument &doc) { it != cards.end(); ++it) { - QDomElement card = doc.createElement("card"); + TQDomElement card = doc.createElement("card"); card.setAttribute("suit", (*it)->suit()); card.setAttribute("value", (*it)->rank()); card.setAttribute("faceup", (*it)->isFaceUp()); @@ -886,20 +886,20 @@ void Dealer::saveGame(QDomDocument &doc) { } /* - QDomElement eList = doc.createElement("undo"); + TQDomElement eList = doc.createElement("undo"); - QPtrListIterator<State> it(undoList); + TQPtrListIterator<State> it(undoList); for (; it.current(); ++it) { State *n = it.current(); - QDomElement state = doc.createElement("state"); + TQDomElement state = doc.createElement("state"); if (!n->gameData.isEmpty()) state.setAttribute("data", n->gameData); - QDomElement cards = doc.createElement("cards"); - for (QValueList<CardState>::ConstIterator it2 = n->cards.begin(); + TQDomElement cards = doc.createElement("cards"); + for (TQValueList<CardState>::ConstIterator it2 = n->cards.begin(); it2 != n->cards.end(); ++it2) { - QDomElement item = doc.createElement("item"); + TQDomElement item = doc.createElement("item"); (*it2).fillNode(item); cards.appendChild(item); } @@ -911,26 +911,26 @@ void Dealer::saveGame(QDomDocument &doc) { // kdDebug(11111) << doc.toString() << endl; } -void Dealer::openGame(QDomDocument &doc) +void Dealer::openGame(TQDomDocument &doc) { unmarkAll(); - QDomElement dealer = doc.documentElement(); + TQDomElement dealer = doc.documentElement(); setGameNumber(dealer.attribute("number").toULong()); undoList.clear(); - QDomNodeList piles = dealer.elementsByTagName("pile"); + TQDomNodeList piles = dealer.elementsByTagName("pile"); - QCanvasItemList list = canvas()->allItems(); + TQCanvasItemList list = canvas()->allItems(); CardList cards; - for (QCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it) + for (TQCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it) if ((*it)->rtti() == Card::RTTI) cards.append(static_cast<Card*>(*it)); Deck::deck()->collectAndShuffle(); - for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) + for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) { if ((*it)->rtti() == Pile::RTTI) { @@ -939,13 +939,13 @@ void Dealer::openGame(QDomDocument &doc) for (uint i = 0; i < piles.count(); ++i) { - QDomElement pile = piles.item(i).toElement(); + TQDomElement pile = piles.item(i).toElement(); if (pile.attribute("index").toInt() == p->index()) { - QDomNodeList pcards = pile.elementsByTagName("card"); + TQDomNodeList pcards = pile.elementsByTagName("card"); for (uint j = 0; j < pcards.count(); ++j) { - QDomElement card = pcards.item(j).toElement(); + TQDomElement card = pcards.item(j).toElement(); Card::Suit s = static_cast<Card::Suit>(card.attribute("suit").toInt()); Card::Rank v = static_cast<Card::Rank>(card.attribute("value").toInt()); @@ -953,7 +953,7 @@ void Dealer::openGame(QDomDocument &doc) it2 != cards.end(); ++it2) { if ((*it2)->suit() == s && (*it2)->rank() == v) { - if (QString((*it2)->name()) == "Diamonds Eight") { + if (TQString((*it2)->name()) == "Diamonds Eight") { kdDebug(11111) << i << " " << j << endl; } p->add(*it2); @@ -1034,7 +1034,7 @@ void Dealer::setWaiting(bool w) void Dealer::setAutoDropEnabled(bool a) { _autodrop = a; - QTimer::singleShot(TIME_BETWEEN_MOVES, this, SLOT(startAutoDrop())); + TQTimer::singleShot(TIME_BETWEEN_MOVES, this, TQT_SLOT(startAutoDrop())); } bool Dealer::startAutoDrop() @@ -1042,11 +1042,11 @@ bool Dealer::startAutoDrop() if (!autoDrop()) return false; - QCanvasItemList list = canvas()->allItems(); + TQCanvasItemList list = canvas()->allItems(); - for (QCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it) + for (TQCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it) if ((*it)->animated()) { - QTimer::singleShot(TIME_BETWEEN_MOVES, this, SLOT(startAutoDrop())); + TQTimer::singleShot(TIME_BETWEEN_MOVES, this, TQT_SLOT(startAutoDrop())); return true; } @@ -1070,7 +1070,7 @@ bool Dealer::startAutoDrop() t->move(x, y); kdDebug(11111) << "autodrop " << t->name() << endl; t->moveTo(int(t->source()->x()), int(t->source()->y()), int(t->z()), STEPS_AUTODROP); - connect(t, SIGNAL(stoped(Card*)), SLOT(waitForAutoDrop(Card*))); + connect(t, TQT_SIGNAL(stoped(Card*)), TQT_SLOT(waitForAutoDrop(Card*))); return true; } } @@ -1160,20 +1160,20 @@ void Dealer::won() { // wrap in own scope to make KConfigGroupSave work KConfig *config = kapp->config(); KConfigGroupSaver kcs(config, scores_group); - unsigned int n = config->readUnsignedNumEntry(QString("won%1").arg(_id),0) + 1; - config->writeEntry(QString("won%1").arg(_id),n); - n = config->readUnsignedNumEntry(QString("winstreak%1").arg(_id),0) + 1; - config->writeEntry(QString("winstreak%1").arg(_id),n); - unsigned int m = config->readUnsignedNumEntry(QString("maxwinstreak%1").arg(_id),0); + unsigned int n = config->readUnsignedNumEntry(TQString("won%1").arg(_id),0) + 1; + config->writeEntry(TQString("won%1").arg(_id),n); + n = config->readUnsignedNumEntry(TQString("winstreak%1").arg(_id),0) + 1; + config->writeEntry(TQString("winstreak%1").arg(_id),n); + unsigned int m = config->readUnsignedNumEntry(TQString("maxwinstreak%1").arg(_id),0); if (n>m) - config->writeEntry(QString("maxwinstreak%1").arg(_id),n); - config->writeEntry(QString("loosestreak%1").arg(_id),0); + config->writeEntry(TQString("maxwinstreak%1").arg(_id),n); + config->writeEntry(TQString("loosestreak%1").arg(_id),0); } // sort cards by increasing z - QCanvasItemList list = canvas()->allItems(); - QValueList<CardPtr> cards; - for (QCanvasItemList::ConstIterator it=list.begin(); it!=list.end(); ++it) + TQCanvasItemList list = canvas()->allItems(); + TQValueList<CardPtr> cards; + for (TQCanvasItemList::ConstIterator it=list.begin(); it!=list.end(); ++it) if ((*it)->rtti() == Card::RTTI) { CardPtr p; p.ptr = dynamic_cast<Card*>(*it); @@ -1183,16 +1183,16 @@ void Dealer::won() qHeapSort(cards); // disperse the cards everywhere - QRect can(0, 0, canvas()->width(), canvas()->height()); - QValueList<CardPtr>::ConstIterator it = cards.begin(); + TQRect can(0, 0, canvas()->width(), canvas()->height()); + TQValueList<CardPtr>::ConstIterator it = cards.begin(); for (; it != cards.end(); ++it) { (*it).ptr->turn(true); - QRect p(0, 0, (*it).ptr->width(), (*it).ptr->height()); + TQRect p(0, 0, (*it).ptr->width(), (*it).ptr->height()); int x, y; do { x = 3*canvas()->width()/2 - kapp->random() % (canvas()->width() * 2); y = 3*canvas()->height()/2 - (kapp->random() % (canvas()->height() * 2)); - p.moveTopLeft(QPoint(x, y)); + p.moveTopLeft(TQPoint(x, y)); } while (can.intersects(p)); (*it).ptr->moveTo( x, y, 0, STEPS_WON); @@ -1305,7 +1305,7 @@ Card *Dealer::demoNewCards() void Dealer::newDemoMove(Card *m) { towait = m; - connect(m, SIGNAL(stoped(Card*)), SLOT(waitForDemo(Card*))); + connect(m, TQT_SIGNAL(stoped(Card*)), TQT_SLOT(waitForDemo(Card*))); } void Dealer::waitForDemo(Card *t) @@ -1344,8 +1344,8 @@ bool Dealer::checkAdd( int, const Pile *, const CardList&) const { void Dealer::drawPile(KPixmap &pixmap, Pile *pile, bool selected) { - QPixmap bg = myCanvas.backgroundPixmap(); - QRect bounding(int(pile->x()), int(pile->y()), cardMap::CARDX(), cardMap::CARDY()); + TQPixmap bg = myCanvas.backgroundPixmap(); + TQRect bounding(int(pile->x()), int(pile->y()), cardMap::CARDX(), cardMap::CARDY()); pixmap.resize(bounding.width(), bounding.height()); pixmap.fill(Qt::white); @@ -1401,24 +1401,24 @@ int Dealer::freeCells() const return n; } -void Dealer::setAnchorName(const QString &name) +void Dealer::setAnchorName(const TQString &name) { kdDebug(11111) << "setAnchorname " << name << endl; ac = name; } -QString Dealer::anchorName() const { return ac; } +TQString Dealer::anchorName() const { return ac; } -void Dealer::wheelEvent( QWheelEvent *e ) +void Dealer::wheelEvent( TQWheelEvent *e ) { - QWheelEvent ce( viewport()->mapFromGlobal( e->globalPos() ), + TQWheelEvent ce( viewport()->mapFromGlobal( e->globalPos() ), e->globalPos(), e->delta(), e->state()); viewportWheelEvent(&ce); if ( !ce.isAccepted() ) { if ( e->orientation() == Horizontal && hScrollBarMode () == AlwaysOn ) - QApplication::sendEvent( horizontalScrollBar(), e); + TQApplication::sendEvent( horizontalScrollBar(), e); else if (e->orientation() == Vertical && vScrollBarMode () == AlwaysOn ) - QApplication::sendEvent( verticalScrollBar(), e); + TQApplication::sendEvent( verticalScrollBar(), e); } else { e->accept(); } @@ -1430,9 +1430,9 @@ void Dealer::countGame() kdDebug(11111) << "counting game as played." << endl; KConfig *config = kapp->config(); KConfigGroupSaver kcs(config, scores_group); - unsigned int Total = config->readUnsignedNumEntry(QString("total%1").arg(_id),0); + unsigned int Total = config->readUnsignedNumEntry(TQString("total%1").arg(_id),0); ++Total; - config->writeEntry(QString("total%1").arg(_id),Total); + config->writeEntry(TQString("total%1").arg(_id),Total); _gameRecorded = true; } } @@ -1443,12 +1443,12 @@ void Dealer::countLoss() // update score KConfig *config = kapp->config(); KConfigGroupSaver kcs(config, scores_group); - unsigned int n = config->readUnsignedNumEntry(QString("loosestreak%1").arg(_id),0) + 1; - config->writeEntry(QString("loosestreak%1").arg(_id),n); - unsigned int m = config->readUnsignedNumEntry(QString("maxloosestreak%1").arg(_id),0); + unsigned int n = config->readUnsignedNumEntry(TQString("loosestreak%1").arg(_id),0) + 1; + config->writeEntry(TQString("loosestreak%1").arg(_id),n); + unsigned int m = config->readUnsignedNumEntry(TQString("maxloosestreak%1").arg(_id),0); if (n>m) - config->writeEntry(QString("maxloosestreak%1").arg(_id),n); - config->writeEntry(QString("winstreak%1").arg(_id),0); + config->writeEntry(TQString("maxloosestreak%1").arg(_id),n); + config->writeEntry(TQString("winstreak%1").arg(_id),0); } } diff --git a/kpat/dealer.h b/kpat/dealer.h index c5593cbd..fef7e6ce 100644 --- a/kpat/dealer.h +++ b/kpat/dealer.h @@ -19,9 +19,9 @@ public: static DealerInfoList *self(); void add(DealerInfo *); - const QValueList<DealerInfo*> games() const { return list; } + const TQValueList<DealerInfo*> games() const { return list; } private: - QValueList<DealerInfo*> list; + TQValueList<DealerInfo*> list; static DealerInfoList *_self; }; @@ -40,12 +40,12 @@ public: class CardState; -typedef QValueList<CardState> CardStateList; +typedef TQValueList<CardState> CardStateList; struct State { CardStateList cards; - QString gameData; + TQString gameData; }; @@ -65,14 +65,14 @@ public: static const Dealer *instance(); - void enlargeCanvas(QCanvasRectangle *c); + void enlargeCanvas(TQCanvasRectangle *c); void setGameNumber(long gmn); long gameNumber() const; virtual bool isGameWon() const; virtual bool isGameLost() const; - void setViewSize(const QSize &size); + void setViewSize(const TQSize &size); void addPile(Pile *p); void removePile(Pile *p); @@ -89,11 +89,11 @@ public: void drawPile(KPixmap &, Pile *p, bool selected); - QColor midColor() const { return _midcolor; } - void setBackgroundPixmap(const QPixmap &background, const QColor &midcolor); + TQColor midColor() const { return _midcolor; } + void setBackgroundPixmap(const TQPixmap &background, const TQColor &midcolor); - void saveGame(QDomDocument &doc); - void openGame(QDomDocument &doc); + void saveGame(TQDomDocument &doc); + void openGame(TQDomDocument &doc); void setGameId(int id) { _id = id; } int gameId() const { return _id; } @@ -103,13 +103,13 @@ public: bool isMoving(Card *c) const; - virtual QSize minimumCardSize() const; - virtual void resizeEvent(QResizeEvent *); + virtual TQSize minimumCardSize() const; + virtual void resizeEvent(TQResizeEvent *); int freeCells() const; - QString anchorName() const; - void setAnchorName(const QString &name); + TQString anchorName() const; + void setAnchorName(const TQString &name); void setAutoDropEnabled(bool a); bool autoDrop() const { return _autodrop; } @@ -131,7 +131,7 @@ signals: void gameWon(bool withhelp); void gameLost(); void saveGame(); // emergency - void gameInfo(const QString &info); + void gameInfo(const TQString &info); void updateMoves(); public slots: @@ -150,11 +150,11 @@ protected: virtual void restart() = 0; - virtual void contentsMousePressEvent(QMouseEvent* e); - virtual void contentsMouseMoveEvent( QMouseEvent* ); - virtual void contentsMouseReleaseEvent( QMouseEvent* ); - virtual void contentsMouseDoubleClickEvent( QMouseEvent* ); - virtual void wheelEvent( QWheelEvent *e ); + virtual void contentsMousePressEvent(TQMouseEvent* e); + virtual void contentsMouseMoveEvent( TQMouseEvent* ); + virtual void contentsMouseReleaseEvent( TQMouseEvent* ); + virtual void contentsMouseDoubleClickEvent( TQMouseEvent* ); + virtual void wheelEvent( TQWheelEvent *e ); void unmarkAll(); void mark(Card *c); @@ -182,26 +182,26 @@ protected: void setState(State *); // reimplement this to add game-specific information in the state structure - virtual QString getGameState() const { return QString::null; } + virtual TQString getGameState() const { return TQString::null; } // reimplement this to use the game-specific information from the state structure - virtual void setGameState( const QString & ) {} + virtual void setGameState( const TQString & ) {} virtual void newDemoMove(Card *m); bool moved; CardList movingCards; - QCanvasItemList marked; - QPoint moving_start; + TQCanvasItemList marked; + TQPoint moving_start; Dealer( Dealer& ); // don't allow copies or assignments void operator = ( Dealer& ); // don't allow copies or assignments - QCanvas myCanvas; - QSize minsize; - QSize viewsize; - QPtrList<State> undoList; + TQCanvas myCanvas; + TQSize minsize; + TQSize viewsize; + TQPtrList<State> undoList; long gamenumber; - QValueList<MoveHint*> hints; + TQValueList<MoveHint*> hints; Card *towait; - QTimer *demotimer; + TQTimer *demotimer; int myActions; bool toldAboutLostGame; @@ -209,13 +209,13 @@ protected: KAction *ahint, *aredeal; KRandomSequence randseq; - QColor _midcolor; + TQColor _midcolor; Q_UINT32 _id; bool takeTargets; bool _won; int _waiting; bool stop_demo_next; - QString ac; + TQString ac; static Dealer *s_instance; bool _autodrop; bool _gameRecorded; diff --git a/kpat/fortyeight.cpp b/kpat/fortyeight.cpp index 1d867378..1747b647 100644 --- a/kpat/fortyeight.cpp +++ b/kpat/fortyeight.cpp @@ -12,12 +12,12 @@ HorLeftPile::HorLeftPile( int _index, Dealer* parent) setHSpread( cardMap::CARDX() / 11 + 1 ); } -QSize HorLeftPile::cardOffset( bool _spread, bool, const Card *) const +TQSize HorLeftPile::cardOffset( bool _spread, bool, const Card *) const { if (_spread) - return QSize(-hspread(), 0); + return TQSize(-hspread(), 0); - return QSize(0, 0); + return TQSize(0, 0); } void HorLeftPile::initSizes() @@ -35,7 +35,7 @@ Fortyeight::Fortyeight( KMainWindow* parent, const char* name) const int dist_x = cardMap::CARDX() * 11 / 10 + 1; const int dist_y = cardMap::CARDY() * 11 / 10 + 1; - connect(deck, SIGNAL(clicked(Card*)), SLOT(deckClicked(Card*))); + connect(deck, TQT_SIGNAL(clicked(Card*)), TQT_SLOT(deckClicked(Card*))); deck->move(10 + cardMap::CARDX() * 82 / 10, 10 + cardMap::CARDX() * 56 / 10); deck->setZ(20); @@ -124,12 +124,12 @@ void Fortyeight::deal() pile->add(deck->nextCard(), false, false); } -QString Fortyeight::getGameState() const +TQString Fortyeight::getGameState() const { - return QString::number(lastdeal); + return TQString::number(lastdeal); } -void Fortyeight::setGameState( const QString &s ) +void Fortyeight::setGameState( const TQString &s ) { lastdeal = s.toInt(); } diff --git a/kpat/fortyeight.h b/kpat/fortyeight.h index 858e6e15..80303c0e 100644 --- a/kpat/fortyeight.h +++ b/kpat/fortyeight.h @@ -9,7 +9,7 @@ class HorLeftPile : public Pile public: HorLeftPile( int _index, Dealer* parent = 0); - virtual QSize cardOffset( bool _spread, bool _facedown, const Card *before) const; + virtual TQSize cardOffset( bool _spread, bool _facedown, const Card *before) const; virtual void initSizes(); }; @@ -29,8 +29,8 @@ public slots: protected: virtual bool checkAdd( int checkIndex, const Pile *c1, const CardList& c2) const; virtual Card *demoNewCards(); - virtual QString getGameState() const; - virtual void setGameState( const QString & stream ); + virtual TQString getGameState() const; + virtual void setGameState( const TQString & stream ); private: Pile *stack[8]; diff --git a/kpat/freecell.cpp b/kpat/freecell.cpp index 7a72c1fc..ff8a5b1a 100644 --- a/kpat/freecell.cpp +++ b/kpat/freecell.cpp @@ -26,7 +26,7 @@ #include <kdebug.h> #include <stdio.h> #include <stdlib.h> -#include <qtimer.h> +#include <tqtimer.h> #include "cardmaps.h" #include "freecell-solver/fcs_user.h" @@ -102,7 +102,7 @@ void FreecellBase::restart() deal(); } -QString suitToString(Card::Suit s) { +TQString suitToString(Card::Suit s) { switch (s) { case Card::Clubs: return "C"; @@ -113,10 +113,10 @@ QString suitToString(Card::Suit s) { case Card::Spades: return "S"; } - return QString::null; + return TQString::null; } -QString rankToString(Card::Rank r) +TQString rankToString(Card::Rank r) { switch (r) { case Card::King: @@ -128,7 +128,7 @@ QString rankToString(Card::Rank r) case Card::Queen: return "Q"; default: - return QString::number(r); + return TQString::number(r); } } @@ -211,7 +211,7 @@ void FreecellBase::findSolution() { kdDebug(11111) << "findSolution\n"; - QString output = solverFormat(); + TQString output = solverFormat(); kdDebug(11111) << output << endl; int ret; @@ -313,7 +313,7 @@ void FreecellBase::resumeSolution() } solver_ret = freecell_solver_user_resume_solution(solver_instance); - QTimer::singleShot(0, this, SLOT(resumeSolution())); + TQTimer::singleShot(0, this, TQT_SLOT(resumeSolution())); } MoveHint *FreecellBase::translateMove(void *m) { @@ -369,17 +369,17 @@ MoveHint *FreecellBase::translateMove(void *m) { return new MoveHint(c, to); } -QString FreecellBase::solverFormat() const +TQString FreecellBase::solverFormat() const { - QString output; - QString tmp; + TQString output; + TQString tmp; for (uint i = 0; i < target.count(); i++) { if (target[i]->isEmpty()) continue; tmp += suitToString(target[i]->top()->suit()) + "-" + rankToString(target[i]->top()->rank()) + " "; } if (!tmp.isEmpty()) - output += QString::fromLatin1("Foundations: %1\n").arg(tmp); + output += TQString::fromLatin1("Foundations: %1\n").arg(tmp); tmp.truncate(0); for (uint i = 0; i < freecell.count(); i++) { @@ -389,7 +389,7 @@ QString FreecellBase::solverFormat() const tmp += rankToString(freecell[i]->top()->rank()) + suitToString(freecell[i]->top()->suit()) + " "; } if (!tmp.isEmpty()) - output += QString::fromLatin1("Freecells: %1\n").arg(tmp); + output += TQString::fromLatin1("Freecells: %1\n").arg(tmp); for (uint i = 0; i < store.count(); i++) { @@ -602,7 +602,7 @@ void FreecellBase::moveCards(CardList &c, FreecellPile *from, Pile *to) from->moveCardsBack(c); waitfor = c.first(); - connect(waitfor, SIGNAL(stoped(Card*)), SLOT(waitForMoving(Card*))); + connect(waitfor, TQT_SIGNAL(stoped(Card*)), TQT_SLOT(waitForMoving(Card*))); PileList fcs; @@ -625,7 +625,7 @@ void FreecellBase::moveCards(CardList &c, FreecellPile *from, Pile *to) movePileToPile(c, to, fss, fcs, 0, c.count(), 0); if (!waitfor->animated()) - QTimer::singleShot(0, this, SLOT(startMoving())); + TQTimer::singleShot(0, this, TQT_SLOT(startMoving())); } struct MoveAway { @@ -645,7 +645,7 @@ void FreecellBase::movePileToPile(CardList &c, Pile *to, PileList fss, PileList } kdDebug(11111) << debug_level << " moveaway " << moveaway << endl; - QValueList<MoveAway> moves_away; + TQValueList<MoveAway> moves_away; if (count - moveaway < (fcs.count() + 1) && (count <= 2 * (fcs.count() + 1))) { moveaway = count - (fcs.count() + 1); @@ -707,7 +707,7 @@ void FreecellBase::startMoving() mh->pile()->moveCardsBack(empty, true); waitfor = mh->card(); kdDebug(11111) << "wait for moving end " << mh->card()->name() << endl; - connect(mh->card(), SIGNAL(stoped(Card*)), SLOT(waitForMoving(Card*))); + connect(mh->card(), TQT_SIGNAL(stoped(Card*)), TQT_SLOT(waitForMoving(Card*))); delete mh; } diff --git a/kpat/freecell.h b/kpat/freecell.h index aba311b6..b2b94dad 100644 --- a/kpat/freecell.h +++ b/kpat/freecell.h @@ -39,7 +39,7 @@ public: FreecellBase( int decks, int stores, int freecells, int es_filling, bool unlimited_move, KMainWindow* parent=0, const char* name=0); void moveCards(CardList &c, FreecellPile *from, Pile *to); - QString solverFormat() const; + TQString solverFormat() const; virtual ~FreecellBase(); public slots: @@ -63,7 +63,7 @@ protected: void movePileToPile(CardList &c, Pile *to, PileList fss, PileList &fcs, uint start, uint count, int debug_level); - Pile *pileForName(QString line) const; + Pile *pileForName(TQString line) const; void findSolution(); virtual MoveHint *chooseHint(); @@ -75,7 +75,7 @@ protected: virtual bool cardDblClicked(Card *c); protected: - QValueList<FreecellPile*> store; + TQValueList<FreecellPile*> store; PileList freecell; PileList target; Deck *deck; diff --git a/kpat/gamestatsimpl.cpp b/kpat/gamestatsimpl.cpp index a3a67a43..11b95fee 100644 --- a/kpat/gamestatsimpl.cpp +++ b/kpat/gamestatsimpl.cpp @@ -2,18 +2,18 @@ #include "dealer.h" #include "version.h" -#include <qcombobox.h> -#include <qlabel.h> +#include <tqcombobox.h> +#include <tqlabel.h> #include <kapplication.h> #include <kconfig.h> #include <klocale.h> -GameStatsImpl::GameStatsImpl(QWidget* aParent, const char* aname) +GameStatsImpl::GameStatsImpl(TQWidget* aParent, const char* aname) : GameStats(aParent, aname) { - QStringList list; - QValueList<DealerInfo*>::ConstIterator it; + TQStringList list; + TQValueList<DealerInfo*>::ConstIterator it; for (it = DealerInfoList::self()->games().begin(); it != DealerInfoList::self()->games().end(); ++it) { @@ -42,16 +42,16 @@ void GameStatsImpl::setGameType(int id) languageChange(); KConfig *config = kapp->config(); KConfigGroupSaver kcs(config, scores_group); - unsigned int t = config->readUnsignedNumEntry(QString("total%1").arg(id),0); + unsigned int t = config->readUnsignedNumEntry(TQString("total%1").arg(id),0); Played->setText(Played->text().arg(t)); - unsigned int w = config->readUnsignedNumEntry(QString("won%1").arg(id),0); + unsigned int w = config->readUnsignedNumEntry(TQString("won%1").arg(id),0); Won->setText(Won->text().arg(w)); if (t) WonPerc->setText(WonPerc->text().arg(w*100/t)); else WonPerc->setText(WonPerc->text().arg(0)); WinStreak->setText( - WinStreak->text().arg(config->readUnsignedNumEntry(QString("maxwinstreak%1").arg(id),0))); + WinStreak->text().arg(config->readUnsignedNumEntry(TQString("maxwinstreak%1").arg(id),0))); LooseStreak->setText( - LooseStreak->text().arg(config->readUnsignedNumEntry(QString("maxloosestreak%1").arg(id),0))); + LooseStreak->text().arg(config->readUnsignedNumEntry(TQString("maxloosestreak%1").arg(id),0))); } diff --git a/kpat/gamestatsimpl.h b/kpat/gamestatsimpl.h index 192b7793..5a884017 100644 --- a/kpat/gamestatsimpl.h +++ b/kpat/gamestatsimpl.h @@ -6,7 +6,7 @@ class GameStatsImpl : public GameStats { public: - GameStatsImpl(QWidget* aParent, const char* aname); + GameStatsImpl(TQWidget* aParent, const char* aname); virtual void setGameType(int i); virtual void showGameType(int i); diff --git a/kpat/golf.cpp b/kpat/golf.cpp index 71bdfbb5..053525da 100644 --- a/kpat/golf.cpp +++ b/kpat/golf.cpp @@ -9,12 +9,12 @@ HorRightPile::HorRightPile( int _index, Dealer* parent) { } -QSize HorRightPile::cardOffset( bool _spread, bool, const Card *) const +TQSize HorRightPile::cardOffset( bool _spread, bool, const Card *) const { if (_spread) - return QSize(+hspread(), 0); + return TQSize(+hspread(), 0); - return QSize(0, 0); + return TQSize(0, 0); } //-------------------------------------------------------------------------// @@ -27,7 +27,7 @@ Golf::Golf( KMainWindow* parent, const char* _name) deck = Deck::new_deck( this); deck->move(10, pile_dist); - connect(deck, SIGNAL(clicked(Card*)), SLOT(deckClicked(Card*))); + connect(deck, TQT_SIGNAL(clicked(Card*)), TQT_SLOT(deckClicked(Card*))); for( int r = 0; r < 7; r++ ) { stack[r]=new Pile(1+r, this); diff --git a/kpat/golf.h b/kpat/golf.h index 9c3b6421..7729e8f4 100644 --- a/kpat/golf.h +++ b/kpat/golf.h @@ -9,7 +9,7 @@ class HorRightPile : public Pile public: HorRightPile( int _index, Dealer* parent = 0); - virtual QSize cardOffset( bool _spread, bool _facedown, const Card *before) const; + virtual TQSize cardOffset( bool _spread, bool _facedown, const Card *before) const; }; class Golf : public Dealer diff --git a/kpat/grandf.cpp b/kpat/grandf.cpp index 9756b840..c15c6103 100644 --- a/kpat/grandf.cpp +++ b/kpat/grandf.cpp @@ -146,12 +146,12 @@ bool Grandf::checkAdd( int checkIndex, const Pile *c1, const CardList& c2) const && c2.first()->suit() == c1->top()->suit(); } -QString Grandf::getGameState() const +TQString Grandf::getGameState() const { - return QString::number(numberOfDeals); + return TQString::number(numberOfDeals); } -void Grandf::setGameState( const QString &s) +void Grandf::setGameState( const TQString &s) { numberOfDeals = s.toInt(); aredeal->setEnabled(numberOfDeals < 3); diff --git a/kpat/grandf.h b/kpat/grandf.h index db24483f..4c07abc1 100644 --- a/kpat/grandf.h +++ b/kpat/grandf.h @@ -50,8 +50,8 @@ public slots: protected: void collect(); virtual bool checkAdd ( int checkIndex, const Pile *c1, const CardList& c2) const; - virtual QString getGameState() const; - virtual void setGameState( const QString & stream ); + virtual TQString getGameState() const; + virtual void setGameState( const TQString & stream ); virtual Card *demoNewCards(); private: diff --git a/kpat/gypsy.cpp b/kpat/gypsy.cpp index db58f7cd..5432336a 100644 --- a/kpat/gypsy.cpp +++ b/kpat/gypsy.cpp @@ -12,7 +12,7 @@ Gypsy::Gypsy( KMainWindow* parent, const char *name ) deck = Deck::new_deck(this, 2); deck->move(10 + dist_x / 2 + 8*dist_x, 10 + 45 * cardMap::CARDY() / 10); - connect(deck, SIGNAL(clicked(Card*)), SLOT(slotClicked(Card *))); + connect(deck, TQT_SIGNAL(clicked(Card*)), TQT_SLOT(slotClicked(Card *))); for (int i=0; i<8; i++) { target[i] = new Pile(i+1, this); diff --git a/kpat/hint.h b/kpat/hint.h index 1d1c2594..8ebf9ed5 100644 --- a/kpat/hint.h +++ b/kpat/hint.h @@ -22,7 +22,7 @@ private: }; -typedef QValueList<MoveHint*> HintList; +typedef TQValueList<MoveHint*> HintList; #endif diff --git a/kpat/klondike.cpp b/kpat/klondike.cpp index ff561fa3..dcf4c1f8 100644 --- a/kpat/klondike.cpp +++ b/kpat/klondike.cpp @@ -40,11 +40,11 @@ public: void addSpread(Card *c) { cardlist.append(c); } - virtual QSize cardOffset( bool _spread, bool, const Card *c) const { + virtual TQSize cardOffset( bool _spread, bool, const Card *c) const { kdDebug(11111) << "cardOffset " << _spread << " " << (c? c->name() : "(null)") << endl; if (cardlist.contains(const_cast<Card * const>(c))) - return QSize(+dspread(), 0); - return QSize(0, 0); + return TQSize(+dspread(), 0); + return TQSize(0, 0); } private: CardList cardlist; diff --git a/kpat/mod3.cpp b/kpat/mod3.cpp index c69aa8e4..45a8d026 100644 --- a/kpat/mod3.cpp +++ b/kpat/mod3.cpp @@ -37,7 +37,7 @@ Mod3::Mod3( KMainWindow* parent, const char* _name) deck = Deck::new_deck( this, 2); deck->move(8 + dist_x * 8 + 20, 8 + dist_y * 3 + margin); - connect(deck, SIGNAL(clicked(Card*)), SLOT(deckClicked(Card*))); + connect(deck, TQT_SIGNAL(clicked(Card*)), TQT_SLOT(deckClicked(Card*))); aces = new Pile(50, this); aces->move(16 + dist_x * 8, 8 + dist_y / 2); diff --git a/kpat/napoleon.cpp b/kpat/napoleon.cpp index ffdf245c..7f7c7f95 100644 --- a/kpat/napoleon.cpp +++ b/kpat/napoleon.cpp @@ -26,7 +26,7 @@ Napoleon::Napoleon( KMainWindow* parent, const char* _name ) : Dealer( parent, _name ) { deck = Deck::new_deck( this ); - connect(deck, SIGNAL(clicked(Card *)), SLOT(deal1(Card*))); + connect(deck, TQT_SIGNAL(clicked(Card *)), TQT_SLOT(deal1(Card*))); pile = new Pile( 1, this ); pile->setAddFlags( Pile::disallow ); diff --git a/kpat/pile.cpp b/kpat/pile.cpp index dd419580..50a15bab 100644 --- a/kpat/pile.cpp +++ b/kpat/pile.cpp @@ -1,7 +1,7 @@ #include "pile.h" #include "dealer.h" #include <kdebug.h> -#include <qpainter.h> +#include <tqpainter.h> #include "cardmaps.h" #include <assert.h> #include "speeds.h" @@ -22,7 +22,7 @@ const int Pile::wholeColumn = 0x0400; Pile::Pile( int _index, Dealer* _dealer) - : QCanvasRectangle( _dealer->canvas() ), + : TQCanvasRectangle( _dealer->canvas() ), m_dealer(_dealer), m_atype(Custom), m_rtype(Custom), @@ -32,13 +32,13 @@ Pile::Pile( int _index, Dealer* _dealer) // Make the patience aware of this pile. dealer()->addPile(this); - QCanvasRectangle::setVisible(true); // default + TQCanvasRectangle::setVisible(true); // default _checkIndex = -1; m_addFlags = 0; m_removeFlags = 0; setBrush(Qt::black); - setPen(QPen(Qt::black)); + setPen(TQPen(Qt::black)); setZ(0); initSizes(); @@ -119,7 +119,7 @@ void Pile::resetCache() cache_selected.resize(0, 0); } -void Pile::drawShape ( QPainter & painter ) +void Pile::drawShape ( TQPainter & painter ) { if (isSelected()) { if (cache.isNull()) @@ -193,7 +193,7 @@ bool Pile::legalRemove(const Card *c) const void Pile::setVisible(bool vis) { - QCanvasRectangle::setVisible(vis); + TQCanvasRectangle::setVisible(vis); dealer()->enlargeCanvas(this); for (CardList::Iterator it = m_cards.begin(); it != m_cards.end(); ++it) @@ -205,7 +205,7 @@ void Pile::setVisible(bool vis) void Pile::moveBy(double dx, double dy) { - QCanvasRectangle::moveBy(dx, dy); + TQCanvasRectangle::moveBy(dx, dy); dealer()->enlargeCanvas(this); for (CardList::Iterator it = m_cards.begin(); it != m_cards.end(); ++it) @@ -277,20 +277,20 @@ void Pile::add( Card *_card, int index) // // Note: Default is to only have vertical spread (Y direction). -QSize Pile::cardOffset( bool _spread, bool _facedown, const Card *before) const +TQSize Pile::cardOffset( bool _spread, bool _facedown, const Card *before) const { if (_spread) { if (_facedown) - return QSize(0, dspread()); + return TQSize(0, dspread()); else { if (before && !before->isFaceUp()) - return QSize(0, dspread()); + return TQSize(0, dspread()); else - return QSize(0, spread()); + return TQSize(0, spread()); } } - return QSize(0, 0); + return TQSize(0, 0); } /* override cardtype (for initial deal ) */ @@ -310,7 +310,7 @@ void Pile::add( Card* _card, bool _facedown, bool _spread ) _card->turn( !_facedown ); - QSize offset = cardOffset(_spread, _facedown, t); + TQSize offset = cardOffset(_spread, _facedown, t); int x2, y2, z2; @@ -408,7 +408,7 @@ void Pile::moveCardsBack(CardList &cl, bool anim) Card *c = cl.first(); Card *before = 0; - QSize off; + TQSize off; int steps = STEPS_MOVEBACK; if (!anim) diff --git a/kpat/pile.h b/kpat/pile.h index b2b553b0..7dd14f3c 100644 --- a/kpat/pile.h +++ b/kpat/pile.h @@ -15,7 +15,7 @@ class Dealer; * */ -class Pile : public QObject, public QCanvasRectangle +class Pile : public TQObject, public QCanvasRectangle { Q_OBJECT @@ -73,7 +73,7 @@ public: int index() const { return myIndex; } bool isEmpty() const { return m_cards.count() == 0; } - virtual void drawShape ( QPainter & p ); + virtual void drawShape ( TQPainter & p ); static const int RTTI; virtual int rtti() const { return RTTI; } @@ -89,7 +89,7 @@ public: void hideCards( const CardList & cards ); void unhideCards( const CardList & cards ); - virtual QSize cardOffset( bool _spread, bool _facedown, const Card *before) const; + virtual TQSize cardOffset( bool _spread, bool _facedown, const Card *before) const; void resetCache(); virtual void initSizes(); @@ -149,6 +149,6 @@ private: KPixmap cache_selected; }; -typedef QValueList<Pile*> PileList; +typedef TQValueList<Pile*> PileList; #endif diff --git a/kpat/pwidget.cpp b/kpat/pwidget.cpp index dae69f60..eb12a1c8 100644 --- a/kpat/pwidget.cpp +++ b/kpat/pwidget.cpp @@ -20,9 +20,9 @@ #include <stdio.h> -#include <qregexp.h> -#include <qtimer.h> -#include <qimage.h> +#include <tqregexp.h> +#include <tqtimer.h> +#include <tqimage.h> #include <kapplication.h> #include <klocale.h> @@ -59,32 +59,32 @@ pWidget::pWidget() { current_pwidget = this; // KCrash::setEmergencySaveFunction(::saveGame); - KStdAction::quit(kapp, SLOT(quit()), actionCollection(), "game_exit"); + KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection(), "game_exit"); - undo = KStdAction::undo(this, SLOT(undoMove()), + undo = KStdAction::undo(this, TQT_SLOT(undoMove()), actionCollection(), "undo_move"); undo->setEnabled(false); - (void)KStdAction::openNew(this, SLOT(newGame()), + (void)KStdAction::openNew(this, TQT_SLOT(newGame()), actionCollection(), "new_game"); - (void)KStdAction::open(this, SLOT(openGame()), + (void)KStdAction::open(this, TQT_SLOT(openGame()), actionCollection(), "open"); - recent = KStdAction::openRecent(this, SLOT(openGame(const KURL&)), + recent = KStdAction::openRecent(this, TQT_SLOT(openGame(const KURL&)), actionCollection(), "open_recent"); recent->loadEntries(KGlobal::config()); - (void)KStdAction::saveAs(this, SLOT(saveGame()), + (void)KStdAction::saveAs(this, TQT_SLOT(saveGame()), actionCollection(), "save"); - (void)new KAction(i18n("&Choose Game..."), 0, this, SLOT(chooseGame()), + (void)new KAction(i18n("&Choose Game..."), 0, this, TQT_SLOT(chooseGame()), actionCollection(), "choose_game"); - (void)new KAction(i18n("Restart &Game"), QString::fromLatin1("reload"), 0, - this, SLOT(restart()), + (void)new KAction(i18n("Restart &Game"), TQString::fromLatin1("reload"), 0, + this, TQT_SLOT(restart()), actionCollection(), "restart_game"); - (void)KStdAction::help(this, SLOT(helpGame()), actionCollection(), "help_game"); + (void)KStdAction::help(this, TQT_SLOT(helpGame()), actionCollection(), "help_game"); games = new KSelectAction(i18n("&Game Type"), 0, this, - SLOT(newGameType()), + TQT_SLOT(newGameType()), actionCollection(), "game_type"); - QStringList list; - QValueList<DealerInfo*>::ConstIterator it; + TQStringList list; + TQValueList<DealerInfo*>::ConstIterator it; uint max_type = 0; for (it = DealerInfoList::self()->games().begin(); @@ -105,18 +105,18 @@ pWidget::pWidget() KGlobal::dirs()->addResourceType("wallpaper", KStandardDirs::kde_default("data") + "kpat/backgrounds/"); KGlobal::dirs()->addResourceType("wallpaper", KStandardDirs::kde_default("data") + "ksnake/backgrounds/"); wallpapers = new KSelectAction(i18n("&Change Background"), 0, this, - SLOT(changeWallpaper()), + TQT_SLOT(changeWallpaper()), actionCollection(), "wallpaper"); list.clear(); wallpaperlist.clear(); - QStringList wallpaperlist2 = KGlobal::dirs()->findAllResources("wallpaper", QString::null, + TQStringList wallpaperlist2 = KGlobal::dirs()->findAllResources("wallpaper", TQString::null, false, true, list); - QStringList list2; - for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { - QString file = *it; + TQStringList list2; + for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { + TQString file = *it; int rindex = file.findRev('.'); if (rindex != -1) { - QString ext = file.mid(rindex + 1).lower(); + TQString ext = file.mid(rindex + 1).lower(); if (ext == "jpeg" || ext == "png" || ext == "jpg") { list2.append(file.left(rindex)); wallpaperlist.append( file ); @@ -132,27 +132,27 @@ pWidget::pWidget() (void)new cardMap(midcolor); backs = new KAction(i18n("&Switch Cards..."), 0, this, - SLOT(changeBackside()), + TQT_SLOT(changeBackside()), actionCollection(), "backside"); - stats = new KAction(i18n("&Statistics"), 0, this, SLOT(showStats()), + stats = new KAction(i18n("&Statistics"), 0, this, TQT_SLOT(showStats()), actionCollection(),"game_stats"); animation = new KToggleAction(i18n( "&Animation on Startup" ), - 0, this, SLOT(animationChanged()), + 0, this, TQT_SLOT(animationChanged()), actionCollection(), "animation"); dropaction = new KToggleAction(i18n("&Enable Autodrop"), - 0, this, SLOT(enableAutoDrop()), + 0, this, TQT_SLOT(enableAutoDrop()), actionCollection(), "enable_autodrop"); dropaction->setCheckedState(i18n("Disable Autodrop")); KConfig *config = kapp->config(); KConfigGroupSaver cs(config, settings_group ); - QString bgpath = config->readPathEntry("Background"); + TQString bgpath = config->readPathEntry("Background"); kdDebug(11111) << "bgpath '" << bgpath << "'" << endl; if (bgpath.isEmpty()) bgpath = locate("wallpaper", "No-Ones-Laughing-3.jpg"); - background = QPixmap(bgpath); + background = TQPixmap(bgpath); bool animate = config->readBoolEntry( "Animation", true); animation->setChecked( animate ); @@ -167,7 +167,7 @@ pWidget::pWidget() statusBar()->insertItem( "", 1, 0, true ); - createGUI(QString::null, false); + createGUI(TQString::null, false); KAcceleratorManager::manage(menuBar()); newGameType(); @@ -201,13 +201,13 @@ void pWidget::changeBackside() { KConfig *config = kapp->config(); KConfigGroupSaver kcs(config, settings_group); - QString deck = config->readEntry("Back", KCardDialog::getDefaultDeck()); - QString cards = config->readEntry("Cards", KCardDialog::getDefaultCardDir()); - if (KCardDialog::getCardDeck(deck, cards, this, KCardDialog::Both) == QDialog::Accepted) + TQString deck = config->readEntry("Back", KCardDialog::getDefaultDeck()); + TQString cards = config->readEntry("Cards", KCardDialog::getDefaultCardDir()); + if (KCardDialog::getCardDeck(deck, cards, this, KCardDialog::Both) == TQDialog::Accepted) { - QString imgname = KCardDialog::getCardPath(cards, 11); + TQString imgname = KCardDialog::getCardPath(cards, 11); - QImage image; + TQImage image; image.load(imgname); if( image.isNull()) { kdDebug(11111) << "cannot load card pixmap \"" << imgname << "\" in " << cards << "\n"; @@ -234,16 +234,16 @@ void pWidget::changeBackside() { void pWidget::changeWallpaper() { - QString bgpath=locate("wallpaper", wallpaperlist[wallpapers->currentItem()]); + TQString bgpath=locate("wallpaper", wallpaperlist[wallpapers->currentItem()]); if (bgpath.isEmpty()) return; - background = QPixmap(bgpath); + background = TQPixmap(bgpath); if (background.isNull()) { KMessageBox::sorry(this, i18n("<qt>Couldn't load wallpaper<br/>%1</qt>").arg(bgpath)); return; } - QImage bg = background.convertToImage().convertDepth(8, 0); + TQImage bg = background.convertToImage().convertDepth(8, 0); if (bg.isNull() || !bg.numColors()) return; long r = 0; @@ -259,14 +259,14 @@ void pWidget::changeWallpaper() r /= bg.numColors(); b /= bg.numColors(); g /= bg.numColors(); - midcolor = QColor(r, b, g); + midcolor = TQColor(r, b, g); if (dill) { KConfig *config = kapp->config(); KConfigGroupSaver kcs(config, settings_group); - QString deck = config->readEntry("Back", KCardDialog::getDefaultDeck()); - QString dummy = config->readEntry("Cards", KCardDialog::getDefaultCardDir()); + TQString deck = config->readEntry("Back", KCardDialog::getDefaultDeck()); + TQString dummy = config->readEntry("Cards", KCardDialog::getDefaultCardDir()); setBackSide(deck, dummy); config->writePathEntry("Background", bgpath); @@ -322,12 +322,12 @@ void pWidget::restart() void pWidget::setGameCaption() { - QString name = games->currentText(); - QString newname; - QString gamenum; + TQString name = games->currentText(); + TQString newname; + TQString gamenum; gamenum.setNum( dill->gameNumber() ); for (uint i = 0; i < name.length(); i++) - if (name.at(i) != QChar('&')) + if (name.at(i) != TQChar('&')) newname += name.at(i); setCaption( newname + " - " + gamenum ); @@ -340,18 +340,18 @@ void pWidget::newGameType() slotUpdateMoves(); uint id = games->currentItem(); - for (QValueList<DealerInfo*>::ConstIterator it = DealerInfoList::self()->games().begin(); it != DealerInfoList::self()->games().end(); ++it) { + for (TQValueList<DealerInfo*>::ConstIterator it = DealerInfoList::self()->games().begin(); it != DealerInfoList::self()->games().end(); ++it) { if ((*it)->gameindex == id) { dill = (*it)->createGame(this); - QString name = (*it)->name; - name = name.replace(QRegExp("[&']"), ""); - name = name.replace(QRegExp("[ ]"), "_").lower(); + TQString name = (*it)->name; + name = name.replace(TQRegExp("[&']"), ""); + name = name.replace(TQRegExp("[ ]"), "_").lower(); dill->setAnchorName("game_" + name); - connect(dill, SIGNAL(saveGame()), SLOT(saveGame())); - connect(dill, SIGNAL(gameInfo(const QString&)), - SLOT(slotGameInfo(const QString &))); - connect(dill, SIGNAL(updateMoves()), - SLOT(slotUpdateMoves())); + connect(dill, TQT_SIGNAL(saveGame()), TQT_SLOT(saveGame())); + connect(dill, TQT_SIGNAL(gameInfo(const TQString&)), + TQT_SLOT(slotGameInfo(const TQString &))); + connect(dill, TQT_SIGNAL(updateMoves()), + TQT_SLOT(slotUpdateMoves())); dill->setGameId(id); dill->setupActions(); dill->setBackgroundPixmap(background, midcolor); @@ -365,9 +365,9 @@ void pWidget::newGameType() dill = DealerInfoList::self()->games().first()->createGame(this); } - connect(dill, SIGNAL(undoPossible(bool)), SLOT(undoPossible(bool))); - connect(dill, SIGNAL(gameWon(bool)), SLOT(gameWon(bool))); - connect(dill, SIGNAL(gameLost()), SLOT(gameLost())); + connect(dill, TQT_SIGNAL(undoPossible(bool)), TQT_SLOT(undoPossible(bool))); + connect(dill, TQT_SIGNAL(gameWon(bool)), TQT_SLOT(gameWon(bool))); + connect(dill, TQT_SIGNAL(gameLost()), TQT_SLOT(gameLost())); dill->setAutoDropEnabled(dropaction->isChecked()); @@ -381,7 +381,7 @@ void pWidget::newGameType() KConfigGroupSaver kcs(config, settings_group); config->writeEntry("DefaultGame", id); - QSize min(700,400); + TQSize min(700,400); min = min.expandedTo(dill->minimumCardSize()); dill->setMinimumSize(min); dill->resize(min); @@ -390,14 +390,14 @@ void pWidget::newGameType() dill->show(); } -void pWidget::showEvent(QShowEvent *e) +void pWidget::showEvent(TQShowEvent *e) { if (dill) - dill->setMinimumSize(QSize(0,0)); + dill->setMinimumSize(TQSize(0,0)); KMainWindow::showEvent(e); } -void pWidget::slotGameInfo(const QString &text) +void pWidget::slotGameInfo(const TQString &text) { statusBar()->message(text, 3000); } @@ -409,11 +409,11 @@ void pWidget::slotUpdateMoves() statusBar()->changeItem( i18n("1 move", "%n moves", moves), 1 ); } -void pWidget::setBackSide(const QString &deck, const QString &cards) +void pWidget::setBackSide(const TQString &deck, const TQString &cards) { KConfig *config = kapp->config(); KConfigGroupSaver kcs(config, settings_group); - QPixmap pm(deck); + TQPixmap pm(deck); if(!pm.isNull()) { cardMap::self()->setBackSide(pm, false); config->writeEntry("Back", deck); @@ -437,7 +437,7 @@ void pWidget::setBackSide(const QString &deck, const QString &cards) void pWidget::chooseGame() { bool ok; - long number = KInputDialog::getText(i18n("Game Number"), i18n("Enter a game number (FreeCell deals are the same as in the FreeCell FAQ):"), QString::number(dill->gameNumber()), 0, this).toLong(&ok); + long number = KInputDialog::getText(i18n("Game Number"), i18n("Enter a game number (FreeCell deals are the same as in the FreeCell FAQ):"), TQString::number(dill->gameNumber()), 0, this).toLong(&ok); if (ok) { dill->setGameNumber(number); setGameCaption(); @@ -447,7 +447,7 @@ void pWidget::chooseGame() void pWidget::gameWon(bool withhelp) { - QString congrats; + TQString congrats; if (withhelp) congrats = i18n("Congratulations! We have won!"); else @@ -455,7 +455,7 @@ void pWidget::gameWon(bool withhelp) #if TEST_SOLVER == 0 KMessageBox::information(this, congrats, i18n("Congratulations!")); #endif - QTimer::singleShot(0, this, SLOT(newGame())); + TQTimer::singleShot(0, this, TQT_SLOT(newGame())); #if TEST_SOLVER == 1 dill->demo(); #endif @@ -463,17 +463,17 @@ void pWidget::gameWon(bool withhelp) void pWidget::gameLost() { - QString dontAskAgainName = "gameLostDontAskAgain"; + TQString dontAskAgainName = "gameLostDontAskAgain"; // The following code is taken out of kmessagebox.cpp in kdeui. // Is there a better way? KConfig *config = 0; - QString grpNotifMsgs = QString::fromLatin1("Notification Messages"); + TQString grpNotifMsgs = TQString::fromLatin1("Notification Messages"); config = KGlobal::config(); KConfigGroupSaver saver(config, - QString::fromLatin1("Notification Messages")); - QString dontAsk = config->readEntry(dontAskAgainName).lower(); + TQString::fromLatin1("Notification Messages")); + TQString dontAsk = config->readEntry(dontAskAgainName).lower(); // If we are ordered never to ask again and to continue the game, // then do so. @@ -482,7 +482,7 @@ void pWidget::gameLost() // If it says yes, we ask anyway. Just starting a new game would // be incredibly annoying. if (dontAsk == "yes") - dontAskAgainName = QString::null; + dontAskAgainName = TQString::null; if (KMessageBox::questionYesNo(this, i18n("You could not win this game, " "but there is always a second try.\nStart a new game?"), @@ -491,19 +491,19 @@ void pWidget::gameLost() KStdGuiItem::cont(), dontAskAgainName) == KMessageBox::Yes) { - QTimer::singleShot(0, this, SLOT(newGame())); + TQTimer::singleShot(0, this, TQT_SLOT(newGame())); } } void pWidget::openGame(const KURL &url) { - QString tmpFile; + TQString tmpFile; if( KIO::NetAccess::download( url, tmpFile, this ) ) { - QFile of(tmpFile); + TQFile of(tmpFile); of.open(IO_ReadOnly); - QDomDocument doc; - QString error; + TQDomDocument doc; + TQString error; if (!doc.setContent(&of, &error)) { KMessageBox::sorry(this, error); @@ -538,9 +538,9 @@ void pWidget::saveGame() { KURL url = KFileDialog::getSaveURL(); KTempFile file; - QDomDocument doc("kpat"); + TQDomDocument doc("kpat"); dill->saveGame(doc); - QTextStream *stream = file.textStream(); + TQTextStream *stream = file.textStream(); *stream << doc.toString(); file.close(); KIO::NetAccess::upload(file.name(), url, this); diff --git a/kpat/pwidget.h b/kpat/pwidget.h index 8781960f..36b2272b 100644 --- a/kpat/pwidget.h +++ b/kpat/pwidget.h @@ -57,7 +57,7 @@ public slots: void gameWon(bool withhelp); void gameLost(); void changeWallpaper(); - void slotGameInfo(const QString &); + void slotGameInfo(const TQString &); void slotUpdateMoves(); void helpGame(); void enableAutoDrop(); @@ -65,8 +65,8 @@ public slots: private: void setGameCaption(); - void setBackSide(const QString &deck, const QString &dir); - virtual void showEvent(QShowEvent *e); + void setBackSide(const TQString &deck, const TQString &dir); + virtual void showEvent(TQShowEvent *e); private: // Members @@ -81,9 +81,9 @@ private: KToggleAction *dropaction; KAction *stats; - QPixmap background; - QColor midcolor; - QStringList wallpaperlist; + TQPixmap background; + TQColor midcolor; + TQStringList wallpaperlist; KRecentFilesAction *recent; }; diff --git a/kpat/spider.cpp b/kpat/spider.cpp index 262c49b9..c8e6abc5 100644 --- a/kpat/spider.cpp +++ b/kpat/spider.cpp @@ -68,7 +68,7 @@ Spider::Spider(int suits, KMainWindow* parent, const char* _name) redeals[column]->setCheckIndex(0); redeals[column]->setAddFlags(Pile::disallow); redeals[column]->setRemoveFlags(Pile::disallow); - connect(redeals[column], SIGNAL(clicked(Card*)), SLOT(deckClicked(Card*))); + connect(redeals[column], TQT_SIGNAL(clicked(Card*)), TQT_SLOT(deckClicked(Card*))); } // The 10 playing piles @@ -245,12 +245,12 @@ MoveHint *Spider::chooseHint() //-------------------------------------------------------------------------// -QString Spider::getGameState() const +TQString Spider::getGameState() const { - return QString::number(m_leg*10 + m_redeal); + return TQString::number(m_leg*10 + m_redeal); } -void Spider::setGameState(const QString &stream) +void Spider::setGameState(const TQString &stream) { int i = stream.toInt(); diff --git a/kpat/spider.h b/kpat/spider.h index ea2cc165..055502ff 100644 --- a/kpat/spider.h +++ b/kpat/spider.h @@ -49,8 +49,8 @@ public slots: protected: virtual bool checkRemove(int /*checkIndex*/, const Pile *p, const Card *c) const; virtual bool checkAdd(int /*checkIndex*/, const Pile *c1, const CardList &c2) const; - virtual QString getGameState() const; - virtual void setGameState(const QString &stream); + virtual TQString getGameState() const; + virtual void setGameState(const TQString &stream); virtual void getHints(); virtual MoveHint *chooseHint(); virtual Card *demoNewCards(); diff --git a/kpoker/betbox.cpp b/kpoker/betbox.cpp index e152573f..91fcab8b 100644 --- a/kpoker/betbox.cpp +++ b/kpoker/betbox.cpp @@ -15,8 +15,8 @@ */ -#include <qpushbutton.h> -#include <qlayout.h> +#include <tqpushbutton.h> +#include <tqlayout.h> #include <kglobal.h> #include <klocale.h> @@ -24,42 +24,42 @@ #include "betbox.h" -BetBox::BetBox(QWidget* parent, const char* name) - : QGroupBox(parent, name) +BetBox::BetBox(TQWidget* parent, const char* name) + : TQGroupBox(parent, name) { - QVBoxLayout* topLayout = new QVBoxLayout(this, 1, 1); - QGridLayout* g = new QGridLayout(topLayout, 2, 2, 1); - QHBoxLayout* l = new QHBoxLayout(topLayout, 1); + TQVBoxLayout* topLayout = new TQVBoxLayout(this, 1, 1); + TQGridLayout* g = new TQGridLayout(topLayout, 2, 2, 1); + TQHBoxLayout* l = new TQHBoxLayout(topLayout, 1); - bet5Up = new QPushButton(this); + bet5Up = new TQPushButton(this); g->addWidget(bet5Up, 0, 0); - bet10Up = new QPushButton(this); + bet10Up = new TQPushButton(this); g->addWidget(bet10Up, 0, 1); - bet5Down = new QPushButton(this); + bet5Down = new TQPushButton(this); g->addWidget(bet5Down, 1, 0); - bet10Down = new QPushButton(this); + bet10Down = new TQPushButton(this); g->addWidget(bet10Down, 1, 1); - adjustBet = new QPushButton(this); + adjustBet = new TQPushButton(this); l->addWidget(adjustBet, 0); l->addStretch(1); - foldButton = new QPushButton(this); + foldButton = new TQPushButton(this); l->addWidget(foldButton, 0); - bet5Up->setText(QString("+%1").arg(KGlobal::locale()->formatMoney(5))); - bet10Up->setText(QString("+%1").arg(KGlobal::locale()->formatMoney(10))); - bet5Down->setText(QString("-%1").arg(KGlobal::locale()->formatMoney(5))); - bet10Down->setText(QString("-%1").arg(KGlobal::locale()->formatMoney(10))); + bet5Up->setText(TQString("+%1").arg(KGlobal::locale()->formatMoney(5))); + bet10Up->setText(TQString("+%1").arg(KGlobal::locale()->formatMoney(10))); + bet5Down->setText(TQString("-%1").arg(KGlobal::locale()->formatMoney(5))); + bet10Down->setText(TQString("-%1").arg(KGlobal::locale()->formatMoney(10))); adjustBet->setText(i18n("Adjust Bet")); foldButton->setText(i18n("Fold")); //connects - connect(bet5Up, SIGNAL(clicked()), SLOT(bet5UpClicked())); - connect(bet10Up, SIGNAL(clicked()), SLOT(bet10UpClicked())); - connect(bet5Down, SIGNAL(clicked()), SLOT(bet5DownClicked())); - connect(bet10Down, SIGNAL(clicked()), SLOT(bet10DownClicked())); - connect(foldButton, SIGNAL(clicked()), SLOT(foldClicked())); - connect(adjustBet, SIGNAL(clicked()), SLOT(adjustBetClicked())); + connect(bet5Up, TQT_SIGNAL(clicked()), TQT_SLOT(bet5UpClicked())); + connect(bet10Up, TQT_SIGNAL(clicked()), TQT_SLOT(bet10UpClicked())); + connect(bet5Down, TQT_SIGNAL(clicked()), TQT_SLOT(bet5DownClicked())); + connect(bet10Down, TQT_SIGNAL(clicked()), TQT_SLOT(bet10DownClicked())); + connect(foldButton, TQT_SIGNAL(clicked()), TQT_SLOT(foldClicked())); + connect(adjustBet, TQT_SIGNAL(clicked()), TQT_SLOT(adjustBetClicked())); stopRaise(); } diff --git a/kpoker/betbox.h b/kpoker/betbox.h index 2aa54894..3a639277 100644 --- a/kpoker/betbox.h +++ b/kpoker/betbox.h @@ -18,13 +18,13 @@ #ifndef BETBOX_H #define BETBOX_H -#include <qgroupbox.h> +#include <tqgroupbox.h> class QPushButton; /** - * This class provides a QGroupBox with several button + * This class provides a TQGroupBox with several button * * The bet up / down buttons are used to change the player bet directly, * the adjustBet and out buttons depend on the computers bet @@ -35,7 +35,7 @@ class BetBox : public QGroupBox Q_OBJECT public: - BetBox(QWidget* parent = 0, const char* name = 0); + BetBox(TQWidget* parent = 0, const char* name = 0); ~BetBox(); @@ -102,12 +102,12 @@ class BetBox : public QGroupBox private: - QPushButton *bet5Up; - QPushButton *bet10Up; - QPushButton *bet5Down; - QPushButton *bet10Down; - QPushButton *adjustBet; - QPushButton *foldButton; + TQPushButton *bet5Up; + TQPushButton *bet10Up; + TQPushButton *bet5Down; + TQPushButton *bet10Down; + TQPushButton *adjustBet; + TQPushButton *foldButton; }; diff --git a/kpoker/kpaint.cpp b/kpoker/kpaint.cpp index c6322aee..83012ab0 100644 --- a/kpoker/kpaint.cpp +++ b/kpoker/kpaint.cpp @@ -16,8 +16,8 @@ // QT includes -#include <qdir.h> -#include <qlayout.h> +#include <tqdir.h> +#include <tqlayout.h> // KDE includes //#include <kglobal.h> @@ -34,12 +34,12 @@ // class CardImages -QPixmap *CardImages::m_cardPixmaps; -QPixmap *CardImages::m_deck; +TQPixmap *CardImages::m_cardPixmaps; +TQPixmap *CardImages::m_deck; -CardImages::CardImages(QWidget* parent, const char* name) - : QWidget(parent, name) +CardImages::CardImages(TQWidget* parent, const char* name) + : TQWidget(parent, name) { m_cardPixmaps = new QPixmap[numCards]; m_deck = new QPixmap; @@ -58,7 +58,7 @@ CardImages::~CardImages() } -QPixmap * +TQPixmap * CardImages::getCardImage(int card) const { if (card == 0) @@ -71,10 +71,10 @@ CardImages::getCardImage(int card) const // Load all the card images from the directory 'cardDir'. void -CardImages::loadCards(QString cardDir) +CardImages::loadCards(TQString cardDir) { for (int i = 0; i < numCards; i++) { - QString card = KCardDialog::getCardPath(cardDir, i + 1); + TQString card = KCardDialog::getCardPath(cardDir, i + 1); if (card.isEmpty() || !m_cardPixmaps[i].load(card)) { if (!card.isEmpty()) @@ -91,7 +91,7 @@ CardImages::loadCards(QString cardDir) // Load the backside of the card deck from the file name in 'path'. void -CardImages::loadDeck(QString path) +CardImages::loadDeck(TQString path) { if (!m_deck->load(path)) { kdWarning() << "Could not load deck - loading default deck" << endl; @@ -109,13 +109,13 @@ CardImages::loadDeck(QString path) extern CardImages *cardImages; -CardWidget::CardWidget( QWidget *parent, const char *name ) - : QPushButton( parent, name ) +CardWidget::CardWidget( TQWidget *parent, const char *name ) + : TQPushButton( parent, name ) { m_held = false; setBackgroundMode( NoBackground ); // disables flickering - connect(this, SIGNAL(clicked()), this, SLOT(ownClick())); + connect(this, TQT_SIGNAL(clicked()), this, TQT_SLOT(ownClick())); setFixedSize(cardWidth, cardHeight); } @@ -161,8 +161,8 @@ void CardWidget::paintCard(int cardType) m_pm = cardImages->getCardImage(card); #endif - // Set the pixmap in the QPushButton that we inherit from. - if ( m_pm->size() != QSize( 0, 0 ) ) { // is an image loaded? + // Set the pixmap in the TQPushButton that we inherit from. + if ( m_pm->size() != TQSize( 0, 0 ) ) { // is an image loaded? setPixmap(*m_pm); } } @@ -173,8 +173,8 @@ void CardWidget::repaintDeck() setPixmap(*m_pm); setFixedSize(cardImages->getWidth(), cardImages->getHeight()); - ((QWidget*) parent())->layout()->invalidate(); - ((QWidget*) parent())->setFixedSize( ((QWidget*) parent())->sizeHint()); + ((TQWidget*) parent())->layout()->invalidate(); + ((TQWidget*) parent())->setFixedSize( ((TQWidget*) parent())->sizeHint()); } diff --git a/kpoker/kpaint.h b/kpoker/kpaint.h index ae4c1d29..21dbf097 100644 --- a/kpoker/kpaint.h +++ b/kpoker/kpaint.h @@ -21,8 +21,8 @@ #include <assert.h> -#include <qpushbutton.h> -#include <qpixmap.h> +#include <tqpushbutton.h> +#include <tqpixmap.h> class QLabel; @@ -38,28 +38,28 @@ class CardImages : public QWidget Q_OBJECT public: - CardImages( QWidget *parent = 0, const char *name = 0 ); + CardImages( TQWidget *parent = 0, const char *name = 0 ); ~CardImages(); // FIXME: Use CardValue instead of int when the cards are in their // own file. - QPixmap *getCardImage(int card) const; - QPixmap *getDeck() const { return m_deck; } + TQPixmap *getCardImage(int card) const; + TQPixmap *getDeck() const { return m_deck; } int getWidth() const { return m_cardPixmaps[0].width(); } int getHeight() const { return m_cardPixmaps[0].height(); } - void loadDeck(QString path); - void loadCards(QString cardDir); + void loadDeck(TQString path); + void loadCards(TQString cardDir); private: - static QPixmap *m_cardPixmaps; - static QPixmap *m_deck; + static TQPixmap *m_cardPixmaps; + static TQPixmap *m_deck; }; /** - * This class extends the QPushButton by some methods / variables to provide a card with held labels and so on + * This class extends the TQPushButton by some methods / variables to provide a card with held labels and so on * * @short The cards **/ @@ -68,7 +68,7 @@ class CardWidget : public QPushButton Q_OBJECT public: - CardWidget( QWidget *parent=0, const char *name=0 ); + CardWidget( TQWidget *parent=0, const char *name=0 ); /** * Paints the deck if cardType = 0 or the card specified in cardType @@ -110,11 +110,11 @@ class CardWidget : public QPushButton private: - QPixmap *m_pm; // the loaded pixmap + TQPixmap *m_pm; // the loaded pixmap bool m_held; public: - QLabel *heldLabel; + TQLabel *heldLabel; }; diff --git a/kpoker/kpoker.cpp b/kpoker/kpoker.cpp index 2956b42c..a6f51772 100644 --- a/kpoker/kpoker.cpp +++ b/kpoker/kpoker.cpp @@ -18,11 +18,11 @@ #include <stdlib.h> // QT includes -#include <qlabel.h> -#include <qtimer.h> -#include <qpainter.h> -#include <qtooltip.h> -#include <qlayout.h> +#include <tqlabel.h> +#include <tqtimer.h> +#include <tqpainter.h> +#include <tqtooltip.h> +#include <tqlayout.h> // KDE includes #include <kmessagebox.h> @@ -159,11 +159,11 @@ CardImages *cardImages; // Class kpok -kpok::kpok(QWidget *parent, const char *name) - : QWidget(parent, name), +kpok::kpok(TQWidget *parent, const char *name) + : TQWidget(parent, name), m_game(&m_random) { - QString version; + TQString version; m_random.setSeed(0); @@ -178,7 +178,7 @@ kpok::kpok(QWidget *parent, const char *name) // ...and the rest to computer players. for (int unsigned i = 1; i < m_numPlayers; i++) - m_players[i].setName(QString("Computer %1").arg(i-1)); + m_players[i].setName(TQString("Computer %1").arg(i-1)); lastHandText = ""; @@ -237,78 +237,78 @@ void kpok::initWindow() m_blinkingBox = 0; // General font stuff. Define myFixedFont and wonFont. - QFont myFixedFont; + TQFont myFixedFont; myFixedFont.setPointSize(12); - QFont wonFont; + TQFont wonFont; wonFont.setPointSize(14); wonFont.setBold(true); - topLayout = new QVBoxLayout(this, BORDER); - QVBoxLayout* topInputLayout = new QVBoxLayout; + topLayout = new TQVBoxLayout(this, BORDER); + TQVBoxLayout* topInputLayout = new QVBoxLayout; topLayout->addLayout(topInputLayout); - QHBoxLayout* betLayout = new QHBoxLayout; + TQHBoxLayout* betLayout = new QHBoxLayout; inputLayout = new QHBoxLayout; inputLayout->addLayout(betLayout); topInputLayout->addLayout(inputLayout); // The draw button - drawButton = new QPushButton(this); + drawButton = new TQPushButton(this); drawButton->setText(i18n("&Deal")); - connect(drawButton, SIGNAL(clicked()), this, SLOT(drawClick())); + connect(drawButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(drawClick())); inputLayout->addWidget(drawButton); inputLayout->addStretch(1); // The waving text - QFont waveFont; + TQFont waveFont; waveFont.setPointSize(16); waveFont.setBold(true); - QFontMetrics tmp(waveFont); + TQFontMetrics tmp(waveFont); // The widget where the winner is announced. - mWonWidget = new QWidget(this); + mWonWidget = new TQWidget(this); inputLayout->addWidget(mWonWidget, 2); mWonWidget->setMinimumHeight(50); //FIXME hardcoded value for the wave mWonWidget->setMinimumWidth(tmp.width(i18n("You won %1").arg(KGlobal::locale()->formatMoney(100))) + 20); // workaround for width problem in wave - QHBoxLayout* wonLayout = new QHBoxLayout(mWonWidget); + TQHBoxLayout* wonLayout = new TQHBoxLayout(mWonWidget); wonLayout->setAutoAdd(true); - wonLabel = new QLabel(mWonWidget); + wonLabel = new TQLabel(mWonWidget); wonLabel->setFont(wonFont); wonLabel->setAlignment(AlignCenter); wonLabel->hide(); inputLayout->addStretch(1); // The pot view - potLabel = new QLabel(this); + potLabel = new TQLabel(this); potLabel->setFont(myFixedFont); - potLabel->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); + potLabel->setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); inputLayout->addWidget(potLabel, 0, AlignCenter); // Label widget in the lower left. - clickToHold = new QLabel(this); + clickToHold = new TQLabel(this); clickToHold->hide(); // Timers - blinkTimer = new QTimer(this); - connect( blinkTimer, SIGNAL(timeout()), SLOT(bTimerEvent()) ); + blinkTimer = new TQTimer(this); + connect( blinkTimer, TQT_SIGNAL(timeout()), TQT_SLOT(bTimerEvent()) ); - waveTimer = new QTimer(this); - connect( waveTimer, SIGNAL(timeout()), SLOT(waveTimerEvent()) ); + waveTimer = new TQTimer(this); + connect( waveTimer, TQT_SIGNAL(timeout()), TQT_SLOT(waveTimerEvent()) ); - drawTimer = new QTimer(this); - connect (drawTimer, SIGNAL(timeout()), SLOT(drawCardsEvent()) ); + drawTimer = new TQTimer(this); + connect (drawTimer, TQT_SIGNAL(timeout()), TQT_SLOT(drawCardsEvent()) ); // and now the betUp/Down Buttons betBox = new BetBox(this, 0); betLayout->addWidget(betBox); - connect(betBox, SIGNAL(betChanged(int)), this, SLOT(betChange(int))); - connect(betBox, SIGNAL(betAdjusted()), this, SLOT(adjustBet())); - connect(betBox, SIGNAL(fold()), this, SLOT(out())); + connect(betBox, TQT_SIGNAL(betChanged(int)), this, TQT_SLOT(betChange(int))); + connect(betBox, TQT_SIGNAL(betAdjusted()), this, TQT_SLOT(adjustBet())); + connect(betBox, TQT_SIGNAL(fold()), this, TQT_SLOT(out())); // some tips - QToolTip::add(drawButton, i18n("Continue the round")); - QToolTip::add(potLabel, i18n("The current pot")); + TQToolTip::add(drawButton, i18n("Continue the round")); + TQToolTip::add(potLabel, i18n("The current pot")); // Load all cards into pixmaps first -> in the constructor. cardImages = new CardImages(this, 0); @@ -644,7 +644,7 @@ void kpok::initPoker(unsigned int numPlayers) // // FIXME: Make CardWidget::toggleHeld() work. playerBox[0]->activateToggleHeld(); - connect(playerBox[0], SIGNAL(toggleHeld()), this, SLOT(toggleHeld())); + connect(playerBox[0], TQT_SIGNAL(toggleHeld()), this, TQT_SLOT(toggleHeld())); // hide some things playerBox[0]->showHelds(false); @@ -701,7 +701,7 @@ void kpok::updateLHLabel() } -void kpok::setHand(const QString& newHand, bool lastHand) +void kpok::setHand(const TQString& newHand, bool lastHand) { emit changeLastHand(newHand, lastHand); @@ -803,7 +803,7 @@ void kpok::displayWinner_Computer(PokerPlayer* winner, bool othersPassed) m_game.setDirty(); // Generate a string with winner info and show it. - QString label; + TQString label; if (winner->getHuman()) label = i18n("You won %1").arg(KGlobal::locale()->formatMoney(m_game.getPot())); else @@ -811,10 +811,10 @@ void kpok::displayWinner_Computer(PokerPlayer* winner, bool othersPassed) wonLabel->setText(label); // Start the waving motion of the text. - QFont waveFont; + TQFont waveFont; waveFont.setBold(true); waveFont.setPointSize(16); - QFontMetrics tmp(waveFont); + TQFontMetrics tmp(waveFont); mWonWidget->setMinimumWidth(tmp.width(label) + 20); // Play a suitable sound. @@ -1060,9 +1060,9 @@ void kpok::bTimerEvent() } -void kpok::displayWin(const QString& hand, int cashWon) +void kpok::displayWin(const TQString& hand, int cashWon) { - QString buf; + TQString buf; setHand(hand); m_game.getActivePlayer(0)->setCash(m_game.getActivePlayer(0)->getCash() @@ -1090,7 +1090,7 @@ void kpok::displayWin(const QString& hand, int cashWon) } -void kpok::paintEvent( QPaintEvent *) +void kpok::paintEvent( TQPaintEvent *) { /* NOTE: This was shamelessy stolen from the "hello world" example * coming with Qt Thanks to the Qt-Guys for doing such a cool @@ -1101,7 +1101,7 @@ void kpok::paintEvent( QPaintEvent *) return; } - QString txt = wonLabel->text(); + TQString txt = wonLabel->text(); wonLabel->hide(); static int sin_tbl[16] = { @@ -1111,17 +1111,17 @@ void kpok::paintEvent( QPaintEvent *) return; } - QFont wonFont; + TQFont wonFont; wonFont.setPointSize(18); wonFont.setBold(true); - QFontMetrics fm = QFontMetrics(wonFont); + TQFontMetrics fm = TQFontMetrics(wonFont); int w = fm.width(txt) + 20; int h = fm.height() * 2; while (w > mWonWidget->width() && wonFont.pointSize() > 6) {// > 6 for emergency abort... wonFont.setPointSize(wonFont.pointSize() - 1); - fm = QFontMetrics(wonFont); + fm = TQFontMetrics(wonFont); w = fm.width(txt) + 20; h = fm.height() * 2; } @@ -1130,7 +1130,7 @@ void kpok::paintEvent( QPaintEvent *) int pmy = 0; // int pmy = (playerBox[0]->x() + playerBox[0]->height() + 10) - h / 4; - QPixmap pm( w, h ); + TQPixmap pm( w, h ); pm.fill( mWonWidget, pmx, pmy ); if (fCount == -1) { /* clear area */ @@ -1138,18 +1138,18 @@ void kpok::paintEvent( QPaintEvent *) return; } - QPainter p; + TQPainter p; int x = 10; int y = h/2 + fm.descent(); unsigned int i = 0; p.begin( &pm ); p.setFont( wonFont ); - p.setPen( QColor(0,0,0) ); + p.setPen( TQColor(0,0,0) ); while ( i < txt.length() ) { int i16 = (fCount+i) & 15; - p.drawText( x, y-sin_tbl[i16]*h/800, QString(txt[i]), 1 ); + p.drawText( x, y-sin_tbl[i16]*h/800, TQString(txt[i]), 1 ); x += fm.width( txt[i] ); i++; } @@ -1307,9 +1307,9 @@ void kpok::saveGame(KConfig* conf) conf->writeEntry("lastHandText", lastHandText); for (int i = 0; i < players; i++) { - conf->writeEntry(QString("Name_%1").arg(i), m_players[i].getName()); - conf->writeEntry(QString("Human_%1").arg(i), m_players[i].getHuman()); - conf->writeEntry(QString("Cash_%1").arg(i), m_players[i].getCash()); + conf->writeEntry(TQString("Name_%1").arg(i), m_players[i].getName()); + conf->writeEntry(TQString("Human_%1").arg(i), m_players[i].getHuman()); + conf->writeEntry(TQString("Cash_%1").arg(i), m_players[i].getCash()); } m_game.clearDirty(); @@ -1360,10 +1360,10 @@ bool kpok::initSound() } -void kpok::playSound(const QString &soundname) +void kpok::playSound(const TQString &soundname) { if (sound) - KAudioPlayer::play(locate("data", QString("kpoker/sounds/")+soundname)); + KAudioPlayer::play(locate("data", TQString("kpoker/sounds/")+soundname)); } @@ -1407,14 +1407,14 @@ bool kpok::loadGame(KConfig* conf) if (numPlayers > 0) { for (int i = 0; i < numPlayers; i++) { - QString buf = conf->readEntry(QString("Name_%1").arg(i), + TQString buf = conf->readEntry(TQString("Name_%1").arg(i), "Player"); m_players[i].setName(buf); - bool human = conf->readBoolEntry(QString("Human_%1").arg(i), + bool human = conf->readBoolEntry(TQString("Human_%1").arg(i), false); if (human) m_players[i].setHuman(); // i == 0 - int cash = conf->readNumEntry(QString("Cash_%1").arg(i), + int cash = conf->readNumEntry(TQString("Cash_%1").arg(i), START_MONEY); m_players[i].setCash(cash); m_game.setDirty(); @@ -1451,15 +1451,15 @@ void kpok::exchangeCard5() { playerBox[0]->cardClicked(5); } void kpok::slotCardDeck() { kapp->config()->setGroup("General"); - QString deckPath = kapp->config()->readPathEntry("DeckPath", 0); - QString cardPath = kapp->config()->readPathEntry("CardPath", 0); + TQString deckPath = kapp->config()->readPathEntry("DeckPath", 0); + TQString cardPath = kapp->config()->readPathEntry("CardPath", 0); bool randomDeck, randomCardDir; // Show the "Select Card Deck" dialog and load the images for the // selected deck, if any. if (KCardDialog::getCardDeck(deckPath, cardPath, this, KCardDialog::Both, &randomDeck, &randomCardDir) - == QDialog::Accepted) { + == TQDialog::Accepted) { // Load backside and front images. if (playerBox && m_blinking && (m_blinkStat == 0)) diff --git a/kpoker/kpoker.h b/kpoker/kpoker.h index 21a41ebc..cd0bd42a 100644 --- a/kpoker/kpoker.h +++ b/kpoker/kpoker.h @@ -20,8 +20,8 @@ // QT includes -#include <qwidget.h> -#include <qptrlist.h> +#include <tqwidget.h> +#include <tqptrlist.h> // KDE includes #include <krandomsequence.h> @@ -158,8 +158,8 @@ public: int m_pot; // The amount of money people have bet. // The players in the game. - QPtrList<PokerPlayer> m_activePlayers; // players still in the round - QPtrList<PokerPlayer> m_removedPlayers; // players out of this round + TQPtrList<PokerPlayer> m_activePlayers; // players still in the round + TQPtrList<PokerPlayer> m_removedPlayers; // players out of this round }; @@ -172,10 +172,10 @@ class kpok : public QWidget Q_OBJECT public: - kpok(QWidget * parent = 0, const char *name = 0); + kpok(TQWidget * parent = 0, const char *name = 0); virtual ~kpok(); - QString getName (int playerNr); + TQString getName (int playerNr); void paintCash(); bool isDirty() const { return m_game.isDirty(); } @@ -191,9 +191,9 @@ class kpok : public QWidget bool getAdjust() const { return adjust; } signals: - void changeLastHand(const QString &newHand, bool lastHand = true); + void changeLastHand(const TQString &newHand, bool lastHand = true); void showClickToHold(bool show); - void statusBarMessage(QString); + void statusBarMessage(TQString); void clearStatusBar(); protected: @@ -202,11 +202,11 @@ class kpok : public QWidget void drawCards(PokerPlayer* p, bool skip[]); void newRound(); void noMoney(); - void paintEvent( QPaintEvent * ); - void playSound(const QString &filename); + void paintEvent( TQPaintEvent * ); + void playSound(const TQString &filename); void setBetButtonEnabled(bool enabled); - void setHand(const QString& newHand, bool lastHand = true); - void setLastWinner(const QString& lastWinner); + void setHand(const TQString& newHand, bool lastHand = true); + void setLastWinner(const TQString& lastWinner); void startBlinking(); void stopBlinking(); void stopDrawing(); @@ -215,7 +215,7 @@ class kpok : public QWidget void bet(); - void displayWin(const QString& hand, int cashWon); + void displayWin(const TQString& hand, int cashWon); /** * Displays the winner, adds the pot to his money @@ -325,14 +325,14 @@ class kpok : public QWidget int drawDelay; // Graphical layout. - QVBoxLayout *topLayout; - QHBoxLayout *inputLayout; - QLabel *potLabel; + TQVBoxLayout *topLayout; + TQHBoxLayout *inputLayout; + TQLabel *potLabel; BetBox *betBox; - QPushButton *drawButton; // the main Button - QLabel *wonLabel; // the winner - QLabel *clickToHold; - QWidget *mWonWidget; + TQPushButton *drawButton; // the main Button + TQLabel *wonLabel; // the winner + TQLabel *clickToHold; + TQWidget *mWonWidget; PlayerBox **playerBox; //one box per player @@ -342,9 +342,9 @@ class kpok : public QWidget // Other stuff KRandomSequence m_random; - QTimer *blinkTimer; // the winning cards will blink - QTimer *drawTimer; // delay between drawing of the cards - QTimer *waveTimer; // for displaying of the win (if winner == human) + TQTimer *blinkTimer; // the winning cards will blink + TQTimer *drawTimer; // delay between drawing of the cards + TQTimer *waveTimer; // for displaying of the win (if winner == human) bool adjust; // allow user to adjust the bet. int drawStat; // status of drawing (which card already was drawn etc. @@ -358,7 +358,7 @@ class kpok : public QWidget bool waveActive; int fCount; - QString lastHandText; + TQString lastHandText; }; #endif diff --git a/kpoker/newgamedlg.cpp b/kpoker/newgamedlg.cpp index 002833b6..80a9a501 100644 --- a/kpoker/newgamedlg.cpp +++ b/kpoker/newgamedlg.cpp @@ -16,11 +16,11 @@ // QT includes -#include <qlabel.h> -#include <qlineedit.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qlayout.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqlayout.h> // KDE includes #include <klocale.h> @@ -34,12 +34,12 @@ #include "newgamedlg.h" -NewGameDlg::NewGameDlg(QWidget* parent) +NewGameDlg::NewGameDlg(TQWidget* parent) : KDialogBase(Plain, i18n("New Game"), Ok|Cancel, Ok, parent, 0, true, true) { - QVBoxLayout *topLayout = new QVBoxLayout(plainPage(), spacingHint()); - QHBoxLayout *l = new QHBoxLayout(topLayout); + TQVBoxLayout *topLayout = new TQVBoxLayout(plainPage(), spacingHint()); + TQHBoxLayout *l = new TQHBoxLayout(topLayout); KConfig* conf = kapp->config(); conf->setGroup("NewGameDlg"); @@ -50,46 +50,46 @@ NewGameDlg::NewGameDlg(QWidget* parent) int playerNr = conf->readNumEntry("players", DEFAULT_PLAYERS); int money = conf->readNumEntry("startMoney", START_MONEY); - readFromConfig = new QCheckBox(i18n("Try loading a game"), plainPage()); + readFromConfig = new TQCheckBox(i18n("Try loading a game"), plainPage()); readFromConfig->adjustSize(); readFromConfig->setChecked(readConfig); l->addWidget(readFromConfig); - readFromConfigLabel = new QLabel(i18n("The following values are used if loading from config fails"), plainPage()); + readFromConfigLabel = new TQLabel(i18n("The following values are used if loading from config fails"), plainPage()); if (!readFromConfig->isChecked()) readFromConfigLabel->hide(); readFromConfigLabel->adjustSize(); l->addWidget(readFromConfigLabel); - connect(readFromConfig, SIGNAL(toggled(bool)), - this, SLOT(changeReadFromConfig(bool))); + connect(readFromConfig, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(changeReadFromConfig(bool))); players = new KIntNumInput(playerNr, plainPage()); players->setRange(1, MAX_PLAYERS); players->setLabel(i18n("How many players do you want?")); topLayout->addWidget(players); - l = new QHBoxLayout(topLayout); - l->addWidget(new QLabel(i18n("Your name:"), plainPage())); - player1Name = new QLineEdit(plainPage()); + l = new TQHBoxLayout(topLayout); + l->addWidget(new TQLabel(i18n("Your name:"), plainPage())); + player1Name = new TQLineEdit(plainPage()); l->addWidget(player1Name); - l = new QHBoxLayout(topLayout); - l->addWidget(new QLabel(i18n("Players' starting money:"), plainPage())); - moneyOfPlayers = new QLineEdit(QString("%1").arg(money), plainPage()); + l = new TQHBoxLayout(topLayout); + l->addWidget(new TQLabel(i18n("Players' starting money:"), plainPage())); + moneyOfPlayers = new TQLineEdit(TQString("%1").arg(money), plainPage()); moneyOfPlayers->setValidator( new KIntValidator( 0,999999,moneyOfPlayers ) ); l->addWidget(moneyOfPlayers); - l = new QHBoxLayout(topLayout); - l->addWidget(new QLabel(i18n("The names of your opponents:"), plainPage())); - computerNames = new QComboBox(true, plainPage()); - computerNames->setInsertionPolicy(QComboBox::AtCurrent); + l = new TQHBoxLayout(topLayout); + l->addWidget(new TQLabel(i18n("The names of your opponents:"), plainPage())); + computerNames = new TQComboBox(true, plainPage()); + computerNames->setInsertionPolicy(TQComboBox::AtCurrent); l->addWidget(computerNames); - l = new QHBoxLayout(topLayout); - l->addWidget(new QLabel(i18n("Show this dialog every time on startup"), + l = new TQHBoxLayout(topLayout); + l->addWidget(new TQLabel(i18n("Show this dialog every time on startup"), plainPage())); - showDialogOnStartup = new QCheckBox(plainPage()); + showDialogOnStartup = new TQCheckBox(plainPage()); showDialogOnStartup->setChecked(showNewGameDlg); l->addWidget(showDialogOnStartup); @@ -120,14 +120,14 @@ NewGameDlg::~NewGameDlg() } -void NewGameDlg::setPlayerNames(int no, QString playerName) +void NewGameDlg::setPlayerNames(int no, TQString playerName) { if (no < 0) { kapp->config()->setGroup("Save"); player1Name->setText(kapp->config()->readEntry("Name_0", i18n("You"))); computerNames->clear(); for (int i = 1; i < MAX_PLAYERS; i++) { - computerNames->insertItem(kapp->config()->readEntry(QString("Name_%1").arg(i), i18n("Computer %1").arg(i))); + computerNames->insertItem(kapp->config()->readEntry(TQString("Name_%1").arg(i), i18n("Computer %1").arg(i))); } } else if (no == 0) { player1Name->setText(playerName); @@ -178,7 +178,7 @@ int NewGameDlg::money() } -QString NewGameDlg::name(int nr) +TQString NewGameDlg::name(int nr) { if (computerNames->currentText() != computerNames->text(computerNames->currentItem())) computerNames->changeItem(computerNames->currentText(), computerNames->currentItem()); diff --git a/kpoker/newgamedlg.h b/kpoker/newgamedlg.h index 5588f0aa..1dc73057 100644 --- a/kpoker/newgamedlg.h +++ b/kpoker/newgamedlg.h @@ -41,7 +41,7 @@ class NewGameDlg : public KDialogBase Q_OBJECT public: - NewGameDlg(QWidget* parent = 0); + NewGameDlg(TQWidget* parent = 0); ~NewGameDlg(); /** @@ -69,7 +69,7 @@ class NewGameDlg : public KDialogBase * @param nr The number of the player * @return The name of the player specified in nr **/ - QString name(int nr); + TQString name(int nr); /** * This method hides the button where the user can choose to read values from config file @@ -78,7 +78,7 @@ class NewGameDlg : public KDialogBase **/ void hideReadingFromConfig(); - void setPlayerNames(int no = -1, QString playerName = 0); + void setPlayerNames(int no = -1, TQString playerName = 0); protected slots: @@ -91,13 +91,13 @@ class NewGameDlg : public KDialogBase private: - QLabel *readFromConfigLabel; - QCheckBox *readFromConfig; + TQLabel *readFromConfigLabel; + TQCheckBox *readFromConfig; KIntNumInput *players; - QLineEdit *moneyOfPlayers; - QCheckBox *showDialogOnStartup; - QLineEdit *player1Name; - QComboBox *computerNames; + TQLineEdit *moneyOfPlayers; + TQCheckBox *showDialogOnStartup; + TQLineEdit *player1Name; + TQComboBox *computerNames; }; diff --git a/kpoker/optionsdlg.cpp b/kpoker/optionsdlg.cpp index e009c3d2..5fdfbfcf 100644 --- a/kpoker/optionsdlg.cpp +++ b/kpoker/optionsdlg.cpp @@ -16,8 +16,8 @@ // QT includes -#include <qlabel.h> -#include <qlayout.h> +#include <tqlabel.h> +#include <tqlayout.h> // KDE includes #include <klocale.h> @@ -28,11 +28,11 @@ #include "defines.h" -OptionsDlg::OptionsDlg(QWidget* parent, const char* name, int _players) +OptionsDlg::OptionsDlg(TQWidget* parent, const char* name, int _players) : KDialogBase(Plain, i18n("Options")/*?*/, Ok|Cancel, Ok, parent, name, true, true) { - QVBoxLayout* topLayout = new QVBoxLayout(plainPage(), spacingHint()); + TQVBoxLayout* topLayout = new TQVBoxLayout(plainPage(), spacingHint()); maxBet = 0; minBet = 0; @@ -41,7 +41,7 @@ OptionsDlg::OptionsDlg(QWidget* parent, const char* name, int _players) else players = _players; - topLayout->addWidget(new QLabel(i18n("All changes will be activated in the next round."), plainPage())); + topLayout->addWidget(new TQLabel(i18n("All changes will be activated in the next round."), plainPage())); drawDelay = new KIntNumInput(0, plainPage()); drawDelay->setLabel(i18n("Draw delay:")); diff --git a/kpoker/optionsdlg.h b/kpoker/optionsdlg.h index c1573133..fdc556a8 100644 --- a/kpoker/optionsdlg.h +++ b/kpoker/optionsdlg.h @@ -41,7 +41,7 @@ class OptionsDlg : public KDialogBase Q_OBJECT public: - OptionsDlg(QWidget* parent = 0, const char* name = 0, int _players = 1); + OptionsDlg(TQWidget* parent = 0, const char* name = 0, int _players = 1); ~OptionsDlg(); void init(int _drawDelay, int _maxBetOrCashPerRound, int minBet = -1); @@ -56,9 +56,9 @@ class OptionsDlg : public KDialogBase int defaultMinBet; int defaultCashPerRound; int defaultDrawDelay; - // QLineEdit* maxBet; - // QLineEdit* minBet; - // QLineEdit* drawDelay; + // TQLineEdit* maxBet; + // TQLineEdit* minBet; + // TQLineEdit* drawDelay; KIntNumInput* maxBet; KIntNumInput* minBet; KIntNumInput* drawDelay; diff --git a/kpoker/player.h b/kpoker/player.h index 7d3988cf..56399151 100644 --- a/kpoker/player.h +++ b/kpoker/player.h @@ -19,7 +19,7 @@ #define PLAYER_H // QT includes -#include <qstring.h> +#include <tqstring.h> // KDE includes #include <krandomsequence.h> @@ -100,7 +100,7 @@ class PokerPlayer * Sets a new name * @param newName The new name of the player **/ - void setName(const QString &newName) { m_name = newName; } + void setName(const TQString &newName) { m_name = newName; } /** * Informs the player that he is out (or is not out anymore) @@ -165,7 +165,7 @@ class PokerPlayer /** * @return The name of the player **/ - QString getName() const { return m_name; } + TQString getName() const { return m_name; } // FIXME: Rename to hasFolded? /** @@ -194,7 +194,7 @@ class PokerPlayer private: // Basic data: - QString m_name; // The name of the player. + TQString m_name; // The name of the player. bool m_isHuman; // True if the player is human. // The hand itself diff --git a/kpoker/playerbox.cpp b/kpoker/playerbox.cpp index cdfb216c..4927fd7c 100644 --- a/kpoker/playerbox.cpp +++ b/kpoker/playerbox.cpp @@ -15,10 +15,10 @@ */ -#include <qtooltip.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qhbox.h> +#include <tqtooltip.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqhbox.h> #include <kglobal.h> #include <klocale.h> @@ -30,25 +30,25 @@ #include "kpaint.h" -PlayerBox::PlayerBox(bool playerOne, QWidget* parent, const char* name) - : QGroupBox(parent, name) +PlayerBox::PlayerBox(bool playerOne, TQWidget* parent, const char* name) + : TQGroupBox(parent, name) { - QHBoxLayout* l = new QHBoxLayout(this, PLAYERBOX_BORDERS, + TQHBoxLayout* l = new TQHBoxLayout(this, PLAYERBOX_BORDERS, PLAYERBOX_HDISTANCEOFWIDGETS); // The card and "held" label arrays. m_cardWidgets = new CardWidget *[PokerHandSize]; - m_heldLabels = new QLabel *[PokerHandSize]; + m_heldLabels = new TQLabel *[PokerHandSize]; - QFont myFixedFont; + TQFont myFixedFont; myFixedFont.setPointSize(12); // Generate the 5 cards for (int i = 0; i < PokerHandSize; i++) { - QVBoxLayout* vl = new QVBoxLayout(0); + TQVBoxLayout* vl = new TQVBoxLayout(0); l->addLayout(vl, 0); - QHBox* cardBox = new QHBox(this); + TQHBox* cardBox = new TQHBox(this); vl->addWidget(cardBox, 0); cardBox->setFrameStyle(Box | Sunken); m_cardWidgets[i] = new CardWidget(cardBox); @@ -56,14 +56,14 @@ PlayerBox::PlayerBox(bool playerOne, QWidget* parent, const char* name) // Only add the "held" labels if this is the first player (the human one). if (playerOne) { - QHBox* b = new QHBox(this); - m_heldLabels[i] = new QLabel(b); + TQHBox* b = new TQHBox(this); + m_heldLabels[i] = new TQLabel(b); m_heldLabels[i]->setText(i18n("Held")); b->setFrameStyle(Box | Sunken); b->setFixedSize(b->sizeHint()); m_cardWidgets[i]->heldLabel = m_heldLabels[i]; - QHBoxLayout* heldLayout = new QHBoxLayout(0); + TQHBoxLayout* heldLayout = new TQHBoxLayout(0); heldLayout->addWidget(b, 0, AlignCenter); vl->insertLayout(0, heldLayout, 0); vl->insertStretch(0, 1); @@ -73,24 +73,24 @@ PlayerBox::PlayerBox(bool playerOne, QWidget* parent, const char* name) // Add the cash and bet labels. { - QVBoxLayout* vl = new QVBoxLayout; + TQVBoxLayout* vl = new QVBoxLayout; l->addLayout(vl); vl->addStretch(); - m_cashLabel = new QLabel(this); - m_cashLabel->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); + m_cashLabel = new TQLabel(this); + m_cashLabel->setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); m_cashLabel->setFont(myFixedFont); vl->addWidget(m_cashLabel, 0, AlignHCenter); vl->addStretch(); - m_betLabel = new QLabel(this); - m_betLabel->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); + m_betLabel = new TQLabel(this); + m_betLabel->setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); m_betLabel->setFont(myFixedFont); vl->addWidget(m_betLabel, 0, AlignHCenter); vl->addStretch(); } - QToolTip::add(m_cashLabel, + TQToolTip::add(m_cashLabel, i18n("Money of %1").arg("Player"));//change via showName() // Assume that we have a multiplayer game. @@ -109,9 +109,9 @@ PlayerBox::~PlayerBox() -void PlayerBox::resizeEvent(QResizeEvent* e) +void PlayerBox::resizeEvent(TQResizeEvent* e) { - QGroupBox::resizeEvent(e); + TQGroupBox::resizeEvent(e); showCash(); showName(); @@ -144,8 +144,8 @@ void PlayerBox::showCash() void PlayerBox::showName() { setTitle(m_player->getName()); - QToolTip::remove(m_cashLabel); - QToolTip::add(m_cashLabel, i18n("Money of %1").arg(m_player->getName())); + TQToolTip::remove(m_cashLabel); + TQToolTip::add(m_cashLabel, i18n("Money of %1").arg(m_player->getName())); } @@ -176,8 +176,8 @@ void PlayerBox::paintCard(int nr) void PlayerBox::activateToggleHeld() { for (int i = 0; i < PokerHandSize; i++) { - connect(m_cardWidgets[i], SIGNAL(pClicked(CardWidget*)), - this, SLOT(cardClicked(CardWidget*))); + connect(m_cardWidgets[i], TQT_SIGNAL(pClicked(CardWidget*)), + this, TQT_SLOT(cardClicked(CardWidget*))); } } diff --git a/kpoker/playerbox.h b/kpoker/playerbox.h index 4d769170..86ab8d2f 100644 --- a/kpoker/playerbox.h +++ b/kpoker/playerbox.h @@ -19,7 +19,7 @@ #define PLAYERBOX_H -#include <qgroupbox.h> +#include <tqgroupbox.h> class QLabel; @@ -34,7 +34,7 @@ class PlayerBox : public QGroupBox Q_OBJECT public: - PlayerBox(bool playerOne, QWidget* parent = 0, const char* name = 0); + PlayerBox(bool playerOne, TQWidget* parent = 0, const char* name = 0); ~PlayerBox(); void cardClicked(int no); @@ -121,7 +121,7 @@ class PlayerBox : public QGroupBox protected: - virtual void resizeEvent( QResizeEvent* e ); + virtual void resizeEvent( TQResizeEvent* e ); protected slots: @@ -141,12 +141,12 @@ class PlayerBox : public QGroupBox // The card widgets and "held" widgets CardWidget **m_cardWidgets; - QLabel **m_heldLabels; + TQLabel **m_heldLabels; bool m_enableHeldLabels; // True if held labels are enabled. // The labels at the right hand side of the box. - QLabel *m_cashLabel; - QLabel *m_betLabel; + TQLabel *m_cashLabel; + TQLabel *m_betLabel; }; diff --git a/kpoker/poker.cpp b/kpoker/poker.cpp index 6143d342..d5d70f80 100644 --- a/kpoker/poker.cpp +++ b/kpoker/poker.cpp @@ -89,7 +89,7 @@ CardDeck::getTopCard() // Poker types -QString PokerHandNames[] = { +TQString PokerHandNames[] = { "High Card", "Pair", "Two Pairs", diff --git a/kpoker/poker.h b/kpoker/poker.h index 5a944d99..ff388950 100644 --- a/kpoker/poker.h +++ b/kpoker/poker.h @@ -18,7 +18,7 @@ #ifndef POKER_H #define POKER_H -#include <qstring.h> +#include <tqstring.h> #include <krandomsequence.h> #include <kdebug.h> @@ -167,7 +167,7 @@ typedef enum { } PokerHandType; // Name strings for all the hands -extern QString PokerHandNames[]; +extern TQString PokerHandNames[]; // Number of cards in the hand. diff --git a/kpoker/sound.cpp b/kpoker/sound.cpp index f029d03a..3835c3fb 100644 --- a/kpoker/sound.cpp +++ b/kpoker/sound.cpp @@ -14,7 +14,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qstring.h> +#include <tqstring.h> #include <kstandarddirs.h> @@ -36,7 +36,7 @@ void kpok::playSound(const char *soundname) if (!sound) return; - KAudioPlayer::play(locate("data", QString("kpoker/sounds/")+soundname)); + KAudioPlayer::play(locate("data", TQString("kpoker/sounds/")+soundname)); } diff --git a/kpoker/top.cpp b/kpoker/top.cpp index b2e8137f..a58d5666 100644 --- a/kpoker/top.cpp +++ b/kpoker/top.cpp @@ -16,8 +16,8 @@ // QT includes -#include <qkeycode.h> -#include <qcursor.h> +#include <tqkeycode.h> +#include <tqcursor.h> // KDE includes #include <kapplication.h> @@ -47,17 +47,17 @@ PokerWindow::PokerWindow() clickToHoldIsShown = false; - LHLabel = new QLabel(statusBar()); + LHLabel = new TQLabel(statusBar()); LHLabel->adjustSize(); - connect(m_kpok, SIGNAL(changeLastHand(const QString &, bool)), - this, SLOT(setHand(const QString &, bool))); - connect(m_kpok, SIGNAL(showClickToHold(bool)), - this, SLOT(showClickToHold(bool))); - connect(m_kpok, SIGNAL(clearStatusBar()), - this, SLOT(clearStatusBar())); - connect(m_kpok, SIGNAL(statusBarMessage(QString)), - this, SLOT(statusBarMessage(QString))); + connect(m_kpok, TQT_SIGNAL(changeLastHand(const TQString &, bool)), + this, TQT_SLOT(setHand(const TQString &, bool))); + connect(m_kpok, TQT_SIGNAL(showClickToHold(bool)), + this, TQT_SLOT(showClickToHold(bool))); + connect(m_kpok, TQT_SIGNAL(clearStatusBar()), + this, TQT_SLOT(clearStatusBar())); + connect(m_kpok, TQT_SIGNAL(statusBarMessage(TQString)), + this, TQT_SLOT(statusBarMessage(TQString))); statusBar()->addWidget(LHLabel, 0, true); m_kpok->updateLHLabel(); @@ -79,47 +79,47 @@ PokerWindow::~PokerWindow() void PokerWindow::initKAction() { //Game - KStdGameAction::gameNew(m_kpok, SLOT(newGame()), actionCollection()); - KStdGameAction::save(m_kpok, SLOT(saveGame()), actionCollection()); - KStdGameAction::quit(this, SLOT(close()), actionCollection()); + KStdGameAction::gameNew(m_kpok, TQT_SLOT(newGame()), actionCollection()); + KStdGameAction::save(m_kpok, TQT_SLOT(saveGame()), actionCollection()); + KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); //Settings showMenubarAction = - KStdAction::showMenubar(this, SLOT(toggleMenubar()), actionCollection()); + KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); soundAction = new KToggleAction(i18n("Soun&d"), 0, m_kpok, - SLOT(toggleSound()), actionCollection(), "options_sound"); + TQT_SLOT(toggleSound()), actionCollection(), "options_sound"); if (m_kpok->getSound()) m_kpok->toggleSound(); blinkingAction = new KToggleAction(i18n("&Blinking Cards"), 0, m_kpok, - SLOT(toggleBlinking()), actionCollection(), "options_blinking"); + TQT_SLOT(toggleBlinking()), actionCollection(), "options_blinking"); if (m_kpok->getBlinking()) m_kpok->toggleBlinking(); adjustAction = new KToggleAction(i18n("&Adjust Bet is Default"), 0, - m_kpok, SLOT(toggleAdjust()), actionCollection(), "options_adjust"); + m_kpok, TQT_SLOT(toggleAdjust()), actionCollection(), "options_adjust"); if (m_kpok->getAdjust()) m_kpok->toggleAdjust(); showStatusbarAction = - KStdAction::showStatusbar(this, SLOT(toggleStatusbar()), actionCollection()); + KStdAction::showStatusbar(this, TQT_SLOT(toggleStatusbar()), actionCollection()); - KStdAction::saveOptions(this, SLOT(saveOptions()), actionCollection()); - KStdGameAction::carddecks(m_kpok, SLOT(slotCardDeck()), actionCollection()); - KStdAction::preferences(m_kpok, SLOT(slotPreferences()), actionCollection()); + KStdAction::saveOptions(this, TQT_SLOT(saveOptions()), actionCollection()); + KStdGameAction::carddecks(m_kpok, TQT_SLOT(slotCardDeck()), actionCollection()); + KStdAction::preferences(m_kpok, TQT_SLOT(slotPreferences()), actionCollection()); // Keyboard shortcuts. (void)new KAction(i18n("Draw"), KShortcut(Qt::Key_Return), m_kpok, - SLOT(drawClick()), actionCollection(), "draw"); + TQT_SLOT(drawClick()), actionCollection(), "draw"); (void)new KAction(i18n("Exchange Card 1"), KShortcut(Qt::Key_1), m_kpok, - SLOT(exchangeCard1()), actionCollection(), "exchange_card_1"); + TQT_SLOT(exchangeCard1()), actionCollection(), "exchange_card_1"); (void)new KAction(i18n("Exchange Card 2"), KShortcut(Qt::Key_2), m_kpok, - SLOT(exchangeCard2()), actionCollection(), "exchange_card_2"); + TQT_SLOT(exchangeCard2()), actionCollection(), "exchange_card_2"); (void)new KAction(i18n("Exchange Card 3"), KShortcut(Qt::Key_3), m_kpok, - SLOT(exchangeCard3()), actionCollection(), "exchange_card_3"); + TQT_SLOT(exchangeCard3()), actionCollection(), "exchange_card_3"); (void)new KAction(i18n("Exchange Card 4"), KShortcut(Qt::Key_4), m_kpok, - SLOT(exchangeCard4()), actionCollection(), "exchange_card_4"); + TQT_SLOT(exchangeCard4()), actionCollection(), "exchange_card_4"); (void)new KAction(i18n("Exchange Card 5"), KShortcut(Qt::Key_5), m_kpok, - SLOT(exchangeCard5()), actionCollection(), "exchange_card_5"); + TQT_SLOT(exchangeCard5()), actionCollection(), "exchange_card_5"); setupGUI( KMainWindow::Save | StatusBar | Keys | Create); } @@ -177,7 +177,7 @@ bool PokerWindow::queryClose() return true; // Only ask if the game is changed in some way. - switch(KMessageBox::warningYesNoCancel(this, i18n("Do you want to save this game?"), QString::null, KStdGuiItem::save(), KStdGuiItem::dontSave())) { + switch(KMessageBox::warningYesNoCancel(this, i18n("Do you want to save this game?"), TQString::null, KStdGuiItem::save(), KStdGuiItem::dontSave())) { case KMessageBox::Yes : m_kpok->saveGame(); return true; @@ -195,7 +195,7 @@ bool PokerWindow::queryClose() * player game. */ -void PokerWindow::setHand(const QString &newHand, bool lastHand) +void PokerWindow::setHand(const TQString &newHand, bool lastHand) { if (lastHand) LHLabel->setText(i18n("Last hand: ") + newHand); @@ -218,7 +218,7 @@ void PokerWindow::showClickToHold(bool show) } -void PokerWindow::statusBarMessage(QString s) +void PokerWindow::statusBarMessage(TQString s) { clearStatusBar(); statusBar()->message(s); @@ -246,14 +246,14 @@ void PokerWindow::saveOptions() } -bool PokerWindow::eventFilter(QObject*, QEvent* e) +bool PokerWindow::eventFilter(TQObject*, TQEvent* e) { - if (e->type() == QEvent::MouseButtonPress) { + if (e->type() == TQEvent::MouseButtonPress) { - if (((QMouseEvent*)e)->button() == RightButton) { - QPopupMenu* popup = (QPopupMenu*) factory()->container("popup", this); + if (((TQMouseEvent*)e)->button() == RightButton) { + TQPopupMenu* popup = (TQPopupMenu*) factory()->container("popup", this); if (popup) - popup->popup(QCursor::pos()); + popup->popup(TQCursor::pos()); return true; } else return false; diff --git a/kpoker/top.h b/kpoker/top.h index 715aa20d..e09054fe 100644 --- a/kpoker/top.h +++ b/kpoker/top.h @@ -37,16 +37,16 @@ class PokerWindow : public KMainWindow protected: virtual bool queryClose(); - bool eventFilter(QObject*, QEvent*); + bool eventFilter(TQObject*, TQEvent*); void initKAction(); void readOptions(); protected slots: // void saveProperties(KConfig*); // void readProperties(KConfig*); - void setHand(const QString &newHand, bool lastHand = true); + void setHand(const TQString &newHand, bool lastHand = true); void showClickToHold(bool show); - void statusBarMessage(QString); + void statusBarMessage(TQString); void clearStatusBar(); void saveOptions(); void toggleMenubar(); @@ -62,7 +62,7 @@ class PokerWindow : public KMainWindow KToggleAction *showStatusbarAction; // statusbar elements: - QLabel *LHLabel; + TQLabel *LHLabel; bool clickToHoldIsShown; }; diff --git a/kreversi/Engine.cpp b/kreversi/Engine.cpp index da7750ce..c675b5b2 100644 --- a/kreversi/Engine.cpp +++ b/kreversi/Engine.cpp @@ -117,7 +117,7 @@ // or nearly equal value after the search is completed. -#include <qapplication.h> +#include <tqapplication.h> #include "Engine.h" @@ -129,7 +129,7 @@ #if !defined(__GNUC__) -ULONG64::ULONG64() : QBitArray(64) +ULONG64::ULONG64() : TQBitArray(64) { fill(0); } @@ -138,7 +138,7 @@ ULONG64::ULONG64() : QBitArray(64) // Initialize an ULONG64 from a 32 bit value. // -ULONG64::ULONG64( unsigned int value ) : QBitArray(64) +ULONG64::ULONG64( unsigned int value ) : TQBitArray(64) { fill(0); for(int i = 0; i < 32; i++) { diff --git a/kreversi/Engine.h b/kreversi/Engine.h index a84be895..4b895080 100644 --- a/kreversi/Engine.h +++ b/kreversi/Engine.h @@ -124,9 +124,9 @@ #include "Game.h" #include "Move.h" #include "Score.h" -#include <qmemarray.h> +#include <tqmemarray.h> #include <sys/times.h> -#include <qbitarray.h> +#include <tqbitarray.h> // Class ULONG64 is used as a bitmap for the squares. @@ -134,7 +134,7 @@ #if defined(__GNUC__) #define ULONG64 unsigned long long int #else -class ULONG64 : public QBitArray { +class ULONG64 : public TQBitArray { public: ULONG64(); ULONG64( unsigned int ); @@ -171,7 +171,7 @@ public: void Push(int x, int y); private: - QMemArray<SquareStackEntry> m_squarestack; + TQMemArray<SquareStackEntry> m_squarestack; int m_top; }; diff --git a/kreversi/Move.cpp b/kreversi/Move.cpp index 3a616647..3916925e 100644 --- a/kreversi/Move.cpp +++ b/kreversi/Move.cpp @@ -61,12 +61,12 @@ SimpleMove::SimpleMove(const SimpleMove &move) } -QString SimpleMove::asString() const +TQString SimpleMove::asString() const { if (m_x == -1) - return QString("pass"); + return TQString("pass"); else - return QString("%1%2").arg(" ABCDEFGH"[m_x]).arg(" 12345678"[m_y]); + return TQString("%1%2").arg(" ABCDEFGH"[m_x]).arg(" 12345678"[m_y]); } diff --git a/kreversi/Move.h b/kreversi/Move.h index e205f279..e6ddcf52 100644 --- a/kreversi/Move.h +++ b/kreversi/Move.h @@ -66,8 +66,8 @@ #define __MOVE__H__ -#include "qvaluelist.h" -#include "qstring.h" +#include "tqvaluelist.h" +#include "tqstring.h" #include "Score.h" @@ -88,7 +88,7 @@ public: int x() const { return m_x; } int y() const { return m_y; } - QString asString() const; + TQString asString() const; protected: Color m_color; @@ -114,11 +114,11 @@ public: bool wasTurned(uint x, uint y) const; private: - QValueList<char> m_turnedPieces; + TQValueList<char> m_turnedPieces; }; -typedef QValueList<Move> MoveList; +typedef TQValueList<Move> MoveList; #endif diff --git a/kreversi/Position.cpp b/kreversi/Position.cpp index 22ffb3cf..80daa7ac 100644 --- a/kreversi/Position.cpp +++ b/kreversi/Position.cpp @@ -207,7 +207,7 @@ bool Position::moveIsAtAllPossible() const // // Return true if the move was legal, otherwise return false. // -bool Position::doMove(SimpleMove &move, QValueList<char> *turned) +bool Position::doMove(SimpleMove &move, TQValueList<char> *turned) { if (move.color() == Nobody) return false; @@ -293,7 +293,7 @@ bool Position::undoMove(Move &move) } // 2. All turned pieces must be on the board anb be of the right color. - QValueList<char>::iterator it; + TQValueList<char>::iterator it; for (it = move.m_turnedPieces.begin(); it != move.m_turnedPieces.end(); ++it) { @@ -345,9 +345,9 @@ MoveList Position::generateMoves(Color color) const } -QString Position::asString() const +TQString Position::asString() const { - QString result; + TQString result; for (uint y = 1; y < 9; ++y) { for (uint x = 1; x < 9; ++x) { diff --git a/kreversi/Position.h b/kreversi/Position.h index 7269c2e6..916279e2 100644 --- a/kreversi/Position.h +++ b/kreversi/Position.h @@ -77,13 +77,13 @@ public: bool moveIsPossible(Color color) const; bool moveIsAtAllPossible() const; bool moveIsLegal(SimpleMove &move) const; - bool doMove(SimpleMove &move, QValueList<char> *turned = 0); + bool doMove(SimpleMove &move, TQValueList<char> *turned = 0); bool doMove(Move &move); bool undoMove(Move &move); MoveList generateMoves(Color color) const; - QString asString() const; + TQString asString() const; private: // The actual position itself. Use the simplest representation possible. diff --git a/kreversi/Score.h b/kreversi/Score.h index 947272dc..e1681be9 100644 --- a/kreversi/Score.h +++ b/kreversi/Score.h @@ -47,7 +47,7 @@ #ifndef __SCORE__H__ #define __SCORE__H__ -#include <qglobal.h> +#include <tqglobal.h> enum Color { White = 0, Black = 1, NbColors = 2, Nobody = NbColors }; diff --git a/kreversi/board.cpp b/kreversi/board.cpp index 9d367a38..e0324ebd 100644 --- a/kreversi/board.cpp +++ b/kreversi/board.cpp @@ -39,8 +39,8 @@ #include <unistd.h> -#include <qpainter.h> -#include <qfont.h> +#include <tqpainter.h> +#include <tqfont.h> #include <kapplication.h> #include <kstandarddirs.h> @@ -57,7 +57,7 @@ #ifndef PICDATA -#define PICDATA(x) KGlobal::dirs()->findResource("appdata", QString("pics/")+ x) +#define PICDATA(x) KGlobal::dirs()->findResource("appdata", TQString("pics/")+ x) #endif const uint HINT_BLINKRATE = 250000; @@ -72,8 +72,8 @@ const uint CHIP_SIZE = 36; // class KReversiBoardView -QReversiBoardView::QReversiBoardView(QWidget *parent, QReversiGame *krgame) - : QWidget(parent, "board"), +QReversiBoardView::QReversiBoardView(TQWidget *parent, QReversiGame *krgame) + : TQWidget(parent, "board"), chiptype(Unloaded) { m_krgame = krgame; @@ -107,10 +107,10 @@ void QReversiBoardView::start() void QReversiBoardView::loadChips(ChipType type) { - QString name("pics/"); + TQString name("pics/"); name += (type==Colored ? "chips.png" : "chips_mono.png"); - QString s = KGlobal::dirs()->findResource("appdata", name); + TQString s = KGlobal::dirs()->findResource("appdata", name); bool ok = allchips.load(s); Q_ASSERT( ok && allchips.width()==CHIP_SIZE*5 @@ -134,7 +134,7 @@ void QReversiBoardView::setAnimationSpeed(uint speed) // Handle mouse clicks. // -void QReversiBoardView::mousePressEvent(QMouseEvent *e) +void QReversiBoardView::mousePressEvent(TQMouseEvent *e) { // Only handle left button. No context menu. if ( e->button() != LeftButton ) { @@ -167,7 +167,7 @@ void QReversiBoardView::showHint(Move move) // The isVisible condition has been added so that when the player // was viewing a hint and quits the game window, the game doesn't // still have to do all this looping and directly ends. - QPainter p(this); + TQPainter p(this); p.setPen(black); m_hintShowing = true; for (int flash = 0; @@ -291,7 +291,7 @@ void QReversiBoardView::rotateChip(uint row, uint col) for (uint i = from; i != end; i += delta) { drawOnePiece(row, col, i); - kapp->flushX(); // FIXME: use QCanvas to avoid flicker... + kapp->flushX(); // FIXME: use TQCanvas to avoid flicker... usleep(ANIMATION_DELAY * anim_speed); } } @@ -304,7 +304,7 @@ void QReversiBoardView::rotateChip(uint row, uint col) void QReversiBoardView::updateBoard (bool force) { - QPainter p(this); + TQPainter p(this); p.setPen(black); // If we are showing legal moves, we have to erase the old ones @@ -331,32 +331,32 @@ void QReversiBoardView::updateBoard (bool force) // Draw letters and numbers if appropriate. if (m_marksShowing) { - QFont font("Sans Serif", zoomedSize() / 2 - 6); - font.setWeight(QFont::DemiBold); - QFontMetrics metrics(font); + TQFont font("Sans Serif", zoomedSize() / 2 - 6); + font.setWeight(TQFont::DemiBold); + TQFontMetrics metrics(font); p.setFont(font); uint charHeight = metrics.ascent(); for (uint i = 0; i < 8; i++) { - QChar letter = "ABCDEFGH"[i]; - QChar number = "12345678"[i]; + TQChar letter = "ABCDEFGH"[i]; + TQChar number = "12345678"[i]; uint charWidth = metrics.charWidth("ABCDEFGH", i); // The horizontal letters p.drawText(offset + i * zoomedSize() + (zoomedSize() - charWidth) / 2, offset - charHeight / 2 + 2, - QString(letter)); + TQString(letter)); p.drawText(offset + i * zoomedSize() + (zoomedSize() - charWidth) / 2, offset + 8 * zoomedSize() + offset - charHeight / 2 + 2, - QString(letter)); + TQString(letter)); // The vertical numbers p.drawText((offset - charWidth) / 2 + 2, offset + (i + 1) * zoomedSize() - charHeight / 2 + 2, - QString(number)); + TQString(number)); p.drawText(offset + 8 * zoomedSize() + (offset - charWidth) / 2 + 2, offset + (i + 1) * zoomedSize() - charHeight / 2 + 2, - QString(number)); + TQString(number)); } } @@ -405,7 +405,7 @@ void QReversiBoardView::updateBoard (bool force) void QReversiBoardView::showLegalMoves() { - QPainter p(this); + TQPainter p(this); p.setPen(black); // Get the legal moves in the current position. @@ -419,7 +419,7 @@ void QReversiBoardView::showLegalMoves() } -void QReversiBoardView::drawSmallCircle(int x, int y, QPainter &p) +void QReversiBoardView::drawSmallCircle(int x, int y, TQPainter &p) { int offset = m_marksShowing ? OFFSET() : 0; int ellipseSize = zoomedSize() / 3; @@ -433,7 +433,7 @@ void QReversiBoardView::drawSmallCircle(int x, int y, QPainter &p) -QPixmap QReversiBoardView::chipPixmap(Color color, uint size) const +TQPixmap QReversiBoardView::chipPixmap(Color color, uint size) const { return chipPixmap(CHIP_OFFSET[color], size); } @@ -442,16 +442,16 @@ QPixmap QReversiBoardView::chipPixmap(Color color, uint size) const // Get a pixmap for the chip 'i' at size 'size'. // -QPixmap QReversiBoardView::chipPixmap(uint i, uint size) const +TQPixmap QReversiBoardView::chipPixmap(uint i, uint size) const { // Get the part of the 'allchips' pixmap that contains exactly that // chip that we want to use. - QPixmap pix(CHIP_SIZE, CHIP_SIZE); + TQPixmap pix(CHIP_SIZE, CHIP_SIZE); copyBlt(&pix, 0, 0, &allchips, (i%5) * CHIP_SIZE, (i/5) * CHIP_SIZE, CHIP_SIZE, CHIP_SIZE); // Resize (scale) the pixmap to the desired size. - QWMatrix wm3; + TQWMatrix wm3; wm3.scale(float(size)/CHIP_SIZE, float(size)/CHIP_SIZE); return pix.xForm(wm3); @@ -475,7 +475,7 @@ void QReversiBoardView::drawOnePiece(uint row, uint col, int i) { int px = col * zoomedSize() + 1; int py = row * zoomedSize() + 1; - QPainter p(this); + TQPainter p(this); // Draw either a background pixmap or a background color to the square. int offset = m_marksShowing ? OFFSET() : 0; @@ -503,7 +503,7 @@ void QReversiBoardView::drawOnePiece(uint row, uint col, int i) // entire board. // -void QReversiBoardView::paintEvent(QPaintEvent *) +void QReversiBoardView::paintEvent(TQPaintEvent *) { updateBoard(true); } @@ -520,7 +520,7 @@ void QReversiBoardView::adjustSize() } -void QReversiBoardView::setPixmap(QPixmap &pm) +void QReversiBoardView::setPixmap(TQPixmap &pm) { if ( pm.width() == 0 ) return; @@ -531,10 +531,10 @@ void QReversiBoardView::setPixmap(QPixmap &pm) } -void QReversiBoardView::setColor(const QColor &c) +void QReversiBoardView::setColor(const TQColor &c) { bgColor = c; - bg = QPixmap(); + bg = TQPixmap(); update(); setEraseColor(c); } @@ -563,7 +563,7 @@ void QReversiBoardView::loadSettings() // Background if ( Prefs::backgroundImageChoice() ) { - QPixmap pm( Prefs::backgroundImage() ); + TQPixmap pm( Prefs::backgroundImage() ); if (!pm.isNull()) setPixmap(pm); } else { diff --git a/kreversi/board.h b/kreversi/board.h index 4f9d1603..f5efc739 100644 --- a/kreversi/board.h +++ b/kreversi/board.h @@ -39,8 +39,8 @@ #ifndef __BOARD__H__ #define __BOARD__H__ -#include <qwidget.h> -#include <qpixmap.h> +#include <tqwidget.h> +#include <tqpixmap.h> #include "Position.h" //#include "Game.h" @@ -54,12 +54,12 @@ class QReversiGame; // The class Board is the visible Reversi Board widget. // -class QReversiBoardView : public QWidget { +class QReversiBoardView : public TQWidget { Q_OBJECT public: - QReversiBoardView(QWidget *parent, QReversiGame *game); + QReversiBoardView(TQWidget *parent, QReversiGame *game); ~QReversiBoardView(); // starts all: emits some signal, so it can't be called from @@ -86,7 +86,7 @@ public: void loadSettings(); // To get the pixmap for the status view - QPixmap chipPixmap(Color color, uint size) const; + TQPixmap chipPixmap(Color color, uint size) const; signals: @@ -96,8 +96,8 @@ signals: protected: // event stuff - void paintEvent(QPaintEvent *); - void mousePressEvent(QMouseEvent *); + void paintEvent(TQPaintEvent *); + void mousePressEvent(TQMouseEvent *); private: @@ -108,31 +108,31 @@ private: void rotateChip(uint row, uint col); bool isField(int row, int col) const; - void setColor(const QColor &); - QColor color() const { return bgColor; } - void setPixmap(QPixmap &); + void setColor(const TQColor &); + TQColor color() const { return bgColor; } + void setPixmap(TQPixmap &); // Methods for handling images of pieces. enum ChipType { Unloaded, Colored, Grayscale }; void loadChips(ChipType); ChipType chipType() const { return chiptype; } - QPixmap chipPixmap(uint i, uint size) const; + TQPixmap chipPixmap(uint i, uint size) const; // Private drawing methods. void showLegalMoves(); - void drawSmallCircle(int x, int y, QPainter &p); + void drawSmallCircle(int x, int y, TQPainter &p); private: QReversiGame *m_krgame; // Pointer to the game object (not owner). // The background of the board - a color and a pixmap. - QColor bgColor; - QPixmap bg; + TQColor bgColor; + TQPixmap bg; // the pieces ChipType chiptype; - QPixmap allchips; + TQPixmap allchips; uint anim_speed; // Special stuff used only in smaller areas. diff --git a/kreversi/highscores.cpp b/kreversi/highscores.cpp index 88317a87..1da40d26 100644 --- a/kreversi/highscores.cpp +++ b/kreversi/highscores.cpp @@ -45,23 +45,23 @@ ExtManager::ExtManager() setShowDrawGamesStatistic(true); const uint RANGE[6] = { 0, 32, 40, 48, 56, 64 }; - QMemArray<uint> s; + TQMemArray<uint> s; s.duplicate(RANGE, 6); setScoreHistogram(s, ScoreBound); } -QString ExtManager::gameTypeLabel(uint gameType, LabelType type) const +TQString ExtManager::gameTypeLabel(uint gameType, LabelType type) const { const Data &data = DATA[gameType]; switch (type) { case Icon: return data.icon; - case Standard: return QString::number(gameType); + case Standard: return TQString::number(gameType); case I18N: return i18n(data.label); case WW: break; } - return QString::null; + return TQString::null; } @@ -78,8 +78,8 @@ void ExtManager::convertLegacy(uint gameType) KConfigGroupSaver cg(kapp->config(), "High Score"); for (uint i = 1; i <= 10; i++) { - QString key = "Pos" + QString::number(i); - QString name = cg.config()->readEntry(key + "Name", QString::null); + TQString key = "Pos" + TQString::number(i); + TQString name = cg.config()->readEntry(key + "Name", TQString::null); if ( name.isEmpty() ) name = i18n("anonymous"); @@ -88,8 +88,8 @@ void ExtManager::convertLegacy(uint gameType) if ( score==0 ) continue; - QString sdate = cg.config()->readEntry(key + "Date", QString::null); - QDateTime date = QDateTime::fromString(sdate); + TQString sdate = cg.config()->readEntry(key + "Date", TQString::null); + TQDateTime date = TQDateTime::fromString(sdate); Score s(Won); s.setScore(score); diff --git a/kreversi/highscores.h b/kreversi/highscores.h index a599d12d..3eda6482 100644 --- a/kreversi/highscores.h +++ b/kreversi/highscores.h @@ -35,7 +35,7 @@ class KDE_EXPORT ExtManager : public Manager ExtManager(); private: - QString gameTypeLabel(uint gameTye, LabelType) const; + TQString gameTypeLabel(uint gameTye, LabelType) const; void convertLegacy(uint gameType); struct Data { diff --git a/kreversi/kreversi.cpp b/kreversi/kreversi.cpp index b0a5ddc8..d01c2f6e 100644 --- a/kreversi/kreversi.cpp +++ b/kreversi/kreversi.cpp @@ -39,9 +39,9 @@ #include <unistd.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qlistbox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqlistbox.h> #include <kapplication.h> #include <kdebug.h> @@ -74,7 +74,7 @@ #ifndef PICDATA #define PICDATA(x) \ - KGlobal::dirs()->findResource("appdata", QString("pics/") + x) + KGlobal::dirs()->findResource("appdata", TQString("pics/") + x) #endif @@ -82,8 +82,8 @@ KReversi::KReversi() : KZoomMainWindow(10, 300, 5, "kreversi"), m_gameOver(false) { - QWidget *w; - QGridLayout *top; + TQWidget *w; + TQGridLayout *top; KNotifyClient::startDaemon(); @@ -98,10 +98,10 @@ KReversi::KReversi() setStrength(1); // The visual stuff - w = new QWidget(this); + w = new TQWidget(this); setCentralWidget(w); - top = new QGridLayout(w, 2, 2); + top = new TQGridLayout(w, 2, 2); // The reversi game view. m_gameView = new QReversiGameView(w, m_game); @@ -116,15 +116,15 @@ KReversi::KReversi() // The only part of the view that is left in this class is the // indicator of whose turn it is in the status bar. The rest is // in the game view. - connect(m_game, SIGNAL(sig_newGame()), this, SLOT(showTurn())); - connect(m_game, SIGNAL(sig_move(uint, Move&)), - this, SLOT(handleMove(uint, Move&))); // Calls showTurn(). - connect(m_game, SIGNAL(sig_update()), this, SLOT(showTurn())); - connect(m_game, SIGNAL(sig_gameOver()), this, SLOT(slotGameOver())); + connect(m_game, TQT_SIGNAL(sig_newGame()), this, TQT_SLOT(showTurn())); + connect(m_game, TQT_SIGNAL(sig_move(uint, Move&)), + this, TQT_SLOT(handleMove(uint, Move&))); // Calls showTurn(). + connect(m_game, TQT_SIGNAL(sig_update()), this, TQT_SLOT(showTurn())); + connect(m_game, TQT_SIGNAL(sig_gameOver()), this, TQT_SLOT(slotGameOver())); // Signal that is sent when the user clicks on the board. - connect(m_gameView, SIGNAL(signalSquareClicked(int, int)), - this, SLOT(slotSquareClicked(int, int))); + connect(m_gameView, TQT_SIGNAL(signalSquareClicked(int, int)), + this, TQT_SLOT(slotSquareClicked(int, int))); loadSettings(); @@ -150,38 +150,38 @@ KReversi::~KReversi() void KReversi::createKActions() { // Standard Game Actions. - KStdGameAction::gameNew(this, SLOT(slotNewGame()), actionCollection(), + KStdGameAction::gameNew(this, TQT_SLOT(slotNewGame()), actionCollection(), "game_new"); - KStdGameAction::load(this, SLOT(slotOpenGame()), actionCollection()); - KStdGameAction::save(this, SLOT(slotSave()), actionCollection()); - KStdGameAction::quit(this, SLOT(close()), actionCollection()); - KStdGameAction::hint(this, SLOT(slotHint()), actionCollection(), + KStdGameAction::load(this, TQT_SLOT(slotOpenGame()), actionCollection()); + KStdGameAction::save(this, TQT_SLOT(slotSave()), actionCollection()); + KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdGameAction::hint(this, TQT_SLOT(slotHint()), actionCollection(), "game_hint"); - KStdGameAction::undo(this, SLOT(slotUndo()), actionCollection(), + KStdGameAction::undo(this, TQT_SLOT(slotUndo()), actionCollection(), "game_undo"); // Non-standard Game Actions: Stop, Continue, Switch sides stopAction = new KAction(i18n("&Stop Thinking"), "game_stop", Qt::Key_Escape, - this, SLOT(slotInterrupt()), actionCollection(), + this, TQT_SLOT(slotInterrupt()), actionCollection(), "game_stop"); continueAction = new KAction(i18n("&Continue Thinking"), "reload", 0, - this, SLOT(slotContinue()), actionCollection(), + this, TQT_SLOT(slotContinue()), actionCollection(), "game_continue"); new KAction(i18n("S&witch Sides"), 0, 0, - this, SLOT(slotSwitchSides()), actionCollection(), + this, TQT_SLOT(slotSwitchSides()), actionCollection(), "game_switch_sides"); // Some more standard game actions: Highscores, Settings. - KStdGameAction::highscores(this, SLOT(showHighScoreDialog()), actionCollection()); - KStdAction::preferences(this, SLOT(slotEditSettings()), actionCollection()); + KStdGameAction::highscores(this, TQT_SLOT(showHighScoreDialog()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(slotEditSettings()), actionCollection()); // Actions for the view(s). showLastMoveAction = new KToggleAction(i18n("Show Last Move"), "lastmoves", 0, - this, SLOT(slotShowLastMove()), + this, TQT_SLOT(slotShowLastMove()), actionCollection(), "show_last_move"); showLegalMovesAction = new KToggleAction(i18n("Show Legal Moves"), "legalmoves", 0, - this, SLOT(slotShowLegalMoves()), + this, TQT_SLOT(slotShowLegalMoves()), actionCollection(), "show_legal_moves"); } @@ -392,7 +392,7 @@ void KReversi::slotSwitchSides() if (m_game->moveNumber() != 0) { int res = KMessageBox::warningContinueCancel(this, i18n("If you switch side, your score will not be added to the highscores."), - QString::null, QString::null, "switch_side_warning"); + TQString::null, TQString::null, "switch_side_warning"); if ( res==KMessageBox::Cancel ) return; @@ -465,7 +465,7 @@ void KReversi::showTurn(Color color) if (color == humanColor()) statusBar()->message(i18n("Your turn")); else if (color == computerColor()) { - QString message = i18n("Computer's turn"); + TQString message = i18n("Computer's turn"); // We can't use the interrupted() test here since we might be in a // middle state when called from slotInterrupt(). @@ -608,21 +608,21 @@ void KReversi::showGameOver(Color color) // Show the winner in a messagebox. if ( color == Nobody ) { KNotifyClient::event(winId(), "draw", i18n("Draw!")); - QString s = i18n("Game is drawn!\n\nYou : %1\nComputer: %2") + TQString s = i18n("Game is drawn!\n\nYou : %1\nComputer: %2") .arg(human).arg(computer); KMessageBox::information(this, s, i18n("Game Ended")); score.setType(KExtHighscore::Draw); } else if ( humanColor() == color ) { KNotifyClient::event(winId(), "won", i18n("Game won!")); - QString s = i18n("Congratulations, you have won!\n\nYou : %1\nComputer: %2") + TQString s = i18n("Congratulations, you have won!\n\nYou : %1\nComputer: %2") .arg(human).arg(computer); KMessageBox::information(this, s, i18n("Game Ended")); score.setType(KExtHighscore::Won); } else { KNotifyClient::event(winId(), "lost", i18n("Game lost!")); - QString s = i18n("You have lost the game!\n\nYou : %1\nComputer: %2") + TQString s = i18n("You have lost the game!\n\nYou : %1\nComputer: %2") .arg(human).arg(computer); KMessageBox::information(this, s, i18n("Game Ended")); score.setType(KExtHighscore::Lost); @@ -661,8 +661,8 @@ void KReversi::saveGame(KConfig *config) for (uint i = 0; i < m_game->moveNumber(); i++) { Move move = m_game->move(i); - QString moveString; - QString idx; + TQString moveString; + TQString idx; moveString.sprintf("%d %d %d", move.x(), move.y(), (int) move.color()); idx.sprintf("Move_%d", i + 1); @@ -691,10 +691,10 @@ bool KReversi::loadGame(KConfig *config) uint movenumber = 1; while (nmoves--) { // Read one move. - QString idx; + TQString idx; idx.sprintf("Move_%d", movenumber++); - QStringList s = config->readListEntry(idx, ' '); + TQStringList s = config->readListEntry(idx, ' '); uint x = (*s.at(0)).toUInt(); uint y = (*s.at(1)).toUInt(); Color color = (Color)(*s.at(2)).toInt(); @@ -755,7 +755,7 @@ void KReversi::slotEditSettings() Settings *general = new Settings(0, "General"); dialog->addPage(general, i18n("General"), "package_settings"); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(loadSettings())); dialog->show(); } diff --git a/kreversi/kreversi.h b/kreversi/kreversi.h index 17599fa2..a106623c 100644 --- a/kreversi/kreversi.h +++ b/kreversi/kreversi.h @@ -90,7 +90,7 @@ private: void createKActions(); // View functions. - QString getPlayerName(); + TQString getPlayerName(); virtual void writeZoomSetting(uint zoom); virtual uint readZoomSetting() const; diff --git a/kreversi/kzoommainwindow.cpp b/kreversi/kzoommainwindow.cpp index 4da50935..56f46742 100644 --- a/kreversi/kzoommainwindow.cpp +++ b/kreversi/kzoommainwindow.cpp @@ -34,11 +34,11 @@ KZoomMainWindow::KZoomMainWindow(uint min, uint max, uint step, installEventFilter(this); m_zoomInAction = - KStdAction::zoomIn(this, SLOT(zoomIn()), actionCollection()); + KStdAction::zoomIn(this, TQT_SLOT(zoomIn()), actionCollection()); m_zoomOutAction = - KStdAction::zoomOut(this, SLOT(zoomOut()), actionCollection()); + KStdAction::zoomOut(this, TQT_SLOT(zoomOut()), actionCollection()); m_menu = - KStdAction::showMenubar(this, SLOT(toggleMenubar()), actionCollection()); + KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); } @@ -53,37 +53,37 @@ void KZoomMainWindow::init(const char *popupName) // context popup if (popupName) { - QPopupMenu *popup = - static_cast<QPopupMenu *>(factory()->container(popupName, this)); + TQPopupMenu *popup = + static_cast<TQPopupMenu *>(factory()->container(popupName, this)); Q_ASSERT(popup); if (popup) KContextMenuManager::insert(this, popup); } } -void KZoomMainWindow::addWidget(QWidget *widget) +void KZoomMainWindow::addWidget(TQWidget *widget) { widget->adjustSize(); - QWidget *tlw = widget->topLevelWidget(); + TQWidget *tlw = widget->topLevelWidget(); KZoomMainWindow *zm = static_cast<KZoomMainWindow *>(tlw->qt_cast("KZoomMainWindow")); Q_ASSERT(zm); zm->m_widgets.append(widget); - connect(widget, SIGNAL(destroyed()), zm, SLOT(widgetDestroyed())); + connect(widget, TQT_SIGNAL(destroyed()), zm, TQT_SLOT(widgetDestroyed())); } void KZoomMainWindow::widgetDestroyed() { - m_widgets.remove(static_cast<const QWidget *>(sender())); + m_widgets.remove(static_cast<const TQWidget *>(sender())); } -bool KZoomMainWindow::eventFilter(QObject *o, QEvent *e) +bool KZoomMainWindow::eventFilter(TQObject *o, TQEvent *e) { - if ( e->type()==QEvent::LayoutHint ) + if ( e->type()==TQEvent::LayoutHint ) setFixedSize(minimumSize()); // because K/QMainWindow // does not manage fixed central widget // with hidden menubar... @@ -96,7 +96,7 @@ void KZoomMainWindow::setZoom(uint zoom) m_zoom = zoom; writeZoomSetting(m_zoom); - QPtrListIterator<QWidget> it(m_widgets); + TQPtrListIterator<TQWidget> it(m_widgets); for (; it.current(); ++it) (*it)->adjustSize(); diff --git a/kreversi/kzoommainwindow.h b/kreversi/kzoommainwindow.h index dee04139..73acd539 100644 --- a/kreversi/kzoommainwindow.h +++ b/kreversi/kzoommainwindow.h @@ -56,7 +56,7 @@ public: * widget is called whenever the zoom is changed. * This function assumes that the topLevelWidget() is the KZoomMainWindow. */ - static void addWidget(QWidget *widget); + static void addWidget(TQWidget *widget); uint zoom() const { return m_zoom; } @@ -74,7 +74,7 @@ protected: void init(const char *popupName = 0); virtual void setZoom(uint zoom); - virtual bool eventFilter(QObject *o, QEvent *e); + virtual bool eventFilter(TQObject *o, TQEvent *e); virtual bool queryExit(); /** You need to implement this method since different application @@ -124,7 +124,7 @@ private: uint m_minZoom; uint m_maxZoom; - QPtrList<QWidget> m_widgets; + TQPtrList<TQWidget> m_widgets; KAction *m_zoomInAction; KAction *m_zoomOutAction; diff --git a/kreversi/qreversigame.cpp b/kreversi/qreversigame.cpp index d31bac4a..3e940ca2 100644 --- a/kreversi/qreversigame.cpp +++ b/kreversi/qreversigame.cpp @@ -44,8 +44,8 @@ // class QReversiGame -QReversiGame::QReversiGame(QObject *parent) - : QObject(parent), Game() +QReversiGame::QReversiGame(TQObject *parent) + : TQObject(parent), Game() { } diff --git a/kreversi/qreversigame.h b/kreversi/qreversigame.h index d1712832..b4dcb19b 100644 --- a/kreversi/qreversigame.h +++ b/kreversi/qreversigame.h @@ -39,8 +39,8 @@ #ifndef __QREVERSIGAME__H__ #define __QREVERSIGAME__H__ -#include <qwidget.h> -#include <qpixmap.h> +#include <tqwidget.h> +#include <tqpixmap.h> #include "Position.h" #include "Game.h" @@ -62,11 +62,11 @@ class KConfig; // gameOver() // -class QReversiGame : public QObject, public Game { +class QReversiGame : public TQObject, public Game { Q_OBJECT public: - QReversiGame(QObject *parent = 0); + QReversiGame(TQObject *parent = 0); ~QReversiGame(); // Methods dealing with the game diff --git a/kreversi/qreversigameview.cpp b/kreversi/qreversigameview.cpp index 92812657..e9104398 100644 --- a/kreversi/qreversigameview.cpp +++ b/kreversi/qreversigameview.cpp @@ -37,9 +37,9 @@ */ -#include <qlayout.h> -#include <qwidget.h> -#include <qlabel.h> +#include <tqlayout.h> +#include <tqwidget.h> +#include <tqlabel.h> #include <klocale.h> #include <kdialog.h> @@ -47,8 +47,8 @@ #if 0 #include <unistd.h> -#include <qpainter.h> -#include <qfont.h> +#include <tqpainter.h> +#include <tqfont.h> #include <kapplication.h> #include <kstandarddirs.h> @@ -71,22 +71,22 @@ // class StatusWidget -StatusWidget::StatusWidget(const QString &text, QWidget *parent) - : QWidget(parent, "status_widget") +StatusWidget::StatusWidget(const TQString &text, TQWidget *parent) + : TQWidget(parent, "status_widget") { - QHBoxLayout *hbox = new QHBoxLayout(this, 0, KDialog::spacingHint()); - QLabel *label; + TQHBoxLayout *hbox = new TQHBoxLayout(this, 0, KDialog::spacingHint()); + TQLabel *label; - m_textLabel = new QLabel(text, this); + m_textLabel = new TQLabel(text, this); hbox->addWidget(m_textLabel); - m_pixLabel = new QLabel(this); + m_pixLabel = new TQLabel(this); hbox->addWidget(m_pixLabel); - label = new QLabel(":", this); + label = new TQLabel(":", this); hbox->addWidget(label); - m_scoreLabel = new QLabel(this); + m_scoreLabel = new TQLabel(this); hbox->addWidget(m_scoreLabel); } @@ -94,7 +94,7 @@ StatusWidget::StatusWidget(const QString &text, QWidget *parent) // Set the text label // -void StatusWidget::setText(const QString &string) +void StatusWidget::setText(const TQString &string) { m_textLabel->setText(string); } @@ -103,7 +103,7 @@ void StatusWidget::setText(const QString &string) // Set the pixel label - used to show the color. // -void StatusWidget::setPixmap(const QPixmap &pixmap) +void StatusWidget::setPixmap(const TQPixmap &pixmap) { m_pixLabel->setPixmap(pixmap); } @@ -114,7 +114,7 @@ void StatusWidget::setPixmap(const QPixmap &pixmap) void StatusWidget::setScore(uint s) { - m_scoreLabel->setText(QString::number(s)); + m_scoreLabel->setText(TQString::number(s)); } @@ -122,8 +122,8 @@ void StatusWidget::setScore(uint s) // class QReversiGameView -QReversiGameView::QReversiGameView(QWidget *parent, QReversiGame *game) - : QWidget(parent, "gameview") +QReversiGameView::QReversiGameView(TQWidget *parent, QReversiGame *game) + : TQWidget(parent, "gameview") { // Store a pointer to the game. m_game = game; @@ -135,15 +135,15 @@ QReversiGameView::QReversiGameView(QWidget *parent, QReversiGame *game) m_humanColor = Nobody; // Connect the game to the view. - connect(m_game, SIGNAL(sig_newGame()), this, SLOT(newGame())); - connect(m_game, SIGNAL(sig_move(uint, Move&)), - this, SLOT(moveMade(uint, Move&))); - connect(m_game, SIGNAL(sig_update()), this, SLOT(updateView())); + connect(m_game, TQT_SIGNAL(sig_newGame()), this, TQT_SLOT(newGame())); + connect(m_game, TQT_SIGNAL(sig_move(uint, Move&)), + this, TQT_SLOT(moveMade(uint, Move&))); + connect(m_game, TQT_SIGNAL(sig_update()), this, TQT_SLOT(updateView())); // The sig_gameOver signal is not used by the view. // Reemit the signal from the board. - connect(m_boardView, SIGNAL(signalSquareClicked(int, int)), - this, SLOT(squareClicked(int, int))); + connect(m_boardView, TQT_SIGNAL(signalSquareClicked(int, int)), + this, TQT_SLOT(squareClicked(int, int))); } @@ -156,7 +156,7 @@ QReversiGameView::~QReversiGameView() void QReversiGameView::createView() { - QGridLayout *layout = new QGridLayout(this, 4, 2); + TQGridLayout *layout = new TQGridLayout(this, 4, 2); // The board m_boardView = new QReversiBoardView(this, m_game); @@ -164,20 +164,20 @@ void QReversiGameView::createView() layout->addMultiCellWidget(m_boardView, 0, 3, 0, 0); // The status widgets - m_blackStatus = new StatusWidget(QString::null, this); + m_blackStatus = new StatusWidget(TQString::null, this); m_blackStatus->setPixmap(m_boardView->chipPixmap(Black, 20)); layout->addWidget(m_blackStatus, 0, 1); - m_whiteStatus = new StatusWidget(QString::null, this); + m_whiteStatus = new StatusWidget(TQString::null, this); m_whiteStatus->setPixmap(m_boardView->chipPixmap(White, 20)); layout->addWidget(m_whiteStatus, 1, 1); // The "Moves" label - QLabel *movesLabel = new QLabel( i18n("Moves"), this); + TQLabel *movesLabel = new TQLabel( i18n("Moves"), this); movesLabel->setAlignment(AlignCenter); layout->addWidget(movesLabel, 2, 1); // The list of moves. - m_movesView = new QListBox(this, "moves"); + m_movesView = new TQListBox(this, "moves"); m_movesView->setMinimumWidth(150); layout->addWidget(m_movesView, 3, 1); } @@ -202,17 +202,17 @@ void QReversiGameView::newGame() void QReversiGameView::moveMade(uint moveNum, Move &move) { //FIXME: Error checks. - QString colorsWB[] = { + TQString colorsWB[] = { i18n("White"), i18n("Black") }; - QString colorsRB[] = { + TQString colorsRB[] = { i18n("Red"), i18n("Blue") }; // Insert the new move in the listbox and mark it as the current one. - m_movesView->insertItem(QString("%1. %2 %3") + m_movesView->insertItem(TQString("%1. %2 %3") .arg(moveNum) .arg(Prefs::grayscale() ? colorsWB[move.color()] : colorsRB[move.color()]) diff --git a/kreversi/qreversigameview.h b/kreversi/qreversigameview.h index a3059a25..59855fa9 100644 --- a/kreversi/qreversigameview.h +++ b/kreversi/qreversigameview.h @@ -40,7 +40,7 @@ #define __QREVERSIGAMEVIEW__H__ -#include <qlistbox.h> +#include <tqlistbox.h> #include "Score.h" #include "Move.h" @@ -60,27 +60,27 @@ class StatusWidget : public QWidget Q_OBJECT public: - StatusWidget(const QString &text, QWidget *parent); + StatusWidget(const TQString &text, TQWidget *parent); - void setText(const QString &string); - void setPixmap(const QPixmap &pixmap); + void setText(const TQString &string); + void setPixmap(const TQPixmap &pixmap); void setScore(uint score); private: - QLabel *m_textLabel; - QLabel *m_pixLabel; - QLabel *m_scoreLabel; + TQLabel *m_textLabel; + TQLabel *m_pixLabel; + TQLabel *m_scoreLabel; }; // The main game view -class QReversiGameView : public QWidget { +class QReversiGameView : public TQWidget { Q_OBJECT public: - QReversiGameView(QWidget *parent, QReversiGame *game); + QReversiGameView(TQWidget *parent, QReversiGame *game); ~QReversiGameView(); // Proxy methods for the board view @@ -94,12 +94,12 @@ public: void setAnimationSpeed(uint speed){m_boardView->setAnimationSpeed(speed);} // To get the pixmap for the status view - QPixmap chipPixmap(Color color, uint size) const + TQPixmap chipPixmap(Color color, uint size) const { return m_boardView->chipPixmap(color, size); } // Proxy methods for the movelist // FIXME: Not all of these need to be externally reachable - void insertMove(QString moveString) { m_movesView->insertItem(moveString); } + void insertMove(TQString moveString) { m_movesView->insertItem(moveString); } void removeMove(int moveNum) { m_movesView->removeItem(moveNum); updateStatus(); @@ -150,7 +150,7 @@ private: // Widgets in the view. QReversiBoardView *m_boardView; - QListBox *m_movesView; + TQListBox *m_movesView; StatusWidget *m_blackStatus; StatusWidget *m_whiteStatus; }; diff --git a/ksame/KSameWidget.cpp b/ksame/KSameWidget.cpp index e9f2d730..a0e0142e 100644 --- a/ksame/KSameWidget.cpp +++ b/ksame/KSameWidget.cpp @@ -21,8 +21,8 @@ #include "KSameWidget.h" -#include <qwidget.h> -#include <qvbox.h> +#include <tqwidget.h> +#include <tqvbox.h> #include <kapplication.h> #include <kiconloader.h> @@ -46,20 +46,20 @@ static int default_colors=3; #define Board KScoreDialog::Custom1 -KSameWidget::KSameWidget(QWidget *parent, const char* name, WFlags fl) : +KSameWidget::KSameWidget(TQWidget *parent, const char* name, WFlags fl) : KMainWindow(parent,name,fl) { - KStdGameAction::gameNew(this, SLOT(m_new()), actionCollection(), "game_new"); + KStdGameAction::gameNew(this, TQT_SLOT(m_new()), actionCollection(), "game_new"); restart = new KAction(i18n("&Restart This Board"), CTRL+Key_R, this, - SLOT(m_restart()), actionCollection(), "game_restart"); - KStdGameAction::highscores(this, SLOT(m_showhs()), actionCollection(), "game_highscores"); - KStdGameAction::quit(this, SLOT(close()), actionCollection(), "game_quit"); - undo = KStdGameAction::undo(this, SLOT(m_undo()), actionCollection(), "edit_undo"); + TQT_SLOT(m_restart()), actionCollection(), "game_restart"); + KStdGameAction::highscores(this, TQT_SLOT(m_showhs()), actionCollection(), "game_highscores"); + KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection(), "game_quit"); + undo = KStdGameAction::undo(this, TQT_SLOT(m_undo()), actionCollection(), "edit_undo"); random = new KToggleAction(i18n("&Random Board"), 0, 0, 0, actionCollection(), "random_board"); - showNumberRemaining = new KToggleAction(i18n("&Show Number Remaining"), 0, this, SLOT(showNumberRemainingToggled()), actionCollection(), "showNumberRemaining"); + showNumberRemaining = new KToggleAction(i18n("&Show Number Remaining"), 0, this, TQT_SLOT(showNumberRemainingToggled()), actionCollection(), "showNumberRemaining"); - KStdAction::configureNotifications(this, SLOT(configureNotifications()), + KStdAction::configureNotifications(this, TQT_SLOT(configureNotifications()), actionCollection()); status=statusBar(); @@ -70,14 +70,14 @@ KSameWidget::KSameWidget(QWidget *parent, const char* name, WFlags fl) : stone = new StoneWidget(this,15,10); - connect( stone, SIGNAL(s_gameover()), this, SLOT(gameover())); - connect( stone, SIGNAL(s_colors(int)), this, SLOT(setColors(int))); - connect( stone, SIGNAL(s_board(int)), this, SLOT(setBoard(int))); - connect( stone, SIGNAL(s_marked(int)), this, SLOT(setMarked(int))); - connect( stone, SIGNAL(s_score(int)), this, SLOT(setScore(int))); - connect( stone, SIGNAL(s_remove(int,int)), this, SLOT(stonesRemoved(int,int))); + connect( stone, TQT_SIGNAL(s_gameover()), this, TQT_SLOT(gameover())); + connect( stone, TQT_SIGNAL(s_colors(int)), this, TQT_SLOT(setColors(int))); + connect( stone, TQT_SIGNAL(s_board(int)), this, TQT_SLOT(setBoard(int))); + connect( stone, TQT_SIGNAL(s_marked(int)), this, TQT_SLOT(setMarked(int))); + connect( stone, TQT_SIGNAL(s_score(int)), this, TQT_SLOT(setScore(int))); + connect( stone, TQT_SIGNAL(s_remove(int,int)), this, TQT_SLOT(stonesRemoved(int,int))); - connect(stone, SIGNAL(s_sizechanged()), this, SLOT(sizeChanged())); + connect(stone, TQT_SIGNAL(s_sizechanged()), this, TQT_SLOT(sizeChanged())); sizeChanged(); setCentralWidget(stone); @@ -119,10 +119,10 @@ void KSameWidget::sizeChanged() { void KSameWidget::showNumberRemainingToggled() { if(showNumberRemaining->isChecked()){ - QStringList list; + TQStringList list; for(int i=1;i<=stone->colors();i++) - list.append(QString("%1").arg(stone->count(i))); - QString count = QString(" (%1)").arg(list.join(",")); + list.append(TQString("%1").arg(stone->count(i))); + TQString count = TQString(" (%1)").arg(list.join(",")); status->changeItem(i18n("%1 Colors%2").arg(stone->colors()).arg(count),1); } else status->changeItem(i18n("%1 Colors").arg(stone->colors()),1); @@ -156,7 +156,7 @@ void KSameWidget::m_new() { KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok); - QVBox *page = dlg.makeVBoxMainWidget(); + TQVBox *page = dlg.makeVBoxMainWidget(); KIntNumInput bno(0, page); bno.setRange(0, 1000000, 1); @@ -207,10 +207,10 @@ void KSameWidget::stonesRemoved(int,int) { void KSameWidget::setScore(int score) { if(showNumberRemaining->isChecked()){ - QStringList list; + TQStringList list; for(int i=1;i<=stone->colors();i++) - list.append(QString("%1").arg(stone->count(i))); - QString count = QString(" (%1)").arg(list.join(",")); + list.append(TQString("%1").arg(stone->count(i))); + TQString count = TQString(" (%1)").arg(list.join(",")); status->changeItem(i18n("%1 Colors%2").arg(stone->colors()).arg(count),1); } status->changeItem(i18n("Score: %1").arg(score, 6),4); diff --git a/ksame/KSameWidget.h b/ksame/KSameWidget.h index ff02e1c4..46154094 100644 --- a/ksame/KSameWidget.h +++ b/ksame/KSameWidget.h @@ -31,7 +31,7 @@ class KSameWidget: public KMainWindow { Q_OBJECT public: - KSameWidget(QWidget *parent=0, const char* name=0, WFlags fl=0); + KSameWidget(TQWidget *parent=0, const char* name=0, WFlags fl=0); private slots: /* File Menu */ diff --git a/ksame/StoneField.cpp b/ksame/StoneField.cpp index 3862d7fb..673e0e38 100644 --- a/ksame/StoneField.cpp +++ b/ksame/StoneField.cpp @@ -60,7 +60,7 @@ StoneField::StoneField(int width, int height, Q_ASSERT(width>0); Q_ASSERT(height>0); - if (undoenabled) undolist=new QPtrList<StoneFieldState>; + if (undoenabled) undolist=new TQPtrList<StoneFieldState>; else undolist=0; sizex=width; diff --git a/ksame/StoneField.h b/ksame/StoneField.h index df199605..d38a19b6 100644 --- a/ksame/StoneField.h +++ b/ksame/StoneField.h @@ -23,7 +23,7 @@ #define _STONEFIELD #include <krandomsequence.h> -#include <qptrlist.h> +#include <tqptrlist.h> struct Stone { unsigned char color; @@ -69,7 +69,7 @@ private: int marked; KRandomSequence random; - QPtrList<StoneFieldState> *undolist; + TQPtrList<StoneFieldState> *undolist; public: StoneField(int width=15,int height=10, int colors=3,unsigned int board=0, diff --git a/ksame/StoneWidget.cpp b/ksame/StoneWidget.cpp index 3d4114de..81fafca9 100644 --- a/ksame/StoneWidget.cpp +++ b/ksame/StoneWidget.cpp @@ -22,11 +22,11 @@ #include <stdio.h> #include <stdlib.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qbitmap.h> -#include <qimage.h> -#include <qcursor.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqbitmap.h> +#include <tqimage.h> +#include <tqcursor.h> #include <kapplication.h> #include <kconfig.h> @@ -42,15 +42,15 @@ struct StoneSlice { - QPixmap stone; + TQPixmap stone; }; -StoneWidget::StoneWidget( QWidget *parent, int x, int y ) - : QWidget(parent,"StoneWidget"), stonefield(x,y) +StoneWidget::StoneWidget( TQWidget *parent, int x, int y ) + : TQWidget(parent,"StoneWidget"), stonefield(x,y) { - setBackgroundPixmap(QPixmap(locate("wallpaper", "Time-For-Lunch-2.jpg"))); - QPixmap stonemap(locate("appdata", "stones.png")); + setBackgroundPixmap(TQPixmap(locate("wallpaper", "Time-For-Lunch-2.jpg"))); + TQPixmap stonemap(locate("appdata", "stones.png")); assert(!stonemap.isNull()); @@ -65,7 +65,7 @@ StoneWidget::StoneWidget( QWidget *parent, int x, int y ) stone_height=stonemap.height()/maxcolors; map = new StoneSlice*[maxcolors]; - QBitmap mask; + TQBitmap mask; for (int c = 0; c < maxcolors; c++) { map[c] = new StoneSlice[maxslices]; @@ -76,7 +76,7 @@ StoneWidget::StoneWidget( QWidget *parent, int x, int y ) &stonemap, stone_width * s, c*stone_height, stone_width,stone_height,CopyROP,false); - QImage im = map[c][s].stone.convertToImage(); + TQImage im = map[c][s].stone.convertToImage(); mask = im.createHeuristicMask(); map[c][s].stone.setMask(mask); } @@ -87,7 +87,7 @@ StoneWidget::StoneWidget( QWidget *parent, int x, int y ) setMouseTracking(true); - // QColor c(115,115,115); + // TQColor c(115,115,115); // setBackgroundColor(c); // emit s_sizechanged(); @@ -127,7 +127,7 @@ StoneWidget::marked() { QSize StoneWidget::size() { - return QSize(sizex,sizey); + return TQSize(sizex,sizey); } int @@ -137,7 +137,7 @@ StoneWidget::colors() { QSize StoneWidget::sizeHint () const { - return QSize(field_width,field_height); + return TQSize(field_width,field_height); } void @@ -174,7 +174,7 @@ StoneWidget::undo(int count) { int ret_val=stonefield.undo(count); - QPoint p=mapFromGlobal(cursor().pos()); + TQPoint p=mapFromGlobal(cursor().pos()); int x=p.x(); int y=p.y(); if (x<0||y<0||x>=field_width||y>=field_height) { @@ -214,13 +214,13 @@ void StoneWidget::readProperties(KConfig *conf) { } newGame(conf->readNumEntry("Board"),conf->readNumEntry("Colors")); - QStrList list; + TQStrList list; conf->readListEntry("Stones",list); for (const char *item=list.first();item;item=list.next()) { int x=-1,y=-1; if (sscanf(item,"%02X%02X",&x,&y)!=2) break; - history.append(new QPoint(x,y)); + history.append(new TQPoint(x,y)); stonefield.remove(x,y); } } @@ -230,10 +230,10 @@ void StoneWidget::saveProperties(KConfig *conf) { Q_ASSERT(conf); - QStrList list(true); - QString tmp; + TQStrList list(true); + TQString tmp; - for (QPoint *item=history.first();item;item=history.next()) { + for (TQPoint *item=history.first();item;item=history.next()) { tmp.sprintf("%02X%02X",item->x(),item->y()); list.append(tmp.ascii()); } @@ -244,8 +244,8 @@ StoneWidget::saveProperties(KConfig *conf) { } void -StoneWidget::timerEvent( QTimerEvent * ) { - QPoint p=mapFromGlobal(cursor().pos()); +StoneWidget::timerEvent( TQTimerEvent * ) { + TQPoint p=mapFromGlobal(cursor().pos()); int x=p.x(); int y=p.y(); if (x<0||y<0||x>=field_width||y>=field_height) @@ -255,7 +255,7 @@ StoneWidget::timerEvent( QTimerEvent * ) { } void -StoneWidget::paintEvent( QPaintEvent *e ) { +StoneWidget::paintEvent( TQPaintEvent *e ) { Stone *stone=stonefield.getField(); @@ -268,7 +268,7 @@ StoneWidget::paintEvent( QPaintEvent *e ) { bool redraw=stone->marked||stone->changed; if (!redraw&&e) { - QRect r(cx,cy,stone_width,stone_height); + TQRect r(cx,cy,stone_width,stone_height); redraw=r.intersects(e->rect()); } if (redraw) { @@ -291,7 +291,7 @@ StoneWidget::paintEvent( QPaintEvent *e ) { } void -StoneWidget::mousePressEvent ( QMouseEvent *e) { +StoneWidget::mousePressEvent ( TQMouseEvent *e) { if (stonefield.isGameover()) return; @@ -303,7 +303,7 @@ StoneWidget::mousePressEvent ( QMouseEvent *e) { int sy=y/stone_height; if (stonefield.remove(sx, sy)) { - history.append(new QPoint(sx, sy)); + history.append(new TQPoint(sx, sy)); emit s_remove(sx, sy); @@ -317,7 +317,7 @@ StoneWidget::mousePressEvent ( QMouseEvent *e) { } void -StoneWidget::mouseMoveEvent ( QMouseEvent *e) +StoneWidget::mouseMoveEvent ( TQMouseEvent *e) { if (stonefield.isGameover()) { stonefield.unmark(); diff --git a/ksame/StoneWidget.h b/ksame/StoneWidget.h index 05276924..b6840055 100644 --- a/ksame/StoneWidget.h +++ b/ksame/StoneWidget.h @@ -22,12 +22,12 @@ #ifndef _STONEWIDGET #define _STONEWIDGET -#include <qwidget.h> +#include <tqwidget.h> #include "StoneField.h" struct StoneSlice; -class StoneWidget : public QWidget { +class StoneWidget : public TQWidget { Q_OBJECT int modified; @@ -37,7 +37,7 @@ class StoneWidget : public QWidget { int sizex, sizey; int field_width, field_height; - QPtrList<QPoint> history; + TQPtrList<TQPoint> history; StoneField stonefield; // picture number of stonemovie @@ -46,15 +46,15 @@ class StoneWidget : public QWidget { StoneSlice **map; public: - StoneWidget( QWidget *parent=0, int x=10,int y=10); + StoneWidget( TQWidget *parent=0, int x=10,int y=10); ~StoneWidget(); unsigned int board(); int score(); int marked(); - QSize size(); + TQSize size(); int colors(); - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; bool undoPossible() const; @@ -75,10 +75,10 @@ public: int count(int color); protected: - void timerEvent( QTimerEvent *e ); - void paintEvent( QPaintEvent *e ); - void mousePressEvent ( QMouseEvent *e); - void mouseMoveEvent ( QMouseEvent *e); + void timerEvent( TQTimerEvent *e ); + void paintEvent( TQPaintEvent *e ); + void mousePressEvent ( TQMouseEvent *e); + void mouseMoveEvent ( TQMouseEvent *e); // properties of the stone picture int stone_width,stone_height; // size of one stone diff --git a/ksame/main.cpp b/ksame/main.cpp index 08c1e076..30423f16 100644 --- a/ksame/main.cpp +++ b/ksame/main.cpp @@ -19,7 +19,7 @@ */ #include <stdio.h> -#include <qwidget.h> +#include <tqwidget.h> #include <kapplication.h> #include <klocale.h> @@ -39,7 +39,7 @@ int main( int argc, char **argv ) { aboutData.addAuthor("Marcus Kreutzberger", 0, "kreutzbe@informatik.mu-luebeck.de"); KCmdLineArgs::init(argc, argv, &aboutData); - KApplication::setColorSpec(QApplication::ManyColor+QApplication::CustomColor); + KApplication::setColorSpec(TQApplication::ManyColor+TQApplication::CustomColor); KApplication a; KGlobal::locale()->insertCatalogue("libkdegames"); diff --git a/kshisen/app.cpp b/kshisen/app.cpp index 27f8cbf2..ab6e3b85 100644 --- a/kshisen/app.cpp +++ b/kshisen/app.cpp @@ -52,9 +52,9 @@ #include <kstdguiitem.h> #include <kconfigdialog.h> -#include <qlayout.h> -#include <qtimer.h> -#include <qlineedit.h> +#include <tqlayout.h> +#include <tqtimer.h> +#include <tqlineedit.h> #include <cmath> @@ -62,7 +62,7 @@ #include "prefs.h" #include "settings.h" -App::App(QWidget *parent, const char *name) : KMainWindow(parent, name), +App::App(TQWidget *parent, const char *name) : KMainWindow(parent, name), cheat(false) { highscoreTable = new KHighscore(this); @@ -89,13 +89,13 @@ App::App(QWidget *parent, const char *name) : KMainWindow(parent, name), setupGUI(); - connect(board, SIGNAL(changed()), this, SLOT(enableItems())); + connect(board, TQT_SIGNAL(changed()), this, TQT_SLOT(enableItems())); - QTimer *t = new QTimer(this); + TQTimer *t = new TQTimer(this); t->start(1000); - connect(t, SIGNAL(timeout()), this, SLOT(updateScore())); - connect(board, SIGNAL(endOfGame()), this, SLOT(slotEndOfGame())); - connect(board, SIGNAL(resized()), this, SLOT(boardResized())); + connect(t, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateScore())); + connect(board, TQT_SIGNAL(endOfGame()), this, TQT_SLOT(slotEndOfGame())); + connect(board, TQT_SIGNAL(resized()), this, TQT_SLOT(boardResized())); kapp->processEvents(); @@ -106,25 +106,25 @@ App::App(QWidget *parent, const char *name) : KMainWindow(parent, name), void App::initKAction() { // Game - KStdGameAction::gameNew(this, SLOT(newGame()), actionCollection()); - KStdGameAction::restart(this, SLOT(restartGame()), actionCollection()); - KStdGameAction::pause(this, SLOT(pause()), actionCollection()); - KStdGameAction::highscores(this, SLOT(hallOfFame()), actionCollection()); - KStdGameAction::quit(this, SLOT(quitGame()), actionCollection()); + KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection()); + KStdGameAction::restart(this, TQT_SLOT(restartGame()), actionCollection()); + KStdGameAction::pause(this, TQT_SLOT(pause()), actionCollection()); + KStdGameAction::highscores(this, TQT_SLOT(hallOfFame()), actionCollection()); + KStdGameAction::quit(this, TQT_SLOT(quitGame()), actionCollection()); // Move - KStdGameAction::undo(this, SLOT(undo()), actionCollection()); - KStdGameAction::redo(this, SLOT(redo()), actionCollection()); - KStdGameAction::hint(this, SLOT(hint()), actionCollection()); + KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); + KStdGameAction::redo(this, TQT_SLOT(redo()), actionCollection()); + KStdGameAction::hint(this, TQT_SLOT(hint()), actionCollection()); //new KAction(i18n("Is Game Solvable?"), 0, this, - // SLOT(isSolvable()), actionCollection(), "move_solvable"); + // TQT_SLOT(isSolvable()), actionCollection(), "move_solvable"); #ifdef DEBUGGING - (void)new KAction(i18n("&Finish"), 0, board, SLOT(finish()), actionCollection(), "move_finish"); + (void)new KAction(i18n("&Finish"), 0, board, TQT_SLOT(finish()), actionCollection(), "move_finish"); #endif // Settings - KStdAction::preferences(this, SLOT(showSettings()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection()); } void App::hallOfFame() @@ -207,7 +207,7 @@ void App::loadSettings() // The user can work-around this situation by un-maximizing the window first. if(Prefs::unscaled()) { - QSize s = board->unscaledSize(); + TQSize s = board->unscaledSize(); // We would have liked to have used KMainWindow::sizeForCentralWidgetSize(), // but this function does not seem to work when the toolbar is docked on the @@ -298,10 +298,10 @@ void App::slotEndOfGame() } else { - QString s = i18n("Congratulations! You made it in %1:%2:%3") - .arg(QString().sprintf("%02d", board->getTimeForGame()/3600)) - .arg(QString().sprintf("%02d", (board->getTimeForGame() / 60) % 60)) - .arg(QString().sprintf("%02d", board->getTimeForGame() % 60)); + TQString s = i18n("Congratulations! You made it in %1:%2:%3") + .arg(TQString().sprintf("%02d", board->getTimeForGame()/3600)) + .arg(TQString().sprintf("%02d", (board->getTimeForGame() / 60) % 60)) + .arg(TQString().sprintf("%02d", board->getTimeForGame() % 60)); KMessageBox::information(this, s, i18n("End of Game")); } @@ -314,19 +314,19 @@ void App::slotEndOfGame() void App::updateScore() { int t = board->getTimeForGame(); - QString s = i18n(" Your time: %1:%2:%3 %4") - .arg(QString().sprintf("%02d", t / 3600 )) - .arg(QString().sprintf("%02d", (t / 60) % 60 )) - .arg(QString().sprintf("%02d", t % 60 )) - .arg(board->isPaused()?i18n("(Paused) "):QString::null); + TQString s = i18n(" Your time: %1:%2:%3 %4") + .arg(TQString().sprintf("%02d", t / 3600 )) + .arg(TQString().sprintf("%02d", (t / 60) % 60 )) + .arg(TQString().sprintf("%02d", t % 60 )) + .arg(board->isPaused()?i18n("(Paused) "):TQString::null); statusBar()->changeItem(s, SBI_TIME); // Number of tiles int tl = (board->x_tiles() * board->y_tiles()); s = i18n(" Removed: %1/%2 ") - .arg(QString().sprintf("%d", tl - board->tilesLeft())) - .arg(QString().sprintf("%d", tl )); + .arg(TQString().sprintf("%d", tl - board->tilesLeft())) + .arg(TQString().sprintf("%d", tl )); statusBar()->changeItem(s, SBI_TILES); } @@ -351,33 +351,33 @@ void App::resetCheatMode() } } -QString App::getPlayerName() +TQString App::getPlayerName() { - QDialog *dlg = new QDialog(this, "Hall of Fame", true); + TQDialog *dlg = new TQDialog(this, "Hall of Fame", true); - QLabel *l1 = new QLabel(i18n("You've made it into the \"Hall Of Fame\". Type in\nyour name so mankind will always remember\nyour cool rating."), dlg); + TQLabel *l1 = new TQLabel(i18n("You've made it into the \"Hall Of Fame\". Type in\nyour name so mankind will always remember\nyour cool rating."), dlg); l1->setFixedSize(l1->sizeHint()); - QLabel *l2 = new QLabel(i18n("Your name:"), dlg); + TQLabel *l2 = new TQLabel(i18n("Your name:"), dlg); l2->setFixedSize(l2->sizeHint()); - QLineEdit *e = new QLineEdit(dlg); + TQLineEdit *e = new TQLineEdit(dlg); e->setText("XXXXXXXXXXXXXXXX"); e->setMinimumWidth(e->sizeHint().width()); e->setFixedHeight(e->sizeHint().height()); e->setText( lastPlayerName ); e->setFocus(); - QPushButton *b = new KPushButton(KStdGuiItem::ok(), dlg); + TQPushButton *b = new KPushButton(KStdGuiItem::ok(), dlg); b->setDefault(true); b->setFixedSize(b->sizeHint()); - connect(b, SIGNAL(released()), dlg, SLOT(accept())); - connect(e, SIGNAL(returnPressed()), dlg, SLOT(accept())); + connect(b, TQT_SIGNAL(released()), dlg, TQT_SLOT(accept())); + connect(e, TQT_SIGNAL(returnPressed()), dlg, TQT_SLOT(accept())); // create layout - QVBoxLayout *tl = new QVBoxLayout(dlg, 10); - QHBoxLayout *tl1 = new QHBoxLayout(); + TQVBoxLayout *tl = new TQVBoxLayout(dlg, 10); + TQHBoxLayout *tl1 = new TQHBoxLayout(); tl->addWidget(l1); tl->addSpacing(5); tl->addLayout(tl1); @@ -469,7 +469,7 @@ int App::insertHighscore(const HighScore &hs) void App::readHighscore() { - QStringList hi_x, hi_y, hi_sec, hi_date, hi_grav, hi_name; + TQStringList hi_x, hi_y, hi_sec, hi_date, hi_grav, hi_name; hi_x = highscoreTable->readList("x", HIGHSCORE_MAX); hi_y = highscoreTable->readList("y", HIGHSCORE_MAX); hi_sec = highscoreTable->readList("seconds", HIGHSCORE_MAX); @@ -501,7 +501,7 @@ void App::readOldHighscore() { // this is for before-KHighscore-highscores int i; - QString s, e, grp; + TQString s, e, grp; KConfig *conf = kapp->config(); highscore.resize(0); @@ -519,7 +519,7 @@ void App::readOldHighscore() HighScore hs; - QStringList e = conf->readListEntry(s, ' '); + TQStringList e = conf->readListEntry(s, ' '); int nelem = e.count(); hs.x = (*e.at(0)).toInt(); hs.y = (*e.at(1)).toInt(); @@ -570,15 +570,15 @@ void App::readOldHighscore() void App::writeHighscore() { int i; - QStringList hi_x, hi_y, hi_sec, hi_date, hi_grav, hi_name; + TQStringList hi_x, hi_y, hi_sec, hi_date, hi_grav, hi_name; for(i = 0; i < (int)highscore.size(); i++) { HighScore hs = highscore[i]; - hi_x.append(QString::number(hs.x)); - hi_y.append(QString::number(hs.y)); - hi_sec.append(QString::number(hs.seconds)); - hi_date.append(QString::number(hs.date)); - hi_grav.append(QString::number(hs.gravity)); + hi_x.append(TQString::number(hs.x)); + hi_y.append(TQString::number(hs.y)); + hi_sec.append(TQString::number(hs.seconds)); + hi_date.append(TQString::number(hs.date)); + hi_grav.append(TQString::number(hs.gravity)); hi_name.append(hs.name); } highscoreTable->writeList("x", hi_x); @@ -593,13 +593,13 @@ void App::writeHighscore() void App::showHighscore(int focusitem) { // this may look a little bit confusing... - QDialog *dlg = new QDialog(0, "hall_Of_fame", true); + TQDialog *dlg = new TQDialog(0, "hall_Of_fame", true); dlg->setCaption(i18n("Hall of Fame")); - QVBoxLayout *tl = new QVBoxLayout(dlg, 10); + TQVBoxLayout *tl = new TQVBoxLayout(dlg, 10); - QLabel *l = new QLabel(i18n("Hall of Fame"), dlg); - QFont f = font(); + TQLabel *l = new TQLabel(i18n("Hall of Fame"), dlg); + TQFont f = font(); f.setPointSize(24); f.setBold(true); l->setFont(f); @@ -609,7 +609,7 @@ void App::showHighscore(int focusitem) tl->addWidget(l); // insert highscores in a gridlayout - QGridLayout *table = new QGridLayout(12, 5, 5); + TQGridLayout *table = new TQGridLayout(12, 5, 5); tl->addLayout(table, 1); // add a separator line @@ -619,29 +619,29 @@ void App::showHighscore(int focusitem) // add titles f = font(); f.setBold(true); - l = new QLabel(i18n("Rank"), dlg); + l = new TQLabel(i18n("Rank"), dlg); l->setFont(f); l->setMinimumSize(l->sizeHint()); table->addWidget(l, 0, 0); - l = new QLabel(i18n("Name"), dlg); + l = new TQLabel(i18n("Name"), dlg); l->setFont(f); l->setMinimumSize(l->sizeHint()); table->addWidget(l, 0, 1); - l = new QLabel(i18n("Time"), dlg); + l = new TQLabel(i18n("Time"), dlg); l->setFont(f); l->setMinimumSize(l->sizeHint()); table->addWidget(l, 0, 2); - l = new QLabel(i18n("Size"), dlg); + l = new TQLabel(i18n("Size"), dlg); l->setFont(f); l->setMinimumSize(l->sizeHint()); table->addWidget(l, 0, 3); - l = new QLabel(i18n("Score"), dlg); + l = new TQLabel(i18n("Score"), dlg); l->setFont(f); l->setMinimumSize(l->sizeHint().width()*3, l->sizeHint().height()); table->addWidget(l, 0, 4); - QString s; - QLabel *e[10][5]; + TQString s; + TQLabel *e[10][5]; unsigned i, j; for(i = 0; i < 10; i++) @@ -652,25 +652,25 @@ void App::showHighscore(int focusitem) // insert rank s.sprintf("%d", i+1); - e[i][0] = new QLabel(s, dlg); + e[i][0] = new TQLabel(s, dlg); // insert name if(i < highscore.size()) - e[i][1] = new QLabel(hs.name, dlg); + e[i][1] = new TQLabel(hs.name, dlg); else - e[i][1] = new QLabel("", dlg); + e[i][1] = new TQLabel("", dlg); // insert time - QTime ti(0,0,0); + TQTime ti(0,0,0); if(i < highscore.size()) { ti = ti.addSecs(hs.seconds); s.sprintf("%02d:%02d:%02d", ti.hour(), ti.minute(), ti.second()); - e[i][2] = new QLabel(s, dlg); + e[i][2] = new TQLabel(s, dlg); } else { - e[i][2] = new QLabel("", dlg); + e[i][2] = new TQLabel("", dlg); } // insert size @@ -679,21 +679,21 @@ void App::showHighscore(int focusitem) else s = ""; - e[i][3] = new QLabel(s, dlg); + e[i][3] = new TQLabel(s, dlg); // insert score if(i < highscore.size()) { - s = QString("%1 %2") + s = TQString("%1 %2") .arg(getScore(hs)) - .arg(hs.gravity ? i18n("(gravity)") : QString("")); + .arg(hs.gravity ? i18n("(gravity)") : TQString("")); } else { s = ""; } - e[i][4] = new QLabel(s, dlg); + e[i][4] = new TQLabel(s, dlg); e[i][4]->setAlignment(AlignRight); } @@ -718,12 +718,12 @@ void App::showHighscore(int focusitem) } } - QPushButton *b = new KPushButton(KStdGuiItem::close(), dlg); + TQPushButton *b = new KPushButton(KStdGuiItem::close(), dlg); b->setFixedSize(b->sizeHint()); // connect the "Close"-button to done - connect(b, SIGNAL(clicked()), dlg, SLOT(accept())); + connect(b, TQT_SIGNAL(clicked()), dlg, TQT_SLOT(accept())); b->setDefault(true); b->setFocus(); @@ -752,8 +752,8 @@ void App::showSettings(){ KConfigDialog *dialog = new KConfigDialog(this, "settings", Prefs::self(), KDialogBase::Swallow); Settings *general = new Settings(0, "General"); dialog->addPage(general, i18n("General"), "package_settings"); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(loadSettings())); - connect(dialog, SIGNAL(settingsChanged()), board, SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), board, TQT_SLOT(loadSettings())); dialog->show(); } diff --git a/kshisen/app.h b/kshisen/app.h index 47808f9e..7e670138 100644 --- a/kshisen/app.h +++ b/kshisen/app.h @@ -50,7 +50,7 @@ class KHighscore; struct HighScore { - QString name; + TQString name; int seconds; int x, y; time_t date; @@ -64,7 +64,7 @@ class App : public KMainWindow Q_OBJECT public: - App(QWidget *parent = 0, const char *name=0); + App(TQWidget *parent = 0, const char *name=0); private slots: void loadSettings(); @@ -88,7 +88,7 @@ private slots: private: void lockMenus(bool); - QString getPlayerName(); + TQString getPlayerName(); /** * Read the old (pre- @ref KHighscore) highscore table. @@ -109,9 +109,9 @@ private: void resetCheatMode(); private: - QString lastPlayerName; + TQString lastPlayerName; Board *board; - QValueVector<HighScore> highscore; + TQValueVector<HighScore> highscore; KHighscore* highscoreTable; bool cheat; diff --git a/kshisen/board.cpp b/kshisen/board.cpp index ab61a912..ee0d70a7 100644 --- a/kshisen/board.cpp +++ b/kshisen/board.cpp @@ -42,9 +42,9 @@ #include <kglobalsettings.h> #include <kdebug.h> -#include <qpainter.h> -#include <qpaintdevicemetrics.h> -#include <qtimer.h> +#include <tqpainter.h> +#include <tqpaintdevicemetrics.h> +#include <tqtimer.h> #include "board.h" #include "prefs.h" @@ -57,8 +57,8 @@ static int size_x[5] = {14, 18, 24, 26, 30}; static int size_y[5] = { 6, 8, 12, 14, 16}; static int DELAY[5] = {1000, 750, 500, 250, 125}; -Board::Board(QWidget *parent, const char *name) : - QWidget(parent, name, WResizeNoErase), field(0), +Board::Board(TQWidget *parent, const char *name) : + TQWidget(parent, name, WResizeNoErase), field(0), _x_tiles(0), _y_tiles(0), _delay(125), paused(false), gravity_flag(true), _solvable_flag(true), @@ -74,7 +74,7 @@ Board::Board(QWidget *parent, const char *name) : _redo.setAutoDelete(true); _undo.setAutoDelete(true); - QPixmap bg(KGlobal::dirs()->findResource("appdata", "kshisen_bgnd.png")); + TQPixmap bg(KGlobal::dirs()->findResource("appdata", "kshisen_bgnd.png")); setBackgroundPixmap(bg); loadSettings(); @@ -165,7 +165,7 @@ void Board::gravity(int col, bool update) } } -void Board::mousePressEvent(QMouseEvent *e) +void Board::mousePressEvent(TQMouseEvent *e) { // Calculate field position int pos_x = (e->pos().x() - xOffset()) / tiles.tileWidth(); @@ -273,7 +273,7 @@ void Board::setSize(int x, int y) emit changed(); } -void Board::resizeEvent(QResizeEvent*) +void Board::resizeEvent(TQResizeEvent*) { resizeBoard(); emit resized(); @@ -292,11 +292,11 @@ void Board::resizeBoard() tiles.resizeTiles(w, h); } -QSize Board::unscaledSize() const +TQSize Board::unscaledSize() const { int w = tiles.unscaledTileWidth() * x_tiles() + tiles.unscaledTileWidth(); int h = tiles.unscaledTileHeight() * y_tiles() + tiles.unscaledTileWidth(); - return QSize(w, h); + return TQSize(w, h); } void Board::newGame() @@ -439,7 +439,7 @@ bool Board::isTileHighlighted(int x, int y) const void Board::updateField(int x, int y, bool erase) { - QRect r(xOffset() + x * tiles.tileWidth(), + TQRect r(xOffset() + x * tiles.tileWidth(), yOffset() + y * tiles.tileHeight(), tiles.tileWidth(), tiles.tileHeight()); @@ -447,13 +447,13 @@ void Board::updateField(int x, int y, bool erase) repaint(r, erase); } -void Board::paintEvent(QPaintEvent *e) +void Board::paintEvent(TQPaintEvent *e) { - QRect ur = e->rect(); // rectangle to update - QPixmap pm(ur.size()); // Pixmap for double-buffering + TQRect ur = e->rect(); // rectangle to update + TQPixmap pm(ur.size()); // Pixmap for double-buffering pm.fill(this, ur.topLeft()); // fill with widget background - QPainter p(&pm); + TQPainter p(&pm); p.translate(-ur.x(), -ur.y()); // use widget coordinate system if(paused) @@ -475,7 +475,7 @@ void Board::paintEvent(QPaintEvent *e) int xpos = xOffset() + i * w; int ypos = yOffset() + j * h; - QRect r(xpos, ypos, w, h); + TQRect r(xpos, ypos, w, h); if(e->rect().intersects(r)) { if(isTileHighlighted(i, j)) @@ -664,9 +664,9 @@ void Board::drawConnection(int timeout) updateField(connection.front().x, connection.front().y); updateField(connection.back().x, connection.back().y); - QPainter p; + TQPainter p; p.begin(this); - p.setPen(QPen(QColor("red"), tiles.lineWidth())); + p.setPen(TQPen(TQColor("red"), tiles.lineWidth())); // Path.size() will always be >= 2 Path::const_iterator pathEnd = connection.end(); @@ -683,7 +683,7 @@ void Board::drawConnection(int timeout) p.flush(); p.end(); - QTimer::singleShot(timeout, this, SLOT(undrawConnection())); + TQTimer::singleShot(timeout, this, TQT_SLOT(undrawConnection())); } void Board::undrawConnection() @@ -735,9 +735,9 @@ void Board::undrawConnection() } } -QPoint Board::midCoord(int x, int y) const +TQPoint Board::midCoord(int x, int y) const { - QPoint p; + TQPoint p; int w = tiles.tileWidth(); int h = tiles.tileHeight(); @@ -893,14 +893,14 @@ void Board::dumpBoard() const kdDebug() << "Board contents:" << endl; for(int y = 0; y < y_tiles(); ++y) { - QString row; + TQString row; for(int x = 0; x < x_tiles(); ++x) { int tile = getField(x, y); if(tile == EMPTY) row += " --"; else - row += QString("%1").arg(getField(x, y), 3); + row += TQString("%1").arg(getField(x, y), 3); } kdDebug() << row << endl; } @@ -1071,12 +1071,12 @@ bool Board::pause() return paused; } -QSize Board::sizeHint() const +TQSize Board::sizeHint() const { - int dpi = QPaintDeviceMetrics(this).logicalDpiX(); + int dpi = TQPaintDeviceMetrics(this).logicalDpiX(); if (dpi < 75) dpi = 75; - return QSize(9*dpi,7*dpi); + return TQSize(9*dpi,7*dpi); } #include "board.moc" diff --git a/kshisen/board.h b/kshisen/board.h index c38fba57..2413d8d4 100644 --- a/kshisen/board.h +++ b/kshisen/board.h @@ -72,12 +72,12 @@ class Board : public QWidget Q_OBJECT public: - Board(QWidget *parent = 0, const char *name=0); + Board(TQWidget *parent = 0, const char *name=0); ~Board(); - virtual void paintEvent(QPaintEvent *); - virtual void mousePressEvent(QMouseEvent *); - virtual void resizeEvent(QResizeEvent*); + virtual void paintEvent(TQPaintEvent *); + virtual void mousePressEvent(TQMouseEvent *); + virtual void resizeEvent(TQResizeEvent*); void setDelay(int); int getDelay() const; @@ -89,7 +89,7 @@ public: void setSize(int x, int y); void resizeBoard(); - QSize unscaledSize() const; + TQSize unscaledSize() const; void newGame(); void setShuffle(int); int getShuffle() const; @@ -134,7 +134,7 @@ private slots: void gravity(int, bool); protected: - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; private: // functions void initBoard(); @@ -151,7 +151,7 @@ private: // functions bool findSimplePath(int x1, int y1, int x2, int y2, Path& p) const; bool isTileHighlighted(int x, int y) const; void drawConnection(int timeout); - QPoint midCoord(int x, int y) const; + TQPoint midCoord(int x, int y) const; void marked(int x, int y); void madeMove(int x1, int y1, int x2, int y2); @@ -163,8 +163,8 @@ private: KRandomSequence random; - QPtrList<Move> _undo; - QPtrList<Move> _redo; + TQPtrList<Move> _undo; + TQPtrList<Move> _redo; int undraw_timer_id; int mark_x; diff --git a/kshisen/tileset.cpp b/kshisen/tileset.cpp index f44e2698..492cde79 100644 --- a/kshisen/tileset.cpp +++ b/kshisen/tileset.cpp @@ -27,7 +27,7 @@ #include <kmessagebox.h> #include <kdebug.h> -#include <qimage.h> +#include <tqimage.h> #include <algorithm> @@ -36,7 +36,7 @@ TileSet::TileSet() : scaledTiles(nTiles) { //loadTiles - QImage tileset(KGlobal::dirs()->findResource("appdata", "tileset.png")); + TQImage tileset(KGlobal::dirs()->findResource("appdata", "tileset.png")); if(tileset.isNull()) { KMessageBox::sorry(0, i18n("Cannot load tiles pixmap!")); @@ -76,7 +76,7 @@ void TileSet::resizeTiles(int maxWidth, int maxHeight) //kdDebug() << "tile size: " << maxWidth << "x" << maxHeight << endl; - QImage img; + TQImage img; for(int i = 0; i < nTiles; i++) { if(maxHeight == unscaledTileHeight()) @@ -88,17 +88,17 @@ void TileSet::resizeTiles(int maxWidth, int maxHeight) } } -const QPixmap &TileSet::tile(int n) const +const TQPixmap &TileSet::tile(int n) const { return scaledTiles[n]; } -QPixmap TileSet::highlightedTile(int n) const +TQPixmap TileSet::highlightedTile(int n) const { const double LIGHTEN_FACTOR = 1.3; // lighten the image - QImage img = scaledTiles[n].convertToImage().convertDepth(32); + TQImage img = scaledTiles[n].convertToImage().convertDepth(32); for(int y = 0; y < img.height(); y++) { @@ -110,7 +110,7 @@ QPixmap TileSet::highlightedTile(int n) const } } - QPixmap highlightedTile; + TQPixmap highlightedTile; highlightedTile.convertFromImage(img); return highlightedTile; diff --git a/kshisen/tileset.h b/kshisen/tileset.h index 02905201..ee371327 100644 --- a/kshisen/tileset.h +++ b/kshisen/tileset.h @@ -24,7 +24,7 @@ #ifndef __IMAGEDATA__H__ #define __IMAGEDATA__H__ -#include <qvaluevector.h> +#include <tqvaluevector.h> class TileSet { @@ -38,8 +38,8 @@ public: void resizeTiles(int maxWidth, int maxHeight); - const QPixmap &tile(int n) const; - QPixmap highlightedTile(int n) const; + const TQPixmap &tile(int n) const; + TQPixmap highlightedTile(int n) const; int lineWidth() const; @@ -50,8 +50,8 @@ public: private: - QValueVector<QPixmap> scaledTiles; - QValueVector<QImage> unscaledTiles; + TQValueVector<TQPixmap> scaledTiles; + TQValueVector<TQImage> unscaledTiles; }; diff --git a/ksirtet/ksirtet/board.cpp b/ksirtet/ksirtet/board.cpp index 4c084f63..f50aa1a4 100644 --- a/ksirtet/ksirtet/board.cpp +++ b/ksirtet/ksirtet/board.cpp @@ -8,7 +8,7 @@ using namespace KGrid2D; -KSBoard::KSBoard(bool graphic, QWidget *parent) +KSBoard::KSBoard(bool graphic, TQWidget *parent) : Board(graphic, new GiftPool(parent), parent), filled(matrix().height()), linesRemoved(4) { diff --git a/ksirtet/ksirtet/board.h b/ksirtet/ksirtet/board.h index 90b1c231..45ec0f26 100644 --- a/ksirtet/ksirtet/board.h +++ b/ksirtet/ksirtet/board.h @@ -8,7 +8,7 @@ class KSBoard : public Board { Q_OBJECT public: - KSBoard(bool graphic, QWidget *parent); + KSBoard(bool graphic, TQWidget *parent); void copy(const GenericTetris &); void start(const GTInitData &); @@ -17,8 +17,8 @@ class KSBoard : public Board uint lastRemoved() const { return _lastRemoved; } private: - QMemArray<uint> filled; - QMemArray<uint> linesRemoved; + TQMemArray<uint> filled; + TQMemArray<uint> linesRemoved; uint addRemoved; uint _lastRemoved; diff --git a/ksirtet/ksirtet/check_score.cpp b/ksirtet/ksirtet/check_score.cpp index 71cd53be..e748c286 100644 --- a/ksirtet/ksirtet/check_score.cpp +++ b/ksirtet/ksirtet/check_score.cpp @@ -12,7 +12,7 @@ int main(int argc, char **argv) KCmdLineArgs::addCmdLineOptions(options); KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); if ( args->count()==0 ) KCmdLineArgs::usage(); - QString s = args->arg(0); + TQString s = args->arg(0); bool ok; uint nb = s.toUInt(&ok); if ( !ok ) qFatal("The argument is not an unsigned integer."); diff --git a/ksirtet/ksirtet/field.cpp b/ksirtet/ksirtet/field.cpp index e3384a9e..46f5c4de 100644 --- a/ksirtet/ksirtet/field.cpp +++ b/ksirtet/ksirtet/field.cpp @@ -1,7 +1,7 @@ #include "field.h" #include "field.moc" -#include <qwhatsthis.h> +#include <tqwhatsthis.h> #include <klocale.h> #include <kgamelcd.h> @@ -11,11 +11,11 @@ #include "piece.h" //----------------------------------------------------------------------------- -KSField::KSField(QWidget *parent) +KSField::KSField(TQWidget *parent) : Field(parent) { const Board *b = static_cast<Board *>(board); - QWhatsThis::add(b->giftPool(), i18n("Indicate the number of garbage lines you received from your opponent.")); + TQWhatsThis::add(b->giftPool(), i18n("Indicate the number of garbage lines you received from your opponent.")); } void KSField::removedUpdated() @@ -41,9 +41,9 @@ void KSField::settingsChanged() static_cast<KSPieceInfo &>(Piece::info()).setOldRotationStyle(b); removedList->clear(); - QWhatsThis::remove(removedList); + TQWhatsThis::remove(removedList); KGameLCD *lcd = new KGameLCD(5, removedList); - QString s = (Prefs::showDetailedRemoved() ? i18n("Total:") : QString::null); + TQString s = (Prefs::showDetailedRemoved() ? i18n("Total:") : TQString::null); removedList->append(s, lcd); lcd->displayInt( board->nbRemoved() ); lcd->show(); @@ -51,7 +51,7 @@ void KSField::settingsChanged() if ( Prefs::showDetailedRemoved() ) { for (uint i=0; i<4; i++) { KGameLCD *lcd = new KGameLCD(5, removedList); - QString s = i18n("1 Line:", "%n Lines:", i+1); + TQString s = i18n("1 Line:", "%n Lines:", i+1); removedList->append(s, lcd); uint nb = static_cast<const KSBoard *>(board)->nbRemovedLines(i); lcd->displayInt(nb); diff --git a/ksirtet/ksirtet/field.h b/ksirtet/ksirtet/field.h index 4af498e9..26378b28 100644 --- a/ksirtet/ksirtet/field.h +++ b/ksirtet/ksirtet/field.h @@ -9,7 +9,7 @@ class KSField : public Field { Q_OBJECT public: - KSField(QWidget *parent); + KSField(TQWidget *parent); private slots: virtual void removedUpdated(); diff --git a/ksirtet/ksirtet/main.cpp b/ksirtet/ksirtet/main.cpp index a186038e..4c66c22f 100644 --- a/ksirtet/ksirtet/main.cpp +++ b/ksirtet/ksirtet/main.cpp @@ -64,7 +64,7 @@ KSFactory::KSFactory() : CommonFactory(MAIN_DATA, BASE_BOARD_INFO, COMMON_BOARD_INFO) {} -BaseInterface *KSFactory::createInterface(QWidget *parent) +BaseInterface *KSFactory::createInterface(TQWidget *parent) { return new Interface(MP_GAME_INFO, parent); } diff --git a/ksirtet/ksirtet/main.h b/ksirtet/ksirtet/main.h index 67fe3619..05af263d 100644 --- a/ksirtet/ksirtet/main.h +++ b/ksirtet/ksirtet/main.h @@ -16,13 +16,13 @@ class KSFactory : public CommonFactory KSFactory(); protected: - virtual BaseBoard *createBoard(bool graphic, QWidget *parent) + virtual BaseBoard *createBoard(bool graphic, TQWidget *parent) { return new KSBoard(graphic, parent); } - virtual BaseField *createField(QWidget *parent) + virtual BaseField *createField(TQWidget *parent) { return new KSField(parent); } - virtual BaseInterface *createInterface(QWidget *parent); + virtual BaseInterface *createInterface(TQWidget *parent); virtual AI *createAI() { return new KSAI; } - virtual QWidget *createGameConfig() { return new KSGameConfig; } + virtual TQWidget *createGameConfig() { return new KSGameConfig; } }; //----------------------------------------------------------------------------- diff --git a/ksirtet/ksirtet/piece.cpp b/ksirtet/ksirtet/piece.cpp index 67ba2635..a77812bf 100644 --- a/ksirtet/ksirtet/piece.cpp +++ b/ksirtet/ksirtet/piece.cpp @@ -1,6 +1,6 @@ #include "piece.h" -#include <qpainter.h> +#include <tqpainter.h> #include <klocale.h> @@ -54,21 +54,21 @@ const char *KSPieceInfo::DEFAULT_COLORS[NB_FORMS+1] = { "#C8C8C8" }; -QColor KSPieceInfo::defaultColor(uint i) const +TQColor KSPieceInfo::defaultColor(uint i) const { - if ( i>=nbColors() ) return QColor(); - return QColor(DEFAULT_COLORS[i]); + if ( i>=nbColors() ) return TQColor(); + return TQColor(DEFAULT_COLORS[i]); } -void KSPieceInfo::draw(QPixmap *pixmap, uint blockType, uint, +void KSPieceInfo::draw(TQPixmap *pixmap, uint blockType, uint, bool lighted) const { - QColor col = color(blockType); + TQColor col = color(blockType); if (lighted) col = col.light(); pixmap->fill(col); - QPainter p(pixmap); - QRect r = pixmap->rect(); + TQPainter p(pixmap); + TQRect r = pixmap->rect(); p.setPen( col.light() ); p.moveTo(r.bottomLeft()); @@ -76,7 +76,7 @@ void KSPieceInfo::draw(QPixmap *pixmap, uint blockType, uint, p.lineTo(r.topRight()); p.setPen( col.dark() ); - p.moveTo(r.topRight() + QPoint(0,1)); + p.moveTo(r.topRight() + TQPoint(0,1)); p.lineTo(r.bottomRight()); - p.lineTo(r.bottomLeft() + QPoint(1,0)); + p.lineTo(r.bottomLeft() + TQPoint(1,0)); } diff --git a/ksirtet/ksirtet/piece.h b/ksirtet/ksirtet/piece.h index 25d866c4..3d772e29 100644 --- a/ksirtet/ksirtet/piece.h +++ b/ksirtet/ksirtet/piece.h @@ -31,11 +31,11 @@ class KSPieceInfo : public GPieceInfo virtual uint nbBlockModes() const { return 1; } virtual uint nbColors() const { return NB_FORMS + 1; } - virtual QString colorLabel(uint i) const { return i18n(COLOR_LABELS[i]); } - virtual QColor defaultColor(uint i) const; + virtual TQString colorLabel(uint i) const { return i18n(COLOR_LABELS[i]); } + virtual TQColor defaultColor(uint i) const; private: - virtual void draw(QPixmap *, uint blockType, uint blockMode, + virtual void draw(TQPixmap *, uint blockType, uint blockMode, bool lighted) const; private: diff --git a/ksirtet/ksirtet/settings.cpp b/ksirtet/ksirtet/settings.cpp index 96669e78..b35891b8 100644 --- a/ksirtet/ksirtet/settings.cpp +++ b/ksirtet/ksirtet/settings.cpp @@ -1,8 +1,8 @@ #include "settings.h" #include "settings.moc" -#include <qlayout.h> -#include <qcheckbox.h> +#include <tqlayout.h> +#include <tqcheckbox.h> #include <klocale.h> @@ -12,6 +12,6 @@ KSGameConfig::KSGameConfig() int row = _grid->numRows(); int col = _grid->numCols(); - QCheckBox *cb = new QCheckBox(i18n("Old rotation style"), this, "kcfg_OldRotationStyle"); + TQCheckBox *cb = new TQCheckBox(i18n("Old rotation style"), this, "kcfg_OldRotationStyle"); _grid->addMultiCellWidget(cb, row, row, 0, col-1); } diff --git a/ksmiletris/gamewidget.cpp b/ksmiletris/gamewidget.cpp index 7bead2f7..f10f9b36 100644 --- a/ksmiletris/gamewidget.cpp +++ b/ksmiletris/gamewidget.cpp @@ -26,10 +26,10 @@ this software. #include <kaudioplayer.h> #include <kapplication.h> #include <kstandarddirs.h> -#include <qbitmap.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qtimer.h> +#include <tqbitmap.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqtimer.h> #ifdef HAVE_USLEEP #include <unistd.h> #endif @@ -43,8 +43,8 @@ this software. #include <kmessagebox.h> #include <klocale.h> -GameWidget::GameWidget(QWidget *parent, const char *name) - : QWidget(parent, name) +GameWidget::GameWidget(TQWidget *parent, const char *name) + : TQWidget(parent, name) { in_game = false; in_pause = false; @@ -69,8 +69,8 @@ GameWidget::GameWidget(QWidget *parent, const char *name) next->move(278, 10); next->setNextPieceSprites(next_piece); - timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(timeout())); + timer = new TQTimer(this); + connect(timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeout())); } GameWidget::~GameWidget() @@ -85,7 +85,7 @@ void GameWidget::playSound(Sound s) if (!do_sounds) return; - QString name; + TQString name; switch (s) { case Sound_Break: name = "break.wav"; @@ -95,12 +95,12 @@ void GameWidget::playSound(Sound s) break; } - KAudioPlayer::play(locate("data", QString("ksmiletris/sounds/") + name)); + KAudioPlayer::play(locate("data", TQString("ksmiletris/sounds/") + name)); } void GameWidget::setPieces(PiecesType type) { - QString prefix; + TQString prefix; switch (type) { case Pieces_Smiles: @@ -117,13 +117,13 @@ void GameWidget::setPieces(PiecesType type) } for (int i = 0; i < num_blocks; ++i) { - QString n; + TQString n; n.setNum(i + 1); loadSprite((Sprite)(Sprite_Block1 + i), prefix + n + ".bmp"); } - QPixmap pm(32, 32); + TQPixmap pm(32, 32); for (int i = 0; i < num_blocks; ++i) { - QPainter p; + TQPainter p; p.begin(&pm); p.drawPixmap(0, 0, sprites[Sprite_Block1 + i]); p.drawPixmap(0, 0, sprites[Sprite_Broken]); @@ -156,18 +156,18 @@ void GameWidget::loadSprites() loadMaskedSprite(Sprite_Broken, "broken.bmp", "broken-mask.bmp"); } -void GameWidget::loadSprite(Sprite spr, const QString & path) +void GameWidget::loadSprite(Sprite spr, const TQString & path) { - if (!sprites[spr].load(locate("appdata", QString("data/") + path))) + if (!sprites[spr].load(locate("appdata", TQString("data/") + path))) qFatal("Cannot open data files.\nHave you correctly installed KSmiletris?"); } -void GameWidget::loadMaskedSprite(Sprite spr, const QString & path1, const QString & path2) +void GameWidget::loadMaskedSprite(Sprite spr, const TQString & path1, const TQString & path2) { - QBitmap bmp; - if (!sprites[spr].load(locate("appdata", QString("data/") + path1))) + TQBitmap bmp; + if (!sprites[spr].load(locate("appdata", TQString("data/") + path1))) qFatal("Cannot open data files.\nHave you correctly installed KSmiletris?"); - if (!bmp.load(locate("appdata", QString("data/") + path2))) + if (!bmp.load(locate("appdata", TQString("data/") + path2))) qFatal("Cannot open data files.\nHave you correctly installed KSmiletris?"); sprites[spr].setMask(bmp); } diff --git a/ksmiletris/gamewidget.h b/ksmiletris/gamewidget.h index 49901650..ca826395 100644 --- a/ksmiletris/gamewidget.h +++ b/ksmiletris/gamewidget.h @@ -24,7 +24,7 @@ this software. #ifndef GAMEWIDGET_H #define GAMEWIDGET_H -#include <qwidget.h> +#include <tqwidget.h> #include <krandomsequence.h> #include "ksmiletris.h" @@ -34,7 +34,7 @@ class MirrorWidget; class NextPieceWidget; class QTimer; -class GameWidget : public QWidget { +class GameWidget : public TQWidget { Q_OBJECT signals: @@ -47,7 +47,7 @@ public: int num_level; int num_points; - GameWidget(QWidget *parent=0, const char *name=0); + GameWidget(TQWidget *parent=0, const char *name=0); ~GameWidget(); void setPieces(PiecesType type); @@ -65,7 +65,7 @@ public: void repaintChilds(); private: - QPixmap *sprites; + TQPixmap *sprites; ScreenWidget *screen; MirrorWidget *mirror; NextPieceWidget *next; @@ -77,15 +77,15 @@ private: Sprite bg_sprite; int timer_interval; bool fast_mode; - QTimer *timer; + TQTimer *timer; KRandomSequence random; int num_pieces_level; void playSound(Sound s); void loadSprites(); - void loadSprite(Sprite spr, const QString & path); - void loadMaskedSprite(Sprite spr, const QString & path1, const QString & path2); + void loadSprite(Sprite spr, const TQString & path); + void loadMaskedSprite(Sprite spr, const TQString & path1, const TQString & path2); void newBlock(); void putPiece(); void getPiece(); diff --git a/ksmiletris/gamewindow.cpp b/ksmiletris/gamewindow.cpp index 60973530..991ff1c3 100644 --- a/ksmiletris/gamewindow.cpp +++ b/ksmiletris/gamewindow.cpp @@ -42,37 +42,37 @@ this software. const int default_width = 362; const int default_height = 460; -GameWindow::GameWindow(QWidget *, const char *name) +GameWindow::GameWindow(TQWidget *, const char *name) : KMainWindow(0, name) { //New Games (void)KStdGameAction::gameNew(this, - SLOT(menu_newGame()), + TQT_SLOT(menu_newGame()), actionCollection()); //Pause Game (void)KStdGameAction::pause(this, - SLOT(menu_pause()), + TQT_SLOT(menu_pause()), actionCollection()); //End Game (void)KStdGameAction::end(this, - SLOT(menu_endGame()), + TQT_SLOT(menu_endGame()), actionCollection()); //Highscores (void)KStdGameAction::highscores(this, - SLOT(menu_highScores()), + TQT_SLOT(menu_highScores()), actionCollection()); //Quit (void)KStdGameAction::quit(this, - SLOT(close()), + TQT_SLOT(close()), actionCollection()); - QStringList list; + TQStringList list; KSelectAction* piecesAct = - new KSelectAction(i18n("&Pieces"), 0, this, SLOT(menu_pieces()), + new KSelectAction(i18n("&Pieces"), 0, this, TQT_SLOT(menu_pieces()), actionCollection(), "settings_pieces"); list.append(i18n("&Smiles")); list.append(i18n("S&ymbols")); @@ -80,14 +80,14 @@ GameWindow::GameWindow(QWidget *, const char *name) piecesAct->setItems(list); (void)new KToggleAction(i18n("&Sounds"), 0, this, - SLOT(menu_sounds()), actionCollection(), "settings_sounds"); + TQT_SLOT(menu_sounds()), actionCollection(), "settings_sounds"); - //connect(menu, SIGNAL(moved(menuPosition)), - // this, SLOT(movedMenu(menuPosition))); ? + //connect(menu, TQT_SIGNAL(moved(menuPosition)), + // this, TQT_SLOT(movedMenu(menuPosition))); ? status = new KStatusBar(this); status->insertItem(i18n("Level: 99"), 1); @@ -97,16 +97,16 @@ GameWindow::GameWindow(QWidget *, const char *name) game = new GameWidget(this); setCentralWidget(game); - connect(game, SIGNAL(changedStats(int, int)), - this, SLOT(updateStats(int, int))); - connect(game, SIGNAL(gameOver()), this, SLOT(gameOver())); + connect(game, TQT_SIGNAL(changedStats(int, int)), + this, TQT_SLOT(updateStats(int, int))); + connect(game, TQT_SIGNAL(gameOver()), this, TQT_SLOT(gameOver())); //keys - (void)new KAction(i18n("Move Left"), Key_Left, game, SLOT(keyLeft()), actionCollection(), "left"); - (void)new KAction(i18n("Move Right"), Key_Right, game, SLOT(keyRight()), actionCollection(), "right"); - (void)new KAction(i18n("Rotate Left"), Key_Up, game, SLOT(keyUp()), actionCollection(), "up"); - (void)new KAction(i18n("Rotate Right"), Key_Down, game, SLOT(keyDown()), actionCollection(), "down"); - (void)new KAction(i18n("Drop Down"), Key_Space, game, SLOT(keySpace()), actionCollection(), "space"); + (void)new KAction(i18n("Move Left"), Key_Left, game, TQT_SLOT(keyLeft()), actionCollection(), "left"); + (void)new KAction(i18n("Move Right"), Key_Right, game, TQT_SLOT(keyRight()), actionCollection(), "right"); + (void)new KAction(i18n("Rotate Left"), Key_Up, game, TQT_SLOT(keyUp()), actionCollection(), "up"); + (void)new KAction(i18n("Rotate Right"), Key_Down, game, TQT_SLOT(keyDown()), actionCollection(), "down"); + (void)new KAction(i18n("Drop Down"), Key_Space, game, TQT_SLOT(keySpace()), actionCollection(), "space"); game->setFixedSize(default_width, default_height); adjustSize(); @@ -179,7 +179,7 @@ void GameWindow::menu_sounds() void GameWindow::updateStats(int level, int points) { - QString l, p; + TQString l, p; l.setNum(level); p.setNum(points); status->changeItem(i18n("Level: %1").arg(l), 1); diff --git a/ksmiletris/gamewindow.h b/ksmiletris/gamewindow.h index 54e637a0..cb06bae5 100644 --- a/ksmiletris/gamewindow.h +++ b/ksmiletris/gamewindow.h @@ -37,7 +37,7 @@ class GameWindow : public KMainWindow { Q_OBJECT public: - GameWindow(QWidget *parent=0, const char *name=0); + GameWindow(TQWidget *parent=0, const char *name=0); public slots: void menu_newGame(); @@ -57,7 +57,7 @@ private: KStatusBar *status; GameWidget *game; - QString m_player; + TQString m_player; }; #endif // !GAMEWINDOW_H diff --git a/ksmiletris/mirrorwidget.cpp b/ksmiletris/mirrorwidget.cpp index 43ae0175..8a7447eb 100644 --- a/ksmiletris/mirrorwidget.cpp +++ b/ksmiletris/mirrorwidget.cpp @@ -23,29 +23,29 @@ this software. #include "config.h" -#include <qframe.h> -#include <qpainter.h> -#include <qpixmap.h> +#include <tqframe.h> +#include <tqpainter.h> +#include <tqpixmap.h> #include "ksmiletris.h" #include "mirrorwidget.h" -MirrorWidget::MirrorWidget(QPixmap *s, bool *game, bool *pause, - QWidget *parent, const char *name) - : QFrame(parent, name) +MirrorWidget::MirrorWidget(TQPixmap *s, bool *game, bool *pause, + TQWidget *parent, const char *name) + : TQFrame(parent, name) { in_game = game; in_pause = pause; sprites = s; - setFrameStyle(QFrame::Box | QFrame::Raised); + setFrameStyle(TQFrame::Box | TQFrame::Raised); setLineWidth(2); setMidLineWidth(1); resize(scr_width * sprite_width + 10, sprite_height + 10); } -void MirrorWidget::drawContents(QPainter *p) +void MirrorWidget::drawContents(TQPainter *p) { - QRect r = contentsRect(); + TQRect r = contentsRect(); if (!*in_game) { p->fillRect(r, black); diff --git a/ksmiletris/mirrorwidget.h b/ksmiletris/mirrorwidget.h index 4b0c7fa0..80676a8a 100644 --- a/ksmiletris/mirrorwidget.h +++ b/ksmiletris/mirrorwidget.h @@ -24,26 +24,26 @@ this software. #ifndef MIRRORWIDGET_H #define MIRRORWIDGET_H -#include <qframe.h> +#include <tqframe.h> #include "ksmiletris.h" -class MirrorWidget : public QFrame { +class MirrorWidget : public TQFrame { public: - MirrorWidget(QPixmap *s, bool *game, bool *pause, - QWidget *parent=0, const char *name=0); + MirrorWidget(TQPixmap *s, bool *game, bool *pause, + TQWidget *parent=0, const char *name=0); void setBackgroundSprite(Sprite s) { bg_sprite = s; } void setMirrorSprites(Sprite *s) { mirror_sprites = s; } private: - QPixmap *sprites; + TQPixmap *sprites; bool *in_game, *in_pause; Sprite bg_sprite; Sprite *mirror_sprites; protected: - void drawContents(QPainter *p); + void drawContents(TQPainter *p); }; #endif // !MIRRORWIDGET_H diff --git a/ksmiletris/npiecewidget.cpp b/ksmiletris/npiecewidget.cpp index 5df68f8e..9e87a9a0 100644 --- a/ksmiletris/npiecewidget.cpp +++ b/ksmiletris/npiecewidget.cpp @@ -23,29 +23,29 @@ this software. #include "config.h" -#include <qframe.h> -#include <qpainter.h> -#include <qpixmap.h> +#include <tqframe.h> +#include <tqpainter.h> +#include <tqpixmap.h> #include "ksmiletris.h" #include "npiecewidget.h" -NextPieceWidget::NextPieceWidget(QPixmap *s, bool *game, bool *pause, - QWidget *parent, const char *name) - : QFrame(parent, name) +NextPieceWidget::NextPieceWidget(TQPixmap *s, bool *game, bool *pause, + TQWidget *parent, const char *name) + : TQFrame(parent, name) { in_game = game; in_pause = pause; sprites = s; - setFrameStyle(QFrame::Box | QFrame::Raised); + setFrameStyle(TQFrame::Box | TQFrame::Raised); setLineWidth(2); setMidLineWidth(1); resize(2 * sprite_width + 10, 2 * sprite_height + 10); } -void NextPieceWidget::drawContents(QPainter *p) +void NextPieceWidget::drawContents(TQPainter *p) { - QRect r = contentsRect(); + TQRect r = contentsRect(); if (!*in_game) { p->fillRect(r, black); diff --git a/ksmiletris/npiecewidget.h b/ksmiletris/npiecewidget.h index 66095e31..f2d7ac1f 100644 --- a/ksmiletris/npiecewidget.h +++ b/ksmiletris/npiecewidget.h @@ -24,26 +24,26 @@ this software. #ifndef NPIECEWIDGET_H #define NPIECEWIDGET_H -#include <qframe.h> +#include <tqframe.h> #include "ksmiletris.h" -class NextPieceWidget : public QFrame { +class NextPieceWidget : public TQFrame { public: - NextPieceWidget(QPixmap *s, bool *game, bool *pause, - QWidget *parent=0, const char *name=0); + NextPieceWidget(TQPixmap *s, bool *game, bool *pause, + TQWidget *parent=0, const char *name=0); void setBackgroundSprite(Sprite s) { bg_sprite = s; } void setNextPieceSprites(Sprite *s) { next_piece_sprites = s; } private: - QPixmap *sprites; + TQPixmap *sprites; bool *in_game, *in_pause; Sprite bg_sprite; Sprite *next_piece_sprites; protected: - void drawContents(QPainter *p); + void drawContents(TQPainter *p); }; #endif // !NPIECEWIDGET_H diff --git a/ksmiletris/screenwidget.cpp b/ksmiletris/screenwidget.cpp index 0080aadd..d8e87f4c 100644 --- a/ksmiletris/screenwidget.cpp +++ b/ksmiletris/screenwidget.cpp @@ -25,29 +25,29 @@ this software. #include <kapplication.h> #include <kstandarddirs.h> -#include <qframe.h> -#include <qpainter.h> -#include <qpixmap.h> +#include <tqframe.h> +#include <tqpainter.h> +#include <tqpixmap.h> #include "ksmiletris.h" #include "screenwidget.h" -ScreenWidget::ScreenWidget(QPixmap *s, bool *game, bool *pause, - QWidget *parent, const char *name) - : QFrame(parent, name) +ScreenWidget::ScreenWidget(TQPixmap *s, bool *game, bool *pause, + TQWidget *parent, const char *name) + : TQFrame(parent, name) { in_game = game; in_pause = pause; sprites = s; - setFrameStyle(QFrame::Box | QFrame::Raised); + setFrameStyle(TQFrame::Box | TQFrame::Raised); setLineWidth(2); setMidLineWidth(1); resize(scr_width * sprite_width + 10, scr_height * sprite_height + 10); } -void ScreenWidget::drawContents(QPainter *p) +void ScreenWidget::drawContents(TQPainter *p) { - QRect r = contentsRect(); + TQRect r = contentsRect(); if (!*in_game) { p->fillRect(r, black); @@ -61,7 +61,7 @@ void ScreenWidget::drawContents(QPainter *p) sprites[screen_sprites[y*scr_width + x]]); if (*in_pause) { - QPixmap pause(locate("appdata", "data/pause.bmp")); + TQPixmap pause(locate("appdata", "data/pause.bmp")); p->drawPixmap((width()-pause.width())/2, (height()-pause.height())/2, pause); } diff --git a/ksmiletris/screenwidget.h b/ksmiletris/screenwidget.h index 5643d7ed..a27b3b31 100644 --- a/ksmiletris/screenwidget.h +++ b/ksmiletris/screenwidget.h @@ -24,26 +24,26 @@ this software. #ifndef SCREENWIDGET_H #define SCREENWIDGET_H -#include <qframe.h> +#include <tqframe.h> #include "ksmiletris.h" -class ScreenWidget : public QFrame { +class ScreenWidget : public TQFrame { public: - ScreenWidget(QPixmap *s, bool *game, bool *pause, - QWidget *parent=0, const char *name=0); + ScreenWidget(TQPixmap *s, bool *game, bool *pause, + TQWidget *parent=0, const char *name=0); void setBackgroundSprite(Sprite s) { bg_sprite = s; } void setScreenSprites(Sprite *s) { screen_sprites = s; } private: - QPixmap *sprites; + TQPixmap *sprites; bool *in_game, *in_pause; Sprite bg_sprite; Sprite *screen_sprites; protected: - void drawContents(QPainter *p); + void drawContents(TQPainter *p); }; #endif // !SCREENWIDGET_H diff --git a/ksnake/basket.cpp b/ksnake/basket.cpp index c03b1deb..138336cd 100644 --- a/ksnake/basket.cpp +++ b/ksnake/basket.cpp @@ -23,8 +23,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qtimer.h> -#include <qptrlist.h> +#include <tqtimer.h> +#include <tqptrlist.h> #include "board.h" #include "basket.h" @@ -35,7 +35,7 @@ Kaffee::Kaffee(int pos, int r1, int r2) p = pos; t = Red; r = r2; - QTimer::singleShot( r1, this, SLOT(golden()) ); + TQTimer::singleShot( r1, this, TQT_SLOT(golden()) ); dirty = true; } @@ -43,14 +43,14 @@ void Kaffee::golden() { dirty = true; t = (t == Red ? Golden : Red); - QTimer::singleShot( r, this, SLOT(golden()) ); + TQTimer::singleShot( r, this, TQT_SLOT(golden()) ); } Basket::Basket(Board *b, PixServer *p) { board = b; pixServer = p; - list = new QPtrList<Kaffee>; + list = new TQPtrList<Kaffee>; list->setAutoDelete( true ); } diff --git a/ksnake/basket.h b/ksnake/basket.h index eb965e4a..56bc8020 100644 --- a/ksnake/basket.h +++ b/ksnake/basket.h @@ -63,7 +63,7 @@ signals: private: Board *board; PixServer *pixServer; - QPtrList<Kaffee> *list; + TQPtrList<Kaffee> *list; KRandomSequence random; }; diff --git a/ksnake/board.cpp b/ksnake/board.cpp index 9179dfb1..0959dee1 100644 --- a/ksnake/board.cpp +++ b/ksnake/board.cpp @@ -23,7 +23,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qrect.h> +#include <tqrect.h> #include "board.h" Pos::Pos(Pos *p, int i, int r) { @@ -117,7 +117,7 @@ void Pos::addList(Pos *np) { } Board::Board(int s) - :QMemArray<int> (s) + :TQMemArray<int> (s) { sz = s; samyIndex = -1; @@ -142,10 +142,10 @@ void Board::set(int i, Square sq) samyIndex = i; } -QRect Board::rect(int i) +TQRect Board::rect(int i) { index(i); - return (QRect(col*BRICKSIZE, row*BRICKSIZE, BRICKSIZE, BRICKSIZE)); + return (TQRect(col*BRICKSIZE, row*BRICKSIZE, BRICKSIZE, BRICKSIZE)); } bool Board::isEmpty(int i) diff --git a/ksnake/board.h b/ksnake/board.h index 0fa43d7e..0eece38d 100644 --- a/ksnake/board.h +++ b/ksnake/board.h @@ -63,12 +63,12 @@ private: bool inList; }; -class Board : public QMemArray<int> +class Board : public TQMemArray<int> { public: Board (int s); ~Board() {} - QRect rect(int i); + TQRect rect(int i); void set(int i, Square sq); diff --git a/ksnake/game.cpp b/ksnake/game.cpp index 0fa18df2..4817b3af 100644 --- a/ksnake/game.cpp +++ b/ksnake/game.cpp @@ -29,8 +29,8 @@ from KReversi. thanks. */ -#include <qdir.h> -#include <qregexp.h> +#include <tqdir.h> +#include <tqregexp.h> #include <klocale.h> @@ -54,7 +54,7 @@ #define SCORE 1 #define LIVES 2 -Game::Game(QWidget *parent, const char *name) : KMainWindow(parent,name) +Game::Game(TQWidget *parent, const char *name) : KMainWindow(parent,name) { // create statusbar statusBar()->insertItem(i18n("Score: 0"), SCORE); @@ -67,14 +67,14 @@ Game::Game(QWidget *parent, const char *name) : KMainWindow(parent,name) rattler->reloadRoomPixmap(); rattler->setFocus(); - connect(rattler, SIGNAL(setPoints(int)), this, SLOT(scoreChanged(int))); - connect(rattler, SIGNAL(setTrys(int)), this, SLOT(setTrys(int))); - connect(rattler, SIGNAL(rewind()), view->progress, SLOT(rewind())); - connect(rattler, SIGNAL(advance()), view->progress, SLOT(advance())); - connect(view->progress, SIGNAL(restart()), rattler, SLOT(restartTimer())); + connect(rattler, TQT_SIGNAL(setPoints(int)), this, TQT_SLOT(scoreChanged(int))); + connect(rattler, TQT_SIGNAL(setTrys(int)), this, TQT_SLOT(setTrys(int))); + connect(rattler, TQT_SIGNAL(rewind()), view->progress, TQT_SLOT(rewind())); + connect(rattler, TQT_SIGNAL(advance()), view->progress, TQT_SLOT(advance())); + connect(view->progress, TQT_SIGNAL(restart()), rattler, TQT_SLOT(restartTimer())); - connect(rattler, SIGNAL(togglePaused()), this, SLOT(togglePaused())); - connect(rattler, SIGNAL(setScore(int)), this, SLOT(gameEnd(int))); + connect(rattler, TQT_SIGNAL(togglePaused()), this, TQT_SLOT(togglePaused())); + connect(rattler, TQT_SIGNAL(setScore(int)), this, TQT_SLOT(gameEnd(int))); setCentralWidget(view); @@ -98,7 +98,7 @@ void Game::setTrys(int tries){ void Game::gameEnd(int score){ KScoreDialog di(KScoreDialog::Name | KScoreDialog::Score | KScoreDialog::Date, this); KScoreDialog::FieldInfo scoreInfo; - QString date = QDateTime::currentDateTime().toString(); + TQString date = TQDateTime::currentDateTime().toString(); scoreInfo.insert(KScoreDialog::Date, date); if (di.addScore(score, scoreInfo, true)) di.exec(); @@ -120,16 +120,16 @@ void Game::createMenu() actionCollection()->setAutoConnectShortcuts(true); rattler->setActionCollection(actionCollection()); - KStdGameAction::gameNew(rattler, SLOT(restart()), actionCollection()); - pause = KStdGameAction::pause(rattler, SLOT(pause()), actionCollection()); - KStdGameAction::highscores(this, SLOT(showHighScores()), actionCollection()); - KStdGameAction::quit( this, SLOT(close()), actionCollection()); + KStdGameAction::gameNew(rattler, TQT_SLOT(restart()), actionCollection()); + pause = KStdGameAction::pause(rattler, TQT_SLOT(pause()), actionCollection()); + KStdGameAction::highscores(this, TQT_SLOT(showHighScores()), actionCollection()); + KStdGameAction::quit( this, TQT_SLOT(close()), actionCollection()); - KStdAction::preferences(this, SLOT(showSettings()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection()); // TODO change and make custom function that pauses game or // modify widget to pause when loosing focus and remove this - KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), + KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); } @@ -153,17 +153,17 @@ void Game::showSettings(){ Appearance *a = new Appearance(0, "Appearance"); - QStringList list; + TQStringList list; if (rattler->backgroundPixmaps.count() == 0) { list.append(i18n("none")); } else { - QStringList::ConstIterator it = rattler->backgroundPixmaps.begin(); + TQStringList::ConstIterator it = rattler->backgroundPixmaps.begin(); for(unsigned i = 0; it != rattler->backgroundPixmaps.end(); i++, it++) { // since the filename may contain underscore, they // are replaced with spaces in the menu entry - QString s = QFileInfo( *it ).baseName(); - s = s.replace(QRegExp("_"), " "); + TQString s = TQFileInfo( *it ).baseName(); + s = s.replace(TQRegExp("_"), " "); list.append(s); } } @@ -173,7 +173,7 @@ void Game::showSettings(){ dialog->addPage(a, i18n("Appearance"), "style"); dialog->addPage(new StartRoom(0, "StartRoom"), i18n("First Level"), "folder_home"); - connect(dialog, SIGNAL(settingsChanged()), rattler, SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), rattler, TQT_SLOT(loadSettings())); dialog->show(); } diff --git a/ksnake/game.h b/ksnake/game.h index f25ef127..0c9eb66b 100644 --- a/ksnake/game.h +++ b/ksnake/game.h @@ -38,7 +38,7 @@ class Game : public KMainWindow { Q_OBJECT public: - Game(QWidget *parent=0, const char *name=0); + Game(TQWidget *parent=0, const char *name=0); ~Game(); private slots: diff --git a/ksnake/level.cpp b/ksnake/level.cpp index 86360818..0ea100f0 100644 --- a/ksnake/level.cpp +++ b/ksnake/level.cpp @@ -23,8 +23,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qbitmap.h> -#include <qimage.h> +#include <tqbitmap.h> +#include <tqimage.h> #include "level.h" #include "board.h" @@ -68,18 +68,18 @@ void Level::create(Img img) void Level::createRoom() { - QImage image = leV->getImage(level); + TQImage image = leV->getImage(level); initBoard(image); } void Level::makeImageFromData(const uchar *buf) { - QBitmap bitmap(BoardWidth, BoardWidth, buf, true); - QImage image = bitmap.convertToImage(); + TQBitmap bitmap(BoardWidth, BoardWidth, buf, true); + TQImage image = bitmap.convertToImage(); initBoard (image); } -void Level::initBoard(const QImage &image) +void Level::initBoard(const TQImage &image) { int index = 0; uchar *b; @@ -88,7 +88,7 @@ void Level::initBoard(const QImage &image) b = image.scanLine(y); for ( int x = 0;x < image.width();x++ ) { - if ( image.bitOrder() == QImage::BigEndian ) { + if ( image.bitOrder() == TQImage::BigEndian ) { if (((*b >> (7 - (x & 7))) & 1) == 1) board->set(index, brick); else board->set(index, empty); @@ -109,13 +109,13 @@ void Level::createBanner() { makeImageFromData(level_bits); - QString num; + TQString num; num.setNum(level); if(level < 10) num.insert(0,'0'); - QString left = num.left(1); - QString right = num.right(1); + TQString left = num.left(1); + TQString right = num.right(1); drawNumber ( 606, numbers[left.toInt()] ); drawNumber ( 614, numbers[right.toInt()] ); @@ -123,8 +123,8 @@ void Level::createBanner() void Level::drawNumber(int beginAt, const uchar *buf) { - QBitmap bitmap(7, 9, buf, true); - QImage image = bitmap.convertToImage(); + TQBitmap bitmap(7, 9, buf, true); + TQImage image = bitmap.convertToImage(); int index = beginAt; uchar *b; @@ -134,7 +134,7 @@ void Level::drawNumber(int beginAt, const uchar *buf) b = image.scanLine(y); for ( int x = 0;x < image.width();x++ ) { - if ( image.bitOrder() == QImage::BigEndian ) + if ( image.bitOrder() == TQImage::BigEndian ) { if (((*b >> (7 - (x & 7))) & 1) == 1) board->set(index, brick); diff --git a/ksnake/level.h b/ksnake/level.h index 51c86dc6..03398a60 100644 --- a/ksnake/level.h +++ b/ksnake/level.h @@ -41,10 +41,10 @@ public: private: Board *board; - QImage makeImage(char *); + TQImage makeImage(char *); void makeImageFromData(const uchar *buf); void drawNumber(int beginAt, const uchar *buf); - void initBoard(const QImage &image); + void initBoard(const TQImage &image); void createRoom(); void createBanner(); diff --git a/ksnake/levels.cpp b/ksnake/levels.cpp index c58aa895..fe85cb39 100644 --- a/ksnake/levels.cpp +++ b/ksnake/levels.cpp @@ -23,8 +23,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qimage.h> -#include <qbitmap.h> +#include <tqimage.h> +#include <tqbitmap.h> #include <kstandarddirs.h> @@ -44,15 +44,15 @@ int Levels::max() return ( list.count() -1 ); } -QImage Levels::getImage(int at) +TQImage Levels::getImage(int at) { - QBitmap bitmap(*list.at(at)); - QImage image = bitmap.convertToImage(); + TQBitmap bitmap(*list.at(at)); + TQImage image = bitmap.convertToImage(); return image; } -QPixmap Levels::getPixmap(int at) +TQPixmap Levels::getPixmap(int at) { - return QPixmap(*list.at(at)); + return TQPixmap(*list.at(at)); } diff --git a/ksnake/levels.h b/ksnake/levels.h index e40f5602..c0ed0e0b 100644 --- a/ksnake/levels.h +++ b/ksnake/levels.h @@ -30,12 +30,12 @@ class Levels { public: Levels (); - QImage getImage(int); - QPixmap getPixmap(int); + TQImage getImage(int); + TQPixmap getPixmap(int); int max(); private: - QStringList list; + TQStringList list; }; diff --git a/ksnake/pixServer.cpp b/ksnake/pixServer.cpp index bdc281ea..ac25f9be 100644 --- a/ksnake/pixServer.cpp +++ b/ksnake/pixServer.cpp @@ -25,9 +25,9 @@ #include "pixServer.h" -#include <qimage.h> -#include <qpainter.h> -#include <qbitmap.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqbitmap.h> #include <kstandarddirs.h> #include <klocale.h> @@ -50,24 +50,24 @@ void PixServer::erase(int pos) if (!board->isEmpty(pos)) return; - QRect rect = board->rect(pos); + TQRect rect = board->rect(pos); bitBlt( &cachePix, rect.x(), rect.y(), &backPix, rect.x(), rect.y(), rect.width(), rect.height()); } void PixServer::restore(int pos) { - QRect rect = board->rect(pos); + TQRect rect = board->rect(pos); bitBlt( &cachePix, rect.x(), rect.y(), &roomPix, rect.x(), rect.y(), rect.width(), rect.height()); } void PixServer::draw(int pos, PixMap pix, int i) { - QPixmap p; + TQPixmap p; p.resize(BRICKSIZE, BRICKSIZE); - QRect rect = board->rect(pos); + TQRect rect = board->rect(pos); if (! plainColor) bitBlt( &p, 0, 0, &backPix, @@ -94,40 +94,40 @@ void PixServer::draw(int pos, PixMap pix, int i) void PixServer::initPixmaps() { - QPixmap pm = QPixmap(locate("appdata", "pics/snake1.png")); - QImage qi = pm.convertToImage(); + TQPixmap pm = TQPixmap(locate("appdata", "pics/snake1.png")); + TQImage qi = pm.convertToImage(); qi=qi.smoothScale(BRICKSIZE*18,BRICKSIZE); - pm.convertFromImage(qi,QPixmap::AvoidDither); + pm.convertFromImage(qi,TQPixmap::AvoidDither); for (int x = 0 ; x < 18; x++){ compuSnakePix[x].resize(BRICKSIZE, BRICKSIZE); bitBlt(&compuSnakePix[x] ,0,0, &pm,x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, Qt::CopyROP, true); compuSnakePix[x].setMask(compuSnakePix[x].createHeuristicMask()); } - pm = QPixmap(locate("appdata", "pics/snake2.png")); + pm = TQPixmap(locate("appdata", "pics/snake2.png")); qi = pm.convertToImage(); qi=qi.smoothScale(BRICKSIZE*18,BRICKSIZE); - pm.convertFromImage(qi,QPixmap::AvoidDither); + pm.convertFromImage(qi,TQPixmap::AvoidDither); for (int x = 0 ; x < 18; x++){ samyPix[x].resize(BRICKSIZE, BRICKSIZE); bitBlt(&samyPix[x] ,0,0, &pm,x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, Qt::CopyROP, true); samyPix[x].setMask(samyPix[x].createHeuristicMask()); } - pm = QPixmap(locate("appdata", "pics/ball.png")); + pm = TQPixmap(locate("appdata", "pics/ball.png")); qi = pm.convertToImage(); qi=qi.smoothScale(BRICKSIZE*4,BRICKSIZE); - pm.convertFromImage(qi,QPixmap::AvoidDither); + pm.convertFromImage(qi,TQPixmap::AvoidDither); for (int x = 0 ; x < 4; x++){ ballPix[x].resize(BRICKSIZE, BRICKSIZE); bitBlt(&ballPix[x] ,0,0, &pm,x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, Qt::CopyROP, true); ballPix[x].setMask(ballPix[x].createHeuristicMask()); } - pm = QPixmap(locate("appdata", "pics/apples.png")); + pm = TQPixmap(locate("appdata", "pics/apples.png")); qi = pm.convertToImage(); qi=qi.smoothScale(BRICKSIZE*2,BRICKSIZE); - pm.convertFromImage(qi,QPixmap::AvoidDither); + pm.convertFromImage(qi,TQPixmap::AvoidDither); for (int x = 0 ; x < 2; x++){ applePix[x].resize(BRICKSIZE, BRICKSIZE); bitBlt(&applePix[x] ,0,0, &pm,x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, Qt::CopyROP, true); @@ -137,7 +137,7 @@ void PixServer::initPixmaps() void PixServer::initbackPixmaps() { - QString path; + TQString path; plainColor = false; if(Settings::bgcolor_enabled()){ @@ -145,19 +145,19 @@ void PixServer::initbackPixmaps() plainColor = true; } else if(Settings::bgimage_enabled()) { // A bit of a hack. - QStringList backgroundPixmaps = + TQStringList backgroundPixmaps = KGlobal::dirs()->findAllResources("appdata", "backgrounds/*.png"); path = backgroundPixmaps[(Settings::bgimage())]; } - QPixmap PIXMAP; + TQPixmap PIXMAP; int pw, ph; backPix.resize(MAPWIDTH, MAPHEIGHT); if (! plainColor) { - PIXMAP = QPixmap(path); + PIXMAP = TQPixmap(path); if (!PIXMAP.isNull()) { pw = PIXMAP.width(); @@ -169,7 +169,7 @@ void PixServer::initbackPixmaps() } else { kdDebug() << "error loading background image :" << path << endl; - backgroundColor = (QColor("black")); + backgroundColor = (TQColor("black")); plainColor = true; } } @@ -179,7 +179,7 @@ void PixServer::initbackPixmaps() void PixServer::initBrickPixmap() { - QPixmap pm = QPixmap(locate("appdata", "pics/brick.png")); + TQPixmap pm = TQPixmap(locate("appdata", "pics/brick.png")); if (pm.isNull()) { kdFatal() << i18n("error loading %1, aborting\n").arg("brick.png"); } @@ -194,7 +194,7 @@ void PixServer::initBrickPixmap() void PixServer::initRoomPixmap() { - QPainter paint; + TQPainter paint; roomPix.resize(MAPWIDTH, MAPHEIGHT); bitBlt(&roomPix,0,0, &backPix); @@ -210,18 +210,18 @@ void PixServer::initRoomPixmap() bitBlt(&cachePix,0,0, &roomPix); } -void PixServer::drawBrick(QPainter *p ,int i) +void PixServer::drawBrick(TQPainter *p ,int i) { //Note, ROOMPIC IS OUR 'TARGET' - QColor light(180,180,180); - QColor dark(100,100,100); + TQColor light(180,180,180); + TQColor dark(100,100,100); int topSq = board->getNext(N, i); //find 'address' of neighbouring squares int botSq = board->getNext(S, i); int rightSq = board->getNext(E ,i); int leftSq = board->getNext(W, i); - QRect rect = board->rect(i); //get our square's rect + TQRect rect = board->rect(i); //get our square's rect int x = rect.x(); int y = rect.y(); //Get x,y location of square??? diff --git a/ksnake/pixServer.h b/ksnake/pixServer.h index 783f7efa..c081a491 100644 --- a/ksnake/pixServer.h +++ b/ksnake/pixServer.h @@ -26,7 +26,7 @@ #ifndef PIXSERVER_H #define PIXSERVER_H -#include <qpixmap.h> +#include <tqpixmap.h> class Board; enum SnakePix {TailUp, TailDown, TailRight, TailLeft, @@ -41,7 +41,7 @@ class PixServer { public: PixServer (Board *); - QPixmap levelPix() const { return cachePix; } + TQPixmap levelPix() const { return cachePix; } void initRoomPixmap(); void initBrickPixmap(); @@ -55,20 +55,20 @@ public: private: Board *board; - void drawBrick(QPainter *, int); + void drawBrick(TQPainter *, int); - QPixmap samyPix[18]; - QPixmap compuSnakePix[18]; - QPixmap ballPix[4]; - QPixmap applePix[2]; + TQPixmap samyPix[18]; + TQPixmap compuSnakePix[18]; + TQPixmap ballPix[4]; + TQPixmap applePix[2]; - QPixmap roomPix; - QPixmap cachePix; - QPixmap offPix; - QPixmap backPix; + TQPixmap roomPix; + TQPixmap cachePix; + TQPixmap offPix; + TQPixmap backPix; bool plainColor; - QColor backgroundColor; + TQColor backgroundColor; }; diff --git a/ksnake/progress.cpp b/ksnake/progress.cpp index d6d88823..c5024a0f 100644 --- a/ksnake/progress.cpp +++ b/ksnake/progress.cpp @@ -25,7 +25,7 @@ #include "progress.h" -Progress::Progress(QWidget *parent, const char *name) +Progress::Progress(TQWidget *parent, const char *name) : KGameProgress(0, 300, 300, KGameProgress::Horizontal, parent, name) { setBarColor("green1"); diff --git a/ksnake/progress.h b/ksnake/progress.h index 4b902f26..311a2bcf 100644 --- a/ksnake/progress.h +++ b/ksnake/progress.h @@ -32,7 +32,7 @@ class Progress : public KGameProgress { Q_OBJECT public: - Progress( QWidget *parent=0, const char *name=0 ); + Progress( TQWidget *parent=0, const char *name=0 ); public slots: void advance(); diff --git a/ksnake/rattler.cpp b/ksnake/rattler.cpp index 8bea1c0c..1085d6f8 100644 --- a/ksnake/rattler.cpp +++ b/ksnake/rattler.cpp @@ -25,28 +25,28 @@ #include "rattler.h" -#include <qtimer.h> -#include <qlabel.h> +#include <tqtimer.h> +#include <tqlabel.h> #include <kapplication.h> #include <kstdgameaction.h> #include <kdebug.h> #include <klocale.h> #include <kmessagebox.h> -#include <qbitarray.h> +#include <tqbitarray.h> #include <kstandarddirs.h> #include "level.h" #include "basket.h" #include "settings.h" -QBitArray gameState(5); -QLabel *label = 0; +TQBitArray gameState(5); +TQLabel *label = 0; int speed[4] = { 130, 95, 55, 40 }; -Rattler::Rattler( QWidget *parent, const char *name ) - : QWidget( parent, name ) +Rattler::Rattler( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) { - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(TQWidget::StrongFocus); numBalls = Settings::balls(); ballsAI = Settings::ballsAI(); @@ -61,22 +61,22 @@ Rattler::Rattler( QWidget *parent, const char *name ) basket = new Basket(board, pix); samy = new SamySnake(board, pix); - computerSnakes = new QPtrList<CompuSnake>; + computerSnakes = new TQPtrList<CompuSnake>; computerSnakes->setAutoDelete( true ); - balls = new QPtrList<Ball>; + balls = new TQPtrList<Ball>; balls->setAutoDelete( true ); - connect( samy, SIGNAL(closeGate(int)), this, SLOT(closeGate(int))); - connect( samy, SIGNAL(score(bool, int)), this, SLOT(scoring(bool,int))); - connect( samy, SIGNAL(goingOut()), this, SLOT(speedUp())); - connect( basket, SIGNAL(openGate()), this, SLOT(openGate())); + connect( samy, TQT_SIGNAL(closeGate(int)), this, TQT_SLOT(closeGate(int))); + connect( samy, TQT_SIGNAL(score(bool, int)), this, TQT_SLOT(scoring(bool,int))); + connect( samy, TQT_SIGNAL(goingOut()), this, TQT_SLOT(speedUp())); + connect( basket, TQT_SIGNAL(openGate()), this, TQT_SLOT(openGate())); gameState.fill(false); gameState.setBit(Demo); timerCount = 0; - QTimer::singleShot( 2000, this, SLOT(demo()) ); // Why wait? + TQTimer::singleShot( 2000, this, TQT_SLOT(demo()) ); // Why wait? backgroundPixmaps = KGlobal::dirs()->findAllResources("appdata", "backgrounds/*.png"); @@ -106,13 +106,13 @@ void Rattler::loadSettings(){ reloadRoomPixmap(); } -void Rattler::paintEvent( QPaintEvent *e) +void Rattler::paintEvent( TQPaintEvent *e) { - QRect rect = e->rect(); + TQRect rect = e->rect(); if (rect.isEmpty()) return; - QPixmap levelPix = pix->levelPix(); + TQPixmap levelPix = pix->levelPix(); basket->repaint(true); @@ -120,7 +120,7 @@ void Rattler::paintEvent( QPaintEvent *e) &levelPix, rect.x(), rect.y(), rect.width(), rect.height()); } -void Rattler::timerEvent( QTimerEvent * ) +void Rattler::timerEvent( TQTimerEvent * ) { timerCount++; @@ -157,11 +157,11 @@ void Rattler::timerEvent( QTimerEvent * ) else if (state == out) levelUp(); - QPixmap levelPix = pix->levelPix(); + TQPixmap levelPix = pix->levelPix(); bitBlt(this, 0, 0, &levelPix, 0, 0, rect().width(), rect().height()); } -void Rattler::keyPressEvent( QKeyEvent *k ) +void Rattler::keyPressEvent( TQKeyEvent *k ) { if (gameState.testBit(Paused)) return; @@ -190,7 +190,7 @@ void Rattler::keyPressEvent( QKeyEvent *k ) k->accept(); } -void Rattler::mousePressEvent( QMouseEvent *e ) +void Rattler::mousePressEvent( TQMouseEvent *e ) { if (gameState.testBit(Paused)) return; @@ -310,12 +310,12 @@ void Rattler::pause() KAction* tempPauseAction = KStdGameAction::pause(); - label = new QLabel(this); - label->setFont( QFont( "Times", 14, QFont::Bold ) ); + label = new TQLabel(this); + label->setFont( TQFont( "Times", 14, TQFont::Bold ) ); label->setText(i18n("Game Paused\n Press %1 to resume\n") .arg(tempPauseAction->shortcutText())); label->setAlignment( AlignCenter ); - label->setFrameStyle( QFrame::Panel | QFrame::Raised ); + label->setFrameStyle( TQFrame::Panel | TQFrame::Raised ); label->setGeometry(182, 206, 198, 80); label->show(); @@ -345,7 +345,7 @@ void Rattler::restartDemo() return; int r = 50000+ (kapp->random() % 30000); - QTimer::singleShot( r, this, SLOT(restartDemo()) ); + TQTimer::singleShot( r, this, TQT_SLOT(restartDemo()) ); stop(); level->create(Intro); @@ -364,7 +364,7 @@ void Rattler::demo() stop(); - QTimer::singleShot( 60000, this, SLOT(restartDemo()) ); + TQTimer::singleShot( 60000, this, TQT_SLOT(restartDemo()) ); gameState.fill(false); gameState.setBit(Init); gameState.setBit(Demo); @@ -414,7 +414,7 @@ void Rattler::restart() cleanLabel(); repaint(); - QTimer::singleShot( 2000, this, SLOT(showRoom()) ); + TQTimer::singleShot( 2000, this, TQT_SLOT(showRoom()) ); } void Rattler::newTry() @@ -427,7 +427,7 @@ void Rattler::newTry() level->create(GameOver); pix->initRoomPixmap(); repaint(); - QTimer::singleShot( 5000, this, SLOT(demo()) ); + TQTimer::singleShot( 5000, this, TQT_SLOT(demo()) ); emit setScore(points); return; } @@ -440,7 +440,7 @@ void Rattler::newTry() pix->initRoomPixmap(); init(true); repaint(); - QTimer::singleShot( 1000, this, SLOT(run()) ); + TQTimer::singleShot( 1000, this, TQT_SLOT(run()) ); } void Rattler::levelUp() @@ -458,7 +458,7 @@ void Rattler::levelUp() pix->initRoomPixmap(); repaint(); - QTimer::singleShot( 2000, this, SLOT(showRoom()) ); + TQTimer::singleShot( 2000, this, TQT_SLOT(showRoom()) ); } /* this slot is called by the progressBar when value() == 0 @@ -494,7 +494,7 @@ void Rattler::showRoom() pix->initRoomPixmap(); init(true); repaint(); - QTimer::singleShot( 1000, this, SLOT(run()) ); + TQTimer::singleShot( 1000, this, TQT_SLOT(run()) ); } void Rattler::init(bool play) @@ -557,10 +557,10 @@ void Rattler::restartComputerSnakes(bool play) as = new KillerCompuSnake(board, pix); break; } - connect( as, SIGNAL(closeGate(int)), this, SLOT(closeGate(int))); - connect( as, SIGNAL(restartTimer()), this, SLOT(restartTimer())); - connect( as, SIGNAL(score(bool, int)), this, SLOT(scoring(bool,int))); - connect( as, SIGNAL(killed()), this, SLOT(killedComputerSnake())); + connect( as, TQT_SIGNAL(closeGate(int)), this, TQT_SLOT(closeGate(int))); + connect( as, TQT_SIGNAL(restartTimer()), this, TQT_SLOT(restartTimer())); + connect( as, TQT_SIGNAL(score(bool, int)), this, TQT_SLOT(scoring(bool,int))); + connect( as, TQT_SIGNAL(killed()), this, TQT_SLOT(killedComputerSnake())); computerSnakes->append(as); } } @@ -614,7 +614,7 @@ void Rattler::setBallsAI(int i) ballsAI = i; } -void Rattler::resizeEvent( QResizeEvent * ) +void Rattler::resizeEvent( TQResizeEvent * ) { pix->initPixmaps(); pix->initBrickPixmap(); @@ -643,10 +643,10 @@ void Rattler::setCompuSnakes(int i) as = new KillerCompuSnake(board, pix); break; } - connect( as, SIGNAL(closeGate(int)), this, SLOT(closeGate(int))); - connect( as, SIGNAL(restartTimer()), this, SLOT(restartTimer())); - connect( as, SIGNAL(score(bool, int)), this, SLOT(scoring(bool,int))); - connect( as, SIGNAL(killed()), this, SLOT(killedComputerSnake())); + connect( as, TQT_SIGNAL(closeGate(int)), this, TQT_SLOT(closeGate(int))); + connect( as, TQT_SIGNAL(restartTimer()), this, TQT_SLOT(restartTimer())); + connect( as, TQT_SIGNAL(score(bool, int)), this, TQT_SLOT(scoring(bool,int))); + connect( as, TQT_SIGNAL(killed()), this, TQT_SLOT(killedComputerSnake())); computerSnakes->append(as); i--; } diff --git a/ksnake/rattler.h b/ksnake/rattler.h index 2922dfe6..da0c13bd 100644 --- a/ksnake/rattler.h +++ b/ksnake/rattler.h @@ -26,7 +26,7 @@ #ifndef RATTLER_H #define RATTLER_H -#include <qwidget.h> +#include <tqwidget.h> #include <kaction.h> #include "ball.h" #include "snake.h" @@ -45,7 +45,7 @@ class Rattler : public QWidget Q_OBJECT public: - Rattler ( QWidget *parent=0, const char *name=0 ); + Rattler ( TQWidget *parent=0, const char *name=0 ); ~Rattler(); void setActionCollection(KActionCollection *a){ actionCollection = a;} @@ -59,7 +59,7 @@ public: void reloadRoomPixmap(); - QStringList backgroundPixmaps; + TQStringList backgroundPixmaps; public slots: void closeGate(int); @@ -101,12 +101,12 @@ signals: void advance(); protected: - void timerEvent( QTimerEvent * ); - void paintEvent( QPaintEvent * ); - void keyPressEvent( QKeyEvent * ); - void mousePressEvent( QMouseEvent * ); - void focusOutEvent( QFocusEvent * ) { ; } - void focusInEvent( QFocusEvent * ) { ; } + void timerEvent( TQTimerEvent * ); + void paintEvent( TQPaintEvent * ); + void keyPressEvent( TQKeyEvent * ); + void mousePressEvent( TQMouseEvent * ); + void focusOutEvent( TQFocusEvent * ) { ; } + void focusInEvent( TQFocusEvent * ) { ; } KActionCollection *actionCollection; private: @@ -125,12 +125,12 @@ private: int direction; - QPtrList<Ball> *balls; + TQPtrList<Ball> *balls; void restartBalls(bool); int numBalls; int ballsAI; - QPtrList<CompuSnake> *computerSnakes; + TQPtrList<CompuSnake> *computerSnakes; void restartComputerSnakes(bool); int numSnakes; int snakesAI; @@ -147,7 +147,7 @@ private: void score(int); void cleanLabel(); - void resizeEvent( QResizeEvent * ); + void resizeEvent( TQResizeEvent * ); }; diff --git a/ksnake/snake.cpp b/ksnake/snake.cpp index 33b3f027..c892452b 100644 --- a/ksnake/snake.cpp +++ b/ksnake/snake.cpp @@ -23,7 +23,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qwidget.h> +#include <tqwidget.h> #include "snake.h" diff --git a/ksnake/snake.h b/ksnake/snake.h index 863ec593..6ea2dac2 100644 --- a/ksnake/snake.h +++ b/ksnake/snake.h @@ -60,7 +60,7 @@ protected: int index; }; - QPtrList<Samy> list; + TQPtrList<Samy> list; KRandomSequence random; diff --git a/ksnake/startroom.cpp b/ksnake/startroom.cpp index 5bb4d989..24874ee9 100644 --- a/ksnake/startroom.cpp +++ b/ksnake/startroom.cpp @@ -24,44 +24,44 @@ */ #include "startroom.h" -#include <qlabel.h> -#include <qpixmap.h> -#include <qwmatrix.h> -#include <qspinbox.h> +#include <tqlabel.h> +#include <tqpixmap.h> +#include <tqwmatrix.h> +#include <tqspinbox.h> #include <klocale.h> -#include <qlayout.h> +#include <tqlayout.h> #include "levels.h" -StartRoom::StartRoom( QWidget *parent, const char *name) - : QWidget( parent, name ) +StartRoom::StartRoom( TQWidget *parent, const char *name) + : TQWidget( parent, name ) { - QGridLayout *Form1Layout = new QGridLayout( this, 1, 1, 11, 6, "Form1Layout"); - QSpacerItem* spacer = new QSpacerItem( 20, 61, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQGridLayout *Form1Layout = new TQGridLayout( this, 1, 1, 11, 6, "Form1Layout"); + TQSpacerItem* spacer = new TQSpacerItem( 20, 61, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); Form1Layout->addItem( spacer, 2, 1 ); - QHBoxLayout *layout1 = new QHBoxLayout( 0, 0, 6, "layout1"); - QSpacerItem* spacer_2 = new QSpacerItem( 91, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQHBoxLayout *layout1 = new TQHBoxLayout( 0, 0, 6, "layout1"); + TQSpacerItem* spacer_2 = new TQSpacerItem( 91, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); layout1->addItem( spacer_2 ); - picture = new QLabel( this, "picture" ); + picture = new TQLabel( this, "picture" ); layout1->addWidget( picture ); - QSpacerItem* spacer_3 = new QSpacerItem( 41, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem* spacer_3 = new TQSpacerItem( 41, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); layout1->addItem( spacer_3 ); Form1Layout->addMultiCellLayout( layout1, 0, 0, 0, 1 ); - roomRange = new QSpinBox( this, "kcfg_StartingRoom" ); + roomRange = new TQSpinBox( this, "kcfg_StartingRoom" ); roomRange->setMaxValue( 25 ); roomRange->setMinValue( 1 ); Form1Layout->addWidget( roomRange, 1, 1 ); - QLabel *textLabel = new QLabel( this, "textLabel" ); + TQLabel *textLabel = new TQLabel( this, "textLabel" ); textLabel->setText(i18n("First level:")); Form1Layout->addWidget( textLabel, 1, 0 ); - connect( roomRange, SIGNAL(valueChanged(int)), SLOT(loadLevel(int))); + connect( roomRange, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(loadLevel(int))); loadLevel(1); } @@ -70,8 +70,8 @@ void StartRoom::loadLevel(int level) if(level < 1 || level > leV->max()) return; - QPixmap pixmap = leV->getPixmap(level); - QWMatrix m; + TQPixmap pixmap = leV->getPixmap(level); + TQWMatrix m; m.scale( (double)7, (double)7 ); pixmap = pixmap.xForm( m ); picture->setPixmap(pixmap); diff --git a/ksnake/startroom.h b/ksnake/startroom.h index ef8cbbe0..683cd6e1 100644 --- a/ksnake/startroom.h +++ b/ksnake/startroom.h @@ -26,7 +26,7 @@ #ifndef STARTROOM_H #define STARTROOM_H -#include <qwidget.h> +#include <tqwidget.h> class QLabel; class QSpinBox; @@ -35,14 +35,14 @@ class StartRoom : public QWidget { Q_OBJECT public: - StartRoom( QWidget *parent=0, const char *name=0 ); + StartRoom( TQWidget *parent=0, const char *name=0 ); private slots: void loadLevel(int level); private: - QLabel *picture; - QSpinBox *roomRange; + TQLabel *picture; + TQSpinBox *roomRange; }; diff --git a/ksnake/view.cpp b/ksnake/view.cpp index 3db7d34f..a8503700 100644 --- a/ksnake/view.cpp +++ b/ksnake/view.cpp @@ -32,15 +32,15 @@ int MAPWIDTH = BRICKSIZE * 35; int MAPHEIGHT = MAPWIDTH; #define BAR_HEIGHT 12 -View::View( QWidget *parent, const char *name ) - : QWidget( parent, name ) +View::View( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) { progress = new Progress(this); rattler = new Rattler( this); setMinimumSize(145,145+BAR_HEIGHT); } -void View::resizeEvent( QResizeEvent * ) +void View::resizeEvent( TQResizeEvent * ) { // These hard coded number really need to be documented BRICKSIZE= (int)16* ((width() < height() - BAR_HEIGHT) ? width() : height() - BAR_HEIGHT)/ 560; @@ -51,9 +51,9 @@ void View::resizeEvent( QResizeEvent * ) rattler->setGeometry(0, BAR_HEIGHT, width(), height()-BAR_HEIGHT); } -QSize View::sizeHint() const +TQSize View::sizeHint() const { - return QSize(490,502); + return TQSize(490,502); } #include "view.moc" diff --git a/ksnake/view.h b/ksnake/view.h index 3dff2dbb..68fd2412 100644 --- a/ksnake/view.h +++ b/ksnake/view.h @@ -25,7 +25,7 @@ #ifndef VIEW_H #define VIEW_H -#include <qwidget.h> +#include <tqwidget.h> class Progress; class Rattler; @@ -34,14 +34,14 @@ class View : public QWidget { Q_OBJECT public: - View ( QWidget *parent=0, const char *name=0 ); + View ( TQWidget *parent=0, const char *name=0 ); Progress *progress; Rattler *rattler; protected: - void resizeEvent( QResizeEvent * ); - virtual QSize sizeHint() const; + void resizeEvent( TQResizeEvent * ); + virtual TQSize sizeHint() const; }; #endif // VIEW_H diff --git a/ksokoban/Bookmark.cpp b/ksokoban/Bookmark.cpp index 796d54b6..5571b7aa 100644 --- a/ksokoban/Bookmark.cpp +++ b/ksokoban/Bookmark.cpp @@ -21,7 +21,7 @@ #include "History.h" #include "LevelMap.h" -#include <qfile.h> +#include <tqfile.h> #include <kapplication.h> @@ -37,10 +37,10 @@ #include <assert.h> void -Bookmark::fileName(QString &p) { +Bookmark::fileName(TQString &p) { p = KGlobal::dirs()->saveLocation("appdata"); - QString n; + TQString n; n.setNum(number_); p += "/bookmark" + n; } @@ -48,7 +48,7 @@ Bookmark::fileName(QString &p) { Bookmark::Bookmark(int _num) : number_(_num), collection_(-1), level_(-1), moves_(0), data_("") { - QString p; + TQString p; fileName(p); FILE *file = fopen(p.latin1(), "r"); @@ -91,9 +91,9 @@ Bookmark::set(int _collection, int _level, int _moves, History *_h) { data_ = ""; _h->save(data_); - QString p; + TQString p; fileName(p); - FILE *file = fopen(QFile::encodeName(p), "w"); + FILE *file = fopen(TQFile::encodeName(p), "w"); if (file == NULL) return; fprintf(file, "%d %d %d\n", collection_, level_, moves_); fprintf(file, "%s\n", data_.latin1()); diff --git a/ksokoban/Bookmark.h b/ksokoban/Bookmark.h index 30c5faff..f4642ae1 100644 --- a/ksokoban/Bookmark.h +++ b/ksokoban/Bookmark.h @@ -23,7 +23,7 @@ class History; class LevelMap; -#include <qstring.h> +#include <tqstring.h> class Bookmark { public: @@ -38,14 +38,14 @@ public: bool goTo(LevelMap *_map, History *_h); private: - void fileName(QString &p); + void fileName(TQString &p); int number_; int collection_; int level_; int moves_; //int pushes_; - QString data_; + TQString data_; }; #endif /* BOOKMARK_H */ diff --git a/ksokoban/History.cpp b/ksokoban/History.cpp index 4c73827d..4525516f 100644 --- a/ksokoban/History.cpp +++ b/ksokoban/History.cpp @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <qptrlist.h> +#include <tqptrlist.h> #include "History.h" #include "Move.h" @@ -43,7 +43,7 @@ History::clear() { } void -History::save(QString &_str) { +History::save(TQString &_str) { Move *m = past_.first(); while (m != 0) { diff --git a/ksokoban/History.h b/ksokoban/History.h index c3db5194..27825f95 100644 --- a/ksokoban/History.h +++ b/ksokoban/History.h @@ -20,8 +20,8 @@ #ifndef HISTORY_H #define HISTORY_H -#include <qptrlist.h> -#include <qstring.h> +#include <tqptrlist.h> +#include <tqstring.h> #include "Move.h" class MoveSequence; @@ -37,8 +37,8 @@ class MoveSequence; class History { private: - QPtrList<Move> past_; - QPtrList<Move> future_; + TQPtrList<Move> past_; + TQPtrList<Move> future_; protected: @@ -53,7 +53,7 @@ public: */ void clear(); - void save(QString &_str); + void save(TQString &_str); const char *load(LevelMap *map, const char *_str); bool redo(LevelMap *map); MoveSequence *deferRedo(LevelMap *map); diff --git a/ksokoban/ImageData.cpp b/ksokoban/ImageData.cpp index 13040c47..c34ece36 100644 --- a/ksokoban/ImageData.cpp +++ b/ksokoban/ImageData.cpp @@ -20,10 +20,10 @@ #include "ImageData.h" #include <assert.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qimage.h> -#include <qcolor.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqimage.h> +#include <tqcolor.h> ImageData::ImageData() : indexSize_(0), size_(0), halfSize_(0) { random.setSeed(0); @@ -52,28 +52,28 @@ ImageData::expandIndex(int size) { indexSize_ = size; } -const QPixmap & +const TQPixmap & ImageData::upperLarge(int index) { assert(index >= 0); if (indexSize_ <= index) expandIndex(index); return largeStone_xpm_[(unsigned char)upperLargeIndex_[index]]; } -const QPixmap & +const TQPixmap & ImageData::lowerLarge(int index) { assert(index >= 0); if (indexSize_ <= index) expandIndex(index); return largeStone_xpm_[(unsigned char)lowerLargeIndex_[index]]; } -const QPixmap & +const TQPixmap & ImageData::leftSmall(int index) { assert(index >= 0); if (indexSize_ <= index) expandIndex(index); return smallStone_xpm_[(unsigned char)leftSmallIndex_[index]]; } -const QPixmap & +const TQPixmap & ImageData::rightSmall(int index) { assert(index >= 0); if (indexSize_ <= index) expandIndex(index); @@ -91,12 +91,12 @@ ImageData::resize(int size) { for (int i=0; i<SMALL_STONES; i++) { image2pixmap(images_[i].smoothScale(halfSize_, halfSize_), smallStone_xpm_[i]); -// smallStone_xpm_[i].convertFromImage(images_[i].smoothScale(halfSize_, halfSize_), QPixmap::ColorOnly|QPixmap::DiffuseDither|QPixmap::DiffuseAlphaDither|QPixmap::AvoidDither); +// smallStone_xpm_[i].convertFromImage(images_[i].smoothScale(halfSize_, halfSize_), TQPixmap::ColorOnly|TQPixmap::DiffuseDither|TQPixmap::DiffuseAlphaDither|TQPixmap::AvoidDither); } for (int i=0; i<LARGE_STONES; i++) { image2pixmap(images_[SMALL_STONES+i].smoothScale(size_, halfSize_), largeStone_xpm_[i]); -// largeStone_xpm_[i].convertFromImage(images_[SMALL_STONES+i].smoothScale(size_, halfSize_) , QPixmap::ColorOnly|QPixmap::DiffuseDither|QPixmap::DiffuseAlphaDither|QPixmap::AvoidDither); +// largeStone_xpm_[i].convertFromImage(images_[SMALL_STONES+i].smoothScale(size_, halfSize_) , TQPixmap::ColorOnly|TQPixmap::DiffuseDither|TQPixmap::DiffuseAlphaDither|TQPixmap::AvoidDither); } objectImg_ = images_[SMALL_STONES+LARGE_STONES].smoothScale(size_, size_); @@ -111,7 +111,7 @@ ImageData::resize(int size) { brighten(objectImg_); image2pixmap(objectImg_, brightObject_, false); - QImage img = images_[SMALL_STONES+LARGE_STONES+1].smoothScale(size_, size_); + TQImage img = images_[SMALL_STONES+LARGE_STONES+1].smoothScale(size_, size_); if (img.width() == size_) img = img.copy(); image2pixmap(img, otherPixmaps_[1], false); @@ -120,7 +120,7 @@ ImageData::resize(int size) { for (int i=2; i<OTHER_IMAGES; i++) { image2pixmap(images_[SMALL_STONES+LARGE_STONES+i].smoothScale(size_, size_), otherPixmaps_[i]); -// otherPixmaps_[i].convertFromImage(images_[SMALL_STONES+LARGE_STONES+i].smoothScale(size_, size_), QPixmap::ColorOnly|QPixmap::OrderedDither|QPixmap::OrderedAlphaDither|QPixmap::AvoidDither); +// otherPixmaps_[i].convertFromImage(images_[SMALL_STONES+LARGE_STONES+i].smoothScale(size_, size_), TQPixmap::ColorOnly|TQPixmap::OrderedDither|TQPixmap::OrderedAlphaDither|TQPixmap::AvoidDither); } return size_; @@ -130,16 +130,16 @@ ImageData::resize(int size) { // it gives spurious dots on the floor around them void -ImageData::image2pixmap(QImage img, QPixmap& xpm, bool diffuse) { +ImageData::image2pixmap(TQImage img, TQPixmap& xpm, bool diffuse) { xpm.convertFromImage(img, (diffuse ? - (QPixmap::DiffuseDither|QPixmap::DiffuseAlphaDither) : - (QPixmap::OrderedDither|QPixmap::OrderedAlphaDither))| - QPixmap::ColorOnly|QPixmap::AvoidDither); + (TQPixmap::DiffuseDither|TQPixmap::DiffuseAlphaDither) : + (TQPixmap::OrderedDither|TQPixmap::OrderedAlphaDither))| + TQPixmap::ColorOnly|TQPixmap::AvoidDither); } void -ImageData::brighten(QImage& img) { +ImageData::brighten(TQImage& img) { assert(img.depth() == 32); for (int y=0; y<img.height(); y++) { @@ -152,8 +152,8 @@ ImageData::brighten(QImage& img) { if (r > g && r > b) { // only modify redish pixels - QColor col(r, g, b); - QColor lcol = col.light(130); + TQColor col(r, g, b); + TQColor lcol = col.light(130); img.setPixel(x, y, lcol.rgb()); } @@ -162,7 +162,7 @@ ImageData::brighten(QImage& img) { } void -ImageData::wall(QPainter &p, int x, int y, int index, bool left, bool right) { +ImageData::wall(TQPainter &p, int x, int y, int index, bool left, bool right) { if (left) p.drawPixmap(x, y, upperLarge(index-1), halfSize_); else p.drawPixmap(x, y, leftSmall(index)); @@ -173,41 +173,41 @@ ImageData::wall(QPainter &p, int x, int y, int index, bool left, bool right) { } void -ImageData::floor(QPainter &p, int x, int y) { +ImageData::floor(TQPainter &p, int x, int y) { p.eraseRect(x, y, size_, size_); } void -ImageData::goal(QPainter &p, int x, int y) { +ImageData::goal(TQPainter &p, int x, int y) { p.drawPixmap(x, y, otherPixmaps_[2]); } void -ImageData::man(QPainter &p, int x, int y) { +ImageData::man(TQPainter &p, int x, int y) { p.drawPixmap(x, y, otherPixmaps_[3]); } void -ImageData::object(QPainter &p, int x, int y) { +ImageData::object(TQPainter &p, int x, int y) { p.drawPixmap(x, y, otherPixmaps_[0]); } void -ImageData::saveman(QPainter &p, int x, int y) { +ImageData::saveman(TQPainter &p, int x, int y) { p.drawPixmap(x, y, otherPixmaps_[4]); } void -ImageData::treasure(QPainter &p, int x, int y) { +ImageData::treasure(TQPainter &p, int x, int y) { p.drawPixmap(x, y, otherPixmaps_[1]); } void -ImageData::brightObject(QPainter &p, int x, int y) { +ImageData::brightObject(TQPainter &p, int x, int y) { p.drawPixmap(x, y, brightObject_); } void -ImageData::brightTreasure(QPainter &p, int x, int y) { +ImageData::brightTreasure(TQPainter &p, int x, int y) { p.drawPixmap(x, y, brightTreasure_); } diff --git a/ksokoban/ImageData.h b/ksokoban/ImageData.h index 4e57bc7d..ae2f2a42 100644 --- a/ksokoban/ImageData.h +++ b/ksokoban/ImageData.h @@ -20,9 +20,9 @@ #ifndef IMAGEDATA_H #define IMAGEDATA_H -#include <qimage.h> -#include <qpixmap.h> -#include <qcstring.h> +#include <tqimage.h> +#include <tqpixmap.h> +#include <tqcstring.h> #include <krandomsequence.h> @@ -41,44 +41,44 @@ public: int resize(int size); int size() { return size_; } - void wall(QPainter &p, int x, int y, int index, bool left, bool right); - void floor(QPainter &p, int x, int y); - void goal(QPainter &p, int x, int y); - void man(QPainter &p, int x, int y); - void object(QPainter &p, int x, int y); - void saveman(QPainter &p, int x, int y); - void treasure(QPainter &p, int x, int y); - void brightObject(QPainter &p, int x, int y); - void brightTreasure(QPainter &p, int x, int y); + void wall(TQPainter &p, int x, int y, int index, bool left, bool right); + void floor(TQPainter &p, int x, int y); + void goal(TQPainter &p, int x, int y); + void man(TQPainter &p, int x, int y); + void object(TQPainter &p, int x, int y); + void saveman(TQPainter &p, int x, int y); + void treasure(TQPainter &p, int x, int y); + void brightObject(TQPainter &p, int x, int y); + void brightTreasure(TQPainter &p, int x, int y); - const QPixmap &background() { return background_; } - const QImage& objectImg() const { return objectImg_; } + const TQPixmap &background() { return background_; } + const TQImage& objectImg() const { return objectImg_; } protected: ImageData(); void expandIndex(int size); - void image2pixmap(QImage img, QPixmap& xpm, bool diffuse=true); - void brighten(QImage& img); + void image2pixmap(TQImage img, TQPixmap& xpm, bool diffuse=true); + void brighten(TQImage& img); - const QPixmap &upperLarge(int index); - const QPixmap &lowerLarge(int index); - const QPixmap &leftSmall(int index); - const QPixmap &rightSmall(int index); + const TQPixmap &upperLarge(int index); + const TQPixmap &lowerLarge(int index); + const TQPixmap &leftSmall(int index); + const TQPixmap &rightSmall(int index); - QImage images_[NO_OF_IMAGES]; + TQImage images_[NO_OF_IMAGES]; - QPixmap smallStone_xpm_[SMALL_STONES]; - QPixmap largeStone_xpm_[LARGE_STONES]; - QPixmap otherPixmaps_[OTHER_IMAGES]; - QPixmap background_, brightObject_, brightTreasure_; - QImage objectImg_; + TQPixmap smallStone_xpm_[SMALL_STONES]; + TQPixmap largeStone_xpm_[LARGE_STONES]; + TQPixmap otherPixmaps_[OTHER_IMAGES]; + TQPixmap background_, brightObject_, brightTreasure_; + TQImage objectImg_; int indexSize_; - QByteArray upperLargeIndex_; - QByteArray lowerLargeIndex_; - QByteArray leftSmallIndex_; - QByteArray rightSmallIndex_; + TQByteArray upperLargeIndex_; + TQByteArray lowerLargeIndex_; + TQByteArray leftSmallIndex_; + TQByteArray rightSmallIndex_; int size_, halfSize_; KRandomSequence random; diff --git a/ksokoban/InternalCollections.cpp b/ksokoban/InternalCollections.cpp index cdc3dbb3..242a724d 100644 --- a/ksokoban/InternalCollections.cpp +++ b/ksokoban/InternalCollections.cpp @@ -63,7 +63,7 @@ InternalCollections::collectionName(int _level) { } assert(false); - return QString(); + return TQString(); } diff --git a/ksokoban/InternalCollections.h b/ksokoban/InternalCollections.h index 13759da8..03e4e807 100644 --- a/ksokoban/InternalCollections.h +++ b/ksokoban/InternalCollections.h @@ -21,8 +21,8 @@ #define INTERNALCOLLECTIONS_H #include <assert.h> -#include <qstring.h> -#include <qptrvector.h> +#include <tqstring.h> +#include <tqptrvector.h> #include "LevelCollection.h" @@ -44,9 +44,9 @@ private: static int configCollection2Real(int collection); static int realCollection2Config(int collection); - static QString collectionName(int _level); + static TQString collectionName(int _level); - QPtrVector<LevelCollection> collections_; + TQPtrVector<LevelCollection> collections_; char *data_; }; diff --git a/ksokoban/LevelCollection.cpp b/ksokoban/LevelCollection.cpp index 7f5db852..a562fb35 100644 --- a/ksokoban/LevelCollection.cpp +++ b/ksokoban/LevelCollection.cpp @@ -2,7 +2,7 @@ #include "Map.h" -#include <qfile.h> +#include <tqfile.h> #include <stdio.h> #include <assert.h> @@ -146,7 +146,7 @@ LevelCollection::loadPrefs() { KConfig *cfg=(KApplication::kApplication())->config(); cfg->setGroup("settings"); - QString key; + TQString key; key.sprintf("level%d", id_); level_ = cfg->readNumEntry(key, 0); @@ -199,7 +199,7 @@ LevelCollection::addSeparator() { } LevelCollection::LevelCollection(const char *_def, int _len, - const QString &_name, int _id) : + const TQString &_name, int _id) : level_(0), completedLevels_(0), noOfLevels_(0), name_(_name), id_(_id) { @@ -213,7 +213,7 @@ LevelCollection::LevelCollection(const char *_def, int _len, loadPrefs(); } -LevelCollection::LevelCollection(const QString &_path, const QString &_name, +LevelCollection::LevelCollection(const TQString &_path, const TQString &_name, int _id) : level_(0), completedLevels_(0), noOfLevels_(0), name_(_name), path_(_path), id_(_id) { @@ -221,7 +221,7 @@ LevelCollection::LevelCollection(const QString &_path, const QString &_name, char buf[1024]; int len; - QFile file(path_); + TQFile file(path_); if (file.open(IO_Raw | IO_ReadOnly)) { while ((len = file.readBlock(buf, 1024)) > 0) { addData((const char *) buf, len); @@ -243,7 +243,7 @@ LevelCollection::~LevelCollection() { KConfig *cfg=(KApplication::kApplication())->config(); cfg->setGroup ("settings"); - QString key; + TQString key; key.sprintf("level%d", id_); cfg->writeEntry(key, level_, true, false, false); } @@ -268,7 +268,7 @@ LevelCollection::levelCompleted() { x = forward(x, 0xd4d657b4ul, 0x1ful, 0x7e129575ul); x = forward(x, 0x80ff0b94ul, 0x0eul, 0x92fc153dul); - QString key; + TQString key; key.sprintf("status%d", id_); KConfig *cfg=(KApplication::kApplication())->config(); diff --git a/ksokoban/LevelCollection.h b/ksokoban/LevelCollection.h index f01d1316..0f0b3b11 100644 --- a/ksokoban/LevelCollection.h +++ b/ksokoban/LevelCollection.h @@ -20,19 +20,19 @@ #ifndef LEVELCOLLECTION_H #define LEVELCOLLECTION_H -#include <qstring.h> -#include <qcstring.h> -#include <qptrvector.h> +#include <tqstring.h> +#include <tqcstring.h> +#include <tqptrvector.h> class Map; class LevelCollection { public: - LevelCollection(const char *_def, int _len, const QString &_name, int _id=-1); - LevelCollection(const QString &_path, const QString &_name, int _id=-1); + LevelCollection(const char *_def, int _len, const TQString &_name, int _id=-1); + LevelCollection(const TQString &_path, const TQString &_name, int _id=-1); ~LevelCollection(); - const QString &name() const { return name_; } + const TQString &name() const { return name_; } int id() const { return id_; } int level() const { return level_; } void level(int _level); @@ -51,15 +51,15 @@ private: void addData(const char* _data, unsigned _len); void addSeparator(); - QPtrVector<const char> index_; - QByteArray data_; + TQPtrVector<const char> index_; + TQByteArray data_; //int dataLen_; int level_; int completedLevels_; int noOfLevels_; - QString name_; - QString path_; + TQString name_; + TQString path_; int id_; }; diff --git a/ksokoban/LevelMap.cpp b/ksokoban/LevelMap.cpp index 954dc588..34c2a15f 100644 --- a/ksokoban/LevelMap.cpp +++ b/ksokoban/LevelMap.cpp @@ -38,7 +38,7 @@ #define BUFSIZE (128*1024) -const QString & +const TQString & LevelMap::collectionName() { return collection_->name(); } diff --git a/ksokoban/LevelMap.h b/ksokoban/LevelMap.h index ed45f1c0..7d4541c5 100644 --- a/ksokoban/LevelMap.h +++ b/ksokoban/LevelMap.h @@ -21,7 +21,7 @@ #define LEVELMAP_H #include <assert.h> -#include <qstring.h> +#include <tqstring.h> #include "Map.h" class LevelCollection; @@ -34,7 +34,7 @@ public: ~LevelMap(); LevelCollection *collection() const { return collection_; } - const QString &collectionName(); + const TQString &collectionName(); void changeCollection(LevelCollection *_collection); int totalMoves() const { return totalMoves_; } int totalPushes() const { return totalPushes_; } diff --git a/ksokoban/MainWindow.cpp b/ksokoban/MainWindow.cpp index 63654f1c..1f9ba526 100644 --- a/ksokoban/MainWindow.cpp +++ b/ksokoban/MainWindow.cpp @@ -22,19 +22,19 @@ #include <kapplication.h> #include <kconfig.h> #include <kmenubar.h> -#include <qpopupmenu.h> -#include <qkeycode.h> +#include <tqpopupmenu.h> +#include <tqkeycode.h> #include <assert.h> #include <klocale.h> -#include <qstring.h> +#include <tqstring.h> #include <kfiledialog.h> -#include <qframe.h> +#include <tqframe.h> #include <kmessagebox.h> #include <kstandarddirs.h> #include <kio/netaccess.h> #include <kiconloader.h> -#include <qiconset.h> -#include <qdragobject.h> +#include <tqiconset.h> +#include <tqdragobject.h> #include <kpopupmenu.h> #include <kurldrag.h> #include <kstdaccel.h> @@ -47,10 +47,10 @@ void MainWindow::createCollectionMenu() { - collection_ = new QPopupMenu(0,"collection menu"); + collection_ = new TQPopupMenu(0,"collection menu"); collection_->setCheckable(true); - //connect(collection_, SIGNAL(activated(int)), playField_, SLOT(changeCollection(int))); - connect(collection_, SIGNAL(activated(int)), this, SLOT(changeCollection(int))); + //connect(collection_, TQT_SIGNAL(activated(int)), playField_, TQT_SLOT(changeCollection(int))); + connect(collection_, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changeCollection(int))); for (int i=0; i<internalCollections_.collections(); i++) { collection_->insertItem(internalCollections_[i]->name(), i); @@ -72,9 +72,9 @@ MainWindow::createCollectionMenu() { MainWindow::MainWindow() : KMainWindow(0), externalCollection_(0) { int i; - QPixmap pixmap; + TQPixmap pixmap; - setEraseColor(QColor(0,0,0)); + setEraseColor(TQColor(0,0,0)); KConfig *cfg=(KApplication::kApplication())->config(); cfg->setGroup("Geometry"); @@ -88,32 +88,32 @@ MainWindow::MainWindow() : KMainWindow(0), externalCollection_(0) { menu_ = new KMenuBar(this, "menubar" ); - game_ = new QPopupMenu(0,"game menu"); + game_ = new TQPopupMenu(0,"game menu"); pixmap = SmallIcon("fileopen"); - game_->insertItem(QIconSet(pixmap), i18n("&Load Levels..."), this, SLOT(loadLevels())); + game_->insertItem(TQIconSet(pixmap), i18n("&Load Levels..."), this, TQT_SLOT(loadLevels())); pixmap = SmallIcon("forward"); - game_->insertItem(QIconSet(pixmap), i18n("&Next Level"), playField_, SLOT(nextLevel()), Key_N); + game_->insertItem(TQIconSet(pixmap), i18n("&Next Level"), playField_, TQT_SLOT(nextLevel()), Key_N); pixmap = SmallIcon("back"); - game_->insertItem(QIconSet(pixmap), i18n("&Previous Level"), playField_, SLOT(previousLevel()), Key_P); + game_->insertItem(TQIconSet(pixmap), i18n("&Previous Level"), playField_, TQT_SLOT(previousLevel()), Key_P); pixmap = SmallIcon("reload"); - game_->insertItem(QIconSet(pixmap), i18n("Re&start Level"), playField_, SLOT(restartLevel()), Key_Escape); + game_->insertItem(TQIconSet(pixmap), i18n("Re&start Level"), playField_, TQT_SLOT(restartLevel()), Key_Escape); createCollectionMenu(); game_->insertItem(i18n("&Level Collection"), collection_); pixmap = SmallIcon("undo"); - game_->insertItem(QIconSet(pixmap), i18n("&Undo"), playField_, SLOT(undo()),QKeySequence( (KStdAccel::undo()).toString())); + game_->insertItem(TQIconSet(pixmap), i18n("&Undo"), playField_, TQT_SLOT(undo()),TQKeySequence( (KStdAccel::undo()).toString())); pixmap = SmallIcon("redo"); - game_->insertItem(QIconSet(pixmap), i18n("&Redo"), playField_, SLOT(redo()), QKeySequence( (KStdAccel::redo()).toString())); + game_->insertItem(TQIconSet(pixmap), i18n("&Redo"), playField_, TQT_SLOT(redo()), TQKeySequence( (KStdAccel::redo()).toString())); game_->insertSeparator(); pixmap = SmallIcon("exit"); - game_->insertItem(QIconSet(pixmap), i18n("&Quit"), KApplication::kApplication(), SLOT(closeAllWindows()), QKeySequence( (KStdAccel::quit()).toString())); + game_->insertItem(TQIconSet(pixmap), i18n("&Quit"), KApplication::kApplication(), TQT_SLOT(closeAllWindows()), TQKeySequence( (KStdAccel::quit()).toString())); menu_->insertItem(i18n("&Game"), game_); - animation_ = new QPopupMenu(0,"animation menu"); + animation_ = new TQPopupMenu(0,"animation menu"); animation_->setCheckable(true); - connect(animation_, SIGNAL(activated(int)), this, SLOT(updateAnimMenu(int))); - connect(animation_, SIGNAL(activated(int)), playField_, SLOT(changeAnim(int))); + connect(animation_, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateAnimMenu(int))); + connect(animation_, TQT_SIGNAL(activated(int)), playField_, TQT_SLOT(changeAnim(int))); animation_->insertItem(i18n("&Slow"), 3); animation_->insertItem(i18n("&Medium"), 2); animation_->insertItem(i18n("&Fast"), 1); @@ -123,54 +123,54 @@ MainWindow::MainWindow() : KMainWindow(0), externalCollection_(0) { menu_->insertItem(i18n("&Animation"), animation_); pixmap = SmallIcon("bookmark_add"); - bookmarkMenu_ = new QPopupMenu(0,"bookmarks menu"); - setBM_ = new QPopupMenu(0, "set bookmark menu"); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 1); + bookmarkMenu_ = new TQPopupMenu(0,"bookmarks menu"); + setBM_ = new TQPopupMenu(0, "set bookmark menu"); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 1); setBM_->setAccel(CTRL+Key_1, 1); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 2); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 2); setBM_->setAccel(CTRL+Key_2, 2); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 3); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 3); setBM_->setAccel(CTRL+Key_3, 3); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 4); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 4); setBM_->setAccel(CTRL+Key_4, 4); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 5); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 5); setBM_->setAccel(CTRL+Key_5, 5); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 6); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 6); setBM_->setAccel(CTRL+Key_6, 6); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 7); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 7); setBM_->setAccel(CTRL+Key_7, 7); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 8); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 8); setBM_->setAccel(CTRL+Key_8, 8); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 9); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 9); setBM_->setAccel(CTRL+Key_9, 9); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 10); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 10); setBM_->setAccel(CTRL+Key_0, 10); - connect(setBM_, SIGNAL(activated(int)), this, SLOT(setBookmark(int))); + connect(setBM_, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setBookmark(int))); bookmarkMenu_->insertItem(i18n("&Set Bookmark"), setBM_); pixmap = SmallIcon("bookmark"); - goToBM_ = new QPopupMenu(0, "go to bookmark menu"); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 1); + goToBM_ = new TQPopupMenu(0, "go to bookmark menu"); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 1); goToBM_->setAccel(Key_1, 1); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 2); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 2); goToBM_->setAccel(Key_2, 2); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 3); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 3); goToBM_->setAccel(Key_3, 3); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 4); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 4); goToBM_->setAccel(Key_4, 4); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 5); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 5); goToBM_->setAccel(Key_5, 5); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 6); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 6); goToBM_->setAccel(Key_6, 6); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 7); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 7); goToBM_->setAccel(Key_7, 7); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 8); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 8); goToBM_->setAccel(Key_8, 8); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 9); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 9); goToBM_->setAccel(Key_9, 9); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 10); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 10); goToBM_->setAccel(Key_0, 10); - connect(goToBM_, SIGNAL(activated(int)), this, SLOT(goToBookmark(int))); + connect(goToBM_, TQT_SIGNAL(activated(int)), this, TQT_SLOT(goToBookmark(int))); bookmarkMenu_->insertItem(i18n("&Go to Bookmark"), goToBM_); menu_->insertItem(i18n("&Bookmarks"), bookmarkMenu_); @@ -179,7 +179,7 @@ MainWindow::MainWindow() : KMainWindow(0), externalCollection_(0) { updateBookmark(i); } - help_ = helpMenu(QString::null, false); + help_ = helpMenu(TQString::null, false); menu_->insertSeparator(); menu_->insertItem(i18n("&Help"), help_); @@ -222,7 +222,7 @@ MainWindow::~MainWindow() void -MainWindow::focusInEvent(QFocusEvent *) { +MainWindow::focusInEvent(TQFocusEvent *) { playField_->setFocus(); } @@ -241,12 +241,12 @@ MainWindow::updateBookmark(int num) { if (col < 0 || lev < 0) return; - QString name; + TQString name; if (col >= 0 && col < internalCollections_.collections()) name = internalCollections_[col]->name(); else name = i18n("(invalid)"); - QString l; + TQString l; l.setNum(lev+1); name += " #" + l; l.setNum(mov); @@ -299,7 +299,7 @@ void MainWindow::loadLevels() { KConfig *cfg=(KApplication::kApplication())->config(); cfg->setGroup("settings"); - QString lastFile = cfg->readPathEntry("lastLevelFile"); + TQString lastFile = cfg->readPathEntry("lastLevelFile"); KURL result = KFileDialog::getOpenURL(lastFile, "*", this, i18n("Load Levels From File")); if (result.isEmpty()) return; @@ -312,10 +312,10 @@ MainWindow::openURL(KURL _url) { KConfig *cfg=(KApplication::kApplication())->config(); // int namepos = _url.path().findRev('/') + 1; // NOTE: findRev can return -1 -// QString levelName = _url.path().mid(namepos); - QString levelName = _url.fileName(); +// TQString levelName = _url.path().mid(namepos); + TQString levelName = _url.fileName(); - QString levelFile; + TQString levelFile; if (_url.isLocalFile()) { levelFile = _url.path(); } else { @@ -347,15 +347,15 @@ MainWindow::openURL(KURL _url) { } void -MainWindow::dragEnterEvent(QDragEnterEvent* event) { +MainWindow::dragEnterEvent(TQDragEnterEvent* event) { event->accept(KURLDrag::canDecode(event)); } void -MainWindow::dropEvent(QDropEvent* event) { +MainWindow::dropEvent(TQDropEvent* event) { KURL::List urls; if (KURLDrag::decode(event, urls)) { -// kdDebug() << "MainWindow:Handling QUriDrag..." << endl; +// kdDebug() << "MainWindow:Handling TQUriDrag..." << endl; if (urls.count() > 0) { const KURL &url = urls.first(); openURL(url); diff --git a/ksokoban/MainWindow.h b/ksokoban/MainWindow.h index 202afd13..19ff4060 100644 --- a/ksokoban/MainWindow.h +++ b/ksokoban/MainWindow.h @@ -50,10 +50,10 @@ public slots: void loadLevels(); protected: - void focusInEvent(QFocusEvent*); + void focusInEvent(TQFocusEvent*); void createCollectionMenu(); - virtual void dragEnterEvent(QDragEnterEvent*); - virtual void dropEvent(QDropEvent*); + virtual void dragEnterEvent(TQDragEnterEvent*); + virtual void dropEvent(TQDropEvent*); private: InternalCollections internalCollections_; @@ -63,13 +63,13 @@ private: Bookmark *bookmarks_[10]; int currentCollection_; - QPopupMenu *game_; - QPopupMenu *collection_; - QPopupMenu *animation_; - QPopupMenu *bookmarkMenu_; - QPopupMenu *setBM_; - QPopupMenu *goToBM_; - QPopupMenu *help_; + TQPopupMenu *game_; + TQPopupMenu *collection_; + TQPopupMenu *animation_; + TQPopupMenu *bookmarkMenu_; + TQPopupMenu *setBM_; + TQPopupMenu *goToBM_; + TQPopupMenu *help_; int checkedCollection_; int checkedAnim_; diff --git a/ksokoban/ModalLabel.cpp b/ksokoban/ModalLabel.cpp index 1ed55dcf..c0ccbbad 100644 --- a/ksokoban/ModalLabel.cpp +++ b/ksokoban/ModalLabel.cpp @@ -19,23 +19,23 @@ #include "ModalLabel.h" -#include <qlabel.h> -#include <qfont.h> +#include <tqlabel.h> +#include <tqfont.h> #include <kapplication.h> #include <kglobalsettings.h> -#include <qwidgetlist.h> -#include <qstring.h> +#include <tqwidgetlist.h> +#include <tqstring.h> #include "ModalLabel.moc" -ModalLabel::ModalLabel(const QString &text, QWidget *parent, +ModalLabel::ModalLabel(const TQString &text, TQWidget *parent, const char *name, WFlags f) - : QLabel(text, parent, name, f) { - QFont font(KGlobalSettings::generalFont().family(), 24, QFont::Bold); - QFontMetrics fontMet(font); + : TQLabel(text, parent, name, f) { + TQFont font(KGlobalSettings::generalFont().family(), 24, TQFont::Bold); + TQFontMetrics fontMet(font); - QString currentLine; - QRect bounds; + TQString currentLine; + TQRect bounds; int lineLen, width=0, height=0; for (int linePos=0; linePos < (int) text.length(); linePos += lineLen+1) { @@ -58,15 +58,15 @@ ModalLabel::ModalLabel(const QString &text, QWidget *parent, if (height < 75) height = 75; setAlignment (AlignCenter); - setFrameStyle (QFrame::Panel | QFrame::Raised); + setFrameStyle (TQFrame::Panel | TQFrame::Raised); setLineWidth (4); setFont (font); move (parent->width ()/2 - width/2, parent->height ()/2 - height/2); resize (width, height); show (); - QWidgetList *list = QApplication::allWidgets(); - QWidgetListIt it( *list ); + TQWidgetList *list = TQApplication::allWidgets(); + TQWidgetListIt it( *list ); while (it.current()) { it.current()->installEventFilter (this); ++it; @@ -78,25 +78,25 @@ ModalLabel::ModalLabel(const QString &text, QWidget *parent, } void -ModalLabel::timerEvent (QTimerEvent *) { +ModalLabel::timerEvent (TQTimerEvent *) { completed_ = true; } bool -ModalLabel::eventFilter (QObject *, QEvent *e) { +ModalLabel::eventFilter (TQObject *, TQEvent *e) { switch (e->type()) { - case QEvent::MouseButtonPress: - case QEvent::MouseButtonRelease: - case QEvent::MouseButtonDblClick: - case QEvent::MouseMove: - case QEvent::KeyPress: - case QEvent::KeyRelease: - case QEvent::Accel: - //case QEvent::DragEnter: - case QEvent::DragMove: - case QEvent::DragLeave: - case QEvent::Drop: - //case QEvent::DragResponse: + case TQEvent::MouseButtonPress: + case TQEvent::MouseButtonRelease: + case TQEvent::MouseButtonDblClick: + case TQEvent::MouseMove: + case TQEvent::KeyPress: + case TQEvent::KeyRelease: + case TQEvent::Accel: + //case TQEvent::DragEnter: + case TQEvent::DragMove: + case TQEvent::DragLeave: + case TQEvent::Drop: + //case TQEvent::DragResponse: //kdDebug << "Ate event" << endl; return true; @@ -107,7 +107,7 @@ ModalLabel::eventFilter (QObject *, QEvent *e) { } void -ModalLabel::message (const QString &text, QWidget *parent) { +ModalLabel::message (const TQString &text, TQWidget *parent) { KApplication *app = KApplication::kApplication (); ModalLabel cl (text, parent); diff --git a/ksokoban/ModalLabel.h b/ksokoban/ModalLabel.h index 4b35a82a..2fd010e9 100644 --- a/ksokoban/ModalLabel.h +++ b/ksokoban/ModalLabel.h @@ -20,19 +20,19 @@ #ifndef MODALLABEL_H #define MODALLABEL_H -#include <qlabel.h> +#include <tqlabel.h> -class ModalLabel : public QLabel { +class ModalLabel : public TQLabel { Q_OBJECT public: - static void message (const QString &text, QWidget *parent); + static void message (const TQString &text, TQWidget *parent); - void timerEvent (QTimerEvent *); - bool eventFilter (QObject *, QEvent *); + void timerEvent (TQTimerEvent *); + bool eventFilter (TQObject *, TQEvent *); bool completed_; protected: - ModalLabel (const QString &text, QWidget *parent, const char *name=0, WFlags f=0); + ModalLabel (const TQString &text, TQWidget *parent, const char *name=0, WFlags f=0); }; diff --git a/ksokoban/Move.cpp b/ksokoban/Move.cpp index 22773774..449e9b0e 100644 --- a/ksokoban/Move.cpp +++ b/ksokoban/Move.cpp @@ -56,7 +56,7 @@ Move::finish () { } void -Move::save (QString &s) { +Move::save (TQString &s) { static const char move1[] = "lrud"; static const char push1[] = "LRUD"; static const char move2[] = "wens"; diff --git a/ksokoban/Move.h b/ksokoban/Move.h index ad6b3eed..129e8607 100644 --- a/ksokoban/Move.h +++ b/ksokoban/Move.h @@ -21,7 +21,7 @@ #define MOVE_H #include <assert.h> -#include <qstring.h> +#include <tqstring.h> #include "Map.h" class LevelMap; @@ -106,7 +106,7 @@ public: int finalY () const { return (moves_[moveIndex_-1]>>8)&0x7f; } - void save (QString &_str); + void save (TQString &_str); const char *load (const char *_str); bool redo (LevelMap *map); bool undo (LevelMap *map); diff --git a/ksokoban/PlayField.cpp b/ksokoban/PlayField.cpp index 4d98d309..f277192e 100644 --- a/ksokoban/PlayField.cpp +++ b/ksokoban/PlayField.cpp @@ -20,13 +20,13 @@ #include <stdio.h> #include <assert.h> -#include <qwidget.h> -#include <qpixmap.h> -#include <qkeycode.h> +#include <tqwidget.h> +#include <tqpixmap.h> +#include <tqkeycode.h> #include <kconfig.h> #include <kapplication.h> #include <klocale.h> -#include <qpainter.h> +#include <tqpainter.h> #include <kmessagebox.h> #include <kglobalsettings.h> @@ -45,16 +45,16 @@ #include "PlayField.moc" -PlayField::PlayField(QWidget *parent, const char *name, WFlags f) - : QWidget(parent, name, f|WResizeNoErase), imageData_(0), lastLevel_(-1), +PlayField::PlayField(TQWidget *parent, const char *name, WFlags f) + : TQWidget(parent, name, f|WResizeNoErase), imageData_(0), lastLevel_(-1), moveSequence_(0), moveInProgress_(false), dragInProgress_(false), xOffs_(0), yOffs_(0), wheelDelta_(0), levelText_(i18n("Level:")), stepsText_(i18n("Steps:")), pushesText_(i18n("Pushes:")), - statusFont_(KGlobalSettings::generalFont().family(), 18, QFont::Bold), statusMetrics_(statusFont_) { + statusFont_(KGlobalSettings::generalFont().family(), 18, TQFont::Bold), statusMetrics_(statusFont_) { - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(TQWidget::StrongFocus); setFocus(); setBackgroundMode(Qt::NoBackground); setMouseTracking(true); @@ -72,7 +72,7 @@ PlayField::PlayField(QWidget *parent, const char *name, WFlags f) history_ = new History; background_.setPixmap(imageData_->background()); - floor_ = QColor(0x66,0x66,0x66); + floor_ = TQColor(0x66,0x66,0x66); levelMap_ = new LevelMap; mapDelta_ = new MapDelta(levelMap_); @@ -93,7 +93,7 @@ PlayField::~PlayField() { } void -PlayField::changeCursor(const QCursor* c) { +PlayField::changeCursor(const TQCursor* c) { if (cursor_ == c) return; cursor_ = c; @@ -107,9 +107,9 @@ PlayField::level() const { return levelMap_->level(); } -const QString & +const TQString & PlayField::collectionName() { - static QString error = "????"; + static TQString error = "????"; if (levelMap_ == 0) return error; return levelMap_->collectionName(); } @@ -140,7 +140,7 @@ PlayField::levelChange() { } void -PlayField::paintSquare(int x, int y, QPainter &paint) { +PlayField::paintSquare(int x, int y, TQPainter &paint) { if (levelMap_->xpos() == x && levelMap_->ypos() == y) { if (levelMap_->goal(x, y)) imageData_->saveman(paint, x2pixel(x), y2pixel(y)); @@ -185,7 +185,7 @@ PlayField::paintSquare(int x, int y, QPainter &paint) { void PlayField::paintDelta() { - QPainter paint(this); + TQPainter paint(this); // the following line is a workaround for a bug in Qt 2.0.1 // (and possibly earlier versions) @@ -201,8 +201,8 @@ PlayField::paintDelta() { void -PlayField::paintEvent(QPaintEvent *e) { - QPainter paint(this); +PlayField::paintEvent(TQPaintEvent *e) { + TQPainter paint(this); // the following line is a workaround for a bug in Qt 2.0.1 // (and possibly earlier versions) @@ -215,8 +215,8 @@ PlayField::paintEvent(QPaintEvent *e) { } void -PlayField::paintPainterClip(QPainter &paint, int x, int y, int w, int h) { - QRect rect(x, y, w, h); +PlayField::paintPainterClip(TQPainter &paint, int x, int y, int w, int h) { + TQRect rect(x, y, w, h); paint.setClipRect(rect); paint.setClipping(true); @@ -224,7 +224,7 @@ PlayField::paintPainterClip(QPainter &paint, int x, int y, int w, int h) { } void -PlayField::paintPainter(QPainter &paint, const QRect &rect) { +PlayField::paintPainter(TQPainter &paint, const TQRect &rect) { if (size_ <= 0) return; int minx = pixel2x(rect.x()); int miny = pixel2y(rect.y()); @@ -272,12 +272,12 @@ PlayField::paintPainter(QPainter &paint, const QRect &rect) { } void -PlayField::resizeEvent(QResizeEvent *e) { +PlayField::resizeEvent(TQResizeEvent *e) { setSize(e->size().width(), e->size().height()); } void -PlayField::mouseMoveEvent(QMouseEvent *e) { +PlayField::mouseMoveEvent(TQMouseEvent *e) { lastMouseXPos_ = e->x(); lastMouseYPos_ = e->y(); @@ -309,11 +309,11 @@ PlayField::mouseMoveEvent(QMouseEvent *e) { if (dragX_ == old_x && dragY_ == old_y) return; - QRect rect(dragX_, dragY_, size_, size_); + TQRect rect(dragX_, dragY_, size_, size_); dragXpm_.resize(size_, size_); - QPainter paint; + TQPainter paint; paint.begin(&dragXpm_); paint.setBackgroundColor(backgroundColor()); paint.setBrushOrigin(- dragX_, - dragY_); @@ -358,19 +358,19 @@ PlayField::mouseMoveEvent(QMouseEvent *e) { int y2 = old_y; if (dy > 0) { paintPainterClip(paint, old_x, old_y, size_, dy); - // NOTE: clipping is now activated in the QPainter paint + // NOTE: clipping is now activated in the TQPainter paint y2 += dy; } else if (dy < 0) { paintPainterClip(paint, old_x, old_y+size_+dy, size_, -dy); - // NOTE: clipping is now activated in the QPainter paint + // NOTE: clipping is now activated in the TQPainter paint dy = -dy; } if (dx > 0) { paintPainterClip(paint, old_x, y2, dx, size_-dy); - // NOTE: clipping is now activated in the QPainter paint + // NOTE: clipping is now activated in the TQPainter paint } else if (dx < 0) { paintPainterClip(paint, old_x+size_+dx, y2, -dx, size_-dy); - // NOTE: clipping is now activated in the QPainter paint + // NOTE: clipping is now activated in the TQPainter paint } } paint.end(); @@ -390,7 +390,7 @@ PlayField::highlight() { if (x == highlightX_ && y == highlightY_) return; if (pathFinder_.canDrag(x, y)) { - QPainter paint(this); + TQPainter paint(this); if (highlightX_ >= 0) { int x = highlightX_, y = highlightY_; @@ -409,7 +409,7 @@ PlayField::highlight() { if (pathFinder_.canWalkTo(x, y)) changeCursor(&crossCursor); else changeCursor(0); if (highlightX_ >= 0) { - QPainter paint(this); + TQPainter paint(this); int x = highlightX_, y = highlightY_; highlightX_ = -1; @@ -428,7 +428,7 @@ PlayField::stopMoving() { updateStepsXpm(); updatePushesXpm(); - QPainter paint(this); + TQPainter paint(this); paint.drawPixmap(snumRect_.x(), snumRect_.y(), snumXpm_); paint.drawPixmap(pnumRect_.x(), pnumRect_.y(), pnumXpm_); @@ -453,7 +453,7 @@ PlayField::startMoving(MoveSequence *ms) { } void -PlayField::timerEvent(QTimerEvent *) { +PlayField::timerEvent(TQTimerEvent *) { assert(moveInProgress_); if (moveSequence_ == 0) { killTimers(); @@ -559,7 +559,7 @@ PlayField::push(int _x, int _y) { } void -PlayField::keyPressEvent(QKeyEvent * e) { +PlayField::keyPressEvent(TQKeyEvent * e) { int x=levelMap_->xpos(); int y=levelMap_->ypos(); @@ -626,7 +626,7 @@ PlayField::keyPressEvent(QKeyEvent * e) { case Key_S: { - QString buf; + TQString buf; history_->save(buf); printf("%s\n", (char *) buf); } @@ -667,7 +667,7 @@ PlayField::stopDrag() { changeCursor(0); - QPainter paint(this); + TQPainter paint(this); // the following line is a workaround for a bug in Qt 2.0.1 // (and possibly earlier versions) @@ -677,7 +677,7 @@ PlayField::stopDrag() { paintSquare(x, y, paint); paintPainterClip(paint, dragX_, dragY_, size_, size_); - // NOTE: clipping is now activated in the QPainter paint + // NOTE: clipping is now activated in the TQPainter paint dragInProgress_ = false; } @@ -696,7 +696,7 @@ PlayField::dragObject(int xpixel, int ypixel) { void -PlayField::mousePressEvent(QMouseEvent *e) { +PlayField::mousePressEvent(TQMouseEvent *e) { if (!canMoveNow()) return; if (dragInProgress_) { @@ -712,7 +712,7 @@ PlayField::mousePressEvent(QMouseEvent *e) { return; if (e->button() == LeftButton && pathFinder_.canDrag(x, y)) { - QPainter paint(this); + TQPainter paint(this); changeCursor(&sizeAllCursor); if (levelMap_->goal(x, y)) @@ -754,7 +754,7 @@ PlayField::mousePressEvent(QMouseEvent *e) { } void -PlayField::wheelEvent(QWheelEvent *e) { +PlayField::wheelEvent(TQWheelEvent *e) { wheelDelta_ += e->delta(); if (wheelDelta_ >= 120) { @@ -767,23 +767,23 @@ PlayField::wheelEvent(QWheelEvent *e) { } void -PlayField::mouseReleaseEvent(QMouseEvent *e) { +PlayField::mouseReleaseEvent(TQMouseEvent *e) { if (dragInProgress_) dragObject(e->x(), e->y()); } void -PlayField::focusInEvent(QFocusEvent *) { +PlayField::focusInEvent(TQFocusEvent *) { //printf("PlayField::focusInEvent\n"); } void -PlayField::focusOutEvent(QFocusEvent *) { +PlayField::focusOutEvent(TQFocusEvent *) { //printf("PlayField::focusOutEvent\n"); } void -PlayField::leaveEvent(QEvent *) { +PlayField::leaveEvent(TQEvent *) { stopDrag(); } @@ -908,12 +908,12 @@ void PlayField::updateCollectionXpm() { if (collXpm_.isNull()) return; - QPainter paint(&collXpm_); + TQPainter paint(&collXpm_); paint.setBrushOrigin(- collRect_.x(), - collRect_.y()); paint.fillRect(0, 0, collRect_.width(), collRect_.height(), background_); paint.setFont(statusFont_); - paint.setPen(QColor(0,255,0)); + paint.setPen(TQColor(0,255,0)); paint.drawText(0, 0, collRect_.width(), collRect_.height(), AlignLeft, collectionName()); } @@ -922,13 +922,13 @@ void PlayField::updateTextXpm() { if (ltxtXpm_.isNull()) return; - QPainter paint; + TQPainter paint; paint.begin(<xtXpm_); paint.setBrushOrigin(- ltxtRect_.x(), - ltxtRect_.y()); paint.fillRect(0, 0, ltxtRect_.width(), ltxtRect_.height(), background_); paint.setFont(statusFont_); - paint.setPen(QColor(128,128,128)); + paint.setPen(TQColor(128,128,128)); paint.drawText(0, 0, ltxtRect_.width(), ltxtRect_.height(), AlignLeft, levelText_); paint.end(); @@ -936,7 +936,7 @@ PlayField::updateTextXpm() { paint.setBrushOrigin(- stxtRect_.x(), - stxtRect_.y()); paint.fillRect(0, 0, stxtRect_.width(), stxtRect_.height(), background_); paint.setFont(statusFont_); - paint.setPen(QColor(128,128,128)); + paint.setPen(TQColor(128,128,128)); paint.drawText(0, 0, stxtRect_.width(), stxtRect_.height(), AlignLeft, stepsText_); paint.end(); @@ -944,7 +944,7 @@ PlayField::updateTextXpm() { paint.setBrushOrigin(- ptxtRect_.x(), - ptxtRect_.y()); paint.fillRect(0, 0, ptxtRect_.width(), ptxtRect_.height(), background_); paint.setFont(statusFont_); - paint.setPen(QColor(128,128,128)); + paint.setPen(TQColor(128,128,128)); paint.drawText(0, 0, ptxtRect_.width(), ptxtRect_.height(), AlignLeft, pushesText_); paint.end(); } @@ -953,13 +953,13 @@ void PlayField::updateLevelXpm() { if (lnumXpm_.isNull()) return; - QPainter paint(&lnumXpm_); + TQPainter paint(&lnumXpm_); paint.setBrushOrigin(- lnumRect_.x(), - lnumRect_.y()); paint.fillRect(0, 0, lnumRect_.width(), lnumRect_.height(), background_); - QString str; + TQString str; paint.setFont(statusFont_); - paint.setPen(QColor(255,0,0)); + paint.setPen(TQColor(255,0,0)); paint.drawText(0, 0, lnumRect_.width(), lnumRect_.height(), AlignLeft, str.sprintf("%05d", level()+1)); } @@ -968,13 +968,13 @@ void PlayField::updateStepsXpm() { if (snumXpm_.isNull()) return; - QPainter paint(&snumXpm_); + TQPainter paint(&snumXpm_); paint.setBrushOrigin(- snumRect_.x(), - snumRect_.y()); paint.fillRect(0, 0, snumRect_.width(), snumRect_.height(), background_); - QString str; + TQString str; paint.setFont(statusFont_); - paint.setPen(QColor(255,0,0)); + paint.setPen(TQColor(255,0,0)); paint.drawText(0, 0, snumRect_.width(), snumRect_.height(), AlignLeft, str.sprintf("%05d", totalMoves())); } @@ -983,13 +983,13 @@ void PlayField::updatePushesXpm() { if (pnumXpm_.isNull()) return; - QPainter paint(&pnumXpm_); + TQPainter paint(&pnumXpm_); paint.setBrushOrigin(- pnumRect_.x(), - pnumRect_.y()); paint.fillRect(0, 0, pnumRect_.width(), pnumRect_.height(), background_); - QString str; + TQString str; paint.setFont(statusFont_); - paint.setPen(QColor(255,0,0)); + paint.setPen(TQColor(255,0,0)); paint.drawText(0, 0, pnumRect_.width(), pnumRect_.height(), AlignLeft, str.sprintf("%05d", totalPushes())); } diff --git a/ksokoban/PlayField.h b/ksokoban/PlayField.h index 57524ea8..0066442a 100644 --- a/ksokoban/PlayField.h +++ b/ksokoban/PlayField.h @@ -20,13 +20,13 @@ #ifndef PLAYFIELD_H #define PLAYFIELD_H -#include <qwidget.h> -#include <qstring.h> -#include <qfont.h> -#include <qfontmetrics.h> -#include <qpixmap.h> -#include <qimage.h> -#include <qbrush.h> +#include <tqwidget.h> +#include <tqstring.h> +#include <tqfont.h> +#include <tqfontmetrics.h> +#include <tqpixmap.h> +#include <tqimage.h> +#include <tqbrush.h> #include "ImageData.h" #include "LevelMap.h" @@ -41,10 +41,10 @@ class LevelCollection; class QPainter; class QCursor; -class PlayField : public QWidget { +class PlayField : public TQWidget { Q_OBJECT public: - PlayField(QWidget *parent, const char *name=0, WFlags f=0); + PlayField(TQWidget *parent, const char *name=0, WFlags f=0); ~PlayField (); bool canMoveNow(); @@ -57,7 +57,7 @@ public: void goToBookmark(Bookmark *bm); int level() const; - const QString &collectionName(); + const TQString &collectionName(); int totalMoves() const; int totalPushes() const; @@ -87,30 +87,30 @@ protected: bool dragInProgress_; PathFinder pathFinder_; int animDelay_; - const QCursor* cursor_; + const TQCursor* cursor_; void levelChange (); - void paintSquare (int x, int y, QPainter &paint); + void paintSquare (int x, int y, TQPainter &paint); void paintDelta (); - void paintEvent (QPaintEvent *e); - void paintPainterClip(QPainter& paint, int x, int y, int w, int h); - void paintPainter(QPainter& paint, const QRect& rect); - void resizeEvent (QResizeEvent *e); - void mouseMoveEvent(QMouseEvent* e); - void keyPressEvent (QKeyEvent *); - void focusInEvent (QFocusEvent *); - void focusOutEvent (QFocusEvent *); - void mousePressEvent (QMouseEvent *); - void mouseReleaseEvent(QMouseEvent*); - void leaveEvent(QEvent*); - void wheelEvent (QWheelEvent *); + void paintEvent (TQPaintEvent *e); + void paintPainterClip(TQPainter& paint, int x, int y, int w, int h); + void paintPainter(TQPainter& paint, const TQRect& rect); + void resizeEvent (TQResizeEvent *e); + void mouseMoveEvent(TQMouseEvent* e); + void keyPressEvent (TQKeyEvent *); + void focusInEvent (TQFocusEvent *); + void focusOutEvent (TQFocusEvent *); + void mousePressEvent (TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent*); + void leaveEvent(TQEvent*); + void wheelEvent (TQWheelEvent *); void step (int _x, int _y); void push (int _x, int _y); - virtual void timerEvent (QTimerEvent *); + virtual void timerEvent (TQTimerEvent *); void stopDrag(); void dragObject(int xpixel, int ypixel); void highlight(); - void changeCursor(const QCursor* c); + void changeCursor(const TQCursor* c); void eatKeyPressEvents(); private: @@ -131,18 +131,18 @@ private: void startMoving (MoveSequence *ms); void stopMoving (); - QRect pnumRect_, ptxtRect_, snumRect_, stxtRect_, lnumRect_, ltxtRect_; - QRect collRect_; - - const QString levelText_, stepsText_, pushesText_; - QPixmap pnumXpm_, ptxtXpm_, snumXpm_, stxtXpm_, lnumXpm_, ltxtXpm_; - QPixmap collXpm_; - QPixmap dragXpm_; - QImage dragImage_; - QFont statusFont_; - QFontMetrics statusMetrics_; - QBrush background_; - QBrush floor_; + TQRect pnumRect_, ptxtRect_, snumRect_, stxtRect_, lnumRect_, ltxtRect_; + TQRect collRect_; + + const TQString levelText_, stepsText_, pushesText_; + TQPixmap pnumXpm_, ptxtXpm_, snumXpm_, stxtXpm_, lnumXpm_, ltxtXpm_; + TQPixmap collXpm_; + TQPixmap dragXpm_; + TQImage dragImage_; + TQFont statusFont_; + TQFontMetrics statusMetrics_; + TQBrush background_; + TQBrush floor_; }; diff --git a/ksokoban/main.cpp b/ksokoban/main.cpp index 9c997613..d55c6ce9 100644 --- a/ksokoban/main.cpp +++ b/ksokoban/main.cpp @@ -60,7 +60,7 @@ main (int argc, char **argv) // if (!KUniqueApplication::start()) // return 0; - QApplication::setColorSpec(QApplication::ManyColor); + TQApplication::setColorSpec(TQApplication::ManyColor); // KUniqueApplication app; KApplication app; @@ -76,7 +76,7 @@ main (int argc, char **argv) } args->clear(); - QObject::connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); + TQObject::connect(&app, TQT_SIGNAL(lastWindowClosed()), &app, TQT_SLOT(quit())); int rc = app.exec(); diff --git a/kspaceduel/ai.cpp b/kspaceduel/ai.cpp index 5a7bec20..828c5e35 100644 --- a/kspaceduel/ai.cpp +++ b/kspaceduel/ai.cpp @@ -10,8 +10,8 @@ int Ai::calcShotDirections[Options::EnumAiDifficulty::COUNT] = {4,7,10,12}; int Ai::calcCollisions[Options::EnumAiDifficulty::COUNT] = {30,15,10,10}; int Ai::calcNextShot[Options::EnumAiDifficulty::COUNT] = {300,200,90,60}; -Ai::Ai(int pn,ShipSprite* s[2],QPtrList<BulletSprite>* b[2], - QPtrList<MineSprite>* m[2],SConfig *c) +Ai::Ai(int pn,ShipSprite* s[2],TQPtrList<BulletSprite>* b[2], + TQPtrList<MineSprite>* m[2],SConfig *c) { int i; @@ -24,9 +24,9 @@ Ai::Ai(int pn,ShipSprite* s[2],QPtrList<BulletSprite>* b[2], ship[i]=s[i]; bullets[i]=b[i]; mines[i]=m[i]; - shipsNextPositions[i]=new QMemArray<AiSprite> + shipsNextPositions[i]=new TQMemArray<AiSprite> ((int)(calcPositionNumber[Options::aiDifficulty(playerNumber)]/cfg->gamespeed)); - aiMines[i]=new QMemArray<AiSprite>(cfg->maxMines); + aiMines[i]=new TQMemArray<AiSprite>(cfg->maxMines); mineNumber[i]=0; } myShots.setAutoDelete(true); @@ -158,7 +158,7 @@ AiSprite Ai::nextPosition(AiSprite sp,double mult) return sp; } -void Ai::nextPositions(AiSprite sp,QMemArray<AiSprite> *a,int frames) +void Ai::nextPositions(AiSprite sp,TQMemArray<AiSprite> *a,int frames) { int i,num; double fmult=cfg->gamespeed*frames; diff --git a/kspaceduel/ai.h b/kspaceduel/ai.h index 0369ea02..8e258d6a 100644 --- a/kspaceduel/ai.h +++ b/kspaceduel/ai.h @@ -3,8 +3,8 @@ #include <krandomsequence.h> -#include <qptrlist.h> -#include <qmemarray.h> +#include <tqptrlist.h> +#include <tqmemarray.h> #include "sprites.h" #include "dialogs.h" @@ -39,8 +39,8 @@ struct Shot class Ai { public: - Ai(int pn,ShipSprite* s[2],QPtrList<BulletSprite> *b[2], - QPtrList<MineSprite> *m[2],SConfig *c); + Ai(int pn,ShipSprite* s[2],TQPtrList<BulletSprite> *b[2], + TQPtrList<MineSprite> *m[2],SConfig *c); void newRound(); void think(); bool rotateLeft(){return rotation==RLEFT;} @@ -50,7 +50,7 @@ public: bool layMine(){return mine;} private: AiSprite nextPosition(AiSprite sp,double mult); - void nextPositions(AiSprite sp,QMemArray<AiSprite> *a,int frames); + void nextPositions(AiSprite sp,TQMemArray<AiSprite> *a,int frames); Hit firstObject(AiSprite shot,int shotframes,int frames); void shotScores(); void calculateNextPositions(); @@ -74,15 +74,15 @@ private: //sprites int playerNumber,opponentNumber; ShipSprite *ship[2]; - QPtrList<BulletSprite> *bullets[2]; - QPtrList<MineSprite> *mines[2]; - QMemArray<AiSprite> *shipsNextPositions[2]; - QMemArray<AiSprite> *aiMines[2]; + TQPtrList<BulletSprite> *bullets[2]; + TQPtrList<MineSprite> *mines[2]; + TQMemArray<AiSprite> *shipsNextPositions[2]; + TQMemArray<AiSprite> *aiMines[2]; int mineNumber[2]; //possible Hits - QPtrList<Shot> myShots; - QPtrList<Hit> objectsHitByShip; - QPtrList<Hit> minesHitByShot; + TQPtrList<Shot> myShots; + TQPtrList<Hit> objectsHitByShip; + TQPtrList<Hit> minesHitByShot; int borderTime; int sunTime; //SpriteField width and height diff --git a/kspaceduel/defines.h b/kspaceduel/defines.h index 81162d77..edd4835e 100644 --- a/kspaceduel/defines.h +++ b/kspaceduel/defines.h @@ -1,4 +1,4 @@ -#include <qnamespace.h> +#include <tqnamespace.h> #define IDS_PAUSE 1 diff --git a/kspaceduel/dialogs.cpp b/kspaceduel/dialogs.cpp index 9e5b4b7a..c8ec2632 100644 --- a/kspaceduel/dialogs.cpp +++ b/kspaceduel/dialogs.cpp @@ -1,9 +1,9 @@ -#include <qlabel.h> -#include <qcombobox.h> -#include <qtabwidget.h> -#include <qslider.h> -#include <qlcdnumber.h> -#include <qlayout.h> +#include <tqlabel.h> +#include <tqcombobox.h> +#include <tqtabwidget.h> +#include <tqslider.h> +#include <tqlcdnumber.h> +#include <tqlayout.h> #include <klocale.h> @@ -113,13 +113,13 @@ int ConfigSetup::Position[EditNum]= const int LCDLen=6; -ConfigSetup::ConfigSetup(SConfig *custom,QWidget *parent,const char *name) - :QWidget( parent, name ) +ConfigSetup::ConfigSetup(SConfig *custom,TQWidget *parent,const char *name) + :TQWidget( parent, name ) { - QLabel *label[EditNum]; - QGridLayout *stacklayout[TabNum]; - QWidget *configWidgets[TabNum]; - //QGroupBox *box; + TQLabel *label[EditNum]; + TQGridLayout *stacklayout[TabNum]; + TQWidget *configWidgets[TabNum]; + //TQGroupBox *box; int i; @@ -128,31 +128,31 @@ ConfigSetup::ConfigSetup(SConfig *custom,QWidget *parent,const char *name) //setHelp( "OptionsConfigurations" ); - //box=new QGroupBox(i18n("Config"),this); + //box=new TQGroupBox(i18n("Config"),this); //setMainWidget( box ); - QVBoxLayout *boxlayout = new QVBoxLayout( this, 6 ); + TQVBoxLayout *boxlayout = new TQVBoxLayout( this, 6 ); - tabs=new QTabWidget(this); + tabs=new TQTabWidget(this); for(i=0;i<TabNum;i++) { - configWidgets[i]=new QWidget(tabs); - stacklayout[i]=new QGridLayout(configWidgets[i],6,3,10); + configWidgets[i]=new TQWidget(tabs); + stacklayout[i]=new TQGridLayout(configWidgets[i],6,3,10); } for(i=0;i<EditNum;i++) { - label[i]=new QLabel(i18n(LabelName[i]),configWidgets[Parent[i]]); - slider[i]=new QSlider(EditVal[i][0]*EditDiv[i],EditVal[i][1]*EditDiv[i], + label[i]=new TQLabel(i18n(LabelName[i]),configWidgets[Parent[i]]); + slider[i]=new TQSlider(EditVal[i][0]*EditDiv[i],EditVal[i][1]*EditDiv[i], (EditVal[i][1]-EditVal[i][0])/10, EditVal[i][2]*EditDiv[i], - QSlider::Horizontal,configWidgets[Parent[i]]); - connect(slider[i],SIGNAL(valueChanged(int)),SLOT(sliderChanged(int))); - value[i]=new QLCDNumber(LCDLen,configWidgets[Parent[i]]); - value[i]->setFrameStyle(QFrame::NoFrame); + TQSlider::Horizontal,configWidgets[Parent[i]]); + connect(slider[i],TQT_SIGNAL(valueChanged(int)),TQT_SLOT(sliderChanged(int))); + value[i]=new TQLCDNumber(LCDLen,configWidgets[Parent[i]]); + value[i]->setFrameStyle(TQFrame::NoFrame); } - configCombo=new QComboBox(false,this); - connect(configCombo,SIGNAL(activated(int)),SLOT(configSelected(int))); + configCombo=new TQComboBox(false,this); + connect(configCombo,TQT_SIGNAL(activated(int)),TQT_SLOT(configSelected(int))); for(i=0;i<predefinedConfigNum;i++) configCombo->insertItem(i18n(predefinedConfigName[i])); configCombo->insertItem(i18n("Custom")); @@ -329,7 +329,7 @@ void ConfigSetup::displayConfig(SConfig cfg) void ConfigSetup::setValue(int ednum,int val) { - QString str; + TQString str; str.sprintf("%*i",LCDLen,val); value[ednum]->display(str); slider[ednum]->setValue(val); @@ -337,7 +337,7 @@ void ConfigSetup::setValue(int ednum,int val) void ConfigSetup::setValue(int ednum,double val) { - QString str; + TQString str; int hval=(int)(val*EditDiv[ednum]+0.5); int n,h; @@ -356,7 +356,7 @@ void ConfigSetup::setValue(int ednum,double val) void ConfigSetup::setValue(int ednum,unsigned val) { - QString str; + TQString str; str.sprintf("%*i",LCDLen,(int)val); value[ednum]->display(str); slider[ednum]->setValue((int)val); @@ -365,7 +365,7 @@ void ConfigSetup::setValue(int ednum,unsigned val) void ConfigSetup::sliderChanged(int val) { int i,n,h; - QString str; + TQString str; for(i=0;(i<EditNum)&&(slider[i]!=sender());i++); if(i<EditNum) @@ -388,7 +388,7 @@ void ConfigSetup::sliderChanged(int val) } -SettingsDialog::SettingsDialog(SConfig *customConfig, QWidget *parent, const char *name) +SettingsDialog::SettingsDialog(SConfig *customConfig, TQWidget *parent, const char *name) : KConfigDialog( parent, name, Options::self()) { General *general = new General(); @@ -396,7 +396,7 @@ SettingsDialog::SettingsDialog(SConfig *customConfig, QWidget *parent, const cha cs = new ConfigSetup(customConfig); addPage(cs, i18n("Game"), "kspaceduel", i18n("Game Settings")); - connect(cs, SIGNAL(changed()), this, SLOT(updateButtons())); + connect(cs, TQT_SIGNAL(changed()), this, TQT_SLOT(updateButtons())); // resize(600,400); } diff --git a/kspaceduel/dialogs.h b/kspaceduel/dialogs.h index 1a1ef6d2..2cfe08ba 100644 --- a/kspaceduel/dialogs.h +++ b/kspaceduel/dialogs.h @@ -19,7 +19,7 @@ class ConfigSetup:public QWidget { Q_OBJECT public: - ConfigSetup(SConfig *custom,QWidget *parent=0,const char* name=0); + ConfigSetup(SConfig *custom,TQWidget *parent=0,const char* name=0); bool hasChanged(); bool isDefault(); @@ -65,12 +65,12 @@ private: static int EditDiv[EditNum]; static Type VarType[EditNum]; - QTabWidget *tabs; + TQTabWidget *tabs; - QSlider *slider[EditNum]; - QLCDNumber *value[EditNum]; + TQSlider *slider[EditNum]; + TQLCDNumber *value[EditNum]; - QComboBox *configCombo; + TQComboBox *configCombo; SConfig *customConfig,config; int selectedConfig; @@ -80,7 +80,7 @@ class SettingsDialog : public KConfigDialog { Q_OBJECT public: - SettingsDialog(SConfig *customConfig, QWidget *parent=0, const char *name=0); + SettingsDialog(SConfig *customConfig, TQWidget *parent=0, const char *name=0); ~SettingsDialog(); signals: diff --git a/kspaceduel/mainview.cpp b/kspaceduel/mainview.cpp index 0d385a49..5448c1a3 100644 --- a/kspaceduel/mainview.cpp +++ b/kspaceduel/mainview.cpp @@ -1,9 +1,9 @@ #include "mainview.h" #include <math.h> -#include <qbitmap.h> -#include <qfile.h> -#include <qvbox.h> +#include <tqbitmap.h> +#include <tqfile.h> +#include <tqvbox.h> #include <kapplication.h> #include <kaction.h> @@ -18,20 +18,20 @@ KToggleAction *MyMainView::pauseAction = 0; -MyMainView::MyMainView(QWidget *parent) - :QWidget(parent), +MyMainView::MyMainView(TQWidget *parent) + :TQWidget(parent), field(DEF_WIDTH,DEF_HEIGHT), view(&field,this) { int i,p; setMinimumSize(600,400); random.setSeed(0); - QPixmap backgr(locate("appdata", MV_BACKGROUND)); + TQPixmap backgr(locate("appdata", MV_BACKGROUND)); field.setBackgroundPixmap(backgr); - view.setResizePolicy(QScrollView::AutoOne); - view.setHScrollBarMode(QScrollView::AlwaysOff); - view.setVScrollBarMode(QScrollView::AlwaysOff); + view.setResizePolicy(TQScrollView::AutoOne); + view.setHScrollBarMode(TQScrollView::AlwaysOff); + view.setVScrollBarMode(TQScrollView::AlwaysOff); for(p=0;p<2;p++) { @@ -41,9 +41,9 @@ MyMainView::MyMainView(QWidget *parent) minePut[p]=false; } - QString tmp = KGlobal::dirs()->findResourceDir("appdata", (QString)MV_BACKGROUND); + TQString tmp = KGlobal::dirs()->findResourceDir("appdata", (TQString)MV_BACKGROUND); - QCanvasPixmapArray *sunsequence + TQCanvasPixmapArray *sunsequence = loadOldPixmapSequence( tmp + MV_SUN_PPM, tmp + MV_SUN_PBM ); sun=new SunSprite(sunsequence, &field); sun->move(width()/2-1,height()/2-1); @@ -82,9 +82,9 @@ MyMainView::MyMainView(QWidget *parent) { // ship[i]->setBoundsAction(QwRealMobileSprite::Wrap); ship[i]->hide(); - bullets[i]=new QPtrList<BulletSprite>; + bullets[i]=new TQPtrList<BulletSprite>; bullets[i]->setAutoDelete(true); - mines[i]=new QPtrList<MineSprite>; + mines[i]=new TQPtrList<MineSprite>; mines[i]->setAutoDelete(true); } @@ -233,7 +233,7 @@ SConfig MyMainView::modifyConfig(SConfig conf) return newConfig; } -void MyMainView::keyPressEvent(QKeyEvent *ev) +void MyMainView::keyPressEvent(TQKeyEvent *ev) { if((gameEnd<=0.0)&&(gameEnd>-2.0)) { @@ -297,7 +297,7 @@ void MyMainView::keyPressEvent(QKeyEvent *ev) } } -void MyMainView::keyReleaseEvent(QKeyEvent *ev) +void MyMainView::keyReleaseEvent(TQKeyEvent *ev) { KKey key(ev); bool accept=true; @@ -387,7 +387,7 @@ void MyMainView::togglePause( ) pause( ); } -void MyMainView::resizeEvent(QResizeEvent *event) +void MyMainView::resizeEvent(TQResizeEvent *event) { double mx,my; MineSprite *mine; @@ -397,7 +397,7 @@ void MyMainView::resizeEvent(QResizeEvent *event) mx=(event->size().width()-event->oldSize().width())/2.0; my=(event->size().height()-event->oldSize().height())/2.0; - QWidget::resizeEvent(event); + TQWidget::resizeEvent(event); view.resize(width(),height()); field.resize(width(),height()); @@ -491,7 +491,7 @@ void MyMainView::newRound() } field.update(); - QString str = i18n("Press %1 to start") + TQString str = i18n("Press %1 to start") .arg(KShortcut(GAME_START_SHORTCUT).toString()); emit(setStatusText(str,IDS_MAIN)); emit( setStatusText( "", IDS_PAUSE ) ); @@ -509,7 +509,7 @@ void MyMainView::newGame() newRound(); } -void MyMainView::timerEvent(QTimerEvent *event) +void MyMainView::timerEvent(TQTimerEvent *event) { unsigned w; int i; @@ -531,11 +531,11 @@ void MyMainView::timerEvent(QTimerEvent *event) textSprite=0; } - textSprite=new QCanvasText(&field); + textSprite=new TQCanvasText(&field); textSprite->move(width()/2,height()/2-90); textSprite->setTextFlags(AlignCenter); textSprite->setColor(qRgb(255,160,0)); - textSprite->setFont(QFont(KGlobalSettings::generalFont().family(),14)); + textSprite->setFont(TQFont(KGlobalSettings::generalFont().family(),14)); textSprite->show( ); if(ship[0]->getHitPoints()==0) { @@ -556,7 +556,7 @@ void MyMainView::timerEvent(QTimerEvent *event) ship[0]->setWins(w); emit(wins(0,w)); } - QString str = i18n("Press %1 for new round") + TQString str = i18n("Press %1 for new round") .arg(KShortcut(GAME_START_SHORTCUT).toString()); emit(setStatusText(str,IDS_MAIN)); stop( ); @@ -789,17 +789,17 @@ void MyMainView::calculatePowerups() void MyMainView::collisions() { int pl,hp,op,oldhp[2],ohp; - QCanvasItemList unexact; - QCanvasItem *sprite; + TQCanvasItemList unexact; + TQCanvasItem *sprite; BulletSprite *bullet; MineSprite *mine; ExplosionSprite *expl; ShipSprite *s; PowerupSprite *power; - QCanvasItemList hitlist; + TQCanvasItemList hitlist; double ndx[2],ndy[2]; double en; - QCanvasItemList::Iterator it; + TQCanvasItemList::Iterator it; for(pl=0;pl<2;pl++) { @@ -990,7 +990,7 @@ void MyMainView::gameSetup() return; SettingsDialog *settings=new SettingsDialog(&customConfig,this,"settings"); - connect(settings, SIGNAL(settingsUpdated()),this,SLOT(closeSettings())); + connect(settings, TQT_SIGNAL(settingsUpdated()),this,TQT_SLOT(closeSettings())); settings->show(); } @@ -1001,17 +1001,17 @@ void MyMainView::closeSettings(){ config=modifyConfig(customConfig); } -QCanvasPixmapArray* MyMainView::loadOldPixmapSequence(const QString& datapattern, - const QString& maskpattern, int framecount) +TQCanvasPixmapArray* MyMainView::loadOldPixmapSequence(const TQString& datapattern, + const TQString& maskpattern, int framecount) { int image; - QPtrList<QPixmap> pixmaplist; - QPtrList<QPoint> pointlist; - QString dataname, maskname; - QPixmap *pix; - QBitmap *bitmap; + TQPtrList<TQPixmap> pixmaplist; + TQPtrList<TQPoint> pointlist; + TQString dataname, maskname; + TQPixmap *pix; + TQBitmap *bitmap; int hotx=0, hoty=0; - QPoint *point; + TQPoint *point; for( image=0; image < framecount; image++ ) { @@ -1019,7 +1019,7 @@ QCanvasPixmapArray* MyMainView::loadOldPixmapSequence(const QString& datapattern dataname.sprintf( datapattern.ascii(), image ); maskname.sprintf( maskpattern.ascii(), image ); - QFile file(dataname); + TQFile file(dataname); if( file.open( IO_ReadOnly ) ) { char line[128]; @@ -1034,18 +1034,18 @@ QCanvasPixmapArray* MyMainView::loadOldPixmapSequence(const QString& datapattern file.readLine( line, 128 ); } - point = new QPoint( hotx, hoty ); + point = new TQPoint( hotx, hoty ); pointlist.append( point ); } - pix = new QPixmap( dataname ); - bitmap = new QBitmap( maskname ); + pix = new TQPixmap( dataname ); + bitmap = new TQBitmap( maskname ); pix->setMask( *bitmap ); pixmaplist.append( pix ); } - QCanvasPixmapArray* newarray = new QCanvasPixmapArray( pixmaplist, pointlist ); + TQCanvasPixmapArray* newarray = new TQCanvasPixmapArray( pixmaplist, pointlist ); return newarray; } diff --git a/kspaceduel/mainview.h b/kspaceduel/mainview.h index 98dd8e15..c56a4f12 100644 --- a/kspaceduel/mainview.h +++ b/kspaceduel/mainview.h @@ -1,8 +1,8 @@ #ifndef __MY_MAIN_VIEW_H #define __MY_MAIN_VIEW_H -#include <qwidget.h> -#include <qimage.h> +#include <tqwidget.h> +#include <tqimage.h> class KToggleAction; class KActionCollection; @@ -20,7 +20,7 @@ class MyMainView:public QWidget { Q_OBJECT public: - MyMainView(QWidget *parent=0); + MyMainView(TQWidget *parent=0); ~MyMainView(); static KToggleAction *pauseAction; @@ -42,16 +42,16 @@ signals: void hitPoints(int pn,int hp); void energy(int pn,int en); void wins(int pn,int w); - void setStatusText(const QString & str,int id); + void setStatusText(const TQString & str,int id); protected: - virtual void resizeEvent(QResizeEvent *event); - virtual void timerEvent(QTimerEvent *event); - virtual void keyPressEvent(QKeyEvent *event); - virtual void keyReleaseEvent(QKeyEvent *event); + virtual void resizeEvent(TQResizeEvent *event); + virtual void timerEvent(TQTimerEvent *event); + virtual void keyPressEvent(TQKeyEvent *event); + virtual void keyReleaseEvent(TQKeyEvent *event); SConfig modifyConfig(SConfig conf); - QCanvasPixmapArray* loadOldPixmapSequence(const QString& datapattern, - const QString& maskpattern, int framecount=1); + TQCanvasPixmapArray* loadOldPixmapSequence(const TQString& datapattern, + const TQString& maskpattern, int framecount=1); void moveShips(); void moveBullets(); void moveMines(); @@ -61,8 +61,8 @@ protected: private: KActionCollection *actionCollection; - QCanvas field; - QCanvasView view; + TQCanvas field; + TQCanvasView view; SConfig customConfig,config; @@ -75,24 +75,24 @@ private: double timeToNextPowerup; // sprites - QPtrList<QImage> shipImages; - QPtrList<QPoint> points; - QImage bulletImage; - QCanvasPixmapArray *bulletsequence[2]; - QCanvasPixmapArray *shipsequence[2]; - QCanvasPixmapArray *explosionsequence; - QCanvasPixmapArray *minesequence[2]; - QCanvasPixmapArray *mineexplosionsequence; - QCanvasPixmapArray *powerupsequence[PowerupSprite::PowerupNum]; + TQPtrList<TQImage> shipImages; + TQPtrList<TQPoint> points; + TQImage bulletImage; + TQCanvasPixmapArray *bulletsequence[2]; + TQCanvasPixmapArray *shipsequence[2]; + TQCanvasPixmapArray *explosionsequence; + TQCanvasPixmapArray *minesequence[2]; + TQCanvasPixmapArray *mineexplosionsequence; + TQCanvasPixmapArray *powerupsequence[PowerupSprite::PowerupNum]; ShipSprite *ship[2]; SunSprite *sun; - QCanvasText *textSprite; - QPtrList<BulletSprite> *bullets[2]; - QPtrList<MineSprite> *mines[2]; - QPtrList<ExplosionSprite> explosions; - QPtrList<PowerupSprite> powerups; + TQCanvasText *textSprite; + TQPtrList<BulletSprite> *bullets[2]; + TQPtrList<MineSprite> *mines[2]; + TQPtrList<ExplosionSprite> explosions; + TQPtrList<PowerupSprite> powerups; KRandomSequence random; diff --git a/kspaceduel/playerinfo.cpp b/kspaceduel/playerinfo.cpp index 1cd2cd31..2e1ef91d 100644 --- a/kspaceduel/playerinfo.cpp +++ b/kspaceduel/playerinfo.cpp @@ -1,29 +1,29 @@ #include "playerinfo.h" -#include <qpixmap.h> -#include <qtooltip.h> +#include <tqpixmap.h> +#include <tqtooltip.h> #include <klocale.h> #include <kstandarddirs.h> -PlayerInfo::PlayerInfo(int pnr,QWidget *parent,const char *name) - :QFrame(parent,name), +PlayerInfo::PlayerInfo(int pnr,TQWidget *parent,const char *name) + :TQFrame(parent,name), lplayer(this),lenergy(this),lwins(this), hitpoints(2,this),energy(2,this),wins(2,this) { setFixedWidth(45); setFrameStyle(Panel|Raised); - QString str; + TQString str; int i; lplayer.setFrameStyle(Panel|Sunken); lplayer.setMargin(0); - QToolTip::add(&lplayer,i18n("Hit points")); + TQToolTip::add(&lplayer,i18n("Hit points")); lenergy.setFrameStyle(Panel|Sunken); lenergy.setMargin(0); - QToolTip::add(&lenergy,i18n("Energy")); + TQToolTip::add(&lenergy,i18n("Energy")); lwins.setFrameStyle(Panel|Sunken); lwins.setMargin(0); - QToolTip::add(&lwins,i18n("Wins")); + TQToolTip::add(&lwins,i18n("Wins")); lplayer.setGeometry(5,5,35,35); lplayer.setIndent(0); @@ -34,26 +34,26 @@ PlayerInfo::PlayerInfo(int pnr,QWidget *parent,const char *name) for(i=0;i<4;i++) { - str = QString::fromLatin1("sprites/playerinfo/ship%1%2.pnm") + str = TQString::fromLatin1("sprites/playerinfo/ship%1%2.pnm") .arg(pnr+1) .arg(i); - pix[i]=new QPixmap(locate("appdata", str)); + pix[i]=new TQPixmap(locate("appdata", str)); } lplayer.setPixmap(*pix[0]); currentPixmap=0; - lenergy.setPixmap(QPixmap(locate("appdata", "sprites/playerinfo/energy.pnm"))); - lwins.setPixmap(QPixmap(locate("appdata", "sprites/playerinfo/win.pnm"))); + lenergy.setPixmap(TQPixmap(locate("appdata", "sprites/playerinfo/energy.pnm"))); + lwins.setPixmap(TQPixmap(locate("appdata", "sprites/playerinfo/win.pnm"))); hitpoints.setGeometry(9,45,26,26); energy.setGeometry(9,120,26,26); wins.setGeometry(9,195,26,26); hitpoints.setFrameStyle(NoFrame); - QToolTip::add(&hitpoints,i18n("Hit points")); + TQToolTip::add(&hitpoints,i18n("Hit points")); energy.setFrameStyle(NoFrame); - QToolTip::add(&energy,i18n("Energy")); + TQToolTip::add(&energy,i18n("Energy")); wins.setFrameStyle(NoFrame); - QToolTip::add(&wins,i18n("Wins")); + TQToolTip::add(&wins,i18n("Wins")); } void PlayerInfo::setHitpoints(int h) diff --git a/kspaceduel/playerinfo.h b/kspaceduel/playerinfo.h index e172c982..42fc8158 100644 --- a/kspaceduel/playerinfo.h +++ b/kspaceduel/playerinfo.h @@ -1,26 +1,26 @@ #ifndef __PLAYER_INFO_H #define __PLAYER_INFO_H -#include <qframe.h> -#include <qlabel.h> +#include <tqframe.h> +#include <tqlabel.h> class QPixmap; -#include <qlcdnumber.h> -#include <qcolor.h> +#include <tqlcdnumber.h> +#include <tqcolor.h> class PlayerInfo:public QFrame { Q_OBJECT public: - PlayerInfo(int pnr,QWidget *parent=0,const char *name=0); + PlayerInfo(int pnr,TQWidget *parent=0,const char *name=0); public slots: void setHitpoints(int h); void setEnergy(int e); void setWins(int w); private: - QPixmap* pix[4]; + TQPixmap* pix[4]; int currentPixmap; - QLabel lplayer,lenergy,lwins; - QLCDNumber hitpoints,energy,wins; + TQLabel lplayer,lenergy,lwins; + TQLCDNumber hitpoints,energy,wins; }; #endif diff --git a/kspaceduel/sprites.cpp b/kspaceduel/sprites.cpp index 08eab3c7..ba163429 100644 --- a/kspaceduel/sprites.cpp +++ b/kspaceduel/sprites.cpp @@ -3,25 +3,25 @@ #include <math.h> -SunSprite::SunSprite(QCanvasPixmapArray *seq, QCanvas* canvas) - :QCanvasSprite(seq, canvas) +SunSprite::SunSprite(TQCanvasPixmapArray *seq, TQCanvas* canvas) + :TQCanvasSprite(seq, canvas) { // doesn't work with Qt 2.2.2 anymore // setZ(0); } -PowerupSprite::PowerupSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int t, +PowerupSprite::PowerupSprite(TQCanvasPixmapArray* seq, TQCanvas* canvas, int t, double lifetime) - :QCanvasSprite(seq, canvas) + :TQCanvasSprite(seq, canvas) { time=lifetime; type=t; } -MobileSprite::MobileSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int pn) - :QCanvasSprite(seq, canvas) +MobileSprite::MobileSprite(TQCanvasPixmapArray* seq, TQCanvas* canvas, int pn) + :TQCanvasSprite(seq, canvas) { stopped=false; playerNumber=pn; @@ -31,7 +31,7 @@ void MobileSprite::forward(double mult, int fr) { if(!stopped) { - QCanvasSprite::moveBy(xVelocity()*mult,yVelocity()*mult); + TQCanvasSprite::moveBy(xVelocity()*mult,yVelocity()*mult); checkBounds(); setFrame(fr); } @@ -43,7 +43,7 @@ void MobileSprite::forward(double mult) { if(!stopped) { - QCanvasSprite::moveBy(xVelocity()*mult,yVelocity()*mult); + TQCanvasSprite::moveBy(xVelocity()*mult,yVelocity()*mult); checkBounds(); } } @@ -107,7 +107,7 @@ AiSprite MobileSprite::toAiSprite() return as; } -ShipSprite::ShipSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int pn) +ShipSprite::ShipSprite(TQCanvasPixmapArray* seq, TQCanvas* canvas, int pn) :MobileSprite(seq,canvas,pn) { hitpoints=99; @@ -215,7 +215,7 @@ void ShipSprite::rotateLeft(double rotationEnergyNeed,double rotationSpeed) } } -BulletSprite::BulletSprite(QCanvasPixmapArray* seq,QCanvas* canvas, int pn,double lifetime) +BulletSprite::BulletSprite(TQCanvasPixmapArray* seq,TQCanvas* canvas, int pn,double lifetime) :MobileSprite(seq,canvas,pn) { setZ(-10); @@ -234,7 +234,7 @@ void BulletSprite::forward(double mult,int fr) time-=mult; } -MineSprite::MineSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int pn,double atime,double f) +MineSprite::MineSprite(TQCanvasPixmapArray* seq, TQCanvas* canvas, int pn,double atime,double f) :MobileSprite(seq,canvas,pn) { activateTime=atime; @@ -246,7 +246,7 @@ MineSprite::MineSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int pn,double a active=false; } -void MineSprite::explode(QCanvasPixmapArray *seq) +void MineSprite::explode(TQCanvasPixmapArray *seq) { setSequence(seq); timeToGo=seq->count(); @@ -304,8 +304,8 @@ void MineSprite::calculateGravity(double gravity,double mult) } } -ExplosionSprite::ExplosionSprite(QCanvasPixmapArray* seq, QCanvas* canvas, MobileSprite *sp) - :QCanvasSprite(seq, canvas) +ExplosionSprite::ExplosionSprite(TQCanvasPixmapArray* seq, TQCanvas* canvas, MobileSprite *sp) + :TQCanvasSprite(seq, canvas) { over=false; setZ(-5); @@ -333,8 +333,8 @@ void ExplosionSprite::forward(double mult) } -void ExplosionSprite::setSequence(QCanvasPixmapArray *seq) +void ExplosionSprite::setSequence(TQCanvasPixmapArray *seq) { timeToGo=seq->count(); - QCanvasSprite::setSequence(seq); + TQCanvasSprite::setSequence(seq); } diff --git a/kspaceduel/sprites.h b/kspaceduel/sprites.h index 0d0b1fb3..8011301e 100644 --- a/kspaceduel/sprites.h +++ b/kspaceduel/sprites.h @@ -1,7 +1,7 @@ #ifndef __SPRITE_OBJECTS_H #define __SPRITE_OBJECTS_H -#include <qcanvas.h> +#include <tqcanvas.h> #include "defines.h" #ifdef sun @@ -17,7 +17,7 @@ struct AiSprite class SunSprite:public QCanvasSprite { public: - SunSprite(QCanvasPixmapArray* seq, QCanvas* canvas); + SunSprite(TQCanvasPixmapArray* seq, TQCanvas* canvas); virtual int rtti() const {return S_SUN;} }; @@ -27,7 +27,7 @@ class PowerupSprite:public QCanvasSprite public: enum {PowerupMine=0, PowerupBullet, PowerupShield, PowerupEnergy, PowerupNum}; - PowerupSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int t, double lifetime); + PowerupSprite(TQCanvasPixmapArray* seq, TQCanvas* canvas, int t, double lifetime); virtual int rtti() const {return S_POWERUP;} double getLifetime() {return time;} @@ -41,7 +41,7 @@ private: class MobileSprite:public QCanvasSprite { public: - MobileSprite(QCanvasPixmapArray* array, QCanvas* canvas, int pn); + MobileSprite(TQCanvasPixmapArray* array, TQCanvas* canvas, int pn); virtual void forward(double mult,int frame); virtual void forward(double mult); @@ -63,7 +63,7 @@ protected: class ShipSprite:public MobileSprite { public: - ShipSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int pn); + ShipSprite(TQCanvasPixmapArray* seq, TQCanvas* canvas, int pn); virtual int rtti() const {return S_SHIP;} int getHitPoints() {return hitpoints;} void setHitPoints(int hp) {hitpoints=(hp<0?0:hp);} @@ -99,7 +99,7 @@ private: class BulletSprite:public MobileSprite { public: - BulletSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int pn,double lifetime); + BulletSprite(TQCanvasPixmapArray* seq, TQCanvas* canvas, int pn,double lifetime); virtual int rtti() const {return S_BULLET;} virtual void forward(double mult); virtual void forward(double mult,int fr); @@ -111,13 +111,13 @@ private: class MineSprite:public MobileSprite { public: - MineSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int pn,double atime,double f); + MineSprite(TQCanvasPixmapArray* seq, TQCanvas* canvas, int pn,double atime,double f); virtual int rtti() const {return S_MINE;} bool isActive() {return active;} double getFuel() {return fuel;} void setFuel(double f) {fuel=(f<0.0?0.0:f);} virtual void forward(double mult); - void explode(QCanvasPixmapArray* s); + void explode(TQCanvasPixmapArray* s); bool explodes() {return expl;} bool over() {return (expl&&(explosiontime>(timeToGo-0.1)));} virtual void calculateGravity(double gravity,double mult); @@ -129,11 +129,11 @@ private: class ExplosionSprite:public QCanvasSprite { public: - ExplosionSprite(QCanvasPixmapArray *seq, QCanvas* field, MobileSprite *sp); + ExplosionSprite(TQCanvasPixmapArray *seq, TQCanvas* field, MobileSprite *sp); virtual int rtti() const {return S_EXPLOSION;} bool isOver() {return over;} virtual void forward(double mult); - void setSequence(QCanvasPixmapArray *seq); + void setSequence(TQCanvasPixmapArray *seq); private: double timeToGo,time; bool over; diff --git a/kspaceduel/topwidget.cpp b/kspaceduel/topwidget.cpp index 9f275848..510da675 100644 --- a/kspaceduel/topwidget.cpp +++ b/kspaceduel/topwidget.cpp @@ -3,7 +3,7 @@ #include <kkeydialog.h> #include <kaction.h> #include <kstdgameaction.h> -#include <qlayout.h> +#include <tqlayout.h> #include <kstatusbar.h> #include "topwidget.h" @@ -19,28 +19,28 @@ MyTopLevelWidget::MyTopLevelWidget() } void MyTopLevelWidget::initGameWidgets( ){ - QWidget *w = new QWidget(this); + TQWidget *w = new TQWidget(this); playerinfo[0]=new PlayerInfo(0,w); playerinfo[1]=new PlayerInfo(1,w); playfield=new MyMainView(w); - QBoxLayout *toplayout=new QHBoxLayout(w); + TQBoxLayout *toplayout=new TQHBoxLayout(w); toplayout->addWidget(playerinfo[0]); toplayout->addWidget(playfield); toplayout->addWidget(playerinfo[1]); toplayout->activate(); - playfield->setFocusPolicy(QWidget::StrongFocus); + playfield->setFocusPolicy(TQWidget::StrongFocus); playfield->setFocus(); - QObject::connect(playfield,SIGNAL(energy(int,int)), - SLOT(energy(int,int))); - QObject::connect(playfield,SIGNAL(hitPoints(int,int)), - SLOT(hitPoints(int,int))); - QObject::connect(playfield,SIGNAL(wins(int,int)),SLOT(wins(int,int))); - QObject::connect(playfield,SIGNAL(setStatusText(const QString &,int)), - SLOT(setStatusText(const QString &,int))); + TQObject::connect(playfield,TQT_SIGNAL(energy(int,int)), + TQT_SLOT(energy(int,int))); + TQObject::connect(playfield,TQT_SIGNAL(hitPoints(int,int)), + TQT_SLOT(hitPoints(int,int))); + TQObject::connect(playfield,TQT_SIGNAL(wins(int,int)),TQT_SLOT(wins(int,int))); + TQObject::connect(playfield,TQT_SIGNAL(setStatusText(const TQString &,int)), + TQT_SLOT(setStatusText(const TQString &,int))); setCentralWidget(w); } @@ -62,18 +62,18 @@ void MyTopLevelWidget::wins(int pn,int w) void MyTopLevelWidget::initActions( ) { - KStdGameAction::quit(this, SLOT(close()), actionCollection()); - KStdGameAction::gameNew(playfield, SLOT(newGame()), actionCollection()); + KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdGameAction::gameNew(playfield, TQT_SLOT(newGame()), actionCollection()); ( void )new KAction( i18n( "&New Round" ), "spnewround", - CTRL + Key_R, playfield, SLOT( newRound( ) ), + CTRL + Key_R, playfield, TQT_SLOT( newRound( ) ), actionCollection( ), "new_round" ); MyMainView::pauseAction = - KStdGameAction::pause(playfield, SLOT(togglePause()), actionCollection()); + KStdGameAction::pause(playfield, TQT_SLOT(togglePause()), actionCollection()); MyMainView::pauseAction->setChecked( false ); KAction* gameStart = new KAction( i18n( "Start" ), GAME_START_SHORTCUT, - playfield, SLOT( start( ) ), actionCollection( ), "game_start" ); + playfield, TQT_SLOT( start( ) ), actionCollection( ), "game_start" ); - KStdAction::preferences(playfield, SLOT(gameSetup()), actionCollection()); + KStdAction::preferences(playfield, TQT_SLOT(gameSetup()), actionCollection()); KAccel* acc = new KAccel(this); gameStart->plugAccel(acc); @@ -130,7 +130,7 @@ void MyTopLevelWidget::start() playfield->newRound(); } -void MyTopLevelWidget::setStatusText(const QString & str,int id) +void MyTopLevelWidget::setStatusText(const TQString & str,int id) { statusBar( )->changeItem(str,id); } diff --git a/kspaceduel/topwidget.h b/kspaceduel/topwidget.h index 39c0f5d3..7c86a39c 100644 --- a/kspaceduel/topwidget.h +++ b/kspaceduel/topwidget.h @@ -14,7 +14,7 @@ public: void start(); private slots: - void setStatusText(const QString & text,int id); + void setStatusText(const TQString & text,int id); void keySetup(); void energy(int pn,int en); void hitPoints(int pn,int hp); diff --git a/ktron/ktron.cpp b/ktron/ktron.cpp index 67151ff0..c9a5ea77 100644 --- a/ktron/ktron.cpp +++ b/ktron/ktron.cpp @@ -42,11 +42,11 @@ /** * Constuctor */ -KTron::KTron(QWidget *parent, const char *name) : KMainWindow(parent, name) { +KTron::KTron(TQWidget *parent, const char *name) : KMainWindow(parent, name) { playerPoints[0]=playerPoints[1]=0; tron=new Tron(this, "Tron"); - connect(tron,SIGNAL(gameEnds(Player)),SLOT(changeStatus(Player))); + connect(tron,TQT_SIGNAL(gameEnds(Player)),TQT_SLOT(changeStatus(Player))); setCentralWidget(tron); tron->setMinimumSize(200,180); @@ -81,10 +81,10 @@ KTron::KTron(QWidget *parent, const char *name) : KMainWindow(parent, name) { tron->setActionCollection(actionCollection()); - KStdGameAction::pause(tron, SLOT(togglePause()), actionCollection()); - KStdGameAction::gameNew( tron, SLOT( newGame() ), actionCollection() ); - KStdGameAction::quit(this, SLOT( close() ), actionCollection()); - KStdAction::preferences(this, SLOT(showSettings()), actionCollection()); + KStdGameAction::pause(tron, TQT_SLOT(togglePause()), actionCollection()); + KStdGameAction::gameNew( tron, TQT_SLOT( newGame() ), actionCollection() ); + KStdGameAction::quit(this, TQT_SLOT( close() ), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection()); setupGUI( KMainWindow::Keys | StatusBar | Save | Create); loadSettings(); @@ -106,14 +106,14 @@ void KTron::updateStatusbar(){ Player player; player=(i==0?One:Two); - QString name; + TQString name; if(tron->isComputer(Both)) name=i18n("Computer(%1)").arg(i+1); else if(tron->isComputer(player)) name=i18n("Computer"); else name=playerName[i]; - QString string = QString("%1: %2").arg(name).arg(playerPoints[i]); + TQString string = TQString("%1: %2").arg(name).arg(playerPoints[i]); statusBar()->changeItem(string,ID_STATUS_BASE+i+1); } } @@ -147,18 +147,18 @@ void KTron::showWinner(Player winner){ if(tron->isComputer(Both) || (winner != One && winner != Two)) return; - QString loserName = i18n("KTron"); + TQString loserName = i18n("KTron"); int loser = Two; if(winner == Two) loser = One; if(!tron->isComputer(((Player)loser))) loserName = playerName[loser]; - QString winnerName = i18n("KTron"); + TQString winnerName = i18n("KTron"); if(!tron->isComputer(winner)) winnerName = playerName[winner]; - QString message=i18n("%1 has won!").arg(winnerName); + TQString message=i18n("%1 has won!").arg(winnerName); statusBar()->message(message,MESSAGE_TIME); message = i18n("%1 has won versus %2 with %3 : %4 points!"); @@ -169,7 +169,7 @@ void KTron::showWinner(Player winner){ tron->newGame(); } -void KTron::paletteChange(const QPalette &/*oldPalette*/){ +void KTron::paletteChange(const TQPalette &/*oldPalette*/){ update(); tron->updatePixmap(); tron->update(); @@ -186,8 +186,8 @@ void KTron::showSettings(){ dialog->addPage(new General(0, "General"), i18n("General"), "package_settings"); dialog->addPage(new Ai(0, "Ai"), i18n("A.I."), "personal"); dialog->addPage(new Appearance(0, "Appearance"), i18n("Appearance"), "style"); - connect(dialog, SIGNAL(settingsChanged()), tron, SLOT(loadSettings())); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), tron, TQT_SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(loadSettings())); dialog->show(); } diff --git a/ktron/ktron.h b/ktron/ktron.h index 191f2b44..c61bf42b 100644 --- a/ktron/ktron.h +++ b/ktron/ktron.h @@ -41,18 +41,18 @@ class KTron : public KMainWindow { Q_OBJECT public: - KTron(QWidget *parent=0, const char *name=0); + KTron(TQWidget *parent=0, const char *name=0); private: KAccel *accel; Tron *tron; - QString playerName[2]; + TQString playerName[2]; int playerPoints[2]; void updateStatusbar(); protected: /** calls tron->updatePixmap to draw frame in the new colors */ - void paletteChange(const QPalette &oldPalette); + void paletteChange(const TQPalette &oldPalette); private slots: void loadSettings(); diff --git a/ktron/tron.cpp b/ktron/tron.cpp index 494d96bc..1c7bf72c 100644 --- a/ktron/tron.cpp +++ b/ktron/tron.cpp @@ -23,7 +23,7 @@ #include <kmessagebox.h> // Normal class -#include <qtimer.h> +#include <tqtimer.h> #include <kdebug.h> #include <klocale.h> @@ -41,8 +41,8 @@ * init-functions **/ -Tron::Tron(QWidget *parent,const char *name) - : QWidget(parent,name) +Tron::Tron(TQWidget *parent,const char *name) + : TQWidget(parent,name) { pixmap=0; playfield=0; @@ -51,16 +51,16 @@ Tron::Tron(QWidget *parent,const char *name) random.setSeed(0); - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(TQWidget::StrongFocus); setBackgroundMode(NoBackground); gameBlocked=false; rectSize=10; - timer = new QTimer(this,"timer"); + timer = new TQTimer(this,"timer"); loadSettings(); - connect(timer, SIGNAL(timeout()), SLOT(doMove())); - QTimer::singleShot(15000, this,SLOT(showBeginHint())); + connect(timer, TQT_SIGNAL(timeout()), TQT_SLOT(doMove())); + TQTimer::singleShot(15000, this,TQT_SLOT(showBeginHint())); } void Tron::loadSettings(){ @@ -89,13 +89,13 @@ void Tron::loadSettings(){ if(Settings::backgroundImageChoice()){ KURL url ( Settings::backgroundImage() ); if(!url.isEmpty()){ - QString tmpFile; + TQString tmpFile; KIO::NetAccess::download(url, tmpFile, this); - QPixmap pix(tmpFile); + TQPixmap pix(tmpFile); if(!pix.isNull()){ setBackgroundPix(pix); } else { - QString msg=i18n("Wasn't able to load wallpaper\n%1"); + TQString msg=i18n("Wasn't able to load wallpaper\n%1"); msg=msg.arg(tmpFile); KMessageBox::sorry(this, msg); } @@ -132,11 +132,11 @@ void Tron::createNewPlayfield() fieldHeight=(height()-2*TRON_FRAMESIZE)/rectSize; // start positions - playfield=new QMemArray<int>[fieldWidth]; + playfield=new TQMemArray<int>[fieldWidth]; for(int i=0;i<fieldWidth;i++) playfield[i].resize(fieldHeight); - pixmap=new QPixmap(size()); + pixmap=new TQPixmap(size()); pixmap->fill(Settings::color_Background()); //int min=(fieldWidth<fieldHeight) ? fieldWidth : fieldHeight; @@ -150,7 +150,7 @@ void Tron::newGame() emit gameEnds(Nobody); reset(); - QTimer::singleShot(15000,this,SLOT(showBeginHint())); + TQTimer::singleShot(15000,this,TQT_SLOT(showBeginHint())); } void Tron::reset() @@ -274,7 +274,7 @@ void Tron::showWinner(Player player) if(isComputer(Both)) { - QTimer::singleShot(1000,this,SLOT(computerStart())); + TQTimer::singleShot(1000,this,TQT_SLOT(computerStart())); } } @@ -299,7 +299,7 @@ void Tron::updatePixmap() pixmap->fill(Settings::color_Background()); } - QPainter p; + TQPainter p; p.begin(pixmap); // alle Pixel prüfen und evt. zeichnen @@ -313,8 +313,8 @@ void Tron::updatePixmap() } // draw frame - QColor light=parentWidget()->colorGroup().midlight(); - QColor dark=parentWidget()->colorGroup().mid(); + TQColor light=parentWidget()->colorGroup().midlight(); + TQColor dark=parentWidget()->colorGroup().mid(); p.setPen(NoPen); p.setBrush(light); @@ -330,7 +330,7 @@ void Tron::updatePixmap() // draw new player rects void Tron::paintPlayers() { - QPainter p; + TQPainter p; p.begin(this); drawRect(p,players[0].xCoordinate,players[0].yCoordinate); drawRect(p,players[1].xCoordinate,players[1].yCoordinate); @@ -342,7 +342,7 @@ void Tron::paintPlayers() p.end(); } -void Tron::drawRect(QPainter & p, int x, int y) +void Tron::drawRect(TQPainter & p, int x, int y) { int xOffset=x*rectSize+(width()-fieldWidth*rectSize)/2; int yOffset=y*rectSize+(height()-fieldHeight*rectSize)/2; @@ -350,7 +350,7 @@ void Tron::drawRect(QPainter & p, int x, int y) int type=playfield[x][y]; // find out which color to draw - QColor toDraw; + TQColor toDraw; int player; if(type&PLAYER1) // check player bit { @@ -427,14 +427,14 @@ void Tron::setActionCollection(KActionCollection *a) actionCollection = a; } -void Tron::setBackgroundPix(QPixmap pix) +void Tron::setBackgroundPix(TQPixmap pix) { bgPix=pix; if(pixmap!=0){ updatePixmap(); // most pictures have colors, that you can read white text - setPalette(QColor("black")); + setPalette(TQColor("black")); } } @@ -453,7 +453,7 @@ void Tron::setComputerplayer(Player player, bool flag) { players[1].setComputer(flag); if(isComputer(Both)) - QTimer::singleShot(1000,this,SLOT(computerStart())); + TQTimer::singleShot(1000,this,TQT_SLOT(computerStart())); } bool Tron::isComputer(Player player) @@ -581,16 +581,16 @@ void Tron::updateDirections(int playerNr) ** Events ** ** *************************************************************** */ -void Tron::paintEvent(QPaintEvent *e) +void Tron::paintEvent(TQPaintEvent *e) { bitBlt(this,e->rect().topLeft(),pixmap,e->rect()); // if game is paused, print message if(gamePaused) { - QString message=i18n("Game paused"); - QPainter p(this); - QFontMetrics fm=p.fontMetrics(); + TQString message=i18n("Game paused"); + TQPainter p(this); + TQFontMetrics fm=p.fontMetrics(); int w=fm.width(message); p.drawText(width()/2-w/2,height()/2,message); } @@ -598,8 +598,8 @@ void Tron::paintEvent(QPaintEvent *e) // If game ended, print "Crash!" else if(gameEnded) { - QString message=i18n("Crash!"); - QPainter p(this); + TQString message=i18n("Crash!"); + TQPainter p(this); int w=p.fontMetrics().width(message); int h=p.fontMetrics().height(); for(int i=0;i<2;i++) @@ -619,7 +619,7 @@ void Tron::paintEvent(QPaintEvent *e) // draw begin hint if(beginHint) { - QString hint=i18n("Press any of your direction keys to start!"); + TQString hint=i18n("Press any of your direction keys to start!"); int x=p.fontMetrics().width(hint); x=(width()-x)/2; int y=height()/2; @@ -629,13 +629,13 @@ void Tron::paintEvent(QPaintEvent *e) } } -void Tron::resizeEvent(QResizeEvent *) +void Tron::resizeEvent(TQResizeEvent *) { createNewPlayfield(); reset(); } -void Tron::keyPressEvent(QKeyEvent *e) +void Tron::keyPressEvent(TQKeyEvent *e) { KKey key(e); if(!players[1].computer) @@ -718,7 +718,7 @@ void Tron::keyPressEvent(QKeyEvent *e) } } -void Tron::keyReleaseEvent(QKeyEvent * e) +void Tron::keyReleaseEvent(TQKeyEvent * e) { KKey key(e); @@ -785,7 +785,7 @@ void Tron::keyReleaseEvent(QKeyEvent * e) } // if playingfield loses keyboard focus, pause game -void Tron::focusOutEvent(QFocusEvent *) +void Tron::focusOutEvent(TQFocusEvent *) { if(!gameEnded && !gamePaused) { @@ -939,7 +939,7 @@ void Tron::doMove() { //this is for waiting 0,5s before starting next game gameBlocked=true; - QTimer::singleShot(1000,this,SLOT(unblockGame())); + TQTimer::singleShot(1000,this,TQT_SLOT(unblockGame())); return; } } @@ -1056,7 +1056,7 @@ void Tron::doMove() { //this is for waiting 1s before starting next game gameBlocked=true; - QTimer::singleShot(1000,this,SLOT(unblockGame())); + TQTimer::singleShot(1000,this,TQT_SLOT(unblockGame())); } } diff --git a/ktron/tron.h b/ktron/tron.h index ebfc1d56..188604d8 100644 --- a/ktron/tron.h +++ b/ktron/tron.h @@ -26,9 +26,9 @@ #include <config.h> #endif -#include <qwidget.h> -#include <qpainter.h> -#include <qpixmap.h> +#include <tqwidget.h> +#include <tqpainter.h> +#include <tqpixmap.h> #include <math.h> #include <krandomsequence.h> @@ -48,11 +48,11 @@ class Tron : public QWidget Q_OBJECT public: - Tron(QWidget *parent=0, const char *name=0); + Tron(TQWidget *parent=0, const char *name=0); ~Tron(); void setActionCollection(KActionCollection*); void updatePixmap(); - void setBackgroundPix(QPixmap); + void setBackgroundPix(TQPixmap); void setComputerplayer(Player player, bool); bool isComputer(Player player); void setVelocity(int); @@ -80,21 +80,21 @@ protected: /** bitBlt´s the rect that has to be updated from the * bufferpixmap on the screen and writes eventually text */ - void paintEvent(QPaintEvent *); + void paintEvent(TQPaintEvent *); /** resets game and creates a new playingfield */ - void resizeEvent(QResizeEvent *); - void keyPressEvent(QKeyEvent *); - void keyReleaseEvent(QKeyEvent *); + void resizeEvent(TQResizeEvent *); + void keyPressEvent(TQKeyEvent *); + void keyReleaseEvent(TQKeyEvent *); /** pauses game */ - void focusOutEvent(QFocusEvent *); + void focusOutEvent(TQFocusEvent *); private: /** Stores key shortcuts */ KActionCollection* actionCollection; /** Drawing buffer */ - QPixmap *pixmap; + TQPixmap *pixmap; /** The playingfield */ - QMemArray<int> *playfield; + TQMemArray<int> *playfield; /** game status flag */ bool gamePaused; /** game status flag */ @@ -107,11 +107,11 @@ private: int fieldHeight; /** Width of the playingfield in number of rects*/ int fieldWidth; - QTimer *timer; + TQTimer *timer; player players[2]; /** Backgroundpixmap **/ - QPixmap bgPix; + TQPixmap bgPix; /** time in ms between two moves */ int velocity; @@ -137,7 +137,7 @@ private: /** paints players at current player coordinates */ void paintPlayers(); /** draws a rect in current TronStyle at position x,y of the playingfield */ - void drawRect(QPainter & p, int x, int y); + void drawRect(TQPainter & p, int x, int y); /** emits gameEnds(Player) and displays the winner by changing color*/ void showWinner(Player winner); diff --git a/ktuberling/playground.cpp b/ktuberling/playground.cpp index 367c407c..4488fe8d 100644 --- a/ktuberling/playground.cpp +++ b/ktuberling/playground.cpp @@ -11,11 +11,11 @@ #include <kstandarddirs.h> #include <kprinter.h> -#include <qfile.h> -#include <qpainter.h> -#include <qimage.h> -#include <qcursor.h> -#include <qdom.h> +#include <tqfile.h> +#include <tqpainter.h> +#include <tqimage.h> +#include <tqcursor.h> +#include <tqdom.h> #include "playground.moc" #include "toplevel.h" @@ -25,7 +25,7 @@ // Constructor PlayGround::PlayGround(TopLevel *parent, const char *name, uint selectedGameboard) - : QWidget(parent, name) + : TQWidget(parent, name) { topLevel = parent; @@ -38,7 +38,7 @@ PlayGround::PlayGround(TopLevel *parent, const char *name, uint selectedGameboar setBackgroundColor(white); - QDomDocument layoutsDocument; + TQDomDocument layoutsDocument; bool ok = topLevel->loadLayout(layoutsDocument); if (ok) ok = registerPlayGrounds(layoutsDocument); if (ok) ok = loadPlayGround(layoutsDocument, selectedGameboard); @@ -71,7 +71,7 @@ void PlayGround::reset() // Change the gameboard void PlayGround::change(uint selectedGameboard) { - QDomDocument layoutsDocument; + TQDomDocument layoutsDocument; bool ok = topLevel->loadLayout(layoutsDocument); if (ok) ok = loadPlayGround(layoutsDocument, selectedGameboard); if (!ok) loadFailure(); @@ -88,7 +88,7 @@ void PlayGround::change(uint selectedGameboard) // Repaint all the editable area void PlayGround::repaintAll() { - QRect dirtyArea + TQRect dirtyArea (editableArea.left() - 10, editableArea.top() - 10, editableArea.width() + 20, @@ -158,12 +158,12 @@ bool PlayGround::redo() } // Save objects laid down on the editable area -bool PlayGround::saveAs(const QString & name) +bool PlayGround::saveAs(const TQString & name) { FILE *fp; const ToDraw *currentObject; - if (!(fp = fopen((const char *) QFile::encodeName(name), "w"))) return false; + if (!(fp = fopen((const char *) TQFile::encodeName(name), "w"))) return false; fprintf(fp, "%d\n", topLevel->getSelectedGameboard()); for (currentObject = toDraw.first(); currentObject; currentObject = toDraw.next()) @@ -175,21 +175,21 @@ bool PlayGround::saveAs(const QString & name) // Print gameboard's picture bool PlayGround::printPicture(KPrinter &printer) const { - QPainter artist; - QPixmap picture(getPicture()); + TQPainter artist; + TQPixmap picture(getPicture()); if (!artist.begin(&printer)) return false; - artist.drawPixmap(QPoint(32, 32), picture); + artist.drawPixmap(TQPoint(32, 32), picture); if (!artist.end()) return false; return true; } // Get a pixmap containing the current picture -QPixmap PlayGround::getPicture() const +TQPixmap PlayGround::getPicture() const { - QPixmap result(editableArea.size()); - QPainter artist(&result); - QRect transEditableArea(editableArea); + TQPixmap result(editableArea.size()); + TQPainter artist(&result); + TQRect transEditableArea(editableArea); transEditableArea.moveBy(-XMARGIN, -YMARGIN); artist.translate(XMARGIN - editableArea.left(), @@ -199,9 +199,9 @@ QPixmap PlayGround::getPicture() const } // Draw some text -void PlayGround::drawText(QPainter &artist, QRect &area, QString &textId) const +void PlayGround::drawText(TQPainter &artist, TQRect &area, TQString &textId) const { - QString label; + TQString label; label=i18n(textId.latin1()); @@ -209,7 +209,7 @@ void PlayGround::drawText(QPainter &artist, QRect &area, QString &textId) const } // Paint the current picture to the given device -void PlayGround::drawGameboard( QPainter &artist, const QRect &area ) const +void PlayGround::drawGameboard( TQPainter &artist, const TQRect &area ) const { artist.drawPixmap(area.topLeft(), gameboard, area); @@ -218,25 +218,25 @@ void PlayGround::drawGameboard( QPainter &artist, const QRect &area ) const drawText(artist, textsLayout[text], textsList[text]); artist.setPen(black); - for (QPtrListIterator<ToDraw> currentObject(toDraw); + for (TQPtrListIterator<ToDraw> currentObject(toDraw); currentObject.current(); ++currentObject) currentObject.current()->draw(artist, area, objectsLayout, &gameboard, &masks); } // Painting event -void PlayGround::paintEvent( QPaintEvent *event ) +void PlayGround::paintEvent( TQPaintEvent *event ) { - QPoint destination(event->rect().topLeft()), + TQPoint destination(event->rect().topLeft()), position(destination.x() - XMARGIN, destination.y() - YMARGIN); - QRect area(position, QSize(event->rect().size())); - QPixmap cache(gameboard.size()); - QPainter artist(&cache); + TQRect area(position, TQSize(event->rect().size())); + TQPixmap cache(gameboard.size()); + TQPainter artist(&cache); if (destination.x() < XMARGIN) destination.setX(XMARGIN); if (destination.y() < YMARGIN) destination.setY(YMARGIN); - area = QRect(0, 0, gameboard.width(), gameboard.height()).intersect(area); + area = TQRect(0, 0, gameboard.width(), gameboard.height()).intersect(area); if (area.isEmpty()) return; drawGameboard(artist, area); @@ -245,41 +245,41 @@ void PlayGround::paintEvent( QPaintEvent *event ) } // Mouse pressed event -void PlayGround::mousePressEvent( QMouseEvent *event ) +void PlayGround::mousePressEvent( TQMouseEvent *event ) { if (draggedCursor) return; - QPoint position(event->x() - XMARGIN, + TQPoint position(event->x() - XMARGIN, event->y() - YMARGIN); if (!zone(position)) return; int draggedNumber = draggedObject.getNumber(); - QPixmap object(objectsLayout[draggedNumber].size()); - QBitmap shape(objectsLayout[draggedNumber].size()); - bitBlt(&object, QPoint(0, 0), &gameboard, objectsLayout[draggedNumber], Qt::CopyROP); - bitBlt(&shape, QPoint(0, 0), &masks, objectsLayout[draggedNumber], Qt::CopyROP); + TQPixmap object(objectsLayout[draggedNumber].size()); + TQBitmap shape(objectsLayout[draggedNumber].size()); + bitBlt(&object, TQPoint(0, 0), &gameboard, objectsLayout[draggedNumber], Qt::CopyROP); + bitBlt(&shape, TQPoint(0, 0), &masks, objectsLayout[draggedNumber], Qt::CopyROP); object.setMask(shape); - draggedCursor = new QCursor(object, position.x(), position.y()); + draggedCursor = new TQCursor(object, position.x(), position.y()); setCursor(*draggedCursor); topLevel->playSound(soundsList[draggedNumber]); } // Mouse released event -void PlayGround::mouseReleaseEvent( QMouseEvent *event ) +void PlayGround::mouseReleaseEvent( TQMouseEvent *event ) { // If we are not dragging an object, ignore the event if (!draggedCursor) return; - QCursor arrow; + TQCursor arrow; int draggedNumber = draggedObject.getNumber(); - QRect position( + TQRect position( event->x() - XMARGIN - draggedCursor->hotSpot().x(), event->y() - YMARGIN - draggedCursor->hotSpot().y(), objectsLayout[draggedNumber].width(), objectsLayout[draggedNumber].height()); - QRect dirtyArea + TQRect dirtyArea (editableArea.left() - 10, editableArea.top() - 10, editableArea.width() + 20, @@ -325,11 +325,11 @@ void PlayGround::mouseReleaseEvent( QMouseEvent *event ) } // Register the various playgrounds -bool PlayGround::registerPlayGrounds(QDomDocument &layoutDocument) +bool PlayGround::registerPlayGrounds(TQDomDocument &layoutDocument) { - QDomNodeList playGroundsList, menuItemsList, labelsList; - QDomElement playGroundElement, menuItemElement, labelElement; - QDomAttr actionAttribute; + TQDomNodeList playGroundsList, menuItemsList, labelsList; + TQDomElement playGroundElement, menuItemElement, labelElement; + TQDomAttr actionAttribute; playGroundsList = layoutDocument.elementsByTagName("playground"); if (playGroundsList.count() < 1) @@ -337,19 +337,19 @@ bool PlayGround::registerPlayGrounds(QDomDocument &layoutDocument) for (uint i = 0; i < playGroundsList.count(); i++) { - playGroundElement = (const QDomElement &) playGroundsList.item(i).toElement(); + playGroundElement = (const TQDomElement &) playGroundsList.item(i).toElement(); menuItemsList = playGroundElement.elementsByTagName("menuitem"); if (menuItemsList.count() != 1) return false; - menuItemElement = (const QDomElement &) menuItemsList.item(0).toElement(); + menuItemElement = (const TQDomElement &) menuItemsList.item(0).toElement(); labelsList = menuItemElement.elementsByTagName("label"); if (labelsList.count() != 1) return false; - labelElement = (const QDomElement &) labelsList.item(0).toElement(); + labelElement = (const TQDomElement &) labelsList.item(0).toElement(); actionAttribute = menuItemElement.attributeNode("action"); topLevel->registerGameboard(labelElement.text(), actionAttribute.value().latin1()); } @@ -358,15 +358,15 @@ bool PlayGround::registerPlayGrounds(QDomDocument &layoutDocument) } // Load background and draggable objects masks -bool PlayGround::loadPlayGround(QDomDocument &layoutDocument, uint toLoad) +bool PlayGround::loadPlayGround(TQDomDocument &layoutDocument, uint toLoad) { - QDomNodeList playGroundsList, + TQDomNodeList playGroundsList, editableAreasList, categoriesList, objectsList, gameAreasList, maskAreasList, soundNamesList, labelsList; - QDomElement playGroundElement, + TQDomElement playGroundElement, editableAreaElement, categoryElement, objectElement, gameAreaElement, maskAreaElement, soundNameElement, labelElement; - QDomAttr gameboardAttribute, masksAttribute, + TQDomAttr gameboardAttribute, masksAttribute, leftAttribute, topAttribute, rightAttribute, bottomAttribute, refAttribute; @@ -374,7 +374,7 @@ bool PlayGround::loadPlayGround(QDomDocument &layoutDocument, uint toLoad) if (toLoad >= playGroundsList.count()) return false; - playGroundElement = (const QDomElement &) playGroundsList.item(toLoad).toElement(); + playGroundElement = (const TQDomElement &) playGroundsList.item(toLoad).toElement(); gameboardAttribute = playGroundElement.attributeNode("gameboard"); if (!gameboard.load(locate("data", "ktuberling/pics/" + gameboardAttribute.value()))) @@ -388,13 +388,13 @@ bool PlayGround::loadPlayGround(QDomDocument &layoutDocument, uint toLoad) if (editableAreasList.count() != 1) return false; - editableAreaElement = (const QDomElement &) editableAreasList.item(0).toElement(); + editableAreaElement = (const TQDomElement &) editableAreasList.item(0).toElement(); gameAreasList = editableAreaElement.elementsByTagName("position"); if (gameAreasList.count() != 1) return false; - gameAreaElement = (const QDomElement &) gameAreasList.item(0).toElement(); + gameAreaElement = (const TQDomElement &) gameAreasList.item(0).toElement(); leftAttribute = gameAreaElement.attributeNode("left"); topAttribute = gameAreaElement.attributeNode("top"); rightAttribute = gameAreaElement.attributeNode("right"); @@ -410,7 +410,7 @@ bool PlayGround::loadPlayGround(QDomDocument &layoutDocument, uint toLoad) if (soundNamesList.count() != 1) return false; - soundNameElement = (const QDomElement &) soundNamesList.item(0).toElement(); + soundNameElement = (const TQDomElement &) soundNamesList.item(0).toElement(); refAttribute = soundNameElement.attributeNode("ref"); editableSound = refAttribute.value(); @@ -427,13 +427,13 @@ bool PlayGround::loadPlayGround(QDomDocument &layoutDocument, uint toLoad) for (int text = 0; text < texts; text++) { - categoryElement = (const QDomElement &) categoriesList.item(text).toElement(); + categoryElement = (const TQDomElement &) categoriesList.item(text).toElement(); gameAreasList = categoryElement.elementsByTagName("position"); if (gameAreasList.count() != 1) return false; - gameAreaElement = (const QDomElement &) gameAreasList.item(0).toElement(); + gameAreaElement = (const TQDomElement &) gameAreasList.item(0).toElement(); leftAttribute = gameAreaElement.attributeNode("left"); topAttribute = gameAreaElement.attributeNode("top"); rightAttribute = gameAreaElement.attributeNode("right"); @@ -449,7 +449,7 @@ bool PlayGround::loadPlayGround(QDomDocument &layoutDocument, uint toLoad) if (labelsList.count() != 1) return false; - labelElement = (const QDomElement &) labelsList.item(0).toElement(); + labelElement = (const TQDomElement &) labelsList.item(0).toElement(); textsList[text] = labelElement.text(); } @@ -466,13 +466,13 @@ bool PlayGround::loadPlayGround(QDomDocument &layoutDocument, uint toLoad) for (int decoration = 0; decoration < decorations; decoration++) { - objectElement = (const QDomElement &) objectsList.item(decoration).toElement(); + objectElement = (const TQDomElement &) objectsList.item(decoration).toElement(); gameAreasList = objectElement.elementsByTagName("position"); if (gameAreasList.count() != 1) return false; - gameAreaElement = (const QDomElement &) gameAreasList.item(0).toElement(); + gameAreaElement = (const TQDomElement &) gameAreasList.item(0).toElement(); leftAttribute = gameAreaElement.attributeNode("left"); topAttribute = gameAreaElement.attributeNode("top"); rightAttribute = gameAreaElement.attributeNode("right"); @@ -488,7 +488,7 @@ bool PlayGround::loadPlayGround(QDomDocument &layoutDocument, uint toLoad) if (soundNamesList.count() != 1) return false; - soundNameElement = (const QDomElement &) soundNamesList.item(0).toElement(); + soundNameElement = (const TQDomElement &) soundNamesList.item(0).toElement(); refAttribute = soundNameElement.attributeNode("ref"); @@ -518,7 +518,7 @@ void PlayGround::setupGeometry() // In which decorative object are we? // On return, the position is the location of the cursor's hot spot // Returns false if we aren't in any zone -bool PlayGround::zone(QPoint &position) +bool PlayGround::zone(TQPoint &position) { // Scan all available decorative objects on right side because we may be adding one int draggedNumber; @@ -543,14 +543,14 @@ bool PlayGround::zone(QPoint &position) currentObject = toDraw.at(draggedZOrder); if (!currentObject->getPosition().contains(position)) continue; - QRect toUpdate(currentObject->getPosition()); + TQRect toUpdate(currentObject->getPosition()); draggedObject = *currentObject; draggedNumber = draggedObject.getNumber(); - QBitmap shape(objectsLayout[draggedNumber].size()); - QPoint relative(position.x() - toUpdate.x(), + TQBitmap shape(objectsLayout[draggedNumber].size()); + TQPoint relative(position.x() - toUpdate.x(), position.y() - toUpdate.y()); - bitBlt(&shape, QPoint(0, 0), &masks, objectsLayout[draggedNumber], Qt::CopyROP); + bitBlt(&shape, TQPoint(0, 0), &masks, objectsLayout[draggedNumber], Qt::CopyROP); if (!shape.convertToImage().pixelIndex(relative.x(), relative.y())) continue; toDraw.remove(draggedZOrder); @@ -570,14 +570,14 @@ bool PlayGround::zone(QPoint &position) } // Load objects and lay them down on the editable area -bool PlayGround::loadFrom(const QString &name) +bool PlayGround::loadFrom(const TQString &name) { FILE *fp; bool eof = false; ToDraw readObject, *newObject; Action *newAction; - if (!(fp = fopen(QFile::encodeName(name), "r"))) return false; + if (!(fp = fopen(TQFile::encodeName(name), "r"))) return false; uint newGameboard; int nitems = fscanf(fp, "%u\n", &newGameboard); diff --git a/ktuberling/playground.h b/ktuberling/playground.h index ee1a9a51..a84a7e63 100644 --- a/ktuberling/playground.h +++ b/ktuberling/playground.h @@ -10,9 +10,9 @@ #include <kprinter.h> -#include <qwidget.h> -#include <qbitmap.h> -#include <qptrlist.h> +#include <tqwidget.h> +#include <tqbitmap.h> +#include <tqptrlist.h> #include "todraw.h" #include "action.h" @@ -34,50 +34,50 @@ public: void repaintAll(); bool undo(); bool redo(); - bool loadFrom(const QString &name); - bool saveAs(const QString &name); + bool loadFrom(const TQString &name); + bool saveAs(const TQString &name); bool printPicture(KPrinter &printer) const; - QPixmap getPicture() const; + TQPixmap getPicture() const; inline bool isFirstAction() const { return currentAction == 0; } inline bool isLastAction() const { return currentAction >= history.count(); } protected: - virtual void paintEvent(QPaintEvent *event); - virtual void mousePressEvent(QMouseEvent *event); - virtual void mouseReleaseEvent(QMouseEvent *event); + virtual void paintEvent(TQPaintEvent *event); + virtual void mousePressEvent(TQMouseEvent *event); + virtual void mouseReleaseEvent(TQMouseEvent *event); private: - bool registerPlayGrounds(QDomDocument &layoutDocument); - bool loadPlayGround(QDomDocument &layoutDocument, uint toLoad); + bool registerPlayGrounds(TQDomDocument &layoutDocument); + bool loadPlayGround(TQDomDocument &layoutDocument, uint toLoad); void loadFailure(); void setupGeometry(); - bool zone(QPoint &position); - void drawText(QPainter &artist, QRect &area, QString &textId) const; - void drawGameboard(QPainter &artist, const QRect &area) const; + bool zone(TQPoint &position); + void drawText(TQPainter &artist, TQRect &area, TQString &textId) const; + void drawGameboard(TQPainter &artist, const TQRect &area) const; private: - QPixmap gameboard; // Picture of the game board - QBitmap masks; // Pictures of the objects' shapes - QRect editableArea; // Part of the gameboard where the player can lay down objects - QString menuItem, // Menu item describing describing this gameboard + TQPixmap gameboard; // Picture of the game board + TQBitmap masks; // Pictures of the objects' shapes + TQRect editableArea; // Part of the gameboard where the player can lay down objects + TQString menuItem, // Menu item describing describing this gameboard editableSound; // Sound associated with this area int texts, // Number of categories of objects names decorations; // Number of draggable objects on the right side of the gameboard - QRect *textsLayout, // Positions of the categories names + TQRect *textsLayout, // Positions of the categories names *objectsLayout; // Position of the draggable objects on right side of the gameboard - QString *textsList, // List of the message numbers associated with categories + TQString *textsList, // List of the message numbers associated with categories *soundsList; // List of sounds associated with each object - QCursor *draggedCursor; // Cursor's shape for currently dragged object + TQCursor *draggedCursor; // Cursor's shape for currently dragged object ToDraw draggedObject; // Object currently dragged int draggedZOrder; // Z-order (in to-draw buffer) of this object - QPtrList<ToDraw> toDraw; // List of objects in z-order - QPtrList<Action> history; // List of actions in chronological order + TQPtrList<ToDraw> toDraw; // List of objects in z-order + TQPtrList<Action> history; // List of actions in chronological order unsigned int currentAction; // Number of current action (not the last one if used "undo" button!) TopLevel *topLevel; // Top-level window diff --git a/ktuberling/soundfactory.cpp b/ktuberling/soundfactory.cpp index d9bdf48d..9831adcd 100644 --- a/ktuberling/soundfactory.cpp +++ b/ktuberling/soundfactory.cpp @@ -11,7 +11,7 @@ #include <kstandarddirs.h> #include <kaudioplayer.h> -#include <qdom.h> +#include <tqdom.h> #include "soundfactory.h" #include "soundfactory.moc" @@ -19,13 +19,13 @@ // Constructor SoundFactory::SoundFactory(TopLevel *parent, const char *name, uint selectedLanguage) - : QObject(parent, name) + : TQObject(parent, name) { topLevel = parent; namesList = filesList = 0; - QDomDocument layoutsDocument; + TQDomDocument layoutsDocument; bool ok = topLevel->loadLayout(layoutsDocument); if (ok) ok = registerLanguages(layoutsDocument); if (ok) ok = loadLanguage(layoutsDocument, selectedLanguage); @@ -42,17 +42,17 @@ SoundFactory::~SoundFactory() // Change the language void SoundFactory::change(uint selectedLanguage) { - QDomDocument layoutsDocument; + TQDomDocument layoutsDocument; bool ok = topLevel->loadLayout(layoutsDocument); if (ok) ok = loadLanguage(layoutsDocument, selectedLanguage); if (!ok) loadFailure(); } // Play some sound -void SoundFactory::playSound(const QString &soundRef) const +void SoundFactory::playSound(const TQString &soundRef) const { int sound; - QString soundFile; + TQString soundFile; if (!topLevel->isSoundEnabled()) return; @@ -74,11 +74,11 @@ void SoundFactory::loadFailure() } // Register the various languages -bool SoundFactory::registerLanguages(QDomDocument &layoutDocument) +bool SoundFactory::registerLanguages(TQDomDocument &layoutDocument) { - QDomNodeList languagesList, menuItemsList, labelsList; - QDomElement languageElement, menuItemElement, labelElement; - QDomAttr codeAttribute, actionAttribute; + TQDomNodeList languagesList, menuItemsList, labelsList; + TQDomElement languageElement, menuItemElement, labelElement; + TQDomAttr codeAttribute, actionAttribute; bool enabled; languagesList = layoutDocument.elementsByTagName("language"); @@ -87,7 +87,7 @@ bool SoundFactory::registerLanguages(QDomDocument &layoutDocument) for (uint i = 0; i < languagesList.count(); i++) { - languageElement = (const QDomElement &) languagesList.item(i).toElement(); + languageElement = (const TQDomElement &) languagesList.item(i).toElement(); codeAttribute = languageElement.attributeNode("code"); enabled = locate("data", "ktuberling/sounds/" + codeAttribute.value() + "/") != 0; @@ -95,13 +95,13 @@ bool SoundFactory::registerLanguages(QDomDocument &layoutDocument) if (menuItemsList.count() != 1) return false; - menuItemElement = (const QDomElement &) menuItemsList.item(0).toElement(); + menuItemElement = (const TQDomElement &) menuItemsList.item(0).toElement(); labelsList = menuItemElement.elementsByTagName("label"); if (labelsList.count() != 1) return false; - labelElement = (const QDomElement &) labelsList.item(0).toElement(); + labelElement = (const TQDomElement &) labelsList.item(0).toElement(); actionAttribute = menuItemElement.attributeNode("action"); topLevel->registerLanguage(labelElement.text(), actionAttribute.value().latin1(), enabled); } @@ -110,19 +110,19 @@ bool SoundFactory::registerLanguages(QDomDocument &layoutDocument) } // Load the sounds of one given language -bool SoundFactory::loadLanguage(QDomDocument &layoutDocument, uint toLoad) +bool SoundFactory::loadLanguage(TQDomDocument &layoutDocument, uint toLoad) { - QDomNodeList languagesList, + TQDomNodeList languagesList, soundNamesList; - QDomElement languageElement, + TQDomElement languageElement, soundNameElement; - QDomAttr nameAttribute, fileAttribute; + TQDomAttr nameAttribute, fileAttribute; languagesList = layoutDocument.elementsByTagName("language"); if (toLoad >= languagesList.count()) return false; - languageElement = (const QDomElement &) languagesList.item(toLoad).toElement(); + languageElement = (const TQDomElement &) languagesList.item(toLoad).toElement(); soundNamesList = languageElement.elementsByTagName("sound"); sounds = soundNamesList.count(); @@ -136,7 +136,7 @@ bool SoundFactory::loadLanguage(QDomDocument &layoutDocument, uint toLoad) for (uint sound = 0; sound < sounds; sound++) { - soundNameElement = (const QDomElement &) soundNamesList.item(sound).toElement(); + soundNameElement = (const TQDomElement &) soundNamesList.item(sound).toElement(); nameAttribute = soundNameElement.attributeNode("name"); namesList[sound] = nameAttribute.value(); diff --git a/ktuberling/soundfactory.h b/ktuberling/soundfactory.h index 1eb0abd5..7ea0d532 100644 --- a/ktuberling/soundfactory.h +++ b/ktuberling/soundfactory.h @@ -8,7 +8,7 @@ #ifndef _SOUNDFACTORY_H_ #define _SOUNDFACTORY_H_ -#include "qobject.h" +#include "tqobject.h" class QDomDocument; class TopLevel; @@ -23,12 +23,12 @@ public: ~SoundFactory(); void change(uint selectedLanguage); - void playSound(const QString &soundRef) const; + void playSound(const TQString &soundRef) const; protected: - bool registerLanguages(QDomDocument &layoutDocument); - bool loadLanguage(QDomDocument &layoutDocument, uint toLoad); + bool registerLanguages(TQDomDocument &layoutDocument); + bool loadLanguage(TQDomDocument &layoutDocument, uint toLoad); private: @@ -37,7 +37,7 @@ private: private: int sounds; // Number of sounds - QString *namesList, // List of sound names + TQString *namesList, // List of sound names *filesList; // List of sound files associated with each sound name TopLevel *topLevel; // Top-level window diff --git a/ktuberling/todraw.cpp b/ktuberling/todraw.cpp index e12c9e1b..c88328a7 100644 --- a/ktuberling/todraw.cpp +++ b/ktuberling/todraw.cpp @@ -4,8 +4,8 @@ mailto:e.bischoff@noos.fr ------------------------------------------------------------- */ -#include <qbitmap.h> -#include <qpainter.h> +#include <tqbitmap.h> +#include <tqpainter.h> #include "todraw.h" @@ -24,7 +24,7 @@ ToDraw::ToDraw(const ToDraw &model) } // Constructor with arguments -ToDraw::ToDraw(int declaredNumber, const QRect &declaredPosition) +ToDraw::ToDraw(int declaredNumber, const TQRect &declaredPosition) : position(declaredPosition) { number = declaredNumber; @@ -42,17 +42,17 @@ ToDraw &ToDraw::operator=(const ToDraw &model) } // Draw an object previously laid down on the game board -void ToDraw::draw(QPainter &artist, const QRect &area, - const QRect *objectsLayout, - const QPixmap *gameboard, const QBitmap *masks) const +void ToDraw::draw(TQPainter &artist, const TQRect &area, + const TQRect *objectsLayout, + const TQPixmap *gameboard, const TQBitmap *masks) const { if (!position.intersects(area)) return; - QPixmap objectPixmap(objectsLayout[number].size()); - QBitmap shapeBitmap(objectsLayout[number].size()); + TQPixmap objectPixmap(objectsLayout[number].size()); + TQBitmap shapeBitmap(objectsLayout[number].size()); - bitBlt(&objectPixmap, QPoint(0, 0), gameboard, objectsLayout[number], Qt::CopyROP); - bitBlt(&shapeBitmap, QPoint(0, 0), masks, objectsLayout[number], Qt::CopyROP); + bitBlt(&objectPixmap, TQPoint(0, 0), gameboard, objectsLayout[number], Qt::CopyROP); + bitBlt(&shapeBitmap, TQPoint(0, 0), masks, objectsLayout[number], Qt::CopyROP); objectPixmap.setMask(shapeBitmap); artist.drawPixmap(position.topLeft(), objectPixmap); } diff --git a/ktuberling/todraw.h b/ktuberling/todraw.h index 4e46200a..a2753da3 100644 --- a/ktuberling/todraw.h +++ b/ktuberling/todraw.h @@ -8,7 +8,7 @@ #ifndef _TODRAW_H_ #define _TODRAW_H_ -#include <qrect.h> +#include <tqrect.h> #include <stdio.h> @@ -17,19 +17,19 @@ class ToDraw public: ToDraw(); ToDraw(const ToDraw &); - ToDraw(int, const QRect &); + ToDraw(int, const TQRect &); ToDraw &operator=(const ToDraw &); - void draw(QPainter &, const QRect &, const QRect *, const QPixmap *, const QBitmap *) const; + void draw(TQPainter &, const TQRect &, const TQRect *, const TQPixmap *, const TQBitmap *) const; void save(FILE *) const; bool load(FILE *, int, bool &); inline int getNumber() const { return number; } inline void setNumber(int newValue) { number = newValue; } - inline const QRect &getPosition() const { return position; } + inline const TQRect &getPosition() const { return position; } private: int number; - QRect position; + TQRect position; }; #endif diff --git a/ktuberling/toplevel.cpp b/ktuberling/toplevel.cpp index d4ad647c..53566f17 100644 --- a/ktuberling/toplevel.cpp +++ b/ktuberling/toplevel.cpp @@ -15,7 +15,7 @@ #include <kstdgameaction.h> #include <kprinter.h> -#include <qclipboard.h> +#include <tqclipboard.h> #include "toplevel.moc" #include "playground.h" @@ -55,27 +55,27 @@ void TopLevel::enableRedo(bool enable) const } // Register an available gameboard -void TopLevel::registerGameboard(const QString &menuItem, const char *actionId) +void TopLevel::registerGameboard(const TQString &menuItem, const char *actionId) { KToggleAction *t = 0; switch (gameboards) { - case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(gameboard0()), actionCollection(), actionId); + case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard0()), actionCollection(), actionId); break; - case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(gameboard1()), actionCollection(), actionId); + case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard1()), actionCollection(), actionId); break; - case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(gameboard2()), actionCollection(), actionId); + case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard2()), actionCollection(), actionId); break; - case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(gameboard3()), actionCollection(), actionId); + case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard3()), actionCollection(), actionId); break; - case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(gameboard4()), actionCollection(), actionId); + case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard4()), actionCollection(), actionId); break; - case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(gameboard5()), actionCollection(), actionId); + case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard5()), actionCollection(), actionId); break; - case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(gameboard6()), actionCollection(), actionId); + case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard6()), actionCollection(), actionId); break; - case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(gameboard7()), actionCollection(), actionId); + case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard7()), actionCollection(), actionId); break; } @@ -87,43 +87,43 @@ void TopLevel::registerGameboard(const QString &menuItem, const char *actionId) } // Register an available language -void TopLevel::registerLanguage(const QString &menuItem, const char *actionId, bool enabled) +void TopLevel::registerLanguage(const TQString &menuItem, const char *actionId, bool enabled) { KToggleAction *t = 0; switch (languages) { - case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(language0()), actionCollection(), actionId); + case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language0()), actionCollection(), actionId); break; - case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(language1()), actionCollection(), actionId); + case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language1()), actionCollection(), actionId); break; - case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(language2()), actionCollection(), actionId); + case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language2()), actionCollection(), actionId); break; - case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(language3()), actionCollection(), actionId); + case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language3()), actionCollection(), actionId); break; - case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(language4()), actionCollection(), actionId); + case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language4()), actionCollection(), actionId); break; - case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(language5()), actionCollection(), actionId); + case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language5()), actionCollection(), actionId); break; - case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(language6()), actionCollection(), actionId); + case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language6()), actionCollection(), actionId); break; - case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(language7()), actionCollection(), actionId); + case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language7()), actionCollection(), actionId); break; - case 8: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(language8()), actionCollection(), actionId); + case 8: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language8()), actionCollection(), actionId); break; - case 9: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(language9()), actionCollection(), actionId); + case 9: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language9()), actionCollection(), actionId); break; - case 10: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(language10()), actionCollection(), actionId); + case 10: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language10()), actionCollection(), actionId); break; - case 11: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(language11()), actionCollection(), actionId); + case 11: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language11()), actionCollection(), actionId); break; - case 12: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(language12()), actionCollection(), actionId); + case 12: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language12()), actionCollection(), actionId); break; - case 13: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(language13()), actionCollection(), actionId); + case 13: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language13()), actionCollection(), actionId); break; - case 14: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(language14()), actionCollection(), actionId); + case 14: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language14()), actionCollection(), actionId); break; - case 15: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, SLOT(language15()), actionCollection(), actionId); + case 15: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language15()), actionCollection(), actionId); break; } @@ -187,9 +187,9 @@ void TopLevel::changeLanguage(uint newLanguage) } // Load the layouts file -bool TopLevel::loadLayout(QDomDocument &layoutDocument) +bool TopLevel::loadLayout(TQDomDocument &layoutDocument) { - QFile layoutFile(QFile::encodeName(locate("data", "ktuberling/pics/layout.xml"))); + TQFile layoutFile(TQFile::encodeName(locate("data", "ktuberling/pics/layout.xml"))); if (!layoutFile.open(IO_ReadOnly)) return false; @@ -204,7 +204,7 @@ bool TopLevel::loadLayout(QDomDocument &layoutDocument) } // Play a sound -void TopLevel::playSound(const QString &ref) const +void TopLevel::playSound(const TQString &ref) const { soundFactory->playSound(ref); } @@ -213,7 +213,7 @@ void TopLevel::playSound(const QString &ref) const void TopLevel::readOptions() { KConfig *config; - QString option; + TQString option; config = KApplication::kApplication()->config(); @@ -254,22 +254,22 @@ void TopLevel::writeOptions() void TopLevel::setupKAction() { //Game - KStdGameAction::gameNew(this, SLOT(fileNew()), actionCollection()); - KStdGameAction::load(this, SLOT(fileOpen()), actionCollection()); - KStdGameAction::save(this, SLOT(fileSave()), actionCollection()); - KStdGameAction::print(this, SLOT(filePrint()), actionCollection()); - KStdGameAction::quit(kapp, SLOT(quit()), actionCollection()); - (void) new KAction(i18n("Save &as Picture..."), 0, this, SLOT(filePicture()), actionCollection(), "game_save_picture"); + KStdGameAction::gameNew(this, TQT_SLOT(fileNew()), actionCollection()); + KStdGameAction::load(this, TQT_SLOT(fileOpen()), actionCollection()); + KStdGameAction::save(this, TQT_SLOT(fileSave()), actionCollection()); + KStdGameAction::print(this, TQT_SLOT(filePrint()), actionCollection()); + KStdGameAction::quit(kapp, TQT_SLOT(quit()), actionCollection()); + (void) new KAction(i18n("Save &as Picture..."), 0, this, TQT_SLOT(filePicture()), actionCollection(), "game_save_picture"); //Edit - KStdAction::copy(this, SLOT(editCopy()), actionCollection()); - KStdAction::undo(this, SLOT(editUndo()), actionCollection()); - KStdAction::redo(this, SLOT(editRedo()), actionCollection()); + KStdAction::copy(this, TQT_SLOT(editCopy()), actionCollection()); + KStdAction::undo(this, TQT_SLOT(editUndo()), actionCollection()); + KStdAction::redo(this, TQT_SLOT(editRedo()), actionCollection()); enableUndo(false); enableRedo(false); //Speech - KToggleAction* t = new KToggleAction(i18n("&No Sound"), 0, this, SLOT(soundOff()), actionCollection(), "speech_no_sound"); + KToggleAction* t = new KToggleAction(i18n("&No Sound"), 0, this, TQT_SLOT(soundOff()), actionCollection(), "speech_no_sound"); if (!soundEnabled) t->setChecked(true); setupGUI(); @@ -289,7 +289,7 @@ void TopLevel::fileNew() // Load gameboard void TopLevel::fileOpen() { - QString dir = locate("data", "ktuberling/museum/miss.tuberling"); + TQString dir = locate("data", "ktuberling/museum/miss.tuberling"); dir.truncate(dir.findRev('/') + 1); KURL url = KFileDialog::getOpenURL(dir, "*.tuberling"); @@ -302,7 +302,7 @@ void TopLevel::open(const KURL &url) if (url.isEmpty()) return; - QString name; + TQString name; KIO::NetAccess::download(url, name, this); @@ -323,7 +323,7 @@ void TopLevel::open(const KURL &url) void TopLevel::fileSave() { KURL url = KFileDialog::getSaveURL - ( QString::null, + ( TQString::null, "*.tuberling"); if (url.isEmpty()) @@ -337,7 +337,7 @@ void TopLevel::fileSave() return; } - QString name = url.path(); + TQString name = url.path(); int suffix; suffix = name.findRev('.'); @@ -353,10 +353,10 @@ void TopLevel::fileSave() // Save gameboard as picture void TopLevel::filePicture() { - QPixmap picture(playGround->getPicture()); + TQPixmap picture(playGround->getPicture()); KURL url = KFileDialog::getSaveURL - ( QString::null, + ( TQString::null, i18n( "*.xpm|UNIX Pixmaps (*.xpm)\n" "*.jpg|JPEG Compressed Files (*.jpg)\n" "*.png|Next Generation Pictures (*.png)\n" @@ -374,10 +374,10 @@ void TopLevel::filePicture() return; } - QString name = url.path(); + TQString name = url.path(); const char *format; int suffix; - QString end; + TQString end; suffix = name.findRev('.'); if (suffix == -1) @@ -422,8 +422,8 @@ void TopLevel::filePrint() // Copy modified area to clipboard void TopLevel::editCopy() { - QClipboard *clipboard = QApplication::clipboard(); - QPixmap picture(playGround->getPicture()); + QClipboard *clipboard = TQApplication::clipboard(); + TQPixmap picture(playGround->getPicture()); clipboard->setPixmap(picture); } diff --git a/ktuberling/toplevel.h b/ktuberling/toplevel.h index 8d67a252..31848f0f 100644 --- a/ktuberling/toplevel.h +++ b/ktuberling/toplevel.h @@ -27,12 +27,12 @@ public: void open(const KURL &url); void enableUndo(bool enable) const; void enableRedo(bool enable) const; - void registerGameboard(const QString &menuItem, const char *actionId); - void registerLanguage(const QString &menuItem, const char *actionId, bool enabled); + void registerGameboard(const TQString &menuItem, const char *actionId); + void registerLanguage(const TQString &menuItem, const char *actionId, bool enabled); void changeGameboard(uint newGameboard); void changeLanguage(uint newLanguage); - bool loadLayout(QDomDocument &layoutDocument); - void playSound(const QString &ref) const; + bool loadLayout(TQDomDocument &layoutDocument); + void playSound(const TQString &ref) const; inline bool isSoundEnabled() const {return soundEnabled;} inline uint getSelectedGameboard() const {return selectedGameboard;} @@ -95,7 +95,7 @@ private: gameboards; // Total number of gameboards uint selectedLanguage, // Number of selected language languages; // Total number of languages - QString gameboardActions[8], // Name of actions for registered gameboards + TQString gameboardActions[8], // Name of actions for registered gameboards languageActions[16]; // Name of actions for registered languages PlayGround *playGround; // Play ground central widget diff --git a/kwin4/kwin4/kspritecache.cpp b/kwin4/kwin4/kspritecache.cpp index 5be5538d..d293911b 100644 --- a/kwin4/kwin4/kspritecache.cpp +++ b/kwin4/kwin4/kspritecache.cpp @@ -18,22 +18,22 @@ #include "kspritecache.h" #include <kconfig.h> -#include <qbitmap.h> -#include <qimage.h> -#include <qwmatrix.h> -#include <qdir.h> +#include <tqbitmap.h> +#include <tqimage.h> +#include <tqwmatrix.h> +#include <tqdir.h> #include <kdebug.h> // KSprite #include <math.h> -KSpriteCache::KSpriteCache(QString grafixdir, QObject* parent,const char * name) - : QObject(parent,name) +KSpriteCache::KSpriteCache(TQString grafixdir, TQObject* parent,const char * name) + : TQObject(parent,name) { kdDebug(11002) << "KSpriteCache:: grafixdir=" << grafixdir << endl; mConfig=0; mCanvas=0; - setRcFile(QString("grafix.rc")); + setRcFile(TQString("grafix.rc")); setGrafixDir(grafixdir); kdDebug(11002) << "Grafixdir=" << grafixDir() << " rcfile=" << rcFile() << endl; reset(); @@ -47,18 +47,18 @@ KSpriteCache::~KSpriteCache() delete mConfig; } -void KSpriteCache::setRcFile(QString name) +void KSpriteCache::setRcFile(TQString name) { mRcFile=name; } -bool KSpriteCache::setGrafixDir(QString name) +bool KSpriteCache::setGrafixDir(TQString name) { delete mConfig; - QDir dir(name); - QString d; - d=dir.absPath()+QString("/"); - QString file=d+rcFile(); + TQDir dir(name); + TQString d; + d=dir.absPath()+TQString("/"); + TQString file=d+rcFile(); // TODO check for filename kdDebug(11002) << "Opening config " << file << endl; @@ -78,19 +78,19 @@ void KSpriteCache::reset() void KSpriteCache::deleteAllItems() { - QDictIterator<QCanvasItem> it( mItemDict ); + TQDictIterator<TQCanvasItem> it( mItemDict ); //kdDebug(11002) << "KSpriteCache::deleteAllItems items in cache=" << mItemDict.size() << endl; while ( it.current() ) { - QCanvasItem *item=it.current(); + TQCanvasItem *item=it.current(); mItemDict.remove(it.currentKey()); delete item; } } -void KSpriteCache::deleteItem(QString s,int no) +void KSpriteCache::deleteItem(TQString s,int no) { - QCanvasItem *item; - QString name=s+QString("_%1").arg(no); + TQCanvasItem *item; + TQString name=s+TQString("_%1").arg(no); //kdDebug(11002) << "KSpriteCache::deleteItem name=" << name << endl; item=mItemDict[name]; if (item) @@ -101,9 +101,9 @@ void KSpriteCache::deleteItem(QString s,int no) } } -void KSpriteCache::deleteItem(QCanvasItem *item) +void KSpriteCache::deleteItem(TQCanvasItem *item) { - QDictIterator<QCanvasItem> it( mItemDict ); + TQDictIterator<TQCanvasItem> it( mItemDict ); while ( it.current() ) { if (item==it.current()) @@ -119,11 +119,11 @@ void KSpriteCache::deleteItem(QCanvasItem *item) -QCanvasItem *KSpriteCache::getItem(QString name,int no) +TQCanvasItem *KSpriteCache::getItem(TQString name,int no) { - QString dictname=name+QString("_%1").arg(no); - QCanvasItem *item=mItemDict[dictname]; + TQString dictname=name+TQString("_%1").arg(no); + TQCanvasItem *item=mItemDict[dictname]; //kdDebug(11002) << " -> getItem("<<name<<","<<no<<") =>"<<dictname<<endl; // Directly found item if (item) @@ -155,9 +155,9 @@ QCanvasItem *KSpriteCache::getItem(QString name,int no) return item; } -QPixmap * KSpriteCache::loadPixmap(QString file,QString mask,QString dir) +TQPixmap * KSpriteCache::loadPixmap(TQString file,TQString mask,TQString dir) { - QPixmap *newP=new QPixmap; + TQPixmap *newP=new QPixmap; bool result1=false; bool result2=false; if (dir.isNull()) dir=grafixDir(); // default dir @@ -167,8 +167,8 @@ QPixmap * KSpriteCache::loadPixmap(QString file,QString mask,QString dir) } if (result1 && !mask.isNull()) { - QBitmap bitmask; - if (mask==QString("auto")) // self mask..slow but quick to create + TQBitmap bitmask; + if (mask==TQString("auto")) // self mask..slow but quick to create { newP->setMask( newP->createHeuristicMask() ); result2=true; @@ -185,52 +185,52 @@ QPixmap * KSpriteCache::loadPixmap(QString file,QString mask,QString dir) -QCanvasPixmapArray *KSpriteCache::createPixmapArray(KConfig *config,QString name) +TQCanvasPixmapArray *KSpriteCache::createPixmapArray(KConfig *config,TQString name) { config->setGroup(name); - QPoint defaultoffset=QPoint(0,0); + TQPoint defaultoffset=TQPoint(0,0); // offset for the sprite - QPoint offset=config->readPointEntry("offset",&defaultoffset); + TQPoint offset=config->readPointEntry("offset",&defaultoffset); // operatins to perform. Can be ommited if you want only one operation - QStringList operationList=config->readListEntry("pixmaps"); + TQStringList operationList=config->readListEntry("pixmaps"); // Append default entry (empty string) if (operationList.count()==0) { - operationList.append(QString::null); + operationList.append(TQString::null); } // Prepare for the reading of the pixmaps - QPixmap *pixmap=0; - QPtrList<QPixmap> pixlist; + TQPixmap *pixmap=0; + TQPtrList<TQPixmap> pixlist; pixlist.setAutoDelete(true); - QPtrList<QPoint> hotlist; + TQPtrList<TQPoint> hotlist; hotlist.setAutoDelete(true); // work through the operations list and create pixmaps - for ( QStringList::Iterator it = operationList.begin(); it !=operationList.end(); ++it ) + for ( TQStringList::Iterator it = operationList.begin(); it !=operationList.end(); ++it ) { - QString name=*it; + TQString name=*it; // Try to find out what we want to do, e.g. load, scale, ... - QString type=config->readEntry(name+"method"); - if (type.isNull()) type=QString("load"); // default load + TQString type=config->readEntry(name+"method"); + if (type.isNull()) type=TQString("load"); // default load //kdDebug(11002) << " Processing operation " << (name.isNull()?"default":name) << "type="<<type << endl; unsigned int number=config->readNumEntry(name+"number",1); //kdDebug(11002) << " Reading " << number << " frames " << endl; - QString pixfile=config->readPathEntry(name+"file"); - QString maskfile=config->readPathEntry(name+"mask"); + TQString pixfile=config->readPathEntry(name+"file"); + TQString maskfile=config->readPathEntry(name+"mask"); // Load a given set of images or replace a %d by a sequence if there are // less image names than number given - if (type==QString("load")) + if (type==TQString("load")) { // Read images for (unsigned int i=0;i<number;i++) { - QString tmpfile,tmpmask; + TQString tmpfile,tmpmask; tmpfile.sprintf(pixfile.latin1(),i); tmpmask.sprintf(maskfile.latin1(),i); @@ -241,13 +241,13 @@ QCanvasPixmapArray *KSpriteCache::createPixmapArray(KConfig *config,QString name applyFilter(pixmap,config,name); pixlist.append(pixmap); - QPoint *copyoffset=new QPoint(-offset); + TQPoint *copyoffset=new TQPoint(-offset); hotlist.append(copyoffset); } } } // Scale some images in given axis - else if (type==QString("scale")) + else if (type==TQString("scale")) { // scale images int axis=config->readNumEntry(name+"axis",0); @@ -260,7 +260,7 @@ QCanvasPixmapArray *KSpriteCache::createPixmapArray(KConfig *config,QString name pixmap=loadPixmap(pixfile,maskfile); for (unsigned int j=0;j<(unsigned int)number;j++) { - QWMatrix matrix; + TQWMatrix matrix; double sc=1.0-(double)(j)*step; // scale it @@ -268,12 +268,12 @@ QCanvasPixmapArray *KSpriteCache::createPixmapArray(KConfig *config,QString name else if (axis==2) matrix.scale(1.0,sc); else matrix.scale(sc,sc); - QPixmap *copypixmap=new QPixmap(pixmap->xForm(matrix)); + TQPixmap *copypixmap=new TQPixmap(pixmap->xForm(matrix)); applyFilter(copypixmap,config,name); pixlist.append(copypixmap); - QPoint *copyoffset=new QPoint((-pixmap->width()+copypixmap->width())/2,(-pixmap->height()+copypixmap->height())/2); + TQPoint *copyoffset=new TQPoint((-pixmap->width()+copypixmap->width())/2,(-pixmap->height()+copypixmap->height())/2); hotlist.append(copyoffset); } delete pixmap; @@ -288,15 +288,15 @@ QCanvasPixmapArray *KSpriteCache::createPixmapArray(KConfig *config,QString name //kdDebug(11002) <<"Pixarray count="<<pixlist.count()<<endl; if (pixlist.count()<1) return 0; - QCanvasPixmapArray *pixmaparray=new QCanvasPixmapArray(pixlist,hotlist); + TQCanvasPixmapArray *pixmaparray=new TQCanvasPixmapArray(pixlist,hotlist); return pixmaparray; } -void KSpriteCache::applyFilter(QPixmap *pixmap,KConfig *config,QString name) +void KSpriteCache::applyFilter(TQPixmap *pixmap,KConfig *config,TQString name) { - QValueList<int> filterList; + TQValueList<int> filterList; filterList=config->readIntListEntry(name+"colorfilter"); - QValueList<int> transformList; + TQValueList<int> transformList; transformList=config->readIntListEntry(name+"transformfilter"); // apply transformation filter @@ -304,13 +304,13 @@ void KSpriteCache::applyFilter(QPixmap *pixmap,KConfig *config,QString name) { if (transformList[0]==1 && transformList.count()==2) // rotate { - QWMatrix rotate; + TQWMatrix rotate; rotate.rotate(transformList[1]); *pixmap=pixmap->xForm(rotate); } else if (transformList[0]==2 && transformList.count()==3) // scale { - QWMatrix scale; + TQWMatrix scale; scale.scale((double)transformList[1]/100.0,(double)transformList[2]/100.0); *pixmap=pixmap->xForm(scale); } @@ -326,22 +326,22 @@ void KSpriteCache::applyFilter(QPixmap *pixmap,KConfig *config,QString name) } } -void KSpriteCache::changeHSV(QPixmap *pixmap,int dh,int ds,int dv) +void KSpriteCache::changeHSV(TQPixmap *pixmap,int dh,int ds,int dv) { if (!pixmap || (dh==0 && ds==0 && dv==0)) return ; if (pixmap->isNull()) return ; if (pixmap->width()==0 && pixmap->height()==0) return ; int h,s,v; - QColor black=QColor(0,0,0); - QImage img=pixmap->convertToImage(); // slow + TQColor black=TQColor(0,0,0); + TQImage img=pixmap->convertToImage(); // slow for (int y=0;y<img.height();y++) { for (int x=0;x<img.width();x++) { QRgb pix=img.pixel(x,y); - QColor col(pix); + TQColor col(pix); col.hsv(&h,&s,&v); if (col==black) continue; // speed up? h=((unsigned int)(h+dh))%360; @@ -353,13 +353,13 @@ void KSpriteCache::changeHSV(QPixmap *pixmap,int dh,int ds,int dv) } pixmap->convertFromImage(img); // slow } -void KSpriteCache::changeGrey(QPixmap *pixmap,int lighter) +void KSpriteCache::changeGrey(TQPixmap *pixmap,int lighter) { if (!pixmap) return ; if (pixmap->isNull()) return ; if (pixmap->width()==0 && pixmap->height()==0) return ; - QImage img=pixmap->convertToImage(); // slow + TQImage img=pixmap->convertToImage(); // slow for (int y=0;y<img.height();y++) { @@ -367,7 +367,7 @@ void KSpriteCache::changeGrey(QPixmap *pixmap,int lighter) { QRgb pix=img.pixel(x,y); int gray=qGray(qRed(pix),qGreen(pix),qBlue(pix)); - QColor col(gray,gray,gray); + TQColor col(gray,gray,gray); if (lighter>0) col=col.light(lighter); if (lighter<0) col=col.dark(-lighter); img.setPixel(x,y,qRgba(col.red(),col.green(),col.blue(),qAlpha(pix))); @@ -376,30 +376,30 @@ void KSpriteCache::changeGrey(QPixmap *pixmap,int lighter) pixmap->convertFromImage(img); // slow } -QCanvasItem *KSpriteCache::loadItem(KConfig *config,QString name) +TQCanvasItem *KSpriteCache::loadItem(KConfig *config,TQString name) { if (!config) return 0; int rtti=config->readNumEntry("rtti",0); - QCanvasItem *item=0; + TQCanvasItem *item=0; switch(rtti) { - case QCanvasItem::Rtti_Text: + case TQCanvasItem::Rtti_Text: { - QCanvasText *sprite=new QCanvasText(canvas()); + TQCanvasText *sprite=new TQCanvasText(canvas()); //kdDebug(11002) << "new CanvasText =" << sprite << endl; - QString text=config->readEntry("text"); + TQString text=config->readEntry("text"); sprite->setText(text); - QColor color=config->readColorEntry("color"); + TQColor color=config->readColorEntry("color"); sprite->setColor(color); - QFont font=config->readFontEntry("font"); + TQFont font=config->readFontEntry("font"); sprite->setFont(font); - item=(QCanvasItem *)sprite; + item=(TQCanvasItem *)sprite; configureCanvasItem(config,item); } break; case 32: { - QCanvasPixmapArray *pixmaps=createPixmapArray(config,name); + TQCanvasPixmapArray *pixmaps=createPixmapArray(config,name); KSprite *sprite=new KSprite(pixmaps,canvas()); //kdDebug(11002) << "new sprite =" << sprite << endl; double speed=config->readDoubleNumEntry("speed",0.0); @@ -407,7 +407,7 @@ QCanvasItem *KSpriteCache::loadItem(KConfig *config,QString name) //kdDebug(11002) << "speed=" << sprite->speed() << endl; createAnimations(config,sprite); - item=(QCanvasItem *)sprite; + item=(TQCanvasItem *)sprite; configureCanvasItem(config,item); } @@ -421,32 +421,32 @@ QCanvasItem *KSpriteCache::loadItem(KConfig *config,QString name) return item; } -QCanvasItem *KSpriteCache::cloneItem(QCanvasItem *original) +TQCanvasItem *KSpriteCache::cloneItem(TQCanvasItem *original) { if (!original) return 0; int rtti=original->rtti(); - QCanvasItem *item=0; + TQCanvasItem *item=0; switch(rtti) { - case QCanvasItem::Rtti_Text: + case TQCanvasItem::Rtti_Text: { - QCanvasText *sprite=(QCanvasText *)original; - QCanvasText *copy=new QCanvasText(canvas()); - configureCanvasItem(original,(QCanvasItem *)copy); + TQCanvasText *sprite=(TQCanvasText *)original; + TQCanvasText *copy=new TQCanvasText(canvas()); + configureCanvasItem(original,(TQCanvasItem *)copy); copy->setText(sprite->text()); copy->setColor(sprite->color()); copy->setFont(sprite->font()); - item=(QCanvasItem *)copy; + item=(TQCanvasItem *)copy; } break; case 32: { KSprite *sprite=(KSprite *)original; KSprite *copy=new KSprite(sprite->images(),canvas()); - configureCanvasItem(original,(QCanvasItem *)copy); + configureCanvasItem(original,(TQCanvasItem *)copy); copy->setSpeed(sprite->speed()); createAnimations(sprite,copy); - item=(QCanvasItem *)copy; + item=(TQCanvasItem *)copy; } break; default: @@ -459,7 +459,7 @@ QCanvasItem *KSpriteCache::cloneItem(QCanvasItem *original) } -void KSpriteCache::configureCanvasItem(KConfig *config, QCanvasItem *sprite) +void KSpriteCache::configureCanvasItem(KConfig *config, TQCanvasItem *sprite) { double x=config->readDoubleNumEntry("x",0.0); double y=config->readDoubleNumEntry("y",0.0); @@ -472,7 +472,7 @@ void KSpriteCache::configureCanvasItem(KConfig *config, QCanvasItem *sprite) //kdDebug(11002) << "z=" << sprite->z() << endl; } -void KSpriteCache::configureCanvasItem(QCanvasItem *original, QCanvasItem *copy) +void KSpriteCache::configureCanvasItem(TQCanvasItem *original, TQCanvasItem *copy) { copy->setX(original->x()); copy->setY(original->y()); @@ -496,11 +496,11 @@ void KSpriteCache::createAnimations(KConfig *config,KSprite *sprite) if (!sprite) return ; for (int i=0;i<1000;i++) { - QString anim=QString("anim%1").arg(i); + TQString anim=TQString("anim%1").arg(i); if (config->hasKey(anim)) { //kdDebug(11002) << "Found animation key " << anim << endl; - QValueList<int> animList=config->readIntListEntry(anim); + TQValueList<int> animList=config->readIntListEntry(anim); if (animList.count()!=4) { kdWarning(11002) << "KSpriteCache::createAnimations:: warning animation parameter " << anim << " needs four arguments" << endl; @@ -519,8 +519,8 @@ void KSpriteCache::createAnimations(KConfig *config,KSprite *sprite) // ----------------------- KSPRITE -------------------------------- -KSprite::KSprite(QCanvasPixmapArray* array, QCanvas* canvas) - :QCanvasSprite(array,canvas) +KSprite::KSprite(TQCanvasPixmapArray* array, TQCanvas* canvas) + :TQCanvasSprite(array,canvas) { mImages=array; mSpeed=0.0; @@ -670,7 +670,7 @@ void KSprite::advance(int stage) if (mNotify && emitsignal) { //kdDebug(11002) << " ADVANCE emits signal " << emitsignal << " for item "<< this << endl; - mNotify->emitSignal((QCanvasItem *)this,emitsignal); + mNotify->emitSignal((TQCanvasItem *)this,emitsignal); } } @@ -732,13 +732,13 @@ void KSprite::emitNotify(int mode) { if (!mNotify) return ; //kdDebug(11002) << " ADVANCE emits DIRECT signal " << mode << " for item "<< this << endl; - mNotify->emitSignal((QCanvasItem *)this,mode); + mNotify->emitSignal((TQCanvasItem *)this,mode); } -QObject *KSprite::createNotify() +TQObject *KSprite::createNotify() { if (!mNotify) mNotify=new KSpriteNotify; mNotify->incRefCnt(); - return (QObject *)mNotify; + return (TQObject *)mNotify; } void KSprite::deleteNotify() diff --git a/kwin4/kwin4/kspritecache.h b/kwin4/kwin4/kspritecache.h index 628ff5e6..9d762a13 100644 --- a/kwin4/kwin4/kspritecache.h +++ b/kwin4/kwin4/kspritecache.h @@ -17,15 +17,15 @@ #ifndef _KSPRITECACHE_H #define _KSPRITECACHE_H -#include <qcanvas.h> -#include <qdict.h> +#include <tqcanvas.h> +#include <tqdict.h> class KConfig; class KSprite; /** - * this is an internal class to provide a @ref QObject to emit + * this is an internal class to provide a @ref TQObject to emit * a signal from a sprite if a notify object is created * You do not need this directly. * TODO: Can be part of the KSprite class @@ -35,13 +35,13 @@ class KSprite; Q_OBJECT public: - KSpriteNotify() :QObject(0,0) {mRefCnt=0;} - void emitSignal(QCanvasItem *parent,int mode) {emit signalNotify(parent,mode);} + KSpriteNotify() :TQObject(0,0) {mRefCnt=0;} + void emitSignal(TQCanvasItem *parent,int mode) {emit signalNotify(parent,mode);} void incRefCnt() {mRefCnt++;} void decRefCnt() {mRefCnt--;} int refCnt() {return mRefCnt;} signals: - void signalNotify(QCanvasItem *,int); + void signalNotify(TQCanvasItem *,int); private: int mRefCnt; }; @@ -56,10 +56,10 @@ class KSprite; }; /** - * The KSprite class is an advance QCanvasSprite class which + * The KSprite class is an advance TQCanvasSprite class which * is usable with the @ref KSpriteCache. It furthermore contains a * few useful functions like advanced movement and animations which - * go beyond the QCanvasSprite versions of them. Also it provides + * go beyond the TQCanvasSprite versions of them. Also it provides * a signal which is emitted when movement or animation are finished. * * @short The main KDE game object @@ -76,7 +76,7 @@ class KSprite : public QCanvasSprite * @param array - the frames of the sprite * @param canvas - the canvas the sprites lives on **/ - KSprite(QCanvasPixmapArray* array, QCanvas* canvas); + KSprite(TQCanvasPixmapArray* array, TQCanvas* canvas); /** * Destructs the sprite @@ -92,7 +92,7 @@ class KSprite : public QCanvasSprite * returns a pointer to the pixmap array which holds the * frames of the sprite. **/ - QCanvasPixmapArray* images() const {return mImages;} + TQCanvasPixmapArray* images() const {return mImages;} /** * Moves the sprite to the given position with the given speed. @@ -132,10 +132,10 @@ class KSprite : public QCanvasSprite double speed() {return mSpeed;} /** - * returns the notification QObject. You probably do not need this but + * returns the notification TQObject. You probably do not need this but * @ref createNotify instead **/ - QObject *notify() {return (QObject *)mNotify;} + TQObject *notify() {return (TQObject *)mNotify;} /** * Directly emits the notification signal with the given parameter @@ -146,21 +146,21 @@ class KSprite : public QCanvasSprite /** * Creates a notification object. You can connect to it and it will emit - * the signal signalNotify(QCanvasItem *parent, intmode) when a move or + * the signal signalNotify(TQCanvasItem *parent, intmode) when a move or * animation is finished. * Example: * <pre> - * connect(sprite->createNotify(),SIGNAL(signalNotify(QCanvasItem *,int)), - * this,SLOT(moveDone(QCanvasItem *,int))); + * connect(sprite->createNotify(),TQT_SIGNAL(signalNotify(TQCanvasItem *,int)), + * this,TQT_SLOT(moveDone(TQCanvasItem *,int))); * </pre> * In the move done function you best delete the notify again with * @ref deleteNotify **/ - QObject *createNotify(); + TQObject *createNotify(); /** * Deletes the sprite notify if it is no longer used. The notify keeps a - * reference count which deletes the QObject when no reference to it is in + * reference count which deletes the TQObject when no reference to it is in * use. **/ void deleteNotify(); @@ -173,7 +173,7 @@ class KSprite : public QCanvasSprite * @param startframe - the first frame of the animation * @param endframe - the last frame of the animation * @param mode - the mode of the animation see @ref creaetAnimation - * @param delay - the delay in QCanvas animation cycles between two frames + * @param delay - the delay in TQCanvas animation cycles between two frames **/ void getAnimation(int no,int &startframe,int &endframe,int &mode,int &delay); @@ -217,11 +217,11 @@ class KSprite : public QCanvasSprite private: KSpriteNotify *mNotify; - QCanvasPixmapArray* mImages; - QByteArray mAnimFrom; - QByteArray mAnimTo; - QByteArray mAnimDirection; - QByteArray mAnimDelay; + TQCanvasPixmapArray* mImages; + TQByteArray mAnimFrom; + TQByteArray mAnimTo; + TQByteArray mAnimDirection; + TQByteArray mAnimDelay; double mTargetX,mTargetY; double mSpeed; @@ -275,7 +275,7 @@ class KSprite : public QCanvasSprite * </pre> * * @todo Support single sprites (only one copy in memory) - * Support more sprite types (currently KSprite and QCanvasText) + * Support more sprite types (currently KSprite and TQCanvasText) * * @short The main KDE game object * @author Martin Heni <martin@heni-online.de> @@ -291,7 +291,7 @@ class KSpriteCache : public QObject * * @param grafixdir - the directory where the configuration file and the graphics reside **/ - KSpriteCache(QString grafixdir, QObject* parent=0,const char * name=0); + KSpriteCache(TQString grafixdir, TQObject* parent=0,const char * name=0); /** * Delete the sprite cache @@ -303,34 +303,34 @@ class KSpriteCache : public QObject * * @todo this does not flush the cache or so... **/ - bool setGrafixDir(QString dir); // dir and load config + bool setGrafixDir(TQString dir); // dir and load config /** * Change the name of the config file. Its default is <em>grafix.rc</em> **/ - void setRcFile(QString file); + void setRcFile(TQString file); /** * return the graphics directory **/ - QString grafixDir() {return mGrafixDir;} + TQString grafixDir() {return mGrafixDir;} /** * return the rc/configuration file **/ - QString rcFile() {return mRcFile;} + TQString rcFile() {return mRcFile;} /** * returns the canvas which belongs to the cache **/ - QCanvas *canvas() const {return mCanvas;} + TQCanvas *canvas() const {return mCanvas;} /** * sets the canvas belonging to the cache * * @todo could be done in the constructor **/ - void setCanvas(QCanvas *c) {mCanvas=c;} + void setCanvas(TQCanvas *c) {mCanvas=c;} /** * returns the @ref KConfig configuration file where thegraphical data is @@ -363,24 +363,24 @@ class KSpriteCache : public QObject * @todo support loading of frame sequence via one big pixmap * **/ - QCanvasItem *getItem(QString name, int no); + TQCanvasItem *getItem(TQString name, int no); /** * This function loads a pixmap from the given file. Optional you can also * provide a mask file. Also optinal you can provide the directory. Default * is the directory which is set with this @ref KSpriteCache **/ - QPixmap * loadPixmap(QString file,QString mask=QString::null,QString dir=QString::null); + TQPixmap * loadPixmap(TQString file,TQString mask=TQString::null,TQString dir=TQString::null); /** * Deletes a item form the sprite cache given as a pointer to it **/ - void deleteItem(QCanvasItem *item); + void deleteItem(TQCanvasItem *item); /** * Same as above but delete the item with the name and number **/ - void deleteItem(QString s,int no); + void deleteItem(TQString s,int no); /** * Deletes all items in the cache @@ -397,46 +397,46 @@ class KSpriteCache : public QObject * z=(double) * </pre> **/ - void configureCanvasItem(KConfig *config,QCanvasItem *item); + void configureCanvasItem(KConfig *config,TQCanvasItem *item); /** * Copies the default properties for all QCanvasItems from another sprite. * Same as above. **/ - void configureCanvasItem(QCanvasItem *original,QCanvasItem *item); + void configureCanvasItem(TQCanvasItem *original,TQCanvasItem *item); /** * Loads an item with the given name form the given config file. From the * rtti entry it is determined what type it is and then it is loaded. **/ - virtual QCanvasItem *loadItem(KConfig *config,QString name); + virtual TQCanvasItem *loadItem(KConfig *config,TQString name); /** * Clone the sprite from another sprite, mostly from the copy stored in the * cache. **/ - virtual QCanvasItem *cloneItem(QCanvasItem *original); + virtual TQCanvasItem *cloneItem(TQCanvasItem *original); /** * Creates a pixmap array for a @ref KSprite from the given config file * for the sprite with the given name (is the name necessary?). * Parameters are * <pre> - * offset=(QPoint) : The sprites offset (where 0,0 is) - * pixmaps=(QStringList) : List of operations to create frames (TODO * rename) + * offset=(TQPoint) : The sprites offset (where 0,0 is) + * pixmaps=(TQStringList) : List of operations to create frames (TODO * rename) * if ommited one operation without name is used * </pre> * All following calls have to be preceded by every given string of the * pixmaps section. If this section is not supplied they can be used without * prefix but only one frame sequence is created. * <pre> - * method=(QString) : load, scale (default=load) + * method=(TQString) : load, scale (default=load) * load: loads number frames from file * scale: scales number frames from one loaded file * number=(int) : how many frames to generate * file=(Qstring) : the filename to load (can contain printf format args * as %d which are replaced, e.g. file=hello_%d.png - * mask=(QString) : Same for the mask of the pixmaps + * mask=(TQString) : Same for the mask of the pixmaps * axis=(int) : (scale only): scale axis (1=x,2=y,3=x+y) * final=(double) : final scale in percent (default 0.0, i.e. complete scaling) * colorfilter=1,h,s,v: make a HSV transform of all sprite images @@ -444,7 +444,7 @@ class KSpriteCache : public QObject * colorfilter=2,g : make it gray and lighter (positiv) or darker (negative) * </pre> **/ - virtual QCanvasPixmapArray *createPixmapArray(KConfig *config,QString name); + virtual TQCanvasPixmapArray *createPixmapArray(KConfig *config,TQString name); /** * Reads the animations from the config file and calls the corresponding @@ -474,18 +474,18 @@ class KSpriteCache : public QObject * than 100 the pixmap is made lighter and if it less then 100 it is * made darker too **/ - virtual void changeGrey(QPixmap *pixmap,int lighter=100); + virtual void changeGrey(TQPixmap *pixmap,int lighter=100); /** * Change the HAS value of the pixmap by dH, dS and dV **/ - virtual void changeHSV(QPixmap *pixmap,int dh,int ds,int dv); + virtual void changeHSV(TQPixmap *pixmap,int dh,int ds,int dv); /** * Apply the filters as defined in the config file to the sprite name * (TODO is this argument needed) to the pixmap. */ - virtual void applyFilter(QPixmap *pixmap,KConfig *config,QString name); + virtual void applyFilter(TQPixmap *pixmap,KConfig *config,TQString name); /** * resets the cache (?) @@ -493,13 +493,13 @@ class KSpriteCache : public QObject void reset(); protected: - QDict<QCanvasItem> mItemDict; // Spritename lookup - QDict<QCanvasItem> mCloneDict; // clone Items lookup + TQDict<TQCanvasItem> mItemDict; // Spritename lookup + TQDict<TQCanvasItem> mCloneDict; // clone Items lookup - QString mGrafixDir; - QString mRcFile; + TQString mGrafixDir; + TQString mRcFile; KConfig *mConfig; - QCanvas *mCanvas; + TQCanvas *mCanvas; }; diff --git a/kwin4/kwin4/kwin4.cpp b/kwin4/kwin4/kwin4.cpp index fb66e687..16b37da5 100644 --- a/kwin4/kwin4/kwin4.cpp +++ b/kwin4/kwin4/kwin4.cpp @@ -16,13 +16,13 @@ ***************************************************************************/ // include files for QT -#include <qstring.h> -#include <qlayout.h> -#include <qhgroupbox.h> -#include <qvbox.h> -#include <qradiobutton.h> -#include <qvbuttongroup.h> -#include <qlcdnumber.h> +#include <tqstring.h> +#include <tqlayout.h> +#include <tqhgroupbox.h> +#include <tqvbox.h> +#include <tqradiobutton.h> +#include <tqvbuttongroup.h> +#include <tqlcdnumber.h> // include files for KDE #include <kapplication.h> @@ -35,7 +35,7 @@ #include <kdebug.h> #include <kstdaction.h> #include <kaction.h> -#include <qpushbutton.h> +#include <tqpushbutton.h> #include <kstatusbar.h> #include <kconfigdialog.h> @@ -63,26 +63,26 @@ * Constructor for the chat widget. This widget * is derived from the libkdegames chat widget */ -ChatDlg::ChatDlg(KGame *game,QWidget *parent) +ChatDlg::ChatDlg(KGame *game,TQWidget *parent) : KDialogBase(Plain,i18n("Chat Dlg"),Ok,Ok,parent,0,false,true),mChat(0), mChatDlg(0) { - setMinimumSize(QSize(200,200)); + setMinimumSize(TQSize(200,200)); - QGridLayout* mGridLayout=new QGridLayout(plainPage()); - QHBoxLayout* h = new QHBoxLayout(plainPage()); - QHGroupBox* b = new QHGroupBox(i18n("Chat"), plainPage()); + TQGridLayout* mGridLayout=new TQGridLayout(plainPage()); + TQHBoxLayout* h = new TQHBoxLayout(plainPage()); + TQHGroupBox* b = new TQHGroupBox(i18n("Chat"), plainPage()); mChat = new KGameChat(game, 10000, b); h->addWidget(b, 1); h->addSpacing(10); mGridLayout->addLayout(h,0,0); - QPushButton *mButton=new QPushButton(i18n("Configure..."),plainPage()); + TQPushButton *mButton=new TQPushButton(i18n("Configure..."),plainPage()); mGridLayout->addWidget(mButton,1,1); adjustSize(); mChatDlg=new KChatDialog(mChat,plainPage(),true); - connect(mButton,SIGNAL(clicked()),mChatDlg,SLOT(show())); + connect(mButton,TQT_SIGNAL(clicked()),mChatDlg,TQT_SLOT(show())); } /** @@ -107,7 +107,7 @@ void ChatDlg::setPlayer(Kwin4Player *p) /** * Construct the main application window */ -Kwin4App::Kwin4App(QWidget *parent, const char *name) : KMainWindow(parent,name), view(0), doc(0), mChat(0), mMyChatDlg(0) +Kwin4App::Kwin4App(TQWidget *parent, const char *name) : KMainWindow(parent,name), view(0), doc(0), mChat(0), mMyChatDlg(0) { initGUI(); initStatusBar(); @@ -188,50 +188,50 @@ void Kwin4App::checkMenus(CheckFlags menu) */ void Kwin4App::initGUI() { - KStdGameAction::gameNew(this, SLOT(newGame()), actionCollection(), "new_game"); + KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection(), "new_game"); ACTION("new_game")->setStatusText(i18n("Start a new game")); - KStdGameAction::load(this, SLOT(slotOpenGame()), actionCollection(), "open"); + KStdGameAction::load(this, TQT_SLOT(slotOpenGame()), actionCollection(), "open"); ACTION("open")->setStatusText(i18n("Open a saved game...")); - KStdGameAction::save(this, SLOT(slotSaveGame()), actionCollection(), "save"); + KStdGameAction::save(this, TQT_SLOT(slotSaveGame()), actionCollection(), "save"); ACTION("save")->setStatusText(i18n("Save a game...")); - KStdGameAction::end(this, SLOT(endGame()), actionCollection(), "end_game"); + KStdGameAction::end(this, TQT_SLOT(endGame()), actionCollection(), "end_game"); ACTION("end_game")->setStatusText(i18n("Ending the current game...")); ACTION("end_game")->setWhatsThis(i18n("Aborts a currently played game. No winner will be declared.")); - new KAction(i18n("&Network Configuration..."),0, this, SLOT(slotInitNetwork()), + new KAction(i18n("&Network Configuration..."),0, this, TQT_SLOT(slotInitNetwork()), actionCollection(), "network_conf"); - new KAction(i18n("Network Chat..."),0, this, SLOT(slotChat()), + new KAction(i18n("Network Chat..."),0, this, TQT_SLOT(slotChat()), actionCollection(), "network_chat"); if (global_debug>0) - new KAction(i18n("Debug KGame"), 0, this, SLOT(slotDebugKGame()), + new KAction(i18n("Debug KGame"), 0, this, TQT_SLOT(slotDebugKGame()), actionCollection(), "file_debug"); new KAction(i18n("&Show Statistics"),"flag", 0, this, - SLOT(showStatistics()), actionCollection(), "statistics"); + TQT_SLOT(showStatistics()), actionCollection(), "statistics"); ACTION("statistics")->setStatusText(i18n("Show statistics.")); - KStdGameAction::hint(doc, SLOT(calcHint()), actionCollection(), "hint"); + KStdGameAction::hint(doc, TQT_SLOT(calcHint()), actionCollection(), "hint"); ACTION("hint")->setStatusText(i18n("Shows a hint on how to move.")); - KStdGameAction::quit(this, SLOT(close()), actionCollection(), "game_exit"); + KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection(), "game_exit"); ACTION("game_exit")->setStatusText(i18n("Quits the program.")); - KStdGameAction::undo(this, SLOT(slotUndo()), actionCollection(), "edit_undo"); + KStdGameAction::undo(this, TQT_SLOT(slotUndo()), actionCollection(), "edit_undo"); ACTION("edit_undo")->setStatusText(i18n("Undo last move.")); - KStdGameAction::redo(this, SLOT(slotRedo()), actionCollection(), "edit_redo"); + KStdGameAction::redo(this, TQT_SLOT(slotRedo()), actionCollection(), "edit_redo"); ACTION("edit_redo")->setStatusText(i18n("Redo last move.")); actionCollection()->setHighlightingEnabled(true); - connect(actionCollection(), SIGNAL(actionStatusText(const QString &)), SLOT(slotStatusMsg(const QString &))); - connect(actionCollection(), SIGNAL(clearStatusText()), SLOT(slotClearStatusText())); + connect(actionCollection(), TQT_SIGNAL(actionStatusText(const TQString &)), TQT_SLOT(slotStatusMsg(const TQString &))); + connect(actionCollection(), TQT_SIGNAL(clearStatusText()), TQT_SLOT(slotClearStatusText())); - KStdAction::preferences(this, SLOT(showSettings()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection()); } /** @@ -263,17 +263,17 @@ void Kwin4App::initDocument() { doc = new Kwin4Doc(this); // Game Over signal - connect(doc,SIGNAL(signalGameOver(int, KPlayer *,KGame *)), - this,SLOT(slotGameOver(int, KPlayer *,KGame *))); - connect(doc,SIGNAL(signalMoveDone(int, int)), - this,SLOT(slotMoveDone(int, int))); - connect(doc,SIGNAL(signalClientLeftGame(int, int,KGame *)), - this,SLOT(slotNetworkBroken(int, int, KGame *))); - connect(doc,SIGNAL(signalNextPlayer()), - this,SLOT(slotStatusNames())); + connect(doc,TQT_SIGNAL(signalGameOver(int, KPlayer *,KGame *)), + this,TQT_SLOT(slotGameOver(int, KPlayer *,KGame *))); + connect(doc,TQT_SIGNAL(signalMoveDone(int, int)), + this,TQT_SLOT(slotMoveDone(int, int))); + connect(doc,TQT_SIGNAL(signalClientLeftGame(int, int,KGame *)), + this,TQT_SLOT(slotNetworkBroken(int, int, KGame *))); + connect(doc,TQT_SIGNAL(signalNextPlayer()), + this,TQT_SLOT(slotStatusNames())); - connect(doc,SIGNAL(signalGameRun()), - this,SLOT(slotNewGame())); + connect(doc,TQT_SIGNAL(signalGameRun()), + this,TQT_SLOT(slotNewGame())); } void Kwin4App::changeAction(const char *action, bool enable){ @@ -290,7 +290,7 @@ void Kwin4App::changeAction(const char *action, bool enable){ */ void Kwin4App::saveProperties(KConfig *cfg) { - QString tempfile = kapp->tempSaveName(QDir::currentDirPath()+"kwin4"); + TQString tempfile = kapp->tempSaveName(TQDir::currentDirPath()+"kwin4"); cfg->writePathEntry("filename", tempfile ); doc->save(tempfile); } @@ -300,7 +300,7 @@ void Kwin4App::saveProperties(KConfig *cfg) */ void Kwin4App::readProperties(KConfig* cfg) { - QString filename = cfg->readPathEntry("filename"); + TQString filename = cfg->readPathEntry("filename"); if(!filename.isEmpty()) doc->load(filename); } @@ -310,9 +310,9 @@ void Kwin4App::readProperties(KConfig* cfg) */ void Kwin4App::slotOpenGame() { - QString dir(":<kwin4>"); - QString filter("*"); - QString file("/tmp/kwin.save"); + TQString dir(":<kwin4>"); + TQString filter("*"); + TQString file("/tmp/kwin.save"); if (global_debug < 10) file=KFileDialog::getOpenFileName(dir,filter,this); doc->load(file,true); @@ -324,9 +324,9 @@ void Kwin4App::slotOpenGame() */ void Kwin4App::slotSaveGame() { - QString dir(":<kwin4>"); - QString filter("*"); - QString file("/tmp/kwin.save"); + TQString dir(":<kwin4>"); + TQString filter("*"); + TQString file("/tmp/kwin.save"); if (global_debug < 10) file=KFileDialog::getSaveFileName(dir,filter,this); doc->save(file); @@ -384,7 +384,7 @@ void Kwin4App::showStatistics() dlg->p2_aborted->display(doc->QueryStat(Rot, TBrk)); dlg->p2_sum->display(doc->QueryStat(Rot, TSum)); - if(dlg->exec() == QDialog::Rejected) + if(dlg->exec() == TQDialog::Rejected) doc->ResetStat(); } @@ -419,7 +419,7 @@ void Kwin4App::slotRedo() * Set the given text into the statusbar * change status message permanently */ -void Kwin4App::slotStatusMsg(const QString &text) +void Kwin4App::slotStatusMsg(const TQString &text) { statusBar()->clear(); statusBar()->changeItem(text, ID_STATUS_MSG); @@ -430,7 +430,7 @@ void Kwin4App::slotStatusMsg(const QString &text) * the player currently moving * change status mover permanently */ -void Kwin4App::slotStatusMover(const QString &text) +void Kwin4App::slotStatusMover(const TQString &text) { statusBar()->clear(); statusBar()->changeItem(text, ID_STATUS_MOVER); @@ -452,13 +452,13 @@ void Kwin4App::EndGame(TABLE mode) * Set the names in the mover field */ void Kwin4App::slotStatusNames(){ - QString msg; + TQString msg; if (!(doc->gameStatus()==KGame::Run)) msg=i18n("No game "); else if (doc->QueryCurrentPlayer()==Gelb) - msg=QString(" ")+doc->QueryName(Gelb)+ i18n(" - Yellow "); + msg=TQString(" ")+doc->QueryName(Gelb)+ i18n(" - Yellow "); else if (doc->QueryCurrentPlayer()) - msg=QString(" ")+doc->QueryName(Rot)+ i18n(" - Red "); + msg=TQString(" ")+doc->QueryName(Rot)+ i18n(" - Red "); else msg=i18n("Nobody "); slotStatusMover(msg); @@ -509,13 +509,13 @@ void Kwin4App::slotGameOver(int status, KPlayer * p, KGame * /*me*/) EndGame(TWin); else EndGame(TLost); - QString msg=i18n("%1 won the game. Please restart next round.").arg(doc->QueryName(((FARBE)p->userId()))); + TQString msg=i18n("%1 won the game. Please restart next round.").arg(doc->QueryName(((FARBE)p->userId()))); slotStatusMsg(msg); } else if (status==2) // Abort { EndGame(TBrk); - QString m=i18n(" Game aborted. Please restart next round."); + TQString m=i18n(" Game aborted. Please restart next round."); slotStatusMsg(m); } else @@ -529,7 +529,7 @@ void Kwin4App::slotInitNetwork() { if (doc->gameStatus()==Kwin4Doc::Intro) doc->setGameStatus(Kwin4Doc::Pause); - QString host = Prefs::host(); + TQString host = Prefs::host(); int port=Prefs::port(); // just for testing - should be non-modal @@ -538,15 +538,15 @@ void Kwin4App::slotInitNetwork() dlg.networkConfig()->setDefaultNetworkInfo(host, port); dlg.networkConfig()->setDiscoveryInfo("_kwin4._tcp",Prefs::gamename()); - QVBox *box=dlg.configPage(KGameDialog::NetworkConfig); - QVBoxLayout *l=(QVBoxLayout *)(box->layout()); + TQVBox *box=dlg.configPage(KGameDialog::NetworkConfig); + TQVBoxLayout *l=(TQVBoxLayout *)(box->layout()); - mColorGroup=new QVButtonGroup(box); - connect(mColorGroup, SIGNAL(clicked(int)), this, SLOT(slotRemoteChanged(int))); - connect(dlg.networkConfig(), SIGNAL(signalServerTypeChanged(int)), this, SLOT(slotServerTypeChanged(int))); + mColorGroup=new TQVButtonGroup(box); + connect(mColorGroup, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(slotRemoteChanged(int))); + connect(dlg.networkConfig(), TQT_SIGNAL(signalServerTypeChanged(int)), this, TQT_SLOT(slotServerTypeChanged(int))); - new QRadioButton(i18n("Yellow should be played by remote"), mColorGroup); - new QRadioButton(i18n("Red should be played by remote"), mColorGroup); + new TQRadioButton(i18n("Yellow should be played by remote"), mColorGroup); + new TQRadioButton(i18n("Red should be played by remote"), mColorGroup); l->addWidget(mColorGroup); mColorGroup->setButton(0); slotRemoteChanged(0); @@ -590,8 +590,8 @@ void Kwin4App::slotChat() mMyChatDlg->setPlayer(doc->getPlayer(Gelb)); else mMyChatDlg->setPlayer(doc->getPlayer(Rot)); - connect(doc,SIGNAL(signalChatChanged(Kwin4Player *)), - mMyChatDlg,SLOT(setPlayer(Kwin4Player *))); + connect(doc,TQT_SIGNAL(signalChatChanged(Kwin4Player *)), + mMyChatDlg,TQT_SLOT(setPlayer(Kwin4Player *))); } if (mMyChatDlg->isHidden()) @@ -619,7 +619,7 @@ void Kwin4App::showSettings(){ KConfigDialog *dialog = new KConfigDialog(this, "settings", Prefs::self(), KDialogBase::Swallow); Settings *general = new Settings(0, "General"); dialog->addPage(general, i18n("General"), "package_settings"); - connect(dialog, SIGNAL(settingsChanged()), doc, SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), doc, TQT_SLOT(loadSettings())); dialog->show(); } diff --git a/kwin4/kwin4/kwin4.h b/kwin4/kwin4/kwin4.h index 572381f1..bca0a4f0 100644 --- a/kwin4/kwin4/kwin4.h +++ b/kwin4/kwin4/kwin4.h @@ -39,7 +39,7 @@ class KDE_EXPORT ChatDlg : public KDialogBase { Q_OBJECT public: - ChatDlg(KGame *game,QWidget* parent=0); + ChatDlg(KGame *game,TQWidget* parent=0); public slots: void setPlayer(Kwin4Player *p); @@ -58,7 +58,7 @@ class Kwin4App : public KMainWindow Q_OBJECT public: - Kwin4App(QWidget *parent=0, const char *name=0); + Kwin4App(TQWidget *parent=0, const char *name=0); protected: void EndGame(TABLE mode); @@ -105,14 +105,14 @@ public slots: void slotUndo(); void slotRedo(); - void slotStatusMover(const QString &text); - void slotStatusMsg(const QString &text); + void slotStatusMover(const TQString &text); + void slotStatusMsg(const TQString &text); private: Kwin4View *view; Kwin4Doc *doc; - QVButtonGroup *mColorGroup; + TQVButtonGroup *mColorGroup; KGameChat *mChat; ChatDlg *mMyChatDlg; diff --git a/kwin4/kwin4/kwin4doc.cpp b/kwin4/kwin4/kwin4doc.cpp index 4c85f70e..cfc99c63 100644 --- a/kwin4/kwin4/kwin4doc.cpp +++ b/kwin4/kwin4/kwin4doc.cpp @@ -18,8 +18,8 @@ #include "kwin4doc.h" // include files for Qt -#include <qdir.h> -#include <qtimer.h> +#include <tqdir.h> +#include <tqtimer.h> // include files for KDE #include <klocale.h> @@ -36,10 +36,10 @@ #include "prefs.h" #include "statuswidget.h" -Kwin4Doc::Kwin4Doc(QWidget *parent, const char *) : KGame(1234,parent), pView(0), mHintProcess(0) +Kwin4Doc::Kwin4Doc(TQWidget *parent, const char *) : KGame(1234,parent), pView(0), mHintProcess(0) { - connect(this,SIGNAL(signalPropertyChanged(KGamePropertyBase *,KGame *)), - this,SLOT(slotPropertyChanged(KGamePropertyBase *,KGame *))); + connect(this,TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase *,KGame *)), + this,TQT_SLOT(slotPropertyChanged(KGamePropertyBase *,KGame *))); dataHandler()->Debug(); //kdDebug(12010) << "Property 7 policy=" << dataHandler()->find(7)->policy() << endl; @@ -62,25 +62,25 @@ Kwin4Doc::Kwin4Doc(QWidget *parent, const char *) : KGame(1234,parent), pView(0) // The field array needs not be updated as any move will change it // Careful only in new ResetGame! Maybe unlocal it there! // mField.setPolicy(KGamePropertyBase::PolicyLocal); - mField.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,QString("mField")); + mField.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,TQString("mField")); mFieldFilled.resize(7); mHistory.resize(43); - mHistory.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,QString("mHistory")); - - mAmzug.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,QString("mAmzug")); - mCurrentMove.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,QString("mCurrentMove")); - mMaxMove.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,QString("mMaxMove")); - mFieldFilled.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,QString("mFieldFilled")); - mHistoryCnt.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,QString("mHistoryCnt")); - mLastColumn.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,QString("mLastColumn")); - mLastHint.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,QString("mLastHint")); - mLastColour.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,QString("mLastColour")); - mScore.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,QString("mScore")); + mHistory.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,TQString("mHistory")); + + mAmzug.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,TQString("mAmzug")); + mCurrentMove.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,TQString("mCurrentMove")); + mMaxMove.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,TQString("mMaxMove")); + mFieldFilled.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,TQString("mFieldFilled")); + mHistoryCnt.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,TQString("mHistoryCnt")); + mLastColumn.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,TQString("mLastColumn")); + mLastHint.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,TQString("mLastHint")); + mLastColour.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,TQString("mLastColour")); + mScore.registerData(dataHandler(),KGamePropertyBase::PolicyLocal,TQString("mScore")); // game startup parameter mStartPlayer=Gelb; - mStartPlayer.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,QString("mStartPlayer")); + mStartPlayer.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,TQString("mStartPlayer")); SetCurrentPlayer((FARBE)mStartPlayer.value()); if (global_debug>1) kdDebug(12010) << "amZug policy=" << mAmzug.policy() << endl; @@ -93,14 +93,14 @@ Kwin4Doc::Kwin4Doc(QWidget *parent, const char *) : KGame(1234,parent), pView(0) setGameStatus(Intro); // Listen to network - connect(this,SIGNAL(signalMessageUpdate(int,Q_UINT32,Q_UINT32)), - this,SLOT(slotMessageUpdate(int, Q_UINT32,Q_UINT32))); - connect(this,SIGNAL(signalClientJoinedGame(Q_UINT32,KGame *)), - this,SLOT(slotClientConnected(Q_UINT32, KGame *))); + connect(this,TQT_SIGNAL(signalMessageUpdate(int,Q_UINT32,Q_UINT32)), + this,TQT_SLOT(slotMessageUpdate(int, Q_UINT32,Q_UINT32))); + connect(this,TQT_SIGNAL(signalClientJoinedGame(Q_UINT32,KGame *)), + this,TQT_SLOT(slotClientConnected(Q_UINT32, KGame *))); // Debug only - connect(this,SIGNAL(signalGameOver(int, KPlayer *,KGame *)), - this,SLOT(slotGameOver(int, KPlayer *,KGame *))); + connect(this,TQT_SIGNAL(signalGameOver(int, KPlayer *,KGame *)), + this,TQT_SLOT(slotGameOver(int, KPlayer *,KGame *))); // Change global KGame policy //dataHandler()->setPolicy(KGamePropertyBase::PolicyDirty,false); @@ -232,7 +232,7 @@ void Kwin4Doc::EndGame(TABLE mode) // switch start player } -void Kwin4Doc::moveDone(QCanvasItem *item,int ) +void Kwin4Doc::moveDone(TQCanvasItem *item,int ) { //kdDebug(12010) << "########################## SPRITE MOVE DONE ################# " << endl; //Debug(); @@ -398,14 +398,14 @@ bool Kwin4Doc::RedoMove(){ /** * Set the name of col */ -void Kwin4Doc::SetName(FARBE i, const QString &n){ +void Kwin4Doc::SetName(FARBE i, const TQString &n){ getPlayer(i)->setName(n); } /** * Query the name of i */ -QString Kwin4Doc::QueryName(FARBE i){ +TQString Kwin4Doc::QueryName(FARBE i){ return getPlayer(i)->name(); } @@ -777,24 +777,24 @@ int Kwin4Doc::QueryHistoryCnt() /** * Return the name of the computer player process */ -QString Kwin4Doc::QueryProcessName() +TQString Kwin4Doc::QueryProcessName() { // First try a local dir override - QDir dir; - QString filename=dir.path()+QString("/kwin4/kwin4proc"); - QFile flocal(filename); + TQDir dir; + TQString filename=dir.path()+TQString("/kwin4/kwin4proc"); + TQFile flocal(filename); if (flocal.exists()) { if (global_debug>1) kdDebug(12010) << " Found local process " << filename << endl; return filename; } - QString path=kapp->dirs()->findExe("kwin4proc"); + TQString path=kapp->dirs()->findExe("kwin4proc"); if (!path.isNull()) { if (global_debug>1) kdDebug(12010) << " Found system process " << path << endl; return path; } - QString empty; + TQString empty; kdError() << "Could not locate the computer player" << endl; return empty; } @@ -813,8 +813,8 @@ KPlayer *Kwin4Doc::createPlayer(int /*rtti*/,int io,bool isvirtual) if (!isvirtual) createIO(player,(KGameIO::IOMode)io); - connect(player,SIGNAL(signalPropertyChanged(KGamePropertyBase *, KPlayer *)), - this,SLOT(slotPlayerPropertyChanged(KGamePropertyBase *, KPlayer *))); + connect(player,TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase *, KPlayer *)), + this,TQT_SLOT(slotPlayerPropertyChanged(KGamePropertyBase *, KPlayer *))); ((Kwin4Player *)player)->setWidget(pView->statusWidget()); return player; } @@ -823,12 +823,12 @@ KPlayer *Kwin4Doc::createPlayer(int /*rtti*/,int io,bool isvirtual) * Called when a player input is received from the KGame object * this is e-.g. a mouse event */ -bool Kwin4Doc::playerInput(QDataStream &msg, KPlayer * /*player*/) +bool Kwin4Doc::playerInput(TQDataStream &msg, KPlayer * /*player*/) { int move, pl; msg >> pl >> move; if (!Move(move,pl)) - QTimer::singleShot(0, this,SLOT(slotRepeatMove())); + TQTimer::singleShot(0, this,TQT_SLOT(slotRepeatMove())); return false; } @@ -907,24 +907,24 @@ void Kwin4Doc::createIO(KPlayer *player,KGameIO::IOMode io) input=new KGameMouseIO(pView); if (global_debug>1) kdDebug(12010) << "MOUSE IO added " << endl; // Connect mouse input to a function to process the actual input - connect(input,SIGNAL(signalMouseEvent(KGameIO *,QDataStream &,QMouseEvent *,bool *)), - pView,SLOT(slotMouseInput(KGameIO *,QDataStream &,QMouseEvent *,bool *))); + connect(input,TQT_SIGNAL(signalMouseEvent(KGameIO *,TQDataStream &,TQMouseEvent *,bool *)), + pView,TQT_SLOT(slotMouseInput(KGameIO *,TQDataStream &,TQMouseEvent *,bool *))); player->addGameIO(input); } else if (io&KGameIO::ProcessIO) { - QString file=QueryProcessName(); + TQString file=QueryProcessName(); if (global_debug>1) kdDebug(12010) << "Creating PROCESS IO " << file << endl; KGameProcessIO *input; // We want a computer player input=new KGameProcessIO(file); // Connect computer player to the setTurn - connect(input,SIGNAL(signalPrepareTurn(QDataStream &,bool,KGameIO *,bool *)), - this,SLOT(slotPrepareTurn(QDataStream &,bool,KGameIO *,bool *))); + connect(input,TQT_SIGNAL(signalPrepareTurn(TQDataStream &,bool,KGameIO *,bool *)), + this,TQT_SLOT(slotPrepareTurn(TQDataStream &,bool,KGameIO *,bool *))); - connect(input,SIGNAL(signalProcessQuery(QDataStream &,KGameProcessIO *)), - this,SLOT(slotProcessQuery(QDataStream &,KGameProcessIO *))); + connect(input,TQT_SIGNAL(signalProcessQuery(TQDataStream &,KGameProcessIO *)), + this,TQT_SLOT(slotProcessQuery(TQDataStream &,KGameProcessIO *))); player->addGameIO(input); } else if (io&KGameIO::KeyIO) @@ -934,8 +934,8 @@ void Kwin4Doc::createIO(KPlayer *player,KGameIO::IOMode io) KGameKeyIO *input; input=new KGameKeyIO(pView->parentWidget()); // Connect keys input to a function to process the actual input - connect((KGameKeyIO *)input,SIGNAL(signalKeyEvent(KGameIO *,QDataStream &,QKeyEvent *,bool *)), - pView,SLOT(slotKeyInput(KGameIO *,QDataStream &,QKeyEvent *,bool *))); + connect((KGameKeyIO *)input,TQT_SIGNAL(signalKeyEvent(KGameIO *,TQDataStream &,TQKeyEvent *,bool *)), + pView,TQT_SLOT(slotKeyInput(KGameIO *,TQDataStream &,TQKeyEvent *,bool *))); player->addGameIO(input); } } @@ -943,7 +943,7 @@ void Kwin4Doc::createIO(KPlayer *player,KGameIO::IOMode io) /** * This slot is called when a computer move should be generated */ -void Kwin4Doc::slotPrepareTurn(QDataStream &stream,bool b,KGameIO *input,bool *sendit) +void Kwin4Doc::slotPrepareTurn(TQDataStream &stream,bool b,KGameIO *input,bool *sendit) { if (global_debug>1) kdDebug(12010) << " Kwin4Doc::slotPrepareTurn b="<<b << endl; @@ -968,7 +968,7 @@ void Kwin4Doc::slotPrepareTurn(QDataStream &stream,bool b,KGameIO *input,bool *s * Careful: The data needs to be the same than the computer * player reading on the other side **/ -void Kwin4Doc::prepareGameMessage(QDataStream &stream, Q_INT32 pl) +void Kwin4Doc::prepareGameMessage(TQDataStream &stream, Q_INT32 pl) { if (global_debug>1) kdDebug(12010) << " sending col=" << pl << endl; stream << pl ; @@ -1000,7 +1000,7 @@ void Kwin4Doc::prepareGameMessage(QDataStream &stream, Q_INT32 pl) stream << (Q_INT32)421256; } -void Kwin4Doc::slotProcessQuery(QDataStream &in,KGameProcessIO * /*me*/) +void Kwin4Doc::slotProcessQuery(TQDataStream &in,KGameProcessIO * /*me*/) { Q_INT8 cid; in >> cid; @@ -1098,18 +1098,18 @@ void Kwin4Doc::calcHint() // We allocate the hint process only if it is needed if (!mHintProcess) { - QString file=QueryProcessName(); + TQString file=QueryProcessName(); if (global_debug>1) kdDebug(12010) << "Creating HINT PROCESS IO " << endl; // We want a computer player mHintProcess=new KGameProcessIO(file); - connect(mHintProcess,SIGNAL(signalProcessQuery(QDataStream &,KGameProcessIO *)), - this,SLOT(slotProcessHint(QDataStream &,KGameProcessIO *))); + connect(mHintProcess,TQT_SIGNAL(signalProcessQuery(TQDataStream &,KGameProcessIO *)), + this,TQT_SLOT(slotProcessHint(TQDataStream &,KGameProcessIO *))); } Q_INT32 pl; - QByteArray buffer; - QDataStream stream(buffer,IO_WriteOnly); + TQByteArray buffer; + TQDataStream stream(buffer,IO_WriteOnly); pl=QueryCurrentPlayer(); prepareGameMessage(stream,pl); mHintProcess->sendMessage(stream,2,0,gameId()); @@ -1119,7 +1119,7 @@ void Kwin4Doc::calcHint() * The compute rprocess sent a hint which we show in the * game board **/ -void Kwin4Doc::slotProcessHint(QDataStream &in,KGameProcessIO * /*me*/) +void Kwin4Doc::slotProcessHint(TQDataStream &in,KGameProcessIO * /*me*/) { Q_INT8 cid; in >> cid; @@ -1223,7 +1223,7 @@ void Kwin4Doc::slotGameOver(int status, KPlayer * p, KGame * /*me*/) * when a game is loaded. This can either be via a networ * connect or via a real load from file **/ -bool Kwin4Doc::loadgame(QDataStream &stream,bool network,bool reset) +bool Kwin4Doc::loadgame(TQDataStream &stream,bool network,bool reset) { if (global_debug>1) kdDebug () << "loadgame() network=" << network << " reset="<< reset << endl; @@ -1273,7 +1273,7 @@ bool Kwin4Doc::loadgame(QDataStream &stream,bool network,bool reset) * what is local * This function is only called in the Admin. */ -void Kwin4Doc::newPlayersJoin(KGamePlayerList * /*oldList*/,KGamePlayerList *newList,QValueList<int> &inactivate) +void Kwin4Doc::newPlayersJoin(KGamePlayerList * /*oldList*/,KGamePlayerList *newList,TQValueList<int> &inactivate) { if (global_debug>1) kdDebug(12010) << "newPlayersJoin: START"<<endl; diff --git a/kwin4/kwin4/kwin4doc.h b/kwin4/kwin4/kwin4doc.h index 9ab2b55a..7679dc05 100644 --- a/kwin4/kwin4/kwin4doc.h +++ b/kwin4/kwin4/kwin4doc.h @@ -50,7 +50,7 @@ class Kwin4Doc : public KGame Q_OBJECT public: - Kwin4Doc(QWidget *parent, const char *name=0); + Kwin4Doc(TQWidget *parent, const char *name=0); ~Kwin4Doc(); /** adds a view to the document which represents the document contents. Usually this is your main view. */ @@ -58,7 +58,7 @@ public: /** initializes the players */ void initPlayers(); /** saves the document under filename and format.*/ - bool loadgame(QDataStream &stream, bool network, bool reset); + bool loadgame(TQDataStream &stream, bool network, bool reset); int QueryLastHint(); int QueryHeight(int x); @@ -67,8 +67,8 @@ public: int CheckGameOver(int x, FARBE col); FARBE QueryPlayerColour(int player); int QueryStat(FARBE i, TABLE mode); - QString QueryName(FARBE i); - void SetName(FARBE i, const QString &n); + TQString QueryName(FARBE i); + void SetName(FARBE i, const TQString &n); /** * Set and query the IO mode of player Gelb/Rot @@ -112,21 +112,21 @@ public: void SetCurrentMove(int ); // 0..42 int QueryMaxMove(); // 0..42 int QueryHistoryCnt(); // 0..42 - QString QueryProcessName(); + TQString QueryProcessName(); KPlayer *createPlayer(int rtti, int io, bool isvirtual); KPlayer * nextPlayer(KPlayer *last, bool exclusive=true); - void newPlayersJoin(KGamePlayerList *,KGamePlayerList *,QValueList<int> &); + void newPlayersJoin(KGamePlayerList *,KGamePlayerList *,TQValueList<int> &); protected: bool Move(int x,int id); /** Check whether the field has a game over situation */ int checkGameOver(KPlayer *); /** Send to the computer player */ - void prepareGameMessage(QDataStream &stream, Q_INT32 pl); + void prepareGameMessage(TQDataStream &stream, Q_INT32 pl); /** Main function to do player input */ - bool playerInput(QDataStream &msg,KPlayer *player); + bool playerInput(TQDataStream &msg,KPlayer *player); /** Set the IO devices new */ void recalcIO(); /** Set the turn of the current player to true */ @@ -138,12 +138,12 @@ public slots: void slotPropertyChanged(KGamePropertyBase *,KGame *); void slotPlayerPropertyChanged(KGamePropertyBase *,KPlayer *); - void moveDone(QCanvasItem *,int); + void moveDone(TQCanvasItem *,int); void slotMessageUpdate(int,Q_UINT32,Q_UINT32); - void slotPrepareTurn(QDataStream &stream,bool b,KGameIO *input,bool *eatevent); + void slotPrepareTurn(TQDataStream &stream,bool b,KGameIO *input,bool *eatevent); void slotClientConnected(Q_UINT32,KGame *); - void slotProcessQuery(QDataStream &,KGameProcessIO *); - void slotProcessHint(QDataStream &,KGameProcessIO *); + void slotProcessQuery(TQDataStream &,KGameProcessIO *); + void slotProcessHint(TQDataStream &,KGameProcessIO *); void slotGameOver(int status, KPlayer * p, KGame * me); void slotRepeatMove(); void loadSettings(); diff --git a/kwin4/kwin4/kwin4player.cpp b/kwin4/kwin4/kwin4player.cpp index 65a7947c..5c35d0c6 100644 --- a/kwin4/kwin4/kwin4player.cpp +++ b/kwin4/kwin4/kwin4player.cpp @@ -27,24 +27,24 @@ Kwin4Player::Kwin4Player() : KPlayer(), sWidget(0) { int id; - id=mWin.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,QString("mWin")); - id=mRemis.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,QString("mRemis")); - id=mLost.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,QString("mLost")); - id=mBrk.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,QString("mBrk")); - id=mAllWin.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,QString("mAllWin")); - id=mAllRemis.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,QString("mAllRemis")); - id=mAllLost.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,QString("mAllLost")); - id=mAllBrk.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,QString("mAllBrk")); + id=mWin.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,TQString("mWin")); + id=mRemis.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,TQString("mRemis")); + id=mLost.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,TQString("mLost")); + id=mBrk.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,TQString("mBrk")); + id=mAllWin.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,TQString("mAllWin")); + id=mAllRemis.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,TQString("mAllRemis")); + id=mAllLost.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,TQString("mAllLost")); + id=mAllBrk.registerData(dataHandler(),KGamePropertyBase::PolicyDirty,TQString("mAllBrk")); dataHandler()->setPolicy(KGamePropertyBase::PolicyDirty,false); resetStats(); - connect(this,SIGNAL(signalPropertyChanged(KGamePropertyBase *,KPlayer *)), - this,SLOT(slotPlayerPropertyChanged(KGamePropertyBase *,KPlayer *))); + connect(this,TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase *,KPlayer *)), + this,TQT_SLOT(slotPlayerPropertyChanged(KGamePropertyBase *,KPlayer *))); } -#include <qlabel.h> -#include <qlcdnumber.h> +#include <tqlabel.h> +#include <tqlcdnumber.h> void Kwin4Player::slotPlayerPropertyChanged(KGamePropertyBase *prop, KPlayer * /*player*/) { diff --git a/kwin4/kwin4/kwin4proc.cpp b/kwin4/kwin4/kwin4proc.cpp index 604600ec..6a655f25 100644 --- a/kwin4/kwin4/kwin4proc.cpp +++ b/kwin4/kwin4/kwin4proc.cpp @@ -38,7 +38,7 @@ #define START_REK 1 // (0) 1:Nur Stellungsbewertung bei Level 1 // 0:Level 1 schon eine Rekursion -KComputer::KComputer() : QObject(0,0) +KComputer::KComputer() : TQObject(0,0) { InitField(); @@ -51,31 +51,31 @@ KComputer::KComputer() : QObject(0,0) for (i=0;i<strlen(s2);i++) startofrow[i]=s2[i]-'0'; - connect(&proc,SIGNAL(signalCommand(QDataStream &,int ,int ,int )), - this,SLOT(slotCommand(QDataStream & ,int ,int ,int ))); - connect(&proc,SIGNAL(signalInit(QDataStream &,int)), - this,SLOT(slotInit(QDataStream & ,int ))); - connect(&proc,SIGNAL(signalTurn(QDataStream &,bool )), - this,SLOT(slotTurn(QDataStream & ,bool ))); + connect(&proc,TQT_SIGNAL(signalCommand(TQDataStream &,int ,int ,int )), + this,TQT_SLOT(slotCommand(TQDataStream & ,int ,int ,int ))); + connect(&proc,TQT_SIGNAL(signalInit(TQDataStream &,int)), + this,TQT_SLOT(slotInit(TQDataStream & ,int ))); + connect(&proc,TQT_SIGNAL(signalTurn(TQDataStream &,bool )), + this,TQT_SLOT(slotTurn(TQDataStream & ,bool ))); fprintf(stderr, "----------------->\nKComputer::Computer\n"); } -void KComputer::slotInit(QDataStream &in,int id) +void KComputer::slotInit(TQDataStream &in,int id) { fprintf(stderr,"----------------->\nKComputer::slotInit\nid:%d\n",id); /* - QByteArray buffer; - QDataStream out(buffer,IO_WriteOnly); + TQByteArray buffer; + TQDataStream out(buffer,IO_WriteOnly); int msgid=KGameMessage::IdProcessQuery; out << (int)1; proc.sendSystemMessage(out,msgid,0); */ } -void KComputer::slotTurn(QDataStream &in,bool turn) +void KComputer::slotTurn(TQDataStream &in,bool turn) { - QByteArray buffer; - QDataStream out(buffer,IO_WriteOnly); + TQByteArray buffer; + TQDataStream out(buffer,IO_WriteOnly); fprintf(stderr,"----------------->\nKComputer::slotTurn\nturn:%d\n",turn); if (turn) { @@ -91,13 +91,13 @@ void KComputer::sendValue(long value) { Q_INT8 cid=1; // notifies our KGameIO that this is a value message int id=KGameMessage::IdProcessQuery; - QByteArray buffer; - QDataStream out(buffer,IO_WriteOnly); + TQByteArray buffer; + TQDataStream out(buffer,IO_WriteOnly); out << cid << value; proc.sendSystemMessage(out,id,0); } -long KComputer::think(QDataStream &in,QDataStream &out,bool hint) +long KComputer::think(TQDataStream &in,TQDataStream &out,bool hint) { Q_INT32 pl; Q_INT32 move; @@ -174,11 +174,11 @@ long KComputer::think(QDataStream &in,QDataStream &out,bool hint) return aktwert; } -void KComputer::slotCommand(QDataStream &in,int msgid,int receiver,int sender) +void KComputer::slotCommand(TQDataStream &in,int msgid,int receiver,int sender) { fprintf(stderr,"----------------->\nKComputer::slotCommand\nMsgid:%d\n",msgid); - QByteArray buffer; - QDataStream out(buffer,IO_WriteOnly); + TQByteArray buffer; + TQDataStream out(buffer,IO_WriteOnly); switch(msgid) { case 2: // hint diff --git a/kwin4/kwin4/kwin4proc.h b/kwin4/kwin4/kwin4proc.h index b865b5cb..d18f5bf3 100644 --- a/kwin4/kwin4/kwin4proc.h +++ b/kwin4/kwin4/kwin4proc.h @@ -39,14 +39,14 @@ public: KGameProcess proc; public slots: - void slotCommand(QDataStream &, int msgid,int receiver,int sender); - void slotInit(QDataStream &, int id); - void slotTurn(QDataStream &, bool turn); + void slotCommand(TQDataStream &, int msgid,int receiver,int sender); + void slotInit(TQDataStream &, int id); + void slotTurn(TQDataStream &, bool turn); protected: void sendValue(long value); long random(long max); - long think(QDataStream &in,QDataStream &out,bool hint); + long think(TQDataStream &in,TQDataStream &out,bool hint); // Old computer stuff Farbe SwitchPlayer(Farbe amZug=Niemand); diff --git a/kwin4/kwin4/kwin4view.cpp b/kwin4/kwin4/kwin4view.cpp index 20d83dee..1a3e11f9 100644 --- a/kwin4/kwin4/kwin4view.cpp +++ b/kwin4/kwin4/kwin4view.cpp @@ -30,15 +30,15 @@ #include "statuswidget.h" #include "kspritecache.h" -#include <qlabel.h> -#include <qlcdnumber.h> +#include <tqlabel.h> +#include <tqlcdnumber.h> -#define COL_STATUSLIGHT QColor(210,210,255) -#define COL_STATUSFIELD QColor(130,130,255) -#define COL_STATUSDARK QColor(0,0,65) +#define COL_STATUSLIGHT TQColor(210,210,255) +#define COL_STATUSFIELD TQColor(130,130,255) +#define COL_STATUSDARK TQColor(0,0,65) #define COL_STATUSBORDER black -#define COL_PLAYER QColor(255,255,0) +#define COL_PLAYER TQColor(255,255,0) #define COL_RED red #define COL_YELLOW yellow @@ -101,15 +101,15 @@ private: }; -Kwin4View::Kwin4View(Kwin4Doc *theDoc, QWidget *parent, const char *name) - : QCanvasView(0,parent, name), doc(theDoc) +Kwin4View::Kwin4View(Kwin4Doc *theDoc, TQWidget *parent, const char *name) + : TQCanvasView(0,parent, name), doc(theDoc) { mLastArrow=-1; // localise data file - QString file="kwin4/grafix/default/grafix.rc"; - QString mGrafix=kapp->dirs()->findResourceDir("data",file); + TQString file="kwin4/grafix/default/grafix.rc"; + TQString mGrafix=kapp->dirs()->findResourceDir("data",file); if (mGrafix.isNull()) mGrafix="grafix/default/"; else @@ -127,19 +127,19 @@ Kwin4View::Kwin4View(Kwin4Doc *theDoc, QWidget *parent, const char *name) setHScrollBarMode(AlwaysOff); //setBackgroundMode(PaletteBase); - setBackgroundColor(QColor(0,0,128)); + setBackgroundColor(TQColor(0,0,128)); - mCanvas=new QCanvas(parent); + mCanvas=new TQCanvas(parent); mCanvas->resize(parent->width(),parent->height()); mCanvas->setDoubleBuffering(true); - mCanvas->setBackgroundColor(QColor(0,0,128)); + mCanvas->setBackgroundColor(TQColor(0,0,128)); setCanvas(mCanvas); mCache=new KSpriteCache(mGrafix,this); mCache->setCanvas(mCanvas); KConfig *config=mCache->config(); - QPoint pnt; + TQPoint pnt; config->setGroup("game"); pnt=config->readPointEntry("scorewidget"); @@ -150,10 +150,10 @@ Kwin4View::Kwin4View(Kwin4Doc *theDoc, QWidget *parent, const char *name) pnt=config->readPointEntry("statuswidget"); mStatusWidget=new StatusWidget(this); mStatusWidget->move(pnt); - QPalette pal; - pal.setColor(QColorGroup::Light, COL_STATUSLIGHT); - pal.setColor(QColorGroup::Mid, COL_STATUSFIELD); - pal.setColor(QColorGroup::Dark, COL_STATUSDARK); + TQPalette pal; + pal.setColor(TQColorGroup::Light, COL_STATUSLIGHT); + pal.setColor(TQColorGroup::Mid, COL_STATUSFIELD); + pal.setColor(TQColorGroup::Dark, COL_STATUSDARK); mStatusWidget->setPalette(pal); mStatusWidget->setBackgroundColor(COL_STATUSFIELD); @@ -198,11 +198,11 @@ void Kwin4View::initView(bool deleteall) mSpreadY=config->readNumEntry("spread_y",0); //kdDebug(12010) << "Spread : x=" << mSpreadX << " y=" << mSpreadY << endl; - QPixmap *pixmap=loadPixmap("background.png"); + TQPixmap *pixmap=loadPixmap("background.png"); if (pixmap) mCanvas->setBackgroundPixmap(*pixmap); else - mCanvas->setBackgroundColor(QColor(0,0,128)); + mCanvas->setBackgroundColor(TQColor(0,0,128)); delete pixmap; if (doc->gameStatus()==KGame::Intro) @@ -249,7 +249,7 @@ void Kwin4View::initView(bool deleteall) clearError(); } -QPixmap *Kwin4View::loadPixmap(QString name) +TQPixmap *Kwin4View::loadPixmap(TQString name) { if (!mCache) return 0; @@ -316,12 +316,12 @@ void Kwin4View::hideIntro() sprite=(KSprite *)(mCache->getItem("win4about",2)); if (sprite) sprite->hide(); - QCanvasText *text; - text=(QCanvasText *)(mCache->getItem("intro1",1)); + TQCanvasText *text; + text=(TQCanvasText *)(mCache->getItem("intro1",1)); if (text) text->hide(); - text=(QCanvasText *)(mCache->getItem("intro2",1)); + text=(TQCanvasText *)(mCache->getItem("intro2",1)); if (text) text->hide(); - text=(QCanvasText *)(mCache->getItem("intro3",1)); + text=(TQCanvasText *)(mCache->getItem("intro3",1)); if (text) text->hide(); } @@ -343,20 +343,20 @@ void Kwin4View::drawIntro(bool /*remove*/) sprite->show(); } - QCanvasText *text; - text=(QCanvasText *)(mCache->getItem("intro1",1)); + TQCanvasText *text; + text=(TQCanvasText *)(mCache->getItem("intro1",1)); if (text) { text->setText(i18n("1. intro line, welcome to win4","Welcome")); text->show(); } - text=(QCanvasText *)(mCache->getItem("intro2",1)); + text=(TQCanvasText *)(mCache->getItem("intro2",1)); if (text) { text->setText(i18n("2. intro line, welcome to win4","to")); text->show(); } - text=(QCanvasText *)(mCache->getItem("intro3",1)); + text=(TQCanvasText *)(mCache->getItem("intro3",1)); if (text) { text->setText(i18n("3. intro line, welcome to win4","KWin4")); @@ -371,8 +371,8 @@ void Kwin4View::drawIntro(bool /*remove*/) if (sprite) { KIntroMove *move=new KIntroMove; - connect(sprite->createNotify(),SIGNAL(signalNotify(QCanvasItem *,int)), - this,SLOT(introMoveDone(QCanvasItem *,int))); + connect(sprite->createNotify(),TQT_SIGNAL(signalNotify(TQCanvasItem *,int)), + this,TQT_SLOT(introMoveDone(TQCanvasItem *,int))); sprite->setMoveObject(move); if (no%2==0) { @@ -402,7 +402,7 @@ void Kwin4View::drawIntro(bool /*remove*/) /** * received after the movment of an intro sprite is finished **/ -void Kwin4View::introMoveDone(QCanvasItem *item,int ) +void Kwin4View::introMoveDone(TQCanvasItem *item,int ) { KSprite *sprite=(KSprite *)item; sprite->deleteNotify(); @@ -531,8 +531,8 @@ void Kwin4View::setPiece(int x,int y,int color,int no,bool animation) mBoardY-sprite->height()-mSpreadY); sprite->moveTo(sprite->x(), sprite->y()+y*(sprite->height()+mSpreadY)+mBoardY); - connect(sprite->createNotify(),SIGNAL(signalNotify(QCanvasItem *,int)), - doc,SLOT(moveDone(QCanvasItem *,int))); + connect(sprite->createNotify(),TQT_SIGNAL(signalNotify(TQCanvasItem *,int)), + doc,TQT_SLOT(moveDone(TQCanvasItem *,int))); } else { @@ -541,8 +541,8 @@ void Kwin4View::setPiece(int x,int y,int color,int no,bool animation) y*(sprite->height()+mSpreadY)+mBoardY); // Prevent moving (== speed =0) sprite->moveTo(sprite->x(),sprite->y()); - connect(sprite->createNotify(),SIGNAL(signalNotify(QCanvasItem *,int)), - doc,SLOT(moveDone(QCanvasItem *,int))); + connect(sprite->createNotify(),TQT_SIGNAL(signalNotify(TQCanvasItem *,int)), + doc,TQT_SLOT(moveDone(TQCanvasItem *,int))); sprite->emitNotify(3); } @@ -600,16 +600,16 @@ bool Kwin4View::wrongPlayer(KPlayer *player,KGameIO::IOMode io) clearError(); int rnd=(kapp->random()%4) +1; - QString m; - m=QString("text%1").arg(rnd); - QString ms; + TQString m; + m=TQString("text%1").arg(rnd); + TQString ms; if (rnd==1) ms=i18n("Hold on... the other player has not been yet..."); else if (rnd==2) ms=i18n("Hold your horses..."); else if (rnd==3) ms=i18n("Ah ah ah... only one go at a time..."); else ms=i18n("Please wait... it is not your turn."); // TODO MH can be unique - QCanvasText *text=(QCanvasText *)(mCache->getItem(m,1)); + TQCanvasText *text=(TQCanvasText *)(mCache->getItem(m,1)); if (text) { text->setText(ms); @@ -624,7 +624,7 @@ bool Kwin4View::wrongPlayer(KPlayer *player,KGameIO::IOMode io) **/ // This is analogous to the mouse event only it is called when a key is // pressed -void Kwin4View::slotKeyInput(KGameIO *input,QDataStream &stream,QKeyEvent *e,bool *eatevent) +void Kwin4View::slotKeyInput(KGameIO *input,TQDataStream &stream,TQKeyEvent *e,bool *eatevent) { // Ignore non running if (!doc->isRunning()) @@ -632,7 +632,7 @@ void Kwin4View::slotKeyInput(KGameIO *input,QDataStream &stream,QKeyEvent *e,boo // kdDebug(12010) << "KEY EVENT" << e->ascii() << endl; // Ignore non key press - if (e->type() != QEvent::KeyPress) return ; + if (e->type() != TQEvent::KeyPress) return ; // Our player KPlayer *player=input->player(); @@ -661,14 +661,14 @@ void Kwin4View::slotKeyInput(KGameIO *input,QDataStream &stream,QKeyEvent *e,boo * This slot is called when a mouse key is pressed. As the mouse is used as * input for all players * this slot is called to generate a player move out of a mouse input, i.e. - * it converts a QMouseEvent into a move for the game. We do here some + * it converts a TQMouseEvent into a move for the game. We do here some * simple nonsense and use the position of the mouse to generate * moves containing the keycodes */ -void Kwin4View::slotMouseInput(KGameIO *input,QDataStream &stream,QMouseEvent *mouse,bool *eatevent) +void Kwin4View::slotMouseInput(KGameIO *input,TQDataStream &stream,TQMouseEvent *mouse,bool *eatevent) { // Only react to key pressed not released - if (mouse->type() != QEvent::MouseButtonPress ) return ; + if (mouse->type() != TQEvent::MouseButtonPress ) return ; if (!doc->isRunning()) return; @@ -683,10 +683,10 @@ void Kwin4View::slotMouseInput(KGameIO *input,QDataStream &stream,QMouseEvent *m if (mouse->button()!=LeftButton) return ; //if (!doc->IsRunning()) return ; - QPoint point; + TQPoint point; int x,y; - point=mouse->pos() - QPoint(15,40) - QPoint(20,20); + point=mouse->pos() - TQPoint(15,40) - TQPoint(20,20); if (point.x()<0) return ; x=point.x()/FIELD_SPACING; @@ -709,19 +709,19 @@ void Kwin4View::slotMouseInput(KGameIO *input,QDataStream &stream,QMouseEvent *m */ void Kwin4View::clearError() { - QCanvasText *text; + TQCanvasText *text; - text=(QCanvasText *)(mCache->getItem("text1",1)); + text=(TQCanvasText *)(mCache->getItem("text1",1)); if (text) text->hide(); - text=(QCanvasText *)(mCache->getItem("text2",1)); + text=(TQCanvasText *)(mCache->getItem("text2",1)); if (text) text->hide(); - text=(QCanvasText *)(mCache->getItem("text3",1)); + text=(TQCanvasText *)(mCache->getItem("text3",1)); if (text) text->hide(); - text=(QCanvasText *)(mCache->getItem("text4",1)); + text=(TQCanvasText *)(mCache->getItem("text4",1)); if (text) text->hide(); } -void Kwin4View::resizeEvent(QResizeEvent *e) +void Kwin4View::resizeEvent(TQResizeEvent *e) { if (mCanvas) mCanvas->resize(e->size().width(),e->size().height()); } diff --git a/kwin4/kwin4/kwin4view.h b/kwin4/kwin4/kwin4view.h index 48b60706..775aee1c 100644 --- a/kwin4/kwin4/kwin4view.h +++ b/kwin4/kwin4/kwin4view.h @@ -18,7 +18,7 @@ #ifndef KWIN4VIEW_H #define KWIN4VIEW_H -#include <qcanvas.h> +#include <tqcanvas.h> #include <kgameio.h> class Kwin4Doc; @@ -34,7 +34,7 @@ class Kwin4View : public QCanvasView Q_OBJECT public: - Kwin4View(Kwin4Doc *theDoc, QWidget *parent = 0, const char *name=0); + Kwin4View(Kwin4Doc *theDoc, TQWidget *parent = 0, const char *name=0); void initView(bool deleteall=true); void drawBoard(bool remove=false); @@ -51,20 +51,20 @@ public: void EndGame(); public slots: - void slotMouseInput(KGameIO *input,QDataStream &stream,QMouseEvent *e,bool *eatevent); - void slotKeyInput(KGameIO *input,QDataStream &stream,QKeyEvent *e,bool *eatevent); - void introMoveDone(QCanvasItem *item,int mode); + void slotMouseInput(KGameIO *input,TQDataStream &stream,TQMouseEvent *e,bool *eatevent); + void slotKeyInput(KGameIO *input,TQDataStream &stream,TQKeyEvent *e,bool *eatevent); + void introMoveDone(TQCanvasItem *item,int mode); protected: - QPixmap *loadPixmap(QString name); - void resizeEvent(QResizeEvent *e); + TQPixmap *loadPixmap(TQString name); + void resizeEvent(TQResizeEvent *e); bool wrongPlayer(KPlayer *player,KGameIO::IOMode io); private: Kwin4Doc *doc; - QCanvas *mCanvas; // our drawing canvas + TQCanvas *mCanvas; // our drawing canvas KSpriteCache *mCache; // The sprite cache - QString mGrafix; // grafix dir + TQString mGrafix; // grafix dir int mLastArrow; // last drawn arrow int mLastX; // last piece diff --git a/kwin4/kwin4/main.cpp b/kwin4/kwin4/main.cpp index 8f0ddaa5..acf2f551 100644 --- a/kwin4/kwin4/main.cpp +++ b/kwin4/kwin4/main.cpp @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) if (args->isSet("debug")) { - global_debug=QString(args->getOption("debug")).toInt(); + global_debug=TQString(args->getOption("debug")).toInt(); kdDebug(12010) << "Debug level set to " << global_debug << endl; } args->clear(); diff --git a/kwin4/kwin4/scorewidget.cpp b/kwin4/kwin4/scorewidget.cpp index 7d0586fb..2d2551e8 100644 --- a/kwin4/kwin4/scorewidget.cpp +++ b/kwin4/kwin4/scorewidget.cpp @@ -19,22 +19,22 @@ #include "prefs.h" -#include <qlabel.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qsizepolicy.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqsizepolicy.h> #include <kdebug.h> #include <klocale.h> #define COL_STATUSBORDER black -#define COL_STATUSFIELD QColor(130,130,255) -#define COL_STATUSDARK QColor(0,0,65) -#define COL_STATUSLIGHT QColor(210,210,255) +#define COL_STATUSFIELD TQColor(130,130,255) +#define COL_STATUSDARK TQColor(0,0,65) +#define COL_STATUSLIGHT TQColor(210,210,255) -ScoreWidget::ScoreWidget( QWidget* parent, const char* name, WFlags fl ) - : QFrame( parent, name, fl ) +ScoreWidget::ScoreWidget( TQWidget* parent, const char* name, WFlags fl ) + : TQFrame( parent, name, fl ) { - setFrameStyle( QFrame::Box | QFrame::Raised ); + setFrameStyle( TQFrame::Box | TQFrame::Raised ); setLineWidth( 2 ); setMidLineWidth( 4 ); @@ -44,47 +44,47 @@ ScoreWidget::ScoreWidget( QWidget* parent, const char* name, WFlags fl ) int row=0; setCaption( i18n( "Form1" ) ); - //LayoutB = new QGridLayout( this,4,3,15,5 ); - LayoutB = new QGridLayout( this); + //LayoutB = new TQGridLayout( this,4,3,15,5 ); + LayoutB = new TQGridLayout( this); LayoutB->setSpacing( 3 ); LayoutB->setMargin( 15 ); - TextLabel7 = new QLabel( this, "TextLabel7" ); + TextLabel7 = new TQLabel( this, "TextLabel7" ); setPlayer("-----",0); TextLabel7->setBackgroundColor( COL_STATUSFIELD ); TextLabel7->setAlignment(Qt::AlignHCenter); LayoutB->addMultiCellWidget( TextLabel7, row, row,0,2 ); row++; - TextLabel8 = new QLabel( this, "TextLabel8" ); + TextLabel8 = new TQLabel( this, "TextLabel8" ); TextLabel8->setText( i18n( "vs" ) ); TextLabel8->setBackgroundColor( COL_STATUSFIELD ); TextLabel8->setAlignment(Qt::AlignHCenter); LayoutB->addMultiCellWidget( TextLabel8, row, row,0,2 ); row++; - TextLabel9 = new QLabel( this, "TextLabel9" ); + TextLabel9 = new TQLabel( this, "TextLabel9" ); setPlayer("-----",1); - // TextLabel9->setFrameShape(QFrame::Box ); + // TextLabel9->setFrameShape(TQFrame::Box ); // TextLabel9->setLineWidth(5); TextLabel9->setBackgroundColor( COL_STATUSFIELD ); TextLabel9->setAlignment(Qt::AlignHCenter); LayoutB->addMultiCellWidget( TextLabel9, row, row,0,2 ); row++; - QSpacerItem *Spacer2=new QSpacerItem(0,16,QSizePolicy::Preferred,QSizePolicy::Preferred); + TQSpacerItem *Spacer2=new TQSpacerItem(0,16,TQSizePolicy::Preferred,TQSizePolicy::Preferred); LayoutB->addMultiCell( Spacer2, row, row,0,2 ); row++; - QSpacerItem *Spacer1=new QSpacerItem(25,0,QSizePolicy::Preferred,QSizePolicy::Preferred); + TQSpacerItem *Spacer1=new TQSpacerItem(25,0,TQSizePolicy::Preferred,TQSizePolicy::Preferred); LayoutB->addMultiCell( Spacer1, row, row+2,1,1 ); - TextLabel1 = new QLabel( this, "Level" ); + TextLabel1 = new TQLabel( this, "Level" ); TextLabel1->setText( i18n( "Level" ) ); TextLabel1->setBackgroundColor( COL_STATUSFIELD ); LayoutB->addWidget( TextLabel1, row, 0 ); - TextLabel4 = new QLabel( this, "L" ); + TextLabel4 = new TQLabel( this, "L" ); setLevel(Prefs::level()); TextLabel4->setAlignment(Qt::AlignRight); TextLabel4->setBackgroundColor( COL_STATUSFIELD ); @@ -93,12 +93,12 @@ ScoreWidget::ScoreWidget( QWidget* parent, const char* name, WFlags fl ) row++; - TextLabel2 = new QLabel( this, "Move" ); + TextLabel2 = new TQLabel( this, "Move" ); TextLabel2->setText( i18n("number of MOVE in game", "Move" ) ); TextLabel2->setBackgroundColor( COL_STATUSFIELD ); LayoutB->addWidget( TextLabel2, row, 0 ); - TextLabel5 = new QLabel( this, "M" ); + TextLabel5 = new TQLabel( this, "M" ); setMove(0); TextLabel5->setAlignment(Qt::AlignRight); TextLabel5->setBackgroundColor( COL_STATUSFIELD ); @@ -107,12 +107,12 @@ ScoreWidget::ScoreWidget( QWidget* parent, const char* name, WFlags fl ) row++; - TextLabel3 = new QLabel( this, "Chance" ); + TextLabel3 = new TQLabel( this, "Chance" ); TextLabel3->setText( i18n( "Chance" ) ); TextLabel3->setBackgroundColor( COL_STATUSFIELD ); LayoutB->addWidget( TextLabel3, row, 0 ); - TextLabel6 = new QLabel( this, "C" ); + TextLabel6 = new TQLabel( this, "C" ); setChance(0); TextLabel6->setAlignment(Qt::AlignRight); TextLabel6->setBackgroundColor( COL_STATUSFIELD ); @@ -120,7 +120,7 @@ ScoreWidget::ScoreWidget( QWidget* parent, const char* name, WFlags fl ) row++; - QSpacerItem *Spacer3=new QSpacerItem(0,8,QSizePolicy::Preferred,QSizePolicy::Preferred); + TQSpacerItem *Spacer3=new TQSpacerItem(0,8,TQSizePolicy::Preferred,TQSizePolicy::Preferred); LayoutB->addMultiCell( Spacer3, row, row,0,2 ); row++; @@ -129,31 +129,31 @@ ScoreWidget::ScoreWidget( QWidget* parent, const char* name, WFlags fl ) adjustSize(); } -void ScoreWidget::paintEvent( QPaintEvent * p) +void ScoreWidget::paintEvent( TQPaintEvent * p) { - QPainter paint( this ); + TQPainter paint( this ); paint.setClipRect(p->rect()); Paint( &paint, p->rect() ); } -void ScoreWidget::Paint(QPainter *p,QRect /*cliprect*/) +void ScoreWidget::Paint(TQPainter *p,TQRect /*cliprect*/) { - QPalette pal; - pal.setColor(QColorGroup::Light, COL_STATUSLIGHT); - pal.setColor(QColorGroup::Mid, COL_STATUSFIELD); - pal.setColor(QColorGroup::Dark, COL_STATUSDARK); + TQPalette pal; + pal.setColor(TQColorGroup::Light, COL_STATUSLIGHT); + pal.setColor(TQColorGroup::Mid, COL_STATUSFIELD); + pal.setColor(TQColorGroup::Dark, COL_STATUSDARK); setPalette(pal); drawFrame(p); } void ScoreWidget::setMove(int i) { - TextLabel5->setText( QString("%1").arg(i)); + TextLabel5->setText( TQString("%1").arg(i)); } void ScoreWidget::setLevel(int i) { - TextLabel4->setText( QString("%1").arg(i)); + TextLabel4->setText( TQString("%1").arg(i)); } void ScoreWidget::setChance(int i) @@ -165,10 +165,10 @@ void ScoreWidget::setChance(int i) else if (i<=-999) TextLabel6->setText(i18n("Loser")); else - TextLabel6->setText(QString("%1").arg(i)); + TextLabel6->setText(TQString("%1").arg(i)); } -void ScoreWidget::setPlayer(QString s,int no) +void ScoreWidget::setPlayer(TQString s,int no) { if (no==0) TextLabel7->setText(s); else TextLabel9->setText(s); diff --git a/kwin4/kwin4/scorewidget.h b/kwin4/kwin4/scorewidget.h index 82648b2c..7814467b 100644 --- a/kwin4/kwin4/scorewidget.h +++ b/kwin4/kwin4/scorewidget.h @@ -1,7 +1,7 @@ #ifndef _SCOREWIDGET_H #define _SCOREWIDGET_H -#include <qframe.h> +#include <tqframe.h> class QVBoxLayout; class QHBoxLayout; class QGridLayout; @@ -13,32 +13,32 @@ class ScoreWidget : public QFrame Q_OBJECT public: - ScoreWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ScoreWidget( TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); void setMove(int i); void setLevel(int i); void setChance(int i); - void setPlayer(QString s,int no); + void setPlayer(TQString s,int no); void setTurn(int i); protected: - QGroupBox* GroupBox1; - QLabel* TextLabel4; - QLabel* TextLabel5; - QLabel* TextLabel6; - QLabel* TextLabel1; - QLabel* TextLabel2; - QLabel* TextLabel3; - QLabel* TextLabel7; - QLabel* TextLabel8; - QLabel* TextLabel9; + TQGroupBox* GroupBox1; + TQLabel* TextLabel4; + TQLabel* TextLabel5; + TQLabel* TextLabel6; + TQLabel* TextLabel1; + TQLabel* TextLabel2; + TQLabel* TextLabel3; + TQLabel* TextLabel7; + TQLabel* TextLabel8; + TQLabel* TextLabel9; protected: - void paintEvent( QPaintEvent * ); - void Paint(QPainter *p,QRect rect); - void drawBorder(QPainter *p,QRect rect,int offset,int width,int mode); + void paintEvent( TQPaintEvent * ); + void Paint(TQPainter *p,TQRect rect); + void drawBorder(TQPainter *p,TQRect rect,int offset,int width,int mode); protected: - QGridLayout* LayoutB; + TQGridLayout* LayoutB; }; #endif // _SCOREWIDGET_H diff --git a/libkdegames/highscore/kconfigrawbackend.cpp b/libkdegames/highscore/kconfigrawbackend.cpp index a379ba23..29ffa845 100644 --- a/libkdegames/highscore/kconfigrawbackend.cpp +++ b/libkdegames/highscore/kconfigrawbackend.cpp @@ -21,11 +21,11 @@ #include "kconfigrawbackend.moc" #include <unistd.h> -#include <qfile.h> +#include <tqfile.h> KConfigRawBackEnd::KConfigRawBackEnd(KConfigBase *_config, int fd) - : KConfigINIBackEnd(_config, QString::null, "config", false), + : KConfigINIBackEnd(_config, TQString::null, "config", false), _fd(fd), _stream(0) { _file.open(IO_ReadOnly, _fd); diff --git a/libkdegames/highscore/kconfigrawbackend.h b/libkdegames/highscore/kconfigrawbackend.h index 4b780320..0c5fde03 100644 --- a/libkdegames/highscore/kconfigrawbackend.h +++ b/libkdegames/highscore/kconfigrawbackend.h @@ -20,7 +20,7 @@ #ifndef _KCONFIGRAWBACKEND_H #define _KCONFIGRAWBACKEND_H -#include <qfile.h> +#include <tqfile.h> #include <kconfigbackend.h> #include <ksimpleconfig.h> @@ -39,7 +39,7 @@ public: private: int _fd; FILE *_stream; - QFile _file; + TQFile _file; class KConfigRawBackEndPrivate; KConfigRawBackEndPrivate *d; diff --git a/libkdegames/highscore/kexthighscore.cpp b/libkdegames/highscore/kexthighscore.cpp index 0ad9b3af..585dafd4 100644 --- a/libkdegames/highscore/kexthighscore.cpp +++ b/libkdegames/highscore/kexthighscore.cpp @@ -19,7 +19,7 @@ #include "kexthighscore.h" -#include <qlayout.h> +#include <tqlayout.h> #include <kdebug.h> @@ -44,7 +44,7 @@ void setGameType(uint type) internal->setGameType(type); } -bool configure(QWidget *parent) +bool configure(TQWidget *parent) { internal->checkFirst(); ConfigDialog *cd = new ConfigDialog(parent); @@ -54,14 +54,14 @@ bool configure(QWidget *parent) return saved; } -void show(QWidget *parent, int rank) +void show(TQWidget *parent, int rank) { HighscoresDialog *hd = new HighscoresDialog(rank, parent); hd->exec(); delete hd; } -void submitScore(const Score &score, QWidget *widget) +void submitScore(const Score &score, TQWidget *widget) { int rank = internal->submitScore(score, widget, internal->showMode!=Manager::NeverShow); @@ -81,7 +81,7 @@ void submitScore(const Score &score, QWidget *widget) } } -void show(QWidget *widget) +void show(TQWidget *widget) { internal->checkFirst(); show(widget, -1); @@ -145,7 +145,7 @@ void Manager::setShowDrawGamesStatistic(bool show) internal->showDrawGames = show; } -void Manager::setWWHighscores(const KURL &url, const QString &version) +void Manager::setWWHighscores(const KURL &url, const TQString &version) { Q_ASSERT( url.isValid() ); internal->serverURL = url; @@ -157,7 +157,7 @@ void Manager::setWWHighscores(const KURL &url, const QString &version) internal->version = version; } -void Manager::setScoreHistogram(const QMemArray<uint> &scores, +void Manager::setScoreHistogram(const TQMemArray<uint> &scores, ScoreTypeBound type) { Q_ASSERT( scores.size()>=2 ); @@ -238,7 +238,7 @@ void Manager::setScoreItem(uint worstScore, Item *item) ->item()->setDefaultValue(worstScore); } -void Manager::addScoreItem(const QString &name, Item *item) +void Manager::addScoreItem(const TQString &name, Item *item) { internal->scoreInfos().addItem(name, item, true); } @@ -247,7 +247,7 @@ void Manager::setPlayerItem(PlayerItemType type, Item *item) { const Item *scoreItem = internal->scoreInfos().item("score")->item(); uint def = scoreItem->defaultValue().toUInt(); - QString name; + TQString name; switch (type) { case MeanScore: name = "mean score"; @@ -261,7 +261,7 @@ void Manager::setPlayerItem(PlayerItemType type, Item *item) internal->playerInfos().setItem(name, item); } -QString Manager::gameTypeLabel(uint gameType, LabelType type) const +TQString Manager::gameTypeLabel(uint gameType, LabelType type) const { if ( gameType!=0 ) kdFatal(11002) << "You need to reimplement KExtHighscore::Manager for " @@ -272,15 +272,15 @@ QString Manager::gameTypeLabel(uint gameType, LabelType type) const case I18N: break; case WW: return "normal"; } - return QString::null; + return TQString::null; } -void Manager::addToQueryURL(KURL &url, const QString &item, - const QString &content) +void Manager::addToQueryURL(KURL &url, const TQString &item, + const TQString &content) { Q_ASSERT( !item.isEmpty() && url.queryItem(item).isNull() ); - QString query = url.query(); + TQString query = url.query(); if ( !query.isEmpty() ) query += '&'; query += item + '=' + KURL::encode_string(content); url.setQuery(query); diff --git a/libkdegames/highscore/kexthighscore.h b/libkdegames/highscore/kexthighscore.h index 2484f97b..6dac5ff7 100644 --- a/libkdegames/highscore/kexthighscore.h +++ b/libkdegames/highscore/kexthighscore.h @@ -51,19 +51,19 @@ KDE_EXPORT void setGameType(uint gameType); * Configure the highscores. * @return true if the configuration has been modified and saved */ -KDE_EXPORT bool configure(QWidget *parent); +KDE_EXPORT bool configure(TQWidget *parent); /** * Show the highscores lists. */ -KDE_EXPORT void show(QWidget *parent); +KDE_EXPORT void show(TQWidget *parent); /** * Submit a score. See @ref Manager for usage example. * * @param widget a widget used as parent for error message box. */ -KDE_EXPORT void submitScore(const Score &score, QWidget *widget); +KDE_EXPORT void submitScore(const Score &score, TQWidget *widget); /** * @return the last score in the local list of highscores. The worst possible @@ -160,7 +160,7 @@ class KDE_EXPORT Manager * @param version the game version which is sent to the web server (it can * be useful for backward compatibility on the server side). */ - void setWWHighscores(const KURL &url, const QString &version); + void setWWHighscores(const KURL &url, const TQString &version); /** * Set if the number of lost games should be track for the world-wide @@ -211,7 +211,7 @@ class KDE_EXPORT Manager * * Note: should be called at construction time. */ - void setScoreHistogram(const QMemArray<uint> &scores, ScoreTypeBound type); + void setScoreHistogram(const TQMemArray<uint> &scores, ScoreTypeBound type); /** * Enumerate different conditions under which to show the @@ -272,7 +272,7 @@ class KDE_EXPORT Manager * * Note : This method should be called at construction time. */ - void addScoreItem(const QString &name, Item *item); + void addScoreItem(const TQString &name, Item *item); enum PlayerItemType { MeanScore, BestScore }; /** @@ -307,7 +307,7 @@ class KDE_EXPORT Manager * implementation works only for one game type : you need to reimplement * this method if the number of game types is more than one. */ - virtual QString gameTypeLabel(uint gameType, LabelType type) const; + virtual TQString gameTypeLabel(uint gameType, LabelType type) const; protected: /** @@ -352,8 +352,8 @@ class KDE_EXPORT Manager * @param item the item name * @param content the item content */ - static void addToQueryURL(KURL &url, const QString &item, - const QString &content); + static void addToQueryURL(KURL &url, const TQString &item, + const TQString &content); friend class ManagerPrivate; diff --git a/libkdegames/highscore/kexthighscore_gui.cpp b/libkdegames/highscore/kexthighscore_gui.cpp index 547a885c..3786f529 100644 --- a/libkdegames/highscore/kexthighscore_gui.cpp +++ b/libkdegames/highscore/kexthighscore_gui.cpp @@ -20,11 +20,11 @@ #include "kexthighscore_gui.h" #include "kexthighscore_gui.moc" -#include <qlayout.h> -#include <qtextstream.h> -#include <qheader.h> -#include <qgrid.h> -#include <qvgroupbox.h> +#include <tqlayout.h> +#include <tqtextstream.h> +#include <tqheader.h> +#include <tqgrid.h> +#include <tqvgroupbox.h> #include <kapplication.h> #include <kmessagebox.h> @@ -45,23 +45,23 @@ namespace KExtHighscore { //----------------------------------------------------------------------------- -ShowItem::ShowItem(QListView *list, bool highlight) +ShowItem::ShowItem(TQListView *list, bool highlight) : KListViewItem(list), _highlight(highlight) {} -void ShowItem::paintCell(QPainter *p, const QColorGroup &cg, +void ShowItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align) { - QColorGroup cgrp(cg); - if (_highlight) cgrp.setColor(QColorGroup::Text, red); + TQColorGroup cgrp(cg); + if (_highlight) cgrp.setColor(TQColorGroup::Text, red); KListViewItem::paintCell(p, cgrp, column, width, align); } //----------------------------------------------------------------------------- -ScoresList::ScoresList(QWidget *parent) +ScoresList::ScoresList(TQWidget *parent) : KListView(parent) { - setSelectionMode(QListView::NoSelection); + setSelectionMode(TQListView::NoSelection); setItemMargin(3); setAllColumnsShowFocus(true); setSorting(-1); @@ -74,16 +74,16 @@ void ScoresList::addHeader(const ItemArray &items) addLineItem(items, 0, 0); } -QListViewItem *ScoresList::addLine(const ItemArray &items, +TQListViewItem *ScoresList::addLine(const ItemArray &items, uint index, bool highlight) { - QListViewItem *item = new ShowItem(this, highlight); + TQListViewItem *item = new ShowItem(this, highlight); addLineItem(items, index, item); return item; } void ScoresList::addLineItem(const ItemArray &items, - uint index, QListViewItem *line) + uint index, TQListViewItem *line) { uint k = 0; for (uint i=0; i<items.size(); i++) { @@ -99,11 +99,11 @@ void ScoresList::addLineItem(const ItemArray &items, } //----------------------------------------------------------------------------- -HighscoresList::HighscoresList(QWidget *parent) +HighscoresList::HighscoresList(TQWidget *parent) : ScoresList(parent) {} -QString HighscoresList::itemText(const ItemContainer &item, uint row) const +TQString HighscoresList::itemText(const ItemContainer &item, uint row) const { return item.pretty(row); } @@ -111,26 +111,26 @@ QString HighscoresList::itemText(const ItemContainer &item, uint row) const void HighscoresList::load(const ItemArray &items, int highlight) { clear(); - QListViewItem *line = 0; + TQListViewItem *line = 0; for (int j=items.nbEntries()-1; j>=0; j--) { - QListViewItem *item = addLine(items, j, j==highlight); + TQListViewItem *item = addLine(items, j, j==highlight); if ( j==highlight ) line = item; } if (line) ensureItemVisible(line); } //----------------------------------------------------------------------------- -HighscoresWidget::HighscoresWidget(QWidget *parent) - : QWidget(parent, "show_highscores_widget"), +HighscoresWidget::HighscoresWidget(TQWidget *parent) + : TQWidget(parent, "show_highscores_widget"), _scoresUrl(0), _playersUrl(0), _statsTab(0), _histoTab(0) { const ScoreInfos &s = internal->scoreInfos(); const PlayerInfos &p = internal->playerInfos(); - QVBoxLayout *vbox = new QVBoxLayout(this, KDialogBase::spacingHint()); + TQVBoxLayout *vbox = new TQVBoxLayout(this, KDialogBase::spacingHint()); - _tw = new QTabWidget(this); - connect(_tw, SIGNAL(currentChanged(QWidget *)), SLOT(tabChanged())); + _tw = new TQTabWidget(this); + connect(_tw, TQT_SIGNAL(currentChanged(TQWidget *)), TQT_SLOT(tabChanged())); vbox->addWidget(_tw); // scores tab @@ -160,15 +160,15 @@ HighscoresWidget::HighscoresWidget(QWidget *parent) KURL url = internal->queryURL(ManagerPrivate::Scores); _scoresUrl = new KURLLabel(url.url(), i18n("View world-wide highscores"), this); - connect(_scoresUrl, SIGNAL(leftClickedURL(const QString &)), - SLOT(showURL(const QString &))); + connect(_scoresUrl, TQT_SIGNAL(leftClickedURL(const TQString &)), + TQT_SLOT(showURL(const TQString &))); vbox->addWidget(_scoresUrl); url = internal->queryURL(ManagerPrivate::Players); _playersUrl = new KURLLabel(url.url(), i18n("View world-wide players"), this); - connect(_playersUrl, SIGNAL(leftClickedURL(const QString &)), - SLOT(showURL(const QString &))); + connect(_playersUrl, TQT_SIGNAL(leftClickedURL(const TQString &)), + TQT_SLOT(showURL(const TQString &))); vbox->addWidget(_playersUrl); } } @@ -179,7 +179,7 @@ void HighscoresWidget::changeTab(int i) _tw->setCurrentPage(i); } -void HighscoresWidget::showURL(const QString &url) const +void HighscoresWidget::showURL(const TQString &url) const { (void)new KRun(KURL(url)); } @@ -197,7 +197,7 @@ void HighscoresWidget::load(int rank) } //----------------------------------------------------------------------------- -HighscoresDialog::HighscoresDialog(int rank, QWidget *parent) +HighscoresDialog::HighscoresDialog(int rank, TQWidget *parent) : KDialogBase(internal->nbGameTypes()>1 ? TreeList : Plain, i18n("Highscores"), Close|User1|User2, Close, parent, "show_highscores", true, true, @@ -208,25 +208,25 @@ HighscoresDialog::HighscoresDialog(int rank, QWidget *parent) if ( internal->nbGameTypes()>1 ) { for (uint i=0; i<internal->nbGameTypes(); i++) { - QString title = internal->manager.gameTypeLabel(i, Manager::I18N); - QString icon = internal->manager.gameTypeLabel(i, Manager::Icon); - QWidget *w = addVBoxPage(title, QString::null, + TQString title = internal->manager.gameTypeLabel(i, Manager::I18N); + TQString icon = internal->manager.gameTypeLabel(i, Manager::Icon); + TQWidget *w = addVBoxPage(title, TQString::null, BarIcon(icon, KIcon::SizeLarge)); if ( i==internal->gameType() ) createPage(w); } - connect(this, SIGNAL(aboutToShowPage(QWidget *)), - SLOT(createPage(QWidget *))); + connect(this, TQT_SIGNAL(aboutToShowPage(TQWidget *)), + TQT_SLOT(createPage(TQWidget *))); showPage(internal->gameType()); } else { - QVBoxLayout *vbox = new QVBoxLayout(plainPage()); + TQVBoxLayout *vbox = new TQVBoxLayout(plainPage()); createPage(plainPage()); vbox->addWidget(_widgets[0]); setMainWidget(_widgets[0]); } } -void HighscoresDialog::createPage(QWidget *page) +void HighscoresDialog::createPage(TQWidget *page) { internal->hsConfig().readCurrentConfig(); _current = page; @@ -234,7 +234,7 @@ void HighscoresDialog::createPage(QWidget *page) int i = (several ? pageIndex(page) : 0); if ( _widgets[i]==0 ) { _widgets[i] = new HighscoresWidget(page); - connect(_widgets[i], SIGNAL(tabChanged(int)), SLOT(tabChanged(int))); + connect(_widgets[i], TQT_SIGNAL(tabChanged(int)), TQT_SLOT(tabChanged(int))); } uint type = internal->gameType(); if (several) internal->setGameType(i); @@ -251,7 +251,7 @@ void HighscoresDialog::slotUser1() void HighscoresDialog::slotUser2() { - KURL url = KFileDialog::getSaveURL(QString::null, QString::null, this); + KURL url = KFileDialog::getSaveURL(TQString::null, TQString::null, this); if ( url.isEmpty() ) return; if ( KIO::NetAccess::exists(url, true, this) ) { KGuiItem gi = KStdGuiItem::save(); @@ -270,7 +270,7 @@ void HighscoresDialog::slotUser2() //----------------------------------------------------------------------------- LastMultipleScoresList::LastMultipleScoresList( - const QValueVector<Score> &scores, QWidget *parent) + const TQValueVector<Score> &scores, TQWidget *parent) : ScoresList(parent), _scores(scores) { const ScoreInfos &s = internal->scoreInfos(); @@ -279,7 +279,7 @@ LastMultipleScoresList::LastMultipleScoresList( } void LastMultipleScoresList::addLineItem(const ItemArray &si, - uint index, QListViewItem *line) + uint index, TQListViewItem *line) { uint k = 1; // skip "id" for (uint i=0; i<si.size()-2; i++) { @@ -294,20 +294,20 @@ void LastMultipleScoresList::addLineItem(const ItemArray &si, } } -QString LastMultipleScoresList::itemText(const ItemContainer &item, +TQString LastMultipleScoresList::itemText(const ItemContainer &item, uint row) const { - QString name = item.name(); + TQString name = item.name(); if ( name=="rank" ) - return (_scores[row].type()==Won ? i18n("Winner") : QString::null); - QVariant v = _scores[row].data(name); + return (_scores[row].type()==Won ? i18n("Winner") : TQString::null); + TQVariant v = _scores[row].data(name); if ( name=="name" ) return v.toString(); return item.item()->pretty(row, v); } //----------------------------------------------------------------------------- TotalMultipleScoresList::TotalMultipleScoresList( - const QValueVector<Score> &scores, QWidget *parent) + const TQValueVector<Score> &scores, TQWidget *parent) : ScoresList(parent), _scores(scores) { const ScoreInfos &s = internal->scoreInfos(); @@ -316,7 +316,7 @@ TotalMultipleScoresList::TotalMultipleScoresList( } void TotalMultipleScoresList::addLineItem(const ItemArray &si, - uint index, QListViewItem *line) + uint index, TQListViewItem *line) { const PlayerInfos &pi = internal->playerInfos(); uint k = 1; // skip "id" @@ -330,7 +330,7 @@ void TotalMultipleScoresList::addLineItem(const ItemArray &si, } if (line) line->setText(i, itemText(*container, index)); else { - QString label = + TQString label = (i==2 ? i18n("Won Games") : container->item()->label()); addColumn(label); setColumnAlignment(i, container->item()->alignment()); @@ -338,90 +338,90 @@ void TotalMultipleScoresList::addLineItem(const ItemArray &si, } } -QString TotalMultipleScoresList::itemText(const ItemContainer &item, +TQString TotalMultipleScoresList::itemText(const ItemContainer &item, uint row) const { - QString name = item.name(); - if ( name=="rank" ) return QString::number(_scores.size()-row); + TQString name = item.name(); + if ( name=="rank" ) return TQString::number(_scores.size()-row); if ( name=="nb games" ) - return QString::number( _scores[row].data("nb won games").toUInt() ); - QVariant v = _scores[row].data(name); + return TQString::number( _scores[row].data("nb won games").toUInt() ); + TQVariant v = _scores[row].data(name); if ( name=="name" ) return v.toString(); return item.item()->pretty(row, v); } //----------------------------------------------------------------------------- -ConfigDialog::ConfigDialog(QWidget *parent) +ConfigDialog::ConfigDialog(TQWidget *parent) : KDialogBase(Swallow, i18n("Configure Highscores"), Ok|Apply|Cancel, Cancel, parent, "configure_highscores", true, true), _saved(false), _WWHEnabled(0) { - QWidget *page = 0; - QTabWidget *tab = 0; + TQWidget *page = 0; + TQTabWidget *tab = 0; if ( internal->isWWHSAvailable() ) { - tab = new QTabWidget(this); + tab = new TQTabWidget(this); setMainWidget(tab); - page = new QWidget(tab); + page = new TQWidget(tab); tab->addTab(page, i18n("Main")); } else { - page = new QWidget(this); + page = new TQWidget(this); setMainWidget(page); } - QGridLayout *pageTop = - new QGridLayout(page, 2, 2, spacingHint(), spacingHint()); + TQGridLayout *pageTop = + new TQGridLayout(page, 2, 2, spacingHint(), spacingHint()); - QLabel *label = new QLabel(i18n("Nickname:"), page); + TQLabel *label = new TQLabel(i18n("Nickname:"), page); pageTop->addWidget(label, 0, 0); - _nickname = new QLineEdit(page); - connect(_nickname, SIGNAL(textChanged(const QString &)), - SLOT(modifiedSlot())); - connect(_nickname, SIGNAL(textChanged(const QString &)), - SLOT(nickNameChanged(const QString &))); + _nickname = new TQLineEdit(page); + connect(_nickname, TQT_SIGNAL(textChanged(const TQString &)), + TQT_SLOT(modifiedSlot())); + connect(_nickname, TQT_SIGNAL(textChanged(const TQString &)), + TQT_SLOT(nickNameChanged(const TQString &))); _nickname->setMaxLength(16); pageTop->addWidget(_nickname, 0, 1); - label = new QLabel(i18n("Comment:"), page); + label = new TQLabel(i18n("Comment:"), page); pageTop->addWidget(label, 1, 0); - _comment = new QLineEdit(page); - connect(_comment, SIGNAL(textChanged(const QString &)), - SLOT(modifiedSlot())); + _comment = new TQLineEdit(page); + connect(_comment, TQT_SIGNAL(textChanged(const TQString &)), + TQT_SLOT(modifiedSlot())); _comment->setMaxLength(50); pageTop->addWidget(_comment, 1, 1); if (tab) { _WWHEnabled - = new QCheckBox(i18n("World-wide highscores enabled"), page); - connect(_WWHEnabled, SIGNAL(toggled(bool)), - SLOT(modifiedSlot())); + = new TQCheckBox(i18n("World-wide highscores enabled"), page); + connect(_WWHEnabled, TQT_SIGNAL(toggled(bool)), + TQT_SLOT(modifiedSlot())); pageTop->addMultiCellWidget(_WWHEnabled, 2, 2, 0, 1); // advanced tab - QWidget *page = new QWidget(tab); + TQWidget *page = new TQWidget(tab); tab->addTab(page, i18n("Advanced")); - QVBoxLayout *pageTop = - new QVBoxLayout(page, spacingHint(), spacingHint()); + TQVBoxLayout *pageTop = + new TQVBoxLayout(page, spacingHint(), spacingHint()); - QVGroupBox *group = new QVGroupBox(i18n("Registration Data"), page); + TQVGroupBox *group = new TQVGroupBox(i18n("Registration Data"), page); pageTop->addWidget(group); - QGrid *grid = new QGrid(2, group); + TQGrid *grid = new TQGrid(2, group); grid->setSpacing(spacingHint()); - label = new QLabel(i18n("Nickname:"), grid); + label = new TQLabel(i18n("Nickname:"), grid); _registeredName = new KLineEdit(grid); _registeredName->setReadOnly(true); - label = new QLabel(i18n("Key:"), grid); + label = new TQLabel(i18n("Key:"), grid); _key = new KLineEdit(grid); _key->setReadOnly(true); KGuiItem gi = KStdGuiItem::clear(); gi.setText(i18n("Remove")); _removeButton = new KPushButton(gi, grid); - connect(_removeButton, SIGNAL(clicked()), SLOT(removeSlot())); + connect(_removeButton, TQT_SIGNAL(clicked()), TQT_SLOT(removeSlot())); } load(); @@ -429,7 +429,7 @@ ConfigDialog::ConfigDialog(QWidget *parent) enableButtonApply(false); } -void ConfigDialog::nickNameChanged(const QString &text) +void ConfigDialog::nickNameChanged(const TQString &text) { enableButtonOK( !text.isEmpty() ); } @@ -456,7 +456,7 @@ void ConfigDialog::removeSlot() i18n("This will permanently remove your " "registration key. You will not be able to use " "the currently registered nickname anymore."), - QString::null, gi); + TQString::null, gi); if ( res==KMessageBox::Continue ) { internal->playerInfos().removeKey(); _registeredName->clear(); @@ -471,7 +471,7 @@ void ConfigDialog::load() { internal->hsConfig().readCurrentConfig(); const PlayerInfos &infos = internal->playerInfos(); - _nickname->setText(infos.isAnonymous() ? QString::null : infos.name()); + _nickname->setText(infos.isAnonymous() ? TQString::null : infos.name()); _comment->setText(infos.comment()); if (_WWHEnabled) { _WWHEnabled->setChecked(infos.isWWEnabled()); @@ -491,7 +491,7 @@ bool ConfigDialog::save() // do not bother the user with "nickname empty" if he has not // messed with nickname settings ... - QString newName = _nickname->text(); + TQString newName = _nickname->text(); if ( newName.isEmpty() && !internal->playerInfos().isAnonymous() && !enabled ) return true; @@ -516,28 +516,28 @@ bool ConfigDialog::save() } //----------------------------------------------------------------------------- -AskNameDialog::AskNameDialog(QWidget *parent) +AskNameDialog::AskNameDialog(TQWidget *parent) : KDialogBase(Plain, i18n("Enter Your Nickname"), Ok | Cancel, Ok, parent, "ask_name_dialog") { internal->hsConfig().readCurrentConfig(); - QVBoxLayout *top = - new QVBoxLayout(plainPage(), marginHint(), spacingHint()); - QLabel *label = - new QLabel(i18n("Congratulations, you have won!"), plainPage()); + TQVBoxLayout *top = + new TQVBoxLayout(plainPage(), marginHint(), spacingHint()); + TQLabel *label = + new TQLabel(i18n("Congratulations, you have won!"), plainPage()); top->addWidget(label); - QHBoxLayout *hbox = new QHBoxLayout(top); - label = new QLabel(i18n("Enter your nickname:"), plainPage()); + TQHBoxLayout *hbox = new TQHBoxLayout(top); + label = new TQLabel(i18n("Enter your nickname:"), plainPage()); hbox->addWidget(label); - _edit = new QLineEdit(plainPage()); + _edit = new TQLineEdit(plainPage()); _edit->setFocus(); - connect(_edit, SIGNAL(textChanged(const QString &)), SLOT(nameChanged())); + connect(_edit, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(nameChanged())); hbox->addWidget(_edit); top->addSpacing(spacingHint()); - _checkbox = new QCheckBox(i18n("Do not ask again."), plainPage()); + _checkbox = new TQCheckBox(i18n("Do not ask again."), plainPage()); top->addWidget(_checkbox); nameChanged(); diff --git a/libkdegames/highscore/kexthighscore_gui.h b/libkdegames/highscore/kexthighscore_gui.h index e721299a..2a142856 100644 --- a/libkdegames/highscore/kexthighscore_gui.h +++ b/libkdegames/highscore/kexthighscore_gui.h @@ -20,10 +20,10 @@ #ifndef KEXTHIGHSCORE_GUI_H #define KEXTHIGHSCORE_GUI_H -#include <qcheckbox.h> -#include <qlabel.h> -#include <qvbox.h> -#include <qtabwidget.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqvbox.h> +#include <tqtabwidget.h> #include <klistview.h> #include <klineedit.h> @@ -45,10 +45,10 @@ class AdditionalTab; class ShowItem : public KListViewItem { public: - ShowItem(QListView *, bool highlight); + ShowItem(TQListView *, bool highlight); protected: - virtual void paintCell(QPainter *, const QColorGroup &, int column, + virtual void paintCell(TQPainter *, const TQColorGroup &, int column, int width, int align); private: @@ -59,17 +59,17 @@ class ScoresList : public KListView { Q_OBJECT public: - ScoresList(QWidget *parent); + ScoresList(TQWidget *parent); void addHeader(const ItemArray &); protected: - QListViewItem *addLine(const ItemArray &, uint index, bool highlight); - virtual QString itemText(const ItemContainer &, uint row) const = 0; + TQListViewItem *addLine(const ItemArray &, uint index, bool highlight); + virtual TQString itemText(const ItemContainer &, uint row) const = 0; private: virtual void addLineItem(const ItemArray &, uint index, - QListViewItem *item); + TQListViewItem *item); }; //----------------------------------------------------------------------------- @@ -77,19 +77,19 @@ class HighscoresList : public ScoresList { Q_OBJECT public: - HighscoresList(QWidget *parent); + HighscoresList(TQWidget *parent); void load(const ItemArray &, int highlight); protected: - QString itemText(const ItemContainer &, uint row) const; + TQString itemText(const ItemContainer &, uint row) const; }; class HighscoresWidget : public QWidget { Q_OBJECT public: - HighscoresWidget(QWidget *parent); + HighscoresWidget(TQWidget *parent); void load(int rank); @@ -100,11 +100,11 @@ class HighscoresWidget : public QWidget void changeTab(int i); private slots: - void showURL(const QString &) const; + void showURL(const TQString &) const; void tabChanged() { emit tabChanged(_tw->currentPageIndex()); } private: - QTabWidget *_tw; + TQTabWidget *_tw; HighscoresList *_scoresList, *_playersList; KURLLabel *_scoresUrl, *_playersUrl; AdditionalTab *_statsTab, *_histoTab; @@ -114,18 +114,18 @@ class HighscoresDialog : public KDialogBase { Q_OBJECT public: - HighscoresDialog(int rank, QWidget *parent); + HighscoresDialog(int rank, TQWidget *parent); private slots: void slotUser1(); void slotUser2(); void tabChanged(int i) { _tab = i; } - void createPage(QWidget *); + void createPage(TQWidget *); private: int _rank, _tab; - QWidget *_current; - QValueVector<HighscoresWidget *> _widgets; + TQWidget *_current; + TQValueVector<HighscoresWidget *> _widgets; }; //----------------------------------------------------------------------------- @@ -133,28 +133,28 @@ class LastMultipleScoresList : public ScoresList { Q_OBJECT public: - LastMultipleScoresList(const QValueVector<Score> &, QWidget *parent); + LastMultipleScoresList(const TQValueVector<Score> &, TQWidget *parent); private: - void addLineItem(const ItemArray &, uint index, QListViewItem *line); - QString itemText(const ItemContainer &, uint row) const; + void addLineItem(const ItemArray &, uint index, TQListViewItem *line); + TQString itemText(const ItemContainer &, uint row) const; private: - const QValueVector<Score> &_scores; + const TQValueVector<Score> &_scores; }; class TotalMultipleScoresList : public ScoresList { Q_OBJECT public: - TotalMultipleScoresList(const QValueVector<Score> &, QWidget *parent); + TotalMultipleScoresList(const TQValueVector<Score> &, TQWidget *parent); private: - void addLineItem(const ItemArray &, uint index, QListViewItem *line); - QString itemText(const ItemContainer &, uint row) const; + void addLineItem(const ItemArray &, uint index, TQListViewItem *line); + TQString itemText(const ItemContainer &, uint row) const; private: - const QValueVector<Score> &_scores; + const TQValueVector<Score> &_scores; }; //----------------------------------------------------------------------------- @@ -162,7 +162,7 @@ class ConfigDialog : public KDialogBase { Q_OBJECT public: - ConfigDialog(QWidget *parent); + ConfigDialog(TQWidget *parent); bool hasBeenSaved() const { return _saved; } @@ -171,12 +171,12 @@ class ConfigDialog : public KDialogBase void removeSlot(); void accept(); void slotApply() { save(); } - void nickNameChanged(const QString &); + void nickNameChanged(const TQString &); private: bool _saved; - QCheckBox *_WWHEnabled; - QLineEdit *_nickname, *_comment; + TQCheckBox *_WWHEnabled; + TQLineEdit *_nickname, *_comment; KLineEdit *_key, *_registeredName; KPushButton *_removeButton; @@ -189,17 +189,17 @@ class AskNameDialog : public KDialogBase { Q_OBJECT public: - AskNameDialog(QWidget *parent); + AskNameDialog(TQWidget *parent); - QString name() const { return _edit->text(); } + TQString name() const { return _edit->text(); } bool dontAskAgain() const { return _checkbox->isChecked(); } private slots: void nameChanged(); private: - QLineEdit *_edit; - QCheckBox *_checkbox; + TQLineEdit *_edit; + TQCheckBox *_checkbox; }; } // namespace diff --git a/libkdegames/highscore/kexthighscore_internal.cpp b/libkdegames/highscore/kexthighscore_internal.cpp index a8395753..3c73c3aa 100644 --- a/libkdegames/highscore/kexthighscore_internal.cpp +++ b/libkdegames/highscore/kexthighscore_internal.cpp @@ -23,9 +23,9 @@ #include <sys/types.h> #include <unistd.h> -#include <qfile.h> -#include <qlayout.h> -#include <qdom.h> +#include <tqfile.h> +#include <tqlayout.h> +#include <tqdom.h> #include <kglobal.h> #include <kio/netaccess.h> @@ -62,17 +62,17 @@ void ItemContainer::setItem(Item *item) _item = item; } -QString ItemContainer::entryName() const +TQString ItemContainer::entryName() const { if ( _subGroup.isEmpty() ) return _name; return _name + "_" + _subGroup; } -QVariant ItemContainer::read(uint i) const +TQVariant ItemContainer::read(uint i) const { Q_ASSERT(_item); - QVariant v = _item->defaultValue(); + TQVariant v = _item->defaultValue(); if ( isStored() ) { internal->hsConfig().setHighscoreGroup(_group); v = internal->hsConfig().readPropertyEntry(i+1, entryName(), v); @@ -80,13 +80,13 @@ QVariant ItemContainer::read(uint i) const return _item->read(i, v); } -QString ItemContainer::pretty(uint i) const +TQString ItemContainer::pretty(uint i) const { Q_ASSERT(_item); return _item->pretty(i, read(i)); } -void ItemContainer::write(uint i, const QVariant &value) const +void ItemContainer::write(uint i, const TQVariant &value) const { Q_ASSERT( isStored() ); Q_ASSERT( internal->hsConfig().isLocked() ); @@ -111,14 +111,14 @@ ItemArray::~ItemArray() for (uint i=0; i<size(); i++) delete at(i); } -int ItemArray::findIndex(const QString &name) const +int ItemArray::findIndex(const TQString &name) const { for (uint i=0; i<size(); i++) if ( at(i)->name()==name ) return i; return -1; } -const ItemContainer *ItemArray::item(const QString &name) const +const ItemContainer *ItemArray::item(const TQString &name) const { int i = findIndex(name); if ( i==-1 ) kdError(11002) << k_funcinfo << "no item named \"" << name @@ -126,7 +126,7 @@ const ItemContainer *ItemArray::item(const QString &name) const return at(i); } -ItemContainer *ItemArray::item(const QString &name) +ItemContainer *ItemArray::item(const TQString &name) { int i = findIndex(name); if ( i==-1 ) kdError(11002) << k_funcinfo << "no item named \"" << name @@ -134,7 +134,7 @@ ItemContainer *ItemArray::item(const QString &name) return at(i); } -void ItemArray::setItem(const QString &name, Item *item) +void ItemArray::setItem(const TQString &name, Item *item) { int i = findIndex(name); if ( i==-1 ) kdError(11002) << k_funcinfo << "no item named \"" << name @@ -144,7 +144,7 @@ void ItemArray::setItem(const QString &name, Item *item) _setItem(i, name, item, stored, canHaveSubGroup); } -void ItemArray::addItem(const QString &name, Item *item, +void ItemArray::addItem(const TQString &name, Item *item, bool stored, bool canHaveSubGroup) { if ( findIndex(name)!=-1 ) @@ -155,16 +155,16 @@ void ItemArray::addItem(const QString &name, Item *item, _setItem(i, name, item, stored, canHaveSubGroup); } -void ItemArray::_setItem(uint i, const QString &name, Item *item, +void ItemArray::_setItem(uint i, const TQString &name, Item *item, bool stored, bool canHaveSubGroup) { at(i)->setItem(item); at(i)->setName(name); - at(i)->setGroup(stored ? _group : QString::null); - at(i)->setSubGroup(canHaveSubGroup ? _subGroup : QString::null); + at(i)->setGroup(stored ? _group : TQString::null); + at(i)->setSubGroup(canHaveSubGroup ? _subGroup : TQString::null); } -void ItemArray::setGroup(const QString &group) +void ItemArray::setGroup(const TQString &group) { Q_ASSERT( !group.isNull() ); _group = group; @@ -172,7 +172,7 @@ void ItemArray::setGroup(const QString &group) if ( at(i)->isStored() ) at(i)->setGroup(group); } -void ItemArray::setSubGroup(const QString &subGroup) +void ItemArray::setSubGroup(const TQString &subGroup) { Q_ASSERT( !subGroup.isNull() ); _subGroup = subGroup; @@ -197,7 +197,7 @@ void ItemArray::write(uint k, const Score &data, uint nb) const } } -void ItemArray::exportToText(QTextStream &s) const +void ItemArray::exportToText(TQTextStream &s) const { for (uint k=0; k<nbEntries()+1; k++) { for (uint i=0; i<size(); i++) { @@ -219,7 +219,7 @@ class ScoreNameItem : public NameItem ScoreNameItem(const ScoreInfos &score, const PlayerInfos &infos) : _score(score), _infos(infos) {} - QString pretty(uint i, const QVariant &v) const { + TQString pretty(uint i, const TQVariant &v) const { uint id = _score.item("id")->read(i).toUInt(); if ( id==0 ) return NameItem::pretty(i, v); return _infos.prettyName(id-1); @@ -269,7 +269,7 @@ PlayerInfos::PlayerInfos() it = Manager::createItem(Manager::BestScoreDefault); addItem("best score", it, true, true); addItem("date", new DateItem, true, true); - it = new Item(QString::null, i18n("Comment"), Qt::AlignLeft); + it = new Item(TQString::null, i18n("Comment"), Qt::AlignLeft); addItem("comment", it); // statistics items @@ -281,7 +281,7 @@ PlayerInfos::PlayerInfos() addItem("max won trend", new Item((uint)0), true, true); struct passwd *pwd = getpwuid(getuid()); - QString username = pwd->pw_name; + TQString username = pwd->pw_name; #ifdef HIGHSCORE_DIRECTORY internal->hsConfig().setHighscoreGroup("players"); for (uint i=0; ;i++) { @@ -300,9 +300,9 @@ PlayerInfos::PlayerInfos() internal->hsConfig().lockForWriting(); KEMailSettings emailConfig; emailConfig.setProfile(emailConfig.defaultProfileName()); - QString name = emailConfig.getSetting(KEMailSettings::RealName); + TQString name = emailConfig.getSetting(KEMailSettings::RealName); if ( name.isEmpty() || isNameUsed(name) ) name = username; - if ( isNameUsed(name) ) name= QString(ItemContainer::ANONYMOUS); + if ( isNameUsed(name) ) name= TQString(ItemContainer::ANONYMOUS); #ifdef HIGHSCORE_DIRECTORY internal->hsConfig().writeEntry(_id+1, "username", username); item("name")->write(_id, name); @@ -314,14 +314,14 @@ PlayerInfos::PlayerInfos() #ifdef HIGHSCORE_DIRECTORY if (_oldLocalPlayer) { // player already exists in local config file // copy player data - QString prefix = QString("%1_").arg(_oldLocalId+1); - QMap<QString, QString> entries = + TQString prefix = TQString("%1_").arg(_oldLocalId+1); + TQMap<TQString, TQString> entries = cg.config()->entryMap("KHighscore_players"); - QMap<QString, QString>::const_iterator it; + TQMap<TQString, TQString>::const_iterator it; for (it=entries.begin(); it!=entries.end(); ++it) { - QString key = it.key(); + TQString key = it.key(); if ( key.find(prefix)==0 ) { - QString name = key.right(key.length()-prefix.length()); + TQString name = key.right(key.length()-prefix.length()); if ( name!="name" || !isNameUsed(it.data()) ) internal->hsConfig().writeEntry(_id+1, name, it.data()); } @@ -340,7 +340,7 @@ PlayerInfos::PlayerInfos() internal->hsConfig().writeAndUnlock(); } -void PlayerInfos::createHistoItems(const QMemArray<uint> &scores, bool bound) +void PlayerInfos::createHistoItems(const TQMemArray<uint> &scores, bool bound) { Q_ASSERT( _histogram.size()==0 ); _bound = bound; @@ -357,14 +357,14 @@ bool PlayerInfos::isAnonymous() const uint PlayerInfos::nbEntries() const { internal->hsConfig().setHighscoreGroup("players"); - QStringList list = internal->hsConfig().readList("name", -1); + TQStringList list = internal->hsConfig().readList("name", -1); return list.count(); } -QString PlayerInfos::key() const +TQString PlayerInfos::key() const { ConfigGroup cg; - return cg.config()->readEntry(HS_KEY, QString::null); + return cg.config()->readEntry(HS_KEY, TQString::null); } bool PlayerInfos::isWWEnabled() const @@ -373,13 +373,13 @@ bool PlayerInfos::isWWEnabled() const return cg.config()->readBoolEntry(HS_WW_ENABLED, false); } -QString PlayerInfos::histoName(uint i) const +TQString PlayerInfos::histoName(uint i) const { - const QMemArray<uint> &sh = _histogram; + const TQMemArray<uint> &sh = _histogram; Q_ASSERT( i<sh.size() || (_bound || i==sh.size()) ); if ( i==sh.size() ) - return QString("nb scores greater than %1").arg(sh[sh.size()-1]); - return QString("nb scores less than %1").arg(sh[i]); + return TQString("nb scores greater than %1").arg(sh[sh.size()-1]); + return TQString("nb scores less than %1").arg(sh[i]); } uint PlayerInfos::histoSize() const @@ -446,7 +446,7 @@ void PlayerInfos::submitScore(const Score &score) const // update histogram if ( score.type()==Won ) { - const QMemArray<uint> &sh = _histogram; + const TQMemArray<uint> &sh = _histogram; for (uint i=1; i<histoSize(); i++) if ( i==sh.size() || score.score()<sh[i] ) { item(histoName(i))->increment(_id); @@ -455,7 +455,7 @@ void PlayerInfos::submitScore(const Score &score) const } } -bool PlayerInfos::isNameUsed(const QString &newName) const +bool PlayerInfos::isNameUsed(const TQString &newName) const { if ( newName==name() ) return false; // own name... for (uint i=0; i<nbEntries(); i++) @@ -464,14 +464,14 @@ bool PlayerInfos::isNameUsed(const QString &newName) const return false; } -void PlayerInfos::modifyName(const QString &newName) const +void PlayerInfos::modifyName(const TQString &newName) const { item("name")->write(_id, newName); } -void PlayerInfos::modifySettings(const QString &newName, - const QString &comment, bool WWEnabled, - const QString &newKey) const +void PlayerInfos::modifySettings(const TQString &newName, + const TQString &comment, bool WWEnabled, + const TQString &newKey) const { modifyName(newName); item("comment")->write(_id, comment); @@ -481,10 +481,10 @@ void PlayerInfos::modifySettings(const QString &newName, if (WWEnabled) cg.config()->writeEntry(HS_REGISTERED_NAME, newName); } -QString PlayerInfos::registeredName() const +TQString PlayerInfos::registeredName() const { ConfigGroup cg; - return cg.config()->readEntry(HS_REGISTERED_NAME, QString::null); + return cg.config()->readEntry(HS_REGISTERED_NAME, TQString::null); } void PlayerInfos::removeKey() @@ -493,12 +493,12 @@ void PlayerInfos::removeKey() // save old key/nickname uint i = 0; - QString str = "%1 old #%2"; - QString sk; + TQString str = "%1 old #%2"; + TQString sk; do { i++; sk = str.arg(HS_KEY).arg(i); - } while ( !cg.config()->readEntry(sk, QString::null).isEmpty() ); + } while ( !cg.config()->readEntry(sk, TQString::null).isEmpty() ); cg.config()->writeEntry(sk, key()); cg.config()->writeEntry(str.arg(HS_REGISTERED_NAME).arg(i), registeredName()); @@ -531,11 +531,11 @@ ManagerPrivate::~ManagerPrivate() delete _hsConfig; } -KURL ManagerPrivate::queryURL(QueryType type, const QString &newName) const +KURL ManagerPrivate::queryURL(QueryType type, const TQString &newName) const { KURL url = serverURL; - QString nameItem = "nickname"; - QString name = _playerInfos->registeredName(); + TQString nameItem = "nickname"; + TQString name = _playerInfos->registeredName(); bool withVersion = true; bool key = false; bool level = false; @@ -572,7 +572,7 @@ KURL ManagerPrivate::queryURL(QueryType type, const QString &newName) const if ( !name.isEmpty() ) Manager::addToQueryURL(url, nameItem, name); if (key) Manager::addToQueryURL(url, "key", _playerInfos->key()); if (level) { - QString label = manager.gameTypeLabel(_gameType, Manager::WW); + TQString label = manager.gameTypeLabel(_gameType, Manager::WW); if ( !label.isEmpty() ) Manager::addToQueryURL(url, "level", label); } @@ -602,61 +602,61 @@ const char *DUMMY_STRINGS[] = { const char *UNABLE_TO_CONTACT = I18N_NOOP("Unable to contact world-wide highscore server"); -bool ManagerPrivate::doQuery(const KURL &url, QWidget *parent, - QDomNamedNodeMap *map) +bool ManagerPrivate::doQuery(const KURL &url, TQWidget *parent, + TQDomNamedNodeMap *map) { KIO::http_update_cache(url, true, 0); // remove cache ! - QString tmpFile; + TQString tmpFile; if ( !KIO::NetAccess::download(url, tmpFile, parent) ) { - QString details = i18n("Server URL: %1").arg(url.host()); + TQString details = i18n("Server URL: %1").arg(url.host()); KMessageBox::detailedSorry(parent, i18n(UNABLE_TO_CONTACT), details); return false; } - QFile file(tmpFile); + TQFile file(tmpFile); if ( !file.open(IO_ReadOnly) ) { KIO::NetAccess::removeTempFile(tmpFile); - QString details = i18n("Unable to open temporary file."); + TQString details = i18n("Unable to open temporary file."); KMessageBox::detailedSorry(parent, i18n(UNABLE_TO_CONTACT), details); return false; } - QTextStream t(&file); - QString content = t.read().stripWhiteSpace(); + TQTextStream t(&file); + TQString content = t.read().stripWhiteSpace(); file.close(); KIO::NetAccess::removeTempFile(tmpFile); - QDomDocument doc; + TQDomDocument doc; if ( doc.setContent(content) ) { - QDomElement root = doc.documentElement(); - QDomElement element = root.firstChild().toElement(); + TQDomElement root = doc.documentElement(); + TQDomElement element = root.firstChild().toElement(); if ( element.tagName()=="success" ) { if (map) *map = element.attributes(); return true; } if ( element.tagName()=="error" ) { - QDomAttr attr = element.attributes().namedItem("label").toAttr(); + TQDomAttr attr = element.attributes().namedItem("label").toAttr(); if ( !attr.isNull() ) { - QString msg = i18n(attr.value().latin1()); - QString caption = i18n("Message from world-wide highscores " + TQString msg = i18n(attr.value().latin1()); + TQString caption = i18n("Message from world-wide highscores " "server"); KMessageBox::sorry(parent, msg, caption); return false; } } } - QString msg = i18n("Invalid answer from world-wide highscores server."); - QString details = i18n("Raw message: %1").arg(content); + TQString msg = i18n("Invalid answer from world-wide highscores server."); + TQString details = i18n("Raw message: %1").arg(content); KMessageBox::detailedSorry(parent, msg, details); return false; } -bool ManagerPrivate::getFromQuery(const QDomNamedNodeMap &map, - const QString &name, QString &value, - QWidget *parent) +bool ManagerPrivate::getFromQuery(const TQDomNamedNodeMap &map, + const TQString &name, TQString &value, + TQWidget *parent) { - QDomAttr attr = map.namedItem(name).toAttr(); + TQDomAttr attr = map.namedItem(name).toAttr(); if ( attr.isNull() ) { KMessageBox::sorry(parent, i18n("Invalid answer from world-wide " @@ -683,11 +683,11 @@ int ManagerPrivate::rank(const Score &score) const return (i<_scoreInfos->maxNbEntries() ? (int)i : -1); } -bool ManagerPrivate::modifySettings(const QString &newName, - const QString &comment, bool WWEnabled, - QWidget *widget) +bool ManagerPrivate::modifySettings(const TQString &newName, + const TQString &comment, bool WWEnabled, + TQWidget *widget) { - QString newKey; + TQString newKey; bool newPlayer = false; if (WWEnabled) { @@ -696,7 +696,7 @@ bool ManagerPrivate::modifySettings(const QString &newName, KURL url = queryURL((newPlayer ? Register : Change), newName); Manager::addToQueryURL(url, "comment", comment); - QDomNamedNodeMap map; + TQDomNamedNodeMap map; bool ok = doQuery(url, widget, &map); if ( !ok || (newPlayer && !getFromQuery(map, "key", newKey, widget)) ) return false; @@ -720,7 +720,7 @@ void ManagerPrivate::convertToGlobal() // read old highscores KHighscore *tmp = _hsConfig; _hsConfig = new KHighscore(true, 0); - QValueVector<Score> scores(_scoreInfos->nbEntries()); + TQValueVector<Score> scores(_scoreInfos->nbEntries()); for (uint i=0; i<scores.count(); i++) scores[i] = readScore(i); @@ -759,8 +759,8 @@ void ManagerPrivate::setGameType(uint type) Q_ASSERT( type<_nbGameTypes ); _gameType = kMin(type, _nbGameTypes-1); - QString str = "scores"; - QString lab = manager.gameTypeLabel(_gameType, Manager::Standard); + TQString str = "scores"; + TQString lab = manager.gameTypeLabel(_gameType, Manager::Standard); if ( !lab.isEmpty() ) { _playerInfos->setSubGroup(lab); str += "_" + lab; @@ -774,22 +774,22 @@ void ManagerPrivate::checkFirst() } int ManagerPrivate::submitScore(const Score &ascore, - QWidget *widget, bool askIfAnonymous) + TQWidget *widget, bool askIfAnonymous) { checkFirst(); Score score = ascore; score.setData("id", _playerInfos->id() + 1); - score.setData("date", QDateTime::currentDateTime()); + score.setData("date", TQDateTime::currentDateTime()); // ask new name if anonymous and winner const char *dontAskAgainName = "highscore_ask_name_dialog"; - QString newName; + TQString newName; KMessageBox::ButtonCode dummy; if ( score.type()==Won && askIfAnonymous && _playerInfos->isAnonymous() && KMessageBox::shouldBeShownYesNo(dontAskAgainName, dummy) ) { AskNameDialog d(widget); - if ( d.exec()==QDialog::Accepted ) newName = d.name(); + if ( d.exec()==TQDialog::Accepted ) newName = d.name(); if ( d.dontAskAgain() ) KMessageBox::saveDontShowAgainYesNo(dontAskAgainName, KMessageBox::No); @@ -825,7 +825,7 @@ int ManagerPrivate::submitLocal(const Score &score) } bool ManagerPrivate::submitWorldWide(const Score &score, - QWidget *widget) const + TQWidget *widget) const { if ( score.type()==Lost && !trackLostGames ) return true; if ( score.type()==Draw && !trackDrawGames ) return true; @@ -833,15 +833,15 @@ bool ManagerPrivate::submitWorldWide(const Score &score, KURL url = queryURL(Submit); manager.additionalQueryItems(url, score); int s = (score.type()==Won ? score.score() : (int)score.type()); - QString str = QString::number(s); + TQString str = TQString::number(s); Manager::addToQueryURL(url, "score", str); - KMD5 context(QString(_playerInfos->registeredName() + str).latin1()); + KMD5 context(TQString(_playerInfos->registeredName() + str).latin1()); Manager::addToQueryURL(url, "check", context.hexDigest()); return doQuery(url, widget); } -void ManagerPrivate::exportHighscores(QTextStream &s) +void ManagerPrivate::exportHighscores(TQTextStream &s) { uint tmp = _gameType; diff --git a/libkdegames/highscore/kexthighscore_internal.h b/libkdegames/highscore/kexthighscore_internal.h index 3b206877..639c059b 100644 --- a/libkdegames/highscore/kexthighscore_internal.h +++ b/libkdegames/highscore/kexthighscore_internal.h @@ -48,16 +48,16 @@ class RankItem : public Item RankItem() : Item((uint)0, i18n("Rank"), Qt::AlignRight) {} - QVariant read(uint rank, const QVariant &) const { return rank; } - QString pretty(uint rank, const QVariant &) const - { return QString::number(rank+1); } + TQVariant read(uint rank, const TQVariant &) const { return rank; } + TQString pretty(uint rank, const TQVariant &) const + { return TQString::number(rank+1); } }; class NameItem : public Item { public: NameItem() - : Item(QString::null, i18n("Name"), Qt::AlignLeft) { + : Item(TQString::null, i18n("Name"), Qt::AlignLeft) { setPrettySpecial(Anonymous); } }; @@ -66,7 +66,7 @@ class DateItem : public Item { public: DateItem() - : Item(QDateTime(), i18n("Date"), Qt::AlignRight) { + : Item(TQDateTime(), i18n("Date"), Qt::AlignRight) { setPrettyFormat(DateTime); } }; @@ -92,29 +92,29 @@ class ItemContainer const Item *item() const { return _item; } Item *item() { return _item; } - void setName(const QString &name) { _name = name; } - QString name() const { return _name; } + void setName(const TQString &name) { _name = name; } + TQString name() const { return _name; } - void setGroup(const QString &group) { _group = group; } + void setGroup(const TQString &group) { _group = group; } bool isStored() const { return !_group.isNull(); } - void setSubGroup(const QString &subGroup) { _subGroup = subGroup; } + void setSubGroup(const TQString &subGroup) { _subGroup = subGroup; } bool canHaveSubGroup() const { return !_subGroup.isNull(); } static const char ANONYMOUS[]; // name assigned to anonymous players static const char ANONYMOUS_LABEL[]; - QVariant read(uint i) const; - QString pretty(uint i) const; - void write(uint i, const QVariant &value) const; - // for UInt QVariant (return new value) + TQVariant read(uint i) const; + TQString pretty(uint i) const; + void write(uint i, const TQVariant &value) const; + // for UInt TQVariant (return new value) uint increment(uint i) const; private: Item *_item; - QString _name, _group, _subGroup; + TQString _name, _group, _subGroup; - QString entryName() const; + TQString entryName() const; ItemContainer(const ItemContainer &); ItemContainer &operator =(const ItemContainer &); @@ -125,7 +125,7 @@ class ItemContainer * Manage a bunch of @ref Item which are saved under the same group * in KHighscores config file. */ -class ItemArray : public QMemArray<ItemContainer *> +class ItemArray : public TQMemArray<ItemContainer *> { public: ItemArray(); @@ -133,26 +133,26 @@ class ItemArray : public QMemArray<ItemContainer *> virtual uint nbEntries() const = 0; - const ItemContainer *item(const QString &name) const; - ItemContainer *item(const QString &name); + const ItemContainer *item(const TQString &name) const; + ItemContainer *item(const TQString &name); - void addItem(const QString &name, Item *, bool stored = true, + void addItem(const TQString &name, Item *, bool stored = true, bool canHaveSubGroup = false); - void setItem(const QString &name, Item *); - int findIndex(const QString &name) const; + void setItem(const TQString &name, Item *); + int findIndex(const TQString &name) const; - void setGroup(const QString &group); - void setSubGroup(const QString &subGroup); + void setGroup(const TQString &group); + void setSubGroup(const TQString &subGroup); void read(uint k, Score &data) const; void write(uint k, const Score &data, uint maxNbLines) const; - void exportToText(QTextStream &) const; + void exportToText(TQTextStream &) const; private: - QString _group, _subGroup; + TQString _group, _subGroup; - void _setItem(uint i, const QString &name, Item *, bool stored, + void _setItem(uint i, const TQString &name, Item *, bool stored, bool canHaveSubGroup); ItemArray(const ItemArray &); @@ -176,7 +176,7 @@ class ScoreInfos : public ItemArray class ConfigGroup : public KConfigGroupSaver { public: - ConfigGroup(const QString &group = QString::null) + ConfigGroup(const TQString &group = TQString::null) : KConfigGroupSaver(kapp->config(), group) {} }; @@ -189,34 +189,34 @@ class PlayerInfos : public ItemArray bool isNewPlayer() const { return _newPlayer; } bool isOldLocalPlayer() const { return _oldLocalPlayer; } uint nbEntries() const; - QString name() const { return item("name")->read(_id).toString(); } + TQString name() const { return item("name")->read(_id).toString(); } bool isAnonymous() const; - QString prettyName() const { return prettyName(_id); } - QString prettyName(uint id) const { return item("name")->pretty(id); } - QString registeredName() const; - QString comment() const { return item("comment")->pretty(_id); } + TQString prettyName() const { return prettyName(_id); } + TQString prettyName(uint id) const { return item("name")->pretty(id); } + TQString registeredName() const; + TQString comment() const { return item("comment")->pretty(_id); } bool isWWEnabled() const; - QString key() const; + TQString key() const; uint id() const { return _id; } uint oldLocalId() const { return _oldLocalId; } - void createHistoItems(const QMemArray<uint> &scores, bool bound); - QString histoName(uint i) const; + void createHistoItems(const TQMemArray<uint> &scores, bool bound); + TQString histoName(uint i) const; uint histoSize() const; - const QMemArray<uint> &histogram() const { return _histogram; } + const TQMemArray<uint> &histogram() const { return _histogram; } void submitScore(const Score &) const; // return true if the nickname is already used locally - bool isNameUsed(const QString &name) const; - void modifyName(const QString &newName) const; - void modifySettings(const QString &newName, const QString &comment, - bool WWEnabled, const QString &newKey) const; + bool isNameUsed(const TQString &name) const; + void modifyName(const TQString &newName) const; + void modifySettings(const TQString &newName, const TQString &comment, + bool WWEnabled, const TQString &newKey) const; void removeKey(); private: bool _newPlayer, _bound, _oldLocalPlayer; uint _id, _oldLocalId; - QMemArray<uint> _histogram; + TQMemArray<uint> _histogram; }; //----------------------------------------------------------------------------- @@ -227,13 +227,13 @@ class ManagerPrivate void init(uint maxNbentries); ~ManagerPrivate(); - bool modifySettings(const QString &newName, const QString &comment, - bool WWEnabled, QWidget *widget); + bool modifySettings(const TQString &newName, const TQString &comment, + bool WWEnabled, TQWidget *widget); void setGameType(uint type); void checkFirst(); int submitLocal(const Score &score); - int submitScore(const Score &score, QWidget *widget, bool askIfAnonymous); + int submitScore(const Score &score, TQWidget *widget, bool askIfAnonymous); Score readScore(uint i) const; uint gameType() const { return _gameType; } @@ -243,13 +243,13 @@ class ManagerPrivate PlayerInfos &playerInfos() { return *_playerInfos; } KHighscore &hsConfig() { return *_hsConfig; } enum QueryType { Submit, Register, Change, Players, Scores }; - KURL queryURL(QueryType type, const QString &newName=QString::null) const; + KURL queryURL(QueryType type, const TQString &newName=TQString::null) const; - void exportHighscores(QTextStream &); + void exportHighscores(TQTextStream &); Manager &manager; KURL serverURL; - QString version; + TQString version; bool showStatistics, showDrawGames, trackLostGames, trackDrawGames; Manager::ShowMode showMode; @@ -264,11 +264,11 @@ class ManagerPrivate // return -1 if not a local best score int rank(const Score &score) const; - bool submitWorldWide(const Score &score, QWidget *parent) const; - static bool doQuery(const KURL &url, QWidget *parent, - QDomNamedNodeMap *map = 0); - static bool getFromQuery(const QDomNamedNodeMap &map, const QString &name, - QString &value, QWidget *parent); + bool submitWorldWide(const Score &score, TQWidget *parent) const; + static bool doQuery(const KURL &url, TQWidget *parent, + TQDomNamedNodeMap *map = 0); + static bool getFromQuery(const TQDomNamedNodeMap &map, const TQString &name, + TQString &value, TQWidget *parent); void convertToGlobal(); }; diff --git a/libkdegames/highscore/kexthighscore_item.cpp b/libkdegames/highscore/kexthighscore_item.cpp index 48556e02..fa6c7e2c 100644 --- a/libkdegames/highscore/kexthighscore_item.cpp +++ b/libkdegames/highscore/kexthighscore_item.cpp @@ -19,7 +19,7 @@ #include "kexthighscore_item.h" -#include <qlayout.h> +#include <tqlayout.h> #include <kglobal.h> #include <kdialogbase.h> #include <kdebug.h> @@ -33,7 +33,7 @@ namespace KExtHighscore { //----------------------------------------------------------------------------- -Item::Item(const QVariant &def, const QString &label, int alignment) +Item::Item(const TQVariant &def, const TQString &label, int alignment) : _default(def), _label(label), _alignment(alignment), _format(NoFormat), _special(NoSpecial) {} @@ -41,16 +41,16 @@ Item::Item(const QVariant &def, const QString &label, int alignment) Item::~Item() {} -QVariant Item::read(uint, const QVariant &value) const +TQVariant Item::read(uint, const TQVariant &value) const { return value; } void Item::setPrettyFormat(Format format) { - bool buint = ( _default.type()==QVariant::UInt ); - bool bdouble = ( _default.type()==QVariant::Double ); - bool bnum = ( buint || bdouble || _default.type()==QVariant::Int ); + bool buint = ( _default.type()==TQVariant::UInt ); + bool bdouble = ( _default.type()==TQVariant::Double ); + bool bnum = ( buint || bdouble || _default.type()==TQVariant::Int ); switch (format) { case OneDecimal: @@ -61,7 +61,7 @@ void Item::setPrettyFormat(Format format) Q_ASSERT(bnum); break; case DateTime: - Q_ASSERT( _default.type()==QVariant::DateTime ); + Q_ASSERT( _default.type()==TQVariant::DateTime ); break; case NoFormat: break; @@ -72,9 +72,9 @@ void Item::setPrettyFormat(Format format) void Item::setPrettySpecial(Special special) { - bool buint = ( _default.type()==QVariant::UInt ); - bool bnum = ( buint || _default.type()==QVariant::Double - || _default.type()==QVariant::Int ); + bool buint = ( _default.type()==TQVariant::UInt ); + bool bnum = ( buint || _default.type()==TQVariant::Double + || _default.type()==TQVariant::Int ); switch (special) { case ZeroNotDefined: @@ -86,7 +86,7 @@ void Item::setPrettySpecial(Special special) case DefaultNotDefined: break; case Anonymous: - Q_ASSERT( _default.type()==QVariant::String ); + Q_ASSERT( _default.type()==TQVariant::String ); break; case NoSpecial: break; @@ -95,15 +95,15 @@ void Item::setPrettySpecial(Special special) _special = special; } -QString Item::timeFormat(uint n) +TQString Item::timeFormat(uint n) { Q_ASSERT( n<=3600 && n!=0 ); n = 3600 - n; - return QString::number(n / 60).rightJustify(2, '0') + ':' - + QString::number(n % 60).rightJustify(2, '0'); + return TQString::number(n / 60).rightJustify(2, '0') + ':' + + TQString::number(n % 60).rightJustify(2, '0'); } -QString Item::pretty(uint, const QVariant &value) const +TQString Item::pretty(uint, const TQVariant &value) const { switch (_special) { case ZeroNotDefined: @@ -125,9 +125,9 @@ QString Item::pretty(uint, const QVariant &value) const switch (_format) { case OneDecimal: - return QString::number(value.toDouble(), 'f', 1); + return TQString::number(value.toDouble(), 'f', 1); case Percentage: - return QString::number(value.toDouble(), 'f', 1) + "%"; + return TQString::number(value.toDouble(), 'f', 1) + "%"; case MinuteTime: return timeFormat(value.toUInt()); case DateTime: @@ -152,13 +152,13 @@ Score::Score(ScoreType type) Score::~Score() {} -const QVariant &Score::data(const QString &name) const +const TQVariant &Score::data(const TQString &name) const { Q_ASSERT( _data.contains(name) ); return _data[name]; } -void Score::setData(const QString &name, const QVariant &value) +void Score::setData(const TQString &name, const TQVariant &value) { Q_ASSERT( _data.contains(name) ); Q_ASSERT( _data[name].type()==value.type() ); @@ -176,14 +176,14 @@ bool Score::operator <(const Score &score) return internal->manager.isStrictlyLess(*this, score); } -QDataStream &operator <<(QDataStream &s, const Score &score) +TQDataStream &operator <<(TQDataStream &s, const Score &score) { s << (Q_UINT8)score.type(); s << score._data; return s; } -QDataStream &operator >>(QDataStream &s, Score &score) +TQDataStream &operator >>(TQDataStream &s, Score &score) { Q_UINT8 type; s >> type; @@ -204,7 +204,7 @@ void MultiplayerScores::clear() Score score; for (uint i=0; i<_scores.size(); i++) { _nbGames[i] = 0; - QVariant name = _scores[i].data("name"); + TQVariant name = _scores[i].data("name"); _scores[i] = score; _scores[i].setData("name", name); _scores[i]._data["mean score"] = double(0); @@ -219,14 +219,14 @@ void MultiplayerScores::setPlayerCount(uint nb) clear(); } -void MultiplayerScores::setName(uint i, const QString &name) +void MultiplayerScores::setName(uint i, const TQString &name) { _scores[i].setData("name", name); } void MultiplayerScores::addScore(uint i, const Score &score) { - QVariant name = _scores[i].data("name"); + TQVariant name = _scores[i].data("name"); double mean = _scores[i].data("mean score").toDouble(); uint won = _scores[i].data("nb won games").toUInt(); _scores[i] = score; @@ -238,7 +238,7 @@ void MultiplayerScores::addScore(uint i, const Score &score) _scores[i]._data["nb won games"] = won; } -void MultiplayerScores::show(QWidget *parent) +void MultiplayerScores::show(TQWidget *parent) { // check consistency if ( _nbGames.size()<2 ) kdWarning(11002) << "less than 2 players" << endl; @@ -252,11 +252,11 @@ void MultiplayerScores::show(QWidget *parent) } // order the players according to the number of won games - QValueVector<Score> ordered; + TQValueVector<Score> ordered; for (uint i=0; i<_scores.size(); i++) { uint won = _scores[i].data("nb won games").toUInt(); double mean = _scores[i].data("mean score").toDouble(); - QValueVector<Score>::iterator it; + TQValueVector<Score>::iterator it; for(it = ordered.begin(); it!=ordered.end(); ++it) { uint cwon = (*it).data("nb won games").toUInt(); double cmean = (*it).data("mean score").toDouble(); @@ -272,21 +272,21 @@ void MultiplayerScores::show(QWidget *parent) KDialogBase dialog(KDialogBase::Plain, i18n("Multiplayers Scores"), KDialogBase::Close, KDialogBase::Close, parent, "show_multiplayers_score", true, true); - QHBoxLayout *hbox = new QHBoxLayout(dialog.plainPage(), + TQHBoxLayout *hbox = new TQHBoxLayout(dialog.plainPage(), KDialog::marginHint(), KDialog::spacingHint()); - QVBox *vbox = new QVBox(dialog.plainPage()); + TQVBox *vbox = new TQVBox(dialog.plainPage()); hbox->addWidget(vbox); - if ( _nbGames[0]==0 ) (void)new QLabel(i18n("No game played."), vbox); + if ( _nbGames[0]==0 ) (void)new TQLabel(i18n("No game played."), vbox); else { - (void)new QLabel(i18n("Scores for last game:"), vbox); + (void)new TQLabel(i18n("Scores for last game:"), vbox); (void)new LastMultipleScoresList(ordered, vbox); } if ( _nbGames[0]>1 ) { - vbox = new QVBox(dialog.plainPage()); + vbox = new TQVBox(dialog.plainPage()); hbox->addWidget(vbox); - (void)new QLabel(i18n("Scores for the last %1 games:") + (void)new TQLabel(i18n("Scores for the last %1 games:") .arg(_nbGames[0]), vbox); (void)new TotalMultipleScoresList(ordered, vbox); } @@ -295,14 +295,14 @@ void MultiplayerScores::show(QWidget *parent) dialog.exec(); } -QDataStream &operator <<(QDataStream &s, const MultiplayerScores &score) +TQDataStream &operator <<(TQDataStream &s, const MultiplayerScores &score) { s << score._scores; s << score._nbGames; return s; } -QDataStream &operator >>(QDataStream &s, MultiplayerScores &score) +TQDataStream &operator >>(TQDataStream &s, MultiplayerScores &score) { s >> score._scores; s >> score._nbGames; diff --git a/libkdegames/highscore/kexthighscore_item.h b/libkdegames/highscore/kexthighscore_item.h index 0200fabd..ff067bd2 100644 --- a/libkdegames/highscore/kexthighscore_item.h +++ b/libkdegames/highscore/kexthighscore_item.h @@ -20,10 +20,10 @@ #ifndef KEXTHIGHSCORE_ITEM_H #define KEXTHIGHSCORE_ITEM_H -#include <qvariant.h> -#include <qnamespace.h> -#include <qmap.h> -#include <qvaluevector.h> +#include <tqvariant.h> +#include <tqnamespace.h> +#include <tqmap.h> +#include <tqvaluevector.h> #include <kdemacros.h> class QWidget; @@ -75,14 +75,14 @@ class KDE_EXPORT Item /** * Constructor. * - * @param def default value ; the QVariant also gives the type of data. + * @param def default value ; the TQVariant also gives the type of data. * Be sure to cast the value to the required type (for e.g. with uint). * @param label the label corresponding to the item. If empty, the item * is not shown. * @param alignment the alignment of the item. */ - Item(const QVariant &def = QVariant::Invalid, - const QString &label = QString::null, int alignment = Qt::AlignRight); + Item(const TQVariant &def = TQVariant::Invalid, + const TQString &label = TQString::null, int alignment = Qt::AlignRight); virtual ~Item(); @@ -106,12 +106,12 @@ class KDE_EXPORT Item /** * Set the label. */ - void setLabel(const QString &label) { _label = label; } + void setLabel(const TQString &label) { _label = label; } /** * @return the label. */ - QString label() const { return _label; } + TQString label() const { return _label; } /** * @return the alignment. @@ -121,12 +121,12 @@ class KDE_EXPORT Item /** * Set default value. */ - void setDefaultValue(const QVariant &value) { _default = value; } + void setDefaultValue(const TQVariant &value) { _default = value; } /** * @return the default value. */ - const QVariant &defaultValue() const { return _default; } + const TQVariant &defaultValue() const { return _default; } /** * @return the converted value (by default the value is left @@ -135,7 +135,7 @@ class KDE_EXPORT Item * @param i the element index ("rank" for score / "id" for player) * @param value the value to convert */ - virtual QVariant read(uint i, const QVariant &value) const; + virtual TQVariant read(uint i, const TQVariant &value) const; /** * @return the string to be displayed. You may need to reimplement this @@ -144,11 +144,11 @@ class KDE_EXPORT Item * @param i the element index ("rank" for score / "id" for player) * @param value the value to convert */ - virtual QString pretty(uint i, const QVariant &value) const; + virtual TQString pretty(uint i, const TQVariant &value) const; private: - QVariant _default; - QString _label; + TQVariant _default; + TQString _label; int _alignment; Format _format; Special _special; @@ -156,7 +156,7 @@ class KDE_EXPORT Item class ItemPrivate; ItemPrivate *d; - static QString timeFormat(uint); + static TQString timeFormat(uint); }; //----------------------------------------------------------------------------- @@ -192,14 +192,14 @@ class KDE_EXPORT Score /** * @return the data associated with the named Item. */ - const QVariant &data(const QString &name) const; + const TQVariant &data(const TQString &name) const; /** * Set the data associated with the named Item. Note that the * value should have the type of the default value of the * Item. */ - void setData(const QString &name, const QVariant &value); + void setData(const TQString &name, const TQVariant &value); /** * @return the score value. @@ -230,19 +230,19 @@ class KDE_EXPORT Score private: ScoreType _type; - QMap<QString, QVariant> _data; + TQMap<TQString, TQVariant> _data; class ScorePrivate; ScorePrivate *d; friend class MultiplayerScores; - friend QDataStream &operator <<(QDataStream &stream, const Score &score); - friend QDataStream &operator >>(QDataStream &stream, Score &score); + friend TQDataStream &operator <<(TQDataStream &stream, const Score &score); + friend TQDataStream &operator >>(TQDataStream &stream, Score &score); }; -KDE_EXPORT QDataStream &operator <<(QDataStream &stream, const Score &score); -KDE_EXPORT QDataStream &operator >>(QDataStream &stream, Score &score); +KDE_EXPORT TQDataStream &operator <<(TQDataStream &stream, const Score &score); +KDE_EXPORT TQDataStream &operator >>(TQDataStream &stream, Score &score); /** * This class is used to store and show scores for multiplayer games. @@ -279,7 +279,7 @@ class KDE_EXPORT MultiplayerScores /** * Set the name of player. */ - void setName(uint player, const QString &name); + void setName(uint player, const TQString &name); /** * Add the score of player. @@ -294,23 +294,23 @@ class KDE_EXPORT MultiplayerScores /** * Show scores. */ - void show(QWidget *parent); + void show(TQWidget *parent); private: - QValueVector<uint> _nbGames; - QValueVector<Score> _scores; + TQValueVector<uint> _nbGames; + TQValueVector<Score> _scores; class MultiplayerScoresPrivate; MultiplayerScoresPrivate *d; - friend QDataStream &operator <<(QDataStream &stream, + friend TQDataStream &operator <<(TQDataStream &stream, const MultiplayerScores &score); - friend QDataStream &operator >>(QDataStream &stream, + friend TQDataStream &operator >>(TQDataStream &stream, MultiplayerScores &score); }; -KDE_EXPORT QDataStream &operator <<(QDataStream &stream, const MultiplayerScores &score); -KDE_EXPORT QDataStream &operator >>(QDataStream &stream, MultiplayerScores &score); +KDE_EXPORT TQDataStream &operator <<(TQDataStream &stream, const MultiplayerScores &score); +KDE_EXPORT TQDataStream &operator >>(TQDataStream &stream, MultiplayerScores &score); } // namespace diff --git a/libkdegames/highscore/kexthighscore_tab.cpp b/libkdegames/highscore/kexthighscore_tab.cpp index 3e9cbe8a..3b2b5852 100644 --- a/libkdegames/highscore/kexthighscore_tab.cpp +++ b/libkdegames/highscore/kexthighscore_tab.cpp @@ -20,11 +20,11 @@ #include "kexthighscore_tab.h" #include "kexthighscore_tab.moc" -#include <qlayout.h> -#include <qlabel.h> -#include <qvgroupbox.h> -#include <qgrid.h> -#include <qheader.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqvgroupbox.h> +#include <tqgrid.h> +#include <tqheader.h> #include <kdialogbase.h> #include <klistview.h> @@ -39,14 +39,14 @@ namespace KExtHighscore { //----------------------------------------------------------------------------- -PlayersCombo::PlayersCombo(QWidget *parent, const char *name) - : QComboBox(parent, name) +PlayersCombo::PlayersCombo(TQWidget *parent, const char *name) + : TQComboBox(parent, name) { const PlayerInfos &p = internal->playerInfos(); for (uint i = 0; i<p.nbEntries(); i++) insertItem(p.prettyName(i)); - insertItem(QString("<") + i18n("all") + '>'); - connect(this, SIGNAL(activated(int)), SLOT(activatedSlot(int))); + insertItem(TQString("<") + i18n("all") + '>'); + connect(this, TQT_SIGNAL(activated(int)), TQT_SLOT(activatedSlot(int))); } void PlayersCombo::activatedSlot(int i) @@ -65,19 +65,19 @@ void PlayersCombo::load() } //----------------------------------------------------------------------------- -AdditionalTab::AdditionalTab(QWidget *parent, const char *name) - : QWidget(parent, name) +AdditionalTab::AdditionalTab(TQWidget *parent, const char *name) + : TQWidget(parent, name) { - QVBoxLayout *top = new QVBoxLayout(this, KDialogBase::marginHint(), + TQVBoxLayout *top = new TQVBoxLayout(this, KDialogBase::marginHint(), KDialogBase::spacingHint()); - QHBoxLayout *hbox = new QHBoxLayout(top); - QLabel *label = new QLabel(i18n("Select player:"), this); + TQHBoxLayout *hbox = new TQHBoxLayout(top); + TQLabel *label = new TQLabel(i18n("Select player:"), this); hbox->addWidget(label); _combo = new PlayersCombo(this); - connect(_combo, SIGNAL(playerSelected(uint)), - SLOT(playerSelected(uint))); - connect(_combo, SIGNAL(allSelected()), SLOT(allSelected())); + connect(_combo, TQT_SIGNAL(playerSelected(uint)), + TQT_SLOT(playerSelected(uint))); + connect(_combo, TQT_SIGNAL(allSelected()), TQT_SLOT(allSelected())); hbox->addWidget(_combo); hbox->addStretch(1); } @@ -94,11 +94,11 @@ void AdditionalTab::allSelected() display(internal->playerInfos().nbEntries()); } -QString AdditionalTab::percent(uint n, uint total, bool withBraces) +TQString AdditionalTab::percent(uint n, uint total, bool withBraces) { - if ( n==0 || total==0 ) return QString::null; - QString s = QString("%1%").arg(100.0 * n / total, 0, 'f', 1); - return (withBraces ? QString("(") + s + ")" : s); + if ( n==0 || total==0 ) return TQString::null; + TQString s = TQString("%1%").arg(100.0 * n / total, 0, 'f', 1); + return (withBraces ? TQString("(") + s + ")" : s); } void AdditionalTab::load() @@ -116,32 +116,32 @@ const char *StatisticsTab::TREND_LABELS[Nb_Trends] = { I18N_NOOP("Current:"), I18N_NOOP("Max won:"), I18N_NOOP("Max lost:") }; -StatisticsTab::StatisticsTab(QWidget *parent) +StatisticsTab::StatisticsTab(TQWidget *parent) : AdditionalTab(parent, "statistics_tab") { // construct GUI - QVBoxLayout *top = static_cast<QVBoxLayout *>(layout()); + TQVBoxLayout *top = static_cast<TQVBoxLayout *>(layout()); - QHBoxLayout *hbox = new QHBoxLayout(top); - QVBoxLayout *vbox = new QVBoxLayout(hbox); - QVGroupBox *group = new QVGroupBox(i18n("Game Counts"), this); + TQHBoxLayout *hbox = new TQHBoxLayout(top); + TQVBoxLayout *vbox = new TQVBoxLayout(hbox); + TQVGroupBox *group = new TQVGroupBox(i18n("Game Counts"), this); vbox->addWidget(group); - QGrid *grid = new QGrid(3, group); + TQGrid *grid = new TQGrid(3, group); grid->setSpacing(KDialogBase::spacingHint()); for (uint k=0; k<Nb_Counts; k++) { if ( Count(k)==Draw && !internal->showDrawGames ) continue; - (void)new QLabel(i18n(COUNT_LABELS[k]), grid); - _nbs[k] = new QLabel(grid); - _percents[k] = new QLabel(grid); + (void)new TQLabel(i18n(COUNT_LABELS[k]), grid); + _nbs[k] = new TQLabel(grid); + _percents[k] = new TQLabel(grid); } - group = new QVGroupBox(i18n("Trends"), this); + group = new TQVGroupBox(i18n("Trends"), this); vbox->addWidget(group); - grid = new QGrid(2, group); + grid = new TQGrid(2, group); grid->setSpacing(KDialogBase::spacingHint()); for (uint k=0; k<Nb_Trends; k++) { - (void)new QLabel(i18n(TREND_LABELS[k]), grid); - _trends[k] = new QLabel(grid); + (void)new TQLabel(i18n(TREND_LABELS[k]), grid); + _trends[k] = new TQLabel(grid); } hbox->addStretch(1); @@ -182,9 +182,9 @@ void StatisticsTab::load() init(); } -QString StatisticsTab::percent(const Data &d, Count count) const +TQString StatisticsTab::percent(const Data &d, Count count) const { - if ( count==Total ) return QString::null; + if ( count==Total ) return TQString::null; return AdditionalTab::percent(d.count[count], d.count[Total], true); } @@ -193,26 +193,26 @@ void StatisticsTab::display(uint i) const Data &d = _data[i]; for (uint k=0; k<Nb_Counts; k++) { if ( Count(k) && !internal->showDrawGames ) continue; - _nbs[k]->setText(QString::number(d.count[k])); + _nbs[k]->setText(TQString::number(d.count[k])); _percents[k]->setText(percent(d, Count(k))); } for (uint k=0; k<Nb_Trends; k++) { - QString s; + TQString s; if ( d.trend[k]>0 ) s = '+'; int prec = (i==internal->playerInfos().nbEntries() ? 1 : 0); - _trends[k]->setText(s + QString::number(d.trend[k], 'f', prec)); + _trends[k]->setText(s + TQString::number(d.trend[k], 'f', prec)); } } //----------------------------------------------------------------------------- -HistogramTab::HistogramTab(QWidget *parent) +HistogramTab::HistogramTab(TQWidget *parent) : AdditionalTab(parent, "histogram_tab") { // construct GUI - QVBoxLayout *top = static_cast<QVBoxLayout *>(layout()); + TQVBoxLayout *top = static_cast<TQVBoxLayout *>(layout()); _list = new KListView(this); - _list->setSelectionMode(QListView::NoSelection); + _list->setSelectionMode(TQListView::NoSelection); _list->setItemMargin(3); _list->setAllColumnsShowFocus(true); _list->setSorting(-1); @@ -225,14 +225,14 @@ HistogramTab::HistogramTab(QWidget *parent) _list->addColumn(i18n("Count")); _list->addColumn(i18n("Percent")); for (uint i=0; i<4; i++) _list->setColumnAlignment(i, AlignRight); - _list->addColumn(QString::null); + _list->addColumn(TQString::null); const Item *sitem = internal->scoreInfos().item("score")->item(); const PlayerInfos &pi = internal->playerInfos(); - const QMemArray<uint> &sh = pi.histogram(); + const TQMemArray<uint> &sh = pi.histogram(); for (uint k=1; k<pi.histoSize(); k++) { - QString s1 = sitem->pretty(0, sh[k-1]); - QString s2; + TQString s1 = sitem->pretty(0, sh[k-1]); + TQString s2; if ( k==sh.size() ) s2 = "..."; else if ( sh[k]!=sh[k-1]+1 ) s2 = sitem->pretty(0, sh[k]); (void)new KListViewItem(_list, s1, s2); @@ -264,14 +264,14 @@ void HistogramTab::load() void HistogramTab::display(uint i) { const PlayerInfos &pi = internal->playerInfos(); - QListViewItem *item = _list->firstChild(); + TQListViewItem *item = _list->firstChild(); uint s = pi.histoSize() - 1; for (int k=s-1; k>=0; k--) { uint nb = _counts[i*s + k]; - item->setText(2, QString::number(nb)); + item->setText(2, TQString::number(nb)); item->setText(3, percent(nb, _data[i])); uint width = (_data[i]==0 ? 0 : qRound(150.0 * nb / _data[i])); - QPixmap pixmap(width, 10); + TQPixmap pixmap(width, 10); pixmap.fill(blue); item->setPixmap(4, pixmap); item = item->nextSibling(); diff --git a/libkdegames/highscore/kexthighscore_tab.h b/libkdegames/highscore/kexthighscore_tab.h index ce47a75f..3d31bc95 100644 --- a/libkdegames/highscore/kexthighscore_tab.h +++ b/libkdegames/highscore/kexthighscore_tab.h @@ -20,8 +20,8 @@ #ifndef KEXTHIGHSCORE_TAB_H #define KEXTHIGHSCORE_TAB_H -#include <qcombobox.h> -#include <qmemarray.h> +#include <tqcombobox.h> +#include <tqmemarray.h> class QLabel; class KListView; @@ -35,7 +35,7 @@ class PlayersCombo : public QComboBox { Q_OBJECT public: - PlayersCombo(QWidget *parent = 0, const char *name = 0); + PlayersCombo(TQWidget *parent = 0, const char *name = 0); void load(); @@ -53,7 +53,7 @@ class AdditionalTab : public QWidget { Q_OBJECT public: - AdditionalTab(QWidget *parent, const char *name); + AdditionalTab(TQWidget *parent, const char *name); virtual void load(); @@ -63,7 +63,7 @@ class AdditionalTab : public QWidget protected: void init(); - static QString percent(uint n, uint total, bool withBraces = false); + static TQString percent(uint n, uint total, bool withBraces = false); virtual void display(uint i) = 0; private: @@ -75,7 +75,7 @@ class StatisticsTab : public AdditionalTab { Q_OBJECT public: - StatisticsTab(QWidget *parent); + StatisticsTab(TQWidget *parent); void load(); @@ -88,10 +88,10 @@ class StatisticsTab : public AdditionalTab uint count[Nb_Counts]; double trend[Nb_Trends]; }; - QMemArray<Data> _data; - QLabel *_nbs[Nb_Counts], *_percents[Nb_Counts], *_trends[Nb_Trends]; + TQMemArray<Data> _data; + TQLabel *_nbs[Nb_Counts], *_percents[Nb_Counts], *_trends[Nb_Trends]; - QString percent(const Data &, Count) const; + TQString percent(const Data &, Count) const; void display(uint i); }; @@ -100,13 +100,13 @@ class HistogramTab : public AdditionalTab { Q_OBJECT public: - HistogramTab(QWidget *parent); + HistogramTab(TQWidget *parent); void load(); private: - QMemArray<uint> _counts; - QMemArray<uint> _data; + TQMemArray<uint> _counts; + TQMemArray<uint> _data; KListView *_list; void display(uint i); diff --git a/libkdegames/highscore/khighscore.cpp b/libkdegames/highscore/khighscore.cpp index 4e1f68e5..26bb47c3 100644 --- a/libkdegames/highscore/khighscore.cpp +++ b/libkdegames/highscore/khighscore.cpp @@ -46,7 +46,7 @@ class KHighscorePrivate public: KHighscorePrivate() {} - QString group; + TQString group; bool global; }; @@ -56,14 +56,14 @@ static KStaticDeleter<KFileLock> lockSD; static KStaticDeleter<KRawConfig> configSD; -KHighscore::KHighscore(QObject* parent) - : QObject(parent) +KHighscore::KHighscore(TQObject* parent) + : TQObject(parent) { init(true); } -KHighscore::KHighscore(bool forceLocal, QObject* parent) - : QObject(parent) +KHighscore::KHighscore(bool forceLocal, TQObject* parent) + : TQObject(parent) { init(forceLocal); } @@ -95,7 +95,7 @@ void KHighscore::readCurrentConfig() void KHighscore::init(const char *appname) { #ifdef HIGHSCORE_DIRECTORY - const QString filename = QString::fromLocal8Bit("%1/%2.scores") + const TQString filename = TQString::fromLocal8Bit("%1/%2.scores") .arg(HIGHSCORE_DIRECTORY).arg(appname); int fd = open(filename.local8Bit(), O_RDWR); if ( fd<0 ) kdFatal(11002) << "cannot open global highscore file \"" @@ -111,7 +111,7 @@ void KHighscore::init(const char *appname) #endif } -bool KHighscore::lockForWriting(QWidget *widget) +bool KHighscore::lockForWriting(TQWidget *widget) { if ( isLocked() ) return true; @@ -132,7 +132,7 @@ bool KHighscore::lockForWriting(QWidget *widget) if ( !first ) { KGuiItem item = KStdGuiItem::cont(); item.setText(i18n("Retry")); - int res = KMessageBox::warningContinueCancel(widget, i18n("Cannot access the highscore file. Another user is probably currently writing to it."), QString::null, item, "ask_lock_global_highscore_file"); + int res = KMessageBox::warningContinueCancel(widget, i18n("Cannot access the highscore file. Another user is probably currently writing to it."), TQString::null, item, "ask_lock_global_highscore_file"); if ( res==KMessageBox::Cancel ) break; } else sleep(1); first = false; @@ -165,90 +165,90 @@ KConfig* KHighscore::config() const return (d->global ? _config : kapp->config()); } -void KHighscore::writeEntry(int entry, const QString& key, const QVariant& value) +void KHighscore::writeEntry(int entry, const TQString& key, const TQVariant& value) { Q_ASSERT( isLocked() ); KConfigGroupSaver cg(config(), group()); - QString confKey = QString("%1_%2").arg(entry).arg(key); + TQString confKey = TQString("%1_%2").arg(entry).arg(key); cg.config()->writeEntry(confKey, value); } -void KHighscore::writeEntry(int entry, const QString& key, int value) +void KHighscore::writeEntry(int entry, const TQString& key, int value) { Q_ASSERT( isLocked() ); KConfigGroupSaver cg(config(), group()); - QString confKey = QString("%1_%2").arg(entry).arg(key); + TQString confKey = TQString("%1_%2").arg(entry).arg(key); cg.config()->writeEntry(confKey, value); } -void KHighscore::writeEntry(int entry, const QString& key, const QString &value) +void KHighscore::writeEntry(int entry, const TQString& key, const TQString &value) { Q_ASSERT (isLocked() ); KConfigGroupSaver cg(config(), group()); - QString confKey = QString("%1_%2").arg(entry).arg(key); + TQString confKey = TQString("%1_%2").arg(entry).arg(key); cg.config()->writeEntry(confKey, value); } -QVariant KHighscore::readPropertyEntry(int entry, const QString& key, const QVariant& pDefault) const +TQVariant KHighscore::readPropertyEntry(int entry, const TQString& key, const TQVariant& pDefault) const { KConfigGroupSaver cg(config(), group()); - QString confKey = QString("%1_%2").arg(entry).arg(key); + TQString confKey = TQString("%1_%2").arg(entry).arg(key); return cg.config()->readPropertyEntry(confKey, pDefault); } -QString KHighscore::readEntry(int entry, const QString& key, const QString& pDefault) const +TQString KHighscore::readEntry(int entry, const TQString& key, const TQString& pDefault) const { KConfigGroupSaver cg(config(), group()); - QString confKey = QString("%1_%2").arg(entry).arg(key); + TQString confKey = TQString("%1_%2").arg(entry).arg(key); return cg.config()->readEntry(confKey, pDefault); } -int KHighscore::readNumEntry(int entry, const QString& key, int pDefault) const +int KHighscore::readNumEntry(int entry, const TQString& key, int pDefault) const { KConfigGroupSaver cg(config(), group()); - QString confKey = QString("%1_%2").arg(entry).arg(key); + TQString confKey = TQString("%1_%2").arg(entry).arg(key); return cg.config()->readNumEntry(confKey, pDefault); } -bool KHighscore::hasEntry(int entry, const QString& key) const +bool KHighscore::hasEntry(int entry, const TQString& key) const { KConfigGroupSaver cg(config(), group()); - QString confKey = QString("%1_%2").arg(entry).arg(key); + TQString confKey = TQString("%1_%2").arg(entry).arg(key); return cg.config()->hasKey(confKey); } -QStringList KHighscore::readList(const QString& key, int lastEntry) const +TQStringList KHighscore::readList(const TQString& key, int lastEntry) const { - QStringList list; + TQStringList list; for (int i = 1; hasEntry(i, key) && ((lastEntry > 0) ? (i <= lastEntry) : true); i++) { list.append(readEntry(i, key)); } return list; } -void KHighscore::writeList(const QString& key, const QStringList& list) +void KHighscore::writeList(const TQString& key, const TQStringList& list) { for (int unsigned i = 1; i <= list.count(); i++) { writeEntry(i, key, list[i - 1]); } } -void KHighscore::setHighscoreGroup(const QString& group) +void KHighscore::setHighscoreGroup(const TQString& group) { d->group = group; } -const QString& KHighscore::highscoreGroup() const +const TQString& KHighscore::highscoreGroup() const { return d->group; } -QString KHighscore::group() const +TQString KHighscore::group() const { if ( highscoreGroup().isNull() ) - return (d->global ? QString::null : GROUP); + return (d->global ? TQString::null : GROUP); return (d->global ? highscoreGroup() - : QString("%1_%2").arg(GROUP).arg(highscoreGroup())); + : TQString("%1_%2").arg(GROUP).arg(highscoreGroup())); } bool KHighscore::hasTable() const diff --git a/libkdegames/highscore/khighscore.h b/libkdegames/highscore/khighscore.h index b1e3d25f..42c9fcda 100644 --- a/libkdegames/highscore/khighscore.h +++ b/libkdegames/highscore/khighscore.h @@ -23,8 +23,8 @@ #ifndef __KHIGHSCORE_H__ #define __KHIGHSCORE_H__ -#include <qstring.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqobject.h> #include <kdemacros.h> class KConfig; class KFileLock; @@ -67,7 +67,7 @@ class KHighscorePrivate; * single player, so the "best times" of a player. To write highscores for a * specific player in a specific level you will have to use a more complex way: * \code - * QString group = QString("%1_%2").arg(player).arg(level); + * TQString group = TQString("%1_%2").arg(player).arg(level); * table->setGroup(group); * writeHighscore(table, player, level); * \endcode @@ -76,7 +76,7 @@ class KHighscorePrivate; * don't use i18n() for the keys or groups! Here is the code to read the above * written entry: * \code - * QString firstName = highscore->readEntry(0, "name"); + * TQString firstName = highscore->readEntry(0, "name"); * \endcode * Easy, what? * @author Andreas Beckermann <b_mann@gmx.de> @@ -89,7 +89,7 @@ public: * Constructor. The highscore file is forced to be local to support * games using the old behaviour. */ - KHighscore(QObject* parent = 0); + KHighscore(TQObject* parent = 0); /** * Constructor. @@ -100,7 +100,7 @@ public: * @param parent parent widget for this widget * @since 3.2 */ - KHighscore(bool forceLocal, QObject *parent); + KHighscore(bool forceLocal, TQObject *parent); /** * Read the current state of the highscore file. Remember that when @@ -137,7 +137,7 @@ public: * @return false on error or if the config file is locked by another * process. In such case, the config stays read-only. */ - bool lockForWriting(QWidget *widget = 0); + bool lockForWriting(TQWidget *widget = 0); /** * Effectively write and unlock the system-wide highscore file @@ -167,20 +167,20 @@ public: * are prefixed with the entry number * @param value The value of this entry **/ - void writeEntry(int entry, const QString& key, const QString& value); + void writeEntry(int entry, const TQString& key, const TQString& value); /** * This is an overloaded member function, provided for convenience. * It differs from the above function only in what argument(s) it accepts. **/ - void writeEntry(int entry, const QString& key, int value); + void writeEntry(int entry, const TQString& key, int value); /** * This is an overloaded member function, provided for convenience. * It differs from the above function only in what argument(s) it accepts. - * See KConfigBase documentation for allowed QVariant::Type. + * See KConfigBase documentation for allowed TQVariant::Type. **/ - void writeEntry(int entry, const QString& key, const QVariant &value); + void writeEntry(int entry, const TQString& key, const TQVariant &value); /** * Reads an entry from the highscore table. @@ -193,7 +193,7 @@ public: * @return The value of this entry+key pair or pDefault if the entry+key * pair doesn't exist **/ - QString readEntry(int entry, const QString& key, const QString& pDefault = QString::null) const; + TQString readEntry(int entry, const TQString& key, const TQString& pDefault = TQString::null) const; /** * Read a numeric value. @@ -206,22 +206,22 @@ public: * @return The value of this entry+key pair or pDefault if the entry+key * pair doesn't exist **/ - int readNumEntry(int entry, const QString& key, int pDefault = -1) const; + int readNumEntry(int entry, const TQString& key, int pDefault = -1) const; /** - * Read a QVariant entry. - * See KConfigBase documentation for allowed QVariant::Type. + * Read a TQVariant entry. + * See KConfigBase documentation for allowed TQVariant::Type. * * @return the value of this entry+key pair or pDefault if the entry+key * pair doesn't exist or */ - QVariant readPropertyEntry(int entry, const QString &key, const QVariant &pDefault) const; + TQVariant readPropertyEntry(int entry, const TQString &key, const TQVariant &pDefault) const; /** * @return True if the highscore table conatins the entry/key pair, * otherwise false **/ - bool hasEntry(int entry, const QString& key) const; + bool hasEntry(int entry, const TQString& key) const; /** * Reads a list of entries from the highscore table starting at 1 until @@ -240,7 +240,7 @@ public: * 20 entries. If lastEntry is <= 0 then rading is only stopped when when an * entry does not exist. **/ - QStringList readList(const QString& key, int lastEntry = 20) const; + TQStringList readList(const TQString& key, int lastEntry = 20) const; /** * Writes a list of entries to the highscore table. @@ -253,7 +253,7 @@ public: * are prefixed with the entry number * @param list The list of values **/ - void writeList(const QString& key, const QStringList& list); + void writeList(const TQString& key, const TQStringList& list); /** * @return Whether a highscore table exists. You can use this @@ -273,24 +273,24 @@ public: * Set the new highscore group. The group is being prefixed with * "KHighscore_" in the table. * @param groupname The new groupname. E.g. use "easy" for the easy - * level of your game. If you use QString::null (the default) the + * level of your game. If you use TQString::null (the default) the * default group is used. **/ - void setHighscoreGroup(const QString& groupname = QString::null); + void setHighscoreGroup(const TQString& groupname = TQString::null); /** * @return The currently used group. This doesn't contain the prefix * ("KHighscore_") but the same as setHighscoreGroup uses. The - * default is QString::null + * default is TQString::null **/ - const QString& highscoreGroup() const; + const TQString& highscoreGroup() const; protected: /** * @return A groupname to be used in KConfig. Used internally to * prefix the value from highscoreGroup() with "KHighscore_" **/ - QString group() const; + TQString group() const; /** * @return A pointer to the KConfig object to be used. This is diff --git a/libkdegames/highscore/kscoredialog.cpp b/libkdegames/highscore/kscoredialog.cpp index 37155650..7bed0c6b 100644 --- a/libkdegames/highscore/kscoredialog.cpp +++ b/libkdegames/highscore/kscoredialog.cpp @@ -24,13 +24,13 @@ this software. #include "config.h" -#include <qlabel.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qwidgetstack.h> -#include <qtimer.h> -#include <qevent.h> -#include <qptrvector.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqwidgetstack.h> +#include <tqtimer.h> +#include <tqevent.h> +#include <tqptrvector.h> #include <kapplication.h> #include <kconfig.h> @@ -42,29 +42,29 @@ this software. class KScoreDialog::KScoreDialogPrivate { public: - QPtrList<FieldInfo> scores; - QWidget *page; - QGridLayout *layout; - QLineEdit *edit; - QPtrVector<QWidgetStack> stack; - QPtrVector<QLabel> labels; - QLabel *commentLabel; - QString comment; + TQPtrList<FieldInfo> scores; + TQWidget *page; + TQGridLayout *layout; + TQLineEdit *edit; + TQPtrVector<TQWidgetStack> stack; + TQPtrVector<TQLabel> labels; + TQLabel *commentLabel; + TQString comment; int fields; int newName; int latest; int nrCols; bool loaded; - QString configGroup; + TQString configGroup; - QMap<int, int> col; - QMap<int, QString> header; - QMap<int, QString> key; - QString player; + TQMap<int, int> col; + TQMap<int, TQString> header; + TQMap<int, TQString> key; + TQString player; }; -KScoreDialog::KScoreDialog(int fields, QWidget *parent, const char *oname) +KScoreDialog::KScoreDialog(int fields, TQWidget *parent, const char *oname) : KDialogBase(parent, oname, true, i18n("High Scores"), Ok, Ok, true) { d = new KScoreDialogPrivate(); @@ -90,7 +90,7 @@ KScoreDialog::KScoreDialog(int fields, QWidget *parent, const char *oname) d->key[Score] = "Score"; d->page = makeMainWidget(); - connect(this, SIGNAL(okClicked()), SLOT(slotGotName())); + connect(this, TQT_SIGNAL(okClicked()), TQT_SLOT(slotGotName())); } KScoreDialog::~KScoreDialog() @@ -98,18 +98,18 @@ KScoreDialog::~KScoreDialog() delete d; } -void KScoreDialog::setConfigGroup(const QString &group) +void KScoreDialog::setConfigGroup(const TQString &group) { d->configGroup = group; d->loaded = false; } -void KScoreDialog::setComment(const QString &comment) +void KScoreDialog::setComment(const TQString &comment) { d->comment = comment; } -void KScoreDialog::addField(int field, const QString &header, const QString &key) +void KScoreDialog::addField(int field, const TQString &header, const TQString &key) { d->fields |= field; d->header[field] = header; @@ -126,19 +126,19 @@ void KScoreDialog::setupDialog() d->col[field] = d->nrCols++; } - d->layout = new QGridLayout(d->page, 15, d->nrCols, marginHint() + 20, spacingHint()); + d->layout = new TQGridLayout(d->page, 15, d->nrCols, marginHint() + 20, spacingHint()); d->layout->addRowSpacing(4, 15); - d->commentLabel = new QLabel(d->page); + d->commentLabel = new TQLabel(d->page); d->commentLabel->setAlignment(AlignVCenter | AlignHCenter); d->layout->addMultiCellWidget(d->commentLabel, 1, 1, 0, d->nrCols-1); - QFont bold = font(); + TQFont bold = font(); bold.setBold(true); - QLabel *label; + TQLabel *label; d->layout->addColSpacing(0, 50); - label = new QLabel(i18n("Rank"), d->page); + label = new TQLabel(i18n("Rank"), d->page); d->layout->addWidget(label, 3, 0); label->setFont(bold); @@ -148,7 +148,7 @@ void KScoreDialog::setupDialog() { d->layout->addColSpacing(d->col[field], 50); - label = new QLabel(d->header[field], d->page); + label = new TQLabel(d->header[field], d->page); d->layout->addWidget(label, 3, d->col[field], field <= Name ? AlignLeft : AlignRight); label->setFont(bold); } @@ -160,19 +160,19 @@ void KScoreDialog::setupDialog() d->labels.resize(d->nrCols * 10); d->stack.resize(10); - QString num; + TQString num; for (int i = 1; i <= 10; ++i) { - QLabel *label; + TQLabel *label; num.setNum(i); - label = new QLabel(i18n("#%1").arg(num), d->page); + label = new TQLabel(i18n("#%1").arg(num), d->page); d->labels.insert((i-1)*d->nrCols + 0, label); d->layout->addWidget(label, i+4, 0); if (d->fields & Name) { - QWidgetStack *stack = new QWidgetStack(d->page); + TQWidgetStack *stack = new TQWidgetStack(d->page); d->stack.insert(i-1, stack); d->layout->addWidget(stack, i+4, d->col[Name]); - label = new QLabel(d->page); + label = new TQLabel(d->page); d->labels.insert((i-1)*d->nrCols + d->col[Name], label); stack->addWidget(label); stack->raiseWidget(label); @@ -181,7 +181,7 @@ void KScoreDialog::setupDialog() { if (d->fields & field) { - label = new QLabel(d->page); + label = new TQLabel(d->page); d->labels.insert((i-1)*d->nrCols + d->col[field], label); d->layout->addWidget(label, i+4, d->col[field], AlignRight); } @@ -200,7 +200,7 @@ void KScoreDialog::aboutToShow() d->commentLabel->setText(d->comment); if (d->comment.isEmpty()) { - d->commentLabel->setMinimumSize(QSize(1,1)); + d->commentLabel->setMinimumSize(TQSize(1,1)); d->commentLabel->hide(); d->layout->addRowSpacing(0, -15); d->layout->addRowSpacing(2, -15); @@ -212,15 +212,15 @@ void KScoreDialog::aboutToShow() d->layout->addRowSpacing(0, -10); d->layout->addRowSpacing(2, 10); } - d->comment = QString::null; + d->comment = TQString::null; - QFont normal = font(); - QFont bold = normal; + TQFont normal = font(); + TQFont bold = normal; bold.setBold(true); - QString num; + TQString num; for (int i = 1; i <= 10; ++i) { - QLabel *label; + TQLabel *label; num.setNum(i); FieldInfo *score = d->scores.at(i-1); label = d->labels[(i-1)*d->nrCols + 0]; @@ -233,14 +233,14 @@ void KScoreDialog::aboutToShow() { if (d->newName == i) { - QWidgetStack *stack = d->stack[i-1]; - d->edit = new QLineEdit(d->player, stack); + TQWidgetStack *stack = d->stack[i-1]; + d->edit = new TQLineEdit(d->player, stack); d->edit->setMinimumWidth(40); stack->addWidget(d->edit); stack->raiseWidget(d->edit); d->edit->setFocus(); - connect(d->edit, SIGNAL(returnPressed()), - this, SLOT(slotGotReturn())); + connect(d->edit, TQT_SIGNAL(returnPressed()), + this, TQT_SLOT(slotGotReturn())); } else { @@ -272,14 +272,14 @@ void KScoreDialog::aboutToShow() void KScoreDialog::loadScores() { - QString key, value; + TQString key, value; d->loaded = true; d->scores.clear(); KConfigGroup config(kapp->config(), d->configGroup.utf8()); d->player = config.readEntry("LastPlayer"); - QString num; + TQString num; for (int i = 1; i <= 10; ++i) { num.setNum(i); FieldInfo *score = new FieldInfo(); @@ -297,12 +297,12 @@ void KScoreDialog::loadScores() void KScoreDialog::saveScores() { - QString key, value; + TQString key, value; KConfigGroup config(kapp->config(), d->configGroup.utf8()); config.writeEntry("LastPlayer", d->player); - QString num; + TQString num; for (int i = 1; i <= 10; ++i) { num.setNum(i); FieldInfo *score = d->scores.at(i-1); @@ -365,7 +365,7 @@ void KScoreDialog::show() void KScoreDialog::slotGotReturn() { - QTimer::singleShot(0, this, SLOT(slotGotName())); + TQTimer::singleShot(0, this, TQT_SLOT(slotGotName())); } void KScoreDialog::slotGotName() @@ -377,10 +377,10 @@ void KScoreDialog::slotGotName() (*d->scores.at(d->newName-1))[Name] = d->player; saveScores(); - QFont bold = font(); + TQFont bold = font(); bold.setBold(true); - QLabel *label = d->labels[(d->newName-1)*d->nrCols + d->col[Name]]; + TQLabel *label = d->labels[(d->newName-1)*d->nrCols + d->col[Name]]; label->setFont(bold); label->setText(d->player); d->stack[(d->newName-1)]->raiseWidget(label); @@ -397,7 +397,7 @@ int KScoreDialog::highScore() return (*d->scores.first())[Score].toInt(); } -void KScoreDialog::keyPressEvent( QKeyEvent *ev) +void KScoreDialog::keyPressEvent( TQKeyEvent *ev) { if ((d->newName != -1) && (ev->key() == Key_Return)) { diff --git a/libkdegames/highscore/kscoredialog.h b/libkdegames/highscore/kscoredialog.h index 4d4a76db..50424caa 100644 --- a/libkdegames/highscore/kscoredialog.h +++ b/libkdegames/highscore/kscoredialog.h @@ -25,8 +25,8 @@ this software. #ifndef KSCOREDIALOG_H #define KSCOREDIALOG_H -#include <qmap.h> -#include <qptrlist.h> +#include <tqmap.h> +#include <tqptrlist.h> #include <kdialogbase.h> #include <kdemacros.h> @@ -52,14 +52,14 @@ public: Time = 1 << 28, Score = 1 << 29 }; - typedef QMap<int, QString> FieldInfo; + typedef TQMap<int, TQString> FieldInfo; /** * @param fields Which fields should be listed. - * @param parent passed to parent QWidget constructor - * @param name passed to parent QWidget constructor + * @param parent passed to parent TQWidget constructor + * @param name passed to parent TQWidget constructor */ - KScoreDialog(int fields, QWidget *parent=0, const char *name=0); + KScoreDialog(int fields, TQWidget *parent=0, const char *name=0); ~KScoreDialog(); @@ -67,13 +67,13 @@ public: * @param group to use for reading/writing highscores from/to. By default * the class will use "High Score" */ - void setConfigGroup(const QString &group); + void setConfigGroup(const TQString &group); /** * @param comment to add when showing high-scores. * The comment is only used once. */ - void setComment(const QString &comment); + void setComment(const TQString &comment); /** * Define an extra FieldInfo entry. @@ -81,7 +81,7 @@ public: * @param header Header shown in the dialog for this field * @param key used to store this field with. */ - void addField(int field, const QString &header, const QString &key); + void addField(int field, const TQString &header, const TQString &key); /** * Adds a new score to the list. @@ -115,7 +115,7 @@ private: void aboutToShow(); void setupDialog(); - void keyPressEvent( QKeyEvent *ev); + void keyPressEvent( TQKeyEvent *ev); private: class KScoreDialogPrivate; diff --git a/libkdegames/kcanvasrootpixmap.cpp b/libkdegames/kcanvasrootpixmap.cpp index 14592c66..5e036740 100644 --- a/libkdegames/kcanvasrootpixmap.cpp +++ b/libkdegames/kcanvasrootpixmap.cpp @@ -19,18 +19,18 @@ #include "kcanvasrootpixmap.h" -#include <qcanvas.h> +#include <tqcanvas.h> -KCanvasRootPixmap::KCanvasRootPixmap(QCanvasView *view, const char *name) +KCanvasRootPixmap::KCanvasRootPixmap(TQCanvasView *view, const char *name) : KRootPixmap(view, name), _view(view) { setCustomPainting(true); - connect(this, SIGNAL(backgroundUpdated(const QPixmap &)), - SLOT(backgroundUpdatedSlot(const QPixmap &))); + connect(this, TQT_SIGNAL(backgroundUpdated(const TQPixmap &)), + TQT_SLOT(backgroundUpdatedSlot(const TQPixmap &))); } -void KCanvasRootPixmap::backgroundUpdatedSlot(const QPixmap &pixmap) +void KCanvasRootPixmap::backgroundUpdatedSlot(const TQPixmap &pixmap) { if ( _view && _view->canvas() ) _view->canvas()->setBackgroundPixmap(pixmap); diff --git a/libkdegames/kcanvasrootpixmap.h b/libkdegames/kcanvasrootpixmap.h index 3eedb7e1..2da77746 100644 --- a/libkdegames/kcanvasrootpixmap.h +++ b/libkdegames/kcanvasrootpixmap.h @@ -26,13 +26,13 @@ class QCanvasView; /** - * Implement KRootPixmap for a QCanvasView. + * Implement KRootPixmap for a TQCanvasView. * * The pixmap will be set as the background of the - * QCanvas associated with the view : + * TQCanvas associated with the view : * <ul> * <li>for correct positioning of the background pixmap, the given - * QCanvasView should be positioned at the origin of the canvas.</li> + * TQCanvasView should be positioned at the origin of the canvas.</li> * <li>no other view of the same canvas should use KCanvasRootPixmap.</li> * <li>other views of the canvas will have the same background pixmap.</li> * </ul> @@ -45,13 +45,13 @@ class KDE_EXPORT KCanvasRootPixmap : public KRootPixmap /** * Constructor. */ - KCanvasRootPixmap(QCanvasView *view, const char *name = 0); + KCanvasRootPixmap(TQCanvasView *view, const char *name = 0); private slots: - void backgroundUpdatedSlot(const QPixmap &); + void backgroundUpdatedSlot(const TQPixmap &); private: - QCanvasView *_view; + TQCanvasView *_view; class KCanvasRootPixmapPrivate; KCanvasRootPixmapPrivate *d; diff --git a/libkdegames/kcarddialog.cpp b/libkdegames/kcarddialog.cpp index a4d2ac20..73011c9a 100644 --- a/libkdegames/kcarddialog.cpp +++ b/libkdegames/kcarddialog.cpp @@ -23,13 +23,13 @@ #include <stdio.h> #include <assert.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qlayout.h> -#include <qtooltip.h> -#include <qslider.h> -#include <qwmatrix.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqtooltip.h> +#include <tqslider.h> +#include <tqwmatrix.h> #include <kapplication.h> #include <klocale.h> @@ -38,12 +38,12 @@ #include <ksimpleconfig.h> #include "kcarddialog.h" -#include <qpushbutton.h> +#include <tqpushbutton.h> #include <kdebug.h> -#define KCARD_DEFAULTDECK QString::fromLatin1("deck0.png") -#define KCARD_DEFAULTCARD QString::fromLatin1("11.png") -#define KCARD_DEFAULTCARDDIR QString::fromLatin1("cards-default/") +#define KCARD_DEFAULTDECK TQString::fromLatin1("deck0.png") +#define KCARD_DEFAULTCARD TQString::fromLatin1("11.png") +#define KCARD_DEFAULTCARDDIR TQString::fromLatin1("cards-default/") // values for the resize slider #define SLIDER_MIN 400 @@ -51,19 +51,19 @@ // KConfig entries #define CONF_GROUP "KCardDialog" -#define CONF_RANDOMDECK QString::fromLatin1("RandomDeck") -#define CONF_DECK QString::fromLatin1("Deck") -#define CONF_CARDDIR QString::fromLatin1("CardDir") -#define CONF_RANDOMCARDDIR QString::fromLatin1("RandomCardDir") -#define CONF_USEGLOBALDECK QString::fromLatin1("GlobalDeck") -#define CONF_USEGLOBALCARDDIR QString::fromLatin1("GlobalCardDir") -#define CONF_SCALE QString::fromLatin1("Scale") +#define CONF_RANDOMDECK TQString::fromLatin1("RandomDeck") +#define CONF_DECK TQString::fromLatin1("Deck") +#define CONF_CARDDIR TQString::fromLatin1("CardDir") +#define CONF_RANDOMCARDDIR TQString::fromLatin1("RandomCardDir") +#define CONF_USEGLOBALDECK TQString::fromLatin1("GlobalDeck") +#define CONF_USEGLOBALCARDDIR TQString::fromLatin1("GlobalCardDir") +#define CONF_SCALE TQString::fromLatin1("Scale") -#define CONF_GLOBAL_GROUP QString::fromLatin1("KCardDialog Settings") -#define CONF_GLOBAL_DECK QString::fromLatin1("GlobalDeck") -#define CONF_GLOBAL_CARDDIR QString::fromLatin1("GlobalCardDir") -#define CONF_GLOBAL_RANDOMDECK QString::fromLatin1("GlobalRandomDeck") -#define CONF_GLOBAL_RANDOMCARDDIR QString::fromLatin1("GlobalRandomCardDir") +#define CONF_GLOBAL_GROUP TQString::fromLatin1("KCardDialog Settings") +#define CONF_GLOBAL_DECK TQString::fromLatin1("GlobalDeck") +#define CONF_GLOBAL_CARDDIR TQString::fromLatin1("GlobalCardDir") +#define CONF_GLOBAL_RANDOMDECK TQString::fromLatin1("GlobalRandomDeck") +#define CONF_GLOBAL_RANDOMCARDDIR TQString::fromLatin1("GlobalRandomCardDir") class KCardDialogPrivate @@ -85,31 +85,31 @@ public: cScale = 1; } - QLabel* deckLabel; - QLabel* cardLabel; + TQLabel* deckLabel; + TQLabel* cardLabel; KIconView* deckIconView; KIconView* cardIconView; - QCheckBox* randomDeck; - QCheckBox* randomCardDir; - QCheckBox* globalDeck; - QCheckBox* globalCardDir; + TQCheckBox* randomDeck; + TQCheckBox* randomCardDir; + TQCheckBox* globalDeck; + TQCheckBox* globalCardDir; - QSlider* scaleSlider; - QPixmap cPreviewPix; - QLabel* cPreview; + TQSlider* scaleSlider; + TQPixmap cPreviewPix; + TQLabel* cPreview; - QMap<QIconViewItem*, QString> deckMap; - QMap<QIconViewItem*, QString> cardMap; - QMap<QString, QString> helpMap; + TQMap<TQIconViewItem*, TQString> deckMap; + TQMap<TQIconViewItem*, TQString> cardMap; + TQMap<TQString, TQString> helpMap; //set query variables KCardDialog::CardFlags cFlags; - QString cDeck; - QString cCardDir; + TQString cDeck; + TQString cCardDir; double cScale; }; -int KCardDialog::getCardDeck(QString &pDeck, QString &pCardDir, QWidget *pParent, +int KCardDialog::getCardDeck(TQString &pDeck, TQString &pCardDir, TQWidget *pParent, CardFlags pFlags, bool* pRandomDeck, bool* pRandomCardDir, double* pScale, KConfig* pConf) { @@ -123,14 +123,14 @@ int KCardDialog::getCardDeck(QString &pDeck, QString &pCardDir, QWidget *pParent dlg.showRandomDeckBox(pRandomDeck != 0); dlg.showRandomCardDirBox(pRandomCardDir != 0); int result=dlg.exec(); - if (result==QDialog::Accepted) + if (result==TQDialog::Accepted) { // TODO check for global cards/decks!!!! pDeck=dlg.deck(); pCardDir=dlg.cardDir(); - if (!pCardDir.isNull() && pCardDir.right(1)!=QString::fromLatin1("/")) + if (!pCardDir.isNull() && pCardDir.right(1)!=TQString::fromLatin1("/")) { - pCardDir+=QString::fromLatin1("/"); + pCardDir+=TQString::fromLatin1("/"); } if (pRandomDeck) { @@ -176,13 +176,13 @@ int KCardDialog::getCardDeck(QString &pDeck, QString &pCardDir, QWidget *pParent return result; } -void KCardDialog::getConfigCardDeck(KConfig* conf, QString &pDeck, QString &pCardDir, double& pScale) +void KCardDialog::getConfigCardDeck(KConfig* conf, TQString &pDeck, TQString &pCardDir, double& pScale) { // TODO check for global cards/decks!!!! if (!conf) { return; } - QString origGroup = conf->group(); + TQString origGroup = conf->group(); conf->setGroup(CONF_GROUP); if (conf->readBoolEntry(CONF_RANDOMDECK) || !conf->hasKey(CONF_DECK)) { @@ -215,39 +215,39 @@ void KCardDialog::getConfigCardDeck(KConfig* conf, QString &pDeck, QString &pCar conf->setGroup(origGroup); } -QString KCardDialog::getDefaultDeck() +TQString KCardDialog::getDefaultDeck() { KCardDialog::init(); - return locate("cards", QString::fromLatin1("decks/") + KCARD_DEFAULTDECK); + return locate("cards", TQString::fromLatin1("decks/") + KCARD_DEFAULTDECK); } -QString KCardDialog::getDefaultCardDir() +TQString KCardDialog::getDefaultCardDir() { KCardDialog::init(); - QString file = KCARD_DEFAULTCARDDIR + KCARD_DEFAULTCARD; + TQString file = KCARD_DEFAULTCARDDIR + KCARD_DEFAULTCARD; return KGlobal::dirs()->findResourceDir("cards",file) + KCARD_DEFAULTCARDDIR; } -QString KCardDialog::getCardPath(const QString &carddir, int index) +TQString KCardDialog::getCardPath(const TQString &carddir, int index) { KCardDialog::init(); - QString entry = carddir + QString::number(index); - if (KStandardDirs::exists(entry + QString::fromLatin1(".png"))) - return entry + QString::fromLatin1(".png"); + TQString entry = carddir + TQString::number(index); + if (KStandardDirs::exists(entry + TQString::fromLatin1(".png"))) + return entry + TQString::fromLatin1(".png"); // rather theoretical - if (KStandardDirs::exists(entry + QString::fromLatin1(".xpm"))) - return entry + QString::fromLatin1(".xpm"); + if (KStandardDirs::exists(entry + TQString::fromLatin1(".xpm"))) + return entry + TQString::fromLatin1(".xpm"); - return QString::null; + return TQString::null; } -const QString& KCardDialog::deck() const { return d->cDeck; } -void KCardDialog::setDeck(const QString& file) { d->cDeck=file; } -const QString& KCardDialog::cardDir() const { return d->cCardDir; } -void KCardDialog::setCardDir(const QString& dir) { d->cCardDir=dir; } +const TQString& KCardDialog::deck() const { return d->cDeck; } +void KCardDialog::setDeck(const TQString& file) { d->cDeck=file; } +const TQString& KCardDialog::cardDir() const { return d->cCardDir; } +void KCardDialog::setCardDir(const TQString& dir) { d->cCardDir=dir; } KCardDialog::CardFlags KCardDialog::flags() const { return d->cFlags; } double KCardDialog::cardScale() const { return d->cScale; } bool KCardDialog::isRandomDeck() const @@ -261,20 +261,20 @@ bool KCardDialog::isGlobalCardDir() const void KCardDialog::setupDialog(bool showResizeBox) { - QHBoxLayout* topLayout = new QHBoxLayout(plainPage(), spacingHint()); - QVBoxLayout* cardLayout = new QVBoxLayout(topLayout); - QString path, file; - QWMatrix m; + TQHBoxLayout* topLayout = new TQHBoxLayout(plainPage(), spacingHint()); + TQVBoxLayout* cardLayout = new TQVBoxLayout(topLayout); + TQString path, file; + TQWMatrix m; m.scale(0.8,0.8); - setInitialSize(QSize(600,400)); + setInitialSize(TQSize(600,400)); if (! (flags() & NoDeck)) { - QHBoxLayout* layout = new QHBoxLayout(cardLayout); + TQHBoxLayout* layout = new TQHBoxLayout(cardLayout); // Deck iconview - QGroupBox* grp1 = new QGroupBox(1, Horizontal, i18n("Choose Backside"), plainPage()); + TQGroupBox* grp1 = new TQGroupBox(1, Horizontal, i18n("Choose Backside"), plainPage()); layout->addWidget(grp1); d->deckIconView = new KIconView(grp1,"decks"); @@ -285,48 +285,48 @@ void KCardDialog::setupDialog(bool showResizeBox) */ d->deckIconView->setGridX(82); d->deckIconView->setGridY(106); - d->deckIconView->setSelectionMode(QIconView::Single); - d->deckIconView->setResizeMode(QIconView::Adjust); + d->deckIconView->setSelectionMode(TQIconView::Single); + d->deckIconView->setResizeMode(TQIconView::Adjust); d->deckIconView->setMinimumWidth(360); d->deckIconView->setMinimumHeight(170); d->deckIconView->setWordWrapIconText(false); d->deckIconView->showToolTips(); // deck select - QVBoxLayout* l = new QVBoxLayout(layout); - QGroupBox* grp3 = new QGroupBox(i18n("Backside"), plainPage()); + TQVBoxLayout* l = new TQVBoxLayout(layout); + TQGroupBox* grp3 = new TQGroupBox(i18n("Backside"), plainPage()); grp3->setFixedSize(100, 130); l->addWidget(grp3, 0, AlignTop|AlignHCenter); - d->deckLabel = new QLabel(grp3); + d->deckLabel = new TQLabel(grp3); d->deckLabel->setText(i18n("empty")); d->deckLabel->setAlignment(AlignHCenter|AlignVCenter); d->deckLabel->setGeometry(10, 20, 80, 90); - d->randomDeck = new QCheckBox(plainPage()); + d->randomDeck = new TQCheckBox(plainPage()); d->randomDeck->setChecked(false); - connect(d->randomDeck, SIGNAL(toggled(bool)), this, - SLOT(slotRandomDeckToggled(bool))); + connect(d->randomDeck, TQT_SIGNAL(toggled(bool)), this, + TQT_SLOT(slotRandomDeckToggled(bool))); d->randomDeck->setText(i18n("Random backside")); l->addWidget(d->randomDeck, 0, AlignTop|AlignHCenter); - d->globalDeck = new QCheckBox(plainPage()); + d->globalDeck = new TQCheckBox(plainPage()); d->globalDeck->setChecked(false); d->globalDeck->setText(i18n("Use global backside")); l->addWidget(d->globalDeck, 0, AlignTop|AlignHCenter); - QPushButton* b = new QPushButton(i18n("Make Backside Global"), plainPage()); - connect(b, SIGNAL(pressed()), this, SLOT(slotSetGlobalDeck())); + TQPushButton* b = new TQPushButton(i18n("Make Backside Global"), plainPage()); + connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotSetGlobalDeck())); l->addWidget(b, 0, AlignTop|AlignHCenter); - connect(d->deckIconView,SIGNAL(clicked(QIconViewItem *)), - this,SLOT(slotDeckClicked(QIconViewItem *))); + connect(d->deckIconView,TQT_SIGNAL(clicked(TQIconViewItem *)), + this,TQT_SLOT(slotDeckClicked(TQIconViewItem *))); } if (! (flags() & NoCards)) { // Cards iconview - QHBoxLayout* layout = new QHBoxLayout(cardLayout); - QGroupBox* grp2 = new QGroupBox(1, Horizontal, i18n("Choose Frontside"), plainPage()); + TQHBoxLayout* layout = new TQHBoxLayout(cardLayout); + TQGroupBox* grp2 = new TQGroupBox(1, Horizontal, i18n("Choose Frontside"), plainPage()); layout->addWidget(grp2); d->cardIconView =new KIconView(grp2,"cards"); @@ -336,40 +336,40 @@ void KCardDialog::setupDialog(bool showResizeBox) */ d->cardIconView->setGridX(82); d->cardIconView->setGridY(106); - d->cardIconView->setResizeMode(QIconView::Adjust); + d->cardIconView->setResizeMode(TQIconView::Adjust); d->cardIconView->setMinimumWidth(360); d->cardIconView->setMinimumHeight(170); d->cardIconView->setWordWrapIconText(false); d->cardIconView->showToolTips(); // Card select - QVBoxLayout* l = new QVBoxLayout(layout); - QGroupBox* grp4 = new QGroupBox(i18n("Frontside"), plainPage()); + TQVBoxLayout* l = new TQVBoxLayout(layout); + TQGroupBox* grp4 = new TQGroupBox(i18n("Frontside"), plainPage()); grp4->setFixedSize(100, 130); l->addWidget(grp4, 0, AlignTop|AlignHCenter); - d->cardLabel = new QLabel(grp4); + d->cardLabel = new TQLabel(grp4); d->cardLabel->setText(i18n("empty")); d->cardLabel->setAlignment(AlignHCenter|AlignVCenter); d->cardLabel->setGeometry(10, 20, 80, 90 ); - d->randomCardDir = new QCheckBox(plainPage()); + d->randomCardDir = new TQCheckBox(plainPage()); d->randomCardDir->setChecked(false); - connect(d->randomCardDir, SIGNAL(toggled(bool)), this, - SLOT(slotRandomCardDirToggled(bool))); + connect(d->randomCardDir, TQT_SIGNAL(toggled(bool)), this, + TQT_SLOT(slotRandomCardDirToggled(bool))); d->randomCardDir->setText(i18n("Random frontside")); l->addWidget(d->randomCardDir, 0, AlignTop|AlignHCenter); - d->globalCardDir = new QCheckBox(plainPage()); + d->globalCardDir = new TQCheckBox(plainPage()); d->globalCardDir->setChecked(false); d->globalCardDir->setText(i18n("Use global frontside")); l->addWidget(d->globalCardDir, 0, AlignTop|AlignHCenter); - QPushButton* b = new QPushButton(i18n("Make Frontside Global"), plainPage()); - connect(b, SIGNAL(pressed()), this, SLOT(slotSetGlobalCardDir())); + TQPushButton* b = new TQPushButton(i18n("Make Frontside Global"), plainPage()); + connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotSetGlobalCardDir())); l->addWidget(b, 0, AlignTop|AlignHCenter); - connect(d->cardIconView,SIGNAL(clicked(QIconViewItem *)), - this,SLOT(slotCardClicked(QIconViewItem *))); + connect(d->cardIconView,TQT_SIGNAL(clicked(TQIconViewItem *)), + this,TQT_SLOT(slotCardClicked(TQIconViewItem *))); } // Insert deck icons @@ -383,10 +383,10 @@ void KCardDialog::setupDialog(bool showResizeBox) if (!deck().isNull()) { file=deck(); - QPixmap pixmap(file); + TQPixmap pixmap(file); pixmap=pixmap.xForm(m); d->deckLabel->setPixmap(pixmap); - QToolTip::add(d->deckLabel,d->helpMap[file]); + TQToolTip::add(d->deckLabel,d->helpMap[file]); } } @@ -400,10 +400,10 @@ void KCardDialog::setupDialog(bool showResizeBox) if (!cardDir().isNull()) { file = cardDir() + KCARD_DEFAULTCARD; - QPixmap pixmap(file); + TQPixmap pixmap(file); pixmap = pixmap.xForm(m); d->cardLabel->setPixmap(pixmap); - QToolTip::add(d->cardLabel,d->helpMap[cardDir()]); + TQToolTip::add(d->cardLabel,d->helpMap[cardDir()]); } } @@ -414,36 +414,36 @@ void KCardDialog::setupDialog(bool showResizeBox) // i'm sure there is a cleaner way but i cannot find it. // whenever the pixmap is resized (aka scaled) the box is resized, too. This // leads to an always resizing dialog which is *very* ugly. i worked around - // this by using a QWidget which is the only child widget of the group box. - // The other widget are managed inside this QWidget - a stretch area on the + // this by using a TQWidget which is the only child widget of the group box. + // The other widget are managed inside this TQWidget - a stretch area on the // right ensures that the KIconViews are not resized... // note that the dialog is still resized if you you scale the pixmap very // large. This is desired behaviour as i don't want to make the box even // larger but i want the complete pixmap to be displayed. the dialog is not // resized if you make the pixmap smaller again. - QVBoxLayout* layout = new QVBoxLayout(topLayout); - QGroupBox* grp = new QGroupBox(1, Horizontal, i18n("Resize Cards"), plainPage()); - layout->setResizeMode(QLayout::Fixed); + TQVBoxLayout* layout = new TQVBoxLayout(topLayout); + TQGroupBox* grp = new TQGroupBox(1, Horizontal, i18n("Resize Cards"), plainPage()); + layout->setResizeMode(TQLayout::Fixed); layout->addWidget(grp); - QWidget* box = new QWidget(grp); - QHBoxLayout* hbox = new QHBoxLayout(box, 0, spacingHint()); - QVBoxLayout* boxLayout = new QVBoxLayout(hbox); + TQWidget* box = new TQWidget(grp); + TQHBoxLayout* hbox = new TQHBoxLayout(box, 0, spacingHint()); + TQVBoxLayout* boxLayout = new TQVBoxLayout(hbox); hbox->addStretch(0); - d->scaleSlider = new QSlider(1, SLIDER_MAX, 1, (-1000+SLIDER_MIN+SLIDER_MAX), Horizontal, box); + d->scaleSlider = new TQSlider(1, SLIDER_MAX, 1, (-1000+SLIDER_MIN+SLIDER_MAX), Horizontal, box); d->scaleSlider->setMinValue(SLIDER_MIN); - connect(d->scaleSlider, SIGNAL(valueChanged(int)), this, SLOT(slotCardResized(int))); + connect(d->scaleSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotCardResized(int))); boxLayout->addWidget(d->scaleSlider, 0, AlignLeft); - QPushButton* b = new QPushButton(i18n("Default Size"), box); - connect(b, SIGNAL(pressed()), this, SLOT(slotDefaultSize())); + TQPushButton* b = new TQPushButton(i18n("Default Size"), box); + connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotDefaultSize())); boxLayout->addWidget(b, 0, AlignLeft); - QLabel* l = new QLabel(i18n("Preview:"), box); + TQLabel* l = new TQLabel(i18n("Preview:"), box); boxLayout->addWidget(l); d->cPreviewPix.load(getDefaultDeck()); - d->cPreview = new QLabel(box); + d->cPreview = new TQLabel(box); boxLayout->addWidget(d->cPreview, 0, AlignCenter|AlignVCenter); slotCardResized(d->scaleSlider->value()); @@ -452,29 +452,29 @@ void KCardDialog::setupDialog(bool showResizeBox) void KCardDialog::insertCardIcons() { - QStringList list = KGlobal::dirs()->findAllResources("cards", "card*/index.desktop", false, true); + TQStringList list = KGlobal::dirs()->findAllResources("cards", "card*/index.desktop", false, true); // kdDebug(11000) << "insert " << list.count() << endl; if (list.isEmpty()) return; // We shrink the icons a little // - QWMatrix m; + TQWMatrix m; m.scale(0.8,0.8); - for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) + for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { KSimpleConfig cfg(*it); - cfg.setGroup(QString::fromLatin1("KDE Backdeck")); - QString path = (*it).left((*it).findRev('/') + 1); + cfg.setGroup(TQString::fromLatin1("KDE Backdeck")); + TQString path = (*it).left((*it).findRev('/') + 1); assert(path[path.length() - 1] == '/'); - QPixmap pixmap(path + cfg.readEntry("Preview", "12c.png")); + TQPixmap pixmap(path + cfg.readEntry("Preview", "12c.png")); if (pixmap.isNull()) continue; - QString name=cfg.readEntry("Name", i18n("unnamed")); - QIconViewItem *item= new QIconViewItem(d->cardIconView, name, pixmap); + TQString name=cfg.readEntry("Name", i18n("unnamed")); + TQIconViewItem *item= new TQIconViewItem(d->cardIconView, name, pixmap); item->setDragEnabled(false); item->setDropEnabled(false); @@ -488,28 +488,28 @@ void KCardDialog::insertCardIcons() void KCardDialog::insertDeckIcons() { - QStringList list = KGlobal::dirs()->findAllResources("cards", "decks/*.desktop", false, true); + TQStringList list = KGlobal::dirs()->findAllResources("cards", "decks/*.desktop", false, true); if (list.isEmpty()) return; - QString label; + TQString label; // We shrink the icons a little - QWMatrix m; + TQWMatrix m; m.scale(0.8,0.8); - for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) + for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { KSimpleConfig cfg(*it); - QPixmap pixmap(getDeckName(*it)); + TQPixmap pixmap(getDeckName(*it)); if (pixmap.isNull()) continue; // pixmap=pixmap.xForm(m); - cfg.setGroup(QString::fromLatin1("KDE Cards")); - QString name=cfg.readEntry("Name", i18n("unnamed")); - QIconViewItem *item= new QIconViewItem(d->deckIconView,name, pixmap); + cfg.setGroup(TQString::fromLatin1("KDE Cards")); + TQString name=cfg.readEntry("Name", i18n("unnamed")); + TQIconViewItem *item= new TQIconViewItem(d->deckIconView,name, pixmap); item->setDragEnabled(false); item->setDropEnabled(false); @@ -528,7 +528,7 @@ KCardDialog::~KCardDialog() // Create the dialog -KCardDialog::KCardDialog( QWidget *parent, const char *name, CardFlags mFlags) +KCardDialog::KCardDialog( TQWidget *parent, const char *name, CardFlags mFlags) : KDialogBase( Plain, i18n("Carddeck Selection"), Ok|Cancel, Ok, parent, name, true, true) { KCardDialog::init(); @@ -537,62 +537,62 @@ KCardDialog::KCardDialog( QWidget *parent, const char *name, CardFlags mFlags) d->cFlags = mFlags; } -void KCardDialog::slotDeckClicked(QIconViewItem *item) +void KCardDialog::slotDeckClicked(TQIconViewItem *item) { if (item && item->pixmap()) { d->deckLabel->setPixmap(* (item->pixmap())); - QToolTip::remove( d->deckLabel ); - QToolTip::add(d->deckLabel,d->helpMap[d->deckMap[item]]); + TQToolTip::remove( d->deckLabel ); + TQToolTip::add(d->deckLabel,d->helpMap[d->deckMap[item]]); setDeck(d->deckMap[item]); } } -void KCardDialog::slotCardClicked(QIconViewItem *item) +void KCardDialog::slotCardClicked(TQIconViewItem *item) { if (item && item->pixmap()) { d->cardLabel->setPixmap(* (item->pixmap())); - QString path = d->cardMap[item]; - QToolTip::remove( d->deckLabel ); - QToolTip::add(d->cardLabel,d->helpMap[path]); + TQString path = d->cardMap[item]; + TQToolTip::remove( d->deckLabel ); + TQToolTip::add(d->cardLabel,d->helpMap[path]); setCardDir(path); } } -QString KCardDialog::getDeckName(const QString &desktop) +TQString KCardDialog::getDeckName(const TQString &desktop) { - QString entry = desktop.left(desktop.length() - strlen(".desktop")); - if (KStandardDirs::exists(entry + QString::fromLatin1(".png"))) - return entry + QString::fromLatin1(".png"); + TQString entry = desktop.left(desktop.length() - strlen(".desktop")); + if (KStandardDirs::exists(entry + TQString::fromLatin1(".png"))) + return entry + TQString::fromLatin1(".png"); // rather theoretical - if (KStandardDirs::exists(entry + QString::fromLatin1(".xpm"))) - return entry + QString::fromLatin1(".xpm"); - return QString::null; + if (KStandardDirs::exists(entry + TQString::fromLatin1(".xpm"))) + return entry + TQString::fromLatin1(".xpm"); + return TQString::null; } -QString KCardDialog::getRandomDeck() +TQString KCardDialog::getRandomDeck() { KCardDialog::init(); - QStringList list = KGlobal::dirs()->findAllResources("cards", "decks/*.desktop"); + TQStringList list = KGlobal::dirs()->findAllResources("cards", "decks/*.desktop"); if (list.isEmpty()) - return QString::null; + return TQString::null; int d = KApplication::random() % list.count(); return getDeckName(*list.at(d)); } -QString KCardDialog::getRandomCardDir() +TQString KCardDialog::getRandomCardDir() { KCardDialog::init(); - QStringList list = KGlobal::dirs()->findAllResources("cards", "card*/index.desktop"); + TQStringList list = KGlobal::dirs()->findAllResources("cards", "card*/index.desktop"); if (list.isEmpty()) - return QString::null; + return TQString::null; int d = KApplication::random() % list.count(); - QString entry = *list.at(d); + TQString entry = *list.at(d); return entry.left(entry.length() - strlen("index.desktop")); } @@ -634,8 +634,8 @@ void KCardDialog::slotRandomCardDirToggled(bool on) if (on) { d->cardLabel->setText("random"); setCardDir(getRandomCardDir()); - if (cardDir().length()>0 && cardDir().right(1)!=QString::fromLatin1("/")) { - setCardDir(cardDir() + QString::fromLatin1("/")); + if (cardDir().length()>0 && cardDir().right(1)!=TQString::fromLatin1("/")) { + setCardDir(cardDir() + TQString::fromLatin1("/")); } } else { d->cardLabel->setText("empty"); @@ -649,7 +649,7 @@ void KCardDialog::loadConfig(KConfig* conf) return; } - QString origGroup = conf->group(); + TQString origGroup = conf->group(); conf->setGroup(CONF_GROUP); if (! (flags() & NoDeck)) { @@ -701,10 +701,10 @@ void KCardDialog::slotCardResized(int s) s *= -1; s += (SLIDER_MIN + SLIDER_MAX); - QWMatrix m; + TQWMatrix m; double scale = (double)1000/s; m.scale(scale, scale); - QPixmap pix = d->cPreviewPix.xForm(m); + TQPixmap pix = d->cPreviewPix.xForm(m); d->cPreview->setPixmap(pix); d->cScale = scale; } @@ -722,7 +722,7 @@ void KCardDialog::saveConfig(KConfig* conf) if (!conf) { return; } - QString origGroup = conf->group(); + TQString origGroup = conf->group(); conf->setGroup(CONF_GROUP); if (! (flags() & NoDeck)) { @@ -742,7 +742,7 @@ void KCardDialog::saveConfig(KConfig* conf) void KCardDialog::slotSetGlobalDeck() { - KSimpleConfig* conf = new KSimpleConfig(QString::fromLatin1("kdeglobals"), false); + KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), false); conf->setGroup(CONF_GLOBAL_GROUP); conf->writeEntry(CONF_GLOBAL_DECK, deck()); @@ -753,7 +753,7 @@ void KCardDialog::slotSetGlobalDeck() void KCardDialog::slotSetGlobalCardDir() { - KSimpleConfig* conf = new KSimpleConfig(QString::fromLatin1("kdeglobals"), false); + KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), false); conf->setGroup(CONF_GLOBAL_GROUP); conf->writePathEntry(CONF_GLOBAL_CARDDIR, cardDir()); @@ -762,9 +762,9 @@ void KCardDialog::slotSetGlobalCardDir() delete conf; } -void KCardDialog::getGlobalDeck(QString& deck, bool& random) +void KCardDialog::getGlobalDeck(TQString& deck, bool& random) { - KSimpleConfig* conf = new KSimpleConfig(QString::fromLatin1("kdeglobals"), true); + KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), true); conf->setGroup(CONF_GLOBAL_GROUP); if (!conf->hasKey(CONF_GLOBAL_DECK) || conf->readBoolEntry(CONF_GLOBAL_RANDOMDECK, false)) { @@ -778,9 +778,9 @@ void KCardDialog::getGlobalDeck(QString& deck, bool& random) delete conf; } -void KCardDialog::getGlobalCardDir(QString& dir, bool& random) +void KCardDialog::getGlobalCardDir(TQString& dir, bool& random) { - KSimpleConfig* conf = new KSimpleConfig(QString::fromLatin1("kdeglobals"), true); + KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), true); conf->setGroup(CONF_GLOBAL_GROUP); if (!conf->hasKey(CONF_GLOBAL_CARDDIR) || conf->readBoolEntry(CONF_GLOBAL_RANDOMCARDDIR, false)) { @@ -799,7 +799,7 @@ void KCardDialog::init() static bool _inited = false; if (_inited) return; - KGlobal::dirs()->addResourceType("cards", KStandardDirs::kde_default("data") + QString::fromLatin1("carddecks/")); + KGlobal::dirs()->addResourceType("cards", KStandardDirs::kde_default("data") + TQString::fromLatin1("carddecks/")); KGlobal::locale()->insertCatalogue("libkdegames"); _inited = true; diff --git a/libkdegames/kcarddialog.h b/libkdegames/kcarddialog.h index b32fd636..fae37b97 100644 --- a/libkdegames/kcarddialog.h +++ b/libkdegames/kcarddialog.h @@ -19,9 +19,9 @@ #ifndef __KCARDDIALOG_H_ #define __KCARDDIALOG_H_ -#include <qstring.h> +#include <tqstring.h> #include <kdialogbase.h> -#include <qmap.h> // TODO: remove - it is in kcarddialog.cpp now; left here for source compatibility +#include <tqmap.h> // TODO: remove - it is in kcarddialog.cpp now; left here for source compatibility #include <kdemacros.h> class QIconViewItem; @@ -48,7 +48,7 @@ class KCardDialogPrivate; * Example: * * \code - * QString deck,card; + * TQString deck,card; * int result = KCardDialog::getCardDeck(deck,card ); * if ( result == KCardDialog::Accepted ) * ... @@ -75,10 +75,10 @@ class KCardDialogPrivate; * Another Parameter for KCardDialog::getCardDeck is scale. This pointer * to a double variable contains the scaling factor the user has chosen in the * dialog (the scale box won't be shown if you don't provide this parameter). - * You might want to check out QPixmap::xFrom which gives you access to + * You might want to check out TQPixmap::xFrom which gives you access to * scaling. You can e.g. use * \code - * QWMatrix m; + * TQWMatrix m; * m.scale(s,s); * pixmap.xForm(m); * \endcode @@ -107,7 +107,7 @@ public: * @param name The name of the dialog. * @param flags Specifies whether the dialog is modal or not. */ - KCardDialog (QWidget* parent = NULL,const char* name = NULL, + KCardDialog (TQWidget* parent = NULL,const char* name = NULL, CardFlags flags = Both); /** * Destructs a card deck selection dialog. @@ -151,9 +151,9 @@ public: * parameters randomDeck and randomCardDir overwrite the initial settings from the * config file. * - * @return QDialog::result(). + * @return TQDialog::result(). */ - static int getCardDeck(QString &deck,QString &carddir, QWidget *parent=0, + static int getCardDeck(TQString &deck,TQString &carddir, TQWidget *parent=0, CardFlags flags=Both, bool* randomDeck=0, bool* randomCardDir=0, double* scale=0, KConfig* conf=0); @@ -172,7 +172,7 @@ public: * random cardDir if this is desired according to the config) * @param scale The scaling factor (usually 1) **/ - static void getConfigCardDeck(KConfig* conf, QString& deck, QString& cardDir, double& scale); + static void getConfigCardDeck(KConfig* conf, TQString& deck, TQString& cardDir, double& scale); /** * Returns the default path to the card deck backsides. You want @@ -185,7 +185,7 @@ public: * * @return The default path */ - static QString getDefaultDeck(); + static TQString getDefaultDeck(); /** * Returns the default path to the card frontsides. You want @@ -198,7 +198,7 @@ public: * * @return returns the path to the card directory */ - static QString getDefaultCardDir(); + static TQString getDefaultCardDir(); /** * Returns the path to the card frontside specified in dir carddir @@ -207,19 +207,19 @@ public: * @param carddir The carddir which's path shall be searched for * @return returns the path to the card */ - static QString getCardPath(const QString &carddir, int index); + static TQString getCardPath(const TQString &carddir, int index); /** * Returns a random deck in deckPath() * @return A random deck **/ - static QString getRandomDeck(); + static TQString getRandomDeck(); /** * Returns a random directory of cards * @return A random card dir **/ - static QString getRandomCardDir(); + static TQString getRandomCardDir(); /** * Show or hides the "random backside" checkbox @@ -238,24 +238,24 @@ public: * * @return The deck */ - const QString& deck() const; + const TQString& deck() const; /** * Sets the default deck. * @param file The full path to an image file */ - void setDeck(const QString& file); + void setDeck(const TQString& file); /** * @return The chosen card directory */ - const QString& cardDir() const; + const TQString& cardDir() const; /** * Sets the default card directory. * @param dir The full path to an card directory */ - void setCardDir(const QString& dir); + void setCardDir(const TQString& dir); /** * @return the flags set to the dialog @@ -315,20 +315,20 @@ protected: void insertCardIcons(); void insertDeckIcons(); - static void getGlobalDeck(QString& cardDir, bool& random); - static void getGlobalCardDir(QString& deck, bool& random); + static void getGlobalDeck(TQString& cardDir, bool& random); + static void getGlobalCardDir(TQString& deck, bool& random); - static QString getDeckName(const QString& desktop); + static TQString getDeckName(const TQString& desktop); /** * @return the groupname used by functions like @ref saveConfig and @ref * loadConfig. **/ - static QString group(); + static TQString group(); protected slots: - void slotDeckClicked(QIconViewItem *); - void slotCardClicked(QIconViewItem *); + void slotDeckClicked(TQIconViewItem *); + void slotCardClicked(TQIconViewItem *); void slotRandomCardDirToggled(bool on); void slotRandomDeckToggled(bool on); void slotCardResized(int); diff --git a/libkdegames/kchat.cpp b/libkdegames/kchat.cpp index d4ffd7ec..2a9c3913 100644 --- a/libkdegames/kchat.cpp +++ b/libkdegames/kchat.cpp @@ -31,12 +31,12 @@ public: bool mAutoAddMessages; - QMap<int, QString> mPlayerMap; + TQMap<int, TQString> mPlayerMap; int mPlayerId; int mFromId; }; -KChat::KChat(QWidget* parent, bool twoPlayerGame) : KChatBase(parent, twoPlayerGame) +KChat::KChat(TQWidget* parent, bool twoPlayerGame) : KChatBase(parent, twoPlayerGame) { init(); } @@ -56,9 +56,9 @@ void KChat::init() d->mFromId = 1; } -void KChat::setFromNickname(const QString& n) +void KChat::setFromNickname(const TQString& n) { d->mFromId = addPlayer(n); } -const QString& KChat::fromName() const +const TQString& KChat::fromName() const { return player(fromId()); } void KChat::setAutoAddMessages(bool add) { d->mAutoAddMessages = add; } @@ -68,10 +68,10 @@ int KChat::uniqueId() { return d->mPlayerId++; } int KChat::fromId() const { return d->mFromId; } -const QString& KChat::player(int id) const +const TQString& KChat::player(int id) const { return d->mPlayerMap[id]; } -void KChat::returnPressed(const QString& text) +void KChat::returnPressed(const TQString& text) { int id = fromId(); if (id < 0) { @@ -80,7 +80,7 @@ void KChat::returnPressed(const QString& text) } emit signalSendMessage(id, text); if (autoAddMessages()) { - QString p = player(id); + TQString p = player(id); if (p.isNull()) { p = i18n("Unknown"); } @@ -89,7 +89,7 @@ void KChat::returnPressed(const QString& text) } } -int KChat::addPlayer(const QString& nickname) +int KChat::addPlayer(const TQString& nickname) { int id = uniqueId(); d->mPlayerMap.insert(id, nickname); @@ -101,9 +101,9 @@ void KChat::removePlayer(int id) d->mPlayerMap.remove(id); } -void KChat::removePlayer(const QString& nickname) +void KChat::removePlayer(const TQString& nickname) { - QMap<int, QString>::Iterator it; + TQMap<int, TQString>::Iterator it; for (it = d->mPlayerMap.begin(); it != d->mPlayerMap.end(); ++it) { if (it.data() == nickname) { d->mPlayerMap.remove(it); diff --git a/libkdegames/kchat.h b/libkdegames/kchat.h index db479bc0..5eabb9d3 100644 --- a/libkdegames/kchat.h +++ b/libkdegames/kchat.h @@ -19,7 +19,7 @@ #ifndef __KCHAT_H__ #define __KCHAT_H__ -#include <qstring.h> +#include <tqstring.h> #include "kchatbase.h" #include <kdemacros.h> @@ -43,7 +43,7 @@ public: * choose to send to a single player or to all players will not be added * as you will hardly need it in 2-player games. **/ - KChat(QWidget* parent, bool twoPlayerGame = false); + KChat(TQWidget* parent, bool twoPlayerGame = false); virtual ~KChat(); @@ -52,23 +52,23 @@ public: * @return The name that will be shown for messages from this widget. * That is the string from @ref setFromNickname **/ - virtual const QString& fromName() const; + virtual const TQString& fromName() const; /** * This sets the name that will be shown on all chat widgets if this * widget sends a message. See signalSendMessage * @param name The name of the player owning this widget **/ - void setFromNickname(const QString& name); + void setFromNickname(const TQString& name); // TODO: -// void setPlayerList(QIntDict<QString>);// use this for non-KGame use +// void setPlayerList(TQIntDict<TQString>);// use this for non-KGame use /** * Adds a player nickname. * @return The unique ID of the player **/ - int addPlayer(const QString& nick); + int addPlayer(const TQString& nick); /** * Removes all players with this nickname. Better don't use this as it @@ -76,7 +76,7 @@ public: * call removePlayer(id) * @param nick The nickname of the removed players **/ - void removePlayer(const QString& nick); + void removePlayer(const TQString& nick); /** * Removes the player with this id, as returned by @ref addPlayer @@ -105,7 +105,7 @@ public: /** * @return The nickname of the player which belongs to this id **/ - const QString& player(int id) const; + const TQString& player(int id) const; /** * @return The ID that belongs to the local player. @@ -124,14 +124,14 @@ signals: * setFromNickname and player * @param msg The message itself **/ - void signalSendMessage(int id, const QString& msg); + void signalSendMessage(int id, const TQString& msg); protected: /** * This emits @ref signalSendMessage and, if @ref autoAddMessages is * true, calls @ref KChatBase::addMessage **/ - virtual void returnPressed(const QString&); + virtual void returnPressed(const TQString&); /** * The Id of the next player. Incremented after every call. diff --git a/libkdegames/kchatbase.cpp b/libkdegames/kchatbase.cpp index 4ccd7b08..421e0224 100644 --- a/libkdegames/kchatbase.cpp +++ b/libkdegames/kchatbase.cpp @@ -26,9 +26,9 @@ #include <kapplication.h> #include <kdebug.h> -#include <qlayout.h> -#include <qcombobox.h> -#include <qpainter.h> +#include <tqlayout.h> +#include <tqcombobox.h> +#include <tqpainter.h> class KChatBaseTextPrivate { @@ -39,22 +39,22 @@ public: mMessageFont = 0; } - QString mName; - QString mMessage; + TQString mName; + TQString mMessage; - const QFont* mNameFont; - const QFont* mMessageFont; + const TQFont* mNameFont; + const TQFont* mMessageFont; }; -KChatBaseText::KChatBaseText(const QString& name, const QString& message) : QListBoxText() +KChatBaseText::KChatBaseText(const TQString& name, const TQString& message) : TQListBoxText() { init(); setName(name); setMessage(message); } -KChatBaseText::KChatBaseText(const QString& message) : QListBoxText() +KChatBaseText::KChatBaseText(const TQString& message) : TQListBoxText() { init(); setMessage(message); @@ -70,88 +70,88 @@ void KChatBaseText::init() d = new KChatBaseTextPrivate; } -void KChatBaseText::setName(const QString& n) +void KChatBaseText::setName(const TQString& n) { // d->mName = n; - d->mName = QString("%1: ").arg(n); - setText(QString("%1: %2").arg(name()).arg(message())); // esp. for sorting + d->mName = TQString("%1: ").arg(n); + setText(TQString("%1: %2").arg(name()).arg(message())); // esp. for sorting } -void KChatBaseText::setMessage(const QString& m) +void KChatBaseText::setMessage(const TQString& m) { d->mMessage = m; - setText(QString("%1: %2").arg(name()).arg(message())); // esp. for sorting + setText(TQString("%1: %2").arg(name()).arg(message())); // esp. for sorting } -const QString& KChatBaseText::name() const +const TQString& KChatBaseText::name() const { return d->mName; } -const QString& KChatBaseText::message() const +const TQString& KChatBaseText::message() const { return d->mMessage; } -QFont KChatBaseText::nameFont() const +TQFont KChatBaseText::nameFont() const { if (d->mNameFont) { return *d->mNameFont; } else if (listBox()) { return listBox()->font(); } else { - return QFont(); + return TQFont(); } } -QFont KChatBaseText::messageFont() const +TQFont KChatBaseText::messageFont() const { if (d->mMessageFont) { return *d->mMessageFont; } else if (listBox()) { return listBox()->font(); } else { - return QFont(); + return TQFont(); } } -void KChatBaseText::setNameFont(const QFont* f) +void KChatBaseText::setNameFont(const TQFont* f) { d->mNameFont = f; } -void KChatBaseText::setMessageFont(const QFont* f) +void KChatBaseText::setMessageFont(const TQFont* f) { d->mMessageFont = f; } -void KChatBaseText::paint(QPainter* painter) +void KChatBaseText::paint(TQPainter* painter) { - QFontMetrics fm = painter->fontMetrics(); + TQFontMetrics fm = painter->fontMetrics(); painter->setFont(nameFont()); painter->drawText(3, fm.ascent() + fm.leading()/2, name()); painter->setFont(messageFont()); - painter->drawText(3 + QFontMetrics(nameFont()).width(name()), fm.ascent() + fm.leading()/2, message()); + painter->drawText(3 + TQFontMetrics(nameFont()).width(name()), fm.ascent() + fm.leading()/2, message()); } -int KChatBaseText::width(QListBox* lb) const +int KChatBaseText::width(TQListBox* lb) const { int w = 0; if (lb) { w += 6; - w += QFontMetrics(nameFont()).width(name()); - w += QFontMetrics(messageFont()).width(message()); + w += TQFontMetrics(nameFont()).width(name()); + w += TQFontMetrics(messageFont()).width(message()); } // int w = lb ? lb->fontMetrics().width( text() ) + 6 : 0; // QT orig - return QMAX(w, QApplication::globalStrut().width()); + return QMAX(w, TQApplication::globalStrut().width()); } -int KChatBaseText::height(QListBox* lb) const +int KChatBaseText::height(TQListBox* lb) const { int h = 0; if (lb) { h += 2; // AB: is lineSpacing still correct? - if (QFontMetrics(nameFont()).lineSpacing() > QFontMetrics(messageFont()).lineSpacing()) { - h += QFontMetrics(nameFont()).lineSpacing(); + if (TQFontMetrics(nameFont()).lineSpacing() > TQFontMetrics(messageFont()).lineSpacing()) { + h += TQFontMetrics(nameFont()).lineSpacing(); } else { - h += QFontMetrics(messageFont()).lineSpacing(); + h += TQFontMetrics(messageFont()).lineSpacing(); } } // int h = lb ? lb->fontMetrics().lineSpacing() + 2 : 0; // QT orig - return QMAX(h, QApplication::globalStrut().height()); + return QMAX(h, TQApplication::globalStrut().height()); } @@ -168,21 +168,21 @@ public: mAcceptMessage = true; mMaxItems = -1; } - QListBox* mBox; + TQListBox* mBox; KLineEdit* mEdit; - QComboBox* mCombo; + TQComboBox* mCombo; bool mAcceptMessage; int mMaxItems; - QValueList<int> mIndex2Id; + TQValueList<int> mIndex2Id; - QFont mNameFont; - QFont mMessageFont; - QFont mSystemNameFont; - QFont mSystemMessageFont; + TQFont mNameFont; + TQFont mMessageFont; + TQFont mSystemNameFont; + TQFont mSystemMessageFont; }; -KChatBase::KChatBase(QWidget* parent, bool noComboBox) : QFrame(parent) +KChatBase::KChatBase(TQWidget* parent, bool noComboBox) : TQFrame(parent) { init(noComboBox); } @@ -203,31 +203,31 @@ void KChatBase::init(bool noComboBox) setMinimumWidth(100); setMinimumHeight(150); - QVBoxLayout* l = new QVBoxLayout(this); + TQVBoxLayout* l = new TQVBoxLayout(this); - d->mBox = new QListBox(this); - connect(d->mBox, SIGNAL(rightButtonClicked(QListBoxItem*, const QPoint&)), - this, SIGNAL(rightButtonClicked(QListBoxItem*, const QPoint&))); + d->mBox = new TQListBox(this); + connect(d->mBox, TQT_SIGNAL(rightButtonClicked(TQListBoxItem*, const TQPoint&)), + this, TQT_SIGNAL(rightButtonClicked(TQListBoxItem*, const TQPoint&))); l->addWidget(d->mBox); - d->mBox->setVScrollBarMode(QScrollView::AlwaysOn); - d->mBox->setHScrollBarMode(QScrollView::AlwaysOff); - d->mBox->setFocusPolicy(QWidget::NoFocus); -// d->mBox->setSelectionMode(QListBox::NoSelection); - d->mBox->setSelectionMode(QListBox::Single); + d->mBox->setVScrollBarMode(TQScrollView::AlwaysOn); + d->mBox->setHScrollBarMode(TQScrollView::AlwaysOff); + d->mBox->setFocusPolicy(TQWidget::NoFocus); +// d->mBox->setSelectionMode(TQListBox::NoSelection); + d->mBox->setSelectionMode(TQListBox::Single); l->addSpacing(5); - QHBoxLayout* h = new QHBoxLayout(l); + TQHBoxLayout* h = new TQHBoxLayout(l); d->mEdit = new KLineEdit(this); d->mEdit->setHandleSignals(false); d->mEdit->setTrapReturnKey(true); d->mEdit->completionObject(); // add the completion object d->mEdit->setCompletionMode(KGlobalSettings::CompletionNone); - connect(d->mEdit, SIGNAL(returnPressed(const QString&)), this, SLOT(slotReturnPressed(const QString&))); + connect(d->mEdit, TQT_SIGNAL(returnPressed(const TQString&)), this, TQT_SLOT(slotReturnPressed(const TQString&))); h->addWidget(d->mEdit); if (!noComboBox) { - d->mCombo = new QComboBox(this); + d->mCombo = new TQComboBox(this); h->addWidget(d->mCombo); addSendingEntry(i18n("Send to All Players"), SendToAll);//FIXME: where to put the id? } @@ -247,7 +247,7 @@ bool KChatBase::acceptMessage() const void KChatBase::setAcceptMessage(bool a) { d->mAcceptMessage = a; } -bool KChatBase::addSendingEntry(const QString& text, int id) +bool KChatBase::addSendingEntry(const TQString& text, int id) { //FIXME: is ID used correctly? // do we need ID at all? @@ -256,7 +256,7 @@ bool KChatBase::addSendingEntry(const QString& text, int id) return insertSendingEntry(text, id); } -bool KChatBase::insertSendingEntry(const QString& text, int id, int index) +bool KChatBase::insertSendingEntry(const TQString& text, int id, int index) { if (!d->mCombo) { kdWarning(11000) << "KChatBase: Cannot add an entry to the combo box" << endl; @@ -303,7 +303,7 @@ void KChatBase::removeSendingEntry(int id) d->mIndex2Id.remove(id); } -void KChatBase::changeSendingEntry(const QString& text, int id) +void KChatBase::changeSendingEntry(const TQString& text, int id) { if (!d->mCombo) { kdWarning(11000) << "KChatBase: Cannot change an entry in the combo box" << endl; @@ -336,7 +336,7 @@ int KChatBase::nextId() const return i; } -void KChatBase::addItem(const QListBoxItem* text) +void KChatBase::addItem(const TQListBoxItem* text) { d->mBox->insertItem(text); int index = d->mBox->count() -1; @@ -346,40 +346,40 @@ void KChatBase::addItem(const QListBoxItem* text) } } -void KChatBase::addMessage(const QString& fromName, const QString& text) +void KChatBase::addMessage(const TQString& fromName, const TQString& text) { //maybe "%1 says: %2" or so addItem(layoutMessage(fromName, text)); } -void KChatBase::addSystemMessage(const QString& fromName, const QString& text) +void KChatBase::addSystemMessage(const TQString& fromName, const TQString& text) { addItem(layoutSystemMessage(fromName, text)); } -QListBoxItem* KChatBase::layoutMessage(const QString& fromName, const QString& text) +TQListBoxItem* KChatBase::layoutMessage(const TQString& fromName, const TQString& text) { //TODO: KChatBaseConfigure? - e.g. color - QListBoxItem* message; + TQListBoxItem* message; if (text.startsWith("/me ")) { // replace "/me" by a nice star. leave one space after the star - QPixmap pix; - pix.load(locate("data", QString::fromLatin1("kdegames/pics/star.png"))); + TQPixmap pix; + pix.load(locate("data", TQString::fromLatin1("kdegames/pics/star.png"))); //TODO KChatBasePixmap? Should change the font here! - message = (QListBoxItem*)new QListBoxPixmap(pix, i18n("%1 %2").arg(fromName).arg(text.mid(3))); + message = (TQListBoxItem*)new TQListBoxPixmap(pix, i18n("%1 %2").arg(fromName).arg(text.mid(3))); } else { // the text is not edited in any way. just return an item KChatBaseText* m = new KChatBaseText(fromName, text); m->setNameFont(&d->mNameFont); m->setMessageFont(&d->mMessageFont); - message = (QListBoxItem*)m; + message = (TQListBoxItem*)m; } return message; } -QListBoxItem* KChatBase::layoutSystemMessage(const QString& fromName, const QString& text) +TQListBoxItem* KChatBase::layoutSystemMessage(const TQString& fromName, const TQString& text) { //TODO: KChatBaseConfigure? - e.g. color @@ -387,10 +387,10 @@ QListBoxItem* KChatBase::layoutSystemMessage(const QString& fromName, const QStr KChatBaseText* m = new KChatBaseText(i18n("--- %1").arg(fromName), text); m->setNameFont(&d->mSystemNameFont); m->setMessageFont(&d->mSystemMessageFont); - return (QListBoxItem*)m; + return (TQListBoxItem*)m; } -void KChatBase::slotReturnPressed(const QString& text) +void KChatBase::slotReturnPressed(const TQString& text) { if (text.length() <= 0) { // no text entered - probably hit return by accident @@ -399,12 +399,12 @@ void KChatBase::slotReturnPressed(const QString& text) return; } d->mEdit->completionObject()->addItem(text); -// connect(d->mEdit, SIGNAL(returnPressed(const QString&)), comp, SLOT(addItem(const QString&))); +// connect(d->mEdit, TQT_SIGNAL(returnPressed(const TQString&)), comp, TQT_SLOT(addItem(const TQString&))); d->mEdit->clear(); returnPressed(text); } -QString KChatBase::comboBoxItem(const QString& name) const +TQString KChatBase::comboBoxItem(const TQString& name) const { // TODO: such a function for "send to all" and "send to my group" return i18n("Send to %1").arg(name); } @@ -417,57 +417,57 @@ void KChatBase::slotClear() void KChatBase::setCompletionMode(KGlobalSettings::Completion mode) { d->mEdit->setCompletionMode(mode); } -void KChatBase::setNameFont(const QFont& font) +void KChatBase::setNameFont(const TQFont& font) { d->mNameFont = font; d->mBox->triggerUpdate(false); } -void KChatBase::setMessageFont(const QFont& font) +void KChatBase::setMessageFont(const TQFont& font) { d->mMessageFont = font; d->mBox->triggerUpdate(false); } -void KChatBase::setBothFont(const QFont& font) +void KChatBase::setBothFont(const TQFont& font) { setNameFont(font); setMessageFont(font); } -const QFont& KChatBase::nameFont() const +const TQFont& KChatBase::nameFont() const { return d->mNameFont; } -const QFont& KChatBase::messageFont() const +const TQFont& KChatBase::messageFont() const { return d->mMessageFont; } -void KChatBase::setSystemNameFont(const QFont& font) +void KChatBase::setSystemNameFont(const TQFont& font) { d->mSystemNameFont = font; d->mBox->triggerUpdate(false); } -void KChatBase::setSystemMessageFont(const QFont& font) +void KChatBase::setSystemMessageFont(const TQFont& font) { d->mSystemMessageFont = font; d->mBox->triggerUpdate(false); } -void KChatBase::setSystemBothFont(const QFont& font) +void KChatBase::setSystemBothFont(const TQFont& font) { setSystemNameFont(font); setSystemMessageFont(font); } -const QFont& KChatBase::systemNameFont() const +const TQFont& KChatBase::systemNameFont() const { return d->mSystemNameFont; } -const QFont& KChatBase::systemMessageFont() const +const TQFont& KChatBase::systemMessageFont() const { return d->mSystemMessageFont; } void KChatBase::saveConfig(KConfig* conf) { - QString oldGroup; + TQString oldGroup; if (!conf) { conf = kapp->config(); oldGroup = conf->group(); @@ -487,7 +487,7 @@ void KChatBase::saveConfig(KConfig* conf) void KChatBase::readConfig(KConfig* conf) { - QString oldGroup; + TQString oldGroup; if (!conf) { conf = kapp->config(); oldGroup = conf->group(); diff --git a/libkdegames/kchatbase.h b/libkdegames/kchatbase.h index 07f786f9..e808dd1d 100644 --- a/libkdegames/kchatbase.h +++ b/libkdegames/kchatbase.h @@ -19,9 +19,9 @@ #ifndef __KCHATBASE_H__ #define __KCHATBASE_H__ -#include <qframe.h> -#include <qstring.h> -#include <qlistbox.h> +#include <tqframe.h> +#include <tqstring.h> +#include <tqlistbox.h> #include <kglobalsettings.h> #include <kdemacros.h> @@ -33,7 +33,7 @@ class KConfig; class KChatBaseTextPrivate; /** - * A QListBoxText implementation for KChatBase. + * A TQListBoxText implementation for KChatBase. * * It supports different colors, text fonts, ... * @@ -53,12 +53,12 @@ public: /** * Constructs a KChatBaseText object with the player and text part **/ - KChatBaseText(const QString& player, const QString& text); + KChatBaseText(const TQString& player, const TQString& text); /** * Constructs a KChatBaseText object without player part **/ - KChatBaseText(const QString& text); + KChatBaseText(const TQString& text); /** * Destruct a KChatBaseText object. @@ -72,7 +72,7 @@ public: * @see setMessage * @param name The name of the sender (e.g. the player) **/ - void setName(const QString& name); + void setName(const TQString& name); /** * Set the text part of a message. A message is usually shown like @@ -81,33 +81,33 @@ public: * See also setName * @param message The message that has been sent **/ - void setMessage(const QString& message); + void setMessage(const TQString& message); /** * @return The name part of a message. * @see setName **/ - const QString& name() const; + const TQString& name() const; /** * @return The message text. * @see setMessage **/ - const QString& message() const; + const TQString& message() const; /** * You can set the font of the sender name independently of the message * itself. This font is used as the "name: " part of the message. * @return The font that is used for the name **/ - QFont nameFont() const; + TQFont nameFont() const; /** * You can set the font of the message independently of the sender name. * This font is used as the text part of the message. * @return The font thaz is used for message text **/ - QFont messageFont() const; + TQFont messageFont() const; /** * Set the font for the name. @@ -116,7 +116,7 @@ public: * don't delete the object. This way there is only one object for a lot * of messages in memory. **/ - void setNameFont(const QFont* font); + void setNameFont(const TQFont* font); /** * Set the font for the message text. @@ -125,20 +125,20 @@ public: * don't delete the object! This way there is only one object for a lot * of messages in memory. **/ - void setMessageFont(const QFont* font); + void setMessageFont(const TQFont* font); /** **/ - virtual int width(QListBox* ) const; + virtual int width(TQListBox* ) const; /** **/ - virtual int height(QListBox* ) const; + virtual int height(TQListBox* ) const; protected: /** **/ - virtual void paint(QPainter*); + virtual void paint(TQPainter*); private: void init(); @@ -191,7 +191,7 @@ public: * choose where to send messages to (either globally or just to some * players) will not be added. **/ - KChatBase(QWidget* parent, bool noComboBox = false); + KChatBase(TQWidget* parent, bool noComboBox = false); /** * Destruct the KChatBase object @@ -209,7 +209,7 @@ public: * string that was set by setFromName or the name of the player * that was set by setFromPlayer **/ - virtual const QString& fromName() const = 0; + virtual const TQString& fromName() const = 0; /** * Adds a new entry in the combo box. The default is "send to all @@ -222,7 +222,7 @@ public: * combo box. See nextId * @return True if successful, otherwise false (e.g. if the id is already used) **/ - bool addSendingEntry(const QString& text, int id); + bool addSendingEntry(const TQString& text, int id); /** * Inserts a new entry in the combo box. @@ -235,14 +235,14 @@ public: * at the bottom * @return True if successful, otherwise false (e.g. if the id is already used) **/ - bool insertSendingEntry(const QString& text, int id, int index = -1); + bool insertSendingEntry(const TQString& text, int id, int index = -1); /** * This changes a combo box entry. * @param text The new text of the entry * @param id The ID of the item to be changed **/ - void changeSendingEntry(const QString& text, int id); + void changeSendingEntry(const TQString& text, int id); /** * This selects a combo box entry. @@ -295,13 +295,13 @@ public: * Set the font that used used for the name part of a message. See also * nameFont and setBothFont **/ - void setNameFont(const QFont& font); + void setNameFont(const TQFont& font); /** * Set the font that used used for the message part of a message. * @see messageFont, setBothFont **/ - void setMessageFont(const QFont& font); + void setMessageFont(const TQFont& font); /** * This sets both - nameFont and messageFont to font. You @@ -309,25 +309,25 @@ public: * these parts of a message. * @param font A font used for both nameFont and messageFont **/ - void setBothFont(const QFont& font); + void setBothFont(const TQFont& font); /** * Same as setNameFont but applies only to system messages. * @see layoutSystemMessage **/ - void setSystemNameFont(const QFont& font); + void setSystemNameFont(const TQFont& font); /** * Same as setMessageFont but applies only to system messages. * @see layoutSystemMessage **/ - void setSystemMessageFont(const QFont& font); + void setSystemMessageFont(const TQFont& font); /** * Same as setBothFont but applies only to system messages. * @see layoutSystemMessage **/ - void setSystemBothFont(const QFont& font); + void setSystemBothFont(const TQFont& font); /** * This font should be used for the name (the "from: " part) of a @@ -336,7 +336,7 @@ public: * layoutMessage you should do this yourself. * @return The font that is used for the name part of the message. **/ - const QFont& nameFont() const; + const TQFont& nameFont() const; /** * This font should be used for a message. layoutMessage sets the @@ -345,19 +345,19 @@ public: * messageFont() yourself. * @return The font that is used for a message **/ - const QFont& messageFont() const; + const TQFont& messageFont() const; /** * Same as systemNameFont but applies only to system messages. * @see layoutSystemMessage **/ - const QFont& systemNameFont() const; + const TQFont& systemNameFont() const; /** * Same as systemMessageFont but applies only to system messages. * @see layoutSystemMessage **/ - const QFont& systemMessageFont() const; + const TQFont& systemMessageFont() const; /** * Save the configuration of the dialog to a KConfig object. If @@ -410,7 +410,7 @@ public slots: * @param fromName The player who sent this message * @param text The text to be added **/ - virtual void addMessage(const QString& fromName, const QString& text); + virtual void addMessage(const TQString& fromName, const TQString& text); /** * This works just like addMessage but adds a system message. @@ -419,7 +419,7 @@ public slots: * * You may wish to use this to display status information from your game. **/ - virtual void addSystemMessage(const QString& fromName, const QString& text); + virtual void addSystemMessage(const TQString& fromName, const TQString& text); /** * This member function is mainly internally used to add a message. It @@ -429,9 +429,9 @@ public slots: * * But you may want to replace this in a derived class to create a * non-default (maybe nicer ;-) ) behaviour - * @param item The QListBoxItem that is being added + * @param item The TQListBoxItem that is being added **/ - virtual void addItem(const QListBoxItem* item); + virtual void addItem(const TQListBoxItem* item); /** @@ -449,9 +449,9 @@ public slots: signals: /** * Emitted when the user right-clicks on a list item. - * @see QListBox::rightButtonClicked + * @see TQListBox::rightButtonClicked **/ - void rightButtonClicked(QListBoxItem*, const QPoint&); + void rightButtonClicked(TQListBoxItem*, const TQPoint&); protected: /** @@ -465,7 +465,7 @@ protected: * Must be implemented in derived classes * @param text The message to be sent **/ - virtual void returnPressed(const QString& text) = 0; + virtual void returnPressed(const TQString& text) = 0; /** * Replace to customise the combo box. @@ -474,24 +474,24 @@ protected: * @param name The name of the player * @return The string as it will be shown in the combo box **/ - virtual QString comboBoxItem(const QString& name) const; + virtual TQString comboBoxItem(const TQString& name) const; /** - * Create a QListBoxItem for this message. This function is not yet + * Create a TQListBoxItem for this message. This function is not yet * written usefully - currently just a QListBoxTex object is * created which shows the message in this format: "fromName: text". * This should fit most peoples needs but needs further improvements. **/ - virtual QListBoxItem* layoutMessage(const QString& fromName, const QString& text); + virtual TQListBoxItem* layoutMessage(const TQString& fromName, const TQString& text); /** - * Create a QListBoxItem for this message. This does the same as + * Create a TQListBoxItem for this message. This does the same as * layoutMessage but generates a system message. You might want to * use such a message to display e.g. status information from your game. * * The default implementation just prepends "--- ". **/ - virtual QListBoxItem* layoutSystemMessage(const QString& fromName, const QString& text); + virtual TQListBoxItem* layoutSystemMessage(const TQString& fromName, const TQString& text); private slots: /** @@ -499,7 +499,7 @@ private slots: * Then add the message to the KCompletion object of the KLineEdit * widget and call returnPressed **/ - void slotReturnPressed(const QString&); + void slotReturnPressed(const TQString&); private: void init(bool noComboBox); diff --git a/libkdegames/kchatdialog.cpp b/libkdegames/kchatdialog.cpp index bd196e7c..9cfbefff 100644 --- a/libkdegames/kchatdialog.cpp +++ b/libkdegames/kchatdialog.cpp @@ -24,9 +24,9 @@ #include <klocale.h> #include <kfontdialog.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qpushbutton.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqpushbutton.h> class KChatDialogPrivate { @@ -43,19 +43,19 @@ class KChatDialogPrivate mChat = 0; } - QFrame* mTextPage; + TQFrame* mTextPage; - QLabel* mNamePreview; - QLabel* mTextPreview; - QLabel* mSystemNamePreview; - QLabel* mSystemTextPreview; + TQLabel* mNamePreview; + TQLabel* mTextPreview; + TQLabel* mSystemNamePreview; + TQLabel* mSystemTextPreview; - QLineEdit* mMaxMessages; + TQLineEdit* mMaxMessages; KChatBase* mChat; }; -KChatDialog::KChatDialog(KChatBase* chat, QWidget* parent, bool modal) +KChatDialog::KChatDialog(KChatBase* chat, TQWidget* parent, bool modal) // : KDialogBase(Tabbed, i18n("Configure Chat"), Ok|Default|Apply|Cancel, Ok, parent, 0, modal, true) : KDialogBase(Plain, i18n("Configure Chat"), Ok|Default|Apply|Cancel, Ok, parent, 0, modal, true) { @@ -63,7 +63,7 @@ KChatDialog::KChatDialog(KChatBase* chat, QWidget* parent, bool modal) plugChatWidget(chat); } -KChatDialog::KChatDialog(QWidget* parent, bool modal) +KChatDialog::KChatDialog(TQWidget* parent, bool modal) // : KDialogBase(Tabbed, i18n("Configure Chat"), Ok|Default|Apply|Cancel, Ok, parent, 0, modal, true) : KDialogBase(Plain, i18n("Configure Chat"), Ok|Default|Apply|Cancel, Ok, parent, 0, modal, true) { @@ -80,100 +80,100 @@ void KChatDialog::init() d = new KChatDialogPrivate; // d->mTextPage = addPage(i18n("&Messages"));// not a good name - game Messages? d->mTextPage = plainPage(); - QGridLayout* layout = new QGridLayout(d->mTextPage, 7, 2, KDialog::marginHint(), KDialog::spacingHint()); + TQGridLayout* layout = new TQGridLayout(d->mTextPage, 7, 2, KDialog::marginHint(), KDialog::spacingHint()); // General fonts - QPushButton* nameFont = new QPushButton(i18n("Name Font..."), d->mTextPage); - connect(nameFont, SIGNAL(pressed()), this, SLOT(slotGetNameFont())); + TQPushButton* nameFont = new TQPushButton(i18n("Name Font..."), d->mTextPage); + connect(nameFont, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotGetNameFont())); layout->addWidget(nameFont, 0, 0); - QPushButton* textFont = new QPushButton(i18n("Text Font..."), d->mTextPage); - connect(textFont, SIGNAL(pressed()), this, SLOT(slotGetTextFont())); + TQPushButton* textFont = new TQPushButton(i18n("Text Font..."), d->mTextPage); + connect(textFont, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotGetTextFont())); layout->addWidget(textFont, 0, 1); - QFrame* messagePreview = new QFrame(d->mTextPage); - messagePreview->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); - QHBoxLayout* messageLayout = new QHBoxLayout(messagePreview); + TQFrame* messagePreview = new TQFrame(d->mTextPage); + messagePreview->setFrameStyle(TQFrame::StyledPanel | TQFrame::Sunken); + TQHBoxLayout* messageLayout = new TQHBoxLayout(messagePreview); layout->addMultiCellWidget(messagePreview, 1, 1, 0, 1); - d->mNamePreview = new QLabel(i18n("Player: "), messagePreview); + d->mNamePreview = new TQLabel(i18n("Player: "), messagePreview); messageLayout->addWidget(d->mNamePreview, 0); - d->mTextPreview = new QLabel(i18n("This is a player message"), messagePreview); + d->mTextPreview = new TQLabel(i18n("This is a player message"), messagePreview); messageLayout->addWidget(d->mTextPreview, 1); layout->addRowSpacing(2, 10); // System Message fonts - QLabel* systemMessages = new QLabel(i18n("System Messages - Messages directly sent from the game"), d->mTextPage); + TQLabel* systemMessages = new TQLabel(i18n("System Messages - Messages directly sent from the game"), d->mTextPage); layout->addMultiCellWidget(systemMessages, 3, 3, 0, 1); - QPushButton* systemNameFont = new QPushButton(i18n("Name Font..."), d->mTextPage); - connect(systemNameFont, SIGNAL(pressed()), this, SLOT(slotGetSystemNameFont())); + TQPushButton* systemNameFont = new TQPushButton(i18n("Name Font..."), d->mTextPage); + connect(systemNameFont, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotGetSystemNameFont())); layout->addWidget(systemNameFont, 4, 0); - QPushButton* systemTextFont = new QPushButton(i18n("Text Font..."), d->mTextPage); - connect(systemTextFont, SIGNAL(pressed()), this, SLOT(slotGetSystemTextFont())); + TQPushButton* systemTextFont = new TQPushButton(i18n("Text Font..."), d->mTextPage); + connect(systemTextFont, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotGetSystemTextFont())); layout->addWidget(systemTextFont, 4, 1); - QFrame* systemMessagePreview = new QFrame(d->mTextPage); - systemMessagePreview->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); - QHBoxLayout* systemMessageLayout = new QHBoxLayout(systemMessagePreview); + TQFrame* systemMessagePreview = new TQFrame(d->mTextPage); + systemMessagePreview->setFrameStyle(TQFrame::StyledPanel | TQFrame::Sunken); + TQHBoxLayout* systemMessageLayout = new TQHBoxLayout(systemMessagePreview); layout->addMultiCellWidget(systemMessagePreview, 5, 5, 0, 1); - d->mSystemNamePreview = new QLabel(i18n("--- Game: "), systemMessagePreview); + d->mSystemNamePreview = new TQLabel(i18n("--- Game: "), systemMessagePreview); systemMessageLayout->addWidget(d->mSystemNamePreview, 0); - d->mSystemTextPreview = new QLabel(i18n("This is a system message"), systemMessagePreview); + d->mSystemTextPreview = new TQLabel(i18n("This is a system message"), systemMessagePreview); systemMessageLayout->addWidget(d->mSystemTextPreview, 1); // message count - QLabel* maxMessages = new QLabel(i18n("Maximal number of messages (-1 = unlimited):"), d->mTextPage); + TQLabel* maxMessages = new TQLabel(i18n("Maximal number of messages (-1 = unlimited):"), d->mTextPage); layout->addWidget(maxMessages, 6, 0); - d->mMaxMessages = new QLineEdit(d->mTextPage); - d->mMaxMessages->setText(QString::number(-1)); + d->mMaxMessages = new TQLineEdit(d->mTextPage); + d->mMaxMessages->setText(TQString::number(-1)); layout->addWidget(d->mMaxMessages, 6, 1); } void KChatDialog::slotGetNameFont() { - QFont font = nameFont(); + TQFont font = nameFont(); KFontDialog::getFont(font); setNameFont(font); } void KChatDialog::slotGetTextFont() { - QFont font = textFont(); + TQFont font = textFont(); KFontDialog::getFont(font); setTextFont(font); } void KChatDialog::slotGetSystemNameFont() { - QFont font = systemNameFont(); + TQFont font = systemNameFont(); KFontDialog::getFont(font); setSystemNameFont(font); } void KChatDialog::slotGetSystemTextFont() { - QFont font = systemTextFont(); + TQFont font = systemTextFont(); KFontDialog::getFont(font); setSystemTextFont(font); } -QFont KChatDialog::nameFont() const +TQFont KChatDialog::nameFont() const { return d->mNamePreview->font(); } -QFont KChatDialog::textFont() const +TQFont KChatDialog::textFont() const { return d->mTextPreview->font(); } -QFont KChatDialog::systemNameFont() const +TQFont KChatDialog::systemNameFont() const { return d->mSystemNamePreview->font(); } -QFont KChatDialog::systemTextFont() const +TQFont KChatDialog::systemTextFont() const { return d->mSystemTextPreview->font(); } @@ -215,29 +215,29 @@ void KChatDialog::slotApply() configureChatWidget(d->mChat); } -void KChatDialog::setNameFont(QFont f) +void KChatDialog::setNameFont(TQFont f) { d->mNamePreview->setFont(f); } -void KChatDialog::setTextFont(QFont f) +void KChatDialog::setTextFont(TQFont f) { d->mTextPreview->setFont(f); } -void KChatDialog::setSystemNameFont(QFont f) +void KChatDialog::setSystemNameFont(TQFont f) { d->mSystemNamePreview->setFont(f); } -void KChatDialog::setSystemTextFont(QFont f) +void KChatDialog::setSystemTextFont(TQFont f) { d->mSystemTextPreview->setFont(f); } void KChatDialog::setMaxMessages(int max) { - d->mMaxMessages->setText(QString::number(max)); + d->mMaxMessages->setText(TQString::number(max)); } int KChatDialog::maxMessages() const diff --git a/libkdegames/kchatdialog.h b/libkdegames/kchatdialog.h index 96b3eef2..853dd94a 100644 --- a/libkdegames/kchatdialog.h +++ b/libkdegames/kchatdialog.h @@ -34,14 +34,14 @@ public: /** * Construct a KChatDialog widget **/ - KChatDialog(QWidget* parent, bool modal = false); + KChatDialog(TQWidget* parent, bool modal = false); /** * Construct a KChatDialog widget which automatically configures the * @ref KChatBase widget. You probably want to use this as you don't * have to care about the configuration stuff yourself. **/ - KChatDialog(KChatBase* chatWidget, QWidget* parent, bool modal = false); + KChatDialog(KChatBase* chatWidget, TQWidget* parent, bool modal = false); /** * Destruct the dialog @@ -52,23 +52,23 @@ public: * @return The font that shall be used as the "name: " part of a normal * message. **/ - QFont nameFont() const; + TQFont nameFont() const; /** * @return The font that shall be used for normal messages. **/ - QFont textFont() const; + TQFont textFont() const; /** * @return The font that shall be used as the "name: " part of a system * (game) message. **/ - QFont systemNameFont() const; + TQFont systemNameFont() const; /** * @return The font that shall be used for a system (game) message. **/ - QFont systemTextFont() const; + TQFont systemTextFont() const; /** * Set the widget that will be configured by the dialog. Use this if you @@ -103,10 +103,10 @@ protected slots: virtual void slotOk(); private: - void setNameFont(QFont); - void setTextFont(QFont); - void setSystemNameFont(QFont); - void setSystemTextFont(QFont); + void setNameFont(TQFont); + void setTextFont(TQFont); + void setSystemNameFont(TQFont); + void setSystemTextFont(TQFont); void setMaxMessages(int max); private: diff --git a/libkdegames/kgame/dialogs/kgameconnectdialog.cpp b/libkdegames/kgame/dialogs/kgameconnectdialog.cpp index 4d2d90e0..575b3090 100644 --- a/libkdegames/kgame/dialogs/kgameconnectdialog.cpp +++ b/libkdegames/kgame/dialogs/kgameconnectdialog.cpp @@ -24,15 +24,15 @@ #include <knuminput.h> #include <klocale.h> -#include <qlineedit.h> -#include <qcombobox.h> -#include <qvbuttongroup.h> -#include <qlayout.h> -#include <qradiobutton.h> -#include <qlabel.h> +#include <tqlineedit.h> +#include <tqcombobox.h> +#include <tqvbuttongroup.h> +#include <tqlayout.h> +#include <tqradiobutton.h> +#include <tqlabel.h> #include <dnssd/servicebrowser.h> -#include <qpushbutton.h> -#include <qgrid.h> +#include <tqpushbutton.h> +#include <tqgrid.h> class KGameConnectWidgetPrivate { @@ -46,42 +46,42 @@ class KGameConnectWidgetPrivate } KIntNumInput* mPort; - QLineEdit* mHost; //KLineEdit? - QVButtonGroup* mButtonGroup; - QComboBox *mClientName; - QLabel *mClientNameLabel; + TQLineEdit* mHost; //KLineEdit? + TQVButtonGroup* mButtonGroup; + TQComboBox *mClientName; + TQLabel *mClientNameLabel; DNSSD::ServiceBrowser *mBrowser; - QLabel *mServerNameLabel; - QLineEdit *mServerName; - QString mType; + TQLabel *mServerNameLabel; + TQLineEdit *mServerName; + TQString mType; }; -KGameConnectWidget::KGameConnectWidget(QWidget* parent) : QWidget(parent) +KGameConnectWidget::KGameConnectWidget(TQWidget* parent) : TQWidget(parent) { d = new KGameConnectWidgetPrivate; - QVBoxLayout* vb = new QVBoxLayout(this, KDialog::spacingHint()); - d->mButtonGroup = new QVButtonGroup(this); + TQVBoxLayout* vb = new TQVBoxLayout(this, KDialog::spacingHint()); + d->mButtonGroup = new TQVButtonGroup(this); vb->addWidget(d->mButtonGroup); - connect(d->mButtonGroup, SIGNAL(clicked(int)), this, SLOT(slotTypeChanged(int))); - (void)new QRadioButton(i18n("Create a network game"), d->mButtonGroup); - (void)new QRadioButton(i18n("Join a network game"), d->mButtonGroup); + connect(d->mButtonGroup, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(slotTypeChanged(int))); + (void)new TQRadioButton(i18n("Create a network game"), d->mButtonGroup); + (void)new TQRadioButton(i18n("Join a network game"), d->mButtonGroup); - QGrid* g = new QGrid(2, this); + TQGrid* g = new TQGrid(2, this); vb->addWidget(g); g->setSpacing(KDialog::spacingHint()); - d->mServerNameLabel = new QLabel(i18n("Game name:"), g); - d->mServerName = new QLineEdit(g); - d->mClientNameLabel = new QLabel(i18n("Network games:"), g); - d->mClientName = new QComboBox(g); - connect(d->mClientName,SIGNAL(activated(int)),SLOT(slotGameSelected(int))); - (void)new QLabel(i18n("Port to connect to:"), g); + d->mServerNameLabel = new TQLabel(i18n("Game name:"), g); + d->mServerName = new TQLineEdit(g); + d->mClientNameLabel = new TQLabel(i18n("Network games:"), g); + d->mClientName = new TQComboBox(g); + connect(d->mClientName,TQT_SIGNAL(activated(int)),TQT_SLOT(slotGameSelected(int))); + (void)new TQLabel(i18n("Port to connect to:"), g); d->mPort = new KIntNumInput(g); - (void)new QLabel(i18n("Host to connect to:"), g); - d->mHost = new QLineEdit(g); + (void)new TQLabel(i18n("Host to connect to:"), g); + d->mHost = new TQLineEdit(g); - QPushButton *button=new QPushButton(i18n("&Start Network"), this); - connect(button, SIGNAL(clicked()), this, SIGNAL(signalNetworkSetup())); + TQPushButton *button=new TQPushButton(i18n("&Start Network"), this); + connect(button, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(signalNetworkSetup())); vb->addWidget(button); // Hide until type is set d->mClientName->hide(); @@ -107,12 +107,12 @@ void KGameConnectWidget::showDnssdControls() } } -void KGameConnectWidget::setType(const QString& type) +void KGameConnectWidget::setType(const TQString& type) { d->mType = type; delete d->mBrowser; d->mBrowser = new DNSSD::ServiceBrowser(type); - connect(d->mBrowser,SIGNAL(finished()),SLOT(slotGamesFound())); + connect(d->mBrowser,TQT_SIGNAL(finished()),TQT_SLOT(slotGamesFound())); d->mBrowser->startBrowse(); showDnssdControls(); } @@ -122,25 +122,25 @@ void KGameConnectWidget::slotGamesFound() bool autoselect=false; if (!d->mClientName->count()) autoselect=true; d->mClientName->clear(); - QStringList names; - QValueList<DNSSD::RemoteService::Ptr>::ConstIterator itEnd = d->mBrowser->services().end(); - for (QValueList<DNSSD::RemoteService::Ptr>::ConstIterator it = d->mBrowser->services().begin(); + TQStringList names; + TQValueList<DNSSD::RemoteService::Ptr>::ConstIterator itEnd = d->mBrowser->services().end(); + for (TQValueList<DNSSD::RemoteService::Ptr>::ConstIterator it = d->mBrowser->services().begin(); it!=itEnd; ++it) names << (*it)->serviceName(); d->mClientName->insertStringList(names); if (autoselect && d->mClientName->count()) slotGameSelected(0); } -void KGameConnectWidget::setName(const QString& name) +void KGameConnectWidget::setName(const TQString& name) { d->mServerName->setText(name); } -QString KGameConnectWidget::gameName() const +TQString KGameConnectWidget::gameName() const { return d->mServerName->text(); } -QString KGameConnectWidget::type() const +TQString KGameConnectWidget::type() const { return d->mType; } @@ -160,12 +160,12 @@ KGameConnectWidget::~KGameConnectWidget() delete d; } -QString KGameConnectWidget::host() const +TQString KGameConnectWidget::host() const { if (d->mHost->isEnabled()) { return d->mHost->text(); } else { - return QString::null; + return TQString::null; } } @@ -174,7 +174,7 @@ unsigned short int KGameConnectWidget::port() const return d->mPort->value(); } -void KGameConnectWidget::setHost(const QString& host) +void KGameConnectWidget::setHost(const TQString& host) { d->mHost->setText(host); } @@ -213,11 +213,11 @@ class KGameConnectDialogPrivate }; // buttonmask =Ok|Cancel -KGameConnectDialog::KGameConnectDialog(QWidget* parent,int buttonmask) : KDialogBase(Plain, +KGameConnectDialog::KGameConnectDialog(TQWidget* parent,int buttonmask) : KDialogBase(Plain, i18n("Network Game"),buttonmask , Ok, parent, 0, true, buttonmask!=0) { d = new KGameConnectDialogPrivate; - QVBoxLayout* vb = new QVBoxLayout(plainPage(), spacingHint()); + TQVBoxLayout* vb = new TQVBoxLayout(plainPage(), spacingHint()); d->mConnect = new KGameConnectWidget(plainPage()); vb->addWidget(d->mConnect); } @@ -228,7 +228,7 @@ KGameConnectDialog::~KGameConnectDialog() } int KGameConnectDialog::initConnection( unsigned short int& port, - QString& host, QWidget* parent, bool server) + TQString& host, TQWidget* parent, bool server) { KGameConnectDialog d(parent); d.setHost(host); @@ -240,14 +240,14 @@ int KGameConnectDialog::initConnection( unsigned short int& port, } int result = d.exec(); - if (result == QDialog::Accepted) { + if (result == TQDialog::Accepted) { host = d.host(); port = d.port(); } return result; } -QString KGameConnectDialog::host() const +TQString KGameConnectDialog::host() const { return d->mConnect->host(); } @@ -257,7 +257,7 @@ unsigned short int KGameConnectDialog::port() const return d->mConnect->port(); } -void KGameConnectDialog::setHost(const QString& host) +void KGameConnectDialog::setHost(const TQString& host) { d->mConnect->setHost(host); } diff --git a/libkdegames/kgame/dialogs/kgameconnectdialog.h b/libkdegames/kgame/dialogs/kgameconnectdialog.h index acbf21d2..fdb0be4f 100644 --- a/libkdegames/kgame/dialogs/kgameconnectdialog.h +++ b/libkdegames/kgame/dialogs/kgameconnectdialog.h @@ -30,19 +30,19 @@ class KGameConnectWidget : public QWidget { Q_OBJECT public: - KGameConnectWidget(QWidget* parent); + KGameConnectWidget(TQWidget* parent); virtual ~KGameConnectWidget(); /** * @param host The host to connect to by default **/ - void setHost(const QString& host); + void setHost(const TQString& host); /** - * @return The host to connect to or QString::null if the user wants to + * @return The host to connect to or TQString::null if the user wants to * be the MASTER **/ - QString host() const; + TQString host() const; /** * @param port The port that will be shown by default @@ -66,24 +66,24 @@ public: * It should be unique for application. * @since 3.4 **/ - void setType(const QString& type); + void setType(const TQString& type); /** * @return service type */ - QString type() const; + TQString type() const; /** * Set game name for publishing. * @param name Game name. Important only for server mode. If not * set hostname will be used. In case of name conflict -2, -3 and so on will be added to name. */ - void setName(const QString& name); + void setName(const TQString& name); /** * @return game name. */ - QString gameName() const; + TQString gameName() const; protected slots: /** @@ -108,7 +108,7 @@ private: * @short Dialog to ask for host and port * * This Dialog is used to create a game. You call initConnection(port, - * QString::null, parent, true) to create a network game (as a server) + * TQString::null, parent, true) to create a network game (as a server) * or initConnection(port, host, parent) to join a network game. * * @author Andreas Beckermann <b_mann@gmx.de> @@ -117,7 +117,7 @@ class KGameConnectDialog : public KDialogBase { Q_OBJECT public: - KGameConnectDialog(QWidget* parent = 0,int buttonmask=Ok|Cancel); + KGameConnectDialog(TQWidget* parent = 0,int buttonmask=Ok|Cancel); virtual ~KGameConnectDialog(); /** @@ -125,23 +125,23 @@ public: * server game, depending on user's choice. * @param port The port the user wants to connect to. * @param host The host the user wants to connect to. Will be - * QString::null if server game is chosen + * TQString::null if server game is chosen * @param parent The parent of the dialog * @param server True to create a network game per default, false to * join a game by default **/ - static int initConnection(unsigned short int& port, QString& host, QWidget* parent, bool server = false); + static int initConnection(unsigned short int& port, TQString& host, TQWidget* parent, bool server = false); /** * @param host The host to connect to by default **/ - void setHost(const QString& host); + void setHost(const TQString& host); /** - * @return The host to connect to or QString::null if the user wants to + * @return The host to connect to or TQString::null if the user wants to * be the MASTER **/ - QString host() const; + TQString host() const; /** * @param port The port that will be shown by default diff --git a/libkdegames/kgame/dialogs/kgamedebugdialog.cpp b/libkdegames/kgame/dialogs/kgamedebugdialog.cpp index b112b04c..09a35e56 100644 --- a/libkdegames/kgame/dialogs/kgamedebugdialog.cpp +++ b/libkdegames/kgame/dialogs/kgamedebugdialog.cpp @@ -32,11 +32,11 @@ #include <kpushbutton.h> #include <kstdguiitem.h> -#include <qlayout.h> -#include <qstring.h> -#include <qintdict.h> -#include <qlabel.h> -#include <qdatetime.h> +#include <tqlayout.h> +#include <tqstring.h> +#include <tqintdict.h> +#include <tqlabel.h> +#include <tqdatetime.h> #include <typeinfo> @@ -85,42 +85,42 @@ public: const KGame* mGame; - QFrame* mGamePage; + TQFrame* mGamePage; KListView* mGameProperties; - QListViewItem* mGameAddress; - QListViewItem* mGameId; - QListViewItem* mGameCookie; - QListViewItem* mGameMaster; - QListViewItem* mGameAdmin; - QListViewItem* mGameOffering; - QListViewItem* mGameStatus; - QListViewItem* mGameRunning; - QListViewItem* mGameMaxPlayers; - QListViewItem* mGameMinPlayers; - QListViewItem* mGamePlayerCount; + TQListViewItem* mGameAddress; + TQListViewItem* mGameId; + TQListViewItem* mGameCookie; + TQListViewItem* mGameMaster; + TQListViewItem* mGameAdmin; + TQListViewItem* mGameOffering; + TQListViewItem* mGameStatus; + TQListViewItem* mGameRunning; + TQListViewItem* mGameMaxPlayers; + TQListViewItem* mGameMinPlayers; + TQListViewItem* mGamePlayerCount; - QFrame* mPlayerPage; + TQFrame* mPlayerPage; KListBox* mPlayerList; KListView* mPlayerProperties; - QListViewItem* mPlayerAddress; - QListViewItem* mPlayerId; - QListViewItem* mPlayerName; - QListViewItem* mPlayerGroup; - QListViewItem* mPlayerUserId; - QListViewItem* mPlayerMyTurn; - QListViewItem* mPlayerAsyncInput; - QListViewItem* mPlayerKGameAddress; - QListViewItem* mPlayerVirtual; - QListViewItem* mPlayerActive; - QListViewItem* mPlayerRtti; - QListViewItem* mPlayerNetworkPriority; - - QFrame* mMessagePage; + TQListViewItem* mPlayerAddress; + TQListViewItem* mPlayerId; + TQListViewItem* mPlayerName; + TQListViewItem* mPlayerGroup; + TQListViewItem* mPlayerUserId; + TQListViewItem* mPlayerMyTurn; + TQListViewItem* mPlayerAsyncInput; + TQListViewItem* mPlayerKGameAddress; + TQListViewItem* mPlayerVirtual; + TQListViewItem* mPlayerActive; + TQListViewItem* mPlayerRtti; + TQListViewItem* mPlayerNetworkPriority; + + TQFrame* mMessagePage; KListView* mMessageList; KListBox* mHideIdList; }; -KGameDebugDialog::KGameDebugDialog(KGame* g, QWidget* parent, bool modal) : +KGameDebugDialog::KGameDebugDialog(KGame* g, TQWidget* parent, bool modal) : KDialogBase(Tabbed, i18n("KGame Debug Dialog"), Close, Close, parent, 0, modal, true) { @@ -141,8 +141,8 @@ KGameDebugDialog::~KGameDebugDialog() void KGameDebugDialog::initGamePage() { d->mGamePage = addPage(i18n("Debug &KGame")); - QVBoxLayout* topLayout = new QVBoxLayout(d->mGamePage, marginHint(), spacingHint()); - QHBoxLayout* layout = new QHBoxLayout(topLayout); + TQVBoxLayout* topLayout = new TQVBoxLayout(d->mGamePage, marginHint(), spacingHint()); + TQHBoxLayout* layout = new TQHBoxLayout(topLayout); KListView* v = new KListView(d->mGamePage); v->addColumn(i18n("Data")); @@ -155,38 +155,38 @@ void KGameDebugDialog::initGamePage() d->mGameProperties->addColumn(i18n("Policy")); layout->addWidget(d->mGameProperties); - QPushButton* b = new QPushButton(i18n("Update"), d->mGamePage); - connect(b, SIGNAL(pressed()), this, SLOT(slotUpdateGameData())); + TQPushButton* b = new TQPushButton(i18n("Update"), d->mGamePage); + connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotUpdateGameData())); topLayout->addWidget(b); // game data - d->mGameAddress = new QListViewItem(v, i18n("KGame Pointer")); - d->mGameId = new QListViewItem(v, i18n("Game ID")); - d->mGameCookie = new QListViewItem(v, i18n("Game Cookie")); - d->mGameMaster = new QListViewItem(v, i18n("Is Master")); - d->mGameAdmin = new QListViewItem(v, i18n("Is Admin")); - d->mGameOffering = new QListViewItem(v, i18n("Is Offering Connections")); - d->mGameStatus = new QListViewItem(v, i18n("Game Status")); - d->mGameRunning = new QListViewItem(v, i18n("Game is Running")); - d->mGameMaxPlayers = new QListViewItem(v, i18n("Maximal Players")); - d->mGameMinPlayers = new QListViewItem(v, i18n("Minimal Players")); - d->mGamePlayerCount = new QListViewItem(v, i18n("Players")); + d->mGameAddress = new TQListViewItem(v, i18n("KGame Pointer")); + d->mGameId = new TQListViewItem(v, i18n("Game ID")); + d->mGameCookie = new TQListViewItem(v, i18n("Game Cookie")); + d->mGameMaster = new TQListViewItem(v, i18n("Is Master")); + d->mGameAdmin = new TQListViewItem(v, i18n("Is Admin")); + d->mGameOffering = new TQListViewItem(v, i18n("Is Offering Connections")); + d->mGameStatus = new TQListViewItem(v, i18n("Game Status")); + d->mGameRunning = new TQListViewItem(v, i18n("Game is Running")); + d->mGameMaxPlayers = new TQListViewItem(v, i18n("Maximal Players")); + d->mGameMinPlayers = new TQListViewItem(v, i18n("Minimal Players")); + d->mGamePlayerCount = new TQListViewItem(v, i18n("Players")); } void KGameDebugDialog::initPlayerPage() { d->mPlayerPage = addPage(i18n("Debug &Players")); - QVBoxLayout* topLayout = new QVBoxLayout(d->mPlayerPage, marginHint(), spacingHint()); - QHBoxLayout* layout = new QHBoxLayout(topLayout); + TQVBoxLayout* topLayout = new TQVBoxLayout(d->mPlayerPage, marginHint(), spacingHint()); + TQHBoxLayout* layout = new TQHBoxLayout(topLayout); //TODO: connect to the KGame signals for joined/removed players!!! - QVBoxLayout* listLayout = new QVBoxLayout(layout); - QLabel* listLabel = new QLabel(i18n("Available Players"), d->mPlayerPage); + TQVBoxLayout* listLayout = new TQVBoxLayout(layout); + TQLabel* listLabel = new TQLabel(i18n("Available Players"), d->mPlayerPage); listLayout->addWidget(listLabel); d->mPlayerList = new KListBox(d->mPlayerPage); - connect(d->mPlayerList, SIGNAL(executed(QListBoxItem*)), this, SLOT(slotUpdatePlayerData(QListBoxItem*))); + connect(d->mPlayerList, TQT_SIGNAL(executed(TQListBoxItem*)), this, TQT_SLOT(slotUpdatePlayerData(TQListBoxItem*))); listLayout->addWidget(d->mPlayerList); - d->mPlayerList->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding)); + d->mPlayerList->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding)); KListView* v = new KListView(d->mPlayerPage); layout->addWidget(v); @@ -199,28 +199,28 @@ void KGameDebugDialog::initPlayerPage() d->mPlayerProperties->addColumn(i18n("Policy")); layout->addWidget(d->mPlayerProperties); - QPushButton* b = new QPushButton(i18n("Update"), d->mPlayerPage); - connect(b, SIGNAL(pressed()), this, SLOT(slotUpdatePlayerList())); + TQPushButton* b = new TQPushButton(i18n("Update"), d->mPlayerPage); + connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotUpdatePlayerList())); topLayout->addWidget(b); - d->mPlayerAddress = new QListViewItem(v, i18n("Player Pointer")); - d->mPlayerId = new QListViewItem(v, i18n("Player ID")); - d->mPlayerName = new QListViewItem(v, i18n("Player Name")); - d->mPlayerGroup = new QListViewItem(v, i18n("Player Group")); - d->mPlayerUserId = new QListViewItem(v, i18n("Player User ID")); - d->mPlayerMyTurn = new QListViewItem(v, i18n("My Turn")); - d->mPlayerAsyncInput = new QListViewItem(v, i18n("Async Input")); - d->mPlayerKGameAddress = new QListViewItem(v, i18n("KGame Address")); - d->mPlayerVirtual = new QListViewItem(v, i18n("Player is Virtual")); - d->mPlayerActive = new QListViewItem(v, i18n("Player is Active")); - d->mPlayerRtti = new QListViewItem(v, i18n("RTTI")); - d->mPlayerNetworkPriority = new QListViewItem(v, i18n("Network Priority")); + d->mPlayerAddress = new TQListViewItem(v, i18n("Player Pointer")); + d->mPlayerId = new TQListViewItem(v, i18n("Player ID")); + d->mPlayerName = new TQListViewItem(v, i18n("Player Name")); + d->mPlayerGroup = new TQListViewItem(v, i18n("Player Group")); + d->mPlayerUserId = new TQListViewItem(v, i18n("Player User ID")); + d->mPlayerMyTurn = new TQListViewItem(v, i18n("My Turn")); + d->mPlayerAsyncInput = new TQListViewItem(v, i18n("Async Input")); + d->mPlayerKGameAddress = new TQListViewItem(v, i18n("KGame Address")); + d->mPlayerVirtual = new TQListViewItem(v, i18n("Player is Virtual")); + d->mPlayerActive = new TQListViewItem(v, i18n("Player is Active")); + d->mPlayerRtti = new TQListViewItem(v, i18n("RTTI")); + d->mPlayerNetworkPriority = new TQListViewItem(v, i18n("Network Priority")); } void KGameDebugDialog::initMessagePage() { d->mMessagePage = addPage(i18n("Debug &Messages")); - QGridLayout* layout = new QGridLayout(d->mMessagePage, 11, 7, marginHint(), spacingHint()); + TQGridLayout* layout = new TQGridLayout(d->mMessagePage, 11, 7, marginHint(), spacingHint()); d->mMessageList = new KListView(d->mMessagePage); layout->addMultiCellWidget(d->mMessageList, 0, 9, 0, 3); d->mMessageList->addColumn(i18n("Time")); @@ -229,21 +229,21 @@ void KGameDebugDialog::initMessagePage() d->mMessageList->addColumn(i18n("Sender")); d->mMessageList->addColumn(i18n("ID - Text")); - QPushButton* hide = new QPushButton(i18n("&>>"), d->mMessagePage); - connect(hide, SIGNAL(pressed()), this, SLOT(slotHideId())); + TQPushButton* hide = new TQPushButton(i18n("&>>"), d->mMessagePage); + connect(hide, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotHideId())); layout->addWidget(hide, 4, 4); - QPushButton* show = new QPushButton(i18n("&<<"), d->mMessagePage); - connect(show, SIGNAL(pressed()), this, SLOT(slotShowId())); + TQPushButton* show = new TQPushButton(i18n("&<<"), d->mMessagePage); + connect(show, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotShowId())); layout->addWidget(show, 6, 4); - QLabel* l = new QLabel(i18n("Do not show IDs:"), d->mMessagePage); + TQLabel* l = new TQLabel(i18n("Do not show IDs:"), d->mMessagePage); layout->addMultiCellWidget(l, 0, 0, 5, 6); d->mHideIdList = new KListBox(d->mMessagePage); layout->addMultiCellWidget(d->mHideIdList, 1, 8, 5, 6); - QPushButton* clear = new KPushButton(KStdGuiItem::clear(), d->mMessagePage); - connect(clear, SIGNAL(pressed()), this, SLOT(slotClearMessages())); + TQPushButton* clear = new KPushButton(KStdGuiItem::clear(), d->mMessagePage); + connect(clear, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotClearMessages())); layout->addMultiCellWidget(clear, 10, 10, 0, 6); //TODO: "show all but..." and "show nothing but..." } @@ -292,12 +292,12 @@ void KGameDebugDialog::slotUpdatePlayerData() void KGameDebugDialog::slotUpdatePlayerList() { - QListBoxItem* i = d->mPlayerList->firstItem(); + TQListBoxItem* i = d->mPlayerList->firstItem(); for (; i; i = d->mPlayerList->firstItem()) { removePlayer(i); } - QPtrList<KPlayer> list = *d->mGame->playerList(); + TQPtrList<KPlayer> list = *d->mGame->playerList(); for (KPlayer* p = list.first(); p; p = list.next()) { addPlayer(p); } @@ -312,26 +312,26 @@ void KGameDebugDialog::slotUpdateGameData() clearGameData(); - QString buf; + TQString buf; buf.sprintf("%p", d->mGame); d->mGameAddress->setText(1, buf); - d->mGameId->setText(1, QString::number(d->mGame->gameId())); - d->mGameCookie->setText(1, QString::number(d->mGame->cookie())); + d->mGameId->setText(1, TQString::number(d->mGame->gameId())); + d->mGameCookie->setText(1, TQString::number(d->mGame->cookie())); d->mGameMaster->setText(1, d->mGame->isMaster() ? i18n("True") : i18n("False")); d->mGameAdmin->setText(1, d->mGame->isAdmin() ? i18n("True") : i18n("False")); d->mGameOffering->setText(1, d->mGame->isOfferingConnections() ? i18n("True") : i18n("False")); - d->mGameStatus->setText(1, QString::number(d->mGame->gameStatus())); + d->mGameStatus->setText(1, TQString::number(d->mGame->gameStatus())); d->mGameRunning->setText(1, d->mGame->isRunning() ? i18n("True") : i18n("False")); - d->mGameMaxPlayers->setText(1, QString::number(d->mGame->maxPlayers())); - d->mGameMinPlayers->setText(1, QString::number(d->mGame->minPlayers())); - d->mGamePlayerCount->setText(1, QString::number(d->mGame->playerCount())); + d->mGameMaxPlayers->setText(1, TQString::number(d->mGame->maxPlayers())); + d->mGameMinPlayers->setText(1, TQString::number(d->mGame->minPlayers())); + d->mGamePlayerCount->setText(1, TQString::number(d->mGame->playerCount())); //TODO ios KGamePropertyHandler* handler = d->mGame->dataHandler(); - QIntDictIterator<KGamePropertyBase> it(handler->dict()); + TQIntDictIterator<KGamePropertyBase> it(handler->dict()); while (it.current()) { - QString policy; + TQString policy; switch (it.current()->policy()) { case KGamePropertyBase::PolicyClean: policy = i18n("Clean"); @@ -347,7 +347,7 @@ void KGameDebugDialog::slotUpdateGameData() policy = i18n("Undefined"); break; } - (void) new QListViewItem(d->mGameProperties, + (void) new TQListViewItem(d->mGameProperties, handler->propertyName(it.current()->id()), handler->propertyValue(it.current()), policy); @@ -356,7 +356,7 @@ void KGameDebugDialog::slotUpdateGameData() } } -void KGameDebugDialog::slotUpdatePlayerData(QListBoxItem* item) +void KGameDebugDialog::slotUpdatePlayerData(TQListBoxItem* item) { if (!item || !d->mGame) { return; @@ -371,29 +371,29 @@ void KGameDebugDialog::slotUpdatePlayerData(QListBoxItem* item) clearPlayerData(); - QString buf; + TQString buf; buf.sprintf("%p", p); d->mPlayerAddress->setText(1, buf); - d->mPlayerId->setText(1, QString::number(p->id())); + d->mPlayerId->setText(1, TQString::number(p->id())); d->mPlayerName->setText(1, p->name()); d->mPlayerGroup->setText(1, p->group()); - d->mPlayerUserId->setText(1, QString::number(p->userId())); + d->mPlayerUserId->setText(1, TQString::number(p->userId())); d->mPlayerMyTurn->setText(1, p->myTurn() ? i18n("True") : i18n("False")); d->mPlayerAsyncInput->setText(1, p->asyncInput() ? i18n("True") : i18n("False")); buf.sprintf("%p", p->game()); d->mPlayerKGameAddress->setText(1, buf); d->mPlayerVirtual->setText(1, p->isVirtual() ? i18n("True") : i18n("False")); d->mPlayerActive->setText(1, p->isActive() ? i18n("True") : i18n("False")); - d->mPlayerRtti->setText(1, QString::number(p->rtti())); - d->mPlayerNetworkPriority->setText(1, QString::number(p->networkPriority())); + d->mPlayerRtti->setText(1, TQString::number(p->rtti())); + d->mPlayerNetworkPriority->setText(1, TQString::number(p->networkPriority())); //TODO ios // Properties KGamePropertyHandler * handler = p->dataHandler(); - QIntDictIterator<KGamePropertyBase> it((handler->dict())); + TQIntDictIterator<KGamePropertyBase> it((handler->dict())); while (it.current()) { - QString policy; + TQString policy; switch (it.current()->policy()) { case KGamePropertyBase::PolicyClean: policy = i18n("Clean"); @@ -409,7 +409,7 @@ void KGameDebugDialog::slotUpdatePlayerData(QListBoxItem* item) policy = i18n("Undefined"); break; } - (void)new QListViewItem(d->mPlayerProperties, + (void)new TQListViewItem(d->mPlayerProperties, handler->propertyName(it.current()->id()), handler->propertyValue(it.current()), policy); @@ -431,17 +431,17 @@ void KGameDebugDialog::setKGame(const KGame* g) d->mGame = g; if (g) { //TODO: connect to the KGame signals for joined/removed players!!! - connect(d->mGame, SIGNAL(destroyed()), this, SLOT(slotUnsetKGame())); + connect(d->mGame, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotUnsetKGame())); // connect(); - QPtrList<KPlayer> list = *d->mGame->playerList(); + TQPtrList<KPlayer> list = *d->mGame->playerList(); for (KPlayer* p = list.first(); p; p = list.next()) { addPlayer(p); } slotUpdateGameData(); - connect(d->mGame, SIGNAL(signalMessageUpdate(int, Q_UINT32, Q_UINT32)), this, SLOT(slotMessageUpdate(int, Q_UINT32, Q_UINT32))); + connect(d->mGame, TQT_SIGNAL(signalMessageUpdate(int, Q_UINT32, Q_UINT32)), this, TQT_SLOT(slotMessageUpdate(int, Q_UINT32, Q_UINT32))); } } @@ -461,11 +461,11 @@ void KGameDebugDialog::addPlayer(KPlayer* p) return; } - (void) new QListBoxText(d->mPlayerList, QString::number(p->id())); + (void) new TQListBoxText(d->mPlayerList, TQString::number(p->id())); //TODO connect to signals, like deleted/removed, ... } -void KGameDebugDialog::removePlayer(QListBoxItem* i) +void KGameDebugDialog::removePlayer(TQListBoxItem* i) { if (!i || !d->mGame) { return; @@ -486,7 +486,7 @@ void KGameDebugDialog::slotMessageUpdate(int msgid, Q_UINT32 receiver, Q_UINT32 if (!showId(msgid)) { return; } - QString msgidText = KGameMessage::messageId2Text(msgid); + TQString msgidText = KGameMessage::messageId2Text(msgid); if (msgidText.isNull()) { if (msgid > KGameMessage::IdUser) { emit signalRequestIdName(msgid-KGameMessage::IdUser, true, msgidText); @@ -497,9 +497,9 @@ void KGameDebugDialog::slotMessageUpdate(int msgid, Q_UINT32 receiver, Q_UINT32 msgidText = i18n("Unknown"); } } - (void) new QListViewItem( d->mMessageList, QTime::currentTime().toString(), - QString::number(msgid), QString::number(receiver), - QString::number(sender), msgidText); + (void) new TQListViewItem( d->mMessageList, TQTime::currentTime().toString(), + TQString::number(msgid), TQString::number(receiver), + TQString::number(sender), msgidText); } void KGameDebugDialog::slotClearMessages() @@ -509,7 +509,7 @@ void KGameDebugDialog::slotClearMessages() void KGameDebugDialog::slotShowId() { -/* QListBoxItem* i = d->mHideIdList->firstItem(); +/* TQListBoxItem* i = d->mHideIdList->firstItem(); for (; i; i = i->next()) { if (i->selected()) { d->mHideIdList->removeItem(i->); @@ -530,12 +530,12 @@ void KGameDebugDialog::slotHideId() if (!showId(msgid)) { return; } - (void)new QListBoxText(d->mHideIdList, QString::number(msgid)); + (void)new TQListBoxText(d->mHideIdList, TQString::number(msgid)); } bool KGameDebugDialog::showId(int msgid) { - QListBoxItem* i = d->mHideIdList->firstItem(); + TQListBoxItem* i = d->mHideIdList->firstItem(); for (; i; i = i->next()) { if (i->text().toInt() == msgid) { return false; diff --git a/libkdegames/kgame/dialogs/kgamedebugdialog.h b/libkdegames/kgame/dialogs/kgamedebugdialog.h index 65afc92a..57f20c34 100644 --- a/libkdegames/kgame/dialogs/kgamedebugdialog.h +++ b/libkdegames/kgame/dialogs/kgamedebugdialog.h @@ -35,7 +35,7 @@ class KDE_EXPORT KGameDebugDialog : public KDialogBase { Q_OBJECT public: - KGameDebugDialog(KGame* g, QWidget* parent, bool modal = false); + KGameDebugDialog(KGame* g, TQWidget* parent, bool modal = false); ~KGameDebugDialog(); /** @@ -89,7 +89,7 @@ signals: * KGameMessage::GameMessageIds couldn't be found. * @param name The name of the msgid. You have to fill this! **/ - void signalRequestIdName(int messageid, bool userid, QString& name); + void signalRequestIdName(int messageid, bool userid, TQString& name); protected: void clearPages(); @@ -113,7 +113,7 @@ protected: /** * Remove a player from the list **/ - void removePlayer(QListBoxItem* item); + void removePlayer(TQListBoxItem* item); /** * @return Whether messages with this msgid shall be displayed or not @@ -123,10 +123,10 @@ protected: protected slots: /** * Update the data of the player specified in item - * @param item The @ref QListBoxItem of the player to be updated. Note + * @param item The @ref TQListBoxItem of the player to be updated. Note * that the text of this item MUST be the ID of the player **/ - void slotUpdatePlayerData(QListBoxItem* item); + void slotUpdatePlayerData(TQListBoxItem* item); void slotShowId(); void slotHideId(); diff --git a/libkdegames/kgame/dialogs/kgamedialog.cpp b/libkdegames/kgame/dialogs/kgamedialog.cpp index dc564b8e..c03df4ff 100644 --- a/libkdegames/kgame/dialogs/kgamedialog.cpp +++ b/libkdegames/kgame/dialogs/kgamedialog.cpp @@ -18,8 +18,8 @@ Boston, MA 02110-1301, USA. */ -#include <qlayout.h> -#include <qvbox.h> +#include <tqlayout.h> +#include <tqvbox.h> #include <klocale.h> @@ -48,31 +48,31 @@ public: mGame = 0; } - QVBox* mGamePage; - QVBox* mNetworkPage; - QVBox* mMsgServerPage;// unused here? - QVBoxLayout* mTopLayout; + TQVBox* mGamePage; + TQVBox* mNetworkPage; + TQVBox* mMsgServerPage;// unused here? + TQVBoxLayout* mTopLayout; KGameDialogNetworkConfig* mNetworkConfig; KGameDialogGeneralConfig* mGameConfig; // a list of all config widgets added to this dialog - QPtrList<KGameDialogConfig> mConfigWidgets; + TQPtrList<KGameDialogConfig> mConfigWidgets; // just pointers: KPlayer* mOwner; KGame* mGame; }; -KGameDialog::KGameDialog(KGame* g, KPlayer* owner, const QString& title, - QWidget* parent, bool modal) +KGameDialog::KGameDialog(KGame* g, KPlayer* owner, const TQString& title, + TQWidget* parent, bool modal) : KDialogBase(Tabbed, title, Ok|Default|Apply, Ok, parent, 0, modal, true) { init(g, owner); } -KGameDialog::KGameDialog(KGame* g, KPlayer* owner, const QString& title, - QWidget* parent, long initConfigs, int chatMsgId, bool modal) +KGameDialog::KGameDialog(KGame* g, KPlayer* owner, const TQString& title, + TQWidget* parent, long initConfigs, int chatMsgId, bool modal) : KDialogBase(Tabbed, title, Ok|Default|Apply, Ok, parent, 0, modal, true) { @@ -165,7 +165,7 @@ void KGameDialog::addMsgServerConfig(KGameDialogMsgServerConfig* msgConf) d->mMsgServerPage = addConfigPage(msgConf, i18n("&Message Server")); } -void KGameDialog::addChatWidget(KGameDialogChatConfig* chat, QVBox* parent) +void KGameDialog::addChatWidget(KGameDialogChatConfig* chat, TQVBox* parent) { if (!chat) { return; @@ -180,7 +180,7 @@ void KGameDialog::addChatWidget(KGameDialogChatConfig* chat, QVBox* parent) addConfigWidget(chat, parent); } -void KGameDialog::addConnectionList(KGameDialogConnectionConfig* c, QVBox* parent) +void KGameDialog::addConnectionList(KGameDialogConnectionConfig* c, TQVBox* parent) { if (!c) { return; @@ -195,9 +195,9 @@ void KGameDialog::addConnectionList(KGameDialogConnectionConfig* c, QVBox* paren addConfigWidget(c, parent); } -QVBox *KGameDialog::configPage(ConfigOptions which) +TQVBox *KGameDialog::configPage(ConfigOptions which) { - QVBox *box = 0; + TQVBox *box = 0; switch(which) { case NetworkConfig: @@ -215,18 +215,18 @@ QVBox *KGameDialog::configPage(ConfigOptions which) return box; } -QVBox* KGameDialog::addConfigPage(KGameDialogConfig* widget, const QString& title) +TQVBox* KGameDialog::addConfigPage(KGameDialogConfig* widget, const TQString& title) { if (!widget) { kdError(11001) << "Cannot add NULL config widget" << endl; return 0; } - QVBox* page = addVBoxPage(title); + TQVBox* page = addVBoxPage(title); addConfigWidget(widget, page); return page; } -void KGameDialog::addConfigWidget(KGameDialogConfig* widget, QWidget* parent) +void KGameDialog::addConfigWidget(KGameDialogConfig* widget, TQWidget* parent) { if (!widget) { kdError(11001) << "Cannot add NULL config widget" << endl; @@ -237,9 +237,9 @@ void KGameDialog::addConfigWidget(KGameDialogConfig* widget, QWidget* parent) return; } // kdDebug(11001) << "reparenting widget" << endl; - widget->reparent(parent, QPoint(0,0)); + widget->reparent(parent, TQPoint(0,0)); d->mConfigWidgets.append(widget); - connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(slotRemoveConfigWidget(QObject*))); + connect(widget, TQT_SIGNAL(destroyed(TQObject*)), this, TQT_SLOT(slotRemoveConfigWidget(TQObject*))); if (!d->mGame) { kdWarning(11001) << "No game has been set!" << endl; } else { @@ -278,7 +278,7 @@ void KGameDialog::slotDefault() void KGameDialog::slotOk() { slotApply(); - QDialog::accept(); + TQDialog::accept(); } void KGameDialog::setOwner(KPlayer* owner) @@ -306,9 +306,9 @@ void KGameDialog::setKGame(KGame* g) } if (d->mGame) { setAdmin(d->mGame->isAdmin()); - connect(d->mGame, SIGNAL(destroyed()), this, SLOT(slotUnsetKGame())); - connect(d->mGame, SIGNAL(signalAdminStatusChanged(bool)), - this, SLOT(setAdmin(bool))); + connect(d->mGame, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotUnsetKGame())); + connect(d->mGame, TQT_SIGNAL(signalAdminStatusChanged(bool)), + this, TQT_SLOT(setAdmin(bool))); } } @@ -340,7 +340,7 @@ void KGameDialog::submitToKGame() } } -void KGameDialog::slotRemoveConfigWidget(QObject* configWidget) +void KGameDialog::slotRemoveConfigWidget(TQObject* configWidget) { d->mConfigWidgets.removeRef((KGameDialogConfig*)configWidget); } diff --git a/libkdegames/kgame/dialogs/kgamedialog.h b/libkdegames/kgame/dialogs/kgamedialog.h index f7a0c6e5..f3256d8a 100644 --- a/libkdegames/kgame/dialogs/kgamedialog.h +++ b/libkdegames/kgame/dialogs/kgamedialog.h @@ -97,8 +97,8 @@ public: * @param parent The parent of the dialog * @param modal Whether the dialog is modal or not **/ - KGameDialog(KGame* g, KPlayer* owner, const QString& title, - QWidget* parent, bool modal = false); + KGameDialog(KGame* g, KPlayer* owner, const TQString& title, + TQWidget* parent, bool modal = false); /** * Create a KGameDialog with the standard configuration widgets. This @@ -129,8 +129,8 @@ public: * @param chatMsgId The ID of Chat messages. See KGameChat. Unused * if initConfigs = false **/ - KGameDialog(KGame* g, KPlayer* owner, const QString& title, - QWidget* parent, long initConfigs = AllConfig, + KGameDialog(KGame* g, KPlayer* owner, const TQString& title, + TQWidget* parent, long initConfigs = AllConfig, int chatMsgId = 15432, bool modal = false); virtual ~KGameDialog(); @@ -175,7 +175,7 @@ public: * already added config widget. Note that the game page will be used * if parent is 0. **/ - void addChatWidget(KGameDialogChatConfig* chat, QVBox* parent = 0); + void addChatWidget(KGameDialogChatConfig* chat, TQVBox* parent = 0); /** * Add a connection list to the dialog. The list consists of a @@ -189,7 +189,7 @@ public: * @param parent The parent of the widget. If 0 the networkConfig * page is used. **/ - void addConnectionList(KGameDialogConnectionConfig* c, QVBox* parent = 0); + void addConnectionList(KGameDialogConnectionConfig* c, TQVBox* parent = 0); /** * Add a new page to the dialog. The page will contain you new config @@ -201,13 +201,13 @@ public: * @param title The title of the newly added page. * @return The newly added page which contains your config widget. **/ - QVBox* addConfigPage(KGameDialogConfig* widget, const QString& title); + TQVBox* addConfigPage(KGameDialogConfig* widget, const TQString& title); /** - * @return The QVBox of the given key, The key is from ConfigOptions + * @return The TQVBox of the given key, The key is from ConfigOptions * Note that not all are supported yet **/ - QVBox *configPage(ConfigOptions which); + TQVBox *configPage(ConfigOptions which); /** * @return The default netowrk config. Note that this always returns 0 if @@ -227,7 +227,7 @@ public: * it to the same page. Just use the returned page of * addConfigPage. **/ - void addConfigWidget(KGameDialogConfig* widget, QWidget* parent); + void addConfigWidget(KGameDialogConfig* widget, TQWidget* parent); /** * Used to add the main network config widget in a new page. Use this to @@ -275,7 +275,7 @@ protected: protected slots: /** * Called when the user clicks on Ok. Calls slotApply and - * QDialog::accept() + * TQDialog::accept() **/ virtual void slotOk(); @@ -306,9 +306,9 @@ protected slots: /** * Remove a config widget from the widget list. - * @see QObject::destroyed + * @see TQObject::destroyed **/ - void slotRemoveConfigWidget(QObject* configWidget); + void slotRemoveConfigWidget(TQObject* configWidget); private: void init(KGame*, KPlayer*); diff --git a/libkdegames/kgame/dialogs/kgamedialogconfig.cpp b/libkdegames/kgame/dialogs/kgamedialogconfig.cpp index 27f91cd1..44eaa3c7 100644 --- a/libkdegames/kgame/dialogs/kgamedialogconfig.cpp +++ b/libkdegames/kgame/dialogs/kgamedialogconfig.cpp @@ -31,13 +31,13 @@ #include <klistbox.h> #include <kmessagebox.h> -#include <qlayout.h> -#include <qhgroupbox.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qlineedit.h> -#include <qvbox.h> -#include <qptrdict.h> +#include <tqlayout.h> +#include <tqhgroupbox.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqlineedit.h> +#include <tqvbox.h> +#include <tqptrdict.h> #include "kgamedialogconfig.moc" @@ -57,7 +57,7 @@ public: KPlayer* mOwner; }; -KGameDialogConfig::KGameDialogConfig(QWidget* parent) : QWidget(parent) +KGameDialogConfig::KGameDialogConfig(TQWidget* parent) : TQWidget(parent) { d = new KGameDialogConfigPrivate; } @@ -104,42 +104,42 @@ public: } - // QPushButton* mInitConnection; - QHGroupBox* mInitConnection; - QLabel* mNetworkLabel; - QPushButton *mDisconnectButton; + // TQPushButton* mInitConnection; + TQHGroupBox* mInitConnection; + TQLabel* mNetworkLabel; + TQPushButton *mDisconnectButton; bool mDefaultServer; - QString mDefaultHost; + TQString mDefaultHost; unsigned short int mDefaultPort; KGameConnectWidget *mConnect; }; -KGameDialogNetworkConfig::KGameDialogNetworkConfig(QWidget* parent) +KGameDialogNetworkConfig::KGameDialogNetworkConfig(TQWidget* parent) : KGameDialogConfig(parent) { // kdDebug(11001) << k_funcinfo << ": this=" << this << endl; d = new KGameDialogNetworkConfigPrivate(); - QVBoxLayout* topLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "toplayout"); + TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "toplayout"); - QHBoxLayout *hb = new QHBoxLayout(topLayout, KDialog::spacingHint()); + TQHBoxLayout *hb = new TQHBoxLayout(topLayout, KDialog::spacingHint()); - d->mNetworkLabel = new QLabel(this); + d->mNetworkLabel = new TQLabel(this); hb->addWidget(d->mNetworkLabel); - d->mDisconnectButton=new QPushButton(i18n("Disconnect"),this); - connect(d->mDisconnectButton, SIGNAL(clicked()), this, SLOT(slotExitConnection())); + d->mDisconnectButton=new TQPushButton(i18n("Disconnect"),this); + connect(d->mDisconnectButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExitConnection())); hb->addWidget(d->mDisconnectButton); - d->mInitConnection = new QHGroupBox(i18n("Network Configuration"), this); + d->mInitConnection = new TQHGroupBox(i18n("Network Configuration"), this); topLayout->addWidget(d->mInitConnection); d->mConnect = new KGameConnectWidget(d->mInitConnection); - connect(d->mConnect, SIGNAL(signalNetworkSetup()), this, SLOT(slotInitConnection())); - connect(d->mConnect, SIGNAL(signalServerTypeChanged(int)), - this, SIGNAL(signalServerTypeChanged(int))); + connect(d->mConnect, TQT_SIGNAL(signalNetworkSetup()), this, TQT_SLOT(slotInitConnection())); + connect(d->mConnect, TQT_SIGNAL(signalServerTypeChanged(int)), + this, TQT_SIGNAL(signalServerTypeChanged(int))); // Needs to be AFTER the creation of the dialogs setConnected(false); @@ -165,7 +165,7 @@ void KGameDialogNetworkConfig::slotInitConnection() bool connected = false; bool master = true; unsigned short int port = d->mConnect->port(); - QString host = d->mConnect->host(); + TQString host = d->mConnect->host(); if (host.isNull()) { master = true; @@ -180,8 +180,8 @@ void KGameDialogNetworkConfig::slotInitConnection() } // We need to learn about failed connections if (game()) { - connect(game(), SIGNAL(signalConnectionBroken()), - this, SLOT(slotConnectionBroken())); + connect(game(), TQT_SIGNAL(signalConnectionBroken()), + this, TQT_SLOT(slotConnectionBroken())); } } setConnected(connected, master); @@ -225,7 +225,7 @@ void KGameDialogNetworkConfig::setKGame(KGame* g) setConnected(game()->isNetwork(), game()->isMaster()); } -void KGameDialogNetworkConfig::setDefaultNetworkInfo(const QString& host, unsigned short int port,bool server) +void KGameDialogNetworkConfig::setDefaultNetworkInfo(const TQString& host, unsigned short int port,bool server) { d->mDefaultPort = port; d->mDefaultHost = host; @@ -240,7 +240,7 @@ void KGameDialogNetworkConfig::setDefaultNetworkInfo(const QString& host, unsign } } -void KGameDialogNetworkConfig::setDiscoveryInfo(const QString& type, const QString& name) +void KGameDialogNetworkConfig::setDiscoveryInfo(const TQString& type, const TQString& name) { d->mConnect->setType(type); d->mConnect->setName(name); @@ -256,26 +256,26 @@ public: mName = 0; } - QLineEdit* mName; + TQLineEdit* mName; - QVBoxLayout* mTopLayout; + TQVBoxLayout* mTopLayout; }; -KGameDialogGeneralConfig::KGameDialogGeneralConfig(QWidget* parent, bool initializeGUI) +KGameDialogGeneralConfig::KGameDialogGeneralConfig(TQWidget* parent, bool initializeGUI) : KGameDialogConfig(parent) { // kdDebug(11001) << k_funcinfo << ": this=" << this << endl; d = new KGameDialogGeneralConfigPrivate; if (initializeGUI) { - d->mTopLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + d->mTopLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); d->mTopLayout->setAutoAdd(true); - QWidget* nameWidget = new QWidget(this); - QHBoxLayout* l = new QHBoxLayout(nameWidget); - QLabel* nameLabel = new QLabel(i18n("Your name:"), nameWidget); + TQWidget* nameWidget = new TQWidget(this); + TQHBoxLayout* l = new TQHBoxLayout(nameWidget); + TQLabel* nameLabel = new TQLabel(i18n("Your name:"), nameWidget); l->addWidget(nameLabel); - d->mName = new QLineEdit(nameWidget); + d->mName = new TQLineEdit(nameWidget); l->addWidget(d->mName); } } @@ -286,16 +286,16 @@ KGameDialogGeneralConfig::~KGameDialogGeneralConfig() delete d; } -void KGameDialogGeneralConfig::setPlayerName(const QString& name) +void KGameDialogGeneralConfig::setPlayerName(const TQString& name) { if (d->mName) { d->mName->setText(name); } } -QString KGameDialogGeneralConfig::playerName() const +TQString KGameDialogGeneralConfig::playerName() const { - return d->mName ? d->mName->text() : QString::null; + return d->mName ? d->mName->text() : TQString::null; } void KGameDialogGeneralConfig::setOwner(KPlayer* p) @@ -309,8 +309,8 @@ void KGameDialogGeneralConfig::setOwner(KPlayer* p) // maybe call hide() return; } - connect(owner(), SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)), - this, SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*))); + connect(owner(), TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)), + this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*))); setPlayerName(p->name()); //TODO: connect signalPropertyChanged and check for playername changes! } @@ -373,29 +373,29 @@ public: noMaster = 0; } - QVBoxLayout* senderLayout; - QHBoxLayout* localLayout; + TQVBoxLayout* senderLayout; + TQHBoxLayout* localLayout; - QPushButton* changeMaxClients; - QPushButton* changeAdmin; - QPushButton* removeClient; - QLabel* noAdmin; + TQPushButton* changeMaxClients; + TQPushButton* changeAdmin; + TQPushButton* removeClient; + TQLabel* noAdmin; - QLabel* noMaster; + TQLabel* noMaster; }; // TODO: change ADMIN ID, remove CLIENTS, change MAXCLIENTS // we do everything here with QPushButtons as we want to wait a moment before // continuing - the message must be sent over network first -KGameDialogMsgServerConfig::KGameDialogMsgServerConfig(QWidget* parent) +KGameDialogMsgServerConfig::KGameDialogMsgServerConfig(TQWidget* parent) : KGameDialogConfig(parent) { d = new KGameDialogMsgServerConfigPrivate; - QVBoxLayout* topLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - d->senderLayout = new QVBoxLayout(topLayout); - d->localLayout = new QHBoxLayout(topLayout); + TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + d->senderLayout = new TQVBoxLayout(topLayout); + d->localLayout = new TQHBoxLayout(topLayout); } KGameDialogMsgServerConfig::~KGameDialogMsgServerConfig() @@ -408,7 +408,7 @@ void KGameDialogMsgServerConfig::setKGame(KGame* g) { KGameDialogConfig::setKGame(g); //TODO display the ID of the admin if we aren't - // connect(g, SIGNAL(signalAdminChanged(int)), this, SLOT(slotChangeIsAdmin(int)));//TODO + // connect(g, TQT_SIGNAL(signalAdminChanged(int)), this, TQT_SLOT(slotChangeIsAdmin(int)));//TODO if (!game()) { // we cannot do anything without a KGame object! setAdmin(false); @@ -430,17 +430,17 @@ void KGameDialogMsgServerConfig::slotChangeMaxClients() return; } int max; -// edit->setText(QString::number()); // current max clients! //TODO +// edit->setText(TQString::number()); // current max clients! //TODO - QDialog* dialog = new QDialog(); + TQDialog* dialog = new TQDialog(); dialog->setCaption(i18n("Maximal Number of Clients")); - QHBoxLayout* l = new QHBoxLayout(dialog, KDialog::marginHint(), KDialog::spacingHint()); + TQHBoxLayout* l = new TQHBoxLayout(dialog, KDialog::marginHint(), KDialog::spacingHint()); l->setAutoAdd(true); - (void) new QLabel(i18n("Maximal number of clients (-1 = infinite):"), dialog); - QLineEdit* edit = new QLineEdit(dialog);//TODO: use KIntNumInput -// edit->setText(QString::number(max)); // current max clients! //TODO - if (dialog->exec() == QDialog::Accepted) { + (void) new TQLabel(i18n("Maximal number of clients (-1 = infinite):"), dialog); + TQLineEdit* edit = new TQLineEdit(dialog);//TODO: use KIntNumInput +// edit->setText(TQString::number(max)); // current max clients! //TODO + if (dialog->exec() == TQDialog::Accepted) { bool ok; max = edit->text().toInt(&ok); if (ok) { @@ -487,12 +487,12 @@ void KGameDialogMsgServerConfig::setAdmin(bool a) delete d->noAdmin; d->noAdmin = 0; } - d->changeMaxClients = new QPushButton(i18n("Change Maximal Number of Clients"), this); - connect(d->changeMaxClients, SIGNAL(pressed()), this, SLOT(slotChangeMaxClients())); - d->changeAdmin = new QPushButton(i18n("Change Admin"), this); - connect(d->changeAdmin, SIGNAL(pressed()), this, SLOT(slotChangeAdmin())); - d->removeClient = new QPushButton(i18n("Remove Client with All Players"), this); - connect(d->removeClient, SIGNAL(pressed()), this, SLOT(slotRemoveClient())); + d->changeMaxClients = new TQPushButton(i18n("Change Maximal Number of Clients"), this); + connect(d->changeMaxClients, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotChangeMaxClients())); + d->changeAdmin = new TQPushButton(i18n("Change Admin"), this); + connect(d->changeAdmin, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotChangeAdmin())); + d->removeClient = new TQPushButton(i18n("Remove Client with All Players"), this); + connect(d->removeClient, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotRemoveClient())); d->senderLayout->addWidget(d->changeMaxClients); d->senderLayout->addWidget(d->changeAdmin); d->senderLayout->addWidget(d->removeClient); @@ -509,7 +509,7 @@ void KGameDialogMsgServerConfig::setAdmin(bool a) delete d->removeClient; d->removeClient = 0; } - d->noAdmin = new QLabel(i18n("Only the admin can configure the message server!"), this); + d->noAdmin = new TQLabel(i18n("Only the admin can configure the message server!"), this); d->senderLayout->addWidget(d->noAdmin); } } @@ -520,7 +520,7 @@ void KGameDialogMsgServerConfig::setHasMsgServer(bool has) if (!has) { // delete all inputs if (!d->noMaster) { - d->noMaster = new QLabel(i18n("You don't own the message server"), this); + d->noMaster = new TQLabel(i18n("You don't own the message server"), this); d->localLayout->addWidget(d->noMaster); } return; @@ -547,13 +547,13 @@ public: KGameChat* mChat; }; -KGameDialogChatConfig::KGameDialogChatConfig(int chatMsgId, QWidget* parent) +KGameDialogChatConfig::KGameDialogChatConfig(int chatMsgId, TQWidget* parent) : KGameDialogConfig(parent) { d = new KGameDialogChatConfigPrivate; - QVBoxLayout* topLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); topLayout->setAutoAdd(true); - QHGroupBox* b = new QHGroupBox(i18n("Chat"), this); + TQHGroupBox* b = new TQHGroupBox(i18n("Chat"), this); d->mChat = new KGameChat(0, chatMsgId, b); } @@ -595,18 +595,18 @@ public: mPlayerBox = 0; } - QPtrDict<KPlayer> mItem2Player; + TQPtrDict<KPlayer> mItem2Player; KListBox* mPlayerBox; }; -KGameDialogConnectionConfig::KGameDialogConnectionConfig(QWidget* parent) +KGameDialogConnectionConfig::KGameDialogConnectionConfig(TQWidget* parent) : KGameDialogConfig(parent) { //TODO: prevent player to ban himself d = new KGameDialogConnectionConfigPrivate; - QVBoxLayout* topLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); topLayout->setAutoAdd(true); - QHGroupBox* b = new QHGroupBox(i18n("Connected Players"), this); + TQHGroupBox* b = new TQHGroupBox(i18n("Connected Players"), this); d->mPlayerBox = new KListBox(b); setMinimumHeight(100); } @@ -627,10 +627,10 @@ void KGameDialogConnectionConfig::setKGame(KGame* g) slotClearPlayers(); if (game()) { // react to changes in KGame::playerList() - connect(game(), SIGNAL(signalPlayerJoinedGame(KPlayer*)), - this, SLOT(slotPlayerJoinedGame(KPlayer*))); - connect(game(), SIGNAL(signalPlayerLeftGame(KPlayer*)), - this, SLOT(slotPlayerLeftGame(KPlayer*))); + connect(game(), TQT_SIGNAL(signalPlayerJoinedGame(KPlayer*)), + this, TQT_SLOT(slotPlayerJoinedGame(KPlayer*))); + connect(game(), TQT_SIGNAL(signalPlayerLeftGame(KPlayer*)), + this, TQT_SLOT(slotPlayerLeftGame(KPlayer*))); KGame::KGamePlayerList l = *game()->playerList(); for (KPlayer* p = l.first(); p; p = l.next()) { @@ -650,21 +650,21 @@ void KGameDialogConnectionConfig::setAdmin(bool a) return; } if (admin()) { - disconnect(game(), SIGNAL(executed(QListBoxItem*)), this, 0); + disconnect(game(), TQT_SIGNAL(executed(TQListBoxItem*)), this, 0); } KGameDialogConfig::setAdmin(a); if (admin()) { - connect(d->mPlayerBox, SIGNAL(executed(QListBoxItem*)), this, - SLOT(slotKickPlayerOut(QListBoxItem*))); + connect(d->mPlayerBox, TQT_SIGNAL(executed(TQListBoxItem*)), this, + TQT_SLOT(slotKickPlayerOut(TQListBoxItem*))); } } -QListBoxItem* KGameDialogConnectionConfig::item(KPlayer* p) const +TQListBoxItem* KGameDialogConnectionConfig::item(KPlayer* p) const { - QPtrDictIterator<KPlayer> it(d->mItem2Player); + TQPtrDictIterator<KPlayer> it(d->mItem2Player); while (it.current()) { if (it.current() == p) { - return (QListBoxItem*)it.currentKey(); + return (TQListBoxItem*)it.currentKey(); } ++it; } @@ -673,7 +673,7 @@ QListBoxItem* KGameDialogConnectionConfig::item(KPlayer* p) const void KGameDialogConnectionConfig::slotClearPlayers() { - QPtrDictIterator<KPlayer> it(d->mItem2Player); + TQPtrDictIterator<KPlayer> it(d->mItem2Player); while (it.current()) { slotPlayerLeftGame(it.current()); ++it; @@ -700,12 +700,12 @@ void KGameDialogConnectionConfig::slotPlayerJoinedGame(KPlayer* p) return; } kdDebug(11001) << k_funcinfo << ": add player " << p->id() << endl; - QListBoxText* t = new QListBoxText(p->name()); + TQListBoxText* t = new TQListBoxText(p->name()); d->mItem2Player.insert(t, p); d->mPlayerBox->insertItem(t); - connect(p, SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)), - this, SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*))); + connect(p, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)), + this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*))); } @@ -722,7 +722,7 @@ void KGameDialogConnectionConfig::slotPlayerLeftGame(KPlayer* p) } -void KGameDialogConnectionConfig::slotKickPlayerOut(QListBoxItem* item) +void KGameDialogConnectionConfig::slotKickPlayerOut(TQListBoxItem* item) { kdDebug(11001) << "kick player out" << endl; KPlayer* p = d->mItem2Player[item]; @@ -744,7 +744,7 @@ void KGameDialogConnectionConfig::slotKickPlayerOut(QListBoxItem* item) } if (KMessageBox::questionYesNo(this, i18n("Do you want to ban player \"%1\" from the game?").arg( - p->name()), QString::null, i18n("Ban Player"), i18n("Do Not Ban")) == KMessageBox::Yes) { + p->name()), TQString::null, i18n("Ban Player"), i18n("Do Not Ban")) == KMessageBox::Yes) { kdDebug(11001) << "will remove player " << p << endl; game()->removePlayer(p); // d->mPlayerBox->removeItem(d->mPlayerBox->index(item)); // should be done by signalPlayerLeftGame @@ -756,15 +756,15 @@ void KGameDialogConnectionConfig::slotKickPlayerOut(QListBoxItem* item) void KGameDialogConnectionConfig::slotPropertyChanged(KGamePropertyBase* prop, KPlayer* player) { if(prop->id() == KGamePropertyBase::IdName) { - QListBoxText* old = 0; - QPtrDictIterator<KPlayer> it(d->mItem2Player); + TQListBoxText* old = 0; + TQPtrDictIterator<KPlayer> it(d->mItem2Player); while (it.current() && !old) { if (it.current() == player) { - old = (QListBoxText*)it.currentKey(); + old = (TQListBoxText*)it.currentKey(); } ++it; } - QListBoxText* t = new QListBoxText(player->name()); + TQListBoxText* t = new TQListBoxText(player->name()); d->mPlayerBox->changeItem(t, d->mPlayerBox->index(old)); d->mItem2Player.remove(old); d->mItem2Player.insert(t, player); diff --git a/libkdegames/kgame/dialogs/kgamedialogconfig.h b/libkdegames/kgame/dialogs/kgamedialogconfig.h index b7d30b23..e1b592af 100644 --- a/libkdegames/kgame/dialogs/kgamedialogconfig.h +++ b/libkdegames/kgame/dialogs/kgamedialogconfig.h @@ -28,7 +28,7 @@ #ifndef __KGAMEDIALOGCONFIG_H__ #define __KGAMEDIALOGCONFIG_H__ -#include <qwidget.h> +#include <tqwidget.h> #include <kdemacros.h> class QGridLayout; @@ -52,7 +52,7 @@ class KDE_EXPORT KGameDialogConfig : public QWidget { Q_OBJECT public: - KGameDialogConfig(QWidget* parent = 0); + KGameDialogConfig(TQWidget* parent = 0); virtual ~KGameDialogConfig(); /** @@ -137,7 +137,7 @@ private: * * It currently contains a line edit for the name of the player only. You can * add widgets by using the KGameDialogGeneralConfig as parent parameter as it - * uses QLayout::autoAdd == true. + * uses TQLayout::autoAdd == true. * @author Andreas Beckermann <b_mann@gmx.de> **/ class KGameDialogGeneralConfigPrivate; @@ -151,7 +151,7 @@ public: * * If you just want to add more widgets you can just create your widgets * with the KGameDialogGeneralConfig as parent as it uses - * QLayout::setAutoAdd(true). + * TQLayout::setAutoAdd(true). * * @param parent Parent widget for this dialog. * @param initializeGUI If you really don't want to use the @@ -160,7 +160,7 @@ public: * will exist anymore. * **/ - KGameDialogGeneralConfig(QWidget* parent = 0, bool initializeGUI = true); + KGameDialogGeneralConfig(TQWidget* parent = 0, bool initializeGUI = true); virtual ~KGameDialogGeneralConfig(); /** @@ -199,9 +199,9 @@ protected slots: void slotPropertyChanged(KGamePropertyBase*, KPlayer*); protected: - void setPlayerName(const QString& name); + void setPlayerName(const TQString& name); - QString playerName() const; + TQString playerName() const; private: KGameDialogGeneralConfigPrivate* d; @@ -212,7 +212,7 @@ class KDE_EXPORT KGameDialogNetworkConfig : public KGameDialogConfig { Q_OBJECT public: - KGameDialogNetworkConfig(QWidget* parent = 0); + KGameDialogNetworkConfig(TQWidget* parent = 0); virtual ~KGameDialogNetworkConfig(); @@ -238,7 +238,7 @@ public: * @param port The default port to connect to / listen on * @param host The default host to connect to **/ - void setDefaultNetworkInfo(const QString& host, unsigned short int port,bool server=true); + void setDefaultNetworkInfo(const TQString& host, unsigned short int port,bool server=true); /** * Set service type that will be published or browsed for and game name that will be displayed in @@ -248,7 +248,7 @@ public: * @param type Service type (something like _kwin4._tcp). It should be unique for application. * @since 3.4 **/ - void setDiscoveryInfo(const QString& type, const QString& name=QString::null); + void setDiscoveryInfo(const TQString& type, const TQString& name=TQString::null); signals: /** @@ -278,7 +278,7 @@ class KGameDialogMsgServerConfig : public KGameDialogConfig { Q_OBJECT public: - KGameDialogMsgServerConfig(QWidget* parent = 0); + KGameDialogMsgServerConfig(TQWidget* parent = 0); virtual ~KGameDialogMsgServerConfig(); virtual void submitToKGame(KGame*, KPlayer*) {} @@ -311,7 +311,7 @@ class KGameDialogChatConfig : public KGameDialogConfig { Q_OBJECT public: - KGameDialogChatConfig(int chatMsgId, QWidget* parent = 0); + KGameDialogChatConfig(int chatMsgId, TQWidget* parent = 0); virtual ~KGameDialogChatConfig(); virtual void setKGame(KGame* g); @@ -332,7 +332,7 @@ class KGameDialogConnectionConfig : public KGameDialogConfig { Q_OBJECT public: - KGameDialogConnectionConfig(QWidget* parent = 0); + KGameDialogConnectionConfig(TQWidget* parent = 0); virtual ~KGameDialogConnectionConfig(); virtual void setKGame(KGame* g); @@ -344,12 +344,12 @@ public: protected: /** * @param p A player - * @return The QListBoxItem that belongs to the player @p p + * @return The TQListBoxItem that belongs to the player @p p **/ - QListBoxItem* item(KPlayer* p) const; + TQListBoxItem* item(KPlayer* p) const; protected slots: - void slotKickPlayerOut(QListBoxItem* item); + void slotKickPlayerOut(TQListBoxItem* item); void slotPropertyChanged(KGamePropertyBase* prop, KPlayer* p); void slotPlayerLeftGame(KPlayer* p); void slotPlayerJoinedGame(KPlayer* p); diff --git a/libkdegames/kgame/dialogs/kgameerrordialog.cpp b/libkdegames/kgame/dialogs/kgameerrordialog.cpp index 1750892c..7c3b0509 100644 --- a/libkdegames/kgame/dialogs/kgameerrordialog.cpp +++ b/libkdegames/kgame/dialogs/kgameerrordialog.cpp @@ -37,7 +37,7 @@ public: const KGame* mGame; }; -KGameErrorDialog::KGameErrorDialog(QWidget* parent) : QObject(parent) +KGameErrorDialog::KGameErrorDialog(TQWidget* parent) : TQObject(parent) { d = new KGameErrorDialogPrivate; } @@ -52,15 +52,15 @@ void KGameErrorDialog::setKGame(const KGame* g) slotUnsetKGame(); d->mGame = g; - connect(d->mGame, SIGNAL(destroyed()), this, SLOT(slotUnsetKGame())); + connect(d->mGame, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotUnsetKGame())); // the error signals: - connect(d->mGame, SIGNAL(signalNetworkErrorMessage(int, QString)), - this, SLOT(slotError(int, QString))); - connect(d->mGame, SIGNAL(signalConnectionBroken()), - this, SLOT(slotServerConnectionLost())); - connect(d->mGame, SIGNAL(signalClientDisconnected(Q_UINT32,bool)), - this, SLOT(slotClientConnectionLost(Q_UINT32,bool))); + connect(d->mGame, TQT_SIGNAL(signalNetworkErrorMessage(int, TQString)), + this, TQT_SLOT(slotError(int, TQString))); + connect(d->mGame, TQT_SIGNAL(signalConnectionBroken()), + this, TQT_SLOT(slotServerConnectionLost())); + connect(d->mGame, TQT_SIGNAL(signalClientDisconnected(Q_UINT32,bool)), + this, TQT_SLOT(slotClientConnectionLost(Q_UINT32,bool))); } void KGameErrorDialog::slotUnsetKGame() @@ -71,51 +71,51 @@ void KGameErrorDialog::slotUnsetKGame() d->mGame = 0; } -void KGameErrorDialog::error(const QString& errorText, QWidget* parent) +void KGameErrorDialog::error(const TQString& errorText, TQWidget* parent) { KMessageBox::error(parent, errorText); } void KGameErrorDialog::slotServerConnectionLost() { // TODO: add IP/port of the server - QString message = i18n("Connection to the server has been lost!"); - error(message, (QWidget*)parent()); + TQString message = i18n("Connection to the server has been lost!"); + error(message, (TQWidget*)parent()); } void KGameErrorDialog::slotClientConnectionLost(Q_UINT32 /*id*/,bool) { //TODO: add IP/port of the client - QString message; + TQString message; // if (c) { // message = i18n("Connection to client has been lost!\nID: %1\nIP: %2").arg(c->id()).arg(c->IP()); // } else { // message = i18n("Connection to client has been lost!"); // } message = i18n("Connection to client has been lost!"); - error(message, (QWidget*)parent()); + error(message, (TQWidget*)parent()); } -void KGameErrorDialog::slotError(int errorNo, QString text) +void KGameErrorDialog::slotError(int errorNo, TQString text) { - QString message = i18n("Received a network error!\nError number: %1\nError message: %2").arg(errorNo).arg(text); - error(message, (QWidget*)parent()); + TQString message = i18n("Received a network error!\nError number: %1\nError message: %2").arg(errorNo).arg(text); + error(message, (TQWidget*)parent()); } -void KGameErrorDialog::connectionError(QString s) +void KGameErrorDialog::connectionError(TQString s) { - QString message; + TQString message; if (s.isNull()) { message = i18n("No connection could be created."); } else { message = i18n("No connection could be created.\nThe error message was:\n%1").arg(s); } - error(message, (QWidget*)parent()); + error(message, (TQWidget*)parent()); } // should become the real dialog - currently we just use messageboxes // -> maybe unused forever -KGameErrorMessageDialog::KGameErrorMessageDialog(QWidget* parent) +KGameErrorMessageDialog::KGameErrorMessageDialog(TQWidget* parent) : KDialogBase(Plain, i18n("Error"), Ok, Ok, parent, 0, true, true) { } diff --git a/libkdegames/kgame/dialogs/kgameerrordialog.h b/libkdegames/kgame/dialogs/kgameerrordialog.h index c1dbd1ca..3883399b 100644 --- a/libkdegames/kgame/dialogs/kgameerrordialog.h +++ b/libkdegames/kgame/dialogs/kgameerrordialog.h @@ -40,7 +40,7 @@ class KGameErrorDialog : public QObject { Q_OBJECT public: - KGameErrorDialog(QWidget* parent); + KGameErrorDialog(TQWidget* parent); ~KGameErrorDialog(); /** @@ -55,12 +55,12 @@ public: * KGame couldn't establish a connection. Use this if * KGame::initConnection returns false * @param s A string that describes the error further (like port is - * already in use). Will be ignored if QString::null + * already in use). Will be ignored if TQString::null **/ - void connectionError(QString s = QString::null); + void connectionError(TQString s = TQString::null); public slots: - void slotError(int error, QString text); + void slotError(int error, TQString text); /** * The connection to the @ref KMessageServer has been lost @@ -87,7 +87,7 @@ public slots: void slotUnsetKGame(); protected: - void error(const QString& errorText, QWidget* parent = 0); + void error(const TQString& errorText, TQWidget* parent = 0); private: KGameErrorDialogPrivate* d; @@ -104,7 +104,7 @@ class KGameErrorMessageDialog : public KDialogBase { Q_OBJECT public: - KGameErrorMessageDialog(QWidget* parent); + KGameErrorMessageDialog(TQWidget* parent); ~KGameErrorMessageDialog(); private: diff --git a/libkdegames/kgame/kgame.cpp b/libkdegames/kgame/kgame.cpp index 101dbfcc..ff215837 100644 --- a/libkdegames/kgame/kgame.cpp +++ b/libkdegames/kgame/kgame.cpp @@ -36,10 +36,10 @@ #include <stdio.h> #include <assert.h> -#include <qbuffer.h> -#include <qtimer.h> -#include <qptrqueue.h> -#include <qfile.h> +#include <tqbuffer.h> +#include <tqtimer.h> +#include <tqptrqueue.h> +#include <tqfile.h> #include <klocale.h> #include <krandomsequence.h> @@ -60,7 +60,7 @@ public: } int mUniquePlayerNumber; - QPtrQueue<KPlayer> mAddPlayerList;// this is a list of to-be-added players. See addPlayer() docu + TQPtrQueue<KPlayer> mAddPlayerList;// this is a list of to-be-added players. See addPlayer() docu KRandomSequence* mRandom; KGame::GamePolicy mPolicy; KGameSequence* mGameSequence; @@ -76,12 +76,12 @@ public: KGamePropertyInt mMaxPlayer; KGamePropertyUInt mMinPlayer; KGamePropertyInt mGameStatus; // Game running? - QValueList<int> mInactiveIdList; + TQValueList<int> mInactiveIdList; }; // ------------------- GAME CLASS -------------------------- -KGame::KGame(int cookie,QObject* parent) : KGameNetwork(cookie,parent) +KGame::KGame(int cookie,TQObject* parent) : KGameNetwork(cookie,parent) { kdDebug(11001) << k_funcinfo << " - " << this << ", sizeof(KGame)=" << sizeof(KGame) << endl; d = new KGamePrivate; @@ -89,8 +89,8 @@ KGame::KGame(int cookie,QObject* parent) : KGameNetwork(cookie,parent) d->mProperties = new KGamePropertyHandler(this); d->mProperties->registerHandler(KGameMessage::IdGameProperty, - this,SLOT(sendProperty(int, QDataStream&, bool* )), - SLOT(emitSignal(KGamePropertyBase *))); + this,TQT_SLOT(sendProperty(int, TQDataStream&, bool* )), + TQT_SLOT(emitSignal(KGamePropertyBase *))); d->mMaxPlayer.registerData(KGamePropertyBase::IdMaxPlayer, this, i18n("MaxPlayers")); d->mMaxPlayer.setLocal(-1); // Infinite d->mMinPlayer.registerData(KGamePropertyBase::IdMinPlayer, this, i18n("MinPlayers")); @@ -101,20 +101,20 @@ KGame::KGame(int cookie,QObject* parent) : KGameNetwork(cookie,parent) d->mRandom = new KRandomSequence; d->mRandom->setSeed(0); - connect(this, SIGNAL(signalClientConnected(Q_UINT32)), - this, SLOT(slotClientConnected(Q_UINT32))); - connect(this, SIGNAL(signalClientDisconnected(Q_UINT32,bool)), - this, SLOT(slotClientDisconnected(Q_UINT32,bool))); - connect(this, SIGNAL(signalConnectionBroken()), - this, SLOT(slotServerDisconnected())); + connect(this, TQT_SIGNAL(signalClientConnected(Q_UINT32)), + this, TQT_SLOT(slotClientConnected(Q_UINT32))); + connect(this, TQT_SIGNAL(signalClientDisconnected(Q_UINT32,bool)), + this, TQT_SLOT(slotClientDisconnected(Q_UINT32,bool))); + connect(this, TQT_SIGNAL(signalConnectionBroken()), + this, TQT_SLOT(slotServerDisconnected())); setGameSequence(new KGameSequence()); // BL: FIXME This signal does no longer exist. When we are merging // MH: super....and how do I find out about the lost conenction now? // KGame and KGameNetwork, this could be improved! -// connect(this,SIGNAL(signalConnectionLost(KGameClient *)), -// this,SLOT(slotConnectionLost(KGameClient *))); +// connect(this,TQT_SIGNAL(signalConnectionLost(KGameClient *)), +// this,TQT_SLOT(slotConnectionLost(KGameClient *))); } KGame::~KGame() @@ -159,27 +159,27 @@ void KGame::deleteInactivePlayers() } } -bool KGame::load(QString filename,bool reset) +bool KGame::load(TQString filename,bool reset) { if (filename.isNull()) { return false; } - QFile f(filename); + TQFile f(filename); if (!f.open(IO_ReadOnly)) { return false; } - QDataStream s( &f ); + TQDataStream s( &f ); load(s,reset); f.close(); return true; } -bool KGame::load(QDataStream &stream,bool reset) +bool KGame::load(TQDataStream &stream,bool reset) { return loadgame(stream, false,reset); } -bool KGame::loadgame(QDataStream &stream, bool network,bool resetgame) +bool KGame::loadgame(TQDataStream &stream, bool network,bool resetgame) { // Load Game Data @@ -264,27 +264,27 @@ bool KGame::loadgame(QDataStream &stream, bool network,bool resetgame) return true; } -bool KGame::save(QString filename,bool saveplayers) +bool KGame::save(TQString filename,bool saveplayers) { if (filename.isNull()) { return false; } - QFile f(filename); + TQFile f(filename); if (!f.open(IO_WriteOnly)) { return false; } - QDataStream s( &f ); + TQDataStream s( &f ); save(s,saveplayers); f.close(); return true; } -bool KGame::save(QDataStream &stream,bool saveplayers) +bool KGame::save(TQDataStream &stream,bool saveplayers) { return savegame(stream, false,saveplayers); } -bool KGame::savegame(QDataStream &stream,bool /*network*/,bool saveplayers) +bool KGame::savegame(TQDataStream &stream,bool /*network*/,bool saveplayers) { // Save Game Data @@ -320,7 +320,7 @@ bool KGame::savegame(QDataStream &stream,bool /*network*/,bool saveplayers) return true; } -void KGame::savePlayer(QDataStream &stream,KPlayer* p) +void KGame::savePlayer(TQDataStream &stream,KPlayer* p) { // this could be in KGameMessage as well stream << (Q_INT32)p->rtti(); @@ -329,7 +329,7 @@ void KGame::savePlayer(QDataStream &stream,KPlayer* p) p->save(stream); } -void KGame::savePlayers(QDataStream &stream, KGamePlayerList *list) +void KGame::savePlayers(TQDataStream &stream, KGamePlayerList *list) { if (!list) { @@ -351,7 +351,7 @@ KPlayer *KGame::createPlayer(int /*rtti*/,int /*io*/,bool /*isvirtual*/) kdWarning(11001) << " No user defined player created. Creating default KPlayer. This crashes if you have overwritten KPlayer!!!! " << endl; return new KPlayer; } -KPlayer *KGame::loadPlayer(QDataStream& stream,bool isvirtual) +KPlayer *KGame::loadPlayer(TQDataStream& stream,bool isvirtual) { Q_INT32 rtti,id,iovalue; stream >> rtti >> id >> iovalue; @@ -385,14 +385,14 @@ KPlayer *KGame::loadPlayer(QDataStream& stream,bool isvirtual) KPlayer * KGame::findPlayer(Q_UINT32 id) const { - for (QPtrListIterator<KPlayer> it(d->mPlayerList); it.current(); ++it) + for (TQPtrListIterator<KPlayer> it(d->mPlayerList); it.current(); ++it) { if (it.current()->id() == id) { return it.current(); } } - for (QPtrListIterator<KPlayer> it(d->mInactivePlayerList); it.current(); ++it) + for (TQPtrListIterator<KPlayer> it(d->mInactivePlayerList); it.current(); ++it) { if (it.current()->id() == id) { @@ -438,8 +438,8 @@ void KGame::addPlayer(KPlayer* newplayer) kdDebug(11001) << k_funcinfo << "player " << newplayer << " already has an id: " << newplayer->id() << endl; } - QByteArray buffer; - QDataStream stream(buffer,IO_WriteOnly); + TQByteArray buffer; + TQDataStream stream(buffer,IO_WriteOnly); // We distinguis here what policy we have if (policy()==PolicyLocal || policy()==PolicyDirty) { @@ -706,7 +706,7 @@ KRandomSequence* KGame::random() const { return d->mRandom; } -bool KGame::sendPlayerInput(QDataStream &msg, KPlayer *player, Q_UINT32 sender) +bool KGame::sendPlayerInput(TQDataStream &msg, KPlayer *player, Q_UINT32 sender) { if (!player) { @@ -724,7 +724,7 @@ bool KGame::sendPlayerInput(QDataStream &msg, KPlayer *player, Q_UINT32 sender) return true; } -bool KGame::systemPlayerInput(QDataStream &msg, KPlayer *player, Q_UINT32 sender) +bool KGame::systemPlayerInput(TQDataStream &msg, KPlayer *player, Q_UINT32 sender) { if (!player) { @@ -780,7 +780,7 @@ KPlayer * KGame::playerInputFinished(KPlayer *player) player->setTurn(false); // in turn based games we have to switch off input now if (gameSequence()) { - QTimer::singleShot(0,this,SLOT(prepareNext())); + TQTimer::singleShot(0,this,TQT_SLOT(prepareNext())); } } return player; @@ -840,7 +840,7 @@ void KGame::setGameStatus(int status) d->mGameStatus = status; } -void KGame::networkTransmission(QDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender, Q_UINT32 /*clientID*/) +void KGame::networkTransmission(TQDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender, Q_UINT32 /*clientID*/) {//clientID is unused // message targets a playerobject. If we find it we forward the message to the // player. Otherwise we proceed here and hope the best that the user processes @@ -1033,7 +1033,7 @@ void KGame::networkTransmission(QDataStream &stream, int msgid, Q_UINT32 receive << endl; } kdDebug(11001) << k_funcinfo << ": User data msgid " << msgid << endl; - emit signalNetworkData(msgid - KGameMessage::IdUser,((QBuffer*)stream.device())->readAll(),receiver,sender); + emit signalNetworkData(msgid - KGameMessage::IdUser,((TQBuffer*)stream.device())->readAll(),receiver,sender); } break; } @@ -1043,14 +1043,14 @@ void KGame::networkTransmission(QDataStream &stream, int msgid, Q_UINT32 receive // called by the IdSetupGameContinue Message - MASTER SIDE // Here the master needs to decide which players can take part at the game // and which will be deactivated -void KGame::setupGameContinue(QDataStream& stream, Q_UINT32 sender) +void KGame::setupGameContinue(TQDataStream& stream, Q_UINT32 sender) { KPlayer *player; Q_INT32 cnt; int i; stream >> cnt; - QValueList<int> inactivateIds; + TQValueList<int> inactivateIds; KGamePlayerList newPlayerList; newPlayerList.setAutoDelete(true); @@ -1135,7 +1135,7 @@ void KGame::setupGameContinue(QDataStream& stream, Q_UINT32 sender) kdDebug(11001) << "Alltogether deactivated " << inactivateIds.count() << " players" << endl; - QValueList<int>::Iterator it; + TQValueList<int>::Iterator it; for ( it = inactivateIds.begin(); it != inactivateIds.end(); ++it ) { int pid=*it; @@ -1143,7 +1143,7 @@ void KGame::setupGameContinue(QDataStream& stream, Q_UINT32 sender) } // Now deactivate the network players from the inactivateId list - //QValueList<int>::Iterator it; + //TQValueList<int>::Iterator it; for ( it = inactivateIds.begin(); it != inactivateIds.end(); ++it ) { int pid=*it; @@ -1182,8 +1182,8 @@ void KGame::setupGameContinue(QDataStream& stream, Q_UINT32 sender) } // Save the game over the network - QByteArray bufferS; - QDataStream streamS(bufferS,IO_WriteOnly); + TQByteArray bufferS; + TQDataStream streamS(bufferS,IO_WriteOnly); // Save game over netowrk and save players savegame(streamS,true,true); sendSystemMessage(streamS,KGameMessage::IdGameLoad,sender); @@ -1197,8 +1197,8 @@ void KGame::setupGameContinue(QDataStream& stream, Q_UINT32 sender) // Client needs to prepare for network transfer void KGame::setupGame(Q_UINT32 sender) { - QByteArray bufferS; - QDataStream streamS(bufferS,IO_WriteOnly); + TQByteArray bufferS; + TQDataStream streamS(bufferS,IO_WriteOnly); // Deactivate all players KGamePlayerList mTmpList(d->mPlayerList); // we need copy otherwise the removal crashes @@ -1207,7 +1207,7 @@ void KGame::setupGame(Q_UINT32 sender) streamS << cnt; - QPtrListIterator<KPlayer> it(mTmpList); + TQPtrListIterator<KPlayer> it(mTmpList); KPlayer *player; while (it.current()) { @@ -1356,7 +1356,7 @@ void KGame::slotClientDisconnected(Q_UINT32 clientID,bool /*broken*/) // server // TODO remove players from removed game for (unsigned int idx=0;idx<d->mInactiveIdList.count();idx++) { - QValueList<int>::Iterator it1 = d->mInactiveIdList.at(idx); + TQValueList<int>::Iterator it1 = d->mInactiveIdList.at(idx); player = findPlayer(*it1); if (((int)playerCount() < maxPlayers() || maxPlayers() < 0) && player && KGameMessage::rawGameId(*it1) != clientID) { @@ -1382,8 +1382,8 @@ void KGame::negotiateNetworkGame(Q_UINT32 clientID) return ; } - QByteArray buffer; - QDataStream streamGS(buffer,IO_WriteOnly); + TQByteArray buffer; + TQDataStream streamGS(buffer,IO_WriteOnly); // write Game setup specific data //streamGS << (Q_INT32)maxPlayers(); @@ -1396,7 +1396,7 @@ void KGame::negotiateNetworkGame(Q_UINT32 clientID) sendSystemMessage(streamGS, KGameMessage::IdSetupGame, clientID); } -bool KGame::sendGroupMessage(const QByteArray &msg, int msgid, Q_UINT32 sender, const QString& group) +bool KGame::sendGroupMessage(const TQByteArray &msg, int msgid, Q_UINT32 sender, const TQString& group) { // AB: group must not be i18n'ed!! we should better use an id for group and use // a groupName() for the name // FIXME @@ -1411,13 +1411,13 @@ bool KGame::sendGroupMessage(const QByteArray &msg, int msgid, Q_UINT32 sender, return true; } -bool KGame::sendGroupMessage(const QDataStream &msg, int msgid, Q_UINT32 sender, const QString& group) -{ return sendGroupMessage(((QBuffer*)msg.device())->buffer(), msgid, sender, group); } +bool KGame::sendGroupMessage(const TQDataStream &msg, int msgid, Q_UINT32 sender, const TQString& group) +{ return sendGroupMessage(((TQBuffer*)msg.device())->buffer(), msgid, sender, group); } -bool KGame::sendGroupMessage(const QString& msg, int msgid, Q_UINT32 sender, const QString& group) +bool KGame::sendGroupMessage(const TQString& msg, int msgid, Q_UINT32 sender, const TQString& group) { - QByteArray buffer; - QDataStream stream(buffer, IO_WriteOnly); + TQByteArray buffer; + TQDataStream stream(buffer, IO_WriteOnly); stream << msg; return sendGroupMessage(stream, msgid, sender, group); } @@ -1425,10 +1425,10 @@ bool KGame::sendGroupMessage(const QString& msg, int msgid, Q_UINT32 sender, con bool KGame::addProperty(KGamePropertyBase* data) { return dataHandler()->addProperty(data); } -bool KGame::sendPlayerProperty(int msgid, QDataStream& s, Q_UINT32 playerId) +bool KGame::sendPlayerProperty(int msgid, TQDataStream& s, Q_UINT32 playerId) { return sendSystemMessage(s, msgid, playerId); } -void KGame::sendProperty(int msgid, QDataStream& stream, bool* sent) +void KGame::sendProperty(int msgid, TQDataStream& stream, bool* sent) { bool s = sendSystemMessage(stream, msgid); if (s) @@ -1459,11 +1459,11 @@ void KGame::setPolicy(GamePolicy p,bool recursive) dataHandler()->setPolicy((KGamePropertyBase::PropertyPolicy)p,false); // Set all KPLayer (active or inactive) property policy - for (QPtrListIterator<KPlayer> it(d->mPlayerList); it.current(); ++it) + for (TQPtrListIterator<KPlayer> it(d->mPlayerList); it.current(); ++it) { it.current()->dataHandler()->setPolicy((KGamePropertyBase::PropertyPolicy)p,false); } - for (QPtrListIterator<KPlayer> it(d->mInactivePlayerList); it.current(); ++it) + for (TQPtrListIterator<KPlayer> it(d->mInactivePlayerList); it.current(); ++it) { it.current()->dataHandler()->setPolicy((KGamePropertyBase::PropertyPolicy)p,false); } diff --git a/libkdegames/kgame/kgame.h b/libkdegames/kgame/kgame.h index 37d8d974..85a8356c 100644 --- a/libkdegames/kgame/kgame.h +++ b/libkdegames/kgame/kgame.h @@ -23,9 +23,9 @@ #ifndef __KGAME_H_ #define __KGAME_H_ -#include <qstring.h> -#include <qptrlist.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqptrlist.h> +#include <tqvaluelist.h> #include "kgamenetwork.h" #include <kdemacros.h> @@ -64,7 +64,7 @@ class KDE_EXPORT KGame : public KGameNetwork Q_OBJECT public: - typedef QPtrList<KPlayer> KGamePlayerList; + typedef TQPtrList<KPlayer> KGamePlayerList; /** * The policy of the property. This can be PolicyClean (setVale uses @@ -100,7 +100,7 @@ public: * game in load/save and network operations. Change this between * games. */ - KGame(int cookie=42,QObject* parent=0); + KGame(int cookie=42,TQObject* parent=0); /** * Destructs the game @@ -282,19 +282,19 @@ public: * Called by KPlayer to send a player input to the * KMessageServer. **/ - virtual bool sendPlayerInput(QDataStream &msg,KPlayer *player,Q_UINT32 sender=0); + virtual bool sendPlayerInput(TQDataStream &msg,KPlayer *player,Q_UINT32 sender=0); /** * Called when a player input arrives from KMessageServer. * - * Calls prepareNext (using QTimer::singleShot) if gameOver() + * Calls prepareNext (using TQTimer::singleShot) if gameOver() * returns 0. This function should normally not be used outside KGame. * It could be made non-virtual,protected in a later version. At the * moment it is a virtual function to give you more control over KGame. * * For documentation see playerInput. **/ - virtual bool systemPlayerInput(QDataStream &msg,KPlayer *player,Q_UINT32 sender=0); + virtual bool systemPlayerInput(TQDataStream &msg,KPlayer *player,Q_UINT32 sender=0); /** * This virtual function is called if the KGame needs to create a new player. @@ -337,7 +337,7 @@ public: * * @return true? */ - virtual bool load(QDataStream &stream,bool reset=true); + virtual bool load(TQDataStream &stream,bool reset=true); /** * Same as above function but with different parameters @@ -347,7 +347,7 @@ public: * * @return true? **/ - virtual bool load(QString filename,bool reset=true); + virtual bool load(TQString filename,bool reset=true); /** * Save a game to a file OR to network. Otherwise the same as @@ -358,7 +358,7 @@ public: * * @return true? */ - virtual bool save(QDataStream &stream,bool saveplayers=true); + virtual bool save(TQDataStream &stream,bool saveplayers=true); /** * Same as above function but with different parameters @@ -368,7 +368,7 @@ public: * * @return true? **/ - virtual bool save(QString filename,bool saveplayers=true); + virtual bool save(TQString filename,bool saveplayers=true); /** * Resets the game, i.e. puts it into a state where everything @@ -403,7 +403,7 @@ public: /** * This is called by KPlayer::sendProperty only! Internal function! **/ - bool sendPlayerProperty(int msgid, QDataStream& s, Q_UINT32 playerId); + bool sendPlayerProperty(int msgid, TQDataStream& s, Q_UINT32 playerId); /** * This function allows to find the pointer to a player @@ -435,10 +435,10 @@ public: * @param group the group of the receivers * @return true if worked */ - bool sendGroupMessage(const QByteArray& msg, int msgid, Q_UINT32 sender, const QString& group); - bool sendGroupMessage(const QDataStream &msg, int msgid, Q_UINT32 sender, const QString& group); - bool sendGroupMessage(int msg, int msgid, Q_UINT32 sender, const QString& group); - bool sendGroupMessage(const QString& msg, int msgid, Q_UINT32 sender, const QString& group); + bool sendGroupMessage(const TQByteArray& msg, int msgid, Q_UINT32 sender, const TQString& group); + bool sendGroupMessage(const TQDataStream &msg, int msgid, Q_UINT32 sender, const TQString& group); + bool sendGroupMessage(int msg, int msgid, Q_UINT32 sender, const TQString& group); + bool sendGroupMessage(const TQString& msg, int msgid, Q_UINT32 sender, const TQString& group); /** * This will either forward an incoming message to a specified player @@ -458,7 +458,7 @@ public: * @param sender * @param clientID the client from which we received the transmission - hardly used **/ - virtual void networkTransmission(QDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender, Q_UINT32 clientID); + virtual void networkTransmission(TQDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender, Q_UINT32 clientID); /** * Returns a pointer to the KGame property handler @@ -469,7 +469,7 @@ protected slots: /** * Called by KGamePropertyHandler only! Internal function! **/ - void sendProperty(int msgid, QDataStream& stream, bool* sent); + void sendProperty(int msgid, TQDataStream& stream, bool* sent); /** * Called by KGamePropertyHandler only! Internal function! @@ -539,7 +539,7 @@ signals: * * @param stream the load stream */ - void signalLoadPrePlayers(QDataStream &stream); + void signalLoadPrePlayers(TQDataStream &stream); /** * The game will be loaded from the given stream. Load from here @@ -548,7 +548,7 @@ signals: * * @param stream the load stream */ - void signalLoad(QDataStream &stream); + void signalLoad(TQDataStream &stream); /** * The game will be saved to the given stream. Fill this with data @@ -563,7 +563,7 @@ signals: * * @param stream the save stream **/ - void signalSavePrePlayers(QDataStream &stream); + void signalSavePrePlayers(TQDataStream &stream); /** * The game will be saved to the given stream. Fill this with data @@ -572,7 +572,7 @@ signals: * * @param stream the save stream */ - void signalSave(QDataStream &stream); + void signalSave(TQDataStream &stream); /** * Is emmited if a game with a different version cookie is loaded. @@ -585,7 +585,7 @@ signals: * @param cookie - the saved cookie. It differs from KGame::cookie() * @param result - set this to true if you managed to load the game */ - void signalLoadError(QDataStream &stream,bool network,int cookie, bool &result); + void signalLoadError(TQDataStream &stream,bool network,int cookie, bool &result); /** * We got an user defined update message. This is usually done @@ -593,7 +593,7 @@ signals: * own methods and has to syncronise them over the network. * Reaction to this is usually a call to a KGame function. */ - void signalNetworkData(int msgid,const QByteArray& buffer, Q_UINT32 receiver, Q_UINT32 sender); + void signalNetworkData(int msgid,const TQByteArray& buffer, Q_UINT32 receiver, Q_UINT32 sender); /** * We got an network message. this can be used to notify us that something @@ -686,7 +686,7 @@ protected: * and then manually call @ref playerInputFinished to resume it. * Example: * \code - * bool MyClass::playerInput(QDataStream &msg,KPlayer *player) + * bool MyClass::playerInput(TQDataStream &msg,KPlayer *player) * { * Q_INT32 move; * msg >> move; @@ -700,7 +700,7 @@ protected: * @param player the player who did the move * @return true - input ready, false: input manual */ - virtual bool playerInput(QDataStream &msg,KPlayer *player)=0; + virtual bool playerInput(TQDataStream &msg,KPlayer *player)=0; /** @@ -752,7 +752,7 @@ protected: **/ virtual void newPlayersJoin(KGamePlayerList *oldplayer, KGamePlayerList *newplayer, - QValueList<int> &inactivate) { + TQValueList<int> &inactivate) { Q_UNUSED( oldplayer ); Q_UNUSED( newplayer ); Q_UNUSED( inactivate ); @@ -766,7 +766,7 @@ protected: * @param list the optional list is the player list to be saved, default is playerList() * **/ - void savePlayers(QDataStream &stream,KGamePlayerList *list=0); + void savePlayers(TQDataStream &stream,KGamePlayerList *list=0); /** * Prepare a player for being added. Put all data about a player into the @@ -778,7 +778,7 @@ protected: * @param stream is the stream to add the player * @param player The player to add **/ - void savePlayer(QDataStream& stream,KPlayer* player); + void savePlayer(TQDataStream& stream,KPlayer* player); /** * Load the player list from a stream. Used for network game and load/save. @@ -788,7 +788,7 @@ protected: * @param isvirtual will set the virtual flag true/false * **/ - KPlayer *loadPlayer(QDataStream& stream,bool isvirtual=false); + KPlayer *loadPlayer(TQDataStream& stream,bool isvirtual=false); /** @@ -872,7 +872,7 @@ protected: * * @return true? */ - virtual bool loadgame(QDataStream &stream, bool network, bool reset); + virtual bool loadgame(TQDataStream &stream, bool network, bool reset); /** * Save a game, to file OR network. Internal. @@ -883,7 +883,7 @@ protected: * * @return true? */ - virtual bool savegame(QDataStream &stream, bool network,bool saveplayers); + virtual bool savegame(TQDataStream &stream, bool network,bool saveplayers); private: //AB: this is to hide the "receiver" parameter from the user. It shouldn't be @@ -913,7 +913,7 @@ private: /** * Helping function - game negotiation **/ - void setupGameContinue(QDataStream& msg, Q_UINT32 sender); + void setupGameContinue(TQDataStream& msg, Q_UINT32 sender); /** * Removes a player from all lists, removes the @ref KGame pointer from the diff --git a/libkdegames/kgame/kgamechat.cpp b/libkdegames/kgame/kgamechat.cpp index 16ec7c18..ddc1bd66 100644 --- a/libkdegames/kgame/kgamechat.cpp +++ b/libkdegames/kgame/kgamechat.cpp @@ -29,8 +29,8 @@ #include <klocale.h> #include <kdebug.h> -#include <qmap.h> -#include <qintdict.h> +#include <tqmap.h> +#include <tqintdict.h> //FIXME: #define FIRST_ID 2 // first id, that is free of use, aka not defined above @@ -51,24 +51,24 @@ public: int mMessageId; - QIntDict<KPlayer> mIndex2Player; + TQIntDict<KPlayer> mIndex2Player; - QMap<int, int> mSendId2PlayerId; + TQMap<int, int> mSendId2PlayerId; int mToMyGroup; // just as the above - but for the group, not for players }; -KGameChat::KGameChat(KGame* g, int msgid, QWidget* parent) : KChatBase(parent) +KGameChat::KGameChat(KGame* g, int msgid, TQWidget* parent) : KChatBase(parent) { init(g, msgid); } -KGameChat::KGameChat(KGame* g, int msgid, KPlayer* fromPlayer, QWidget* parent) : KChatBase(parent) +KGameChat::KGameChat(KGame* g, int msgid, KPlayer* fromPlayer, TQWidget* parent) : KChatBase(parent) { init(g, msgid); setFromPlayer(fromPlayer); } -KGameChat::KGameChat(QWidget* parent) : KChatBase(parent) +KGameChat::KGameChat(TQWidget* parent) : KChatBase(parent) { init(0, -1); } @@ -88,7 +88,7 @@ void KGameChat::init(KGame* g, int msgId) setKGame(g); } -void KGameChat::addMessage(int fromId, const QString& text) +void KGameChat::addMessage(int fromId, const TQString& text) { if (!d->mGame) { kdWarning(11001) << "no KGame object has been set" << endl; @@ -105,7 +105,7 @@ void KGameChat::addMessage(int fromId, const QString& text) } } -void KGameChat::returnPressed(const QString& text) +void KGameChat::returnPressed(const TQString& text) { if (!d->mFromPlayer) { kdWarning(11001) << k_funcinfo << ": You must set a player first!" << endl; @@ -123,7 +123,7 @@ void KGameChat::returnPressed(const QString& text) if (isToGroupMessage(id)) { // note: there is currently no support for other groups than the players // group! It might be useful to send to other groups, too - QString group = d->mFromPlayer->group(); + TQString group = d->mFromPlayer->group(); kdDebug(11001) << "send to group " << group << endl; int sender = d->mFromPlayer->id(); d->mGame->sendGroupMessage(text, messageId(), sender, group); @@ -164,7 +164,7 @@ bool KGameChat::isToPlayerMessage(int id) const { return d->mSendId2PlayerId.contains(id); } -QString KGameChat::sendToPlayerEntry(const QString& name) const +TQString KGameChat::sendToPlayerEntry(const TQString& name) const { return i18n("Send to %1").arg(name); } int KGameChat::playerId(int id) const @@ -178,7 +178,7 @@ int KGameChat::playerId(int id) const int KGameChat::sendingId(int playerId) const { - QMap<int, int>::Iterator it; + TQMap<int, int>::Iterator it; for (it = d->mSendId2PlayerId.begin(); it != d->mSendId2PlayerId.end(); ++it) { if (it.data() == playerId) { return it.key(); @@ -187,8 +187,8 @@ int KGameChat::sendingId(int playerId) const return -1; } -const QString& KGameChat::fromName() const -{ return d->mFromPlayer ? d->mFromPlayer->name() : QString::null; } +const TQString& KGameChat::fromName() const +{ return d->mFromPlayer ? d->mFromPlayer->name() : TQString::null; } bool KGameChat::hasPlayer(int id) const { @@ -227,15 +227,15 @@ void KGameChat::setKGame(KGame* g) d->mGame = g; if (d->mGame) { - connect(d->mGame, SIGNAL(signalPlayerJoinedGame(KPlayer*)), - this, SLOT(slotAddPlayer(KPlayer*))); - connect(d->mGame, SIGNAL(signalPlayerLeftGame(KPlayer*)), - this, SLOT(slotRemovePlayer(KPlayer*))); - connect(d->mGame, SIGNAL(signalNetworkData(int, const QByteArray&, Q_UINT32, Q_UINT32)), - this, SLOT(slotReceiveMessage(int, const QByteArray&, Q_UINT32, Q_UINT32))); - connect(d->mGame, SIGNAL(destroyed()), this, SLOT(slotUnsetKGame())); - - QPtrList<KPlayer> playerList = *d->mGame->playerList(); + connect(d->mGame, TQT_SIGNAL(signalPlayerJoinedGame(KPlayer*)), + this, TQT_SLOT(slotAddPlayer(KPlayer*))); + connect(d->mGame, TQT_SIGNAL(signalPlayerLeftGame(KPlayer*)), + this, TQT_SLOT(slotRemovePlayer(KPlayer*))); + connect(d->mGame, TQT_SIGNAL(signalNetworkData(int, const TQByteArray&, Q_UINT32, Q_UINT32)), + this, TQT_SLOT(slotReceiveMessage(int, const TQByteArray&, Q_UINT32, Q_UINT32))); + connect(d->mGame, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotUnsetKGame())); + + TQPtrList<KPlayer> playerList = *d->mGame->playerList(); for (int unsigned i = 0; i < playerList.count(); i++) { slotAddPlayer(playerList.at(i)); } @@ -261,7 +261,7 @@ void KGameChat::slotUnsetKGame() } disconnect(d->mGame, 0, this, 0); removeSendingEntry(d->mToMyGroup); - QMap<int, int>::Iterator it; + TQMap<int, int>::Iterator it; for (it = d->mSendId2PlayerId.begin(); it != d->mSendId2PlayerId.end(); ++it) { removeSendingEntry(it.data()); } @@ -281,10 +281,10 @@ void KGameChat::slotAddPlayer(KPlayer* p) int sendingId = nextId(); addSendingEntry(comboBoxItem(p->name()), sendingId); d->mSendId2PlayerId.insert(sendingId, p->id()); - connect(p, SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)), - this, SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*))); - connect(p, SIGNAL(signalNetworkData(int, const QByteArray&, Q_UINT32, KPlayer*)), - this, SLOT(slotReceivePrivateMessage(int, const QByteArray&, Q_UINT32, KPlayer*))); + connect(p, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)), + this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*))); + connect(p, TQT_SIGNAL(signalNetworkData(int, const TQByteArray&, Q_UINT32, KPlayer*)), + this, TQT_SLOT(slotReceivePrivateMessage(int, const TQByteArray&, Q_UINT32, KPlayer*))); } void KGameChat::slotRemovePlayer(KPlayer* p) @@ -317,7 +317,7 @@ void KGameChat::slotPropertyChanged(KGamePropertyBase* prop, KPlayer* player) } } -void KGameChat::slotReceivePrivateMessage(int msgid, const QByteArray& buffer, Q_UINT32 sender, KPlayer* me) +void KGameChat::slotReceivePrivateMessage(int msgid, const TQByteArray& buffer, Q_UINT32 sender, KPlayer* me) { if (!me || me != fromPlayer()) { kdDebug() << k_funcinfo << "nope - not for us!" << endl; @@ -326,14 +326,14 @@ void KGameChat::slotReceivePrivateMessage(int msgid, const QByteArray& buffer, Q slotReceiveMessage(msgid, buffer, me->id(), sender); } -void KGameChat::slotReceiveMessage(int msgid, const QByteArray& buffer, Q_UINT32 , Q_UINT32 sender) +void KGameChat::slotReceiveMessage(int msgid, const TQByteArray& buffer, Q_UINT32 , Q_UINT32 sender) { - QDataStream msg(buffer, IO_ReadOnly); + TQDataStream msg(buffer, IO_ReadOnly); if (msgid != messageId()) { return; } - QString text; + TQString text; msg >> text; addMessage(sender, text); diff --git a/libkdegames/kgame/kgamechat.h b/libkdegames/kgame/kgamechat.h index 6f7ea65d..effcca22 100644 --- a/libkdegames/kgame/kgamechat.h +++ b/libkdegames/kgame/kgamechat.h @@ -21,7 +21,7 @@ #ifndef __KGAMECHAT_H__ #define __KGAMECHAT_H__ -#include <qstring.h> +#include <tqstring.h> #include "kchatbase.h" #include <kdemacros.h> @@ -49,14 +49,14 @@ public: * the chat message. The @p fromPlayer is the local player (see @ref * setFromPlayer). **/ - KGameChat(KGame* game, int msgid, KPlayer* fromPlayer, QWidget * parent); + KGameChat(KGame* game, int msgid, KPlayer* fromPlayer, TQWidget * parent); /** * @overload * To make use of this widget you need to call @ref setFromPlayer * manually. **/ - KGameChat(KGame* game, int msgId, QWidget* parent); + KGameChat(KGame* game, int msgId, TQWidget* parent); /** * @overload @@ -64,7 +64,7 @@ public: * setGame, setFromPlayer and setMessageId manually. * @since 3.2 **/ - KGameChat(QWidget* parent); + KGameChat(TQWidget* parent); virtual ~KGameChat(); @@ -114,14 +114,14 @@ public: * reimplemented from @ref KChatBase * @return @ref KPlayer::name() for the player set by @ref setFromPlayer **/ - virtual const QString& fromName() const; + virtual const TQString& fromName() const; public slots: - virtual void addMessage(const QString& fromName, const QString& text) { KChatBase::addMessage(fromName, text);} - virtual void addMessage(int fromId, const QString& text); + virtual void addMessage(const TQString& fromName, const TQString& text) { KChatBase::addMessage(fromName, text);} + virtual void addMessage(int fromId, const TQString& text); - void slotReceiveMessage(int, const QByteArray&, Q_UINT32 receiver, Q_UINT32 sender); + void slotReceiveMessage(int, const TQByteArray&, Q_UINT32 receiver, Q_UINT32 sender); protected: /** @@ -187,7 +187,7 @@ protected: * KChatBase. By default this is "send to name" where name is the name * that you specify. See also KChatBase::addSendingEntry **/ - virtual QString sendToPlayerEntry(const QString& name) const; + virtual TQString sendToPlayerEntry(const TQString& name) const; protected slots: @@ -208,10 +208,10 @@ protected slots: * gets forwarded to slotReceiveMessage if @p me equals * fromPlayer. **/ - void slotReceivePrivateMessage(int msgid, const QByteArray& buffer, Q_UINT32 sender, KPlayer* me); + void slotReceivePrivateMessage(int msgid, const TQByteArray& buffer, Q_UINT32 sender, KPlayer* me); protected: - virtual void returnPressed(const QString& text); + virtual void returnPressed(const TQString& text); private: void init(KGame* g, int msgid); diff --git a/libkdegames/kgame/kgameerror.cpp b/libkdegames/kgame/kgameerror.cpp index 93f40f93..eb98a797 100644 --- a/libkdegames/kgame/kgameerror.cpp +++ b/libkdegames/kgame/kgameerror.cpp @@ -26,33 +26,33 @@ #include <klocale.h> -QByteArray KGameError::errVersion(int remoteVersion) +TQByteArray KGameError::errVersion(int remoteVersion) { - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); s << (Q_INT32)KGameMessage::version(); s << (Q_INT32)remoteVersion; return b; } -QByteArray KGameError::errCookie(int localCookie, int remoteCookie) +TQByteArray KGameError::errCookie(int localCookie, int remoteCookie) { - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); s << (Q_INT32)localCookie; s << (Q_INT32)remoteCookie; return b; } -QString KGameError::errorText(int errorCode, const QByteArray& message) +TQString KGameError::errorText(int errorCode, const TQByteArray& message) { - QDataStream s(message, IO_ReadOnly); + TQDataStream s(message, IO_ReadOnly); return errorText(errorCode, s); } -QString KGameError::errorText(int errorCode, QDataStream& s) +TQString KGameError::errorText(int errorCode, TQDataStream& s) { - QString text; + TQString text; switch (errorCode) { case Cookie: { diff --git a/libkdegames/kgame/kgameerror.h b/libkdegames/kgame/kgameerror.h index 2916e891..071737cc 100644 --- a/libkdegames/kgame/kgameerror.h +++ b/libkdegames/kgame/kgameerror.h @@ -23,7 +23,7 @@ #ifndef __KGAMEERROR_H_ #define __KGAMEERROR_H_ -#include <qstring.h> +#include <tqstring.h> class KGameError @@ -40,19 +40,19 @@ public: /** * Generate an error message with Erorr Code = ErrCookie **/ - static QByteArray errCookie(int localCookie, int remoteCookie); - static QByteArray errVersion(int remoteVersion); + static TQByteArray errCookie(int localCookie, int remoteCookie); + static TQByteArray errVersion(int remoteVersion); /** - * Create an erorr text using a QDataStream (QByteArray) which was + * Create an erorr text using a TQDataStream (TQByteArray) which was * created using @ref KGameError. This is the opposite function to all * the errXYZ() function (e.g. @ref errVersion). * You want to use this to generate the message that shall be * displayed to the user. * @return an error message **/ - static QString errorText(int errorCode, QDataStream& message); - static QString errorText(int errorCode, const QByteArray& message); + static TQString errorText(int errorCode, TQDataStream& message); + static TQString errorText(int errorCode, const TQByteArray& message); }; diff --git a/libkdegames/kgame/kgameio.cpp b/libkdegames/kgame/kgameio.cpp index 9b3a55e8..7183d5d3 100644 --- a/libkdegames/kgame/kgameio.cpp +++ b/libkdegames/kgame/kgameio.cpp @@ -30,20 +30,20 @@ #include <kdebug.h> -#include <qwidget.h> -#include <qbuffer.h> -#include <qtimer.h> +#include <tqwidget.h> +#include <tqbuffer.h> +#include <tqtimer.h> #include <stdlib.h> // ----------------------- Generic IO ------------------------- -KGameIO::KGameIO() : QObject(0,0) +KGameIO::KGameIO() : TQObject(0,0) { kdDebug(11001) << k_funcinfo << ": this=" << this << ", sizeof(this)" << sizeof(KGameIO) << endl; mPlayer = 0; } -KGameIO::KGameIO(KPlayer* player) : QObject(0,0) +KGameIO::KGameIO(KPlayer* player) : TQObject(0,0) { kdDebug(11001) << k_funcinfo << ": this=" << this << ", sizeof(this)" << sizeof(KGameIO) << endl; mPlayer = 0; @@ -76,12 +76,12 @@ void KGameIO::notifyTurn(bool b) return; } bool sendit=false; - QByteArray buffer; - QDataStream stream(buffer, IO_WriteOnly); + TQByteArray buffer; + TQDataStream stream(buffer, IO_WriteOnly); emit signalPrepareTurn(stream, b, this, &sendit); if (sendit) { - QDataStream ostream(buffer,IO_ReadOnly); + TQDataStream ostream(buffer,IO_ReadOnly); Q_UINT32 sender = player()->id(); // force correct sender kdDebug(11001) << "Prepare turn sendInput" << endl; sendInput(ostream, true, sender); @@ -97,7 +97,7 @@ KGame* KGameIO::game() const return player()->game(); } -bool KGameIO::sendInput(QDataStream& s, bool transmit, Q_UINT32 sender) +bool KGameIO::sendInput(TQDataStream& s, bool transmit, Q_UINT32 sender) { if (!player()) { @@ -117,7 +117,7 @@ void KGameIO::Debug() // ----------------------- Key IO --------------------------- -KGameKeyIO::KGameKeyIO(QWidget *parent) +KGameKeyIO::KGameKeyIO(TQWidget *parent) : KGameIO() { if (parent) @@ -137,7 +137,7 @@ KGameKeyIO::~KGameKeyIO() int KGameKeyIO::rtti() const { return KeyIO; } -bool KGameKeyIO::eventFilter( QObject *o, QEvent *e ) +bool KGameKeyIO::eventFilter( TQObject *o, TQEvent *e ) { if (!player()) { @@ -145,16 +145,16 @@ bool KGameKeyIO::eventFilter( QObject *o, QEvent *e ) } // key press/release - if ( e->type() == QEvent::KeyPress || - e->type() == QEvent::KeyRelease ) + if ( e->type() == TQEvent::KeyPress || + e->type() == TQEvent::KeyRelease ) { - QKeyEvent *k = (QKeyEvent*)e; + TQKeyEvent *k = (TQKeyEvent*)e; // kdDebug(11001) << "KGameKeyIO " << this << " key press/release " << k->key() << endl ; - QByteArray buffer; - QDataStream stream(buffer,IO_WriteOnly); + TQByteArray buffer; + TQDataStream stream(buffer,IO_WriteOnly); bool eatevent=false; emit signalKeyEvent(this,stream,k,&eatevent); - QDataStream msg(buffer,IO_ReadOnly); + TQDataStream msg(buffer,IO_ReadOnly); if (eatevent && sendInput(msg)) { @@ -162,12 +162,12 @@ bool KGameKeyIO::eventFilter( QObject *o, QEvent *e ) } return false; // do not eat otherwise } - return QObject::eventFilter( o, e ); // standard event processing + return TQObject::eventFilter( o, e ); // standard event processing } // ----------------------- Mouse IO --------------------------- -KGameMouseIO::KGameMouseIO(QWidget *parent,bool trackmouse) +KGameMouseIO::KGameMouseIO(TQWidget *parent,bool trackmouse) : KGameIO() { if (parent) @@ -195,11 +195,11 @@ void KGameMouseIO::setMouseTracking(bool b) { if (parent()) { - ((QWidget*)parent())->setMouseTracking(b); + ((TQWidget*)parent())->setMouseTracking(b); } } -bool KGameMouseIO::eventFilter( QObject *o, QEvent *e ) +bool KGameMouseIO::eventFilter( TQObject *o, TQEvent *e ) { if (!player()) { @@ -208,28 +208,28 @@ bool KGameMouseIO::eventFilter( QObject *o, QEvent *e ) // kdDebug(11001) << "KGameMouseIO " << this << endl ; // mouse action - if ( e->type() == QEvent::MouseButtonPress || - e->type() == QEvent::MouseButtonRelease || - e->type() == QEvent::MouseButtonDblClick || - e->type() == QEvent::Wheel || - e->type() == QEvent::MouseMove + if ( e->type() == TQEvent::MouseButtonPress || + e->type() == TQEvent::MouseButtonRelease || + e->type() == TQEvent::MouseButtonDblClick || + e->type() == TQEvent::Wheel || + e->type() == TQEvent::MouseMove ) { - QMouseEvent *k = (QMouseEvent*)e; + TQMouseEvent *k = (TQMouseEvent*)e; // kdDebug(11001) << "KGameMouseIO " << this << endl ; - QByteArray buffer; - QDataStream stream(buffer,IO_WriteOnly); + TQByteArray buffer; + TQDataStream stream(buffer,IO_WriteOnly); bool eatevent=false; emit signalMouseEvent(this,stream,k,&eatevent); // kdDebug(11001) << "################# eatevent=" << eatevent << endl; - QDataStream msg(buffer,IO_ReadOnly); + TQDataStream msg(buffer,IO_ReadOnly); if (eatevent && sendInput(msg)) { return eatevent; } return false; // do not eat otherwise } - return QObject::eventFilter( o, e ); // standard event processing + return TQObject::eventFilter( o, e ); // standard event processing } @@ -249,7 +249,7 @@ public: }; // ----------------------- Process IO --------------------------- -KGameProcessIO::KGameProcessIO(const QString& name) +KGameProcessIO::KGameProcessIO(const TQString& name) : KGameIO() { kdDebug(11001) << k_funcinfo << ": this=" << this << ", sizeof(this)=" << sizeof(KGameProcessIO) << endl; @@ -266,12 +266,12 @@ KGameProcessIO::KGameProcessIO(const QString& name) //kdDebug(11001) << "================= KMEssage SetSErver ==================== " << endl; //d->mMessageClient->setServer(d->mMessageServer); kdDebug(11001) << "================= KMEssage: Connect ==================== " << endl; - //connect(d->mMessageClient, SIGNAL(broadcastReceived(const QByteArray&, Q_UINT32)), - // this, SLOT(clientMessage(const QByteArray&, Q_UINT32))); - //connect(d->mMessageClient, SIGNAL(forwardReceived(const QByteArray&, Q_UINT32, const QValueList <Q_UINT32> &)), - // this, SLOT(clientMessage(const QByteArray&, Q_UINT32, const QValueList <Q_UINT32> &))); - connect(d->mProcessIO, SIGNAL(received(const QByteArray&)), - this, SLOT(receivedMessage(const QByteArray&))); + //connect(d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, Q_UINT32)), + // this, TQT_SLOT(clientMessage(const TQByteArray&, Q_UINT32))); + //connect(d->mMessageClient, TQT_SIGNAL(forwardReceived(const TQByteArray&, Q_UINT32, const TQValueList <Q_UINT32> &)), + // this, TQT_SLOT(clientMessage(const TQByteArray&, Q_UINT32, const TQValueList <Q_UINT32> &))); + connect(d->mProcessIO, TQT_SIGNAL(received(const TQByteArray&)), + this, TQT_SLOT(receivedMessage(const TQByteArray&))); //kdDebug(11001) << "Our client is id="<<d->mMessageClient->id() << endl; } @@ -300,8 +300,8 @@ void KGameProcessIO::initIO(KPlayer *p) { KGameIO::initIO(p); // Send 'hello' to process - QByteArray buffer; - QDataStream stream(buffer, IO_WriteOnly); + TQByteArray buffer; + TQDataStream stream(buffer, IO_WriteOnly); Q_INT16 id = p->userId(); stream << id; @@ -326,8 +326,8 @@ void KGameProcessIO::notifyTurn(bool b) return; } bool sendit=true; - QByteArray buffer; - QDataStream stream(buffer,IO_WriteOnly); + TQByteArray buffer; + TQDataStream stream(buffer,IO_WriteOnly); stream << (Q_INT8)b; emit signalPrepareTurn(stream,b,this,&sendit); if (sendit) @@ -338,17 +338,17 @@ void KGameProcessIO::notifyTurn(bool b) } } -void KGameProcessIO::sendSystemMessage(QDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender) +void KGameProcessIO::sendSystemMessage(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender) { sendAllMessages(stream, msgid, receiver, sender, false); } -void KGameProcessIO::sendMessage(QDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender) +void KGameProcessIO::sendMessage(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender) { sendAllMessages(stream, msgid, receiver, sender, true); } -void KGameProcessIO::sendAllMessages(QDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender, bool usermsg) +void KGameProcessIO::sendAllMessages(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender, bool usermsg) { kdDebug(11001) << "==============> KGameProcessIO::sendMessage (usermsg="<<usermsg<<")" << endl; // if (!player()) return ; @@ -361,10 +361,10 @@ void KGameProcessIO::sendAllMessages(QDataStream &stream,int msgid, Q_UINT32 rec kdDebug(11001) << "=============* ProcessIO (" << msgid << "," << receiver << "," << sender << ") ===========" << endl; - QByteArray buffer; - QDataStream ostream(buffer,IO_WriteOnly); - QBuffer *device=(QBuffer *)stream.device(); - QByteArray data=device->buffer();; + TQByteArray buffer; + TQDataStream ostream(buffer,IO_WriteOnly); + TQBuffer *device=(TQBuffer *)stream.device(); + TQByteArray data=device->buffer();; KGameMessage::createHeader(ostream,sender,receiver,msgid); // ostream.writeRawBytes(data.data()+device->at(),data.size()-device->at()); @@ -377,10 +377,10 @@ void KGameProcessIO::sendAllMessages(QDataStream &stream,int msgid, Q_UINT32 rec } } -//void KGameProcessIO::clientMessage(const QByteArray& receiveBuffer, Q_UINT32 clientID, const QValueList <Q_UINT32> &recv) -void KGameProcessIO::receivedMessage(const QByteArray& receiveBuffer) +//void KGameProcessIO::clientMessage(const TQByteArray& receiveBuffer, Q_UINT32 clientID, const TQValueList <Q_UINT32> &recv) +void KGameProcessIO::receivedMessage(const TQByteArray& receiveBuffer) { - QDataStream stream(receiveBuffer,IO_ReadOnly); + TQDataStream stream(receiveBuffer,IO_ReadOnly); int msgid; Q_UINT32 sender; Q_UINT32 receiver; @@ -391,10 +391,10 @@ void KGameProcessIO::receivedMessage(const QByteArray& receiveBuffer) // Cut out the header part...to not confuse network code - QBuffer *buf=(QBuffer *)stream.device(); - QByteArray newbuffer; + TQBuffer *buf=(TQBuffer *)stream.device(); + TQByteArray newbuffer; newbuffer.setRawData(buf->buffer().data()+buf->at(),buf->size()-buf->at()); - QDataStream ostream(newbuffer,IO_ReadOnly); + TQDataStream ostream(newbuffer,IO_ReadOnly); kdDebug(11001) << "Newbuffer size=" << newbuffer.size() << endl; @@ -443,7 +443,7 @@ public: int mPauseCounter; - QTimer* mAdvanceTimer; + TQTimer* mAdvanceTimer; }; KGameComputerIO::KGameComputerIO() : KGameIO() @@ -488,8 +488,8 @@ int KGameComputerIO::reactionPeriod() const void KGameComputerIO::setAdvancePeriod(int ms) { stopAdvancePeriod(); - d->mAdvanceTimer = new QTimer(this); - connect(d->mAdvanceTimer, SIGNAL(timeout()), this, SLOT(advance())); + d->mAdvanceTimer = new TQTimer(this); + connect(d->mAdvanceTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(advance())); d->mAdvanceTimer->start(ms); } diff --git a/libkdegames/kgame/kgameio.h b/libkdegames/kgame/kgameio.h index 4d7e0f5b..82b84740 100644 --- a/libkdegames/kgame/kgameio.h +++ b/libkdegames/kgame/kgameio.h @@ -23,8 +23,8 @@ #ifndef __KGAMEIO_H__ #define __KGAMEIO_H__ -#include <qstring.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqobject.h> #include <kdemacros.h> class KPlayer; class KGame; @@ -128,7 +128,7 @@ public: /** * Send an input message using @ref KPlayer::forwardInput **/ - bool sendInput(QDataStream& stream, bool transmit = true, Q_UINT32 sender = 0); + bool sendInput(TQDataStream& stream, bool transmit = true, Q_UINT32 sender = 0); signals: /** @@ -147,7 +147,7 @@ signals: * * Example: * \code - * void GameWindow::slotPrepareTurn(QDataStream &stream,bool b,KGameIO *input,bool * ) + * void GameWindow::slotPrepareTurn(TQDataStream &stream,bool b,KGameIO *input,bool * ) * { * KPlayer *player=input->player(); * if (!player->myTurn()) return ; @@ -162,7 +162,7 @@ signals: * @param send set this to true to send the generated move using @ref * sendInput **/ - void signalPrepareTurn(QDataStream & stream, bool turn, KGameIO *io, bool * send); + void signalPrepareTurn(TQDataStream & stream, bool turn, KGameIO *io, bool * send); private: @@ -193,13 +193,13 @@ public: * \code * KGameKeyIO *input; * input=new KGameKeyIO(myWidget); - * connect(input,SIGNAL(signalKeyEvent(KGameIO *,QDataStream &,QKeyEvent *,bool *)), - * this,SLOT(slotKeyInput(KGameIO *,QDataStream &,QKeyEvent *,bool *))); + * connect(input,TQT_SIGNAL(signalKeyEvent(KGameIO *,TQDataStream &,TQKeyEvent *,bool *)), + * this,TQT_SLOT(slotKeyInput(KGameIO *,TQDataStream &,TQKeyEvent *,bool *))); * \endcode * * @param parent The parents widget whose keyboard events * should be grabbed */ - KGameKeyIO(QWidget *parent); + KGameKeyIO(TQWidget *parent); virtual ~KGameKeyIO(); /** @@ -228,16 +228,16 @@ signals: * * @param io the IO device we belong to * @param stream the stream where we write our move into - * @param m The QKeyEvent we can evaluate + * @param m The TQKeyEvent we can evaluate * @param eatevent set this to true if we processed the event */ - void signalKeyEvent(KGameIO *io,QDataStream &stream,QKeyEvent *m,bool *eatevent); + void signalKeyEvent(KGameIO *io,TQDataStream &stream,TQKeyEvent *m,bool *eatevent); protected: /** * Internal method to process the events */ - bool eventFilter( QObject *o, QEvent *e ); + bool eventFilter( TQObject *o, TQEvent *e ); }; /** @@ -258,14 +258,14 @@ public: * \code * KGameMouseIO *input; * input=new KGameMouseIO(mView); - * connect(input,SIGNAL(signalMouseEvent(KGameIO *,QDataStream &,QMouseEvent *,bool *)), - * this,SLOT(slotMouseInput(KGameIO *,QDataStream &,QMouseEvent *,bool *))); + * connect(input,TQT_SIGNAL(signalMouseEvent(KGameIO *,TQDataStream &,TQMouseEvent *,bool *)), + * this,TQT_SLOT(slotMouseInput(KGameIO *,TQDataStream &,TQMouseEvent *,bool *))); * \endcode * * @param parent The widget whose events should be captured * @param trackmouse enables mouse tracking (gives mouse move events) */ - KGameMouseIO(QWidget *parent,bool trackmouse=false); + KGameMouseIO(TQWidget *parent,bool trackmouse=false); virtual ~KGameMouseIO(); /** @@ -298,16 +298,16 @@ signals: * * @param io the IO device we belong to * @param stream the stream where we write our move into - * @param m The QMouseEvent we can evaluate + * @param m The TQMouseEvent we can evaluate * @param eatevent set this to true if we processed the event */ - void signalMouseEvent(KGameIO *io,QDataStream &stream,QMouseEvent *m,bool *eatevent); + void signalMouseEvent(KGameIO *io,TQDataStream &stream,TQMouseEvent *m,bool *eatevent); protected: /** * Internal event filter */ - bool eventFilter( QObject *o, QEvent *e ); + bool eventFilter( TQObject *o, TQEvent *e ); }; @@ -332,15 +332,15 @@ public: * \code * KGameProcessIO *input; * input=new KGameProcessIO(executable_file); - * connect(input,SIGNAL(signalPrepareTurn(QDataStream &,bool,KGameIO *,bool *)), - * this,SLOT(slotPrepareTurn(QDataStream &,bool,KGameIO *,bool *))); - * connect(input,SIGNAL(signalProcessQuery(QDataStream &,KGameProcessIO *)), - * this,SLOT(slotProcessQuery(QDataStream &,KGameProcessIO *))); + * connect(input,TQT_SIGNAL(signalPrepareTurn(TQDataStream &,bool,KGameIO *,bool *)), + * this,TQT_SLOT(slotPrepareTurn(TQDataStream &,bool,KGameIO *,bool *))); + * connect(input,TQT_SIGNAL(signalProcessQuery(TQDataStream &,KGameProcessIO *)), + * this,TQT_SLOT(slotProcessQuery(TQDataStream &,KGameProcessIO *))); * \endcode * * @param name the filename of the process to start */ - KGameProcessIO(const QString& name); + KGameProcessIO(const TQString& name); /** * Deletes the process input devices @@ -364,7 +364,7 @@ public: * @param receiver - not used * @param sender - who send the message */ - void sendMessage(QDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender); + void sendMessage(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender); /** * Send a system message to the process. This is analogous to the sendMessage @@ -376,7 +376,7 @@ public: * @param receiver - not used * @param sender - who send the message */ - void sendSystemMessage(QDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender); + void sendSystemMessage(TQDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender); /** * Init this device by setting the player and e.g. sending an @@ -403,13 +403,13 @@ public: /** * Internal ~ombined function for all message handling **/ - void sendAllMessages(QDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender, bool usermsg); + void sendAllMessages(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender, bool usermsg); protected slots: /** * Internal message handler to receive data from the process */ - void receivedMessage(const QByteArray& receiveBuffer); + void receivedMessage(const TQByteArray& receiveBuffer); signals: @@ -423,20 +423,20 @@ signals: * * Example: * \code - * void GameWindow::slotProcessQuery(QDataStream &stream,KGameProcessIO *reply) + * void GameWindow::slotProcessQuery(TQDataStream &stream,KGameProcessIO *reply) * { * int no; * stream >> no; // We assume the process sends us an integer question numner * if (no==1) // but YOU have to do this in the process player * { - * QByteArray buffer; - * QDataStream out(buffer,IO_WriteOnly); + * TQByteArray buffer; + * TQDataStream out(buffer,IO_WriteOnly); * reply->sendSystemMessage(out,4242,0,0); // lets reply something... * } * } * \endcode */ - void signalProcessQuery(QDataStream &stream,KGameProcessIO *me); + void signalProcessQuery(TQDataStream &stream,KGameProcessIO *me); /** * Signal generated when the computer player is added. @@ -448,7 +448,7 @@ signals: * @param p the player itself * @param send set this to false if no move should be generated */ - void signalIOAdded(KGameIO *game,QDataStream &stream,KPlayer *p,bool *send); + void signalIOAdded(KGameIO *game,TQDataStream &stream,KPlayer *p,bool *send); protected: @@ -497,7 +497,7 @@ public: int reactionPeriod() const; /** - * Start a QTimer which calls advance every @p ms milli seconds. + * Start a TQTimer which calls advance every @p ms milli seconds. **/ void setAdvancePeriod(int ms); @@ -525,18 +525,18 @@ public: public slots: /** - * Works kind of similar to QCanvas::advance. Increase the internal + * Works kind of similar to TQCanvas::advance. Increase the internal * advance counter. If @p reactionPeriod is reached the counter is set back to * 0 and @ref signalReaction is emitted. This is when the player is meant * to do something (move its units or so). * - * This is very useful if you use QCanvas as you can use this in your - * QCanvas::advance call. The advantage is that if you change the speed - * of the game (i.e. change QCanvas::setAdvancePeriod) the computer + * This is very useful if you use TQCanvas as you can use this in your + * TQCanvas::advance call. The advantage is that if you change the speed + * of the game (i.e. change TQCanvas::setAdvancePeriod) the computer * player gets slower as well. * - * If you don't use QCanvas you can use setAdvancePeriod to get - * the same result. Alternatively you can just use a QTimer. + * If you don't use TQCanvas you can use setAdvancePeriod to get + * the same result. Alternatively you can just use a TQTimer. * **/ virtual void advance(); diff --git a/libkdegames/kgame/kgamemessage.cpp b/libkdegames/kgame/kgamemessage.cpp index 6464d407..228708e9 100644 --- a/libkdegames/kgame/kgamemessage.cpp +++ b/libkdegames/kgame/kgamemessage.cpp @@ -60,38 +60,38 @@ bool KGameMessage::isGame(Q_UINT32 msgid) } -void KGameMessage::createHeader(QDataStream &msg,Q_UINT32 sender,Q_UINT32 receiver,int msgid) +void KGameMessage::createHeader(TQDataStream &msg,Q_UINT32 sender,Q_UINT32 receiver,int msgid) { msg << (Q_INT16)sender << (Q_INT16)receiver << (Q_INT16)msgid; } -void KGameMessage::extractHeader(QDataStream &msg,Q_UINT32 &sender,Q_UINT32 &receiver,int &msgid) +void KGameMessage::extractHeader(TQDataStream &msg,Q_UINT32 &sender,Q_UINT32 &receiver,int &msgid) { Q_INT16 d3,d4,d5; msg >> d3 >> d4 >> d5; sender=d3;receiver=d4;msgid=d5; } -void KGameMessage::createPropertyHeader(QDataStream &msg,int id) +void KGameMessage::createPropertyHeader(TQDataStream &msg,int id) { msg << (Q_INT16)id; } -void KGameMessage::extractPropertyHeader(QDataStream &msg,int &id) +void KGameMessage::extractPropertyHeader(TQDataStream &msg,int &id) { Q_INT16 d1; msg >> d1; id=d1; } -void KGameMessage::createPropertyCommand(QDataStream &msg,int cmdid,int pid,int cmd) +void KGameMessage::createPropertyCommand(TQDataStream &msg,int cmdid,int pid,int cmd) { createPropertyHeader(msg,cmdid); msg << (Q_INT16)pid ; msg << (Q_INT8)cmd ; } -void KGameMessage::extractPropertyCommand(QDataStream &msg,int &pid,int &cmd) +void KGameMessage::extractPropertyCommand(TQDataStream &msg,int &pid,int &cmd) { Q_INT16 d1; Q_INT8 d2; @@ -105,7 +105,7 @@ int KGameMessage::version() return MESSAGE_VERSION; } -QString KGameMessage::messageId2Text(int msgid) +TQString KGameMessage::messageId2Text(int msgid) { // this should contain all KGameMessage::GameMessageIds // feel free to add missing ones, to remove obsolete one and even feel free to @@ -151,6 +151,6 @@ QString KGameMessage::messageId2Text(int msgid) return i18n("Player ID"); case KGameMessage::IdUser: // IdUser must be unknown for use, too! default: - return QString::null; + return TQString::null; } } diff --git a/libkdegames/kgame/kgamemessage.h b/libkdegames/kgame/kgamemessage.h index 4394b4fa..d671a948 100644 --- a/libkdegames/kgame/kgamemessage.h +++ b/libkdegames/kgame/kgamemessage.h @@ -23,7 +23,7 @@ #ifndef __KGAMEMSG_H_ #define __KGAMEMSG_H_ -#include <qdatastream.h> +#include <tqdatastream.h> #include <kdemacros.h> class KDE_EXPORT KGameMessage @@ -85,34 +85,34 @@ class KDE_EXPORT KGameMessage * (message length and magic cookie). If you don't need them remove them * with @ref dropExternalHeader */ - static void createHeader(QDataStream &msg, Q_UINT32 sender, Q_UINT32 receiver, int msgid); + static void createHeader(TQDataStream &msg, Q_UINT32 sender, Q_UINT32 receiver, int msgid); /** * Retrieves the information like cookie,sender,receiver,... from a message header * * Note that it could be necessary to call @ref dropExternalHeader first */ - static void extractHeader(QDataStream &msg,Q_UINT32 &sender, Q_UINT32 &receiver, int &msgid); + static void extractHeader(TQDataStream &msg,Q_UINT32 &sender, Q_UINT32 &receiver, int &msgid); /** * Creates a property header given the property id */ - static void createPropertyHeader(QDataStream &msg, int id); + static void createPropertyHeader(TQDataStream &msg, int id); /** * Retrieves the property id from a property message header */ - static void extractPropertyHeader(QDataStream &msg, int &id); + static void extractPropertyHeader(TQDataStream &msg, int &id); /** * Creates a property header given the property id */ - static void createPropertyCommand(QDataStream &msg, int cmdid, int pid, int cmd); + static void createPropertyCommand(TQDataStream &msg, int cmdid, int pid, int cmd); /** * Retrieves the property id from a property message header */ - static void extractPropertyCommand(QDataStream &msg, int &pid, int &cmd); + static void extractPropertyCommand(TQDataStream &msg, int &pid, int &cmd); /** * @return Version of the network library @@ -124,10 +124,10 @@ class KDE_EXPORT KGameMessage * suitable string for it. This string can't be used to identify a message * (as it is i18n'ed) but it can make debugging more easy. See also @ref * KGameDebugDialog. - * @return Either a i18n'ed string (the name of the id) or QString::null if + * @return Either a i18n'ed string (the name of the id) or TQString::null if * the msgid is unknown **/ - static QString messageId2Text(int msgid); + static TQString messageId2Text(int msgid); /** diff --git a/libkdegames/kgame/kgamenetwork.cpp b/libkdegames/kgame/kgamenetwork.cpp index 9eccb868..92669834 100644 --- a/libkdegames/kgame/kgamenetwork.cpp +++ b/libkdegames/kgame/kgamenetwork.cpp @@ -33,7 +33,7 @@ #include <kdebug.h> -#include <qbuffer.h> +#include <tqbuffer.h> class KGameNetworkPrivate @@ -52,14 +52,14 @@ public: KMessageServer* mMessageServer; Q_UINT32 mDisconnectId; // Stores gameId() over a disconnect process DNSSD::PublicService* mService; - QString mType; - QString mName; + TQString mType; + TQString mName; int mCookie; }; // ------------------- NETWORK GAME ------------------------ -KGameNetwork::KGameNetwork(int c, QObject* parent) : QObject(parent, 0) +KGameNetwork::KGameNetwork(int c, TQObject* parent) : TQObject(parent, 0) { d = new KGameNetworkPrivate; d->mCookie = (Q_INT16)c; @@ -120,25 +120,25 @@ void KGameNetwork::setMaster() } if (!d->mMessageClient) { d->mMessageClient = new KMessageClient (this); - connect (d->mMessageClient, SIGNAL(broadcastReceived(const QByteArray&, Q_UINT32)), - this, SLOT(receiveNetworkTransmission(const QByteArray&, Q_UINT32))); - connect (d->mMessageClient, SIGNAL(connectionBroken()), - this, SIGNAL(signalConnectionBroken())); - connect (d->mMessageClient, SIGNAL(aboutToDisconnect(Q_UINT32)), - this, SLOT(aboutToLoseConnection(Q_UINT32))); - connect (d->mMessageClient, SIGNAL(connectionBroken()), - this, SLOT(slotResetConnection())); - - connect (d->mMessageClient, SIGNAL(adminStatusChanged(bool)), - this, SLOT(slotAdminStatusChanged(bool))); - connect (d->mMessageClient, SIGNAL(eventClientConnected(Q_UINT32)), - this, SIGNAL(signalClientConnected(Q_UINT32))); - connect (d->mMessageClient, SIGNAL(eventClientDisconnected(Q_UINT32, bool)), - this, SIGNAL(signalClientDisconnected(Q_UINT32, bool))); + connect (d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, Q_UINT32)), + this, TQT_SLOT(receiveNetworkTransmission(const TQByteArray&, Q_UINT32))); + connect (d->mMessageClient, TQT_SIGNAL(connectionBroken()), + this, TQT_SIGNAL(signalConnectionBroken())); + connect (d->mMessageClient, TQT_SIGNAL(aboutToDisconnect(Q_UINT32)), + this, TQT_SLOT(aboutToLoseConnection(Q_UINT32))); + connect (d->mMessageClient, TQT_SIGNAL(connectionBroken()), + this, TQT_SLOT(slotResetConnection())); + + connect (d->mMessageClient, TQT_SIGNAL(adminStatusChanged(bool)), + this, TQT_SLOT(slotAdminStatusChanged(bool))); + connect (d->mMessageClient, TQT_SIGNAL(eventClientConnected(Q_UINT32)), + this, TQT_SIGNAL(signalClientConnected(Q_UINT32))); + connect (d->mMessageClient, TQT_SIGNAL(eventClientDisconnected(Q_UINT32, bool)), + this, TQT_SIGNAL(signalClientDisconnected(Q_UINT32, bool))); // broacast and direct messages are treated equally on receive. - connect (d->mMessageClient, SIGNAL(forwardReceived(const QByteArray&, Q_UINT32, const QValueList<Q_UINT32>&)), - d->mMessageClient, SIGNAL(broadcastReceived(const QByteArray&, Q_UINT32))); + connect (d->mMessageClient, TQT_SIGNAL(forwardReceived(const TQByteArray&, Q_UINT32, const TQValueList<Q_UINT32>&)), + d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, Q_UINT32))); } else { // should be no problem but still has to be tested @@ -147,7 +147,7 @@ void KGameNetwork::setMaster() d->mMessageClient->setServer(d->mMessageServer); } -void KGameNetwork::setDiscoveryInfo(const QString& type, const QString& name) +void KGameNetwork::setDiscoveryInfo(const TQString& type, const TQString& name) { kdDebug() << k_funcinfo << type << ":" << name << endl; d->mType = type; @@ -201,7 +201,7 @@ bool KGameNetwork::offerConnections(Q_UINT16 port) return true; } -bool KGameNetwork::connectToServer (const QString& host, Q_UINT16 port) +bool KGameNetwork::connectToServer (const TQString& host, Q_UINT16 port) { if (host.isEmpty()) { kdError(11001) << k_funcinfo << "No hostname given" << endl; @@ -251,7 +251,7 @@ Q_UINT16 KGameNetwork::port() const return 0; } -QString KGameNetwork::hostName() const +TQString KGameNetwork::hostName() const { return d->mMessageClient->peerName(); } @@ -276,8 +276,8 @@ void KGameNetwork::disconnect() kdDebug(11001) << k_funcinfo << endl; stopServerConnection(); if (d->mMessageServer) { - QValueList <Q_UINT32> list=d->mMessageServer->clientIDs(); - QValueList<Q_UINT32>::Iterator it; + TQValueList <Q_UINT32> list=d->mMessageServer->clientIDs(); + TQValueList<Q_UINT32>::Iterator it; for( it = list.begin(); it != list.end(); ++it ) { kdDebug(11001) << "Client id=" << (*it) << endl; @@ -338,8 +338,8 @@ void KGameNetwork::electAdmin(Q_UINT32 clientID) kdWarning(11001) << k_funcinfo << "only ADMIN is allowed to call this!" << endl; return; } - QByteArray buffer; - QDataStream stream(buffer,IO_WriteOnly); + TQByteArray buffer; + TQDataStream stream(buffer,IO_WriteOnly); stream << static_cast<Q_UINT32>( KMessageServer::REQ_ADMIN_CHANGE ); stream << clientID; d->mMessageClient->sendServerMessage(buffer); @@ -351,8 +351,8 @@ void KGameNetwork::setMaxClients(int max) kdWarning(11001) << k_funcinfo << "only ADMIN is allowed to call this!" << endl; return; } - QByteArray buffer; - QDataStream stream(buffer,IO_WriteOnly); + TQByteArray buffer; + TQDataStream stream(buffer,IO_WriteOnly); stream << static_cast<Q_UINT32>( KMessageServer::REQ_MAX_NUM_CLIENTS ); stream << (Q_INT32)max; d->mMessageClient->sendServerMessage(buffer); @@ -376,27 +376,27 @@ void KGameNetwork::unlock() bool KGameNetwork::sendSystemMessage(int data, int msgid, Q_UINT32 receiver, Q_UINT32 sender) { - QByteArray buffer; - QDataStream stream(buffer,IO_WriteOnly); + TQByteArray buffer; + TQDataStream stream(buffer,IO_WriteOnly); stream << data; return sendSystemMessage(buffer,msgid,receiver,sender); } -bool KGameNetwork::sendSystemMessage(const QString &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender) +bool KGameNetwork::sendSystemMessage(const TQString &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender) { - QByteArray buffer; - QDataStream stream(buffer, IO_WriteOnly); + TQByteArray buffer; + TQDataStream stream(buffer, IO_WriteOnly); stream << msg; return sendSystemMessage(buffer, msgid, receiver, sender); } -bool KGameNetwork::sendSystemMessage(const QDataStream &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender) -{ return sendSystemMessage(((QBuffer*)msg.device())->buffer(), msgid, receiver, sender); } +bool KGameNetwork::sendSystemMessage(const TQDataStream &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender) +{ return sendSystemMessage(((TQBuffer*)msg.device())->buffer(), msgid, receiver, sender); } -bool KGameNetwork::sendSystemMessage(const QByteArray& data, int msgid, Q_UINT32 receiver, Q_UINT32 sender) +bool KGameNetwork::sendSystemMessage(const TQByteArray& data, int msgid, Q_UINT32 receiver, Q_UINT32 sender) { - QByteArray buffer; - QDataStream stream(buffer,IO_WriteOnly); + TQByteArray buffer; + TQDataStream stream(buffer,IO_WriteOnly); if (!sender) { sender = gameId(); } @@ -438,19 +438,19 @@ bool KGameNetwork::sendSystemMessage(const QByteArray& data, int msgid, Q_UINT32 bool KGameNetwork::sendMessage(int data, int msgid, Q_UINT32 receiver, Q_UINT32 sender) { return sendSystemMessage(data,msgid+KGameMessage::IdUser,receiver,sender); } -bool KGameNetwork::sendMessage(const QString &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender) +bool KGameNetwork::sendMessage(const TQString &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender) { return sendSystemMessage(msg,msgid+KGameMessage::IdUser,receiver,sender); } -bool KGameNetwork::sendMessage(const QDataStream &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender) +bool KGameNetwork::sendMessage(const TQDataStream &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender) { return sendSystemMessage(msg, msgid+KGameMessage::IdUser, receiver, sender); } -bool KGameNetwork::sendMessage(const QByteArray &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender) +bool KGameNetwork::sendMessage(const TQByteArray &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender) { return sendSystemMessage(msg, msgid+KGameMessage::IdUser, receiver, sender); } -void KGameNetwork::sendError(int error,const QByteArray& message, Q_UINT32 receiver, Q_UINT32 sender) +void KGameNetwork::sendError(int error,const TQByteArray& message, Q_UINT32 receiver, Q_UINT32 sender) { - QByteArray buffer; - QDataStream stream(buffer,IO_WriteOnly); + TQByteArray buffer; + TQDataStream stream(buffer,IO_WriteOnly); stream << (Q_INT32) error; stream.writeRawBytes(message.data(), message.size()); sendSystemMessage(stream,KGameMessage::IdError,receiver,sender); @@ -458,9 +458,9 @@ void KGameNetwork::sendError(int error,const QByteArray& message, Q_UINT32 recei // ----------------- receive messages from the network -void KGameNetwork::receiveNetworkTransmission(const QByteArray& receiveBuffer, Q_UINT32 clientID) +void KGameNetwork::receiveNetworkTransmission(const TQByteArray& receiveBuffer, Q_UINT32 clientID) { - QDataStream stream(receiveBuffer, IO_ReadOnly); + TQDataStream stream(receiveBuffer, IO_ReadOnly); int msgid; Q_UINT32 sender; // the id of the KGame/KPlayer who sent the message Q_UINT32 receiver; // the id of the KGame/KPlayer the message is for @@ -480,7 +480,7 @@ void KGameNetwork::receiveNetworkTransmission(const QByteArray& receiveBuffer, Q } else if (msgid==KGameMessage::IdError) { - QString text; + TQString text; Q_INT32 error; stream >> error; kdDebug(11001) << k_funcinfo << "Got IdError " << error << endl; diff --git a/libkdegames/kgame/kgamenetwork.h b/libkdegames/kgame/kgamenetwork.h index 6ff5cf94..47276d06 100644 --- a/libkdegames/kgame/kgamenetwork.h +++ b/libkdegames/kgame/kgamenetwork.h @@ -23,8 +23,8 @@ #ifndef __KGAMENETWORK_H_ #define __KGAMENETWORK_H_ -#include <qstring.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqobject.h> #include <kdemacros.h> class KGameIO; class KMessageClient; @@ -51,7 +51,7 @@ public: /** * Create a KGameNetwork object */ - KGameNetwork(int cookie=42,QObject* parent=0); + KGameNetwork(int cookie=42,TQObject* parent=0); virtual ~KGameNetwork(); /** @@ -120,7 +120,7 @@ public: * set hostname will be used. In case of name conflict -2, -3 and so on will be added to name. * @since 3.4 **/ - void setDiscoveryInfo(const QString& type, const QString& name=QString::null); + void setDiscoveryInfo(const TQString& type, const TQString& name=TQString::null); /** * Inits a network game as a network CLIENT @@ -130,7 +130,7 @@ public: * * @return true if connected **/ - bool connectToServer(const QString& host, Q_UINT16 port); + bool connectToServer(const TQString& host, Q_UINT16 port); /** * @since 3.2 @@ -146,7 +146,7 @@ public: * isNetwork is TRUE and we are not the MASTER, i.e. if connectToServer * was called. Otherwise this will return "localhost". **/ - QString hostName() const; + TQString hostName() const; /** * Stops offering server connections - only for game MASTER @@ -189,7 +189,7 @@ public: * @return true if worked */ // AB: TODO: doc on how "receiver" and "sender" should be created! - bool sendSystemMessage(const QByteArray& buffer, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); + bool sendSystemMessage(const TQByteArray& buffer, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); /** * @overload @@ -199,12 +199,12 @@ public: /** * @overload **/ - bool sendSystemMessage(const QDataStream &msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); + bool sendSystemMessage(const TQDataStream &msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); /** * @overload **/ - bool sendSystemMessage(const QString& msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); + bool sendSystemMessage(const TQString& msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); /** * Sends a network message @@ -217,7 +217,7 @@ public: * the correct value for you. You might want to use this if you send a * message from a specific player. **/ - void sendError(int error, const QByteArray& message, Q_UINT32 receiver=0, Q_UINT32 sender=0); + void sendError(int error, const TQByteArray& message, Q_UINT32 receiver=0, Q_UINT32 sender=0); /** * Are we still offer offering server connections - only for game MASTER @@ -265,17 +265,17 @@ public: * @return true if worked **/ // AB: TODO: doc on how "receiver" and "sender" should be created! - bool sendMessage(const QByteArray& buffer, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); + bool sendMessage(const TQByteArray& buffer, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); /** * This is an overloaded member function, provided for convenience. **/ - bool sendMessage(const QDataStream &msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); + bool sendMessage(const TQDataStream &msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); /** * This is an overloaded member function, provided for convenience. **/ - bool sendMessage(const QString& msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); + bool sendMessage(const TQString& msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); /** * This is an overloaded member function, provided for convenience. @@ -287,7 +287,7 @@ public: * Called by ReceiveNetworkTransmission(). Will be overwritten by * KGame and handle the incoming message. **/ - virtual void networkTransmission(QDataStream&, int, Q_UINT32, Q_UINT32, Q_UINT32 clientID) = 0; + virtual void networkTransmission(TQDataStream&, int, Q_UINT32, Q_UINT32, Q_UINT32 clientID) = 0; /** @@ -345,7 +345,7 @@ signals: * @param error the error code * @param text the error text */ - void signalNetworkErrorMessage(int error, QString text); + void signalNetworkErrorMessage(int error, TQString text); /** * Our connection to the KMessageServer has broken. @@ -401,7 +401,7 @@ protected slots: * If it is valid, the pure virtual method networkTransmission() is called. * (This one is overwritten in KGame.) **/ - void receiveNetworkTransmission(const QByteArray& a, Q_UINT32 clientID); + void receiveNetworkTransmission(const TQByteArray& a, Q_UINT32 clientID); /** * This KGame object receives or loses the admin status. diff --git a/libkdegames/kgame/kgameprocess.cpp b/libkdegames/kgame/kgameprocess.cpp index 96efe0ce..ffbf0936 100644 --- a/libkdegames/kgame/kgameprocess.cpp +++ b/libkdegames/kgame/kgameprocess.cpp @@ -29,9 +29,9 @@ #include <krandomsequence.h> -#include <qbuffer.h> -#include <qdatastream.h> -#include <qcstring.h> +#include <tqbuffer.h> +#include <tqdatastream.h> +#include <tqcstring.h> #include <assert.h> #include <stdio.h> @@ -43,7 +43,7 @@ // ----------------------- Process Child --------------------------- -KGameProcess::KGameProcess() : QObject(0,0) +KGameProcess::KGameProcess() : TQObject(0,0) { mTerminate=false; // Check whether a player is set. If not create one! @@ -52,10 +52,10 @@ KGameProcess::KGameProcess() : QObject(0,0) mMessageIO=new KMessageFilePipe(this,&rFile,&wFile); // mMessageClient=new KMessageClient(this); // mMessageClient->setServer(mMessageIO); -// connect (mMessageClient, SIGNAL(broadcastReceived(const QByteArray&, Q_UINT32)), -// this, SLOT(receivedMessage(const QByteArray&, Q_UINT32))); - connect (mMessageIO, SIGNAL(received(const QByteArray&)), - this, SLOT(receivedMessage(const QByteArray&))); +// connect (mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, Q_UINT32)), +// this, TQT_SLOT(receivedMessage(const TQByteArray&, Q_UINT32))); + connect (mMessageIO, TQT_SIGNAL(received(const TQByteArray&)), + this, TQT_SLOT(receivedMessage(const TQByteArray&))); fprintf(stderr,"KGameProcess::constructor %p %p\n",&rFile,&wFile); mRandom = new KRandomSequence; @@ -85,17 +85,17 @@ bool KGameProcess::exec(int argc, char *argv[]) } // You have to do this to create a message -// QByteArray buffer; -// QDataStream wstream(buffer,IO_WriteOnly); +// TQByteArray buffer; +// TQDataStream wstream(buffer,IO_WriteOnly); // then stream data into the stream and call this function -void KGameProcess::sendSystemMessage(QDataStream &stream,int msgid,Q_UINT32 receiver) +void KGameProcess::sendSystemMessage(TQDataStream &stream,int msgid,Q_UINT32 receiver) { fprintf(stderr,"KGameProcess::sendMessage id=%d recv=%d",msgid,receiver); - QByteArray a; - QDataStream outstream(a,IO_WriteOnly); + TQByteArray a; + TQDataStream outstream(a,IO_WriteOnly); - QBuffer *device=(QBuffer *)stream.device(); - QByteArray data=device->buffer();; + TQBuffer *device=(TQBuffer *)stream.device(); + TQByteArray data=device->buffer();; KGameMessage::createHeader(outstream,0,receiver,msgid); outstream.writeRawBytes(data.data(),data.size()); @@ -107,7 +107,7 @@ void KGameProcess::sendSystemMessage(QDataStream &stream,int msgid,Q_UINT32 rece if (mMessageIO) mMessageIO->send(a); } -void KGameProcess::sendMessage(QDataStream &stream,int msgid,Q_UINT32 receiver) +void KGameProcess::sendMessage(TQDataStream &stream,int msgid,Q_UINT32 receiver) { sendSystemMessage(stream,msgid+KGameMessage::IdUser,receiver); } @@ -129,9 +129,9 @@ void KGameProcess::processArgs(int argc, char *argv[]) fflush(stderr); } -void KGameProcess::receivedMessage(const QByteArray& receiveBuffer) +void KGameProcess::receivedMessage(const TQByteArray& receiveBuffer) { - QDataStream stream(receiveBuffer, IO_ReadOnly); + TQDataStream stream(receiveBuffer, IO_ReadOnly); int msgid; Q_UINT32 sender; Q_UINT32 receiver; diff --git a/libkdegames/kgame/kgameprocess.h b/libkdegames/kgame/kgameprocess.h index a8db4fcd..ac6389be 100644 --- a/libkdegames/kgame/kgameprocess.h +++ b/libkdegames/kgame/kgameprocess.h @@ -23,9 +23,9 @@ #ifndef __KGAMEPROCESS_H_ #define __KGAMEPROCESS_H_ -#include <qstring.h> -#include <qobject.h> -#include <qfile.h> +#include <tqstring.h> +#include <tqobject.h> +#include <tqfile.h> #include "kgameproperty.h" #include <krandomsequence.h> @@ -60,12 +60,12 @@ class KDE_EXPORT KGameProcess: public QObject * int main(int argc ,char * argv[]) * { * KGameProcess proc; - * connect(&proc,SIGNAL(signalCommand(QDataStream &,int ,int ,int )), - * this,SLOT(slotCommand(QDataStream & ,int ,int ,int ))); - * connect(&proc,SIGNAL(signalInit(QDataStream &,int)), - * this,SLOT(slotInit(QDataStream & ,int ))); - * connect(&proc,SIGNAL(signalTurn(QDataStream &,bool )), - * this,SLOT(slotTurn(QDataStream & ,bool ))); + * connect(&proc,TQT_SIGNAL(signalCommand(TQDataStream &,int ,int ,int )), + * this,TQT_SLOT(slotCommand(TQDataStream & ,int ,int ,int ))); + * connect(&proc,TQT_SIGNAL(signalInit(TQDataStream &,int)), + * this,TQT_SLOT(slotInit(TQDataStream & ,int ))); + * connect(&proc,TQT_SIGNAL(signalTurn(TQDataStream &,bool )), + * this,TQT_SLOT(slotTurn(TQDataStream & ,bool ))); * return proc.exec(argc,argv); * } * \endcode @@ -103,11 +103,11 @@ class KDE_EXPORT KGameProcess: public QObject * device. Works like the sendSystemMessage but * for user id's * - * @param stream the QDataStream containing the message + * @param stream the TQDataStream containing the message * @param msgid the message id for the message * @param receiver unused */ - void sendMessage(QDataStream &stream,int msgid,Q_UINT32 receiver=0); + void sendMessage(TQDataStream &stream,int msgid,Q_UINT32 receiver=0); /** * Sends a system message to the corresonding KGameIO device. @@ -117,18 +117,18 @@ class KDE_EXPORT KGameProcess: public QObject * game relevant data from here. * Exmaple for a query: * \code - * QByteArray buffer; - * QDataStream out(buffer,IO_WriteOnly); + * TQByteArray buffer; + * TQDataStream out(buffer,IO_WriteOnly); * int msgid=KGameMessage::IdProcessQuery; * out << (int)1; * proc.sendSystemMessage(out,msgid,0); * \endcode * - * @param stream the QDataStream containing the message + * @param stream the TQDataStream containing the message * @param msgid the message id for the message * @param receiver unused */ - void sendSystemMessage(QDataStream &stream,int msgid,Q_UINT32 receiver=0); + void sendSystemMessage(TQDataStream &stream,int msgid,Q_UINT32 receiver=0); /** * Returns a pointer to a KRandomSequence. You can generate @@ -153,7 +153,7 @@ class KDE_EXPORT KGameProcess: public QObject * A message is received via the interprocess connection. The * appropriate signals are called. */ - void receivedMessage(const QByteArray& receiveBuffer); + void receivedMessage(const TQByteArray& receiveBuffer); signals: /** @@ -162,7 +162,7 @@ class KDE_EXPORT KGameProcess: public QObject * All signals but IdIOAdded and IdTurn end up here! * Example: * \code - * void Computer::slotCommand(int &msgid,QDataStream &in,QDataStream &out) + * void Computer::slotCommand(int &msgid,TQDataStream &in,TQDataStream &out) * { * Q_INT32 data,move; * in >> data; @@ -177,7 +177,7 @@ class KDE_EXPORT KGameProcess: public QObject * @param receiver the id of the receiver * @param sender the id of the sender */ - void signalCommand(QDataStream &inputStream,int msgid,int receiver,int sender); + void signalCommand(TQDataStream &inputStream,int msgid,int receiver,int sender); /** * This signal is emmited if the computer player should perform a turn. @@ -190,12 +190,12 @@ class KDE_EXPORT KGameProcess: public QObject * stream here. * Example: * \code - * void slotTurn(QDataStream &in,bool turn) + * void slotTurn(TQDataStream &in,bool turn) * { * int id; * int recv; - * QByteArray buffer; - * QDataStream out(buffer,IO_WriteOnly); + * TQByteArray buffer; + * TQDataStream out(buffer,IO_WriteOnly); * if (turn) * { * // Create a move - the format is yours to decide @@ -216,7 +216,7 @@ class KDE_EXPORT KGameProcess: public QObject * @param turn True or false whether the turn is activated or deactivated * */ - void signalTurn(QDataStream &stream,bool turn); + void signalTurn(TQDataStream &stream,bool turn); /** * This signal is emmited when the process is initialized, i.e. added @@ -229,14 +229,14 @@ class KDE_EXPORT KGameProcess: public QObject * @param stream The datastream which contains user data * @param userid The userId of the player. (Careful to rely on it yet) */ - void signalInit(QDataStream &stream,int userid); + void signalInit(TQDataStream &stream,int userid); protected: bool mTerminate; KMessageFilePipe *mMessageIO; private: - QFile rFile; - QFile wFile; + TQFile rFile; + TQFile wFile; KRandomSequence* mRandom; }; #endif diff --git a/libkdegames/kgame/kgameproperty.cpp b/libkdegames/kgame/kgameproperty.cpp index 68a33bcb..3b8c3109 100644 --- a/libkdegames/kgame/kgameproperty.cpp +++ b/libkdegames/kgame/kgameproperty.cpp @@ -76,19 +76,19 @@ void KGamePropertyBase::init() setPolicy(PolicyLocal); } -int KGamePropertyBase::registerData(int id, KGame* owner, QString name) +int KGamePropertyBase::registerData(int id, KGame* owner, TQString name) { return registerData(id, owner->dataHandler(), name); } -int KGamePropertyBase::registerData(int id, KPlayer* owner, QString name) +int KGamePropertyBase::registerData(int id, KPlayer* owner, TQString name) { return registerData(id, owner->dataHandler(), name); } -int KGamePropertyBase::registerData( KGamePropertyHandler* owner,PropertyPolicy p, QString name) +int KGamePropertyBase::registerData( KGamePropertyHandler* owner,PropertyPolicy p, TQString name) { return registerData(-1, owner,p, name); } -int KGamePropertyBase::registerData(int id, KGamePropertyHandler* owner, QString name) +int KGamePropertyBase::registerData(int id, KGamePropertyHandler* owner, TQString name) { return registerData(id, owner,PolicyUndefined, name); } -int KGamePropertyBase::registerData(int id, KGamePropertyHandler* owner,PropertyPolicy p, QString name) +int KGamePropertyBase::registerData(int id, KGamePropertyHandler* owner,PropertyPolicy p, TQString name) { // we don't support changing the id if (!owner) { @@ -123,8 +123,8 @@ void KGamePropertyBase::unregisterData() bool KGamePropertyBase::sendProperty() { - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); KGameMessage::createPropertyHeader(s, id()); save(s); if (mOwner) { @@ -135,10 +135,10 @@ bool KGamePropertyBase::sendProperty() } } -bool KGamePropertyBase::sendProperty(const QByteArray& data) +bool KGamePropertyBase::sendProperty(const TQByteArray& data) { - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); KGameMessage::createPropertyHeader(s, id()); s.writeRawBytes(data.data(), data.size()); if (mOwner) { @@ -169,8 +169,8 @@ bool KGamePropertyBase::unlock(bool force) void KGamePropertyBase::setLock(bool l) { - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); KGameMessage::createPropertyCommand(s, IdCommand, id(), CmdLock); s << (Q_INT8)l; @@ -192,7 +192,7 @@ void KGamePropertyBase::emitSignal() } } -void KGamePropertyBase::command(QDataStream& s, int cmd, bool isSender) +void KGamePropertyBase::command(TQDataStream& s, int cmd, bool isSender) { switch (cmd) { case CmdLock: diff --git a/libkdegames/kgame/kgameproperty.h b/libkdegames/kgame/kgameproperty.h index c6915606..04474603 100644 --- a/libkdegames/kgame/kgameproperty.h +++ b/libkdegames/kgame/kgameproperty.h @@ -21,7 +21,7 @@ #ifndef __KGAMEPROPERTY_H_ #define __KGAMEPROPERTY_H_ -#include <qdatastream.h> +#include <tqdatastream.h> #include <kdebug.h> #include <typeinfo> @@ -151,7 +151,7 @@ public: /** * Sets this property to emit a signal on value changed. - * As the proerties do not inehrit QObject for optimisation + * As the proerties do not inehrit TQObject for optimisation * this signal is emited via the KPlayer or KGame object **/ void setEmittingSignal(bool p) { mFlags.bits.emitsignal=p; } @@ -217,12 +217,12 @@ public: * overwrite this method in order to use this class * @param s The stream to read from **/ - virtual void load(QDataStream& s) = 0; + virtual void load(TQDataStream& s) = 0; /** * Write the value into a stream. MUST be overwritten **/ - virtual void save(QDataStream& s) = 0; + virtual void save(TQDataStream& s) = 0; /** * send a command to advanced properties like arrays @@ -230,7 +230,7 @@ public: * @param msgid The ID of the command - see PropertyCommandIds * @param isSender whether this client is also the sender of the command **/ - virtual void command(QDataStream &stream, int msgid, bool isSender=false); + virtual void command(TQDataStream &stream, int msgid, bool isSender=false); /** * @return The id of this property @@ -261,25 +261,25 @@ public: * @param name if not 0 you can assign a name to this property * **/ - int registerData(int id, KGamePropertyHandler* owner,PropertyPolicy p, QString name=0); + int registerData(int id, KGamePropertyHandler* owner,PropertyPolicy p, TQString name=0); /** * This is an overloaded member function, provided for convenience. * It differs from the above function only in what argument(s) it accepts. **/ - int registerData(int id, KGamePropertyHandler* owner, QString name=0); + int registerData(int id, KGamePropertyHandler* owner, TQString name=0); /** * This is an overloaded member function, provided for convenience. * It differs from the above function only in what argument(s) it accepts. **/ - int registerData(int id, KGame* owner, QString name=0); + int registerData(int id, KGame* owner, TQString name=0); /** * This is an overloaded member function, provided for convenience. * It differs from the above function only in what argument(s) it accepts. **/ - int registerData(int id, KPlayer* owner, QString name=0); + int registerData(int id, KPlayer* owner, TQString name=0); /** * This is an overloaded member function, provided for convenience. @@ -287,7 +287,7 @@ public: * In particular you can use this function to create properties which * will have an automatic id assigned. The new id is returned. **/ - int registerData(KGamePropertyHandler* owner,PropertyPolicy p=PolicyUndefined, QString name=0); + int registerData(KGamePropertyHandler* owner,PropertyPolicy p=PolicyUndefined, TQString name=0); void unregisterData(); @@ -341,7 +341,7 @@ protected: * @return TRUE if the message could be sent successfully, otherwise * FALSE **/ - bool sendProperty(const QByteArray& b); + bool sendProperty(const TQByteArray& b); /** * Causes the parent object to emit a signal on value change @@ -420,7 +420,7 @@ private: * queues the message. As soon as <em>all</em> messages in the message server * which are before the changed property have been transferred the message * server delivers the new value of the KGameProperty to all clients. A - * QTimer::singleShot is used to queue the messages inside the + * TQTimer::singleShot is used to queue the messages inside the * KMessageServer. * * This means that if you do the following: @@ -433,7 +433,7 @@ private: * then "value" will be "0". initData is used to initialize the property * (e.g. when the KMessageServer is not yet running or can not yet be * reached). This is because "myProperty = 10" or "myProperty.send(10)" send a - * message to the KMessageServer which uses QTimer::singleShot to + * message to the KMessageServer which uses TQTimer::singleShot to * queue the message. The game first has to go back into the event loop where * the message is received. The KGamePropertyHandler receives the new value * sets the property. So if you need the new value you need to store it in a @@ -536,7 +536,7 @@ private: * @section Custom classes: * * If you want to use a custum class with KGameProperty you have to implement the - * operators << and >> for QDataStream: + * operators << and >> for TQDataStream: * \code * class Card * { @@ -544,7 +544,7 @@ private: * int type; * int suite; * }; - * QDataStream& operator<<(QDataStream& stream, Card& card) + * TQDataStream& operator<<(TQDataStream& stream, Card& card) * { * Q_INT16 type = card.type; * Q_INT16 suite = card.suite; @@ -552,7 +552,7 @@ private: * s << suite; * return s; * } - * QDataStream& operator>>(QDataStream& stream, Card& card) + * TQDataStream& operator>>(TQDataStream& stream, Card& card) * { * Q_INT16 type; * Q_INT16 suite; @@ -635,7 +635,7 @@ public: * This function sends a new value over network. * * Note that the value DOES NOT change when you call this function. This - * function saves the value into a QDataStream and calls + * function saves the value into a TQDataStream and calls * sendProperty where it gets forwarded to the owner and finally the * value is sent over network. The KMessageServer now sends the * value to ALL clients - even the one who called this function. As soon @@ -675,8 +675,8 @@ public: if (isLocked()) { return false; } - QByteArray b; - QDataStream stream(b, IO_WriteOnly); + TQByteArray b; + TQDataStream stream(b, IO_WriteOnly); stream << v; if (!sendProperty(b)) { setLocal(v); @@ -751,7 +751,7 @@ public: * Saves the object to a stream. * @param stream The stream to save to **/ - virtual void save(QDataStream &stream) + virtual void save(TQDataStream &stream) { stream << mData; } @@ -777,7 +777,7 @@ public: * Also calls emitSignal if isEmittingSignal is TRUE. * @param s The stream to read from **/ - virtual void load(QDataStream& s) + virtual void load(TQDataStream& s) { s >> mData; setDirty(false); @@ -842,7 +842,7 @@ private: typedef KGameProperty<int> KGamePropertyInt; typedef KGameProperty<unsigned int> KGamePropertyUInt; -typedef KGameProperty<QString> KGamePropertyQString; +typedef KGameProperty<TQString> KGamePropertyQString; typedef KGameProperty<Q_INT8> KGamePropertyBool; #endif diff --git a/libkdegames/kgame/kgamepropertyarray.h b/libkdegames/kgame/kgamepropertyarray.h index f91bd75c..0bb1d1a1 100644 --- a/libkdegames/kgame/kgamepropertyarray.h +++ b/libkdegames/kgame/kgamepropertyarray.h @@ -21,7 +21,7 @@ #ifndef __KGAMEPROPERTYARRAY_H_ #define __KGAMEPROPERTYARRAY_H_ -#include <qdatastream.h> +#include <tqdatastream.h> #include <kdebug.h> #include "kgamemessage.h" @@ -30,10 +30,10 @@ template<class type> -class KGamePropertyArray : public QMemArray<type>, public KGamePropertyBase +class KGamePropertyArray : public TQMemArray<type>, public KGamePropertyBase { public: - KGamePropertyArray() :QMemArray<type>(), KGamePropertyBase() + KGamePropertyArray() :TQMemArray<type>(), KGamePropertyBase() { //kdDebug(11001) << "KGamePropertyArray init" << endl; } @@ -43,17 +43,17 @@ public: resize(size); } - KGamePropertyArray( const KGamePropertyArray<type> &a ) : QMemArray<type>(a) + KGamePropertyArray( const KGamePropertyArray<type> &a ) : TQMemArray<type>(a) { } bool resize( uint size ) { - if (size!=QMemArray<type>::size()) + if (size!=TQMemArray<type>::size()) { bool a=true; - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdResize); s << size ; if (policy()==PolicyClean || policy()==PolicyDirty) @@ -66,7 +66,7 @@ public: if (policy()==PolicyLocal || policy()==PolicyDirty) { extractProperty(b); -// a=QMemArray<type>::resize(size);// FIXME: return value! +// a=TQMemArray<type>::resize(size);// FIXME: return value! } return a; } @@ -75,8 +75,8 @@ public: void setAt(uint i,type data) { - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdAt); s << i ; s << data; @@ -96,12 +96,12 @@ public: type at( uint i ) const { - return QMemArray<type>::at(i); + return TQMemArray<type>::at(i); } type operator[]( int i ) const { - return QMemArray<type>::at(i); + return TQMemArray<type>::at(i); } KGamePropertyArray<type> &operator=(const KGamePropertyArray<type> &a) @@ -117,8 +117,8 @@ public: bool fill( const type &data, int size = -1 ) { bool r=true; - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdFill); s << data; s << size ; @@ -132,7 +132,7 @@ public: if (policy()==PolicyLocal || policy()==PolicyDirty) { extractProperty(b); -// r=QMemArray<type>::fill(data,size);//FIXME: return value! +// r=TQMemArray<type>::fill(data,size);//FIXME: return value! } return r; } @@ -146,7 +146,7 @@ public: } if (policy()==PolicyLocal || policy()==PolicyDirty) { - QMemArray<type>::assign(a); + TQMemArray<type>::assign(a); } return *this; } @@ -158,7 +158,7 @@ public: } if (policy()==PolicyLocal || policy()==PolicyDirty) { - QMemArray<type>::assign(a,n); + TQMemArray<type>::assign(a,n); } return *this; } @@ -170,7 +170,7 @@ public: } if (policy()==PolicyLocal || policy()==PolicyDirty) { - QMemArray<type>::duplicate(a); + TQMemArray<type>::duplicate(a); } return *this; } @@ -182,7 +182,7 @@ public: } if (policy()==PolicyLocal || policy()==PolicyDirty) { - QMemArray<type>::duplicate(a,n); + TQMemArray<type>::duplicate(a,n); } return *this; } @@ -194,14 +194,14 @@ public: } if (policy()==PolicyLocal || policy()==PolicyDirty) { - QMemArray<type>::setRawData(a,n); + TQMemArray<type>::setRawData(a,n); } return *this; } void sort() { - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdSort); if (policy()==PolicyLocal || policy()==PolicyDirty) { @@ -216,30 +216,30 @@ public: } } - void load(QDataStream& s) + void load(TQDataStream& s) { //kdDebug(11001) << "KGamePropertyArray load " << id() << endl; type data; - for (unsigned int i=0; i<QMemArray<type>::size(); i++) + for (unsigned int i=0; i<TQMemArray<type>::size(); i++) { s >> data; - QMemArray<type>::at(i)=data; + TQMemArray<type>::at(i)=data; } if (isEmittingSignal()) { emitSignal(); } } - void save(QDataStream &s) + void save(TQDataStream &s) { //kdDebug(11001) << "KGamePropertyArray save "<<id() << endl; - for (unsigned int i=0; i<QMemArray<type>::size(); i++) + for (unsigned int i=0; i<TQMemArray<type>::size(); i++) { s << at(i); } } - void command(QDataStream &s,int cmd,bool) + void command(TQDataStream &s,int cmd,bool) { KGamePropertyBase::command(s, cmd); //kdDebug(11001) << "Array id="<<id()<<" got command ("<<cmd<<") !!!" <<endl; @@ -250,7 +250,7 @@ public: uint i; type data; s >> i >> data; - QMemArray<type>::at(i)=data; + TQMemArray<type>::at(i)=data; //kdDebug(11001) << "CmdAt:id="<<id()<<" i="<<i<<" data="<<data <<endl; if (isEmittingSignal()) { @@ -262,10 +262,10 @@ public: { uint size; s >> size; - //kdDebug(11001) << "CmdResize:id="<<id()<<" oldsize="<<QMemArray<type>::size()<<" newsize="<<size <<endl; - if (QMemArray<type>::size() != size) + //kdDebug(11001) << "CmdResize:id="<<id()<<" oldsize="<<TQMemArray<type>::size()<<" newsize="<<size <<endl; + if (TQMemArray<type>::size() != size) { - QMemArray<type>::resize(size); + TQMemArray<type>::resize(size); } break; } @@ -275,7 +275,7 @@ public: type data; s >> data >> size; //kdDebug(11001) << "CmdFill:id="<<id()<<"size="<<size <<endl; - QMemArray<type>::fill(data,size); + TQMemArray<type>::fill(data,size); if (isEmittingSignal()) { emitSignal(); @@ -285,7 +285,7 @@ public: case CmdSort: { //kdDebug(11001) << "CmdSort:id="<<id()<<endl; - QMemArray<type>::sort(); + TQMemArray<type>::sort(); break; } default: @@ -294,9 +294,9 @@ public: } } protected: - void extractProperty(const QByteArray& b) + void extractProperty(const TQByteArray& b) { - QDataStream s(b, IO_ReadOnly); + TQDataStream s(b, IO_ReadOnly); int cmd; int propId; KGameMessage::extractPropertyHeader(s, propId); diff --git a/libkdegames/kgame/kgamepropertyhandler.cpp b/libkdegames/kgame/kgamepropertyhandler.cpp index 75b3e7e2..f395fc66 100644 --- a/libkdegames/kgame/kgamepropertyhandler.cpp +++ b/libkdegames/kgame/kgamepropertyhandler.cpp @@ -25,8 +25,8 @@ #include "kgameproperty.h" #include "kgamemessage.h" -#include <qmap.h> -#include <qptrqueue.h> +#include <tqmap.h> +#include <tqptrqueue.h> #include <klocale.h> #include <typeinfo> @@ -41,23 +41,23 @@ public: { } - QMap<int, QString> mNameMap; - QIntDict<KGamePropertyBase> mIdDict; + TQMap<int, TQString> mNameMap; + TQIntDict<KGamePropertyBase> mIdDict; int mUniqueId; int mId; KGamePropertyBase::PropertyPolicy mDefaultPolicy; bool mDefaultUserspace; int mIndirectEmit; - QPtrQueue<KGamePropertyBase> mSignalQueue; + TQPtrQueue<KGamePropertyBase> mSignalQueue; }; -KGamePropertyHandler::KGamePropertyHandler(int id, const QObject* receiver, const char * sendf, const char *emitf, QObject* parent) : QObject(parent) +KGamePropertyHandler::KGamePropertyHandler(int id, const TQObject* receiver, const char * sendf, const char *emitf, TQObject* parent) : TQObject(parent) { init(); registerHandler(id,receiver,sendf,emitf); } -KGamePropertyHandler::KGamePropertyHandler(QObject* parent) : QObject(parent) +KGamePropertyHandler::KGamePropertyHandler(TQObject* parent) : TQObject(parent) { init(); } @@ -90,20 +90,20 @@ void KGamePropertyHandler::setId(int id) d->mId = id; } -void KGamePropertyHandler::registerHandler(int id,const QObject * receiver, const char * sendf, const char *emitf) +void KGamePropertyHandler::registerHandler(int id,const TQObject * receiver, const char * sendf, const char *emitf) { setId(id); if (receiver && sendf) { - kdDebug(11001) << "Connecting SLOT " << sendf << endl; - connect(this, SIGNAL(signalSendMessage(int, QDataStream &, bool*)), receiver, sendf); + kdDebug(11001) << "Connecting TQT_SLOT " << sendf << endl; + connect(this, TQT_SIGNAL(signalSendMessage(int, TQDataStream &, bool*)), receiver, sendf); } if (receiver && emitf) { - kdDebug(11001) << "Connecting SLOT " << emitf << endl; - connect(this, SIGNAL(signalPropertyChanged(KGamePropertyBase *)), receiver, emitf); + kdDebug(11001) << "Connecting TQT_SLOT " << emitf << endl; + connect(this, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase *)), receiver, emitf); } } -bool KGamePropertyHandler::processMessage(QDataStream &stream, int id, bool isSender) +bool KGamePropertyHandler::processMessage(TQDataStream &stream, int id, bool isSender) { // kdDebug(11001) << k_funcinfo << ": id=" << id << " mId=" << d->mId << endl; if (id != d->mId) { @@ -148,7 +148,7 @@ bool KGamePropertyHandler::removeProperty(KGamePropertyBase* data) return d->mIdDict.remove(data->id()); } -bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, QString name) +bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, TQString name) { //kdDebug(11001) << k_funcinfo << ": " << data->id() << endl; if (d->mIdDict.find(data->id())) { @@ -169,9 +169,9 @@ bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, QString name) return true; } -QString KGamePropertyHandler::propertyName(int id) const +TQString KGamePropertyHandler::propertyName(int id) const { - QString s; + TQString s; if (d->mIdDict.find(id)) { if (d->mNameMap.contains(id)) { s = i18n("%1 (%2)").arg(d->mNameMap[id]).arg(id); @@ -185,7 +185,7 @@ QString KGamePropertyHandler::propertyName(int id) const return s; } -bool KGamePropertyHandler::load(QDataStream &stream) +bool KGamePropertyHandler::load(TQDataStream &stream) { // Prevent direct emmiting until all is loaded lockDirectEmit(); @@ -207,11 +207,11 @@ bool KGamePropertyHandler::load(QDataStream &stream) return true; } -bool KGamePropertyHandler::save(QDataStream &stream) +bool KGamePropertyHandler::save(TQDataStream &stream) { kdDebug(11001) << k_funcinfo << ": " << d->mIdDict.count() << " KGameProperty objects " << endl; stream << (uint)d->mIdDict.count(); - QIntDictIterator<KGamePropertyBase> it(d->mIdDict); + TQIntDictIterator<KGamePropertyBase> it(d->mIdDict); while (it.current()) { KGamePropertyBase *base=it.current(); if (base) { @@ -234,7 +234,7 @@ void KGamePropertyHandler::setPolicy(KGamePropertyBase::PropertyPolicy p,bool us // kdDebug(11001) << k_funcinfo << ": " << p << endl; d->mDefaultPolicy=p; d->mDefaultUserspace=userspace; - QIntDictIterator<KGamePropertyBase> it(d->mIdDict); + TQIntDictIterator<KGamePropertyBase> it(d->mIdDict); while (it.current()) { if (!userspace || it.current()->id()>=KGamePropertyBase::IdUser) { it.current()->setPolicy((KGamePropertyBase::PropertyPolicy)p); @@ -245,7 +245,7 @@ void KGamePropertyHandler::setPolicy(KGamePropertyBase::PropertyPolicy p,bool us void KGamePropertyHandler::unlockProperties() { - QIntDictIterator<KGamePropertyBase> it(d->mIdDict); + TQIntDictIterator<KGamePropertyBase> it(d->mIdDict); while (it.current()) { it.current()->unlock(); ++it; @@ -254,7 +254,7 @@ void KGamePropertyHandler::unlockProperties() void KGamePropertyHandler::lockProperties() { - QIntDictIterator<KGamePropertyBase> it(d->mIdDict); + TQIntDictIterator<KGamePropertyBase> it(d->mIdDict); while (it.current()) { it.current()->lock(); ++it; @@ -268,7 +268,7 @@ int KGamePropertyHandler::uniquePropertyId() void KGamePropertyHandler::flush() { - QIntDictIterator<KGamePropertyBase> it(d->mIdDict); + TQIntDictIterator<KGamePropertyBase> it(d->mIdDict); while (it.current()) { if (it.current()->isDirty()) { it.current()->sendProperty(); @@ -319,7 +319,7 @@ void KGamePropertyHandler::emitSignal(KGamePropertyBase *prop) } } -bool KGamePropertyHandler::sendProperty(QDataStream &s) +bool KGamePropertyHandler::sendProperty(TQDataStream &s) { bool sent = false; emit signalSendMessage(id(), s, &sent); @@ -334,7 +334,7 @@ KGamePropertyBase *KGamePropertyHandler::find(int id) void KGamePropertyHandler::clear() { kdDebug(11001) << k_funcinfo << id() << endl; - QIntDictIterator<KGamePropertyBase> it(d->mIdDict); + TQIntDictIterator<KGamePropertyBase> it(d->mIdDict); while (it.toFirst()) { KGamePropertyBase* p = it.toFirst(); p->unregisterData(); @@ -346,31 +346,31 @@ void KGamePropertyHandler::clear() } } -QIntDict<KGamePropertyBase>& KGamePropertyHandler::dict() const +TQIntDict<KGamePropertyBase>& KGamePropertyHandler::dict() const { return d->mIdDict; } -QString KGamePropertyHandler::propertyValue(KGamePropertyBase* prop) +TQString KGamePropertyHandler::propertyValue(KGamePropertyBase* prop) { if (!prop) { return i18n("NULL pointer"); } int id = prop->id(); - QString name = propertyName(id); - QString value; + TQString name = propertyName(id); + TQString value; const type_info* t = prop->typeinfo(); if (*t == typeid(int)) { - value = QString::number(((KGamePropertyInt*)prop)->value()); + value = TQString::number(((KGamePropertyInt*)prop)->value()); } else if (*t == typeid(unsigned int)) { - value = QString::number(((KGamePropertyUInt *)prop)->value()); + value = TQString::number(((KGamePropertyUInt *)prop)->value()); } else if (*t == typeid(long int)) { - value = QString::number(((KGameProperty<long int> *)prop)->value()); + value = TQString::number(((KGameProperty<long int> *)prop)->value()); } else if (*t == typeid(unsigned long int)) { - value = QString::number(((KGameProperty<unsigned long int> *)prop)->value()); - } else if (*t == typeid(QString)) { + value = TQString::number(((KGameProperty<unsigned long int> *)prop)->value()); + } else if (*t == typeid(TQString)) { value = ((KGamePropertyQString*)prop)->value(); } else if (*t == typeid(Q_INT8)) { value = ((KGamePropertyBool*)prop)->value() ? i18n("True") : i18n("False"); @@ -390,7 +390,7 @@ void KGamePropertyHandler::Debug() kdDebug(11001) << "KGamePropertyHandler:: Debug this=" << this << endl; kdDebug(11001) << " Registered properties: (Policy,Lock,Emit,Optimized, Dirty)" << endl; - QIntDictIterator<KGamePropertyBase> it(d->mIdDict); + TQIntDictIterator<KGamePropertyBase> it(d->mIdDict); while (it.current()) { KGamePropertyBase *p=it.current(); kdDebug(11001) << " "<< p->id() << ": p=" << p->policy() diff --git a/libkdegames/kgame/kgamepropertyhandler.h b/libkdegames/kgame/kgamepropertyhandler.h index 6147c071..ec7fec06 100644 --- a/libkdegames/kgame/kgamepropertyhandler.h +++ b/libkdegames/kgame/kgamepropertyhandler.h @@ -21,8 +21,8 @@ #ifndef __KGAMEPROPERTYHANDLER_H_ #define __KGAMEPROPERTYHANDLER_H_ -#include <qobject.h> -#include <qintdict.h> +#include <tqobject.h> +#include <tqintdict.h> #include "kgameproperty.h" #include <kdemacros.h> @@ -63,7 +63,7 @@ class KGamePropertyHandlerPrivate; // wow - what a name ;-) * * A KGamePropertyHandler is also used - indirectly using emitSignal - to * emit a signal when the value of a property changes. This is done this way - * because a KGameProperty does not inherit QObject because of memory + * because a KGameProperty does not inherit TQObject because of memory * advantages. Many games can have dozens or even hundreds of KGameProperty * objects so every additional variable in KGameProperty would be * multiplied. @@ -80,14 +80,14 @@ public: * You have to call registerHandler before you can use this * handler! **/ - KGamePropertyHandler(QObject* parent = 0); + KGamePropertyHandler(TQObject* parent = 0); /** * Construct a registered handler. * * @see registerHandler **/ - KGamePropertyHandler(int id, const QObject* receiver, const char* sendf, const char* emitf, QObject* parent = 0); + KGamePropertyHandler(int id, const TQObject* receiver, const char* sendf, const char* emitf, TQObject* parent = 0); ~KGamePropertyHandler(); /** @@ -101,7 +101,7 @@ public: * @param send A slot that is being connected to signalSendMessage * @param emit A slot that is being connected to signalPropertyChanged **/ - void registerHandler(int id, const QObject *receiver, const char * send, const char *emit); + void registerHandler(int id, const TQObject *receiver, const char * send, const char *emit); /** * Main message process function. This has to be called by @@ -118,7 +118,7 @@ public: * @param isSender Whether the receiver is also the sender * @return true on message processed otherwise false **/ - bool processMessage(QDataStream &stream, int id, bool isSender ); + bool processMessage(TQDataStream &stream, int id, bool isSender ); /** * @return the id of the handler @@ -132,7 +132,7 @@ public: * propertyName. This is used for debugging, e.g. in KGameDebugDialog * @return true on success **/ - bool addProperty(KGamePropertyBase *data, QString name=0); + bool addProperty(KGamePropertyBase *data, TQString name=0); /** * Removes a property from the handler @@ -156,7 +156,7 @@ public: * @param stream the datastream to load from * @return true on success otherwise false **/ - virtual bool load(QDataStream &stream); + virtual bool load(TQDataStream &stream); /** * Saves properties into the datastream @@ -164,14 +164,14 @@ public: * @param stream the datastream to save to * @return true on success otherwise false **/ - virtual bool save(QDataStream &stream); + virtual bool save(TQDataStream &stream); /** * called by a property to send itself into the * datastream. This call is simply forwarded to * the parent object **/ - bool sendProperty(QDataStream &s); + bool sendProperty(TQDataStream &s); void sendLocked(bool l); @@ -188,7 +188,7 @@ public: * depend on this function! It it possible not to provide a name or to * provide the same name for multiple properties! **/ - QString propertyName(int id) const; + TQString propertyName(int id) const; /** * @param id The ID of the property. See KGamePropertyBase::id @@ -277,13 +277,13 @@ public: /** * Reference to the internal dictionary **/ - QIntDict<KGamePropertyBase> &dict() const; + TQIntDict<KGamePropertyBase> &dict() const; /** - * In several situations you just want to have a QString of a + * In several situations you just want to have a TQString of a * KGameProperty object. This is the case in the * KGameDebugDialog where the value of all properties is displayed. This - * function will provide you with such a QString for all the types + * function will provide you with such a TQString for all the types * used inside of all KGame classes. If you have a non-standard * property (probably a self defined class or something like this) you * also need to connect to signalRequestValue to make this function @@ -291,7 +291,7 @@ public: * @param property Return the value of this KGameProperty * @return The value of a KGameProperty **/ - QString propertyValue(KGamePropertyBase* property); + TQString propertyValue(KGamePropertyBase* property); /** @@ -320,20 +320,20 @@ signals: * @param sent set this to true if the property was sent successfully - * otherwise don't touch **/ - void signalSendMessage(int msgid, QDataStream &, bool* sent); // AB shall we change bool* into bool& again? + void signalSendMessage(int msgid, TQDataStream &, bool* sent); // AB shall we change bool* into bool& again? /** * If you call propertyValue with a non-standard KGameProperty * it is possible that the value cannot automatically be converted into a - * QString. Then this signal is emitted and asks you to provide the + * TQString. Then this signal is emitted and asks you to provide the * correct value. You probably want to use something like this to achieve * this: * \code * #include <typeinfo> - * void slotRequestValue(KGamePropertyBase* p, QString& value) + * void slotRequestValue(KGamePropertyBase* p, TQString& value) * { * if (*(p->typeinfo()) == typeid(MyType) { - * value = QString(((KGameProperty<MyType>*)p)->value()); + * value = TQString(((KGameProperty<MyType>*)p)->value()); * } * } * \endcode @@ -341,7 +341,7 @@ signals: * @param property The KGamePropertyBase the value is requested for * @param value The value of this property. You have to set this. **/ - void signalRequestValue(KGamePropertyBase* property, QString& value); + void signalRequestValue(KGamePropertyBase* property, TQString& value); private: void init(); diff --git a/libkdegames/kgame/kgamepropertylist.h b/libkdegames/kgame/kgamepropertylist.h index 3a304e70..df8eb604 100644 --- a/libkdegames/kgame/kgamepropertylist.h +++ b/libkdegames/kgame/kgamepropertylist.h @@ -21,7 +21,7 @@ #ifndef __KGAMEPROPERTYLIST_H_ #define __KGAMEPROPERTYLIST_H_ -#include <qvaluelist.h> +#include <tqvaluelist.h> #include <kdebug.h> @@ -32,20 +32,20 @@ // AB: also see README.LIB! template<class type> -class KGamePropertyList : public QValueList<type>, public KGamePropertyBase +class KGamePropertyList : public TQValueList<type>, public KGamePropertyBase { public: /** * Typedefs */ - typedef QValueListIterator<type> Iterator; - typedef QValueListConstIterator<type> ConstIterator; + typedef TQValueListIterator<type> Iterator; + typedef TQValueListConstIterator<type> ConstIterator; - KGamePropertyList() :QValueList<type>(), KGamePropertyBase() + KGamePropertyList() :TQValueList<type>(), KGamePropertyBase() { } - KGamePropertyList( const KGamePropertyList<type> &a ) : QValueList<type>(a) + KGamePropertyList( const KGamePropertyList<type> &a ) : TQValueList<type>(a) { } @@ -66,10 +66,10 @@ public: Iterator insert( Iterator it, const type& d ) { - it=QValueList<type>::insert(it,d); + it=TQValueList<type>::insert(it,d); - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdInsert); int i=findIterator(it); s << i; @@ -92,8 +92,8 @@ public: void append( const type& d ) { - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdAppend); s << d; if (policy() == PolicyClean || policy() == PolicyDirty) @@ -111,8 +111,8 @@ public: Iterator erase( Iterator it ) { - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdRemove); int i=findIterator(it); s << i; @@ -128,7 +128,7 @@ public: extractProperty(b); } //TODO: return value - is it correct for PolicyLocal|PolicyDirty? -// return QValueList<type>::remove(it); +// return TQValueList<type>::remove(it); return it; } @@ -145,8 +145,8 @@ public: void clear() { - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdClear); if (policy() == PolicyClean || policy() == PolicyDirty) { @@ -161,10 +161,10 @@ public: } } - void load(QDataStream& s) + void load(TQDataStream& s) { kdDebug(11001) << "KGamePropertyList load " << id() << endl; - QValueList<type>::clear(); + TQValueList<type>::clear(); uint size; type data; s >> size; @@ -172,12 +172,12 @@ public: for (unsigned int i=0;i<size;i++) { s >> data; - QValueList<type>::append(data); + TQValueList<type>::append(data); } if (isEmittingSignal()) emitSignal(); } - void save(QDataStream &s) + void save(TQDataStream &s) { kdDebug(11001) << "KGamePropertyList save "<<id() << endl; type data; @@ -191,7 +191,7 @@ public: } } - void command(QDataStream &s,int cmd,bool) + void command(TQDataStream &s,int cmd,bool) { KGamePropertyBase::command(s, cmd); kdDebug(11001) << "---> LIST id="<<id()<<" got command ("<<cmd<<") !!!" <<endl; @@ -204,7 +204,7 @@ public: type data; s >> i >> data; it=this->at(i); - QValueList<type>::insert(it,data); + TQValueList<type>::insert(it,data); // kdDebug(11001) << "CmdInsert:id="<<id()<<" i="<<i<<" data="<<data <<endl; if (isEmittingSignal()) emitSignal(); break; @@ -213,7 +213,7 @@ public: { type data; s >> data; - QValueList<type>::append(data); + TQValueList<type>::append(data); // kdDebug(11001) << "CmdAppend:id=" << id() << " data=" << data << endl; if (isEmittingSignal()) emitSignal(); break; @@ -223,14 +223,14 @@ public: uint i; s >> i; it=this->at(i); - QValueList<type>::remove(it); + TQValueList<type>::remove(it); kdDebug(11001) << "CmdRemove:id="<<id()<<" i="<<i <<endl; if (isEmittingSignal()) emitSignal(); break; } case CmdClear: { - QValueList<type>::clear(); + TQValueList<type>::clear(); kdDebug(11001) << "CmdClear:id="<<id()<<endl; if (isEmittingSignal()) emitSignal(); break; @@ -241,11 +241,11 @@ public: } protected: - void extractProperty(const QByteArray& b) + void extractProperty(const TQByteArray& b) // this is called for Policy[Dirty|Local] after putting the stuff into the // stream { - QDataStream s(b, IO_ReadOnly); + TQDataStream s(b, IO_ReadOnly); int cmd; int propId; KGameMessage::extractPropertyHeader(s, propId); diff --git a/libkdegames/kgame/kgamesequence.cpp b/libkdegames/kgame/kgamesequence.cpp index 984a9315..9391ee04 100644 --- a/libkdegames/kgame/kgamesequence.cpp +++ b/libkdegames/kgame/kgamesequence.cpp @@ -27,7 +27,7 @@ #include "kplayer.h" #include "kgame.h" -KGameSequence::KGameSequence() : QObject() +KGameSequence::KGameSequence() : TQObject() { mGame = 0; mCurrentPlayer = 0; diff --git a/libkdegames/kgame/kgamesequence.h b/libkdegames/kgame/kgamesequence.h index 4d26ceee..19699d6b 100644 --- a/libkdegames/kgame/kgamesequence.h +++ b/libkdegames/kgame/kgamesequence.h @@ -23,7 +23,7 @@ #ifndef __KGAMESEQUENCE_H_ #define __KGAMESEQUENCE_H_ -#include <qobject.h> +#include <tqobject.h> class KPlayer; class KGame; diff --git a/libkdegames/kgame/kmessageclient.cpp b/libkdegames/kgame/kmessageclient.cpp index ed9cc966..e490a084 100644 --- a/libkdegames/kgame/kmessageclient.cpp +++ b/libkdegames/kgame/kmessageclient.cpp @@ -20,8 +20,8 @@ #include <kdebug.h> #include <stdio.h> -#include <qbuffer.h> -#include <qtimer.h> +#include <tqbuffer.h> +#include <tqtimer.h> #include "kmessageio.h" #include "kmessageserver.h" @@ -41,15 +41,15 @@ public: } Q_UINT32 adminID; - QValueList <Q_UINT32> clientList; + TQValueList <Q_UINT32> clientList; KMessageIO *connection; bool isLocked; - QValueList <QByteArray> delayedMessages; + TQValueList <TQByteArray> delayedMessages; }; -KMessageClient::KMessageClient (QObject *parent, const char *name) - : QObject (parent, name) +KMessageClient::KMessageClient (TQObject *parent, const char *name) + : TQObject (parent, name) { d = new KMessageClientPrivate (); d->isLocked = false; @@ -63,7 +63,7 @@ KMessageClient::~KMessageClient () // -- setServer stuff -void KMessageClient::setServer (const QString &host, Q_UINT16 port) +void KMessageClient::setServer (const TQString &host, Q_UINT16 port) { setServer (new KMessageSocket (host, port)); } @@ -86,10 +86,10 @@ void KMessageClient::setServer (KMessageIO *connection) d->connection = connection; if (connection ) { - connect (connection, SIGNAL (received(const QByteArray &)), - this, SLOT (processIncomingMessage(const QByteArray &))); - connect (connection, SIGNAL (connectionBroken()), - this, SLOT (removeBrokenConnection ())); + connect (connection, TQT_SIGNAL (received(const TQByteArray &)), + this, TQT_SLOT (processIncomingMessage(const TQByteArray &))); + connect (connection, TQT_SIGNAL (connectionBroken()), + this, TQT_SLOT (removeBrokenConnection ())); } } @@ -110,7 +110,7 @@ Q_UINT32 KMessageClient::adminId () const return d->adminID; } -const QValueList <Q_UINT32> &KMessageClient::clientList() const +const TQValueList <Q_UINT32> &KMessageClient::clientList() const { return d->clientList; } @@ -130,14 +130,14 @@ Q_UINT16 KMessageClient::peerPort () const return d->connection ? d->connection->peerPort() : 0; } -QString KMessageClient::peerName () const +TQString KMessageClient::peerName () const { - return d->connection ? d->connection->peerName() : QString::fromLatin1("localhost"); + return d->connection ? d->connection->peerName() : TQString::fromLatin1("localhost"); } // --------------------- Sending messages -void KMessageClient::sendServerMessage (const QByteArray &msg) +void KMessageClient::sendServerMessage (const TQByteArray &msg) { if (!d->connection) { @@ -147,39 +147,39 @@ void KMessageClient::sendServerMessage (const QByteArray &msg) d->connection->send (msg); } -void KMessageClient::sendBroadcast (const QByteArray &msg) +void KMessageClient::sendBroadcast (const TQByteArray &msg) { - QByteArray sendBuffer; - QBuffer buffer (sendBuffer); + TQByteArray sendBuffer; + TQBuffer buffer (sendBuffer); buffer.open (IO_WriteOnly); - QDataStream stream (&buffer); + TQDataStream stream (&buffer); stream << static_cast<Q_UINT32> ( KMessageServer::REQ_BROADCAST ); - buffer.QIODevice::writeBlock (msg); + buffer.TQIODevice::writeBlock (msg); sendServerMessage (sendBuffer); } -void KMessageClient::sendForward (const QByteArray &msg, const QValueList <Q_UINT32> &clients) +void KMessageClient::sendForward (const TQByteArray &msg, const TQValueList <Q_UINT32> &clients) { - QByteArray sendBuffer; - QBuffer buffer (sendBuffer); + TQByteArray sendBuffer; + TQBuffer buffer (sendBuffer); buffer.open (IO_WriteOnly); - QDataStream stream (&buffer); + TQDataStream stream (&buffer); stream << static_cast<Q_UINT32>( KMessageServer::REQ_FORWARD ) << clients; - buffer.QIODevice::writeBlock (msg); + buffer.TQIODevice::writeBlock (msg); sendServerMessage (sendBuffer); } -void KMessageClient::sendForward (const QByteArray &msg, Q_UINT32 client) +void KMessageClient::sendForward (const TQByteArray &msg, Q_UINT32 client) { - sendForward (msg, QValueList <Q_UINT32> () << client); + sendForward (msg, TQValueList <Q_UINT32> () << client); } // --------------------- Receiving and processing messages -void KMessageClient::processIncomingMessage (const QByteArray &msg) +void KMessageClient::processIncomingMessage (const TQByteArray &msg) { if (d->isLocked) { @@ -189,7 +189,7 @@ void KMessageClient::processIncomingMessage (const QByteArray &msg) if (d->delayedMessages.count() > 0) { d->delayedMessages.append (msg); - QByteArray first = d->delayedMessages.front(); + TQByteArray first = d->delayedMessages.front(); d->delayedMessages.pop_front(); processMessage (first); } @@ -199,16 +199,16 @@ void KMessageClient::processIncomingMessage (const QByteArray &msg) } } -void KMessageClient::processMessage (const QByteArray &msg) +void KMessageClient::processMessage (const TQByteArray &msg) { if (d->isLocked) { // must NOT happen, since we check in processIncomingMessage as well as in processFirstMessage d->delayedMessages.append(msg); return; } - QBuffer in_buffer (msg); + TQBuffer in_buffer (msg); in_buffer.open (IO_ReadOnly); - QDataStream in_stream (&in_buffer); + TQDataStream in_stream (&in_buffer); bool unknown = false; @@ -228,7 +228,7 @@ void KMessageClient::processMessage (const QByteArray &msg) case KMessageServer::MSG_FORWARD: { Q_UINT32 clientID; - QValueList <Q_UINT32> receivers; + TQValueList <Q_UINT32> receivers; in_stream >> clientID >> receivers; emit forwardReceived (in_buffer.readAll(), clientID, receivers); } @@ -313,7 +313,7 @@ void KMessageClient::processFirstMessage() kdDebug(11001) << k_funcinfo << ": no messages delayed" << endl; return; } - QByteArray first = d->delayedMessages.front(); + TQByteArray first = d->delayedMessages.front(); d->delayedMessages.pop_front(); processMessage (first); } @@ -321,8 +321,8 @@ void KMessageClient::processFirstMessage() void KMessageClient::removeBrokenConnection () { kdDebug (11001) << k_funcinfo << ": timer single shot for removeBrokenConnection"<<this << endl; - // MH We cannot directly delete the socket. otherwise QSocket crashes - QTimer::singleShot( 0, this, SLOT(removeBrokenConnection2()) ); + // MH We cannot directly delete the socket. otherwise TQSocket crashes + TQTimer::singleShot( 0, this, TQT_SLOT(removeBrokenConnection2()) ); return; } @@ -361,7 +361,7 @@ void KMessageClient::unlock () d->isLocked = false; for (unsigned int i = 0; i < d->delayedMessages.count(); i++) { - QTimer::singleShot(0, this, SLOT(processFirstMessage())); + TQTimer::singleShot(0, this, TQT_SLOT(processFirstMessage())); } } diff --git a/libkdegames/kgame/kmessageclient.h b/libkdegames/kgame/kmessageclient.h index 90364c8d..71ab7a1e 100644 --- a/libkdegames/kgame/kmessageclient.h +++ b/libkdegames/kgame/kmessageclient.h @@ -20,9 +20,9 @@ #ifndef __KMESSAGECLIENT_H__ #define __KMESSAGECLIENT_H__ -#include <qobject.h> -#include <qstring.h> -#include <qvaluelist.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqvaluelist.h> class KMessageIO; class KMessageServer; @@ -58,7 +58,7 @@ public: Creates an unconnected KMessageClient object. Use setServer() later to connect to a KMessageServer object. */ - KMessageClient (QObject *parent = 0, const char *name = 0); + KMessageClient (TQObject *parent = 0, const char *name = 0); /** Destructor. @@ -95,7 +95,7 @@ public: /** @return The list of the IDs of all the message clients connected to the message server. */ - const QValueList <Q_UINT32> &clientList() const; + const TQValueList <Q_UINT32> &clientList() const; /** Connects the client to (another) server. @@ -108,7 +108,7 @@ public: be resolved to an IP or just an IP @param port The port to connect to */ - void setServer (const QString &host, Q_UINT16 port); + void setServer (const TQString &host, Q_UINT16 port); /** Connects the client to (another) server. @@ -165,7 +165,7 @@ public: /** @return 0 if isConnected() is FALSE, otherwise the port number this client is - connected to. See also KMessageIO::peerPort and QSocket::peerPort. + connected to. See also KMessageIO::peerPort and TQSocket::peerPort. @since 3.2 */ Q_UINT16 peerPort () const; @@ -173,9 +173,9 @@ public: /** @since 3.2 @return "localhost" if isConnected() is FALSE, otherwise the hostname this client is - connected to. See also KMessageIO::peerName() and QSocket::peerName(). + connected to. See also KMessageIO::peerName() and TQSocket::peerName(). */ - QString peerName() const; + TQString peerName() const; /** Sends a message to the KMessageServer. If we are not yet connected to one, nothing @@ -188,7 +188,7 @@ public: and sendForward(). @param msg The message to be sent to the server. Must be in the format specified in KMessageServer. */ - void sendServerMessage (const QByteArray &msg); + void sendServerMessage (const TQByteArray &msg); /** Sends a message to all the clients connected to the server, including ourself. @@ -199,7 +199,7 @@ public: @param msg The message to be sent to the clients */ //AB: processBroadcast doesn't exist!! is processIncomingMessage meant? - void sendBroadcast (const QByteArray &msg); + void sendBroadcast (const TQByteArray &msg); /** Sends a message to all the clients in a list. @@ -218,11 +218,11 @@ public: @param clients A list of clients the message should be sent to */ //AB: processForward doesn't exist!! is processIncomingMessage meant? - void sendForward (const QByteArray &msg, const QValueList <Q_UINT32> &clients); + void sendForward (const TQByteArray &msg, const TQValueList <Q_UINT32> &clients); /** Sends a message to a single client. This is a convenieance method. It calls - sendForward (const QByteArray &msg, const QValueList <Q_UINT32> &clients) + sendForward (const TQByteArray &msg, const TQValueList <Q_UINT32> &clients) with a list containing only one client ID. To send a message to the admin of the KMessageServer, you can use 0 as clientID, @@ -230,7 +230,7 @@ public: @param msg The message to be sent to the client @param client The id of the client the message shall be sent to */ - void sendForward (const QByteArray &msg, Q_UINT32 client); + void sendForward (const TQByteArray &msg, Q_UINT32 client); /** Once this function is called no message will be received anymore. @@ -263,7 +263,7 @@ signals: to ignore broadcast messages that were sent by yourself: \code - void myObject::myBroadcastSlot (const QByteArray &msg, Q_UINT32 senderID) + void myObject::myBroadcastSlot (const TQByteArray &msg, Q_UINT32 senderID) { if (senderID == ((KMessageClient *)sender())->id()) return; @@ -273,7 +273,7 @@ signals: @param msg The message that has been sent to us @param senderID The ID of the client which sent the message */ - void broadcastReceived (const QByteArray &msg, Q_UINT32 senderID); + void broadcastReceived (const TQByteArray &msg, Q_UINT32 senderID); /** This signal is emitted when the client receives a forward message from the @@ -294,8 +294,8 @@ signals: \code KMessageClient *client = new KMessageClient (); - connect (client, SIGNAL (forwardReceived (const QByteArray &, Q_UINT32, const QValueList <Q_UINT32>&)), - client, SIGNAL (broadcastReceived (const QByteArray &, Q_UINT32))); + connect (client, TQT_SIGNAL (forwardReceived (const TQByteArray &, Q_UINT32, const TQValueList <Q_UINT32>&)), + client, TQT_SIGNAL (broadcastReceived (const TQByteArray &, Q_UINT32))); \endcode Then connect the broadcast signal to your slot that analyzes the message. @@ -303,7 +303,7 @@ signals: @param senderID The ID of the client which sent the message @param receivers All clients which receive this message */ - void forwardReceived (const QByteArray &msg, Q_UINT32 senderID, const QValueList <Q_UINT32> &receivers); + void forwardReceived (const TQByteArray &msg, Q_UINT32 senderID, const TQValueList <Q_UINT32> &receivers); /** This signal is emitted when the connection to the KMessageServer is broken. @@ -360,7 +360,7 @@ signals: //AB: maybe add a setNoEmit() so that the other signals can be deactivated? //Could be a performance benefit (note: KMessageClient is a time critical //class!!!) - void serverMessageReceived (const QByteArray &msg, bool &unknown); + void serverMessageReceived (const TQByteArray &msg, bool &unknown); protected: /** @@ -380,7 +380,7 @@ protected: @param msg The incoming message */ - virtual void processMessage (const QByteArray& msg); + virtual void processMessage (const TQByteArray& msg); protected slots: /** @@ -398,10 +398,10 @@ protected slots: MSG_BROADCAST, MSG_FORWARD, ANS_CLIENT_ID, ANS_ADMIN_ID, ANS_CLIENT_LIST @param msg The incoming message */ - virtual void processIncomingMessage (const QByteArray &msg); + virtual void processIncomingMessage (const TQByteArray &msg); /** - Called from unlock() (using QTimer::singleShot) until all delayed + Called from unlock() (using TQTimer::singleShot) until all delayed messages are delivered. */ void processFirstMessage(); diff --git a/libkdegames/kgame/kmessageio.cpp b/libkdegames/kgame/kmessageio.cpp index f3353277..7057a621 100644 --- a/libkdegames/kgame/kmessageio.cpp +++ b/libkdegames/kgame/kmessageio.cpp @@ -22,15 +22,15 @@ */ #include "kmessageio.h" -#include <qsocket.h> +#include <tqsocket.h> #include <kdebug.h> #include <kprocess.h> -#include <qfile.h> +#include <tqfile.h> // ----------------------- KMessageIO ------------------------- -KMessageIO::KMessageIO (QObject *parent, const char *name) - : QObject (parent, name), m_id (0) +KMessageIO::KMessageIO (TQObject *parent, const char *name) + : TQObject (parent, name), m_id (0) {} KMessageIO::~KMessageIO () @@ -48,25 +48,25 @@ Q_UINT32 KMessageIO::id () // ----------------------KMessageSocket ----------------------- -KMessageSocket::KMessageSocket (QString host, Q_UINT16 port, QObject *parent, +KMessageSocket::KMessageSocket (TQString host, Q_UINT16 port, TQObject *parent, const char *name) : KMessageIO (parent, name) { - mSocket = new QSocket (); + mSocket = new TQSocket (); mSocket->connectToHost (host, port); initSocket (); } -KMessageSocket::KMessageSocket (QHostAddress host, Q_UINT16 port, QObject +KMessageSocket::KMessageSocket (TQHostAddress host, Q_UINT16 port, TQObject *parent, const char *name) : KMessageIO (parent, name) { - mSocket = new QSocket (); + mSocket = new TQSocket (); mSocket->connectToHost (host.toString(), port); initSocket (); } -KMessageSocket::KMessageSocket (QSocket *socket, QObject *parent, const char +KMessageSocket::KMessageSocket (TQSocket *socket, TQObject *parent, const char *name) : KMessageIO (parent, name) { @@ -74,11 +74,11 @@ KMessageSocket::KMessageSocket (QSocket *socket, QObject *parent, const char initSocket (); } -KMessageSocket::KMessageSocket (int socketFD, QObject *parent, const char +KMessageSocket::KMessageSocket (int socketFD, TQObject *parent, const char *name) : KMessageIO (parent, name) { - mSocket = new QSocket (); + mSocket = new TQSocket (); mSocket->setSocket (socketFD); initSocket (); } @@ -90,12 +90,12 @@ KMessageSocket::~KMessageSocket () bool KMessageSocket::isConnected () const { - return mSocket->state() == QSocket::Connection; + return mSocket->state() == TQSocket::Connection; } -void KMessageSocket::send (const QByteArray &msg) +void KMessageSocket::send (const TQByteArray &msg) { - QDataStream str (mSocket); + TQDataStream str (mSocket); str << Q_UINT8 ('M'); // magic number for begin of message str.writeBytes (msg.data(), msg.size()); // writes the length (as Q_UINT32) and the data } @@ -106,7 +106,7 @@ void KMessageSocket::processNewData () return; isRecursive = true; - QDataStream str (mSocket); + TQDataStream str (mSocket); while (mSocket->bytesAvailable() > 0) { if (mAwaitingHeader) @@ -141,7 +141,7 @@ void KMessageSocket::processNewData () return; } - QByteArray msg (mNextBlockLength); + TQByteArray msg (mNextBlockLength); str.readRawBytes (msg.data(), mNextBlockLength); // send the received message @@ -157,9 +157,9 @@ void KMessageSocket::processNewData () void KMessageSocket::initSocket () { - connect (mSocket, SIGNAL (error(int)), SIGNAL (connectionBroken())); - connect (mSocket, SIGNAL (connectionClosed()), SIGNAL (connectionBroken())); - connect (mSocket, SIGNAL (readyRead()), SLOT (processNewData())); + connect (mSocket, TQT_SIGNAL (error(int)), TQT_SIGNAL (connectionBroken())); + connect (mSocket, TQT_SIGNAL (connectionClosed()), TQT_SIGNAL (connectionBroken())); + connect (mSocket, TQT_SIGNAL (readyRead()), TQT_SLOT (processNewData())); mAwaitingHeader = true; mNextBlockLength = 0; isRecursive = false; @@ -170,14 +170,14 @@ Q_UINT16 KMessageSocket::peerPort () const return mSocket->peerPort(); } -QString KMessageSocket::peerName () const +TQString KMessageSocket::peerName () const { return mSocket->peerName(); } // ----------------------KMessageDirect ----------------------- -KMessageDirect::KMessageDirect (KMessageDirect *partner, QObject *parent, +KMessageDirect::KMessageDirect (KMessageDirect *partner, TQObject *parent, const char *name) : KMessageIO (parent, name), mPartner (0) { @@ -213,7 +213,7 @@ bool KMessageDirect::isConnected () const return mPartner != 0; } -void KMessageDirect::send (const QByteArray &msg) +void KMessageDirect::send (const TQByteArray &msg) { if (mPartner) emit mPartner->received (msg); @@ -238,24 +238,24 @@ KMessageProcess::~KMessageProcess() // Maybe todo: delete mSendBuffer } } -KMessageProcess::KMessageProcess(QObject *parent, QString file) : KMessageIO(parent,0) +KMessageProcess::KMessageProcess(TQObject *parent, TQString file) : KMessageIO(parent,0) { // Start process kdDebug(11001) << "@@@KMessageProcess::Start process" << endl; mProcessName=file; mProcess=new KProcess; int id=0; - *mProcess << mProcessName << QString("%1").arg(id); + *mProcess << mProcessName << TQString("%1").arg(id); kdDebug(11001) << "@@@KMessageProcess::Init:Id= " << id << endl; kdDebug(11001) << "@@@KMessgeProcess::Init:Processname: " << mProcessName << endl; - connect(mProcess, SIGNAL(receivedStdout(KProcess *, char *, int )), - this, SLOT(slotReceivedStdout(KProcess *, char * , int ))); - connect(mProcess, SIGNAL(receivedStderr(KProcess *, char *, int )), - this, SLOT(slotReceivedStderr(KProcess *, char * , int ))); - connect(mProcess, SIGNAL(processExited(KProcess *)), - this, SLOT(slotProcessExited(KProcess *))); - connect(mProcess, SIGNAL(wroteStdin(KProcess *)), - this, SLOT(slotWroteStdin(KProcess *))); + connect(mProcess, TQT_SIGNAL(receivedStdout(KProcess *, char *, int )), + this, TQT_SLOT(slotReceivedStdout(KProcess *, char * , int ))); + connect(mProcess, TQT_SIGNAL(receivedStderr(KProcess *, char *, int )), + this, TQT_SLOT(slotReceivedStderr(KProcess *, char * , int ))); + connect(mProcess, TQT_SIGNAL(processExited(KProcess *)), + this, TQT_SLOT(slotProcessExited(KProcess *))); + connect(mProcess, TQT_SIGNAL(wroteStdin(KProcess *)), + this, TQT_SLOT(slotWroteStdin(KProcess *))); mProcess->start(KProcess::NotifyOnExit,KProcess::All); mSendBuffer=0; mReceiveCount=0; @@ -267,7 +267,7 @@ bool KMessageProcess::isConnected() const if (!mProcess) return false; return mProcess->isRunning(); } -void KMessageProcess::send(const QByteArray &msg) +void KMessageProcess::send(const TQByteArray &msg) { kdDebug(11001) << "@@@KMessageProcess:: SEND("<<msg.size()<<") to process" << endl; unsigned int size=msg.size()+2*sizeof(long); @@ -280,7 +280,7 @@ void KMessageProcess::send(const QByteArray &msg) *p1=0x4242aeae; *p2=size; - QByteArray *buffer=new QByteArray(); + TQByteArray *buffer=new TQByteArray(); buffer->assign(tmpbuffer,size); // buffer->duplicate(msg); mQueue.enqueue(buffer); @@ -330,9 +330,9 @@ void KMessageProcess::slotReceivedStderr(KProcess * proc, char *buffer, int bufl if (!p) len=buflen; else len=p-pos; - QByteArray a; + TQByteArray a; a.setRawData(pos,len); - QString s(a); + TQString s(a); kdDebug(11001) << "PID" <<pid<< ":" << s << endl; a.resetRawData(pos,len); if (p) pos=p+1; @@ -371,7 +371,7 @@ void KMessageProcess::slotReceivedStdout(KProcess * , char *buffer, int buflen) { kdDebug(11001) << k_funcinfo << ": Got message with len " << len << endl; - QByteArray msg; + TQByteArray msg; // msg.setRawData(mReceiveBuffer.data()+2*sizeof(long),len-2*sizeof(long)); msg.duplicate(mReceiveBuffer.data()+2*sizeof(long),len-2*sizeof(long)); emit received(msg); @@ -397,7 +397,7 @@ void KMessageProcess::slotProcessExited(KProcess * /*p*/) // ----------------------- KMessageFilePipe --------------------------- -KMessageFilePipe::KMessageFilePipe(QObject *parent,QFile *readfile,QFile *writefile) : KMessageIO(parent,0) +KMessageFilePipe::KMessageFilePipe(TQObject *parent,TQFile *readfile,TQFile *writefile) : KMessageIO(parent,0) { mReadFile=readfile; mWriteFile=writefile; @@ -414,7 +414,7 @@ bool KMessageFilePipe::isConnected () const return (mReadFile!=0)&&(mWriteFile!=0); } -void KMessageFilePipe::send(const QByteArray &msg) +void KMessageFilePipe::send(const TQByteArray &msg) { unsigned int size=msg.size()+2*sizeof(long); @@ -425,7 +425,7 @@ void KMessageFilePipe::send(const QByteArray &msg) *p1=0x4242aeae; *p2=size; - QByteArray buffer; + TQByteArray buffer; buffer.assign(tmpbuffer,size); mWriteFile->writeBlock(buffer); mWriteFile->flush(); @@ -464,7 +464,7 @@ void KMessageFilePipe::exec() { //fprintf(stderr,"KMessageFilePipe::exec:: Got Message with len %d\n",len); - QByteArray msg; + TQByteArray msg; //msg.setRawData(mReceiveBuffer.data()+2*sizeof(long),len-2*sizeof(long)); msg.duplicate(mReceiveBuffer.data()+2*sizeof(long),len-2*sizeof(long)); emit received(msg); diff --git a/libkdegames/kgame/kmessageio.h b/libkdegames/kgame/kmessageio.h index 37cf35cd..8ffa4377 100644 --- a/libkdegames/kgame/kmessageio.h +++ b/libkdegames/kgame/kmessageio.h @@ -24,12 +24,12 @@ #ifndef _KMESSAGEIO_H_ #define _KMESSAGEIO_H_ -#include <qcstring.h> -#include <qhostaddress.h> -#include <qobject.h> -#include <qstring.h> -#include <qptrqueue.h> -#include <qfile.h> +#include <tqcstring.h> +#include <tqhostaddress.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqptrqueue.h> +#include <tqfile.h> #include <kdebug.h> class QSocket; @@ -59,9 +59,9 @@ class KMessageIO : public QObject public: /** - * The usual QObject constructor, does nothing else. + * The usual TQObject constructor, does nothing else. **/ - KMessageIO (QObject *parent = 0, const char *name = 0); + KMessageIO (TQObject *parent = 0, const char *name = 0); /** * The usual destructor, does nothing special. @@ -122,7 +122,7 @@ public: @since 3.2 @return "localhost" in the default implementation. Reimplemented in @ref KMessageSocket */ - virtual QString peerName () const { return QString::fromLatin1("localhost"); } + virtual TQString peerName () const { return TQString::fromLatin1("localhost"); } signals: @@ -131,7 +131,7 @@ signals: object is called. The parameter contains the same data array in /e msg as was used in /e send(). */ - void received (const QByteArray &msg); + void received (const TQByteArray &msg); /** This signal is emitted when the connection is closed. This can be caused @@ -154,7 +154,7 @@ public slots: as a slot! (Otherwise another slot would be defined. It would work, but uses more memory and time.) See /e KMessageSocket for an example implementation. */ - virtual void send (const QByteArray &msg) = 0; + virtual void send (const TQByteArray &msg) = 0; protected: Q_UINT32 m_id; @@ -181,7 +181,7 @@ public: If the connection could not be established (e.g. unknown host or no server socket at this port), the signal /e connectionBroken is emitted. */ - KMessageSocket (QString host, Q_UINT16 port, QObject *parent = 0, + KMessageSocket (TQString host, Q_UINT16 port, TQObject *parent = 0, const char *name = 0); /** @@ -192,7 +192,7 @@ public: If the connection could not be established (e.g. unknown host or no server socket at this port), the signal /e connectionBroken is emitted. */ - KMessageSocket (QHostAddress host, Q_UINT16 port, QObject *parent = 0, + KMessageSocket (TQHostAddress host, Q_UINT16 port, TQObject *parent = 0, const char *name = 0); /** @@ -206,20 +206,20 @@ public: together with this KMessageSocket object. (Use 0 as parent for the QSocket object t ensure it is not deleted.) */ - KMessageSocket (QSocket *socket, QObject *parent = 0, const char *name = 0); + KMessageSocket (TQSocket *socket, TQObject *parent = 0, const char *name = 0); /** Uses the socket specified by the socket descriptor socketFD to do the communication. The socket must already be connected. - This constructor can be used with a QServerSocket within the (pure + This constructor can be used with a TQServerSocket within the (pure virtual) method /e newConnection. Note: The socket is then owned by the /e KMessageSocket object. So don't manipulate the socket afterwards, especially don't close it. The socket is automatically closed when KMessageSocket is deleted. */ - KMessageSocket (int socketFD, QObject *parent = 0, const char *name = 0); + KMessageSocket (int socketFD, TQObject *parent = 0, const char *name = 0); /** Destructor, closes the socket. @@ -233,15 +233,15 @@ public: /** @since 3.2 - @return The port that this object is connected to. See QSocket::peerPort + @return The port that this object is connected to. See TQSocket::peerPort */ virtual Q_UINT16 peerPort () const; /** @since 3.2 - @return The hostname this object is connected to. See QSocket::peerName. + @return The hostname this object is connected to. See TQSocket::peerName. */ - virtual QString peerName () const; + virtual TQString peerName () const; /** @return TRUE as this is a network IO. @@ -259,18 +259,18 @@ public: Note: It is not declared as a slot method, since the slot is already defined in KMessageIO as a virtual method. */ - void send (const QByteArray &msg); + void send (const TQByteArray &msg); protected slots: virtual void processNewData (); protected: void initSocket (); - QSocket *mSocket; + TQSocket *mSocket; bool mAwaitingHeader; Q_UINT32 mNextBlockLength; - bool isRecursive; // workaround for "bug" in QSocket, Qt 2.2.3 or older + bool isRecursive; // workaround for "bug" in TQSocket, Qt 2.2.3 or older }; @@ -304,7 +304,7 @@ public: If that object is already connected, the object remains unconnected. */ - KMessageDirect (KMessageDirect *partner = 0, QObject *parent = 0, const char + KMessageDirect (KMessageDirect *partner = 0, TQObject *parent = 0, const char *name = 0); /** @@ -339,7 +339,7 @@ public: Note: It is not declared as a slot method, since the slot is already defined in KMessageIO as a virtual method. */ - void send (const QByteArray &msg); + void send (const TQByteArray &msg); protected: KMessageDirect *mPartner; @@ -350,10 +350,10 @@ class KMessageProcess : public KMessageIO Q_OBJECT public: - KMessageProcess(QObject *parent, QString file); + KMessageProcess(TQObject *parent, TQString file); ~KMessageProcess(); bool isConnected() const; - void send (const QByteArray &msg); + void send (const TQByteArray &msg); void writeToProcess(); /** @@ -375,11 +375,11 @@ class KMessageProcess : public KMessageIO void slotWroteStdin(KProcess *p); private: - QString mProcessName; + TQString mProcessName; KProcess *mProcess; - QPtrQueue <QByteArray> mQueue; - QByteArray *mSendBuffer; - QByteArray mReceiveBuffer; + TQPtrQueue <TQByteArray> mQueue; + TQByteArray *mSendBuffer; + TQByteArray mReceiveBuffer; unsigned int mReceiveCount; }; @@ -388,10 +388,10 @@ class KMessageFilePipe : public KMessageIO Q_OBJECT public: - KMessageFilePipe(QObject *parent,QFile *readFile,QFile *writeFile); + KMessageFilePipe(TQObject *parent,TQFile *readFile,TQFile *writeFile); ~KMessageFilePipe(); bool isConnected() const; - void send (const QByteArray &msg); + void send (const TQByteArray &msg); void exec(); /** @@ -407,9 +407,9 @@ class KMessageFilePipe : public KMessageIO private: - QFile *mReadFile; - QFile *mWriteFile; - QByteArray mReceiveBuffer; + TQFile *mReadFile; + TQFile *mWriteFile; + TQByteArray mReceiveBuffer; unsigned int mReceiveCount; }; diff --git a/libkdegames/kgame/kmessageserver.cpp b/libkdegames/kgame/kmessageserver.cpp index e857ea31..105f35da 100644 --- a/libkdegames/kgame/kmessageserver.cpp +++ b/libkdegames/kgame/kmessageserver.cpp @@ -17,12 +17,12 @@ Boston, MA 02110-1301, USA. */ -#include <qiodevice.h> -#include <qbuffer.h> -#include <qptrlist.h> -#include <qptrqueue.h> -#include <qtimer.h> -#include <qvaluelist.h> +#include <tqiodevice.h> +#include <tqbuffer.h> +#include <tqptrlist.h> +#include <tqptrqueue.h> +#include <tqtimer.h> +#include <tqvaluelist.h> #include <kdebug.h> @@ -31,8 +31,8 @@ // --------------- internal class KMessageServerSocket -KMessageServerSocket::KMessageServerSocket (Q_UINT16 port, QObject *parent) - : QServerSocket (port, 0, parent) +KMessageServerSocket::KMessageServerSocket (Q_UINT16 port, TQObject *parent) + : TQServerSocket (port, 0, parent) { } @@ -50,11 +50,11 @@ void KMessageServerSocket::newConnection (int socket) class MessageBuffer { public: - MessageBuffer (Q_UINT32 clientID, const QByteArray &messageData) + MessageBuffer (Q_UINT32 clientID, const TQByteArray &messageData) : id (clientID), data (messageData) { } ~MessageBuffer () {} Q_UINT32 id; - QByteArray data; + TQByteArray data; }; // ---------------- KMessageServer's private class @@ -77,23 +77,23 @@ public: KMessageServerSocket* mServerSocket; - QPtrList <KMessageIO> mClientList; - QPtrQueue <MessageBuffer> mMessageQueue; - QTimer mTimer; + TQPtrList <KMessageIO> mClientList; + TQPtrQueue <MessageBuffer> mMessageQueue; + TQTimer mTimer; bool mIsRecursive; }; // ------------------ KMessageServer -KMessageServer::KMessageServer (Q_UINT16 cookie,QObject* parent) - : QObject(parent, 0) +KMessageServer::KMessageServer (Q_UINT16 cookie,TQObject* parent) + : TQObject(parent, 0) { d = new KMessageServerPrivate; d->mIsRecursive=false; d->mCookie=cookie; - connect (&(d->mTimer), SIGNAL (timeout()), - this, SLOT (processOneMessage())); + connect (&(d->mTimer), TQT_SIGNAL (timeout()), + this, TQT_SLOT (processOneMessage())); kdDebug(11001) << "CREATE(KMessageServer=" << this << ") cookie=" @@ -138,8 +138,8 @@ bool KMessageServer::initNetwork (Q_UINT16 port) kdDebug (11001) << k_funcinfo << ": Now listening to port " << d->mServerSocket->port() << endl; - connect (d->mServerSocket, SIGNAL (newClientConnected (KMessageIO*)), - this, SLOT (addClient (KMessageIO*))); + connect (d->mServerSocket, TQT_SIGNAL (newClientConnected (KMessageIO*)), + this, TQT_SLOT (addClient (KMessageIO*))); return true; } @@ -169,7 +169,7 @@ bool KMessageServer::isOfferingConnections() const void KMessageServer::addClient (KMessageIO* client) { - QByteArray msg; + TQByteArray msg; // maximum number of clients reached? if (d->mMaxClients >= 0 && d->mMaxClients <= clientCount()) @@ -183,25 +183,25 @@ void KMessageServer::addClient (KMessageIO* client) kdDebug (11001) << k_funcinfo << ": " << client->id() << endl; // connect its signals - connect (client, SIGNAL (connectionBroken()), - this, SLOT (removeBrokenClient())); - connect (client, SIGNAL (received (const QByteArray &)), - this, SLOT (getReceivedMessage (const QByteArray &))); + connect (client, TQT_SIGNAL (connectionBroken()), + this, TQT_SLOT (removeBrokenClient())); + connect (client, TQT_SIGNAL (received (const TQByteArray &)), + this, TQT_SLOT (getReceivedMessage (const TQByteArray &))); // Tell everyone about the new guest // Note: The new client doesn't get this message! - QDataStream (msg, IO_WriteOnly) << Q_UINT32 (EVNT_CLIENT_CONNECTED) << client->id(); + TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (EVNT_CLIENT_CONNECTED) << client->id(); broadcastMessage (msg); // add to our list d->mClientList.append (client); // tell it its ID - QDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_CLIENT_ID) << client->id(); + TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_CLIENT_ID) << client->id(); client->send (msg); // Give it the complete list of client IDs - QDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_CLIENT_LIST) << clientIDs(); + TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_CLIENT_LIST) << clientIDs(); client->send (msg); @@ -213,7 +213,7 @@ void KMessageServer::addClient (KMessageIO* client) else { // otherwise tell it who is the admin - QDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_ADMIN_ID) << adminID(); + TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_ADMIN_ID) << adminID(); client->send (msg); } @@ -230,8 +230,8 @@ void KMessageServer::removeClient (KMessageIO* client, bool broken) } // tell everyone about the removed client - QByteArray msg; - QDataStream (msg, IO_WriteOnly) << Q_UINT32 (EVNT_CLIENT_DISCONNECTED) << client->id() << (Q_INT8)broken; + TQByteArray msg; + TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (EVNT_CLIENT_DISCONNECTED) << client->id() << (Q_INT8)broken; broadcastMessage (msg); // If it was the admin, select a new admin. @@ -280,10 +280,10 @@ int KMessageServer::clientCount() const return d->mClientList.count(); } -QValueList <Q_UINT32> KMessageServer::clientIDs () const +TQValueList <Q_UINT32> KMessageServer::clientIDs () const { - QValueList <Q_UINT32> list; - for (QPtrListIterator <KMessageIO> iter (d->mClientList); *iter; ++iter) + TQValueList <Q_UINT32> list; + for (TQPtrListIterator <KMessageIO> iter (d->mClientList); *iter; ++iter) list.append ((*iter)->id()); return list; } @@ -293,7 +293,7 @@ KMessageIO* KMessageServer::findClient (Q_UINT32 no) const if (no == 0) no = d->mAdminID; - QPtrListIterator <KMessageIO> iter (d->mClientList); + TQPtrListIterator <KMessageIO> iter (d->mClientList); while (*iter) { if ((*iter)->id() == no) @@ -322,8 +322,8 @@ void KMessageServer::setAdmin (Q_UINT32 adminID) d->mAdminID = adminID; - QByteArray msg; - QDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_ADMIN_ID) << adminID; + TQByteArray msg; + TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_ADMIN_ID) << adminID; // Tell everyone about the new master broadcastMessage (msg); @@ -339,26 +339,26 @@ Q_UINT32 KMessageServer::uniqueClientNumber() const // --------------------- Messages --------------------------- -void KMessageServer::broadcastMessage (const QByteArray &msg) +void KMessageServer::broadcastMessage (const TQByteArray &msg) { - for (QPtrListIterator <KMessageIO> iter (d->mClientList); *iter; ++iter) + for (TQPtrListIterator <KMessageIO> iter (d->mClientList); *iter; ++iter) (*iter)->send (msg); } -void KMessageServer::sendMessage (Q_UINT32 id, const QByteArray &msg) +void KMessageServer::sendMessage (Q_UINT32 id, const TQByteArray &msg) { KMessageIO *client = findClient (id); if (client) client->send (msg); } -void KMessageServer::sendMessage (const QValueList <Q_UINT32> &ids, const QByteArray &msg) +void KMessageServer::sendMessage (const TQValueList <Q_UINT32> &ids, const TQByteArray &msg) { - for (QValueListConstIterator <Q_UINT32> iter = ids.begin(); iter != ids.end(); ++iter) + for (TQValueListConstIterator <Q_UINT32> iter = ids.begin(); iter != ids.end(); ++iter) sendMessage (*iter, msg); } -void KMessageServer::getReceivedMessage (const QByteArray &msg) +void KMessageServer::getReceivedMessage (const TQByteArray &msg) { if (!sender() || !sender()->inherits("KMessageIO")) { @@ -369,7 +369,7 @@ void KMessageServer::getReceivedMessage (const QByteArray &msg) KMessageIO *client = (KMessageIO *) sender(); Q_UINT32 clientID = client->id(); - //QByteArray *ta=new QByteArray; + //TQByteArray *ta=new QByteArray; //ta->duplicate(msg); //d->mMessageQueue.enqueue (new MessageBuffer (clientID, *ta)); @@ -396,18 +396,18 @@ void KMessageServer::processOneMessage () MessageBuffer *msg_buf = d->mMessageQueue.head(); Q_UINT32 clientID = msg_buf->id; - QBuffer in_buffer (msg_buf->data); + TQBuffer in_buffer (msg_buf->data); in_buffer.open (IO_ReadOnly); - QDataStream in_stream (&in_buffer); + TQDataStream in_stream (&in_buffer); - QByteArray out_msg; - QBuffer out_buffer (out_msg); + TQByteArray out_msg; + TQBuffer out_buffer (out_msg); out_buffer.open (IO_WriteOnly); - QDataStream out_stream (&out_buffer); + TQDataStream out_stream (&out_buffer); bool unknown = false; - QByteArray ttt=in_buffer.buffer(); + TQByteArray ttt=in_buffer.buffer(); Q_UINT32 messageID; in_stream >> messageID; //kdDebug(11001) << k_funcinfo << ": got message with messageID=" << messageID << endl; @@ -416,19 +416,19 @@ void KMessageServer::processOneMessage () case REQ_BROADCAST: out_stream << Q_UINT32 (MSG_BROADCAST) << clientID; // FIXME, compiler bug? - // this should be okay, since QBuffer is subclass of QIODevice! : + // this should be okay, since TQBuffer is subclass of QIODevice! : // out_buffer.writeBlock (in_buffer.readAll()); - out_buffer.QIODevice::writeBlock (in_buffer.readAll()); + out_buffer.TQIODevice::writeBlock (in_buffer.readAll()); broadcastMessage (out_msg); break; case REQ_FORWARD: { - QValueList <Q_UINT32> clients; + TQValueList <Q_UINT32> clients; in_stream >> clients; out_stream << Q_UINT32 (MSG_FORWARD) << clientID << clients; // see above! - out_buffer.QIODevice::writeBlock (in_buffer.readAll()); + out_buffer.TQIODevice::writeBlock (in_buffer.readAll()); sendMessage (clients, out_msg); } break; @@ -455,9 +455,9 @@ void KMessageServer::processOneMessage () case REQ_REMOVE_CLIENT: if (clientID == d->mAdminID) { - QValueList <Q_UINT32> client_list; + TQValueList <Q_UINT32> client_list; in_stream >> client_list; - for (QValueListIterator <Q_UINT32> iter = client_list.begin(); iter != client_list.end(); ++iter) + for (TQValueListIterator <Q_UINT32> iter = client_list.begin(); iter != client_list.end(); ++iter) { KMessageIO *client = findClient (*iter); if (client) diff --git a/libkdegames/kgame/kmessageserver.h b/libkdegames/kgame/kmessageserver.h index 0049a2e7..3d0b1055 100644 --- a/libkdegames/kgame/kmessageserver.h +++ b/libkdegames/kgame/kmessageserver.h @@ -20,10 +20,10 @@ #ifndef __KMESSAGESERVER_H__ #define __KMESSAGESERVER_H__ -#include <qobject.h> -#include <qserversocket.h> -#include <qstring.h> -#include <qvaluelist.h> +#include <tqobject.h> +#include <tqserversocket.h> +#include <tqstring.h> +#include <tqvaluelist.h> class KMessageIO; class KMessageServerPrivate; @@ -42,7 +42,7 @@ class KMessageServerPrivate; KMessageDirect.) This object already has to be connected. The messages are always packages of an arbitrary length. The format of the messages - is given below. All the data is stored and received with QDataStream, to be + is given below. All the data is stored and received with TQDataStream, to be platform independant. Setting up a KMessageServer can be done like this: @@ -72,53 +72,53 @@ class KMessageServerPrivate; This is always interpreted as the admin client, independant of its real clientID. Here is a list of the messages the KMessageServer understands: - << means, the value is inserted into the QByteArray using QDataStream. The + << means, the value is inserted into the TQByteArray using TQDataStream. The messageIDs (REQ_BROADCAST, ...) are of type Q_UINT32. - - QByteArray << static_cast<Q_UINT32>( REQ_BROADCAST ) << raw_data + - TQByteArray << static_cast<Q_UINT32>( REQ_BROADCAST ) << raw_data When the server receives this message, it sends the following message to ALL connected clients (a broadcast), where the raw_data is left unchanged: - QByteArray << static_cast <Q_UINT32>( MSG_BROADCAST ) << clientID << raw_data + TQByteArray << static_cast <Q_UINT32>( MSG_BROADCAST ) << clientID << raw_data Q_UINT32 clientID; // the ID of the client that sent the broadcast request - - QByteArray << static_cast<Q_UINT32>( REQ_FORWARD ) << client_list << raw_data - QValueList <Q_UINT32> client_list; // list of receivers + - TQByteArray << static_cast<Q_UINT32>( REQ_FORWARD ) << client_list << raw_data + TQValueList <Q_UINT32> client_list; // list of receivers When the server receives this message, it sends the following message to the clients in client_list: - QByteArray << static_cast<Q_UINT32>( MSG_FORWARD ) << senderID << client_list << raw_data + TQByteArray << static_cast<Q_UINT32>( MSG_FORWARD ) << senderID << client_list << raw_data Q_UINT32 senderID; // the sender of the forward request - QValueList <Q_UINT32> client_list; // a copy of the receiver list + TQValueList <Q_UINT32> client_list; // a copy of the receiver list Note: Every client receives the message as many times as he is in the client_list. Note: Since the client_list is sent to all the clients, every client can see who else got the message. If you want to prevent this, send a single REQ_FORWARD message for every receiver. - - QByteArray << static_cast<Q_UINT32>( REQ_CLIENT_ID ) + - TQByteArray << static_cast<Q_UINT32>( REQ_CLIENT_ID ) When the server receives this message, it sends the following message to the asking client: - QByteArray << static_cast<Q_UINT32>( ANS_CLIENT_ID ) << clientID + TQByteArray << static_cast<Q_UINT32>( ANS_CLIENT_ID ) << clientID Q_UINT32 clientID; // The ID of the client who asked for it Note: This answer is also automatically sent to a new connected client, so that he can store his ID. The ID of a client doesn't change during his lifetime, and is unique for this KMessageServer. - - QByteArray << static_cast<Q_UINT32>( REQ_ADMIN_ID ) + - TQByteArray << static_cast<Q_UINT32>( REQ_ADMIN_ID ) When the server receives this message, it sends the following message to the asking client: - QByteArray << ANS_ADMIN_ID << adminID + TQByteArray << ANS_ADMIN_ID << adminID Q_UINT32 adminID; // The ID of the admin Note: This answer is also automatically sent to a new connected client, so that he can see if he is the admin or not. It will also be sent to all connected clients when a new admin is set (see REQ_ADMIN_CHANGE). - - QByteArray << static_cast<Q_UINT32>( REQ_ADMIN_CHANGE ) << new_admin + - TQByteArray << static_cast<Q_UINT32>( REQ_ADMIN_CHANGE ) << new_admin Q_UINT32 new_admin; // the ID of the new admin, or 0 for no admin When the server receives this message, it sets the admin to the new ID. If no client @@ -127,8 +127,8 @@ class KMessageServerPrivate; Note: The server sends a ANS_ADMIN_ID message to every connected client. - - QByteArray << static_cast<Q_UINT32>( REQ_REMOVE_CLIENT ) << client_list - QValueList <Q_UINT32> client_list; // The list of clients to be removed + - TQByteArray << static_cast<Q_UINT32>( REQ_REMOVE_CLIENT ) << client_list + TQValueList <Q_UINT32> client_list; // The list of clients to be removed When the server receives this message, it removes the clients with the ids stored in client_list, disconnecting the connection to them. @@ -137,7 +137,7 @@ class KMessageServerPrivate; Note: If one of the clients is the admin himself, he will also be deleted. Another client (if any left) will become the new admin. - - QByteArray << static_cast<Q_UINT32>( REQ_MAX_NUM_CLIENTS ) << maximum_clients + - TQByteArray << static_cast<Q_UINT32>( REQ_MAX_NUM_CLIENTS ) << maximum_clients Q_INT32 maximum_clients; // The maximum of clients connected, or infinite if -1 When the server receives this message, it limits the number of clients to the number given, @@ -147,12 +147,12 @@ class KMessageServerPrivate; Note: If there are already more clients, they are not affected. It only prevents new Clients to be added. To assure this limit, remove clients afterwards (REQ_REMOVE_CLIENT) - - QByteArray << static_cast<Q_UINT32>( REQ_CLIENT_LIST ) + - TQByteArray << static_cast<Q_UINT32>( REQ_CLIENT_LIST ) When the server receives this message, it answers by sending a list of IDs of all the clients that are connected at the moment. So it sends the following message to the asking client: - QByteArray << static_cast<Q_UINT32>( ANS_CLIENT_LIST ) << clientList - QValueList <Q_UINT32> clientList; // The IDs of the connected clients + TQByteArray << static_cast<Q_UINT32>( ANS_CLIENT_LIST ) << clientList + TQValueList <Q_UINT32> clientList; // The IDs of the connected clients Note: This message is also sent to every new connected client, so that he knows the other clients. @@ -160,10 +160,10 @@ class KMessageServerPrivate; There are two more messages that are sent from the server to the every client automatically when a new client connects or a connection to a client is lost: - QByteArray << static_cast<Q_UINT32>( EVNT_CLIENT_CONNECTED ) << clientID; + TQByteArray << static_cast<Q_UINT32>( EVNT_CLIENT_CONNECTED ) << clientID; Q_UINT32 clientID; // the ID of the new connected client - QByteArray << static_cast<Q_UINT32>( EVNT_CLIENT_DISCONNECTED ) << clientID; + TQByteArray << static_cast<Q_UINT32>( EVNT_CLIENT_DISCONNECTED ) << clientID; Q_UINT32 clientID; // the ID of the client that lost the connection Q_UINT8 broken; // 1 if the network connection was closed, 0 if it was disconnected // on purpose @@ -208,7 +208,7 @@ public: /** * Create a KGameNetwork object **/ - KMessageServer(Q_UINT16 cookie = 42, QObject* parent = 0); + KMessageServer(Q_UINT16 cookie = 42, TQObject* parent = 0); ~KMessageServer(); @@ -325,7 +325,7 @@ public: /** * returns a list of the unique IDs of all clients. **/ - QValueList <Q_UINT32> clientIDs() const; + TQValueList <Q_UINT32> clientIDs() const; /** * Find the @ref KMessageIO object to the given client number. @@ -375,7 +375,7 @@ public: * The message is NOT translated in any way. This method calls * @ref KMessageIO::send for every client added. **/ - virtual void broadcastMessage (const QByteArray &msg); + virtual void broadcastMessage (const TQByteArray &msg); /** * Sends a message to a single client with the given ID. @@ -385,7 +385,7 @@ public: * @ref findClient (id)->send(msg) manually, but this method checks for * errors. **/ - virtual void sendMessage (Q_UINT32 id, const QByteArray &msg); + virtual void sendMessage (Q_UINT32 id, const TQByteArray &msg); /** * Sends a message to a list of clients. Their ID is given in ids. If @@ -394,7 +394,7 @@ public: * This is just a convenience method. You could also iterate over the * list of IDs. **/ - virtual void sendMessage (const QValueList <Q_UINT32> &ids, const QByteArray &msg); + virtual void sendMessage (const TQValueList <Q_UINT32> &ids, const TQByteArray &msg); protected slots: /** @@ -406,7 +406,7 @@ protected slots: * @ref KMessageIO::received, since the sender() object is used to find out * the client that sent the message! **/ - virtual void getReceivedMessage (const QByteArray &msg); + virtual void getReceivedMessage (const TQByteArray &msg); /** * This slot is called whenever there are elements in the message queue. This queue @@ -448,7 +448,7 @@ signals: * @param clientID the ID of the KMessageIO object that received the message * @param unknown true, if the message type is not known by the KMessageServer **/ - void messageReceived (const QByteArray &data, Q_UINT32 clientID, bool &unknown); + void messageReceived (const TQByteArray &data, Q_UINT32 clientID, bool &unknown); protected: /** @@ -468,7 +468,7 @@ private: connections. NOTE: This has to be here in the header file, because it is a subclass from - QObject and has to go through the moc. + TQObject and has to go through the moc. @short An internal class for KServerSocket @author Burkhard Lehner <Burkhard.Lehner@gmx.de> @@ -478,7 +478,7 @@ class KMessageServerSocket : public QServerSocket Q_OBJECT public: - KMessageServerSocket (Q_UINT16 port, QObject *parent = 0); + KMessageServerSocket (Q_UINT16 port, TQObject *parent = 0); ~KMessageServerSocket (); void newConnection (int socket); diff --git a/libkdegames/kgame/kplayer.cpp b/libkdegames/kgame/kplayer.cpp index 0f8ea184..fdde20d9 100644 --- a/libkdegames/kgame/kplayer.cpp +++ b/libkdegames/kgame/kplayer.cpp @@ -31,7 +31,7 @@ #include <kdebug.h> #include <klocale.h> -#include <qbuffer.h> +#include <tqbuffer.h> #include <stdio.h> #include <assert.h> @@ -59,12 +59,12 @@ public: KGamePropertyQString mGroup; }; -KPlayer::KPlayer() : QObject(0,0) +KPlayer::KPlayer() : TQObject(0,0) { init(); } -KPlayer::KPlayer(KGame* game) : QObject(0, 0) +KPlayer::KPlayer(KGame* game) : TQObject(0, 0) { init(); game->addPlayer(this); @@ -78,8 +78,8 @@ void KPlayer::init() d = new KPlayerPrivate; d->mProperties.registerHandler(KGameMessage::IdPlayerProperty, - this,SLOT(sendProperty(int, QDataStream&, bool*)), - SLOT(emitSignal(KGamePropertyBase *))); + this,TQT_SLOT(sendProperty(int, TQDataStream&, bool*)), + TQT_SLOT(emitSignal(KGamePropertyBase *))); d->mVirtual=false; mActive=true; mGame=0; @@ -125,7 +125,7 @@ KPlayer::~KPlayer() // kdDebug(11001) << k_funcinfo << " done" << endl; } -bool KPlayer::forwardMessage(QDataStream &msg,int msgid,Q_UINT32 receiver,Q_UINT32 sender) +bool KPlayer::forwardMessage(TQDataStream &msg,int msgid,Q_UINT32 receiver,Q_UINT32 sender) { if (!isActive()) { @@ -139,7 +139,7 @@ bool KPlayer::forwardMessage(QDataStream &msg,int msgid,Q_UINT32 receiver,Q_UINT return game()->sendSystemMessage(msg,msgid,receiver,sender); } -bool KPlayer::forwardInput(QDataStream &msg,bool transmit,Q_UINT32 sender) +bool KPlayer::forwardInput(TQDataStream &msg,bool transmit,Q_UINT32 sender) { if (!isActive()) { @@ -180,16 +180,16 @@ void KPlayer::setId(Q_UINT32 newid) } -void KPlayer::setGroup(const QString& group) +void KPlayer::setGroup(const TQString& group) { d->mGroup = group; } -const QString& KPlayer::group() const +const TQString& KPlayer::group() const { return d->mGroup.value(); } -void KPlayer::setName(const QString& name) +void KPlayer::setName(const TQString& name) { d->mName = name; } -const QString& KPlayer::name() const +const TQString& KPlayer::name() const { return d->mName.value(); } Q_UINT32 KPlayer::id() const @@ -258,7 +258,7 @@ bool KPlayer::removeGameIO(KGameIO *targetinput,bool deleteit) KGameIO * KPlayer::findRttiIO(int rtti) const { - QPtrListIterator<KGameIO> it(mInputList); + TQPtrListIterator<KGameIO> it(mInputList); while (it.current()) { if (it.current()->rtti() == rtti) @@ -273,7 +273,7 @@ KGameIO * KPlayer::findRttiIO(int rtti) const int KPlayer::calcIOValue() { int value=0; - QPtrListIterator<KGameIO> it(mInputList); + TQPtrListIterator<KGameIO> it(mInputList); while (it.current()) { value|=it.current()->rtti(); @@ -311,7 +311,7 @@ bool KPlayer::setTurn(bool b, bool exclusive) return true; } -bool KPlayer::load(QDataStream &stream) +bool KPlayer::load(TQDataStream &stream) { Q_INT32 id,priority; stream >> id >> priority; @@ -337,7 +337,7 @@ bool KPlayer::load(QDataStream &stream) return true; } -bool KPlayer::save(QDataStream &stream) +bool KPlayer::save(TQDataStream &stream) { stream << (Q_INT32)id() << (Q_INT32)networkPriority(); @@ -350,7 +350,7 @@ bool KPlayer::save(QDataStream &stream) } -void KPlayer::networkTransmission(QDataStream &stream,int msgid,Q_UINT32 sender) +void KPlayer::networkTransmission(TQDataStream &stream,int msgid,Q_UINT32 sender) { //kdDebug(11001) << k_funcinfo ": msgid=" << msgid << " sender=" << sender << " we are=" << id() << endl; // PlayerProperties processed @@ -378,7 +378,7 @@ void KPlayer::networkTransmission(QDataStream &stream,int msgid,Q_UINT32 sender) break; default: emit signalNetworkData(msgid - KGameMessage::IdUser, - ((QBuffer*)stream.device())->readAll(),sender,this); + ((TQBuffer*)stream.device())->readAll(),sender,this); kdDebug(11001) << k_funcinfo << ": " << "User data msgid " << msgid << endl; break; @@ -396,7 +396,7 @@ bool KPlayer::addProperty(KGamePropertyBase* data) return d->mProperties.addProperty(data); } -void KPlayer::sendProperty(int msgid, QDataStream& stream, bool* sent) +void KPlayer::sendProperty(int msgid, TQDataStream& stream, bool* sent) { if (game()) { @@ -414,7 +414,7 @@ void KPlayer::emitSignal(KGamePropertyBase *me) if (me->id()==KGamePropertyBase::IdTurn) { //kdDebug(11001) << k_funcinfo << ": for KGamePropertyBase::IdTurn " << endl; - QPtrListIterator<KGameIO> it(mInputList); + TQPtrListIterator<KGameIO> it(mInputList); while (it.current()) { it.current()->notifyTurn(mMyTurn.value()); diff --git a/libkdegames/kgame/kplayer.h b/libkdegames/kgame/kplayer.h index 0e511ac3..a2d78929 100644 --- a/libkdegames/kgame/kplayer.h +++ b/libkdegames/kgame/kplayer.h @@ -21,9 +21,9 @@ #ifndef __KPLAYER_H_ #define __KPLAYER_H_ -#include <qstring.h> -#include <qobject.h> -#include <qptrlist.h> +#include <tqstring.h> +#include <tqobject.h> +#include <tqptrlist.h> #include "kgameproperty.h" #include <kdemacros.h> @@ -71,7 +71,7 @@ class KDE_EXPORT KPlayer : public QObject Q_OBJECT public: - typedef QPtrList<KGameIO> KGameIOList; + typedef TQPtrList<KGameIO> KGameIOList; // KPlayer(KGame *,KGameIO * input=0); /** @@ -259,24 +259,24 @@ public: * A group the player belongs to. This * Can be set arbitrary by you. */ - void setGroup(const QString& group); + void setGroup(const TQString& group); /** * Query the group the player belongs to. */ - virtual const QString& group() const; + virtual const TQString& group() const; /** * Sets the name of the player. * This can be chosen arbitrary. * @param name The player's name */ - void setName(const QString& name); + void setName(const TQString& name); /** * @return The name of the player. */ - virtual const QString& name() const; + virtual const TQString& name() const; // set devices @@ -333,12 +333,12 @@ public: * KGame::playerInput() (if player=false, ie the message *was* sent through * KGame::sendPlayerInput). */ - virtual bool forwardInput(QDataStream &msg,bool transmit=true, Q_UINT32 sender=0); + virtual bool forwardInput(TQDataStream &msg,bool transmit=true, Q_UINT32 sender=0); /** * Forwards Message to the game object..internal use only */ - virtual bool forwardMessage(QDataStream &msg,int msgid,Q_UINT32 receiver=0,Q_UINT32 sender=0); + virtual bool forwardMessage(TQDataStream &msg,int msgid,Q_UINT32 receiver=0,Q_UINT32 sender=0); // Game logic /** @@ -372,7 +372,7 @@ public: * * @return true? */ - virtual bool load(QDataStream &stream); + virtual bool load(TQDataStream &stream); /** * Save a player to a file OR to network. See also load @@ -381,7 +381,7 @@ public: * * @return true? */ - virtual bool save(QDataStream &stream); + virtual bool save(TQDataStream &stream); /** * Receives a message @@ -390,7 +390,7 @@ public: * @param stream The message itself * @param sender **/ - void networkTransmission(QDataStream &stream,int msgid,Q_UINT32 sender); + void networkTransmission(TQDataStream &stream,int msgid,Q_UINT32 sender); /** * Searches for a property of the player given its id. @@ -430,7 +430,7 @@ signals: * means probably a user message. Connecting to this signal * allowed to process it. */ - void signalNetworkData(int msgid, const QByteArray& buffer, Q_UINT32 sender, KPlayer *me); + void signalNetworkData(int msgid, const TQByteArray& buffer, Q_UINT32 sender, KPlayer *me); /** * This signal is emmited if a player property changes its value and @@ -444,7 +444,7 @@ protected slots: /** * Called by KGameProperty only! Internal function! **/ - void sendProperty(int msgid, QDataStream& stream, bool* sent); + void sendProperty(int msgid, TQDataStream& stream, bool* sent); /** * Called by KGameProperty only! Internal function! **/ diff --git a/libkdegames/kgamelcd.cpp b/libkdegames/kgamelcd.cpp index 65c436a5..c87930b5 100644 --- a/libkdegames/kgamelcd.cpp +++ b/libkdegames/kgamelcd.cpp @@ -20,23 +20,23 @@ #include "kgamelcd.h" #include "kgamelcd.moc" -#include <qlayout.h> -#include <qlabel.h> -#include <qtimer.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqtimer.h> #include <kglobal.h> //----------------------------------------------------------------------------- -KGameLCD::KGameLCD(uint nbDigits, QWidget *parent, const char *name) - : QLCDNumber(nbDigits, parent, name), _htime(800) +KGameLCD::KGameLCD(uint nbDigits, TQWidget *parent, const char *name) + : TQLCDNumber(nbDigits, parent, name), _htime(800) { - const QPalette &p = palette(); - _fgColor = p.color(QPalette::Active, QColorGroup::Foreground); - _hlColor = p.color(QPalette::Active, QColorGroup::HighlightedText); + const TQPalette &p = palette(); + _fgColor = p.color(TQPalette::Active, TQColorGroup::Foreground); + _hlColor = p.color(TQPalette::Active, TQColorGroup::HighlightedText); - _timer = new QTimer(this); - connect(_timer, SIGNAL(timeout()), SLOT(timeout())); + _timer = new TQTimer(this); + connect(_timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeout())); setFrameStyle(Panel | Plain); setSegmentStyle(Flat); @@ -47,27 +47,27 @@ KGameLCD::KGameLCD(uint nbDigits, QWidget *parent, const char *name) KGameLCD::~KGameLCD() {} -void KGameLCD::setDefaultBackgroundColor(const QColor &color) +void KGameLCD::setDefaultBackgroundColor(const TQColor &color) { - QPalette p = palette(); - p.setColor(QColorGroup::Background, color); + TQPalette p = palette(); + p.setColor(TQColorGroup::Background, color); setPalette(p); } -void KGameLCD::setDefaultColor(const QColor &color) +void KGameLCD::setDefaultColor(const TQColor &color) { _fgColor = color; - QPalette p = palette(); - p.setColor(QColorGroup::Foreground, color); + TQPalette p = palette(); + p.setColor(TQColorGroup::Foreground, color); setPalette(p); } -void KGameLCD::setHighlightColor(const QColor &color) +void KGameLCD::setHighlightColor(const TQColor &color) { _hlColor = color; } -void KGameLCD::setLeadingString(const QString &s) +void KGameLCD::setLeadingString(const TQString &s) { _lead = s; displayInt(0); @@ -80,21 +80,21 @@ void KGameLCD::setHighlightTime(uint time) void KGameLCD::resetColor() { - setColor(QColor()); + setColor(TQColor()); } -void KGameLCD::setColor(const QColor &color) +void KGameLCD::setColor(const TQColor &color) { - const QColor &c = (color.isValid() ? color : _fgColor); - QPalette p = palette(); - p.setColor(QColorGroup::Foreground, c); + const TQColor &c = (color.isValid() ? color : _fgColor); + TQPalette p = palette(); + p.setColor(TQColorGroup::Foreground, c); setPalette(p); } void KGameLCD::displayInt(int v) { int n = numDigits() - _lead.length(); - display(_lead + QString::number(v).rightJustify(n)); + display(_lead + TQString::number(v).rightJustify(n)); } void KGameLCD::highlight() @@ -110,11 +110,11 @@ void KGameLCD::highlight(bool light) } //----------------------------------------------------------------------------- -KGameLCDClock::KGameLCDClock(QWidget *parent, const char *name) +KGameLCDClock::KGameLCDClock(TQWidget *parent, const char *name) : KGameLCD(5, parent, name) { - _timerClock = new QTimer(this); - connect(_timerClock, SIGNAL(timeout()), SLOT(timeoutClock())); + _timerClock = new TQTimer(this); + connect(_timerClock, TQT_SIGNAL(timeout()), TQT_SLOT(timeoutClock())); } KGameLCDClock::~KGameLCDClock() @@ -132,10 +132,10 @@ void KGameLCDClock::timeoutClock() showTime(); } -QString KGameLCDClock::pretty() const +TQString KGameLCDClock::pretty() const { - QString sec = QString::number(_sec).rightJustify(2, '0', true); - QString min = QString::number(_min).rightJustify(2, '0', true); + TQString sec = TQString::number(_sec).rightJustify(2, '0', true); + TQString min = TQString::number(_min).rightJustify(2, '0', true); return min + ':' + sec; } @@ -175,7 +175,7 @@ void KGameLCDClock::setTime(uint sec) showTime(); } -void KGameLCDClock::setTime(const QString &s) +void KGameLCDClock::setTime(const TQString &s) { Q_ASSERT( s.length()==5 && s[2]==':' ); uint min = kMin(s.section(':', 0, 0).toUInt(), uint(59)); @@ -188,20 +188,20 @@ void KGameLCDClock::setTime(const QString &s) class KGameLCDList::KGameLCDListPrivate { public: - QValueVector<QLabel *> _leadings; + TQValueVector<TQLabel *> _leadings; }; -KGameLCDList::KGameLCDList(const QString &title, QWidget *parent, +KGameLCDList::KGameLCDList(const TQString &title, TQWidget *parent, const char *name) - : QWidget(parent, name) + : TQWidget(parent, name) { init(title); } -KGameLCDList::KGameLCDList(QWidget *parent, const char *name) - : QWidget(parent, name) +KGameLCDList::KGameLCDList(TQWidget *parent, const char *name) + : TQWidget(parent, name) { - init(QString::null); + init(TQString::null); } KGameLCDList::~KGameLCDList() @@ -209,34 +209,34 @@ KGameLCDList::~KGameLCDList() delete d; } -void KGameLCDList::init(const QString &title) +void KGameLCDList::init(const TQString &title) { d = new KGameLCDListPrivate; - QGridLayout *top = new QGridLayout(this, 1, 2, 5); + TQGridLayout *top = new TQGridLayout(this, 1, 2, 5); top->setColStretch(1, 1); - _title = new QLabel(title, this); + _title = new TQLabel(title, this); _title->setAlignment(AlignCenter); top->addMultiCellWidget(_title, 0, 0, 0, 1, AlignCenter); } -void KGameLCDList::append(QLCDNumber *lcd) +void KGameLCDList::append(TQLCDNumber *lcd) { - append(QString::null, lcd); + append(TQString::null, lcd); } -void KGameLCDList::append(const QString &leading, QLCDNumber *lcd) +void KGameLCDList::append(const TQString &leading, TQLCDNumber *lcd) { uint i = size(); - QLabel *label = 0; + TQLabel *label = 0; if ( !leading.isEmpty() ) { - label = new QLabel(leading, this); - static_cast<QGridLayout *>(layout())->addWidget(label, i+1, 0); + label = new TQLabel(leading, this); + static_cast<TQGridLayout *>(layout())->addWidget(label, i+1, 0); } d->_leadings.push_back(label); _lcds.push_back(lcd); - static_cast<QGridLayout *>(layout())->addWidget(lcd, i+1, 1); + static_cast<TQGridLayout *>(layout())->addWidget(lcd, i+1, 1); } void KGameLCDList::clear() diff --git a/libkdegames/kgamelcd.h b/libkdegames/kgamelcd.h index 3e6ad33c..f7d2c58d 100644 --- a/libkdegames/kgamelcd.h +++ b/libkdegames/kgamelcd.h @@ -20,8 +20,8 @@ #ifndef __KGAMELCD_H #define __KGAMELCD_H -#include <qlcdnumber.h> -#include <qvaluevector.h> +#include <tqlcdnumber.h> +#include <tqvaluevector.h> #include <kdemacros.h> class QLabel; @@ -29,7 +29,7 @@ class QTimer; //----------------------------------------------------------------------------- /** - * This class is a visually enhanced @ref QLCDNumber: + * This class is a visually enhanced @ref TQLCDNumber: * <ul> * <li> It can show an additional string before the integer being * displayed.</li> @@ -43,30 +43,30 @@ class KDE_EXPORT KGameLCD : public QLCDNumber { Q_OBJECT public: - KGameLCD(uint nbDigits, QWidget *parent = 0, const char *name = 0); + KGameLCD(uint nbDigits, TQWidget *parent = 0, const char *name = 0); ~KGameLCD(); /** * Set the default background color. */ - void setDefaultBackgroundColor(const QColor &color); + void setDefaultBackgroundColor(const TQColor &color); /** * Set the default foreground color. */ - void setDefaultColor(const QColor &color); + void setDefaultColor(const TQColor &color); /** * Set highlight color. */ - void setHighlightColor(const QColor &color); + void setHighlightColor(const TQColor &color); /** * Set the string that will be displayed before the integer number to be * displayed. By default this string is null. */ - void setLeadingString(const QString &s); + void setLeadingString(const TQString &s); /** * Set the highlight duration in milliseconds. The default value is @@ -82,7 +82,7 @@ public: /** * Set the foreground color. */ - void setColor(const QColor &color); + void setColor(const TQColor &color); public slots: /** @@ -94,8 +94,8 @@ public slots: /** * Display the given integer with the (optionnal) leading string. * - * Note: we cannot use display(int) since QLCDNumber::display is - * not virtual... And you cannot use QLCDNumber::intValue() to retrieve + * Note: we cannot use display(int) since TQLCDNumber::display is + * not virtual... And you cannot use TQLCDNumber::intValue() to retrieve * the given value. */ void displayInt(int value); @@ -104,10 +104,10 @@ private slots: void timeout() { highlight(false); } private: - QColor _fgColor, _hlColor; - QString _lead; + TQColor _fgColor, _hlColor; + TQString _lead; uint _htime; - QTimer *_timer; + TQTimer *_timer; class KGameLCDPrivate; KGameLCDPrivate *d; @@ -127,7 +127,7 @@ class KDE_EXPORT KGameLCDClock : public KGameLCD { Q_OBJECT public: - KGameLCDClock(QWidget *parent = 0, const char *name = 0); + KGameLCDClock(TQWidget *parent = 0, const char *name = 0); ~KGameLCDClock(); @@ -139,7 +139,7 @@ public: /** * @return the time as a string to be displayed: "mm:ss". */ - QString pretty() const; + TQString pretty() const; /** * Set the time. @@ -149,7 +149,7 @@ public: /** * Set the time (format should be "mm:ss"). */ - void setTime(const QString &s); + void setTime(const TQString &s); public slots: /** @@ -171,7 +171,7 @@ protected slots: virtual void timeoutClock(); private: - QTimer *_timerClock; + TQTimer *_timerClock; uint _sec, _min; class KGameLCDClockPrivate; @@ -182,7 +182,7 @@ private: //----------------------------------------------------------------------------- /** - * This widget holds a list of @ref QLCDNumber arranged in a vertical layout. + * This widget holds a list of @ref TQLCDNumber arranged in a vertical layout. * It also shows a label at the top of the list. * * @since 3.2 @@ -195,55 +195,55 @@ public: * Constructor. * * @param title is the content of the top label. - * @param parent passed to the QWidget constructor - * @param name passed to the QWidget constructor + * @param parent passed to the TQWidget constructor + * @param name passed to the TQWidget constructor */ - KGameLCDList(const QString &title, - QWidget *parent = 0, const char *name = 0); - KGameLCDList(QWidget *parent = 0, const char *name = 0); + KGameLCDList(const TQString &title, + TQWidget *parent = 0, const char *name = 0); + KGameLCDList(TQWidget *parent = 0, const char *name = 0); ~KGameLCDList(); /** - * Append a QLCDNumber at the bottom of the list. - * The QLCDNumber should have the KGameLCDList as parent. + * Append a TQLCDNumber at the bottom of the list. + * The TQLCDNumber should have the KGameLCDList as parent. */ - void append(QLCDNumber *lcd); + void append(TQLCDNumber *lcd); /** - * Append a QLCDNumber at the bottom of the list. - * The QLCDNumber should have the KGameLCDList as parent. + * Append a TQLCDNumber at the bottom of the list. + * The TQLCDNumber should have the KGameLCDList as parent. */ - void append(const QString &leading, QLCDNumber *lcd); + void append(const TQString &leading, TQLCDNumber *lcd); /** - * Delete all @ref QLCDNumber and clear the list. + * Delete all @ref TQLCDNumber and clear the list. */ void clear(); /** * @return the title label. */ - QLabel *title() const { return _title; } + TQLabel *title() const { return _title; } /** - * @return the QLCDNumber at index @param i + * @return the TQLCDNumber at index @param i */ - QLCDNumber *lcd(uint i) const { return _lcds[i]; } + TQLCDNumber *lcd(uint i) const { return _lcds[i]; } /** - * @return the number of QLCDNumber in the list. + * @return the number of TQLCDNumber in the list. */ uint size() const { return _lcds.size(); } private: - QLabel *_title; - QValueVector<QLCDNumber *> _lcds; + TQLabel *_title; + TQValueVector<TQLCDNumber *> _lcds; class KGameLCDListPrivate; KGameLCDListPrivate *d; - void init(const QString &title); + void init(const TQString &title); }; #endif diff --git a/libkdegames/kgamemisc.cpp b/libkdegames/kgamemisc.cpp index bfedd11c..1c318476 100644 --- a/libkdegames/kgamemisc.cpp +++ b/libkdegames/kgamemisc.cpp @@ -20,7 +20,7 @@ $Id$ */ -#include <qstringlist.h> +#include <tqstringlist.h> #include <krandomsequence.h> #include <klocale.h> @@ -48,9 +48,9 @@ KGameMisc::~KGameMisc() // delete d; } -QString KGameMisc::randomName()// do we need i18n? I think yes +TQString KGameMisc::randomName()// do we need i18n? I think yes { - QStringList names = QStringList::split( QChar(' '), + TQStringList names = TQStringList::split( TQChar(' '), i18n( "A list of language typical names ( for games ), separated by spaces", "Adam Alex Andreas Andrew Bart Ben Bernd Bill " "Chris Chuck Daniel Don Duncan Ed Emily Eric " diff --git a/libkdegames/kgamemisc.h b/libkdegames/kgamemisc.h index 526bb0ae..694a6a00 100644 --- a/libkdegames/kgamemisc.h +++ b/libkdegames/kgamemisc.h @@ -22,7 +22,7 @@ #ifndef __KGAMEMISC_H__ #define __KGAMEMISC_H__ -#include <qstring.h> +#include <tqstring.h> #include <kdemacros.h> class KGameMiscPrivate; /** @@ -36,7 +36,7 @@ public: KGameMisc(); ~KGameMisc(); - static QString randomName(); + static TQString randomName(); private: KGameMiscPrivate* d; diff --git a/libkdegames/kgameprogress.cpp b/libkdegames/kgameprogress.cpp index 861dd454..c9f122fb 100644 --- a/libkdegames/kgameprogress.cpp +++ b/libkdegames/kgameprogress.cpp @@ -19,36 +19,36 @@ * KGameProgress -- a progress indicator widget for KDE. */ -#include <qpainter.h> -#include <qpixmap.h> -#include <qstring.h> -#include <qregexp.h> -#include <qstyle.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqstring.h> +#include <tqregexp.h> +#include <tqstyle.h> #include "kgameprogress.h" #include <kapplication.h> -KGameProgress::KGameProgress(QWidget *parent, const char *name) - : QFrame(parent, name), - QRangeControl(0, 100, 1, 10, 0), +KGameProgress::KGameProgress(TQWidget *parent, const char *name) + : TQFrame(parent, name), + TQRangeControl(0, 100, 1, 10, 0), orient(Horizontal) { initialize(); } -KGameProgress::KGameProgress(Orientation orientation, QWidget *parent, const char *name) - : QFrame(parent, name), - QRangeControl(0, 100, 1, 10, 0), +KGameProgress::KGameProgress(Orientation orientation, TQWidget *parent, const char *name) + : TQFrame(parent, name), + TQRangeControl(0, 100, 1, 10, 0), orient(orientation) { initialize(); } KGameProgress::KGameProgress(int minValue, int maxValue, int value, - Orientation orientation, QWidget *parent, const char *name) - : QFrame(parent, name), - QRangeControl(minValue, maxValue, 1, 10, value), + Orientation orientation, TQWidget *parent, const char *name) + : TQFrame(parent, name), + TQRangeControl(minValue, maxValue, 1, 10, value), orient(orientation) { initialize(); @@ -72,14 +72,14 @@ void KGameProgress::initialize() bar_style = Solid; text_enabled = TRUE; setBackgroundMode( PaletteBackground ); - connect(kapp, SIGNAL(appearanceChanged()), this, SLOT(paletteChange())); + connect(kapp, TQT_SIGNAL(appearanceChanged()), this, TQT_SLOT(paletteChange())); paletteChange(); } void KGameProgress::paletteChange() { - QPalette p = kapp->palette(); - const QColorGroup &colorGroup = p.active(); + TQPalette p = kapp->palette(); + const TQColorGroup &colorGroup = p.active(); if (!use_supplied_bar_color) bar_color = colorGroup.highlight(); bar_text_color = colorGroup.highlightedText(); @@ -90,17 +90,17 @@ void KGameProgress::paletteChange() } -void KGameProgress::setBarPixmap(const QPixmap &pixmap) +void KGameProgress::setBarPixmap(const TQPixmap &pixmap) { if (pixmap.isNull()) return; if (bar_pixmap) delete bar_pixmap; - bar_pixmap = new QPixmap(pixmap); + bar_pixmap = new TQPixmap(pixmap); } -void KGameProgress::setBarColor(const QColor &color) +void KGameProgress::setBarColor(const TQColor &color) { bar_color = color; use_supplied_bar_color = true; @@ -128,7 +128,7 @@ void KGameProgress::setOrientation(Orientation orientation) void KGameProgress::setValue(int value) { - QRangeControl::setValue(value); + TQRangeControl::setValue(value); } void KGameProgress::setTextEnabled(bool enable) @@ -136,12 +136,12 @@ void KGameProgress::setTextEnabled(bool enable) text_enabled = enable; } -const QColor & KGameProgress::barColor() const +const TQColor & KGameProgress::barColor() const { return bar_color; } -const QPixmap * KGameProgress::barPixmap() const +const TQPixmap * KGameProgress::barPixmap() const { return bar_pixmap; } @@ -151,9 +151,9 @@ bool KGameProgress::textEnabled() const return text_enabled; } -QSize KGameProgress::sizeHint() const +TQSize KGameProgress::sizeHint() const { - QSize s( size() ); + TQSize s( size() ); if(orientation() == KGameProgress::Vertical) { s.setWidth(24); @@ -164,17 +164,17 @@ QSize KGameProgress::sizeHint() const return s; } -QSize KGameProgress::minimumSizeHint() const +TQSize KGameProgress::minimumSizeHint() const { return sizeHint(); } -QSizePolicy KGameProgress::sizePolicy() const +TQSizePolicy KGameProgress::sizePolicy() const { if ( orientation()==KGameProgress::Vertical ) - return QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding ); + return TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Expanding ); else - return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + return TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ); } KGameProgress::Orientation KGameProgress::orientation() const @@ -206,48 +206,48 @@ void KGameProgress::rangeChange() emit percentageChanged(recalcValue(100)); } -void KGameProgress::styleChange(QStyle&) +void KGameProgress::styleChange(TQStyle&) { adjustStyle(); } void KGameProgress::adjustStyle() { - switch (style().styleHint(QStyle::SH_GUIStyle)) { + switch (style().styleHint(TQStyle::SH_GUIStyle)) { case WindowsStyle: - setFrameStyle(QFrame::WinPanel | QFrame::Sunken); + setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); break; case MotifStyle: default: - setFrameStyle(QFrame::Panel | QFrame::Sunken); + setFrameStyle(TQFrame::Panel | TQFrame::Sunken); setLineWidth( 2 ); break; } update(); } -void KGameProgress::paletteChange( const QPalette &p ) +void KGameProgress::paletteChange( const TQPalette &p ) { // This never gets called for global color changes // because we call setPalette() ourselves. - QFrame::paletteChange(p); + TQFrame::paletteChange(p); } -void KGameProgress::drawText(QPainter *p) +void KGameProgress::drawText(TQPainter *p) { - QRect r(contentsRect()); - //QColor c(bar_color.rgb() ^ backgroundColor().rgb()); + TQRect r(contentsRect()); + //TQColor c(bar_color.rgb() ^ backgroundColor().rgb()); // Rik: Replace the tags '%p', '%v' and '%m' with the current percentage, // the current value and the maximum value respectively. - QString s(format_); + TQString s(format_); - s.replace(QRegExp(QString::fromLatin1("%p")), QString::number(recalcValue(100))); - s.replace(QRegExp(QString::fromLatin1("%v")), QString::number(value())); - s.replace(QRegExp(QString::fromLatin1("%m")), QString::number(maxValue())); + s.replace(TQRegExp(TQString::fromLatin1("%p")), TQString::number(recalcValue(100))); + s.replace(TQRegExp(TQString::fromLatin1("%v")), TQString::number(value())); + s.replace(TQRegExp(TQString::fromLatin1("%m")), TQString::number(maxValue())); p->setPen(text_color); - QFont font = p->font(); + TQFont font = p->font(); font.setBold(true); p->setFont(font); //p->setRasterOp(XorROP); @@ -257,11 +257,11 @@ void KGameProgress::drawText(QPainter *p) p->drawText(r, AlignCenter, s); } -void KGameProgress::drawContents(QPainter *p) +void KGameProgress::drawContents(TQPainter *p) { - QRect cr = contentsRect(), er = cr; + TQRect cr = contentsRect(), er = cr; fr = cr; - QBrush fb(bar_color), eb(backgroundColor()); + TQBrush fb(bar_color), eb(backgroundColor()); if (bar_pixmap) fb.setPixmap(*bar_pixmap); @@ -292,7 +292,7 @@ void KGameProgress::drawContents(QPainter *p) if (orient == Horizontal) { fr.setHeight(cr.height() - 2 * margin); fr.setWidth((int)(0.67 * fr.height())); - fr.moveTopLeft(QPoint(cr.left() + margin, cr.top() + margin)); + fr.moveTopLeft(TQPoint(cr.left() + margin, cr.top() + margin)); dx = fr.width() + margin; dy = 0; max = (cr.width() - margin) / (fr.width() + margin) + 1; @@ -300,7 +300,7 @@ void KGameProgress::drawContents(QPainter *p) } else { fr.setWidth(cr.width() - 2 * margin); fr.setHeight((int)(0.67 * fr.width())); - fr.moveBottomLeft(QPoint(cr.left() + margin, cr.bottom() - margin)); + fr.moveBottomLeft(TQPoint(cr.left() + margin, cr.bottom() - margin)); dx = 0; dy = - (fr.height() + margin); max = (cr.height() - margin) / (fr.height() + margin) + 1; @@ -332,12 +332,12 @@ void KGameProgress::drawContents(QPainter *p) drawText(p); } -void KGameProgress::setFormat(const QString & format) +void KGameProgress::setFormat(const TQString & format) { format_ = format; } -QString KGameProgress::format() const +TQString KGameProgress::format() const { return format_; } diff --git a/libkdegames/kgameprogress.h b/libkdegames/kgameprogress.h index d6a353ac..d4cebe7b 100644 --- a/libkdegames/kgameprogress.h +++ b/libkdegames/kgameprogress.h @@ -24,13 +24,13 @@ #ifndef _KPROGRES_H #define _KPROGRES_H "$Id$" -#include <qframe.h> -#include <qrangecontrol.h> +#include <tqframe.h> +#include <tqrangecontrol.h> #include <kdemacros.h> /** * @short A progress indicator widget. * - * KGameProgress is derived from QFrame and QRangeControl, so + * KGameProgress is derived from TQFrame and TQRangeControl, so * you can use all the methods from those classes. The only difference * is that setValue() is now made a slot, so you can connect * stuff to it. @@ -47,14 +47,14 @@ * @author Martynas Kunigelis * @version $Id$ */ -class KDE_EXPORT KGameProgress : public QFrame, public QRangeControl +class KDE_EXPORT KGameProgress : public TQFrame, public QRangeControl { Q_OBJECT Q_ENUMS( BarStyle ) Q_PROPERTY( int value READ value WRITE setValue) Q_PROPERTY( BarStyle barStyle READ barStyle WRITE setBarStyle ) - Q_PROPERTY( QColor barColor READ barColor WRITE setBarColor ) - Q_PROPERTY( QPixmap barPixmap READ barPixmap WRITE setBarPixmap ) + Q_PROPERTY( TQColor barColor READ barColor WRITE setBarColor ) + Q_PROPERTY( TQPixmap barPixmap READ barPixmap WRITE setBarPixmap ) Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) Q_PROPERTY( bool textEnabled READ textEnabled WRITE setTextEnabled ) @@ -70,18 +70,18 @@ public: /** * Construct a horizontal progress bar. */ - KGameProgress(QWidget *parent=0, const char *name=0); + KGameProgress(TQWidget *parent=0, const char *name=0); /** * Construct a progress bar with orientation @p orient. */ - KGameProgress(Orientation orient, QWidget *parent=0, const char *name=0); + KGameProgress(Orientation orient, TQWidget *parent=0, const char *name=0); /** * Construct a progress bar with minimum, maximum and initial values. */ KGameProgress(int minValue, int maxValue, int value, Orientation, - QWidget *parent=0, const char *name=0); + TQWidget *parent=0, const char *name=0); /** * Destruct the progress bar. @@ -98,12 +98,12 @@ public: /** * Set the color of the progress bar. */ - void setBarColor(const QColor &); + void setBarColor(const TQColor &); /** * Set a pixmap to be shown in the progress bar. */ - void setBarPixmap(const QPixmap &); + void setBarPixmap(const TQPixmap &); /** * Set the orientation of the progress bar. @@ -129,21 +129,21 @@ public: * Retrieve the bar color. * @see setBarColor() */ - const QColor &barColor() const; + const TQColor &barColor() const; /** * Retrieve the bar pixmap. * * @see setBarPixmap() */ - const QPixmap *barPixmap() const; + const TQPixmap *barPixmap() const; /** * Retrive the current status * * @see setValue() */ - int value() const { return QRangeControl::value(); } + int value() const { return TQRangeControl::value(); } /** * Retrive the orientation of the progress bar. * @@ -161,21 +161,21 @@ public: /** */ - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; /** */ - virtual QSize minimumSizeHint() const; + virtual TQSize minimumSizeHint() const; /** */ - virtual QSizePolicy sizePolicy() const; + virtual TQSizePolicy sizePolicy() const; /** * Retrieve the current format for printing status text. * @see setFormat() */ - QString format() const; + TQString format() const; public slots: @@ -187,7 +187,7 @@ public slots: * @param format %p is replaced by percentage done, %v is replaced by actual * value, %m is replaced by the maximum value. */ - void setFormat(const QString & format); + void setFormat(const TQString & format); /** * Set the current value of the progress bar to @p value. @@ -220,31 +220,31 @@ protected: void rangeChange(); /** */ - void styleChange( QStyle& ); + void styleChange( TQStyle& ); /** */ - void paletteChange( const QPalette & ); + void paletteChange( const TQPalette & ); /** */ - void drawContents( QPainter * ); + void drawContents( TQPainter * ); private slots: void paletteChange(); private: - QPixmap *bar_pixmap; + TQPixmap *bar_pixmap; bool use_supplied_bar_color; - QColor bar_color; - QColor bar_text_color; - QColor text_color; - QRect fr; + TQColor bar_color; + TQColor bar_text_color; + TQColor text_color; + TQRect fr; BarStyle bar_style; Orientation orient; bool text_enabled; - QString format_; + TQString format_; void initialize(); int recalcValue(int); - void drawText(QPainter *); + void drawText(TQPainter *); void adjustStyle(); class KGameProgressPrivate; diff --git a/libkdegames/kgrid2d.h b/libkdegames/kgrid2d.h index f9dfd8dd..22a3c19d 100644 --- a/libkdegames/kgrid2d.h +++ b/libkdegames/kgrid2d.h @@ -22,9 +22,9 @@ #include <math.h> -#include <qpair.h> -#include <qvaluelist.h> -#include <qvaluevector.h> +#include <tqpair.h> +#include <tqvaluelist.h> +#include <tqvaluevector.h> #include <kglobal.h> @@ -42,7 +42,7 @@ namespace KGrid2D * This type represents a list of @ref Coord. * @since 3.2 */ - typedef QValueList<Coord> CoordList; + typedef TQValueList<Coord> CoordList; } inline KGrid2D::Coord @@ -72,11 +72,11 @@ minimum(const KGrid2D::Coord &c1, const KGrid2D::Coord &c2) { return KGrid2D::Coord(kMin(c1.first, c2.first), kMin(c1.second, c2.second)); } -inline QTextStream &operator <<(QTextStream &s, const KGrid2D::Coord &c) { +inline TQTextStream &operator <<(TQTextStream &s, const KGrid2D::Coord &c) { return s << '(' << c.second << ", " << c.first << ')'; } -inline QTextStream &operator <<(QTextStream &s, const KGrid2D::CoordList &list) +inline TQTextStream &operator <<(TQTextStream &s, const KGrid2D::CoordList &list) { for(KGrid2D::CoordList::const_iterator i=list.begin(); i!=list.end(); ++i) s << *i; @@ -200,19 +200,19 @@ class Generic protected: uint _width, _height; - QValueVector<Type> _vector; + TQValueVector<Type> _vector; }; } template <class Type> -QDataStream &operator <<(QDataStream &s, const KGrid2D::Generic<Type> &m) { +TQDataStream &operator <<(TQDataStream &s, const KGrid2D::Generic<Type> &m) { s << (Q_UINT32)m.width() << (Q_UINT32)m.height(); for (uint i=0; i<m.size(); i++) s << m[i]; return s; } template <class Type> -QDataStream &operator >>(QDataStream &s, KGrid2D::Generic<Type> &m) { +TQDataStream &operator >>(TQDataStream &s, KGrid2D::Generic<Type> &m) { Q_UINT32 w, h; s >> w >> h; m.resize(w, h); diff --git a/libkdegames/kstdgameaction.cpp b/libkdegames/kstdgameaction.cpp index 53b8f16c..f37af6cb 100644 --- a/libkdegames/kstdgameaction.cpp +++ b/libkdegames/kstdgameaction.cpp @@ -32,7 +32,7 @@ KStdGameAction::KStdGameAction() KStdGameAction::~KStdGameAction() {} -KAction *KStdGameAction::action(StdGameAction act_enum, const QObject *recvr, +KAction *KStdGameAction::action(StdGameAction act_enum, const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name) { @@ -96,14 +96,14 @@ static const KStdGameActionInfo* infoPtr( KStdGameAction::StdGameAction id ) KAction* KStdGameAction::create(StdGameAction id, const char *name, - const QObject *recvr, const char *slot, + const TQObject *recvr, const char *slot, KActionCollection* parent ) { KAction* pAction = 0; const KStdGameActionInfo* pInfo = infoPtr( id ); kdDebug(125) << "KStdGameAction::create( " << id << "=" << (pInfo ? pInfo->psName : (const char*)0) << ", " << parent << ", " << name << " )" << endl; if( pInfo ) { - QString sLabel = i18n(pInfo->psLabel); + TQString sLabel = i18n(pInfo->psLabel); KShortcut cut = (pInfo->globalAccel==KStdAccel::AccelNone ? KShortcut(pInfo->shortcut) : KStdAccel::shortcut(pInfo->globalAccel)); @@ -137,73 +137,73 @@ const char* KStdGameAction::name( StdGameAction id ) return (pInfo) ? pInfo->psName : 0; } -KAction *KStdGameAction::gameNew(const QObject *recvr, const char *slot, +KAction *KStdGameAction::gameNew(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name ) { return KStdGameAction::create(New, name, recvr, slot, parent); } -KAction *KStdGameAction::load(const QObject *recvr, const char *slot, +KAction *KStdGameAction::load(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name ) { return KStdGameAction::create(Load, name, recvr, slot, parent); } -KRecentFilesAction *KStdGameAction::loadRecent(const QObject *recvr, const char *slot, +KRecentFilesAction *KStdGameAction::loadRecent(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name ) { return static_cast<KRecentFilesAction *>(KStdGameAction::create(LoadRecent, name, recvr, slot, parent)); } -KAction *KStdGameAction::save(const QObject *recvr, const char *slot, +KAction *KStdGameAction::save(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name ) { return KStdGameAction::create(Save, name, recvr, slot, parent); } -KAction *KStdGameAction::saveAs(const QObject *recvr, const char *slot, +KAction *KStdGameAction::saveAs(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name ) { return KStdGameAction::create(SaveAs, name, recvr, slot, parent); } -KAction *KStdGameAction::end(const QObject *recvr, const char *slot, +KAction *KStdGameAction::end(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name ) { return KStdGameAction::create(End, name, recvr, slot, parent); } -KToggleAction *KStdGameAction::pause(const QObject *recvr, const char *slot, +KToggleAction *KStdGameAction::pause(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name ) { return static_cast<KToggleAction *>(KStdGameAction::create(Pause, name, recvr, slot, parent)); } -KAction *KStdGameAction::highscores(const QObject *recvr, const char *slot, +KAction *KStdGameAction::highscores(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name ) { return KStdGameAction::create(Highscores, name, recvr, slot, parent); } -KAction *KStdGameAction::print(const QObject *recvr, const char *slot, +KAction *KStdGameAction::print(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name ) { return KStdGameAction::create(Print, name, recvr, slot, parent); } -KAction *KStdGameAction::quit(const QObject *recvr, const char *slot, +KAction *KStdGameAction::quit(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name ) { return KStdGameAction::create(Quit, name, recvr, slot, parent); } -KAction *KStdGameAction::repeat(const QObject *recvr, const char *slot, +KAction *KStdGameAction::repeat(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name ) { return KStdGameAction::create(Repeat, name, recvr, slot, parent); } -KAction *KStdGameAction::undo(const QObject *recvr, const char *slot, +KAction *KStdGameAction::undo(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name ) { return KStdGameAction::create(Undo, name, recvr, slot, parent); } -KAction *KStdGameAction::redo(const QObject *recvr, const char *slot, +KAction *KStdGameAction::redo(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name ) { return KStdGameAction::create(Redo, name, recvr, slot, parent); } -KAction *KStdGameAction::roll(const QObject *recvr, const char *slot, +KAction *KStdGameAction::roll(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name ) { return KStdGameAction::create(Roll, name, recvr, slot, parent); } -KAction *KStdGameAction::endTurn(const QObject *recvr, const char *slot, +KAction *KStdGameAction::endTurn(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name ) { return KStdGameAction::create(EndTurn, name, recvr, slot, parent); } -KAction *KStdGameAction::carddecks(const QObject *recvr, const char *slot, +KAction *KStdGameAction::carddecks(const TQObject *recvr, const char *slot, KActionCollection *parent, const char *name ) { return KStdGameAction::create(Carddecks, name, recvr, slot, parent); } -KAction *KStdGameAction::configureHighscores(const QObject*recvr, const char *slot, +KAction *KStdGameAction::configureHighscores(const TQObject*recvr, const char *slot, KActionCollection *parent, const char *name) { return KStdGameAction::create(ConfigureHighscores, name, recvr, slot, parent); } -KAction *KStdGameAction::hint(const QObject*recvr, const char *slot, +KAction *KStdGameAction::hint(const TQObject*recvr, const char *slot, KActionCollection *parent, const char *name) { return KStdGameAction::create(Hint, name, recvr, slot, parent); } -KToggleAction *KStdGameAction::demo(const QObject*recvr, const char *slot, +KToggleAction *KStdGameAction::demo(const TQObject*recvr, const char *slot, KActionCollection *parent, const char *name) { return static_cast<KToggleAction *>(KStdGameAction::create(Demo, name, recvr, slot, parent)); } -KAction *KStdGameAction::solve(const QObject*recvr, const char *slot, +KAction *KStdGameAction::solve(const TQObject*recvr, const char *slot, KActionCollection *parent, const char *name) { return KStdGameAction::create(Solve, name, recvr, slot, parent); } -KSelectAction *KStdGameAction::chooseGameType(const QObject*recvr, const char *slot, +KSelectAction *KStdGameAction::chooseGameType(const TQObject*recvr, const char *slot, KActionCollection *parent, const char *name) { return static_cast<KSelectAction *>(KStdGameAction::create(ChooseGameType, name, recvr, slot, parent)); } -KAction *KStdGameAction::restart(const QObject*recvr, const char *slot, +KAction *KStdGameAction::restart(const TQObject*recvr, const char *slot, KActionCollection *parent, const char *name) { return KStdGameAction::create(Restart, name, recvr, slot, parent); } diff --git a/libkdegames/kstdgameaction.h b/libkdegames/kstdgameaction.h index a38082af..dd653165 100644 --- a/libkdegames/kstdgameaction.h +++ b/libkdegames/kstdgameaction.h @@ -78,14 +78,14 @@ public: * @since 3.2 */ static KAction* create( StdGameAction id, const char *name, - const QObject *recvr, const char *slot, + const TQObject *recvr, const char *slot, KActionCollection* parent ); /** * @since 3.2 */ static KAction* create( StdGameAction id, - const QObject *recvr, const char *slot, + const TQObject *recvr, const char *slot, KActionCollection* parent ) { return create( id, 0, recvr, slot, parent ); } @@ -95,7 +95,7 @@ public: * KStdGameAction::StdGameAction enum. * @deprecated */ - static KAction *action(StdGameAction act_enum, const QObject *recvr = 0, + static KAction *action(StdGameAction act_enum, const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); @@ -114,43 +114,43 @@ public: /** * Start a new game **/ - static KAction *gameNew(const QObject *recvr = 0, const char *slot = 0, + static KAction *gameNew(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Load a previousely saved game */ - static KAction *load(const QObject *recvr = 0, const char *slot = 0, + static KAction *load(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Load a recently loaded game. */ - static KRecentFilesAction *loadRecent(const QObject *recvr = 0, const char *slot = 0, + static KRecentFilesAction *loadRecent(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Save the current game. */ - static KAction *save(const QObject *recvr = 0, const char *slot = 0, + static KAction *save(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Save the current game under a different filename. */ - static KAction *saveAs(const QObject *recvr = 0, const char *slot = 0, + static KAction *saveAs(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Pause the game **/ - static KToggleAction *pause(const QObject *recvr = 0, const char *slot = 0, + static KToggleAction *pause(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Show the highscores. */ - static KAction *highscores(const QObject *recvr = 0, const char *slot = 0, + static KAction *highscores(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); @@ -158,20 +158,20 @@ public: * End the current game, but do not quit the program. Think of a "close" * entry. */ - static KAction *end(const QObject *recvr = 0, const char *slot = 0, + static KAction *end(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Print the current screen? Game? Whatever - hardly used in games but there * is at least one example (ktuberling) */ - static KAction *print(const QObject *recvr = 0, const char *slot = 0, + static KAction *print(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Quit the game. */ - static KAction *quit(const QObject *recvr = 0, const char *slot = 0, + static KAction *quit(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); @@ -179,81 +179,81 @@ public: /** * Repeat the last move. **/ - static KAction *repeat(const QObject *recvr = 0, const char *slot = 0, + static KAction *repeat(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Undo the last move **/ - static KAction *undo(const QObject *recvr = 0, const char *slot = 0, + static KAction *undo(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Redo the last move (which has been undone) **/ - static KAction *redo(const QObject *recvr = 0, const char *slot = 0, + static KAction *redo(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Roll die or dice **/ - static KAction *roll(const QObject *recvr = 0, const char *slot = 0, + static KAction *roll(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * End the current turn (not the game). Usually to let the next player * start **/ - static KAction *endTurn(const QObject *recvr = 0, const char *slot = 0, + static KAction *endTurn(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Display configure carddecks dialog. */ - static KAction *carddecks(const QObject *recvr = 0, const char *slot = 0, + static KAction *carddecks(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Display configure highscores dialog. * @since 3.2 */ - static KAction *configureHighscores(const QObject *recvr = 0, const char *slot = 0, + static KAction *configureHighscores(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Give an advice/hint. * @since 3.2 */ - static KAction *hint(const QObject *recvr = 0, const char *slot = 0, + static KAction *hint(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Show a demo. * @since 3.2 */ - static KToggleAction *demo(const QObject *recvr = 0, const char *slot = 0, + static KToggleAction *demo(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Solve the game. * @since 3.2 */ - static KAction *solve(const QObject *recvr = 0, const char *slot = 0, + static KAction *solve(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Choose game type. * @since 3.2 */ - static KSelectAction *chooseGameType(const QObject *recvr = 0, const char *slot = 0, + static KSelectAction *chooseGameType(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); /** * Restart game. * @since 3.2 */ - static KAction *restart(const QObject *recvr = 0, const char *slot = 0, + static KAction *restart(const TQObject *recvr = 0, const char *slot = 0, KActionCollection *parent = 0, const char *name = 0L ); }; diff --git a/libksirtet/base/board.cpp b/libksirtet/base/board.cpp index 257e72c3..12193e31 100644 --- a/libksirtet/base/board.cpp +++ b/libksirtet/base/board.cpp @@ -12,14 +12,14 @@ using namespace KGrid2D; //----------------------------------------------------------------------------- -FixedCanvasView::FixedCanvasView(QWidget *parent, const char *name) - : QCanvasView(parent, name, WNoAutoErase) +FixedCanvasView::FixedCanvasView(TQWidget *parent, const char *name) + : TQCanvasView(parent, name, WNoAutoErase) {} -QSize FixedCanvasView::sizeHint() const +TQSize FixedCanvasView::sizeHint() const { - if ( canvas()==0 ) return QSize(); - return canvas()->size() + 2 * QSize(frameWidth(), frameWidth()); + if ( canvas()==0 ) return TQSize(); + return canvas()->size() + 2 * TQSize(frameWidth(), frameWidth()); } void FixedCanvasView::adjustSize() @@ -35,7 +35,7 @@ const BaseBoard::DirectionData BaseBoard::DIRECTION_DATA[Nb_Direction] = { { SquareBase::Up, Down } }; -BaseBoard::BaseBoard(bool graphic, QWidget *parent) +BaseBoard::BaseBoard(bool graphic, TQWidget *parent) : FixedCanvasView(parent, "board"), GenericTetris(bfactory->bbi.width, bfactory->bbi.height, bfactory->bbi.withPieces, graphic), @@ -45,7 +45,7 @@ BaseBoard::BaseBoard(bool graphic, QWidget *parent) if (graphic) { setVScrollBarMode(AlwaysOff); setHScrollBarMode(AlwaysOff); - setFrameStyle( QFrame::Panel | QFrame::Sunken ); + setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); sequences = new SequenceArray; main = new BlockInfo(*sequences); @@ -54,7 +54,7 @@ BaseBoard::BaseBoard(bool graphic, QWidget *parent) _next = new BlockInfo(*sequences); setBlockInfo(main, _next); - connect(&timer, SIGNAL(timeout()), SLOT(timeout())); + connect(&timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeout())); Piece::info().loadColors(); KZoomMainWindow::addWidget(this); @@ -83,7 +83,7 @@ void BaseBoard::adjustSize() for (uint j=0; j<firstClearLine(); j++) { Coord c(i, j); if ( matrix()[c]==0 ) continue; - partialMoveBlock(c, QPoint(0, 0)); + partialMoveBlock(c, TQPoint(0, 0)); } if (_next) { @@ -143,10 +143,10 @@ void BaseBoard::gameOver() emit gameOverSignal(); } -void BaseBoard::showCanvas(QCanvas *c, bool show) +void BaseBoard::showCanvas(TQCanvas *c, bool show) { - QCanvasItemList l = c->allItems(); - QCanvasItemList::Iterator it; + TQCanvasItemList l = c->allItems(); + TQCanvasItemList::Iterator it; for (it=l.begin(); it!=l.end(); ++it) { if (show) (*it)->show(); else (*it)->hide(); @@ -236,7 +236,7 @@ bool BaseBoard::doFall(bool doAll, bool first, bool lineByLine) // we do not rely on firstClearLine() here since this method is // used in kfouleggs to make gift blocks fall down ... uint h = 0; - QMemArray<uint> heights(matrix().height()); + TQMemArray<uint> heights(matrix().height()); for (uint j=1; j<matrix().height(); j++) { // first line cannot fall Coord src(i, j); if ( toFall(src) ) h++; @@ -347,7 +347,7 @@ void BaseBoard::partialBlockFall(const Coord &src, const Coord &dest) float c = float(loop+1) / bfactory->bbi.nbFallStages * BasePrefs::blockSize(); int xdec = dest.first - src.first; int ydec = src.second - dest.second; - QPoint p(int(xdec * c), int(ydec * c)); + TQPoint p(int(xdec * c), int(ydec * c)); partialMoveBlock(src, p); } @@ -383,11 +383,11 @@ void BaseBoard::blockInGroup(Square<int> &field, const Coord &c, uint value, _findGroup(field, c, nb, set); } -QMemArray<uint> BaseBoard::findGroups(Square<int> &field, uint minSize, +TQMemArray<uint> BaseBoard::findGroups(Square<int> &field, uint minSize, bool exitAtFirstFound) const { field.fill(0); - QMemArray<uint> groups; + TQMemArray<uint> groups; for (uint j=0; j<firstClearLine(); j++) for (uint i=0; i<matrix().width(); i++) { Coord c(i, j); diff --git a/libksirtet/base/board.h b/libksirtet/base/board.h index 443c6532..7be2a4ec 100644 --- a/libksirtet/base/board.h +++ b/libksirtet/base/board.h @@ -1,8 +1,8 @@ #ifndef BASE_BOARD_H #define BASE_BOARD_H -#include <qtimer.h> -#include <qcanvas.h> +#include <tqtimer.h> +#include <tqcanvas.h> #include "gtetris.h" @@ -16,9 +16,9 @@ class KDE_EXPORT FixedCanvasView : public QCanvasView { Q_OBJECT public: - FixedCanvasView(QWidget *parent = 0, const char *name = 0); + FixedCanvasView(TQWidget *parent = 0, const char *name = 0); - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; public slots: virtual void adjustSize(); @@ -38,7 +38,7 @@ class KDE_EXPORT BaseBoard : public FixedCanvasView, public GenericTetris static const DirectionData DIRECTION_DATA[Nb_Direction]; public: - BaseBoard(bool graphic, QWidget *parent); + BaseBoard(bool graphic, TQWidget *parent); virtual ~BaseBoard(); void copy(const GenericTetris &); @@ -93,7 +93,7 @@ class KDE_EXPORT BaseBoard : public FixedCanvasView, public GenericTetris void partialBlockFall(const KGrid2D::Coord &src, const KGrid2D::Coord &dest); // return the sizes of the groups (>=minSize) - QMemArray<uint> findGroups(KGrid2D::Square<int> &field, uint minSize, + TQMemArray<uint> findGroups(KGrid2D::Square<int> &field, uint minSize, bool exitAtFirstFound = false) const; // find group size and put -1 in the corresponding blocks (these blocks // should be 0 at start) @@ -107,13 +107,13 @@ class KDE_EXPORT BaseBoard : public FixedCanvasView, public GenericTetris void updateScore(uint newScore); virtual void showBoard(bool show); - void showCanvas(QCanvas *c, bool show); + void showCanvas(TQCanvas *c, bool show); enum BoardState { GameOver, Normal, Paused, DropDown, BeforeGlue, AfterGlue, BeforeRemove, AfterRemove, AfterGift }; BoardState state, _oldState; - QTimer timer; + TQTimer timer; SequenceArray *sequences; BlockInfo *main, *_next; uint loop; diff --git a/libksirtet/base/factory.cpp b/libksirtet/base/factory.cpp index 55850f0b..cb2f484b 100644 --- a/libksirtet/base/factory.cpp +++ b/libksirtet/base/factory.cpp @@ -41,12 +41,12 @@ BaseFactory::~BaseFactory() _self = 0; } -QWidget *BaseFactory::createAppearanceConfig() +TQWidget *BaseFactory::createAppearanceConfig() { return new BaseAppearanceConfig; } -QWidget *BaseFactory::createColorConfig() +TQWidget *BaseFactory::createColorConfig() { return new ColorConfig; } diff --git a/libksirtet/base/factory.h b/libksirtet/base/factory.h index b542205e..60717f4c 100644 --- a/libksirtet/base/factory.h +++ b/libksirtet/base/factory.h @@ -1,7 +1,7 @@ #ifndef BASE_FACTORY_H #define BASE_FACTORY_H -#include <qglobal.h> +#include <tqglobal.h> #include <kdemacros.h> @@ -43,12 +43,12 @@ class KDE_EXPORT BaseFactory const MainData &mainData; const BaseBoardInfo &bbi; - virtual BaseBoard *createBoard(bool graphic, QWidget *parent) = 0; - virtual BaseInterface *createInterface(QWidget *parent) = 0; + virtual BaseBoard *createBoard(bool graphic, TQWidget *parent) = 0; + virtual BaseInterface *createInterface(TQWidget *parent) = 0; - virtual QWidget *createAppearanceConfig(); - virtual QWidget *createColorConfig(); - virtual QWidget *createGameConfig() { return 0; } + virtual TQWidget *createAppearanceConfig(); + virtual TQWidget *createColorConfig(); + virtual TQWidget *createGameConfig() { return 0; } protected: KAboutData *_aboutData; diff --git a/libksirtet/base/field.cpp b/libksirtet/base/field.cpp index 53f6220a..fae20266 100644 --- a/libksirtet/base/field.cpp +++ b/libksirtet/base/field.cpp @@ -1,9 +1,9 @@ #include "field.h" -#include <qwhatsthis.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qpushbutton.h> +#include <tqwhatsthis.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqpushbutton.h> #include <klocale.h> #include <kcanvasrootpixmap.h> @@ -19,12 +19,12 @@ const char *BaseField::BUTTON_TEXTS[NB_BUTTON_TYPE] = { I18N_NOOP("Start"), I18N_NOOP("Resume"), I18N_NOOP("Proceed") }; -BaseField::BaseField(QWidget *w) +BaseField::BaseField(TQWidget *w) : _widget(w), _boardLayout(0), _label(0), _button(0) { - top = new QGridLayout(w, 3, 5, 10); + top = new TQGridLayout(w, 3, 5, 10); - lcds = new QGridLayout(7, 1, 5); + lcds = new TQGridLayout(7, 1, 5); top->addLayout(lcds, 1, 0); lcds->setRowStretch(1, 0); @@ -35,15 +35,15 @@ BaseField::BaseField(QWidget *w) } void BaseField::init(bool AI, bool multiplayer, bool server, bool first, - const QString &name) + const TQString &name) { _flags.AI = AI; _flags.multiplayer = multiplayer; _flags.server = server; _flags.first = first; - QString text = (AI ? i18n("%1\n(AI player)").arg(name) + TQString text = (AI ? i18n("%1\n(AI player)").arg(name) : (multiplayer ? i18n("%1\n(Human player)").arg(name) - : QString::null)); + : TQString::null)); if ( first && !server ) text += i18n("\nWaiting for server"); setMessage(text, (first && server ? StartButton : NoButton)); showScore->resetColor(); @@ -61,7 +61,7 @@ bool BaseField::isArcade() const return board->isArcade(); } -void BaseField::setMessage(const QString &label, ButtonType type) +void BaseField::setMessage(const TQString &label, ButtonType type) { delete _label; _label = 0; @@ -75,24 +75,24 @@ void BaseField::setMessage(const QString &label, ButtonType type) return; } - _boardLayout = new QVBoxLayout(board); + _boardLayout = new TQVBoxLayout(board); _boardLayout->addStretch(3); if ( !label.isEmpty() ) { - QString str = (isArcade() ? i18n("Arcade game") + '\n' - : QString::null) + label; - _label = new QLabel(str, board); + TQString str = (isArcade() ? i18n("Arcade game") + '\n' + : TQString::null) + label; + _label = new TQLabel(str, board); _label->setAlignment(Qt::AlignCenter); - _label->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + _label->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); _boardLayout->addWidget(_label, 0, Qt::AlignCenter); _label->show(); } _boardLayout->addStretch(1); if ( type!=NoButton ) { - _button = new QPushButton(i18n(BUTTON_TEXTS[type]), board); + _button = new TQPushButton(i18n(BUTTON_TEXTS[type]), board); _button->setFocus(); - const char *slot = (type==ResumeButton ? SLOT(pause()) - : SLOT(start())); - _button->connect(_button, SIGNAL(clicked()), + const char *slot = (type==ResumeButton ? TQT_SLOT(pause()) + : TQT_SLOT(start())); + _button->connect(_button, TQT_SIGNAL(clicked()), _widget->parent(), slot); _boardLayout->addWidget(_button, 0, Qt::AlignCenter); _button->show(); @@ -123,7 +123,7 @@ void BaseField::stop(bool gameover) { board->stop(); ButtonType button = StartButton; - QString msg = (gameover ? i18n("Game over") : QString::null); + TQString msg = (gameover ? i18n("Game over") : TQString::null); if ( board->isArcade() && board->arcadeStageDone() ) { if ( board->arcadeStage()==bfactory->bbi.nbArcadeStages ) msg = i18n("The End"); @@ -135,7 +135,7 @@ void BaseField::stop(bool gameover) setMessage(msg, button); } -void BaseField::gameOver(const KExtHighscore::Score &score, QWidget *parent) +void BaseField::gameOver(const KExtHighscore::Score &score, TQWidget *parent) { KNotifyClient::event(parent->winId(), "game over", i18n("Game Over")); KExtHighscore::submitScore(score, parent); @@ -146,7 +146,7 @@ void BaseField::scoreUpdated() showScore->display( (int)board->score() ); if (_flags.multiplayer) return; - QColor color; + TQColor color; if ( _firstScore<currentScore() ) color = Qt::red; else if ( _lastScore<currentScore() ) color = Qt::blue; showScore->setColor(color); @@ -154,7 +154,7 @@ void BaseField::scoreUpdated() void BaseField::settingsChanged() { - QColor color = BasePrefs::fadeColor(); + TQColor color = BasePrefs::fadeColor(); double s = BasePrefs::fadeIntensity(); _boardRootPixmap->setFadeEffect(s, color); board->canvas()->setBackgroundColor(color); diff --git a/libksirtet/base/field.h b/libksirtet/base/field.h index d006a052..f4478ad5 100644 --- a/libksirtet/base/field.h +++ b/libksirtet/base/field.h @@ -18,39 +18,39 @@ class KCanvasRootPixmap; class KDE_EXPORT BaseField { public: - BaseField(QWidget *widget); + BaseField(TQWidget *widget); virtual ~BaseField() {} virtual KExtHighscore::Score currentScore() const = 0; - static void gameOver(const KExtHighscore::Score &, QWidget *parent); + static void gameOver(const KExtHighscore::Score &, TQWidget *parent); virtual void setArcade(); bool isArcade() const; protected: - QGridLayout *top, *lcds; + TQGridLayout *top, *lcds; KGameLCD *showScore; KGameLCDList *removedList, *scoreList; BaseBoard *board; virtual void scoreUpdated(); virtual void init(bool AI, bool multiplayer, bool server, bool first, - const QString &name); + const TQString &name); virtual void start(const GTInitData &); virtual void pause(bool pause); virtual void stop(bool gameover); virtual void settingsChanged(); private: - QWidget *_widget; + TQWidget *_widget; struct Flags { bool AI, multiplayer, server, first; }; Flags _flags; uint _arcadeStage; - QVBoxLayout *_boardLayout; - QLabel *_label; - QButton *_button; + TQVBoxLayout *_boardLayout; + TQLabel *_label; + TQButton *_button; KCanvasRootPixmap *_boardRootPixmap; KExtHighscore::Score _firstScore, _lastScore; @@ -59,8 +59,8 @@ class KDE_EXPORT BaseField static const char *BUTTON_TEXTS[NB_BUTTON_TYPE]; bool hasButton() const { return _flags.server && _flags.first; } - void setMessage(const QString &label, ButtonType); - void hideMessage() { setMessage(QString::null, NB_BUTTON_TYPE); } + void setMessage(const TQString &label, ButtonType); + void hideMessage() { setMessage(TQString::null, NB_BUTTON_TYPE); } }; #endif diff --git a/libksirtet/base/gtetris.cpp b/libksirtet/base/gtetris.cpp index 2141f9ef..6c2a66a9 100644 --- a/libksirtet/base/gtetris.cpp +++ b/libksirtet/base/gtetris.cpp @@ -166,7 +166,7 @@ bool GenericTetris::rotate(bool left) Piece tmp; tmp.copy(_currentPiece); - QPoint p(0, 0); + TQPoint p(0, 0); tmp.rotate(left, p); if ( canPosition(_currentPos, &tmp) ) { if (_graphic) p = toPoint(_currentPos); @@ -192,7 +192,7 @@ void GenericTetris::setBlock(const Coord &c, Block *b) Q_ASSERT( b && _matrix[c]==0 ); _matrix[c] = b; if (_graphic) { - QPoint p = toPoint(c); + TQPoint p = toPoint(c); b->sprite()->move(p.x(), p.y()); } } @@ -212,7 +212,7 @@ void GenericTetris::moveBlock(const Coord &src, const Coord &dest) } } -QPoint GenericTetris::toPoint(const Coord &c) const +TQPoint GenericTetris::toPoint(const Coord &c) const { return _main->toPoint(Coord(c.first, _matrix.height() - 1 - c.second)); } @@ -230,12 +230,12 @@ void GenericTetris::gluePiece() void GenericTetris::bumpCurrentPiece(int dec) { Q_ASSERT( _graphic && _currentPiece ); - _currentPiece->move(toPoint(_currentPos) + QPoint(0, dec)); + _currentPiece->move(toPoint(_currentPos) + TQPoint(0, dec)); } -void GenericTetris::partialMoveBlock(const Coord &c, const QPoint &dec) +void GenericTetris::partialMoveBlock(const Coord &c, const TQPoint &dec) { Q_ASSERT( _graphic && _matrix[c]!=0 ); - QPoint p = toPoint(c) + dec; + TQPoint p = toPoint(c) + dec; _matrix[c]->sprite()->move(p.x(), p.y()); } diff --git a/libksirtet/base/gtetris.h b/libksirtet/base/gtetris.h index 48aefb9d..b0f990b9 100644 --- a/libksirtet/base/gtetris.h +++ b/libksirtet/base/gtetris.h @@ -91,7 +91,7 @@ #ifndef GTETRIS_H #define GTETRIS_H -#include <qpoint.h> +#include <tqpoint.h> #include <krandomsequence.h> #include <kgrid2d.h> @@ -155,10 +155,10 @@ class KDE_EXPORT GenericTetris virtual void updateNextPiece() {} virtual void updatePieceConfig() {} void bumpCurrentPiece(int dec); - void partialMoveBlock(const KGrid2D::Coord &, const QPoint &dec); + void partialMoveBlock(const KGrid2D::Coord &, const TQPoint &dec); private: - QPoint toPoint(const KGrid2D::Coord &) const; + TQPoint toPoint(const KGrid2D::Coord &) const; uint moveTo(const KGrid2D::Coord &dec); bool rotate(bool left); void clear(); diff --git a/libksirtet/base/highscores.cpp b/libksirtet/base/highscores.cpp index 2b3596d7..d1836d78 100644 --- a/libksirtet/base/highscores.cpp +++ b/libksirtet/base/highscores.cpp @@ -12,7 +12,7 @@ BaseHighscores::BaseHighscores() setWWHighscores(KURL( bfactory->mainData.homepage ), bfactory->mainData.version); const BaseBoardInfo &bi = bfactory->bbi; if ( bi.histogramSize!=0 ) { - QMemArray<uint> a; + TQMemArray<uint> a; a.duplicate(bi.histogram, bi.histogramSize); setScoreHistogram(a, bi.scoreBound ? ScoreBound : ScoreNotBound); } diff --git a/libksirtet/base/inter.cpp b/libksirtet/base/inter.cpp index 4f40b63f..658e7c47 100644 --- a/libksirtet/base/inter.cpp +++ b/libksirtet/base/inter.cpp @@ -3,13 +3,13 @@ #include <kexthighscore.h> -void BaseInterface::showHighscores(QWidget *parent) +void BaseInterface::showHighscores(TQWidget *parent) { if ( !_isPaused() ) _pause(); _showHighscores(parent); } -void BaseInterface::_showHighscores(QWidget *parent) +void BaseInterface::_showHighscores(TQWidget *parent) { KExtHighscore::show(parent); } diff --git a/libksirtet/base/inter.h b/libksirtet/base/inter.h index 446a77d3..ac72b61c 100644 --- a/libksirtet/base/inter.h +++ b/libksirtet/base/inter.h @@ -14,10 +14,10 @@ public: virtual void _pause() = 0; virtual bool _isPaused() const = 0; - void showHighscores(QWidget *parent); + void showHighscores(TQWidget *parent); protected: - virtual void _showHighscores(QWidget *parent); + virtual void _showHighscores(TQWidget *parent); }; #endif diff --git a/libksirtet/base/kzoommainwindow.cpp b/libksirtet/base/kzoommainwindow.cpp index 115d5175..4e1b85a5 100644 --- a/libksirtet/base/kzoommainwindow.cpp +++ b/libksirtet/base/kzoommainwindow.cpp @@ -30,11 +30,11 @@ KZoomMainWindow::KZoomMainWindow(uint min, uint max, uint step, const char *name { installEventFilter(this); - _zoomInAction = KStdAction::zoomIn(this, SLOT(zoomIn()), actionCollection()); + _zoomInAction = KStdAction::zoomIn(this, TQT_SLOT(zoomIn()), actionCollection()); _zoomOutAction = - KStdAction::zoomOut(this, SLOT(zoomOut()), actionCollection()); + KStdAction::zoomOut(this, TQT_SLOT(zoomOut()), actionCollection()); _menu = - KStdAction::showMenubar(this, SLOT(toggleMenubar()), actionCollection()); + KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); } void KZoomMainWindow::init(const char *popupName) @@ -48,32 +48,32 @@ void KZoomMainWindow::init(const char *popupName) // context popup if (popupName) { - QPopupMenu *popup = - static_cast<QPopupMenu *>(factory()->container(popupName, this)); + TQPopupMenu *popup = + static_cast<TQPopupMenu *>(factory()->container(popupName, this)); Q_ASSERT(popup); if (popup) KContextMenuManager::insert(this, popup); } } -void KZoomMainWindow::addWidget(QWidget *widget) +void KZoomMainWindow::addWidget(TQWidget *widget) { widget->adjustSize(); - QWidget *tlw = widget->topLevelWidget(); + TQWidget *tlw = widget->topLevelWidget(); KZoomMainWindow *zm = static_cast<KZoomMainWindow *>(tlw->qt_cast("KZoomMainWindow")); Q_ASSERT(zm); zm->_widgets.append(widget); - connect(widget, SIGNAL(destroyed()), zm, SLOT(widgetDestroyed())); + connect(widget, TQT_SIGNAL(destroyed()), zm, TQT_SLOT(widgetDestroyed())); } void KZoomMainWindow::widgetDestroyed() { - _widgets.remove(static_cast<const QWidget *>(sender())); + _widgets.remove(static_cast<const TQWidget *>(sender())); } -bool KZoomMainWindow::eventFilter(QObject *o, QEvent *e) +bool KZoomMainWindow::eventFilter(TQObject *o, TQEvent *e) { - if ( e->type()==QEvent::LayoutHint ) + if ( e->type()==TQEvent::LayoutHint ) setFixedSize(minimumSize()); // because K/QMainWindow // does not manage fixed central widget // with hidden menubar... @@ -84,7 +84,7 @@ void KZoomMainWindow::setZoom(uint zoom) { _zoom = zoom; writeZoomSetting(_zoom); - QPtrListIterator<QWidget> it(_widgets); + TQPtrListIterator<TQWidget> it(_widgets); for (; it.current(); ++it) (*it)->adjustSize();; _zoomOutAction->setEnabled( _zoom>_minZoom ); diff --git a/libksirtet/base/kzoommainwindow.h b/libksirtet/base/kzoommainwindow.h index 14f780fb..fd213fd7 100644 --- a/libksirtet/base/kzoommainwindow.h +++ b/libksirtet/base/kzoommainwindow.h @@ -53,7 +53,7 @@ public: * widget is called whenever the zoom is changed. * This function assumes that the topLevelWidget() is the KZoomMainWindow. */ - static void addWidget(QWidget *widget); + static void addWidget(TQWidget *widget); uint zoom() const { return _zoom; } @@ -71,7 +71,7 @@ protected: void init(const char *popupName = 0); virtual void setZoom(uint zoom); - virtual bool eventFilter(QObject *o, QEvent *e); + virtual bool eventFilter(TQObject *o, TQEvent *e); virtual bool queryExit(); /** You need to implement this method since different application @@ -117,7 +117,7 @@ private slots: private: uint _zoom, _zoomStep, _minZoom, _maxZoom; - QPtrList<QWidget> _widgets; + TQPtrList<TQWidget> _widgets; KAction *_zoomInAction, *_zoomOutAction; KToggleAction *_menu; diff --git a/libksirtet/base/main.cpp b/libksirtet/base/main.cpp index 4b5a4160..e09a9c50 100644 --- a/libksirtet/base/main.cpp +++ b/libksirtet/base/main.cpp @@ -24,26 +24,26 @@ BaseMainWindow::BaseMainWindow() KNotifyClient::startDaemon(); // File & Popup - KStdGameAction::gameNew(this, SLOT(start()), actionCollection()); - _pause = KStdGameAction::pause(this, SLOT(pause()), actionCollection()); + KStdGameAction::gameNew(this, TQT_SLOT(start()), actionCollection()); + _pause = KStdGameAction::pause(this, TQT_SLOT(pause()), actionCollection()); _pause->setEnabled(false); - KStdGameAction::highscores(this, SLOT(showHighscores()), + KStdGameAction::highscores(this, TQT_SLOT(showHighscores()), actionCollection()); - KStdGameAction::quit(qApp, SLOT(quit()), actionCollection()); + KStdGameAction::quit(qApp, TQT_SLOT(quit()), actionCollection()); // Settings - KStdAction::preferences(this, SLOT(configureSettings()), + KStdAction::preferences(this, TQT_SLOT(configureSettings()), actionCollection()); - KStdAction::keyBindings(this, SLOT(configureKeys()), actionCollection()); - KStdAction::configureNotifications(this, SLOT(configureNotifications()), + KStdAction::keyBindings(this, TQT_SLOT(configureKeys()), actionCollection()); + KStdAction::configureNotifications(this, TQT_SLOT(configureNotifications()), actionCollection()); - KStdGameAction::configureHighscores(this, SLOT(configureHighscores()), + KStdGameAction::configureHighscores(this, TQT_SLOT(configureHighscores()), actionCollection()); _inter = bfactory->createInterface(this); } -void BaseMainWindow::buildGUI(QWidget *widget) +void BaseMainWindow::buildGUI(TQWidget *widget) { createGUI(); setCentralWidget(widget); @@ -81,7 +81,7 @@ void BaseMainWindow::configureSettings() if ( KConfigDialog::showDialog("settings") ) return; KConfigDialog *dialog = new KConfigDialog(this, "settings", BasePrefs::self() ); - QWidget *w = bfactory->createGameConfig(); + TQWidget *w = bfactory->createGameConfig(); if (w) dialog->addPage(w, i18n("Game"), "package_system"); w = bfactory->createAppearanceConfig(); if (w) dialog->addPage(w, i18n("Appearance"), "style"); @@ -89,7 +89,7 @@ void BaseMainWindow::configureSettings() if (w) dialog->addPage(w, i18n("Colors"), "colorize"); // dialog->addPage(new BackgroundConfigWidget, i18n("Background"), "background"); addConfig(dialog); - connect(dialog, SIGNAL(settingsChanged()), SIGNAL(settingsChanged())); + connect(dialog, TQT_SIGNAL(settingsChanged()), TQT_SIGNAL(settingsChanged())); dialog->show(); } diff --git a/libksirtet/base/main.h b/libksirtet/base/main.h index d2e108aa..cd165963 100644 --- a/libksirtet/base/main.h +++ b/libksirtet/base/main.h @@ -32,7 +32,7 @@ private slots: protected: BaseInterface *_inter; - void buildGUI(QWidget *widget); + void buildGUI(TQWidget *widget); virtual void addConfig(KConfigDialog *) {} virtual void addKeys(KKeyDialog &) {} virtual void saveKeys() {} diff --git a/libksirtet/base/piece.cpp b/libksirtet/base/piece.cpp index 25aed934..d423473c 100644 --- a/libksirtet/base/piece.cpp +++ b/libksirtet/base/piece.cpp @@ -7,9 +7,9 @@ using namespace KGrid2D; -QPoint operator *(const Coord &c, int i) +TQPoint operator *(const Coord &c, int i) { - return QPoint(c.first * i, c.second * i); + return TQPoint(c.first * i, c.second * i); } //----------------------------------------------------------------------------- @@ -18,10 +18,10 @@ GPieceInfo::GPieceInfo() Piece::setPieceInfo(this); } -QPixmap *GPieceInfo::pixmap(uint blockSize, uint blockType, uint blockMode, +TQPixmap *GPieceInfo::pixmap(uint blockSize, uint blockType, uint blockMode, bool lighted) const { - QPixmap *pixmap = new QPixmap(blockSize, blockSize); + TQPixmap *pixmap = new TQPixmap(blockSize, blockSize); draw(pixmap, blockType, blockMode, lighted); setMask(pixmap, blockMode); return pixmap; @@ -73,18 +73,18 @@ void SequenceArray::setBlockSize(uint bsize) { _size = bsize; const GPieceInfo &pinfo = Piece::info(); - QPtrList<QPixmap> pixmaps; + TQPtrList<TQPixmap> pixmaps; pixmaps.setAutoDelete(TRUE); - QPtrList<QPoint> points; + TQPtrList<TQPoint> points; points.setAutoDelete(TRUE); uint nm = pinfo.nbBlockModes(); for (uint i=0; i<size(); i++) { for (uint k=0; k<2; k++) for (uint j=0; j<nm; j++) { - QPoint *po = new QPoint(0, 0); - QPixmap *pi = pinfo.pixmap(bsize, i, j, k==1); + TQPoint *po = new TQPoint(0, 0); + TQPixmap *pi = pinfo.pixmap(bsize, i, j, k==1); if ( at(i) ) { - at(i)->setImage(k*nm + j, new QCanvasPixmap(*pi, *po)); + at(i)->setImage(k*nm + j, new TQCanvasPixmap(*pi, *po)); delete po; delete pi; } else { @@ -93,7 +93,7 @@ void SequenceArray::setBlockSize(uint bsize) } } if ( at(i)==0 ) { - at(i) = new QCanvasPixmapArray(pixmaps, points); + at(i) = new TQCanvasPixmapArray(pixmaps, points); pixmaps.clear(); points.clear(); } @@ -110,7 +110,7 @@ BlockInfo::BlockInfo(const SequenceArray &s) : _sequences(s) {} -QPoint BlockInfo::toPoint(const Coord &pos) const +TQPoint BlockInfo::toPoint(const Coord &pos) const { return pos * _sequences.blockSize(); } @@ -129,10 +129,10 @@ void Block::setValue(uint value, BlockInfo *binfo) { _value = value; if (binfo) { - QCanvasPixmapArray *seq = binfo->sequences()[value]; + TQCanvasPixmapArray *seq = binfo->sequences()[value]; if (_sprite) _sprite->setSequence(seq); else { - _sprite = new QCanvasSprite(seq, binfo); + _sprite = new TQCanvasSprite(seq, binfo); _sprite->setZ(0); } } @@ -161,7 +161,7 @@ Piece::Piece() _blocks.setAutoDelete(true); } -void Piece::rotate(bool left, const QPoint &p) +void Piece::rotate(bool left, const TQPoint &p) { if (left) { if ( _rotation==0 ) _rotation = 3; @@ -231,7 +231,7 @@ void Piece::generateNext(int type) void Piece::moveCenter() { uint s = _binfo->sequences().blockSize(); - QPoint p = QPoint(_binfo->width(), _binfo->height()) - size() * s; + TQPoint p = TQPoint(_binfo->width(), _binfo->height()) - size() * s; move(p/2 - min() * s); } @@ -240,14 +240,14 @@ Coord Piece::pos(uint k, const Coord &pos) const return Coord(pos.first + coord(k).first, pos.second - coord(k).second); } -void Piece::move(const QPoint &p) +void Piece::move(const TQPoint &p) { for (uint k=0; k<_blocks.size(); k++) moveBlock(k, p); } -void Piece::moveBlock(uint k, const QPoint &p) +void Piece::moveBlock(uint k, const TQPoint &p) { - QPoint po = p + _binfo->toPoint(coord(k)); + TQPoint po = p + _binfo->toPoint(coord(k)); _blocks[k]->sprite()->move(po.x(), po.y()); } diff --git a/libksirtet/base/piece.h b/libksirtet/base/piece.h index 4c0486a8..6cdd667c 100644 --- a/libksirtet/base/piece.h +++ b/libksirtet/base/piece.h @@ -1,8 +1,8 @@ #ifndef BASE_PIECE_H #define BASE_PIECE_H -#include <qcanvas.h> -#include <qptrvector.h> +#include <tqcanvas.h> +#include <tqptrvector.h> #include <kgrid2d.h> @@ -29,7 +29,7 @@ class GPieceInfo KGrid2D::Coord maxSize() const; - QPixmap *pixmap(uint blockSize, uint blockType, uint blockMode, + TQPixmap *pixmap(uint blockSize, uint blockType, uint blockMode, bool lighted) const; virtual uint nbNormalBlockTypes() const = 0; @@ -39,23 +39,23 @@ class GPieceInfo uint generateGarbageBlockType(KRandomSequence *) const; virtual uint nbColors() const = 0; - virtual QString colorLabel(uint i) const = 0; - QCString colorKey(uint i) const; - virtual QColor defaultColor(uint i) const = 0; + virtual TQString colorLabel(uint i) const = 0; + TQCString colorKey(uint i) const; + virtual TQColor defaultColor(uint i) const = 0; void loadColors(); protected: - QColor color(uint i) const { return _colors[i]; } + TQColor color(uint i) const { return _colors[i]; } - virtual void draw(QPixmap *, uint blockType, uint blockMode, + virtual void draw(TQPixmap *, uint blockType, uint blockMode, bool lighted) const = 0; - virtual void setMask(QPixmap *, uint /*blockMode*/) const {} + virtual void setMask(TQPixmap *, uint /*blockMode*/) const {} private: - QValueVector<QColor> _colors; + TQValueVector<TQColor> _colors; }; -class SequenceArray : public QMemArray<QCanvasPixmapArray *> +class SequenceArray : public TQMemArray<TQCanvasPixmapArray *> { public: SequenceArray(); @@ -75,7 +75,7 @@ class BlockInfo : public QCanvas BlockInfo(const SequenceArray &); const SequenceArray &sequences() const { return _sequences; } - QPoint toPoint(const KGrid2D::Coord &) const; + TQPoint toPoint(const KGrid2D::Coord &) const; private: const SequenceArray &_sequences; @@ -92,11 +92,11 @@ class Block uint value() const { return _value; } bool isGarbage() const; void toggleLight(); - QCanvasSprite *sprite() const { return _sprite; } + TQCanvasSprite *sprite() const { return _sprite; } private: uint _value; - QCanvasSprite *_sprite; + TQCanvasSprite *_sprite; Block(const Block &); // disabled Block &operator =(const Block &); // disabled @@ -125,8 +125,8 @@ class Piece KGrid2D::Coord size() const { return max() - min() + KGrid2D::Coord(1, 1); } void generateNext(int type = -1); - void rotate(bool left, const QPoint &); - void move(const QPoint &); + void rotate(bool left, const TQPoint &); + void move(const TQPoint &); void moveCenter(); void show(bool show); @@ -136,7 +136,7 @@ class Piece Block *takeBlock(uint k); private: - QPtrVector<Block> _blocks; + TQPtrVector<Block> _blocks; uint _type; KRandomSequence *_random; static GPieceInfo *_info; @@ -149,7 +149,7 @@ class Piece Piece &operator =(const Piece &); // disabled KGrid2D::Coord coord(uint k) const { return KGrid2D::Coord(_i[k], _j[k]); } - void moveBlock(uint k, const QPoint &); + void moveBlock(uint k, const TQPoint &); }; #endif diff --git a/libksirtet/base/settings.cpp b/libksirtet/base/settings.cpp index 1ea3b16a..a695d746 100644 --- a/libksirtet/base/settings.cpp +++ b/libksirtet/base/settings.cpp @@ -1,11 +1,11 @@ #include "settings.h" #include "settings.moc" -#include <qlabel.h> -#include <qhbox.h> -#include <qlayout.h> -#include <qcheckbox.h> -#include <qhgroupbox.h> +#include <tqlabel.h> +#include <tqhbox.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqhgroupbox.h> #include <klocale.h> #include <knuminput.h> @@ -19,35 +19,35 @@ //----------------------------------------------------------------------------- BaseAppearanceConfig::BaseAppearanceConfig() - : QWidget(0, "appearance_config") + : TQWidget(0, "appearance_config") { - QVBoxLayout *top = new QVBoxLayout(this); + TQVBoxLayout *top = new TQVBoxLayout(this); // upper part - _main = new QWidget(this); + _main = new TQWidget(this); top->addWidget(_main); - _grid = new QGridLayout(_main, 3, 2, 0, KDialog::spacingHint()); + _grid = new TQGridLayout(_main, 3, 2, 0, KDialog::spacingHint()); _grid->setColStretch(1, 1); - QCheckBox *chb = - new QCheckBox(i18n("Enable animations"), _main, "kcfg_AnimationsEnabled"); + TQCheckBox *chb = + new TQCheckBox(i18n("Enable animations"), _main, "kcfg_AnimationsEnabled"); _grid->addMultiCellWidget(chb, 2, 2, 0, 1); top->addSpacing(KDialog::spacingHint()); // lower part - QHGroupBox *gbox = new QHGroupBox(i18n("Background"), this); + TQHGroupBox *gbox = new TQHGroupBox(i18n("Background"), this); top->addWidget(gbox); - QWidget *widget = new QWidget(gbox); - QGridLayout *grid = - new QGridLayout(widget, 2, 3, 0, KDialog::spacingHint()); + TQWidget *widget = new TQWidget(gbox); + TQGridLayout *grid = + new TQGridLayout(widget, 2, 3, 0, KDialog::spacingHint()); grid->setColStretch(2, 1); - QLabel *label = new QLabel(i18n("Color:"), widget); + TQLabel *label = new TQLabel(i18n("Color:"), widget); grid->addWidget(label, 0, 0); KColorButton *cob = new KColorButton(widget, "kcfg_FadeColor"); cob->setFixedWidth(100); grid->addWidget(cob, 0, 1); - label = new QLabel(i18n("Opacity:"), widget); + label = new TQLabel(i18n("Opacity:"), widget); grid->addWidget(label, 1, 0); KDoubleNumInput *dn = new KDoubleNumInput(widget, "kcfg_FadeIntensity"); dn->setRange(0.0, 1.0, 0.01); @@ -58,15 +58,15 @@ BaseAppearanceConfig::BaseAppearanceConfig() //----------------------------------------------------------------------------- ColorConfig::ColorConfig() - : QWidget(0, "color_config") + : TQWidget(0, "color_config") { const GPieceInfo &info = Piece::info(); - QVBoxLayout *top = new QVBoxLayout(this); + TQVBoxLayout *top = new TQVBoxLayout(this); uint nb = info.nbColors(); - QGridLayout *grid = new QGridLayout(top, nb+1, 3, KDialog::spacingHint()); + TQGridLayout *grid = new TQGridLayout(top, nb+1, 3, KDialog::spacingHint()); grid->setColStretch(2, 1); for (uint i=0; i<nb; i++) { - QLabel *label = new QLabel(info.colorLabel(i), this); + TQLabel *label = new TQLabel(info.colorLabel(i), this); grid->addWidget(label, i, 0); KColorButton *cob = new KColorButton(this, colorKey(i)); cob->setFixedWidth(100); @@ -75,9 +75,9 @@ ColorConfig::ColorConfig() grid->setRowStretch(nb, 1); } -QCString ColorConfig::colorKey(uint i) +TQCString ColorConfig::colorKey(uint i) { - QCString s; + TQCString s; s.setNum(i); return "kcfg_Color" + s; } diff --git a/libksirtet/base/settings.h b/libksirtet/base/settings.h index c64bfd5b..37d0aea7 100644 --- a/libksirtet/base/settings.h +++ b/libksirtet/base/settings.h @@ -1,7 +1,7 @@ #ifndef BASE_SETTINGS_H #define BASE_SETTINGS_H -#include <qwidget.h> +#include <tqwidget.h> #include <kconfig.h> class QGridLayout; @@ -15,8 +15,8 @@ public: BaseAppearanceConfig(); protected: - QWidget *_main; - QGridLayout *_grid; + TQWidget *_main; + TQGridLayout *_grid; }; //----------------------------------------------------------------------------- @@ -27,7 +27,7 @@ public: ColorConfig(); private: - static QCString colorKey(uint i); + static TQCString colorKey(uint i); }; #endif diff --git a/libksirtet/common/ai.cpp b/libksirtet/common/ai.cpp index bc1c6722..78f9d5af 100644 --- a/libksirtet/common/ai.cpp +++ b/libksirtet/common/ai.cpp @@ -3,12 +3,12 @@ #include <assert.h> -#include <qlabel.h> -#include <qhbox.h> -#include <qvbox.h> -#include <qlayout.h> -#include <qgrid.h> -#include <qwhatsthis.h> +#include <tqlabel.h> +#include <tqhbox.h> +#include <tqvbox.h> +#include <tqlayout.h> +#include <tqgrid.h> +#include <tqwhatsthis.h> #include <klocale.h> #include <kconfig.h> @@ -61,7 +61,7 @@ bool AIPiece::increment() // nbRot = _current->nbConfigurations() - 1; // curRot = 0; } - _current->rotate(true, QPoint(0, 0)); + _current->rotate(true, TQPoint(0, 0)); nbPos = _board->matrix().width() - _current->size().first + 1; curRot++; curPos = 0; @@ -89,7 +89,7 @@ AI::AI(uint tTime, uint oTime, const Data *DATA) : timer(this), thinkTime(tTime), orderTime(oTime), stopped(false), board(0) { - connect(&timer, SIGNAL(timeout()), SLOT(timeout())); + connect(&timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeout())); for (uint i=0; DATA[i].name; i++) { Element element; @@ -295,13 +295,13 @@ double AI::nbRemoved(const Board &main, const Board ¤t) const uint AIConfig::minThinkingDepth = 1; const uint AIConfig::maxThinkingDepth = 2; -AIConfig::AIConfig(const QValueVector<AI::Element> &elements) - : QWidget(0, "ai config") +AIConfig::AIConfig(const TQValueVector<AI::Element> &elements) + : TQWidget(0, "ai config") { - QGridLayout *top = new QGridLayout(this, 3, 2, KDialog::marginHint(), + TQGridLayout *top = new TQGridLayout(this, 3, 2, KDialog::marginHint(), KDialog::spacingHint()); - QLabel *label = new QLabel(i18n("Thinking depth:"), this); + TQLabel *label = new TQLabel(i18n("Thinking depth:"), this); top->addWidget(label, 0, 0); KIntNumInput *in = new KIntNumInput(this, "kcfg_ThinkingDepth"); in->setRange(minThinkingDepth, maxThinkingDepth); @@ -309,19 +309,19 @@ AIConfig::AIConfig(const QValueVector<AI::Element> &elements) top->addRowSpacing(1, KDialog::spacingHint()); - QGrid *grid = new QGrid(2, this); + TQGrid *grid = new TQGrid(2, this); top->addMultiCellWidget(grid, 2, 2, 0, 1); for (uint i=0; i<elements.size(); i++) { const AI::Data &data = *elements.at(i).data; - QLabel *label = new QLabel(i18n(data.label), grid); - if (data.whatsthis) QWhatsThis::add(label, i18n(data.whatsthis)); - label->setFrameStyle(QFrame::Panel | QFrame::Plain); + TQLabel *label = new TQLabel(i18n(data.label), grid); + if (data.whatsthis) TQWhatsThis::add(label, i18n(data.whatsthis)); + label->setFrameStyle(TQFrame::Panel | TQFrame::Plain); - QVBox *vb = new QVBox(grid); - if (data.whatsthis) QWhatsThis::add(vb, i18n(data.whatsthis)); + TQVBox *vb = new TQVBox(grid); + if (data.whatsthis) TQWhatsThis::add(vb, i18n(data.whatsthis)); vb->setMargin(KDialog::spacingHint()); vb->setSpacing(KDialog::spacingHint()); - vb->setFrameStyle(QFrame::Panel | QFrame::Plain); + vb->setFrameStyle(TQFrame::Panel | TQFrame::Plain); if (data.triggered) { KIntNumInput *trig = new KIntNumInput(vb, triggerKey(data.name)); trig->setRange(0, 10, 1, true); @@ -331,26 +331,26 @@ AIConfig::AIConfig(const QValueVector<AI::Element> &elements) } } -QCString AIConfig::triggerKey(const char *name) +TQCString AIConfig::triggerKey(const char *name) { - return "kcfg_Trigger_" + QCString(name); + return "kcfg_Trigger_" + TQCString(name); } -QCString AIConfig::coefficientKey(const char *name) +TQCString AIConfig::coefficientKey(const char *name) { - return "kcfg_Coefficient_" + QCString(name); + return "kcfg_Coefficient_" + TQCString(name); } double AIConfig::coefficient(const AI::Data &data) { - KConfigSkeletonItem *item = CommonPrefs::self()->findItem( QString("Coefficient_%1").arg(data.name) ); + KConfigSkeletonItem *item = CommonPrefs::self()->findItem( TQString("Coefficient_%1").arg(data.name) ); assert(item); return item->property().toDouble(); } int AIConfig::trigger(const AI::Data &data) { - KConfigSkeletonItem *item = CommonPrefs::self()->findItem( QString("Trigger_%1").arg(data.name) ); + KConfigSkeletonItem *item = CommonPrefs::self()->findItem( TQString("Trigger_%1").arg(data.name) ); assert(item); return item->property().toInt(); } diff --git a/libksirtet/common/ai.h b/libksirtet/common/ai.h index da298abc..b25a1d90 100644 --- a/libksirtet/common/ai.h +++ b/libksirtet/common/ai.h @@ -1,8 +1,8 @@ #ifndef COMMON_AI_H #define COMMON_AI_H -#include <qtimer.h> -#include <qvaluevector.h> +#include <tqtimer.h> +#include <tqvaluevector.h> #include <kdialogbase.h> #include <knuminput.h> @@ -62,7 +62,7 @@ class LIBKSIRTET_EXPORT AI : public QObject double coefficient; int trigger; }; - const QValueVector<Element> &elements() const { return _elements; } + const TQValueVector<Element> &elements() const { return _elements; } void settingsChanged(); @@ -86,13 +86,13 @@ class LIBKSIRTET_EXPORT AI : public QObject double points() const; void resizePieces(uint size); - QTimer timer; + TQTimer timer; enum ThinkState { Thinking, GivingOrders }; ThinkState state; uint thinkTime, orderTime; bool stopped; - QMemArray<AIPiece *> pieces; - QValueVector<Element> _elements; + TQMemArray<AIPiece *> pieces; + TQValueVector<Element> _elements; Board *main, *board; KRandomSequence random; @@ -107,14 +107,14 @@ class LIBKSIRTET_EXPORT AIConfig : public QWidget { Q_OBJECT public: - AIConfig(const QValueVector<AI::Element> &elements); + AIConfig(const TQValueVector<AI::Element> &elements); static double coefficient(const AI::Data &data); static int trigger(const AI::Data &data); private: - static QCString triggerKey(const char *name); - static QCString coefficientKey(const char *name); + static TQCString triggerKey(const char *name); + static TQCString coefficientKey(const char *name); static const uint minThinkingDepth, maxThinkingDepth; }; diff --git a/libksirtet/common/board.cpp b/libksirtet/common/board.cpp index f5f011a6..7a0802ad 100644 --- a/libksirtet/common/board.cpp +++ b/libksirtet/common/board.cpp @@ -11,7 +11,7 @@ #include "commonprefs.h" -Board::Board(bool graphic, GiftPool *gp, QWidget *parent) +Board::Board(bool graphic, GiftPool *gp, TQWidget *parent) : BaseBoard(graphic, parent), _giftPool(gp), aiEngine(0) {} diff --git a/libksirtet/common/board.h b/libksirtet/common/board.h index 97c37c17..7b9f0b3a 100644 --- a/libksirtet/common/board.h +++ b/libksirtet/common/board.h @@ -12,7 +12,7 @@ class LIBKSIRTET_EXPORT Board : public BaseBoard { Q_OBJECT public: - Board(bool graphic, GiftPool *, QWidget *parent); + Board(bool graphic, GiftPool *, TQWidget *parent); virtual ~Board(); void setType(bool computer); diff --git a/libksirtet/common/factory.cpp b/libksirtet/common/factory.cpp index 1b239a82..a93e6fe5 100644 --- a/libksirtet/common/factory.cpp +++ b/libksirtet/common/factory.cpp @@ -9,20 +9,20 @@ CommonFactory::CommonFactory(const MainData &md, const BaseBoardInfo &bbi, : BaseFactory(md, bbi), cbi(ci) {} -QWidget *CommonFactory::createAppearanceConfig() +TQWidget *CommonFactory::createAppearanceConfig() { return new AppearanceConfig; } -QWidget *CommonFactory::createGameConfig() +TQWidget *CommonFactory::createGameConfig() { return new GameConfig; } -QWidget *CommonFactory::createAIConfig() +TQWidget *CommonFactory::createAIConfig() { AI *ai = createAI(); - QWidget *cw = new AIConfig(ai->elements()); + TQWidget *cw = new AIConfig(ai->elements()); delete ai; return cw; } diff --git a/libksirtet/common/factory.h b/libksirtet/common/factory.h index c0b40d66..2d02dcb2 100644 --- a/libksirtet/common/factory.h +++ b/libksirtet/common/factory.h @@ -25,12 +25,12 @@ class LIBKSIRTET_EXPORT CommonFactory : public BaseFactory const CommonBoardInfo &cbi; - virtual BaseField *createField(QWidget *parent) = 0; + virtual BaseField *createField(TQWidget *parent) = 0; virtual AI *createAI() = 0; - QWidget *createAIConfig(); - virtual QWidget *createAppearanceConfig(); - virtual QWidget *createGameConfig(); + TQWidget *createAIConfig(); + virtual TQWidget *createAppearanceConfig(); + virtual TQWidget *createGameConfig(); }; #endif diff --git a/libksirtet/common/field.cpp b/libksirtet/common/field.cpp index 2d67062e..4c00ba4e 100644 --- a/libksirtet/common/field.cpp +++ b/libksirtet/common/field.cpp @@ -1,9 +1,9 @@ #include "field.h" #include "field.moc" -#include <qwhatsthis.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqwhatsthis.h> +#include <tqlabel.h> +#include <tqlayout.h> #include <klocale.h> #include <kprogress.h> @@ -19,7 +19,7 @@ #include "commonprefs.h" -Field::Field(QWidget *parent) +Field::Field(TQWidget *parent) : MPSimpleBoard(parent), BaseField(this) { // column 1 @@ -38,20 +38,20 @@ Field::Field(QWidget *parent) lcds->setRowStretch(4, 1); // level progress - levelLabel = new QLabel(this); + levelLabel = new TQLabel(this); levelLabel->setAlignment(AlignCenter); lcds->addWidget(levelLabel, 5, 0); toLevel = new KProgress(this); toLevel->setTextEnabled(true); toLevel->setFormat("1"); - QWhatsThis::add(toLevel, i18n("Display the progress to complete the current level or stage.")); + TQWhatsThis::add(toLevel, i18n("Display the progress to complete the current level or stage.")); lcds->addWidget(toLevel, 6, 0); lcds->setRowStretch(7, 1); // column 2 // previous player height prevHeight = new PlayerProgress(board, this, "prev_progress"); - QWhatsThis::add(prevHeight, i18n("Previous player's height")); + TQWhatsThis::add(prevHeight, i18n("Previous player's height")); top->addWidget(prevHeight, 1, 1, AlignHCenter); // column 3 @@ -61,22 +61,22 @@ Field::Field(QWidget *parent) // shadow piece shadow = new Shadow(board, this); - QWhatsThis::add(shadow, i18n("Shadow of the current piece")); + TQWhatsThis::add(shadow, i18n("Shadow of the current piece")); top->addWidget(shadow, 2, 2); // column 4 // next player height nextHeight = new PlayerProgress(board, this, "next_progress"); - QWhatsThis::add(nextHeight, i18n("Next player's height")); + TQWhatsThis::add(nextHeight, i18n("Next player's height")); top->addWidget(nextHeight, 1, 3, AlignHCenter); // column 5 // next piece shower - QVBoxLayout *vbl = new QVBoxLayout(10); + TQVBoxLayout *vbl = new TQVBoxLayout(10); top->addLayout(vbl, 1, 4); vbl->addStretch(1); - labShowNext = new QLabel(i18n("Next Tile"), this); + labShowNext = new TQLabel(i18n("Next Tile"), this); labShowNext->setAlignment(AlignCenter); vbl->addWidget(labShowNext, 0); showNext = new ShowNextPiece(board, this); @@ -85,16 +85,16 @@ Field::Field(QWidget *parent) vbl->addWidget(showNext, 0); vbl->addStretch(4); - connect(board, SIGNAL(scoreUpdated()), SLOT(scoreUpdatedSlot())); - connect(board, SIGNAL(levelUpdated()), SLOT(levelUpdated())); - connect(board, SIGNAL(removedUpdated()), SLOT(removedUpdated())); + connect(board, TQT_SIGNAL(scoreUpdated()), TQT_SLOT(scoreUpdatedSlot())); + connect(board, TQT_SIGNAL(levelUpdated()), TQT_SLOT(levelUpdated())); + connect(board, TQT_SIGNAL(removedUpdated()), TQT_SLOT(removedUpdated())); initVariableGUI(); } void Field::levelUpdated() { - toLevel->setFormat(QString::number(board->level())); + toLevel->setFormat(TQString::number(board->level())); // necessary to update string ... int p = toLevel->progress(); toLevel->setProgress(p+1); @@ -125,7 +125,7 @@ void Field::showOpponents(bool show) void Field::settingsChanged() { BaseField::settingsChanged(); - QColor color = BasePrefs::fadeColor(); + TQColor color = BasePrefs::fadeColor(); double s = BasePrefs::fadeIntensity(); _snRootPixmap->setFadeEffect(s, color); showNext->canvas()->setBackgroundColor(color); @@ -143,14 +143,14 @@ void Field::settingsChanged() } void Field::_init(bool AI, bool multiplayer, bool server, bool first, - const QString &name) + const TQString &name) { BaseField::init(AI, multiplayer, server, first, name); showOpponents(multiplayer); static_cast<Board *>(board)->setType(AI); } -void Field::_initFlag(QDataStream &s) +void Field::_initFlag(TQDataStream &s) { ServerInitData sid; s >> sid; @@ -173,20 +173,20 @@ void Field::initVariableGUI() scoreList->title()->setText(i18n("Elapsed time")); showScore->hide(); showTime->show(); - QWhatsThis::add(scoreList, i18n("Display the elapsed time.")); + TQWhatsThis::add(scoreList, i18n("Display the elapsed time.")); levelLabel->setText(i18n("Stage")); toLevel->setTotalSteps( board->arcadeTodo() ); } else { scoreList->title()->setText(i18n("Score")); showScore->show(); showTime->hide(); - QWhatsThis::add(scoreList, i18n("<qt>Display the current score.<br/>It turns <font color=\"blue\">blue</font> if it is a highscore and <font color=\"red\">red</font> if it is the best local score.</qt>")); + TQWhatsThis::add(scoreList, i18n("<qt>Display the current score.<br/>It turns <font color=\"blue\">blue</font> if it is a highscore and <font color=\"red\">red</font> if it is the best local score.</qt>")); levelLabel->setText(i18n("Level")); toLevel->setTotalSteps(cfactory->cbi.nbRemovedToLevel); } } -void Field::_playFlag(QDataStream &s) +void Field::_playFlag(TQDataStream &s) { ServerPlayData spd; s >> spd; @@ -210,7 +210,7 @@ void Field::_stopFlag(bool gameover) showTime->stop(); } -void Field::_dataOut(QDataStream &s) +void Field::_dataOut(TQDataStream &s) { _cpd.height = board->firstClearLine(); _cpd.end = static_cast<Board *>(board)->isGameOver(); @@ -227,7 +227,7 @@ KExtHighscore::Score Field::currentScore() const return score; } -void Field::_gameOverDataOut(QDataStream &s) +void Field::_gameOverDataOut(TQDataStream &s) { s << currentScore(); } diff --git a/libksirtet/common/field.h b/libksirtet/common/field.h index 8179539b..ce0168e6 100644 --- a/libksirtet/common/field.h +++ b/libksirtet/common/field.h @@ -19,7 +19,7 @@ class LIBKSIRTET_EXPORT Field : public MPSimpleBoard, public BaseField { Q_OBJECT public: - Field(QWidget *parent); + Field(TQWidget *parent); public slots: void moveLeft(); @@ -43,24 +43,24 @@ class LIBKSIRTET_EXPORT Field : public MPSimpleBoard, public BaseField KGameLCDClock *showTime; ShowNextPiece *showNext; KProgress *toLevel; - QLabel *labShowNext, *levelLabel; + TQLabel *labShowNext, *levelLabel; KGameProgress *prevHeight, *nextHeight; Shadow *shadow; KCanvasRootPixmap *_snRootPixmap; ClientPlayData _cpd; void _init(bool AI, bool multiplayer, bool server, bool first, - const QString &name); + const TQString &name); void showOpponents(bool show); void initVariableGUI(); - void _initFlag(QDataStream &); - void _playFlag(QDataStream &); + void _initFlag(TQDataStream &); + void _playFlag(TQDataStream &); void _pauseFlag(bool pause); void _stopFlag(bool gameover); - void _dataOut(QDataStream &); - void _gameOverDataOut(QDataStream &); - void _initDataOut(QDataStream &) {} + void _dataOut(TQDataStream &); + void _gameOverDataOut(TQDataStream &); + void _initDataOut(TQDataStream &) {} KExtHighscore::Score currentScore() const; }; diff --git a/libksirtet/common/highscores.cpp b/libksirtet/common/highscores.cpp index 799a31b9..459b35af 100644 --- a/libksirtet/common/highscores.cpp +++ b/libksirtet/common/highscores.cpp @@ -22,14 +22,14 @@ void CommonHighscores::convertLegacy(uint) { KConfigGroupSaver cg(kapp->config(), "High Scores"); for (uint i=0; i<10; i++) { - QString name - = cg.config()->readEntry(QString("name%1").arg(i), QString::null); + TQString name + = cg.config()->readEntry(TQString("name%1").arg(i), TQString::null); if ( name.isNull() ) break; if ( name.isEmpty() ) name = i18n("anonymous"); uint score - = cg.config()->readUnsignedNumEntry(QString("score%1").arg(i), 0); + = cg.config()->readUnsignedNumEntry(TQString("score%1").arg(i), 0); uint level - = cg.config()->readUnsignedNumEntry(QString("level%1").arg(i), 1); + = cg.config()->readUnsignedNumEntry(TQString("level%1").arg(i), 1); Score s(Won); s.setScore(score); s.setData("name", name); @@ -54,7 +54,7 @@ bool CommonHighscores::isStrictlyLess(const Score &s1, const Score &s2) const void CommonHighscores::additionalQueryItems(KURL &url, const Score &s) const { uint l = s.data("level").toUInt(); - addToQueryURL(url, "scoreLevel", QString::number(l)); + addToQueryURL(url, "scoreLevel", TQString::number(l)); uint r = s.data("removed").toUInt(); - addToQueryURL(url, "scoreRemoved", QString::number(r)); + addToQueryURL(url, "scoreRemoved", TQString::number(r)); } diff --git a/libksirtet/common/inter.cpp b/libksirtet/common/inter.cpp index e9f1688b..c5630108 100644 --- a/libksirtet/common/inter.cpp +++ b/libksirtet/common/inter.cpp @@ -12,17 +12,17 @@ const ActionData Interface::ACTION_DATA[Nb_Actions] = { - { I18N_NOOP("Move Left"), "move left", SLOT(moveLeft()), 0 }, - { I18N_NOOP("Move Right"), "move right", SLOT(moveRight()), 0 }, - { I18N_NOOP("Drop Down"), "drop down", SLOT(dropDownStart()), - SLOT(dropDownStop()) }, - { I18N_NOOP("One Line Down"), "one line down", SLOT(oneLineDown()), 0 }, - { I18N_NOOP("Rotate Left"), "rotate left", SLOT(rotateLeft()), 0 }, - { I18N_NOOP("Rotate Right"), "rotate right", SLOT(rotateRight()), 0 }, + { I18N_NOOP("Move Left"), "move left", TQT_SLOT(moveLeft()), 0 }, + { I18N_NOOP("Move Right"), "move right", TQT_SLOT(moveRight()), 0 }, + { I18N_NOOP("Drop Down"), "drop down", TQT_SLOT(dropDownStart()), + TQT_SLOT(dropDownStop()) }, + { I18N_NOOP("One Line Down"), "one line down", TQT_SLOT(oneLineDown()), 0 }, + { I18N_NOOP("Rotate Left"), "rotate left", TQT_SLOT(rotateLeft()), 0 }, + { I18N_NOOP("Rotate Right"), "rotate right", TQT_SLOT(rotateRight()), 0 }, { I18N_NOOP("Move to Left Column"), "move left total", - SLOT(moveLeftTotal()), 0 }, + TQT_SLOT(moveLeftTotal()), 0 }, { I18N_NOOP("Move to Right Column"), "move right total", - SLOT(moveRightTotal()), 0 } + TQT_SLOT(moveRightTotal()), 0 } }; const int Interface::KEYCODE_ONE[Nb_Actions] = { @@ -33,7 +33,7 @@ const int Interface::KEYCODE_TWO[Nb_Actions] = { Key_F, Key_G, Key_D, Key_Space, Key_E, Key_C, SHIFT+Key_F, SHIFT+Key_G }; -Interface::Interface(const MPGameInfo &gi, QWidget *parent) +Interface::Interface(const MPGameInfo &gi, TQWidget *parent) : MPSimpleInterface(gi, Nb_Actions, ACTION_DATA, parent) { setDefaultKeycodes(1, 0, KEYCODE_ONE); @@ -45,7 +45,7 @@ MPBoard *Interface::newBoard(uint i) { Field *f = static_cast<Field *>(cfactory->createField(this)); f->settingsChanged(); - connect(this, SIGNAL(settingsChanged()), f, SLOT(settingsChanged())); + connect(this, TQT_SIGNAL(settingsChanged()), f, TQT_SLOT(settingsChanged())); if ( i==0 ) _firstField = f; return f; } @@ -91,7 +91,7 @@ void Interface::_sendPlayData() } } -void Interface::_showHighscores(QWidget *parent) +void Interface::_showHighscores(TQWidget *parent) { if ( !server() || nbPlayers()!=1 ) _scores.show(parent); else BaseInterface::_showHighscores(parent); @@ -132,7 +132,7 @@ void Interface::_treatInit() } } -void Interface::_sendGameOverData(QDataStream &s) +void Interface::_sendGameOverData(TQDataStream &s) { bool multiplayers = ( nbPlayers()>1 ); for (uint i=0; i<nbPlayers(); i++) { @@ -144,7 +144,7 @@ void Interface::_sendGameOverData(QDataStream &s) } // client only -void Interface::_readGameOverData(QDataStream &s) +void Interface::_readGameOverData(TQDataStream &s) { s >> _scores; } diff --git a/libksirtet/common/inter.h b/libksirtet/common/inter.h index e38c2ed5..02041afa 100644 --- a/libksirtet/common/inter.h +++ b/libksirtet/common/inter.h @@ -16,7 +16,7 @@ class LIBKSIRTET_EXPORT Interface : public MPSimpleInterface, public BaseInterfa { Q_OBJECT public: - Interface(const MPGameInfo &, QWidget *parent); + Interface(const MPGameInfo &, TQWidget *parent); signals: void settingsChanged(); @@ -27,10 +27,10 @@ public slots: void settingsChangedSlot() { emit settingsChanged(); } protected: - void _showHighscores(QWidget *parent); + void _showHighscores(TQWidget *parent); private: - QMemArray<ClientPlayData> _data; + TQMemArray<ClientPlayData> _data; KExtHighscore::Score _score; KExtHighscore::MultiplayerScores _scores; Field *_firstField; @@ -45,8 +45,8 @@ private: uint prev(uint i) const; uint next(uint i) const; - void _readGameOverData(QDataStream &s); - void _sendGameOverData(QDataStream &s); + void _readGameOverData(TQDataStream &s); + void _sendGameOverData(TQDataStream &s); void _firstInit() {} void _treatInit(); void _init(); diff --git a/libksirtet/common/main.cpp b/libksirtet/common/main.cpp index 004b86ca..e7674846 100644 --- a/libksirtet/common/main.cpp +++ b/libksirtet/common/main.cpp @@ -12,7 +12,7 @@ void MainWindow::addConfig(KConfigDialog *dialog) { - QWidget *w = cfactory->createAIConfig(); + TQWidget *w = cfactory->createAIConfig(); if (w) dialog->addPage(w, i18n("A.I."), "personal"); } @@ -24,23 +24,23 @@ void MainWindow::init() // Modes bool ama = ( bfactory->bbi.nbArcadeStages!=0 ); - QString s = (ama ? i18n("&Single Human (Normal)") : i18n("&Single Human")); - (void)new KAction(s, 0, inter, SLOT(normalGame()), + TQString s = (ama ? i18n("&Single Human (Normal)") : i18n("&Single Human")); + (void)new KAction(s, 0, inter, TQT_SLOT(normalGame()), actionCollection(), "mp_single_human"); if (ama) (void)new KAction(i18n("&Single Human (Arcade)"), 0, - inter, SLOT(arcadeGame()), + inter, TQT_SLOT(arcadeGame()), actionCollection(), "mp_arcade"); - (void)new KAction(i18n("Human vs &Human"), 0, inter, SLOT(humanVsHuman()), + (void)new KAction(i18n("Human vs &Human"), 0, inter, TQT_SLOT(humanVsHuman()), actionCollection(), "mp_human_vs_human"); (void)new KAction(i18n("Human vs &Computer"), 0, - inter, SLOT(humanVsComputer()), + inter, TQT_SLOT(humanVsComputer()), actionCollection(), "mp_human_vs_computer"); - (void)new KAction(i18n("&More..."), 0, inter, SLOT(dialog()), + (void)new KAction(i18n("&More..."), 0, inter, TQT_SLOT(dialog()), actionCollection(), "mp_more"); buildGUI(inter); - connect(this, SIGNAL(settingsChanged()), - inter, SLOT(settingsChangedSlot())); + connect(this, TQT_SIGNAL(settingsChanged()), + inter, TQT_SLOT(settingsChangedSlot())); } void MainWindow::addKeys(KKeyDialog &d) @@ -53,7 +53,7 @@ void MainWindow::saveKeys() static_cast<Interface *>(_inter)->saveKeys(); } -void MainWindow::focusInEvent(QFocusEvent *e) +void MainWindow::focusInEvent(TQFocusEvent *e) { static_cast<Interface *>(_inter)->setFocus(); BaseMainWindow::focusInEvent(e); diff --git a/libksirtet/common/main.h b/libksirtet/common/main.h index d22b7273..a98fc6f1 100644 --- a/libksirtet/common/main.h +++ b/libksirtet/common/main.h @@ -16,7 +16,7 @@ protected: void addConfig(KConfigDialog *); void addKeys(KKeyDialog &); void saveKeys(); - virtual void focusInEvent(QFocusEvent *e); + virtual void focusInEvent(TQFocusEvent *e); }; #endif diff --git a/libksirtet/common/misc_ui.cpp b/libksirtet/common/misc_ui.cpp index 45cfb440..cf802e25 100644 --- a/libksirtet/common/misc_ui.cpp +++ b/libksirtet/common/misc_ui.cpp @@ -1,7 +1,7 @@ #include "misc_ui.h" #include "misc_ui.moc" -#include <qpainter.h> +#include <tqpainter.h> #include "base/piece.h" #include "base/board.h" @@ -24,32 +24,32 @@ const uint LED_HEIGHT = 15; const uint LED_SPACING = 5; /*****************************************************************************/ -ShowNextPiece::ShowNextPiece(BaseBoard *board, QWidget *parent) +ShowNextPiece::ShowNextPiece(BaseBoard *board, TQWidget *parent) : FixedCanvasView(parent, "show_next_piece") { setCanvas(board->next()); - setFrameStyle(QFrame::Panel | QFrame::Sunken); + setFrameStyle(TQFrame::Panel | TQFrame::Sunken); KZoomMainWindow::addWidget(this); } /*****************************************************************************/ -Shadow::Shadow(BaseBoard *board, QWidget *parent) - : QWidget(parent, "shadow"), _xOffset(board->frameWidth()), +Shadow::Shadow(BaseBoard *board, TQWidget *parent) + : TQWidget(parent, "shadow"), _xOffset(board->frameWidth()), _board(board), _show(false) { KZoomMainWindow::addWidget(this); - connect(board, SIGNAL(updatePieceConfigSignal()), SLOT(update())); + connect(board, TQT_SIGNAL(updatePieceConfigSignal()), TQT_SLOT(update())); } -QSize Shadow::sizeHint() const +TQSize Shadow::sizeHint() const { - return QSize(_xOffset + _board->matrix().width() * BasePrefs::blockSize(), + return TQSize(_xOffset + _board->matrix().width() * BasePrefs::blockSize(), SHADOW_HEIGHT); } -QSizePolicy Shadow::sizePolicy() const +TQSizePolicy Shadow::sizePolicy() const { - return QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); } void Shadow::setDisplay(bool show) @@ -58,7 +58,7 @@ void Shadow::setDisplay(bool show) update(); } -void Shadow::paintEvent(QPaintEvent *) +void Shadow::paintEvent(TQPaintEvent *) { if ( !_show ) return; @@ -66,11 +66,11 @@ void Shadow::paintEvent(QPaintEvent *) uint pf = piece->min().first + _board->currentPos().first; uint pl = pf + piece->size().first - 1; - QPainter p(this); + TQPainter p(this); p.setBrush(black); p.setPen(black); for (uint i=pf; i<=pl; i++) { - QRect r(_xOffset + i * BasePrefs::blockSize() + 1 , 0, + TQRect r(_xOffset + i * BasePrefs::blockSize() + 1 , 0, BasePrefs::blockSize() - 2, SHADOW_HEIGHT); p.drawRect(r); } @@ -81,32 +81,32 @@ void Shadow::paintEvent(QPaintEvent *) class Led : public QWidget { public: - Led(const QColor &c, QWidget *parent) - : QWidget(parent), col(c), _on(FALSE) {} + Led(const TQColor &c, TQWidget *parent) + : TQWidget(parent), col(c), _on(FALSE) {} - QSizePolicy sizePolicy() const - { return QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); } - QSize sizeHint() const { return QSize(LED_WIDTH, LED_HEIGHT); } + TQSizePolicy sizePolicy() const + { return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); } + TQSize sizeHint() const { return TQSize(LED_WIDTH, LED_HEIGHT); } void on() { if (!_on) { _on = TRUE; repaint(); } } void off() { if (_on) {_on = FALSE; repaint(); } } - void setColor(const QColor &c) { if (c!=col) { col = c; repaint(); } } + void setColor(const TQColor &c) { if (c!=col) { col = c; repaint(); } } protected: - void paintEvent(QPaintEvent *) { - QPainter p(this); + void paintEvent(TQPaintEvent *) { + TQPainter p(this); p.setBrush((_on ? col.light() : col.dark())); p.setPen(black); p.drawEllipse(0, 0, width(), height()); } private: - QColor col; + TQColor col; bool _on; }; -GiftPool::GiftPool(QWidget *parent) - : QHBox(parent, "gift_pool"), nb(0), ready(false) +GiftPool::GiftPool(TQWidget *parent) + : TQHBox(parent, "gift_pool"), nb(0), ready(false) { setSpacing(LED_SPACING); leds.resize(cfactory->cbi.nbGiftLeds); @@ -114,23 +114,23 @@ GiftPool::GiftPool(QWidget *parent) leds.insert(i, new Led(yellow, this)); } -QSize GiftPool::sizeHint() const +TQSize GiftPool::sizeHint() const { - QSize s = (leds.size() ? leds[0]->sizeHint() : QSize()); - return QSize((s.width()+LED_SPACING)*leds.size()-LED_SPACING, s.height()); + TQSize s = (leds.size() ? leds[0]->sizeHint() : TQSize()); + return TQSize((s.width()+LED_SPACING)*leds.size()-LED_SPACING, s.height()); } -QSizePolicy GiftPool::sizePolicy() const +TQSizePolicy GiftPool::sizePolicy() const { - return QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); } void GiftPool::put(uint n) { if ( n==0 ) return; if ( nb==0 && !ready ) - QTimer::singleShot(cfactory->cbi.giftPoolTimeout, - this, SLOT(timeout())); + TQTimer::singleShot(cfactory->cbi.giftPoolTimeout, + this, TQT_SLOT(timeout())); uint e = QMIN(nb+n, leds.size()); for (uint i=nb; i<e; i++) leds[i]->on(); uint f = QMIN(nb+n-e, leds.size()); @@ -171,7 +171,7 @@ void GiftPool::reset() } //----------------------------------------------------------------------------- -PlayerProgress::PlayerProgress(BaseBoard *board, QWidget *parent, +PlayerProgress::PlayerProgress(BaseBoard *board, TQWidget *parent, const char *name) : KGameProgress(0, board->matrix().height(), 0, KGameProgress::Vertical, parent, name), _board(board) @@ -182,13 +182,13 @@ PlayerProgress::PlayerProgress(BaseBoard *board, QWidget *parent, KZoomMainWindow::addWidget(this); } -QSize PlayerProgress::sizeHint() const +TQSize PlayerProgress::sizeHint() const { - return QSize(10, _board->matrix().height() * BasePrefs::blockSize()) - + 2 * QSize(frameWidth(), frameWidth()); + return TQSize(10, _board->matrix().height() * BasePrefs::blockSize()) + + 2 * TQSize(frameWidth(), frameWidth()); } -QSizePolicy PlayerProgress::sizePolicy() const +TQSizePolicy PlayerProgress::sizePolicy() const { - return QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); } diff --git a/libksirtet/common/misc_ui.h b/libksirtet/common/misc_ui.h index 3a89acaa..38544a02 100644 --- a/libksirtet/common/misc_ui.h +++ b/libksirtet/common/misc_ui.h @@ -1,9 +1,9 @@ #ifndef COMMON_MISC_UI_H #define COMMON_MISC_UI_H -#include <qcanvas.h> -#include <qptrvector.h> -#include <qhbox.h> +#include <tqcanvas.h> +#include <tqptrvector.h> +#include <tqhbox.h> #include <kgameprogress.h> #include "lib/libksirtet_export.h" @@ -15,7 +15,7 @@ class LIBKSIRTET_EXPORT ShowNextPiece : public FixedCanvasView { Q_OBJECT public: - ShowNextPiece(BaseBoard *, QWidget *parent); + ShowNextPiece(BaseBoard *, TQWidget *parent); }; /*****************************************************************************/ @@ -23,10 +23,10 @@ class LIBKSIRTET_EXPORT Shadow : public QWidget { Q_OBJECT public: - Shadow(BaseBoard *, QWidget *parent); + Shadow(BaseBoard *, TQWidget *parent); - virtual QSize sizeHint() const; - virtual QSizePolicy sizePolicy() const; + virtual TQSize sizeHint() const; + virtual TQSizePolicy sizePolicy() const; void setDisplay(bool show); private: @@ -34,7 +34,7 @@ class LIBKSIRTET_EXPORT Shadow : public QWidget const BaseBoard *_board; bool _show; - void paintEvent(QPaintEvent *); + void paintEvent(TQPaintEvent *); }; /*****************************************************************************/ @@ -44,10 +44,10 @@ class LIBKSIRTET_EXPORT GiftPool : public QHBox { Q_OBJECT public: - GiftPool(QWidget *parent); + GiftPool(TQWidget *parent); - virtual QSize sizeHint() const; - virtual QSizePolicy sizePolicy() const; + virtual TQSize sizeHint() const; + virtual TQSizePolicy sizePolicy() const; void reset(); void put(uint); @@ -58,7 +58,7 @@ class LIBKSIRTET_EXPORT GiftPool : public QHBox void timeout() { ready = true; } private: - QPtrVector<Led> leds; + TQPtrVector<Led> leds; uint _timeout, nb; bool ready; }; @@ -69,10 +69,10 @@ class LIBKSIRTET_EXPORT PlayerProgress : public KGameProgress { Q_OBJECT public: - PlayerProgress(BaseBoard *board, QWidget *parent = 0, const char *name = 0); + PlayerProgress(BaseBoard *board, TQWidget *parent = 0, const char *name = 0); - virtual QSize sizeHint() const; - virtual QSizePolicy sizePolicy() const; + virtual TQSize sizeHint() const; + virtual TQSizePolicy sizePolicy() const; private: BaseBoard *_board; diff --git a/libksirtet/common/settings.cpp b/libksirtet/common/settings.cpp index 902d1e56..058de034 100644 --- a/libksirtet/common/settings.cpp +++ b/libksirtet/common/settings.cpp @@ -1,10 +1,10 @@ #include "settings.h" #include "settings.moc" -#include <qlabel.h> -#include <qlayout.h> -#include <qcheckbox.h> -#include <qwhatsthis.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqwhatsthis.h> #include <klocale.h> #include <knuminput.h> @@ -18,26 +18,26 @@ AppearanceConfig::AppearanceConfig() int row = _grid->numRows(); int col = _grid->numCols(); - QCheckBox *cb = new QCheckBox(i18n("Show piece's shadow"), _main, "kcfg_ShowPieceShadow"); + TQCheckBox *cb = new TQCheckBox(i18n("Show piece's shadow"), _main, "kcfg_ShowPieceShadow"); _grid->addMultiCellWidget(cb, row, row, 0, col-1); - cb = new QCheckBox(i18n("Show next piece"), _main, "kcfg_ShowNextPiece"); + cb = new TQCheckBox(i18n("Show next piece"), _main, "kcfg_ShowNextPiece"); _grid->addMultiCellWidget(cb, row+1, row+1, 0, col-1); - cb = new QCheckBox(i18n("Show detailed \"removed lines\" field"), _main, "kcfg_ShowDetailedRemoved"); + cb = new TQCheckBox(i18n("Show detailed \"removed lines\" field"), _main, "kcfg_ShowDetailedRemoved"); _grid->addMultiCellWidget(cb, row+2, row+2, 0, col-1); } //----------------------------------------------------------------------------- GameConfig::GameConfig() - : QWidget(0, "game config") + : TQWidget(0, "game config") { - QVBoxLayout *top = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *top = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - _grid = new QGridLayout(top, 3, 2); + _grid = new TQGridLayout(top, 3, 2); _grid->setColStretch(1, 1); - QLabel *label = new QLabel(i18n("Initial level:"), this); + TQLabel *label = new TQLabel(i18n("Initial level:"), this); _grid->addWidget(label, 0, 0); KIntNumInput *in = new KIntNumInput(this, "kcfg_InitialGameLevel"); in->setRange(1, 20, 1, true); @@ -45,8 +45,8 @@ GameConfig::GameConfig() _grid->addRowSpacing(1, KDialog::spacingHint()); - QCheckBox *cb = new QCheckBox(i18n("Direct drop down"), this, "kcfg_DirectDropDownEnabled"); - QWhatsThis::add(cb, i18n("Drop down is not stopped when drop down key is released.")); + TQCheckBox *cb = new TQCheckBox(i18n("Direct drop down"), this, "kcfg_DirectDropDownEnabled"); + TQWhatsThis::add(cb, i18n("Drop down is not stopped when drop down key is released.")); _grid->addMultiCellWidget(cb, 2, 2, 0, 1); top->addStretch(1); diff --git a/libksirtet/common/settings.h b/libksirtet/common/settings.h index ceda13a1..2a554e8d 100644 --- a/libksirtet/common/settings.h +++ b/libksirtet/common/settings.h @@ -22,7 +22,7 @@ public: GameConfig(); protected: - QGridLayout *_grid; + TQGridLayout *_grid; }; #endif diff --git a/libksirtet/common/types.cpp b/libksirtet/common/types.cpp index 05d91db3..e7876c76 100644 --- a/libksirtet/common/types.cpp +++ b/libksirtet/common/types.cpp @@ -1,16 +1,16 @@ #include "types.h" -LIBKSIRTET_EXPORT QDataStream &operator <<(QDataStream &s, const ClientPlayData &d) +LIBKSIRTET_EXPORT TQDataStream &operator <<(TQDataStream &s, const ClientPlayData &d) { s << d.height << d.gift << d.end; return s; } -LIBKSIRTET_EXPORT QDataStream &operator >>(QDataStream &s, ClientPlayData &d) +LIBKSIRTET_EXPORT TQDataStream &operator >>(TQDataStream &s, ClientPlayData &d) { s >> d.height >> d.gift >> d.end; return s; } -LIBKSIRTET_EXPORT QDataStream &operator <<(QDataStream &s, const ServerPlayData &d) +LIBKSIRTET_EXPORT TQDataStream &operator <<(TQDataStream &s, const ServerPlayData &d) { s << d.prevHeight << d.nextHeight << d.gift; return s; } -LIBKSIRTET_EXPORT QDataStream &operator >>(QDataStream &s, ServerPlayData &d) +LIBKSIRTET_EXPORT TQDataStream &operator >>(TQDataStream &s, ServerPlayData &d) { s >> d.prevHeight >> d.nextHeight >> d.gift; return s; } -LIBKSIRTET_EXPORT QDataStream &operator <<(QDataStream &s, const ServerInitData &d) +LIBKSIRTET_EXPORT TQDataStream &operator <<(TQDataStream &s, const ServerInitData &d) { s << d.initLevel << d.seed << d.nextName << d.prevName << d.name; return s; } -LIBKSIRTET_EXPORT QDataStream &operator >>(QDataStream &s, ServerInitData &d) +LIBKSIRTET_EXPORT TQDataStream &operator >>(TQDataStream &s, ServerInitData &d) { s >> d.initLevel >> d.seed >> d.nextName >> d.prevName >> d.name; return s; } diff --git a/libksirtet/common/types.h b/libksirtet/common/types.h index 8a30d276..5b85f302 100644 --- a/libksirtet/common/types.h +++ b/libksirtet/common/types.h @@ -1,26 +1,26 @@ #ifndef COMMON_TYPES_H #define COMMON_TYPES_H -#include <qdatastream.h> +#include <tqdatastream.h> #include "lib/libksirtet_export.h" struct ClientPlayData { Q_UINT8 height, gift, end; }; -LIBKSIRTET_EXPORT QDataStream &operator <<(QDataStream &s, const ClientPlayData &d); -LIBKSIRTET_EXPORT QDataStream &operator >>(QDataStream &s, ClientPlayData &d); +LIBKSIRTET_EXPORT TQDataStream &operator <<(TQDataStream &s, const ClientPlayData &d); +LIBKSIRTET_EXPORT TQDataStream &operator >>(TQDataStream &s, ClientPlayData &d); struct ServerPlayData { Q_UINT8 prevHeight, nextHeight, gift; }; -LIBKSIRTET_EXPORT QDataStream &operator <<(QDataStream &s, const ServerPlayData &d); -LIBKSIRTET_EXPORT QDataStream &operator >>(QDataStream &s, ServerPlayData &d); +LIBKSIRTET_EXPORT TQDataStream &operator <<(TQDataStream &s, const ServerPlayData &d); +LIBKSIRTET_EXPORT TQDataStream &operator >>(TQDataStream &s, ServerPlayData &d); class ServerInitData { public: - QString prevName, nextName, name; + TQString prevName, nextName, name; Q_UINT32 initLevel, seed; }; -LIBKSIRTET_EXPORT QDataStream &operator <<(QDataStream &s, const ServerInitData &d); -LIBKSIRTET_EXPORT QDataStream &operator >>(QDataStream &s, ServerInitData &d); +LIBKSIRTET_EXPORT TQDataStream &operator <<(TQDataStream &s, const ServerInitData &d); +LIBKSIRTET_EXPORT TQDataStream &operator >>(TQDataStream &s, ServerInitData &d); #endif diff --git a/libksirtet/lib/defines.cpp b/libksirtet/lib/defines.cpp index 7c897dd9..baf91083 100644 --- a/libksirtet/lib/defines.cpp +++ b/libksirtet/lib/defines.cpp @@ -2,21 +2,21 @@ #include <klocale.h> -void errorBox(const QString &msg1, const QString &msg2, QWidget *parent) +void errorBox(const TQString &msg1, const TQString &msg2, TQWidget *parent) { - QString str; + TQString str; if ( msg2.isNull() ) str = msg1; else str = i18n("%1:\n%2").arg(msg1).arg(msg2); KMessageBox::error(parent, str); } -QString socketError(const KExtendedSocket *socket) +TQString socketError(const KExtendedSocket *socket) { return KExtendedSocket::strError(socket->status(), socket->systemError()); } bool checkSocket(int res, const KExtendedSocket *socket, - const QString &msg, QWidget *parent) + const TQString &msg, TQWidget *parent) { if ( res==0 ) return false; errorBox(msg, socketError(socket), parent); diff --git a/libksirtet/lib/defines.h b/libksirtet/lib/defines.h index 9015c6b1..a6728a38 100644 --- a/libksirtet/lib/defines.h +++ b/libksirtet/lib/defines.h @@ -16,10 +16,10 @@ #define MP_SERVER_ADDRESS "Server address" #define MP_PORT "Port" -void errorBox(const QString &msg1, const QString &msg2, QWidget *parent); -QString socketError(const KExtendedSocket *socket); +void errorBox(const TQString &msg1, const TQString &msg2, TQWidget *parent); +TQString socketError(const KExtendedSocket *socket); bool checkSocket(int res, const KExtendedSocket *, - const QString &msg, QWidget *parent); + const TQString &msg, TQWidget *parent); #define R_ERROR_BOX(msg1, msg2) { \ errorBox(msg1, msg2, this); \ diff --git a/libksirtet/lib/internal.cpp b/libksirtet/lib/internal.cpp index c7b69f9e..f8b34085 100644 --- a/libksirtet/lib/internal.cpp +++ b/libksirtet/lib/internal.cpp @@ -1,7 +1,7 @@ #include "internal.h" #include "internal.moc" -#include <qptrlist.h> +#include <tqptrlist.h> #include <klocale.h> #include "mp_interface.h" @@ -67,17 +67,17 @@ void Server::serverTimeout() //----------------------------------------------------------------------------- Network::Network(MPInterface *_interface, - QValueList<MPInterface::Data> &_boards, - const QPtrList<RemoteHostData> &rhd) + TQValueList<MPInterface::Data> &_boards, + const TQPtrList<RemoteHostData> &rhd) : Local(_interface, _boards) { RemoteData rd; - QPtrListIterator<RemoteHostData> it(rhd); + TQPtrListIterator<RemoteHostData> it(rhd); for (; it.current(); ++it) { rd.socket = it.current()->socket; rd.socket->notifier()->setEnabled(TRUE); - connect(rd.socket->notifier(), SIGNAL(activated(int)), - SLOT(notifier(int))); + connect(rd.socket->notifier(), TQT_SIGNAL(activated(int)), + TQT_SLOT(notifier(int))); uint nb = it.current()->bds.count(); Q_ASSERT( nb>=1 ); rd.array = new BufferArray(nb); @@ -102,7 +102,7 @@ uint Network::nbPlayers() const return nb; } -QString Network::playerName(uint i) const +TQString Network::playerName(uint i) const { uint l = Local::nbPlayers(); if ( i<l ) return Local::playerName(i); @@ -111,7 +111,7 @@ QString Network::playerName(uint i) const if ( i<(l+ll) ) return remotes[k].names[i-l]; l += ll; } - return QString::null; // dummy + return TQString::null; // dummy } IOBuffer *Network::ioBuffer(uint i) const @@ -141,7 +141,7 @@ void Network::brokeError(uint i) disconnectHost(i, i18n("Link broken")); } -void Network::disconnectHost(uint i, const QString &msg) +void Network::disconnectHost(uint i, const TQString &msg) { delete remotes[i].socket; delete remotes[i].array; @@ -151,24 +151,24 @@ void Network::disconnectHost(uint i, const QString &msg) //----------------------------------------------------------------------------- LocalServer::LocalServer(MPInterface *_interface, - QValueList<MPInterface::Data> &_boards, + TQValueList<MPInterface::Data> &_boards, uint _interval) : Local(_interface, _boards), Server(_interval) { - connect(&timer, SIGNAL(timeout()), SLOT(timeoutSlot())); - connect(&ctimer, SIGNAL(timeout()), SLOT(congestionTimeoutSlot())); + connect(&timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeoutSlot())); + connect(&ctimer, TQT_SIGNAL(timeout()), TQT_SLOT(congestionTimeoutSlot())); serverTimeout(); } //----------------------------------------------------------------------------- NetworkServer::NetworkServer(MPInterface *_interface, - QValueList<MPInterface::Data> &_boards, - const QPtrList<RemoteHostData> &rhd, uint _interval) + TQValueList<MPInterface::Data> &_boards, + const TQPtrList<RemoteHostData> &rhd, uint _interval) : Network(_interface, _boards, rhd), Server(_interval), nbReceived(remotes.count()) { - connect(&timer, SIGNAL(timeout()), SLOT(timeoutSlot())); - connect(&ctimer, SIGNAL(timeout()), SLOT(congestionTimeoutSlot())); + connect(&timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeoutSlot())); + connect(&ctimer, TQT_SIGNAL(timeout()), TQT_SLOT(congestionTimeoutSlot())); // to catch unexpected data for (uint i=0; i<remotes.count(); i++) remotes[i].received = TRUE; nbReceived = remotes.count(); diff --git a/libksirtet/lib/internal.h b/libksirtet/lib/internal.h index 4dece16a..cc74fbc4 100644 --- a/libksirtet/lib/internal.h +++ b/libksirtet/lib/internal.h @@ -1,8 +1,8 @@ #ifndef INTERNAL_H #define INTERNAL_H -#include <qtimer.h> -#include <qstringlist.h> +#include <tqtimer.h> +#include <tqstringlist.h> #include "socket.h" #include "mp_interface.h" @@ -14,12 +14,12 @@ class RemoteHostData; class Local { public: - Local(MPInterface *_interface, QValueList<MPInterface::Data> &_boards) + Local(MPInterface *_interface, TQValueList<MPInterface::Data> &_boards) : interface(_interface), ios(_boards.count()), boards(_boards) {} virtual ~Local() {} virtual uint nbPlayers() const { return boards.count(); } - virtual QString playerName(uint i) const { return boards[i].name; } + virtual TQString playerName(uint i) const { return boards[i].name; } virtual IOBuffer *ioBuffer(uint i) const { return ios[i]; } virtual void writeData(bool inverse); virtual WritingStream *globalStream() { return 0; } @@ -33,7 +33,7 @@ class Local void treatData(); private: - QValueList<MPInterface::Data> boards; + TQValueList<MPInterface::Data> boards; }; //----------------------------------------------------------------------------- @@ -45,7 +45,7 @@ class Server protected: WritingStream stream; - QTimer timer, ctimer; + TQTimer timer, ctimer; virtual void timeout() = 0; void serverTimeout(); @@ -56,17 +56,17 @@ class Server }; //----------------------------------------------------------------------------- -class Network : public QObject, public Local +class Network : public TQObject, public Local { Q_OBJECT public: - Network(MPInterface *_interface, QValueList<MPInterface::Data> &_boards, - const QPtrList<RemoteHostData> &rhd); + Network(MPInterface *_interface, TQValueList<MPInterface::Data> &_boards, + const TQPtrList<RemoteHostData> &rhd); virtual ~Network(); virtual uint nbPlayers() const; - QString playerName(uint i) const; + TQString playerName(uint i) const; IOBuffer *ioBuffer(uint i) const; protected slots: @@ -79,24 +79,24 @@ class Network : public QObject, public Local Socket *socket; BufferArray *array; bool received; - QStringList names; + TQStringList names; }; - QValueList<RemoteData> remotes; + TQValueList<RemoteData> remotes; void readError(uint i); void writeError(uint i); void brokeError(uint i); - void disconnectHost(uint i, const QString &msg); + void disconnectHost(uint i, const TQString &msg); }; //----------------------------------------------------------------------------- -class LocalServer : public QObject, public Local, public Server +class LocalServer : public TQObject, public Local, public Server { Q_OBJECT public: LocalServer(MPInterface *_interface, - QValueList<MPInterface::Data> &_boards, uint _interval); + TQValueList<MPInterface::Data> &_boards, uint _interval); WritingStream *globalStream() { return &stream; } @@ -115,8 +115,8 @@ class NetworkServer : public Network, public Server public: NetworkServer(MPInterface *_interface, - QValueList<MPInterface::Data> &_boards, - const QPtrList<RemoteHostData> &rhd, uint _interval); + TQValueList<MPInterface::Data> &_boards, + const TQPtrList<RemoteHostData> &rhd, uint _interval); void writeData(bool inverse); WritingStream *globalStream() { return &stream; } @@ -139,8 +139,8 @@ class Client : public Network Q_OBJECT public: - Client(MPInterface *_interface, QValueList<MPInterface::Data> &_boards, - const QPtrList<RemoteHostData> &rhd) + Client(MPInterface *_interface, TQValueList<MPInterface::Data> &_boards, + const TQPtrList<RemoteHostData> &rhd) : Network(_interface, _boards, rhd) {} uint nbPlayers() const { return Local::nbPlayers(); } diff --git a/libksirtet/lib/keys.cpp b/libksirtet/lib/keys.cpp index 879f0bfa..8433503f 100644 --- a/libksirtet/lib/keys.cpp +++ b/libksirtet/lib/keys.cpp @@ -1,14 +1,14 @@ #include "keys.h" #include "keys.moc" -#include <qsignal.h> +#include <tqsignal.h> #include <kkeydialog.h> #include <klocale.h> KeyData::KeyData(uint maxNb, uint nbActions, const ActionData *data, - QObject *parent) - : QObject(parent), _maxNb(maxNb) + TQObject *parent) + : TQObject(parent), _maxNb(maxNb) { _data.duplicate(data, nbActions); @@ -40,13 +40,13 @@ void KeyData::clear() _cols.resize(0); } -void KeyData::createActionCollection(uint index, QWidget *receiver) +void KeyData::createActionCollection(uint index, TQWidget *receiver) { Q_ASSERT( index<_cols.size() ); _cols[index] = new KActionCollection(receiver, this); for (uint k=0; k<_data.size(); k++) { - QString label = i18n(_data[k].label); - QString name = QString("%2 %3").arg(index+1).arg(_data[k].name); + TQString label = i18n(_data[k].label); + TQString name = TQString("%2 %3").arg(index+1).arg(_data[k].name); const char *slot = (_data[k].slotRelease ? 0 : _data[k].slot); KAction *a = new KAction(label, _keycodes[_cols.size()-1][index][k], receiver, slot, _cols[index], name.utf8()); @@ -54,9 +54,9 @@ void KeyData::createActionCollection(uint index, QWidget *receiver) if ( slot==0 ) { SpecialData data; data.enabled = false; - data.pressed = new QSignal(this); + data.pressed = new TQSignal(this); data.pressed->connect(receiver, _data[k].slot); - data.released = new QSignal(this); + data.released = new TQSignal(this); data.released->connect(receiver, _data[k].slotRelease); _specActions[a] = data; } @@ -67,7 +67,7 @@ void KeyData::createActionCollection(uint index, QWidget *receiver) void KeyData::setEnabled(uint index, bool enabled) { for (uint k=0; k<_cols[index]->count(); k++) { - QMap<KAction *, SpecialData>::Iterator it = + TQMap<KAction *, SpecialData>::Iterator it = _specActions.find(_cols[index]->action(k)); if ( it==_specActions.end() ) _cols[index]->action(k)->setEnabled(enabled); @@ -88,12 +88,12 @@ void KeyData::save() _cols[i]->writeShortcutSettings(group()); } -void KeyData::keyEvent(QKeyEvent *e, bool pressed) +void KeyData::keyEvent(TQKeyEvent *e, bool pressed) { if ( e->isAutoRepeat() ) return; KKey key(e); - QMap<KAction *, SpecialData>::Iterator it = _specActions.begin(); + TQMap<KAction *, SpecialData>::Iterator it = _specActions.begin(); for(; it!=_specActions.end(); ++it) { if ( !it.data().enabled ) continue; if ( !it.key()->shortcut().contains(key) ) continue; diff --git a/libksirtet/lib/keys.h b/libksirtet/lib/keys.h index 07c08419..62bb818c 100644 --- a/libksirtet/lib/keys.h +++ b/libksirtet/lib/keys.h @@ -1,7 +1,7 @@ #ifndef KEYS_H #define KEYS_H -#include <qmap.h> +#include <tqmap.h> #include <kaction.h> #include "mp_interface.h" @@ -12,31 +12,31 @@ class KeyData : public QObject Q_OBJECT public: KeyData(uint maxNb, uint nbActions, const ActionData *, - QObject *parent); + TQObject *parent); void setKeycodes(uint nb, uint i, const int *keycodes); void setCurrentNb(uint nb); void clear(); - void createActionCollection(uint index, QWidget *receiver); + void createActionCollection(uint index, TQWidget *receiver); void setEnabled(uint index, bool enabled); void addKeys(KKeyDialog &); void save(); - void keyEvent(QKeyEvent *e, bool pressed); + void keyEvent(TQKeyEvent *e, bool pressed); private: uint _maxNb; - QMemArray<ActionData> _data; - QMap<int, QMap<int, QMemArray<int> > > _keycodes; - QMemArray<KActionCollection *> _cols; + TQMemArray<ActionData> _data; + TQMap<int, TQMap<int, TQMemArray<int> > > _keycodes; + TQMemArray<KActionCollection *> _cols; struct SpecialData { bool enabled; - QSignal *pressed, *released; + TQSignal *pressed, *released; }; - QMap<KAction *, SpecialData> _specActions; + TQMap<KAction *, SpecialData> _specActions; - QString group() const - { return QString("Keys (%1 humans)").arg(_cols.size()); } + TQString group() const + { return TQString("Keys (%1 humans)").arg(_cols.size()); } }; #endif // KEYS_H diff --git a/libksirtet/lib/meeting.cpp b/libksirtet/lib/meeting.cpp index 2cb6e285..71df0e4d 100644 --- a/libksirtet/lib/meeting.cpp +++ b/libksirtet/lib/meeting.cpp @@ -1,7 +1,7 @@ #include "meeting.h" -#include <qmessagebox.h> -#include <qpushbutton.h> +#include <tqmessagebox.h> +#include <tqpushbutton.h> #include <klocale.h> #include <kmessagebox.h> @@ -14,7 +14,7 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket, MPOptionWidget *option, - bool _server, QWidget *parent, const char * name) + bool _server, TQWidget *parent, const char * name) : KDialogBase(Plain, i18n("Network Meeting"), (_server ? Ok|Cancel|Help : Cancel|Help), (_server ? Ok : Cancel), parent, name), @@ -24,8 +24,8 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket, sm[0]->notifier()->setEnabled(TRUE); /* top layout */ - QVBoxLayout *top = new QVBoxLayout(plainPage(), spacingHint()); - top->setResizeMode(QLayout::Fixed); + TQVBoxLayout *top = new TQVBoxLayout(plainPage(), spacingHint()); + top->setResizeMode(TQLayout::Fixed); // server line spl = new MeetingLine(server, server, true, plainPage()); @@ -36,7 +36,7 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket, wl->hide(); top->addWidget(wl); - labWait = new QLabel(i18n("Waiting for clients"), plainPage()); + labWait = new TQLabel(i18n("Waiting for clients"), plainPage()); labWait->setAlignment(AlignCenter); top->addWidget(labWait); @@ -44,7 +44,7 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket, // if (ow) top->addWidget(ow); #### FIXME // status bar - status = new QStatusBar(plainPage()); + status = new TQStatusBar(plainPage()); status->setSizeGripEnabled(false); top->addWidget(status); @@ -65,13 +65,13 @@ void NetMeeting::appendLine(const MeetingLineData &pld, bool server) { MeetingLine *pl; pl = new MeetingLine(pld.own, server, false, wl); - if (pld.own) connect(pl, SIGNAL(textChanged(const QString &)), - SLOT(textChanged(const QString &))); + if (pld.own) connect(pl, TQT_SIGNAL(textChanged(const TQString &)), + TQT_SLOT(textChanged(const TQString &))); else message(i18n("A new client has just arrived (#%1)") .arg(wl->size()+1)); pl->setData(pld.ed); - connect(pl, SIGNAL(typeChanged(MeetingCheckBox::Type)), - SLOT(typeChanged(MeetingCheckBox::Type))); + connect(pl, TQT_SIGNAL(typeChanged(MeetingCheckBox::Type)), + TQT_SLOT(typeChanged(MeetingCheckBox::Type))); wl->append(pl); waiting(); } @@ -122,7 +122,7 @@ bool NetMeeting::ready() const return ( nbReady!=0 ); } -void NetMeeting::cleanReject(const QString &str) +void NetMeeting::cleanReject(const TQString &str) { sm.clean(); // remove the sockets immediately to avoid possible further mess if ( !str.isEmpty() ) @@ -205,7 +205,7 @@ void NetMeeting::accept() KDialogBase::accept(); } -void NetMeeting::message(const QString &str) +void NetMeeting::message(const TQString &str) { status->message(str, 3000); } @@ -213,20 +213,20 @@ void NetMeeting::message(const QString &str) /** ServerNetMeeting *********************************************************/ ServerNetMeeting::ServerNetMeeting(const cId &id, const RemoteHostData &r, MPOptionWidget *option, - QPtrList<RemoteHostData> &arhd, QWidget *parent, const char * name) + TQPtrList<RemoteHostData> &arhd, TQWidget *parent, const char * name) : NetMeeting(id, r.socket, option, TRUE, parent, name), rhd(arhd) { - connect(sm[0]->notifier(), SIGNAL(activated(int)), SLOT(newHost(int))); + connect(sm[0]->notifier(), TQT_SIGNAL(activated(int)), TQT_SLOT(newHost(int))); players.append(Accepted); // server // set server line ExtData ed(r.bds, "", MeetingCheckBox::Ready); spl->setData(ed); - connect(spl, SIGNAL(textChanged(const QString &)), - SLOT(textChanged(const QString &))); + connect(spl, TQT_SIGNAL(textChanged(const TQString &)), + TQT_SLOT(textChanged(const TQString &))); // options signal - if (ow) connect(ow, SIGNAL(changed()), SLOT(optionsChanged())); + if (ow) connect(ow, TQT_SIGNAL(changed()), TQT_SLOT(optionsChanged())); } void ServerNetMeeting::writeToAll(uint i) @@ -238,13 +238,13 @@ void ServerNetMeeting::writeToAll(uint i) sm.commonWritingStream().clear(); } -void ServerNetMeeting::netError(uint i, const QString &type) +void ServerNetMeeting::netError(uint i, const TQString &type) { Q_ASSERT( i!=0 ); disconnectHost(i, i18n("%1 client #%2: disconnect it").arg(type).arg(i)); } -void ServerNetMeeting::disconnectHost(uint i, const QString &str) +void ServerNetMeeting::disconnectHost(uint i, const TQString &str) { sm.remove(i, true); socketRemoved = TRUE; @@ -271,8 +271,8 @@ void ServerNetMeeting::newHost(int) players.append(NewPlayer); Socket *socket = new Socket(s, true); uint i = sm.append(socket, SocketManager::ReadWrite); - connect(sm[i]->notifier(), SIGNAL(activated(int)), - SLOT(readNotifier(int))); + connect(sm[i]->notifier(), TQT_SIGNAL(activated(int)), + TQT_SLOT(readNotifier(int))); sm[i]->notifier()->setEnabled(TRUE); } @@ -341,7 +341,7 @@ void ServerNetMeeting::modTextFlag(uint i) { checkState(i-1, Accepted); - // the client i has just sent a new text (QString) + // the client i has just sent a new text (TQString) TextInfo ti; sm[i]->readingStream() >> ti.text; CHECK_READ(i); @@ -369,7 +369,7 @@ void ServerNetMeeting::modTypeFlag(uint i) writeToAll(i); } -void ServerNetMeeting::textChanged(const QString &text) +void ServerNetMeeting::textChanged(const TQString &text) { // server line text changed : send to every clients (Mod_Text flag + TextInfo struct) TextInfo ti; ti.i = 0; ti.text = text; @@ -448,11 +448,11 @@ void ServerNetMeeting::optionsChanged() /** ClientNetMeeting *********************************************************/ ClientNetMeeting::ClientNetMeeting(const cId &id, const RemoteHostData &rhd, MPOptionWidget *option, - QWidget *parent, const char * name) + TQWidget *parent, const char * name) : NetMeeting(id, rhd.socket, option, FALSE, parent, name), bds(rhd.bds) { - connect(sm[0]->notifier(), SIGNAL(activated(int)), - SLOT(readNotifier(int))); + connect(sm[0]->notifier(), TQT_SIGNAL(activated(int)), + TQT_SLOT(readNotifier(int))); players.append(NewPlayer); // server player // Send id to server (Id flag + Id struct) @@ -460,7 +460,7 @@ ClientNetMeeting::ClientNetMeeting(const cId &id, writeToAll(); // what happens if there is a message box appearing before exec() call ?? } -void ClientNetMeeting::netError(uint, const QString &str) +void ClientNetMeeting::netError(uint, const TQString &str) { cleanReject(i18n("%1 server: aborting connection.").arg(str)); } @@ -532,9 +532,9 @@ void ClientNetMeeting::delFlag(uint) message(i18n("Client %1 has left").arg(k)); } -void ClientNetMeeting::textChanged(const QString &text) +void ClientNetMeeting::textChanged(const TQString &text) { - // text changed : send to server (Mod_Text flag + QString) + // text changed : send to server (Mod_Text flag + TQString) sm.commonWritingStream() << Mod_TextFlag << text; writeToAll(); } diff --git a/libksirtet/lib/meeting.h b/libksirtet/lib/meeting.h index cb534404..1e9ba267 100644 --- a/libksirtet/lib/meeting.h +++ b/libksirtet/lib/meeting.h @@ -1,7 +1,7 @@ #ifndef MEETING_H #define MEETING_H -#include <qstatusbar.h> +#include <tqstatusbar.h> #include <kdialogbase.h> #include "smanager.h" #include "pline.h" @@ -15,22 +15,22 @@ class NetMeeting : public KDialogBase Q_OBJECT public: - // "gameName" and "gameId" are QByteArray because they are + // "gameName" and "gameId" are TQByteArray because they are // used for ID comparing between games. NetMeeting(const cId &id, Socket *, MPOptionWidget *option, bool server, - QWidget *parent = 0, const char * name = 0); + TQWidget *parent = 0, const char * name = 0); virtual ~NetMeeting(); protected slots: void readNotifier(int socket); - virtual void textChanged(const QString &) = 0; + virtual void textChanged(const TQString &) = 0; virtual void typeChanged(MeetingCheckBox::Type) = 0; virtual void reject(); virtual void accept(); protected: enum PlayerState { NewPlayer, IdChecked, Accepted }; - QValueList<PlayerState> players; + TQValueList<PlayerState> players; bool server; MeetingLine *spl; WidgetList<MeetingLine> *wl; @@ -44,7 +44,7 @@ class NetMeeting : public KDialogBase void setType(const TypeInfo &ti); void setText(const TextInfo &ti); - void cleanReject(const QString &str = QString::null); + void cleanReject(const TQString &str = TQString::null); bool checkState(uint i, PlayerState s); bool checkAndSetState(uint i, PlayerState os, PlayerState ns); bool ready() const; @@ -58,17 +58,17 @@ class NetMeeting : public KDialogBase virtual void modOptFlag(uint i) { dataError(i); } virtual void playFlag(uint i) { dataError(i); } - virtual void netError(uint i, const QString &str) = 0; + virtual void netError(uint i, const TQString &str) = 0; virtual void writeToAll(uint i=0) = 0; void readError(uint i); void writeError(uint i); void dataError(uint i); void brokeError(uint i); - void message(const QString &str); + void message(const TQString &str); private: - QLabel *labWait; - QStatusBar *status; + TQLabel *labWait; + TQStatusBar *status; void waiting(); void readData(uint i); @@ -81,18 +81,18 @@ class ServerNetMeeting : public NetMeeting public: ServerNetMeeting(const cId &id, const RemoteHostData &rhd, MPOptionWidget *options, - QPtrList<RemoteHostData> &arhd, - QWidget *parent = 0, const char * name = 0); + TQPtrList<RemoteHostData> &arhd, + TQWidget *parent = 0, const char * name = 0); private slots: void newHost(int); - void textChanged(const QString &text); + void textChanged(const TQString &text); void typeChanged(MeetingCheckBox::Type); void accept(); void optionsChanged(); private: - QPtrList<RemoteHostData> &rhd; + TQPtrList<RemoteHostData> &rhd; void idFlag(uint i); void newFlag(uint i); @@ -100,9 +100,9 @@ class ServerNetMeeting : public NetMeeting void modTypeFlag(uint i); void modTextFlag(uint i); - void netError(uint i, const QString &str); + void netError(uint i, const TQString &str); void writeToAll(uint i = 0); - void disconnectHost(uint i, const QString &str); + void disconnectHost(uint i, const TQString &str); }; class ClientNetMeeting : public NetMeeting @@ -112,14 +112,14 @@ class ClientNetMeeting : public NetMeeting public: ClientNetMeeting(const cId &id, const RemoteHostData &rhd, MPOptionWidget *options, - QWidget *parent = 0, const char * name = 0); + TQWidget *parent = 0, const char * name = 0); private slots: - void textChanged(const QString &text); + void textChanged(const TQString &text); void typeChanged(MeetingCheckBox::Type); private: - QValueList<BoardData> bds; + TQValueList<BoardData> bds; void idFlag(uint); void newFlag(uint); @@ -131,7 +131,7 @@ class ClientNetMeeting : public NetMeeting void playFlag(uint); void writeToAll(uint i=0); - void netError(uint, const QString &str); + void netError(uint, const TQString &str); }; #endif // MEETING_H diff --git a/libksirtet/lib/miscui.cpp b/libksirtet/lib/miscui.cpp index 28f00914..dde70adb 100644 --- a/libksirtet/lib/miscui.cpp +++ b/libksirtet/lib/miscui.cpp @@ -1,27 +1,27 @@ #include "miscui.h" #include "miscui.moc" -#include <qlayout.h> +#include <tqlayout.h> #include <klocale.h> //----------------------------------------------------------------------------- MeetingCheckBox::MeetingCheckBox(Type type, bool owner, bool server, - QWidget *parent) - : QWidget(parent, "meeting_check_box") + TQWidget *parent) + : TQWidget(parent, "meeting_check_box") { - QVBoxLayout *vbox = new QVBoxLayout(this); + TQVBoxLayout *vbox = new TQVBoxLayout(this); - _ready = new QCheckBox(i18n("Ready"), this); + _ready = new TQCheckBox(i18n("Ready"), this); vbox->addWidget(_ready); _ready->setEnabled(owner); - connect(_ready, SIGNAL(clicked()), SLOT(changedSlot())); + connect(_ready, TQT_SIGNAL(clicked()), TQT_SLOT(changedSlot())); - _excluded = new QCheckBox(i18n("Excluded"), this); + _excluded = new TQCheckBox(i18n("Excluded"), this); vbox->addWidget(_excluded); _excluded->setEnabled(server); - connect(_excluded, SIGNAL(clicked()), SLOT(changedSlot())); + connect(_excluded, TQT_SIGNAL(clicked()), TQT_SLOT(changedSlot())); setType(type); } @@ -46,13 +46,13 @@ void MeetingCheckBox::changedSlot() //----------------------------------------------------------------------------- PlayerComboBox::PlayerComboBox(Type type, bool canBeEmpty, bool acceptAI, - QWidget *parent) - : QComboBox(parent, "player_combo_box") + TQWidget *parent) + : TQComboBox(parent, "player_combo_box") { insertItem(i18n("Human")); if (acceptAI) insertItem(i18n("AI")); if (canBeEmpty) insertItem(i18n("None")); setCurrentItem(type); - connect(this, SIGNAL(activated(int)), SIGNAL(changed(int))); + connect(this, TQT_SIGNAL(activated(int)), TQT_SIGNAL(changed(int))); } diff --git a/libksirtet/lib/miscui.h b/libksirtet/lib/miscui.h index 7de5dfbc..fb40e0ec 100644 --- a/libksirtet/lib/miscui.h +++ b/libksirtet/lib/miscui.h @@ -1,8 +1,8 @@ #ifndef MISCUI_H #define MISCUI_H -#include <qcombobox.h> -#include <qcheckbox.h> +#include <tqcombobox.h> +#include <tqcheckbox.h> //----------------------------------------------------------------------------- @@ -11,7 +11,7 @@ class MeetingCheckBox : public QWidget Q_OBJECT public: enum Type { Ready, NotReady, Excluded }; - MeetingCheckBox(Type, bool owner, bool server, QWidget *parent); + MeetingCheckBox(Type, bool owner, bool server, TQWidget *parent); void setType(Type); Type type() const; @@ -23,7 +23,7 @@ class MeetingCheckBox : public QWidget void changedSlot(); private: - QCheckBox *_ready, *_excluded; + TQCheckBox *_ready, *_excluded; }; //----------------------------------------------------------------------------- @@ -32,7 +32,7 @@ class PlayerComboBox : public QComboBox Q_OBJECT public: enum Type { Human = 0, AI, None }; - PlayerComboBox(Type, bool canBeNone, bool acceptAI, QWidget *parent); + PlayerComboBox(Type, bool canBeNone, bool acceptAI, TQWidget *parent); Type type() const { return (Type)currentItem(); } diff --git a/libksirtet/lib/mp_board.h b/libksirtet/lib/mp_board.h index fbd1e01f..5e84825c 100644 --- a/libksirtet/lib/mp_board.h +++ b/libksirtet/lib/mp_board.h @@ -1,7 +1,7 @@ #ifndef MP_BOARD_H #define MP_BOARD_H -#include <qwidget.h> +#include <tqwidget.h> /** * The MP_Board class is the base widget from which each individual @@ -12,8 +12,8 @@ class MPBoard : public QWidget Q_OBJECT public: - MPBoard(QWidget *parent, const char *name=0) - : QWidget(parent, name) {} + MPBoard(TQWidget *parent, const char *name=0) + : TQWidget(parent, name) {} virtual ~MPBoard() {} /** @@ -23,7 +23,7 @@ class MPBoard : public QWidget * @param first is TRUE if this board is the first local one. */ virtual void init(bool AI, bool multiplayers, bool server, bool first, - const QString &name) = 0; + const TQString &name) = 0; /** * Put data on the stream. @@ -31,7 +31,7 @@ class MPBoard : public QWidget * This method is the communication way out. The data given here will * be the only information that will go to the server. */ - virtual void dataOut(QDataStream &) = 0; + virtual void dataOut(TQDataStream &) = 0; /** * Get data from the stream. @@ -39,7 +39,7 @@ class MPBoard : public QWidget * This method is the communication way in. The data given here will be * the only information that you will receive from the server. */ - virtual void dataIn(QDataStream &) = 0; + virtual void dataIn(TQDataStream &) = 0; signals: /** diff --git a/libksirtet/lib/mp_interface.cpp b/libksirtet/lib/mp_interface.cpp index 61742562..cfe06cd0 100644 --- a/libksirtet/lib/mp_interface.cpp +++ b/libksirtet/lib/mp_interface.cpp @@ -1,8 +1,8 @@ #include "mp_interface.h" #include "mp_interface.moc" -#include <qpainter.h> -#include <qlayout.h> +#include <tqpainter.h> +#include <tqlayout.h> #include <klocale.h> #include <kmessagebox.h> @@ -21,13 +21,13 @@ /*****************************************************************************/ MPInterface::MPInterface(const MPGameInfo &_gameInfo, uint nbActions, const ActionData *data, - QWidget *parent, const char *name) -: QWidget(parent, name), internal(0), gameInfo(_gameInfo), nbLocalHumans(0) + TQWidget *parent, const char *name) +: TQWidget(parent, name), internal(0), gameInfo(_gameInfo), nbLocalHumans(0) { Q_ASSERT( gameInfo.maxNbLocalPlayers>=1 ); - hbl = new QHBoxLayout(this, 0, 5); - hbl->setResizeMode( QLayout::Fixed ); + hbl = new TQHBoxLayout(this, 0, 5); + hbl->setResizeMode( TQLayout::Fixed ); _keyData = new KeyData(gameInfo.maxNbLocalPlayers, nbActions, data, this); } @@ -57,13 +57,13 @@ void MPInterface::dialog() // configuration wizard ConnectionData cd; MPWizard wiz(gameInfo, cd, this); - if ( wiz.exec()==QDialog::Rejected ) { + if ( wiz.exec()==TQDialog::Rejected ) { singleHuman(); // create a single game return; } // net meeting - QPtrList<RemoteHostData> rhd; + TQPtrList<RemoteHostData> rhd; rhd.setAutoDelete(TRUE); if (cd.network) { cId id(kapp->name(), gameInfo.gameId); @@ -98,13 +98,13 @@ void MPInterface::specialLocalGame(uint nbHumans, uint nbAIs) KConfigGroupSaver cg(kapp->config(), MP_GROUP); for (uint i=0; i<(nbHumans+nbAIs); i++) { bd.type = (i<nbHumans ? PlayerComboBox::Human : PlayerComboBox::AI); - bd.name = QString::null; + bd.name = TQString::null; t = (PlayerComboBox::Type) - cg.config()->readNumEntry(QString(MP_PLAYER_TYPE).arg(i), + cg.config()->readNumEntry(TQString(MP_PLAYER_TYPE).arg(i), PlayerComboBox::None); if ( bd.type==t ) - bd.name = cg.config()->readEntry(QString(MP_PLAYER_NAME).arg(i), - QString::null); + bd.name = cg.config()->readEntry(TQString(MP_PLAYER_NAME).arg(i), + TQString::null); if ( bd.name.isNull() ) bd.name = (i<nbHumans ? i18n("Human %1").arg(i+1) : i18n("AI %1").arg(i-nbHumans+1)); @@ -116,11 +116,11 @@ void MPInterface::specialLocalGame(uint nbHumans, uint nbAIs) Q_ASSERT( gameInfo.AIAllowed || nbAIs==0 ); createLocalGame(cd); - QPtrList<RemoteHostData> rhd; + TQPtrList<RemoteHostData> rhd; createServerGame(rhd); } -void MPInterface::createServerGame(const QPtrList<RemoteHostData> &rhd) +void MPInterface::createServerGame(const TQPtrList<RemoteHostData> &rhd) { internal = (rhd.count() ? (Local *)new NetworkServer(this, boards, rhd, gameInfo.interval) @@ -130,7 +130,7 @@ void MPInterface::createServerGame(const QPtrList<RemoteHostData> &rhd) void MPInterface::createClientGame(const RemoteHostData &rhd) { - QPtrList<RemoteHostData> r; + TQPtrList<RemoteHostData> r; r.append((RemoteHostData *)&rhd); internal = new Client(this, boards, r); init(); @@ -155,7 +155,7 @@ void MPInterface::createLocalGame(const ConnectionData &cd) d.ptr = newBoard(i); hbl->addWidget(d.ptr); d.ptr->show(); - connect(d.ptr, SIGNAL(enableKeys(bool)), SLOT(enableKeys(bool))); + connect(d.ptr, TQT_SIGNAL(enableKeys(bool)), TQT_SLOT(enableKeys(bool))); boards += d; } @@ -204,12 +204,12 @@ void MPInterface::enableKeys(bool enable) _keyData->setEnabled(hi, enable); } -void MPInterface::keyPressEvent(QKeyEvent *e) +void MPInterface::keyPressEvent(TQKeyEvent *e) { _keyData->keyEvent(e, true); } -void MPInterface::keyReleaseEvent(QKeyEvent *e) +void MPInterface::keyReleaseEvent(TQKeyEvent *e) { _keyData->keyEvent(e, false); } @@ -222,24 +222,24 @@ uint MPInterface::nbPlayers() const return internal->nbPlayers(); } -QString MPInterface::playerName(uint i) const +TQString MPInterface::playerName(uint i) const { Q_ASSERT(_server); return internal->playerName(i); } -QDataStream &MPInterface::readingStream(uint i) const +TQDataStream &MPInterface::readingStream(uint i) const { Q_ASSERT(_server); return internal->ioBuffer(i)->reading; } -QDataStream &MPInterface::writingStream(uint i) const +TQDataStream &MPInterface::writingStream(uint i) const { return internal->ioBuffer(i)->writing; } -QDataStream &MPInterface::dataToClientsStream() const +TQDataStream &MPInterface::dataToClientsStream() const { Q_ASSERT(_server); return *internal->globalStream(); @@ -250,14 +250,14 @@ void MPInterface::immediateWrite() internal->writeData(_server); } -void MPInterface::hostDisconnected(uint, const QString &msg) +void MPInterface::hostDisconnected(uint, const TQString &msg) { - errorBox(msg, QString::null, this); + errorBox(msg, TQString::null, this); if ( !disconnected ) { // to avoid multiple calls disconnected = TRUE; // the zero timer is used to be outside the "internal" class - QTimer::singleShot(0, this, SLOT(singleHumanSlot())); + TQTimer::singleShot(0, this, TQT_SLOT(singleHumanSlot())); } } @@ -267,8 +267,8 @@ void MPInterface::singleHumanSlot() singleHuman(); } -void MPInterface::paintEvent(QPaintEvent *e) +void MPInterface::paintEvent(TQPaintEvent *e) { - QPainter p(this); + TQPainter p(this); p.fillRect(e->rect(), darkGray); } diff --git a/libksirtet/lib/mp_interface.h b/libksirtet/lib/mp_interface.h index ad925cba..e52ea9f7 100644 --- a/libksirtet/lib/mp_interface.h +++ b/libksirtet/lib/mp_interface.h @@ -1,9 +1,9 @@ #ifndef MP_INTERFACE_H #define MP_INTERFACE_H -#include <qwidget.h> -#include <qvaluelist.h> -#include <qptrlist.h> +#include <tqwidget.h> +#include <tqvaluelist.h> +#include <tqptrlist.h> #include "mp_board.h" #include "mp_option.h" @@ -82,7 +82,7 @@ class MPInterface : public QWidget */ MPInterface(const MPGameInfo &gameInfo, uint nbActions, const ActionData *data, - QWidget *parent = 0, const char *name = 0); + TQWidget *parent = 0, const char *name = 0); virtual ~MPInterface(); public slots: @@ -135,7 +135,7 @@ class MPInterface : public QWidget /** @return the player name. Do not call from client ! */ - QString playerName(uint i) const; + TQString playerName(uint i) const; /** * Create a new @ref MPBoard. @@ -161,11 +161,11 @@ class MPInterface : public QWidget /** @return the reading stream for board #i. * Do not call from client ! */ - QDataStream &readingStream(uint i) const; + TQDataStream &readingStream(uint i) const; /** @return the writing stream for board #i. */ - QDataStream &writingStream(uint i) const; + TQDataStream &writingStream(uint i) const; /** * Read data sent from server to clients "MultiplayersInterface" @@ -175,13 +175,13 @@ class MPInterface : public QWidget * local games. * NB: the use of this method is optional. */ - virtual void dataFromServer(QDataStream &) {} + virtual void dataFromServer(TQDataStream &) {} /** Used by the server to write meta data to clients. * NB: the use of this method is optional. * Do not call from client ! */ - QDataStream &dataToClientsStream() const; + TQDataStream &dataToClientsStream() const; /** Write immediately data to clients and local boards. * It is unlike the normal exchange which is driven @@ -203,12 +203,12 @@ class MPInterface : public QWidget * ie it stops the current game. By overloading this method, it is * possible to continue the game at this point with the remaining players. */ - virtual void hostDisconnected(uint i, const QString &msg); + virtual void hostDisconnected(uint i, const TQString &msg); protected: - void paintEvent(QPaintEvent *); - void keyPressEvent(QKeyEvent *); - void keyReleaseEvent(QKeyEvent *); + void paintEvent(TQPaintEvent *); + void keyPressEvent(TQKeyEvent *); + void keyReleaseEvent(TQKeyEvent *); private slots: void enableKeys(bool enable); @@ -220,21 +220,21 @@ class MPInterface : public QWidget Data() {} MPBoard *ptr; int humanIndex; - QString name; + TQString name; }; private: Local *internal; const MPGameInfo gameInfo; - QValueList<Data> boards; + TQValueList<Data> boards; uint nbLocalHumans; - QHBoxLayout *hbl; + TQHBoxLayout *hbl; bool _server, disconnected; KeyData *_keyData; - QMemArray<KeyCollection *> _keyCol; + TQMemArray<KeyCollection *> _keyCol; - void createServerGame(const QPtrList<RemoteHostData> &); + void createServerGame(const TQPtrList<RemoteHostData> &); void createClientGame(const RemoteHostData &); void createLocalGame(const ConnectionData &); void specialLocalGame(uint nbHumans, uint nbComputers); diff --git a/libksirtet/lib/mp_option.h b/libksirtet/lib/mp_option.h index 94c59107..2db2eacf 100644 --- a/libksirtet/lib/mp_option.h +++ b/libksirtet/lib/mp_option.h @@ -1,7 +1,7 @@ #ifndef MP_OPTION_H #define MP_OPTION_H -#include <qwidget.h> +#include <tqwidget.h> /** * The OptionWidget is a base widget for the option widget in the @@ -37,8 +37,8 @@ class MPOptionWidget : public QWidget Q_OBJECT public: - MPOptionWidget(bool Server, QWidget *parent = 0, const char *name = 0) - : QWidget(parent, name), server(Server) {} + MPOptionWidget(bool Server, TQWidget *parent = 0, const char *name = 0) + : TQWidget(parent, name), server(Server) {} virtual ~MPOptionWidget() {} bool isServer() const { return server; } @@ -47,10 +47,10 @@ class MPOptionWidget : public QWidget * This method is used on the client side to set the data coming from * the server widget. */ - virtual void dataIn(QDataStream &s) = 0; + virtual void dataIn(TQDataStream &s) = 0; /** This method is used on the server side to get the data. */ - virtual void dataOut(QDataStream &s) const = 0; + virtual void dataOut(TQDataStream &s) const = 0; /** * When the game will begin (ie when the "netmeeting" is over and the diff --git a/libksirtet/lib/mp_simple_board.cpp b/libksirtet/lib/mp_simple_board.cpp index f032c488..c0828f1e 100644 --- a/libksirtet/lib/mp_simple_board.cpp +++ b/libksirtet/lib/mp_simple_board.cpp @@ -3,13 +3,13 @@ void MPSimpleBoard::init(bool AI, bool multiplayers, bool server, bool first, - const QString &name) + const TQString &name) { state = BS_Init; _init(AI, multiplayers, server, first, name); } -void MPSimpleBoard::dataIn(QDataStream &s) +void MPSimpleBoard::dataIn(TQDataStream &s) { if ( s.atEnd() ) return; // no data @@ -24,14 +24,14 @@ void MPSimpleBoard::dataIn(QDataStream &s) } } -void MPSimpleBoard::initFlag(QDataStream &s) +void MPSimpleBoard::initFlag(TQDataStream &s) { state = BS_Play; emit enableKeys(true); _initFlag(s); } -void MPSimpleBoard::playFlag(QDataStream &s) +void MPSimpleBoard::playFlag(TQDataStream &s) { Q_ASSERT( state==BS_Play ); _playFlag(s); @@ -66,7 +66,7 @@ void MPSimpleBoard::_stop(bool gameover) _stopFlag(gameover); } -void MPSimpleBoard::dataOut(QDataStream &s) +void MPSimpleBoard::dataOut(TQDataStream &s) { switch (state) { case BS_Init: diff --git a/libksirtet/lib/mp_simple_board.h b/libksirtet/lib/mp_simple_board.h index 2131feb2..d9a681f7 100644 --- a/libksirtet/lib/mp_simple_board.h +++ b/libksirtet/lib/mp_simple_board.h @@ -11,31 +11,31 @@ class KDE_EXPORT MPSimpleBoard : public MPBoard Q_OBJECT public: - MPSimpleBoard(QWidget *parent = 0, const char *name = 0) + MPSimpleBoard(TQWidget *parent = 0, const char *name = 0) : MPBoard(parent, name) {} virtual ~MPSimpleBoard() {} void init(bool AI, bool multiplayers, bool server, bool first, - const QString &name); - void dataOut(QDataStream &s); - void dataIn(QDataStream &s); + const TQString &name); + void dataOut(TQDataStream &s); + void dataIn(TQDataStream &s); protected: virtual void _init(bool AI, bool multiplayers, bool server, bool first, - const QString &name) = 0; - virtual void _initFlag(QDataStream &s) = 0; - virtual void _playFlag(QDataStream &s) = 0; + const TQString &name) = 0; + virtual void _initFlag(TQDataStream &s) = 0; + virtual void _playFlag(TQDataStream &s) = 0; virtual void _pauseFlag(bool pause) = 0; virtual void _stopFlag(bool gameover) = 0; - virtual void _dataOut(QDataStream &s) = 0; - virtual void _gameOverDataOut(QDataStream &s) = 0; - virtual void _initDataOut(QDataStream &s) = 0; + virtual void _dataOut(TQDataStream &s) = 0; + virtual void _gameOverDataOut(TQDataStream &s) = 0; + virtual void _initDataOut(TQDataStream &s) = 0; private: BoardState state; - void initFlag(QDataStream &s); - void playFlag(QDataStream &s); + void initFlag(TQDataStream &s); + void playFlag(TQDataStream &s); void pauseFlag(); void stopFlag(); void gameOverFlag(); diff --git a/libksirtet/lib/mp_simple_interface.cpp b/libksirtet/lib/mp_simple_interface.cpp index e75243a6..1b83be40 100644 --- a/libksirtet/lib/mp_simple_interface.cpp +++ b/libksirtet/lib/mp_simple_interface.cpp @@ -2,7 +2,7 @@ #include "mp_simple_interface.moc" #include <kmessagebox.h> -#include <qtimer.h> +#include <tqtimer.h> #include <klocale.h> #include <kaction.h> #include <kmainwindow.h> @@ -13,7 +13,7 @@ MPSimpleInterface::MPSimpleInterface(const MPGameInfo &gi, uint nbActions, const ActionData *data, - QWidget *parent, const char *name) + TQWidget *parent, const char *name) : MPInterface(gi, nbActions, data, parent, name), state(SS_Standby) {} @@ -64,7 +64,7 @@ void MPSimpleInterface::pause() } } -void MPSimpleInterface::dataFromServer(QDataStream &s) +void MPSimpleInterface::dataFromServer(TQDataStream &s) { if ( s.atEnd() ) return; // no data @@ -73,7 +73,7 @@ void MPSimpleInterface::dataFromServer(QDataStream &s) switch (scf.value()) { case SC_Flag::Stop: KMessageBox::information(this, i18n("Server has left game!")); - QTimer::singleShot(0, this, SLOT(singleHuman())); + TQTimer::singleShot(0, this, TQT_SLOT(singleHuman())); return; case SC_Flag::GameOver: _readGameOverData(s); @@ -141,7 +141,7 @@ void MPSimpleInterface::treatStop() state = SS_Standby; // read game over data + send them to all clients - QDataStream &s = dataToClientsStream(); + TQDataStream &s = dataToClientsStream(); SC_Flag f(SC_Flag::GameOver); s << f; _sendGameOverData(s); diff --git a/libksirtet/lib/mp_simple_interface.h b/libksirtet/lib/mp_simple_interface.h index 84e6f444..d366dafd 100644 --- a/libksirtet/lib/mp_simple_interface.h +++ b/libksirtet/lib/mp_simple_interface.h @@ -11,7 +11,7 @@ class MPSimpleInterface : public MPInterface public: MPSimpleInterface(const MPGameInfo &gi, uint nbActions, const ActionData *data, - QWidget *parent = 0, const char *name = 0); + TQWidget *parent = 0, const char *name = 0); bool isPaused() const { return state==SS_Pause; } @@ -22,8 +22,8 @@ class MPSimpleInterface : public MPInterface protected: virtual void _init() = 0; - virtual void _readGameOverData(QDataStream &s) = 0; - virtual void _sendGameOverData(QDataStream &s) = 0; + virtual void _readGameOverData(TQDataStream &s) = 0; + virtual void _sendGameOverData(TQDataStream &s) = 0; virtual void _showGameOverData() = 0; virtual void _firstInit() = 0; virtual void _treatInit() = 0; @@ -42,7 +42,7 @@ class MPSimpleInterface : public MPInterface void init(); void stop(); - void dataFromServer(QDataStream &); + void dataFromServer(TQDataStream &); }; #endif // MP_SIMPLE_INTERFACE_H diff --git a/libksirtet/lib/mp_simple_types.cpp b/libksirtet/lib/mp_simple_types.cpp index a470ce7c..c2a9dc27 100644 --- a/libksirtet/lib/mp_simple_types.cpp +++ b/libksirtet/lib/mp_simple_types.cpp @@ -1,6 +1,6 @@ #include "mp_simple_types.h" -QDataStream &operator <<(QDataStream &s, const EnumClass &ec) +TQDataStream &operator <<(TQDataStream &s, const EnumClass &ec) { s << (Q_UINT8)ec.f; return s; } -QDataStream &operator >>(QDataStream &s, EnumClass &ec) +TQDataStream &operator >>(TQDataStream &s, EnumClass &ec) { Q_UINT8 t; s >> t; ec.f = (int)t; return s; } diff --git a/libksirtet/lib/mp_simple_types.h b/libksirtet/lib/mp_simple_types.h index 2fd0c289..248d3fee 100644 --- a/libksirtet/lib/mp_simple_types.h +++ b/libksirtet/lib/mp_simple_types.h @@ -1,7 +1,7 @@ #ifndef WF_TYPES_H #define WF_TYPES_H -#include <qdatastream.h> +#include <tqdatastream.h> class EnumClass { @@ -9,8 +9,8 @@ class EnumClass EnumClass(int _f) : f(_f) {} int f; }; -QDataStream &operator <<(QDataStream &s, const EnumClass &f); -QDataStream &operator >>(QDataStream &s, EnumClass &f); +TQDataStream &operator <<(TQDataStream &s, const EnumClass &f); +TQDataStream &operator >>(TQDataStream &s, EnumClass &f); class IO_Flag : public EnumClass { diff --git a/libksirtet/lib/pline.cpp b/libksirtet/lib/pline.cpp index 41faf6ac..86fde398 100644 --- a/libksirtet/lib/pline.cpp +++ b/libksirtet/lib/pline.cpp @@ -1,36 +1,36 @@ #include "pline.h" #include "pline.moc" -#include <qfont.h> -#include <qpushbutton.h> +#include <tqfont.h> +#include <tqpushbutton.h> #include <klocale.h> #include "defines.h" #define THIN_BORDER 4 MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine, - QWidget *parent, const char *name) -: QFrame(parent, name) + TQWidget *parent, const char *name) +: TQFrame(parent, name) { setFrameStyle(Panel | (serverLine ? Raised : Plain)); // Top layout - hbl = new QHBoxLayout(this, THIN_BORDER + frameWidth()); + hbl = new TQHBoxLayout(this, THIN_BORDER + frameWidth()); /* TriCheckBox */ tcb = new MeetingCheckBox(MeetingCheckBox::Ready, isOwner, serverIsReader, this); if ( !XOR(isOwner, serverIsReader) ) tcb->setEnabled(FALSE); - else connect(tcb, SIGNAL(changed(int)), SLOT(_typeChanged(int))); + else connect(tcb, TQT_SIGNAL(changed(int)), TQT_SLOT(_typeChanged(int))); hbl->addWidget(tcb); /* Name */ - lname = new QLabel(" ", this); + lname = new TQLabel(" ", this); lname->setAlignment(AlignCenter); - lname->setFrameStyle(QFrame::Panel | QFrame::Sunken); + lname->setFrameStyle(TQFrame::Panel | TQFrame::Sunken); lname->setLineWidth(2); lname->setMidLineWidth(3); - QFont f = lname->font(); + TQFont f = lname->font(); f.setBold(TRUE); lname->setFont(f); lname->setFixedSize(lname->fontMetrics().maxWidth()*NAME_MAX_LENGTH, @@ -39,21 +39,21 @@ MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine, hbl->addStretch(1); // Nb humans - labH = new QLabel(this); + labH = new TQLabel(this); hbl->addWidget(labH); // Nb AIs - labAI = new QLabel(this); + labAI = new TQLabel(this); hbl->addWidget(labAI); // talker - qle = new QLineEdit(this); + qle = new TQLineEdit(this); qle->setMaxLength(TALKER_MAX_LENGTH); - qle->setFont( QFont("fixed", 12, QFont::Bold) ); + qle->setFont( TQFont("fixed", 12, TQFont::Bold) ); qle->setFixedSize(qle->fontMetrics().maxWidth()*TALKER_MAX_LENGTH, qle->sizeHint().height()); - connect(qle, SIGNAL(textChanged(const QString &)), - SLOT(_textChanged(const QString &))); + connect(qle, TQT_SIGNAL(textChanged(const TQString &)), + TQT_SLOT(_textChanged(const TQString &))); qle->setEnabled(isOwner); hbl->addWidget(qle); } @@ -81,33 +81,33 @@ void MeetingLine::data(ExtData &ed) const } /*****************************************************************************/ -PlayerLine::PlayerLine(PlayerComboBox::Type type, const QString &txt, +PlayerLine::PlayerLine(PlayerComboBox::Type type, const TQString &txt, bool humanSetting, bool AISetting, bool canBeEmpty, bool acceptAI, - QWidget *parent, const char *name) -: QFrame(parent, name), hs(humanSetting), as(AISetting) + TQWidget *parent, const char *name) +: TQFrame(parent, name), hs(humanSetting), as(AISetting) { setFrameStyle(Panel | Raised); // Top layout - QHBoxLayout *hbl; - hbl = new QHBoxLayout(this, THIN_BORDER + frameWidth()); + TQHBoxLayout *hbl; + hbl = new TQHBoxLayout(this, THIN_BORDER + frameWidth()); /* CheckBox */ pcb = new PlayerComboBox(type, canBeEmpty, acceptAI, this); - connect(pcb, SIGNAL(changed(int)), SLOT(typeChangedSlot(int))); + connect(pcb, TQT_SIGNAL(changed(int)), TQT_SLOT(typeChangedSlot(int))); hbl->addWidget(pcb); /* Name */ - edit = new QLineEdit(txt, this); + edit = new TQLineEdit(txt, this); edit->setMaxLength(NAME_MAX_LENGTH); edit->setFixedSize(edit->fontMetrics().maxWidth()*(NAME_MAX_LENGTH+2), edit->sizeHint().height()); hbl->addWidget(edit); /* settings button */ - setting = new QPushButton(i18n("Settings"), this); - connect(setting, SIGNAL(clicked()), SLOT(setSlot())); + setting = new TQPushButton(i18n("Settings"), this); + connect(setting, TQT_SIGNAL(clicked()), TQT_SLOT(setSlot())); hbl->addWidget(setting); typeChangedSlot(type); @@ -128,13 +128,13 @@ void PlayerLine::setSlot() } /*****************************************************************************/ -GWidgetList::GWidgetList(uint interval, QWidget *parent, const char * name) - : QWidget(parent, name), vbl(this, interval) +GWidgetList::GWidgetList(uint interval, TQWidget *parent, const char * name) + : TQWidget(parent, name), vbl(this, interval) { widgets.setAutoDelete(TRUE); } -void GWidgetList::append(QWidget *wi) +void GWidgetList::append(TQWidget *wi) { vbl.addWidget(wi); wi->show(); diff --git a/libksirtet/lib/pline.h b/libksirtet/lib/pline.h index 2defd10a..7d6e97e7 100644 --- a/libksirtet/lib/pline.h +++ b/libksirtet/lib/pline.h @@ -1,12 +1,12 @@ #ifndef PLINE_H #define PLINE_H -#include <qframe.h> -#include <qscrollbar.h> -#include <qlineedit.h> -#include <qlabel.h> -#include <qptrlist.h> -#include <qlayout.h> +#include <tqframe.h> +#include <tqscrollbar.h> +#include <tqlineedit.h> +#include <tqlabel.h> +#include <tqptrlist.h> +#include <tqlayout.h> #include "types.h" @@ -19,33 +19,33 @@ class MeetingLine : public QFrame public: MeetingLine(bool isOwner, bool readerIsServer, bool serverLine, - QWidget *parent, const char *name = 0); + TQWidget *parent, const char *name = 0); MeetingCheckBox::Type type() const { return tcb->type(); } void setType(MeetingCheckBox::Type type) { tcb->setType(type); } - void setText(const QString &text) { qle->setText(text); } + void setText(const TQString &text) { qle->setText(text); } void setData(const ExtData &ed); void data(ExtData &ed) const; - QString text() const { return qle->text(); } + TQString text() const { return qle->text(); } signals: void typeChanged(MeetingCheckBox::Type); - void textChanged(const QString &); + void textChanged(const TQString &); private slots: void _typeChanged(int t) { emit typeChanged((MeetingCheckBox::Type)t); } - void _textChanged(const QString &text) { emit textChanged(text); } + void _textChanged(const TQString &text) { emit textChanged(text); } protected: - QHBoxLayout *hbl; + TQHBoxLayout *hbl; private: MeetingCheckBox *tcb; - QLabel *lname, *labH, *labAI; - QValueList<BoardData> bds; - QLineEdit *qle; + TQLabel *lname, *labH, *labAI; + TQValueList<BoardData> bds; + TQLineEdit *qle; }; class PlayerLine : public QFrame @@ -53,13 +53,13 @@ class PlayerLine : public QFrame Q_OBJECT public: - PlayerLine(PlayerComboBox::Type type, const QString &txt, + PlayerLine(PlayerComboBox::Type type, const TQString &txt, bool humanSetting, bool AISetting, bool canBeEmpty, bool acceptAI, - QWidget *parent = 0, const char *name = 0); + TQWidget *parent = 0, const char *name = 0); PlayerComboBox::Type type() const { return pcb->type(); } - QString name() const { return edit->text(); } + TQString name() const { return edit->text(); } signals: void setHuman(); @@ -72,8 +72,8 @@ class PlayerLine : public QFrame private: PlayerComboBox *pcb; - QLineEdit *edit; - QPushButton *setting; + TQLineEdit *edit; + TQPushButton *setting; bool hs, as; }; @@ -83,26 +83,26 @@ class GWidgetList : public QWidget Q_OBJECT public: - GWidgetList(uint interval, QWidget *parent = 0, const char * name = 0); + GWidgetList(uint interval, TQWidget *parent = 0, const char * name = 0); void remove(uint i); uint size() const { return widgets.count(); } protected: /** The widget must be created with this widget as parent. */ - void append(QWidget *); - QWidget *widget(uint i) { return widgets.at(i); } + void append(TQWidget *); + TQWidget *widget(uint i) { return widgets.at(i); } private: - QPtrList<QWidget> widgets; - QVBoxLayout vbl; + TQPtrList<TQWidget> widgets; + TQVBoxLayout vbl; }; template <class Type> class WidgetList : public GWidgetList { public: - WidgetList(uint interval, QWidget *parent=0, const char *name=0) + WidgetList(uint interval, TQWidget *parent=0, const char *name=0) : GWidgetList(interval, parent, name) {} void append(Type *w) { GWidgetList::append(w); } diff --git a/libksirtet/lib/smanager.h b/libksirtet/lib/smanager.h index a831b702..59dd0edb 100644 --- a/libksirtet/lib/smanager.h +++ b/libksirtet/lib/smanager.h @@ -75,7 +75,7 @@ class SocketManager bool dataPending(uint i); private: - QMemArray<Socket *> sockets; + TQMemArray<Socket *> sockets; fd_set read_set, write_set, read_tmp, write_tmp; struct timeval tv; diff --git a/libksirtet/lib/socket.cpp b/libksirtet/lib/socket.cpp index 9ef3ba3c..6defc94b 100644 --- a/libksirtet/lib/socket.cpp +++ b/libksirtet/lib/socket.cpp @@ -21,12 +21,12 @@ #endif Socket::Socket(KExtendedSocket *s, bool createNotifier, - QObject *parent, const char *name) + TQObject *parent, const char *name) : _socket(s), _notifier(0) { Q_ASSERT(s); if (createNotifier) { - _notifier = new QSocketNotifier(s->fd(), QSocketNotifier::Read, + _notifier = new TQSocketNotifier(s->fd(), TQSocketNotifier::Read, parent, name); _notifier->setEnabled(FALSE); } @@ -38,7 +38,7 @@ Socket::~Socket() delete _socket; } -bool Socket::write(const QByteArray &a) +bool Socket::write(const TQByteArray &a) { return ( _socket->writeBlock(a.data(), a.size())==(int)a.size() ); } diff --git a/libksirtet/lib/socket.h b/libksirtet/lib/socket.h index a2f47a63..01dac726 100644 --- a/libksirtet/lib/socket.h +++ b/libksirtet/lib/socket.h @@ -1,7 +1,7 @@ #ifndef SOCKET_H #define SOCKET_H -#include <qsocketnotifier.h> +#include <tqsocketnotifier.h> #include <kextsock.h> @@ -12,7 +12,7 @@ class Socket { public: Socket(KExtendedSocket *, bool createNotifier = FALSE, - QObject *parent = 0, const char *name = 0); + TQObject *parent = 0, const char *name = 0); /** close the socket */ ~Socket(); @@ -28,7 +28,7 @@ class Socket * @return the socket notifier associated with the socket * (0 if none). */ - QSocketNotifier *notifier() const { return _notifier; } + TQSocketNotifier *notifier() const { return _notifier; } /** * Write data contained in the writing stream to the socket. @@ -36,9 +36,9 @@ class Socket * @return TRUE if all was written without error. */ bool write(); - bool write(const QByteArray &a); + bool write(const TQByteArray &a); - /** @return the QDataStream for writing. */ + /** @return the TQDataStream for writing. */ WritingStream &writingStream() { return writing; } /** @return the size of pending data. */ @@ -56,7 +56,7 @@ class Socket private: KExtendedSocket *_socket; - QSocketNotifier *_notifier; + TQSocketNotifier *_notifier; WritingStream writing; ReadingStream reading; diff --git a/libksirtet/lib/types.cpp b/libksirtet/lib/types.cpp index 557fffff..ad3dbc9b 100644 --- a/libksirtet/lib/types.cpp +++ b/libksirtet/lib/types.cpp @@ -3,7 +3,7 @@ #include <klocale.h> #include "version.h" -cId::cId(const QString &_gameName, const QString &_gameId) +cId::cId(const TQString &_gameName, const TQString &_gameId) : libId(MULTI_ID), gameName(_gameName), gameId(_gameId) {} @@ -15,12 +15,12 @@ void cId::check(const cId &id) else state = Accepted; } -QString cId::errorMessage(const cId &id) const +TQString cId::errorMessage(const cId &id) const { - QString str = i18n("\nServer: \"%1\"\nClient: \"%2\""); + TQString str = i18n("\nServer: \"%1\"\nClient: \"%2\""); switch (state) { - case Accepted: return QString::null; + case Accepted: return TQString::null; case LibIdClash: return i18n("The MultiPlayer library of the server is incompatible") + str.arg(libId).arg(id.libId); @@ -32,16 +32,16 @@ QString cId::errorMessage(const cId &id) const + str.arg(gameId).arg(id.gameId); } Q_ASSERT(0); - return QString::null; + return TQString::null; } -QDataStream &operator << (QDataStream &s, const cId &id) +TQDataStream &operator << (TQDataStream &s, const cId &id) { s << id.libId << id.gameName << id.gameId << (Q_UINT8)id.state; return s; } -QDataStream &operator >> (QDataStream &s, cId &id) +TQDataStream &operator >> (TQDataStream &s, cId &id) { Q_UINT8 state; s >> id.libId >> id.gameName >> id.gameId >> state; @@ -50,13 +50,13 @@ QDataStream &operator >> (QDataStream &s, cId &id) } //----------------------------------------------------------------------------- -QDataStream &operator << (QDataStream &s, const MeetingMsgFlag &f) +TQDataStream &operator << (TQDataStream &s, const MeetingMsgFlag &f) { s << (Q_UINT8)f; return s; } -QDataStream &operator >> (QDataStream &s, MeetingMsgFlag &f) +TQDataStream &operator >> (TQDataStream &s, MeetingMsgFlag &f) { Q_UINT8 i; s >> i; f = (MeetingMsgFlag)i; @@ -64,13 +64,13 @@ QDataStream &operator >> (QDataStream &s, MeetingMsgFlag &f) } //----------------------------------------------------------------------------- -QDataStream &operator << (QDataStream &s, const TextInfo &ti) +TQDataStream &operator << (TQDataStream &s, const TextInfo &ti) { s << (Q_UINT32)ti.i << ti.text; return s; } -QDataStream &operator >> (QDataStream &s, TextInfo &ti) +TQDataStream &operator >> (TQDataStream &s, TextInfo &ti) { Q_UINT32 i; s >> i >> ti.text; ti.i = i; @@ -78,13 +78,13 @@ QDataStream &operator >> (QDataStream &s, TextInfo &ti) } //----------------------------------------------------------------------------- -QDataStream &operator << (QDataStream &s, const MeetingCheckBox::Type &t) +TQDataStream &operator << (TQDataStream &s, const MeetingCheckBox::Type &t) { s << (Q_UINT8)t; return s; } -QDataStream &operator >> (QDataStream &s, MeetingCheckBox::Type &t) +TQDataStream &operator >> (TQDataStream &s, MeetingCheckBox::Type &t) { Q_UINT8 i; s >> i; t = (MeetingCheckBox::Type)i; @@ -92,13 +92,13 @@ QDataStream &operator >> (QDataStream &s, MeetingCheckBox::Type &t) } //----------------------------------------------------------------------------- -QDataStream &operator << (QDataStream &s, const TypeInfo &ti) +TQDataStream &operator << (TQDataStream &s, const TypeInfo &ti) { s << (Q_UINT32)ti.i << ti.type; return s; } -QDataStream &operator >> (QDataStream &s, TypeInfo &ti) +TQDataStream &operator >> (TQDataStream &s, TypeInfo &ti) { Q_UINT32 i; s >> i >> ti.type; ti.i = i; @@ -106,13 +106,13 @@ QDataStream &operator >> (QDataStream &s, TypeInfo &ti) } //----------------------------------------------------------------------------- -QDataStream &operator << (QDataStream &s, const BoardData &bd) +TQDataStream &operator << (TQDataStream &s, const BoardData &bd) { s << (Q_UINT8)bd.type << bd.name; return s; } -QDataStream &operator >> (QDataStream &s, BoardData &bd) +TQDataStream &operator >> (TQDataStream &s, BoardData &bd) { Q_UINT8 i; s >> i >> bd.name; @@ -121,26 +121,26 @@ QDataStream &operator >> (QDataStream &s, BoardData &bd) } //----------------------------------------------------------------------------- -QDataStream &operator << (QDataStream &s, const ExtData &ed) +TQDataStream &operator << (TQDataStream &s, const ExtData &ed) { s << ed.bds << ed.text << ed.type; return s; } -QDataStream &operator >> (QDataStream &s, ExtData &ed) +TQDataStream &operator >> (TQDataStream &s, ExtData &ed) { s >> ed.bds >> ed.text >> ed.type; return s; } //----------------------------------------------------------------------------- -QDataStream &operator << (QDataStream &s, const MeetingLineData &pld) +TQDataStream &operator << (TQDataStream &s, const MeetingLineData &pld) { s << pld.ed << (Q_UINT8)pld.own; return s; } -QDataStream &operator >> (QDataStream &s, MeetingLineData &pld) +TQDataStream &operator >> (TQDataStream &s, MeetingLineData &pld) { Q_UINT8 b; s >> pld.ed >> b; pld.own = b; @@ -148,13 +148,13 @@ QDataStream &operator >> (QDataStream &s, MeetingLineData &pld) } //----------------------------------------------------------------------------- -QDataStream &operator << (QDataStream &s, const MetaFlag &f) +TQDataStream &operator << (TQDataStream &s, const MetaFlag &f) { s << (Q_UINT8)f; return s; } -QDataStream &operator >> (QDataStream &s, MetaFlag &f) +TQDataStream &operator >> (TQDataStream &s, MetaFlag &f) { Q_UINT8 i; s >> i; f = (MetaFlag)i; @@ -177,7 +177,7 @@ void Stream::clear() buf.open(mode | IO_Truncate); } -void Stream::setArray(QByteArray a) +void Stream::setArray(TQByteArray a) { buf.close(); buf.setBuffer(a); @@ -194,7 +194,7 @@ void ReadingStream::clearRead() int i = buf.at(); if ( i==0 ) return; buf.close(); - QByteArray a; + TQByteArray a; a.duplicate(buffer().data() + i, size() - i); buf.setBuffer(a); buf.open(IO_ReadOnly); @@ -205,7 +205,7 @@ void IOBuffer::writingToReading() { // this should do the trick :) reading.setArray(writing.buffer()); - QByteArray a; + TQByteArray a; writing.setArray(a); } @@ -228,7 +228,7 @@ void BufferArray::resize(uint nb) for (uint i=s; i<nb; i++) a[i] = new IOBuffer; } -QDataStream &operator <<(QDataStream &s, const BufferArray &b) +TQDataStream &operator <<(TQDataStream &s, const BufferArray &b) { for (uint i=0; i<b.size(); i++) { s.writeBytes(b[i]->writing.buffer().data(), b[i]->writing.size()); @@ -238,13 +238,13 @@ QDataStream &operator <<(QDataStream &s, const BufferArray &b) return s; } -QDataStream &operator >>(QDataStream &s, BufferArray &b) +TQDataStream &operator >>(TQDataStream &s, BufferArray &b) { uint size; char *c; for (uint i=0; i<b.size(); i++) { s.readBytes(c, size); - QByteArray a; + TQByteArray a; a.assign(c, size); b[i]->reading.setArray(a); // debug("BUFFERARRAY : >> (i=%i c=%i size=%i s=%i)", diff --git a/libksirtet/lib/types.h b/libksirtet/lib/types.h index 2ccdcba0..ee5867fa 100644 --- a/libksirtet/lib/types.h +++ b/libksirtet/lib/types.h @@ -1,9 +1,9 @@ #ifndef MTYPES_H #define MTYPES_H -#include <qstring.h> -#include <qbuffer.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqbuffer.h> +#include <tqvaluelist.h> #include "miscui.h" @@ -13,28 +13,28 @@ class cId { public: cId() {} - cId(const QString &gameName, const QString &gameId); + cId(const TQString &gameName, const TQString &gameId); enum State { Accepted, LibIdClash, GameNameClash, GameIdClash }; void check(const cId &id); bool accepted() const { return state==Accepted; } - QString errorMessage(const cId &id) const; + TQString errorMessage(const cId &id) const; - friend QDataStream &operator << (QDataStream &s, const cId &id); - friend QDataStream &operator >> (QDataStream &s, cId &id); + friend TQDataStream &operator << (TQDataStream &s, const cId &id); + friend TQDataStream &operator >> (TQDataStream &s, cId &id); private: - QString libId, gameName, gameId; + TQString libId, gameName, gameId; State state; }; -QDataStream &operator << (QDataStream &s, const cId &id); -QDataStream &operator >> (QDataStream &s, cId &id); +TQDataStream &operator << (TQDataStream &s, const cId &id); +TQDataStream &operator >> (TQDataStream &s, cId &id); /** Flags used for the netmeeting. */ enum MeetingMsgFlag { IdFlag = 0, EndFlag, NewFlag, DelFlag, Mod_TextFlag, Mod_TypeFlag, Mod_OptFlag, PlayFlag }; -QDataStream &operator << (QDataStream &s, const MeetingMsgFlag &f); -QDataStream &operator >> (QDataStream &s, MeetingMsgFlag &f); +TQDataStream &operator << (TQDataStream &s, const MeetingMsgFlag &f); +TQDataStream &operator >> (TQDataStream &s, MeetingMsgFlag &f); /** Internal class : used in netmeeting to transport text line. */ class TextInfo @@ -43,20 +43,20 @@ class TextInfo TextInfo() {} uint i; - QString text; + TQString text; }; -QDataStream &operator << (QDataStream &s, const TextInfo &ti); -QDataStream &operator >> (QDataStream &s, TextInfo &ti); +TQDataStream &operator << (TQDataStream &s, const TextInfo &ti); +TQDataStream &operator >> (TQDataStream &s, TextInfo &ti); /** Internal class : used in netmeeting to transport readiness status. */ typedef struct { uint i; MeetingCheckBox::Type type; } TypeInfo; -QDataStream &operator << (QDataStream &s, const MeetingCheckBox::Type &t); -QDataStream &operator >> (QDataStream &s, MeetingCheckBox::Type &t); -QDataStream &operator << (QDataStream &s, const TypeInfo &ti); -QDataStream &operator >> (QDataStream &s, TypeInfo &ti); +TQDataStream &operator << (TQDataStream &s, const MeetingCheckBox::Type &t); +TQDataStream &operator >> (TQDataStream &s, MeetingCheckBox::Type &t); +TQDataStream &operator << (TQDataStream &s, const TypeInfo &ti); +TQDataStream &operator >> (TQDataStream &s, TypeInfo &ti); /* Internal class : store game data. */ class BoardData @@ -64,27 +64,27 @@ class BoardData public: BoardData() {} - QString name; + TQString name; PlayerComboBox::Type type; }; -QDataStream &operator <<(QDataStream &, const BoardData &); -QDataStream &operator >>(QDataStream &, BoardData &); +TQDataStream &operator <<(TQDataStream &, const BoardData &); +TQDataStream &operator >>(TQDataStream &, BoardData &); /* Internal class : store extended game data (used in netmeeting). */ class ExtData { public: ExtData() {} - ExtData(const QValueList<BoardData> &_bds, const QString &_text, + ExtData(const TQValueList<BoardData> &_bds, const TQString &_text, MeetingCheckBox::Type _type) : bds(_bds), text(_text), type(_type) {} - QValueList<BoardData> bds; - QString text; + TQValueList<BoardData> bds; + TQString text; MeetingCheckBox::Type type; }; -QDataStream &operator << (QDataStream &s, const ExtData &ed); -QDataStream &operator >> (QDataStream &s, ExtData &ed); +TQDataStream &operator << (TQDataStream &s, const ExtData &ed); +TQDataStream &operator >> (TQDataStream &s, ExtData &ed); /* Internal class : store meeting line data (in netmeeting). */ class MeetingLineData @@ -95,8 +95,8 @@ class MeetingLineData ExtData ed; bool own; }; -QDataStream &operator << (QDataStream &s, const MeetingLineData &pld); -QDataStream &operator >> (QDataStream &s, MeetingLineData &pld); +TQDataStream &operator << (TQDataStream &s, const MeetingLineData &pld); +TQDataStream &operator >> (TQDataStream &s, MeetingLineData &pld); /* Internal class : store remote host data. */ class Socket; @@ -107,7 +107,7 @@ class RemoteHostData RemoteHostData() : socket(0) {} Socket *socket; - QValueList<BoardData> bds; + TQValueList<BoardData> bds; }; /* Internal class : store connection data (used by config. wizard). */ @@ -122,36 +122,36 @@ class ConnectionData /** Flags used for network communication. */ enum MetaFlag { MF_Ask = 0, MF_Data }; -QDataStream &operator << (QDataStream &s, const MetaFlag &f); -QDataStream &operator >> (QDataStream &s, MetaFlag &f); +TQDataStream &operator << (TQDataStream &s, const MetaFlag &f); +TQDataStream &operator >> (TQDataStream &s, MetaFlag &f); -/** Internal class : encapsulate read/write QBuffer. */ +/** Internal class : encapsulate read/write TQBuffer. */ class Stream : public QDataStream { public: Stream(int mode); void clear(); - void setArray(QByteArray a); + void setArray(TQByteArray a); - QByteArray buffer() const { return buf.buffer(); } + TQByteArray buffer() const { return buf.buffer(); } uint size() const { return buf.buffer().size(); } protected: - QBuffer buf; + TQBuffer buf; private: int mode; }; -/** Internal class : encapsulate write QBuffer. */ +/** Internal class : encapsulate write TQBuffer. */ class WritingStream : public Stream { public: WritingStream() : Stream(IO_WriteOnly) {} }; -/** Internal class : encapsulate read QBuffer. */ +/** Internal class : encapsulate read TQBuffer. */ class ReadingStream : public Stream { public: @@ -187,11 +187,11 @@ class BufferArray IOBuffer *operator [](uint i) const { return a[i]; } private: - QMemArray<IOBuffer *> a; + TQMemArray<IOBuffer *> a; void clear(uint nb); }; -QDataStream &operator <<(QDataStream &s, const BufferArray &b); -QDataStream &operator >>(QDataStream &s, BufferArray &b); +TQDataStream &operator <<(TQDataStream &s, const BufferArray &b); +TQDataStream &operator >>(TQDataStream &s, BufferArray &b); #endif // MTYPES_H diff --git a/libksirtet/lib/wizard.cpp b/libksirtet/lib/wizard.cpp index 30d5a89d..19d9de34 100644 --- a/libksirtet/lib/wizard.cpp +++ b/libksirtet/lib/wizard.cpp @@ -4,14 +4,14 @@ #include <sys/types.h> #include <netinet/in.h> -#include <qvbuttongroup.h> -#include <qradiobutton.h> -#include <qhbox.h> -#include <qvbox.h> -#include <qsignalmapper.h> -#include <qvgroupbox.h> -#include <qgrid.h> -#include <qfile.h> +#include <tqvbuttongroup.h> +#include <tqradiobutton.h> +#include <tqhbox.h> +#include <tqvbox.h> +#include <tqsignalmapper.h> +#include <tqvgroupbox.h> +#include <tqgrid.h> +#include <tqfile.h> #include <kapplication.h> #include <klocale.h> @@ -32,7 +32,7 @@ #define MAX_USER_PORT 65535 MPWizard::MPWizard(const MPGameInfo &gi, ConnectionData &_cd, - QWidget *parent, const char *name) + TQWidget *parent, const char *name) : KWizard(parent, name, TRUE), cd(_cd) { // setupTypePage(); // #### REMOVE NETWORK GAMES UNTIL FIXED @@ -45,26 +45,26 @@ void MPWizard::setupTypePage() { KConfigGroupSaver cg(kapp->config(), MP_GROUP); - typePage = new QVBox(this); + typePage = new TQVBox(this); typePage->setMargin(KDialogBase::marginHint()); - QVButtonGroup *vbg = new QVButtonGroup(typePage); - connect(vbg, SIGNAL(clicked(int)), SLOT(typeChanged(int))); - QRadioButton *b; - b = new QRadioButton(i18n("Create a local game"), vbg); - b = new QRadioButton(i18n("Create a network game"), vbg); - b = new QRadioButton(i18n("Join a network game"), vbg); + TQVButtonGroup *vbg = new TQVButtonGroup(typePage); + connect(vbg, TQT_SIGNAL(clicked(int)), TQT_SLOT(typeChanged(int))); + TQRadioButton *b; + b = new TQRadioButton(i18n("Create a local game"), vbg); + b = new TQRadioButton(i18n("Create a network game"), vbg); + b = new TQRadioButton(i18n("Join a network game"), vbg); type = (Type)cg.config()->readNumEntry(MP_GAMETYPE, 0); if ( type<0 || type>2 ) type = Local; vbg->setButton(type); typePage->setSpacing(KDialogBase::spacingHint()); - net = new QVGroupBox(i18n("Network Settings"), typePage); - QGrid *grid = new QGrid(2, net); - lserver = new QLabel(" ", grid); + net = new TQVGroupBox(i18n("Network Settings"), typePage); + TQGrid *grid = new TQGrid(2, net); + lserver = new TQLabel(" ", grid); grid->setSpacing(KDialogBase::spacingHint()); - eserver = new QLineEdit(grid); - (void)new QLabel(i18n("Port:"), grid); + eserver = new TQLineEdit(grid); + (void)new TQLabel(i18n("Port:"), grid); int p = cg.config()->readNumEntry(MP_PORT, (uint)MIN_USER_PORT); eport = new KIntNumInput(p, grid); eport->setRange(MIN_USER_PORT, MAX_USER_PORT, 1, false); @@ -77,51 +77,51 @@ void MPWizard::setupTypePage() //----------------------------------------------------------------------------- void MPWizard::setupLocalPage(const MPGameInfo &gi) { - localPage = new QVBox(this); + localPage = new TQVBox(this); localPage->setMargin(KDialogBase::marginHint()); wl = new WidgetList<PlayerLine>(5, localPage); - QSignalMapper *husm = new QSignalMapper(this); - if (gi.humanSettingSlot) connect(husm, SIGNAL(mapped(int)), + TQSignalMapper *husm = new TQSignalMapper(this); + if (gi.humanSettingSlot) connect(husm, TQT_SIGNAL(mapped(int)), gi.humanSettingSlot); - QSignalMapper *aism = new QSignalMapper(this); - if (gi.AISettingSlot) connect(aism, SIGNAL(mapped(int)), gi.AISettingSlot); + TQSignalMapper *aism = new TQSignalMapper(this); + if (gi.AISettingSlot) connect(aism, TQT_SIGNAL(mapped(int)), gi.AISettingSlot); KConfigGroupSaver cg(kapp->config(), MP_GROUP); - QString n; + TQString n; PlayerComboBox::Type type; PlayerLine *pl; Q_ASSERT( gi.maxNbLocalPlayers>0 ); for (uint i=0; i<gi.maxNbLocalPlayers; i++) { type = (PlayerComboBox::Type) - cg.config()->readNumEntry(QString(MP_PLAYER_TYPE).arg(i), + cg.config()->readNumEntry(TQString(MP_PLAYER_TYPE).arg(i), (i==0 ? PlayerComboBox::Human : PlayerComboBox::None)); - n = cg.config()->readEntry(QString(MP_PLAYER_NAME).arg(i), + n = cg.config()->readEntry(TQString(MP_PLAYER_NAME).arg(i), i18n("Player #%1").arg(i)); pl = new PlayerLine(type, n, gi.humanSettingSlot, gi.AISettingSlot, i!=0, gi.AIAllowed, wl); - connect(pl, SIGNAL(typeChanged(int)), SLOT(lineTypeChanged(int))); + connect(pl, TQT_SIGNAL(typeChanged(int)), TQT_SLOT(lineTypeChanged(int))); husm->setMapping(pl, i); - connect(pl, SIGNAL(setHuman()), husm, SLOT(map())); + connect(pl, TQT_SIGNAL(setHuman()), husm, TQT_SLOT(map())); aism->setMapping(pl, i); - connect(pl, SIGNAL(setAI()), aism, SLOT(map())); + connect(pl, TQT_SIGNAL(setAI()), aism, TQT_SLOT(map())); wl->append(pl); } - ((QVBox *)localPage)->setSpacing(KDialogBase::spacingHint()); + ((TQVBox *)localPage)->setSpacing(KDialogBase::spacingHint()); -// keys = new QPushButton(i18n("Configure Keys..."), localPage); -// connect(keys, SIGNAL(clicked()), SLOT(configureKeysSlot())); +// keys = new TQPushButton(i18n("Configure Keys..."), localPage); +// connect(keys, TQT_SIGNAL(clicked()), TQT_SLOT(configureKeysSlot())); addPage(localPage, i18n("Local Player's Settings")); setHelpEnabled(localPage, FALSE); lineTypeChanged(0); } -QString MPWizard::name(uint i) const +TQString MPWizard::name(uint i) const { - QString s = wl->widget(i)->name(); + TQString s = wl->widget(i)->name(); if ( s.length()==0 ) s = i18n("Player #%1").arg(i); return s; } @@ -130,7 +130,7 @@ void MPWizard::typeChanged(int t) { type = (Type)t; - QString str; + TQString str; if ( type!=Client ) { str = "localhost"; lserver->setText(i18n("Hostname:")); @@ -170,7 +170,7 @@ void MPWizard::accept() int flags = KExtendedSocket::inetSocket | KExtendedSocket::streamSocket; if (cd.server) flags |= KExtendedSocket::passiveSocket; - QString host = QFile::encodeName(eserver->text()); + TQString host = TQFile::encodeName(eserver->text()); KExtendedSocket *socket = new KExtendedSocket(host, eport->value(), flags); @@ -206,15 +206,15 @@ void MPWizard::accept() cg.config()->writeEntry(MP_GAMETYPE, (int)type); for (uint i=0; i<wl->size(); i++) { - cg.config()->writeEntry(QString(MP_PLAYER_TYPE).arg(i), + cg.config()->writeEntry(TQString(MP_PLAYER_TYPE).arg(i), (int)wl->widget(i)->type()); - cg.config()->writeEntry(QString(MP_PLAYER_NAME).arg(i), name(i)); + cg.config()->writeEntry(TQString(MP_PLAYER_NAME).arg(i), name(i)); } KWizard::accept(); } -void MPWizard::showPage(QWidget *page) +void MPWizard::showPage(TQWidget *page) { if ( page==localPage ) setFinishEnabled(localPage, TRUE); KWizard::showPage(page); diff --git a/libksirtet/lib/wizard.h b/libksirtet/lib/wizard.h index 29287508..fd90a3b8 100644 --- a/libksirtet/lib/wizard.h +++ b/libksirtet/lib/wizard.h @@ -1,11 +1,11 @@ #ifndef WIZARD_H #define WIZARD_H -#include <qlabel.h> -#include <qlineedit.h> -#include <qvbox.h> -#include <qvgroupbox.h> -#include <qpushbutton.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqvbox.h> +#include <tqvgroupbox.h> +#include <tqpushbutton.h> #include <knuminput.h> #include <kconfig.h> @@ -22,9 +22,9 @@ class MPWizard : public KWizard public: MPWizard(const MPGameInfo &gi, ConnectionData &cd, - QWidget *parent = 0, const char *name = 0); + TQWidget *parent = 0, const char *name = 0); - void showPage(QWidget *page); + void showPage(TQWidget *page); signals: void configureKeys(uint); @@ -41,17 +41,17 @@ class MPWizard : public KWizard ConnectionData &cd; enum Type { Local, Server, Client }; Type type; - QVBox *typePage, *localPage; + TQVBox *typePage, *localPage; WidgetList<PlayerLine> *wl; - QLabel *lserver; - QLineEdit *eserver; + TQLabel *lserver; + TQLineEdit *eserver; KIntNumInput *eport; - QVGroupBox *net; -// QPushButton *keys; + TQVGroupBox *net; +// TQPushButton *keys; void setupTypePage(); void setupLocalPage(const MPGameInfo &gi); - QString name(uint i) const; + TQString name(uint i) const; }; #endif // WIZARD_H diff --git a/lskat/lskat/KChildConnect.cpp b/lskat/lskat/KChildConnect.cpp index 61931693..35ac9408 100644 --- a/lskat/lskat/KChildConnect.cpp +++ b/lskat/lskat/KChildConnect.cpp @@ -20,7 +20,7 @@ #include "KChildConnect.moc" KChildConnect::KChildConnect() - : QObject(0,0) + : TQObject(0,0) { input_pending=false; inputbuffer=""; @@ -38,14 +38,14 @@ KR_STATUS KChildConnect::QueryStatus() // Communication with process bool KChildConnect::SendMsg(KEMessage *msg) { - QString sendstring=msg->ToString(); + TQString sendstring=msg->ToString(); // Debug only - if (msg->HasKey(QCString("KLogSendMsg"))) + if (msg->HasKey(TQCString("KLogSendMsg"))) { char *p; int size; FILE *fp; - msg->GetData(QCString("KLogSendMsg"),p,size); + msg->GetData(TQCString("KLogSendMsg"),p,size); if (p && (fp=fopen(p,"a")) ) { fprintf(fp,"------------------------------------\n"); @@ -58,7 +58,7 @@ bool KChildConnect::SendMsg(KEMessage *msg) } // Send string to parent -bool KChildConnect::Send(QString str) +bool KChildConnect::Send(TQString str) { if (!str || str.length()<1) return true; // no need to send crap printf("%s",str.latin1()); @@ -66,11 +66,11 @@ bool KChildConnect::Send(QString str) return true; } -void KChildConnect::Receive(QString input) +void KChildConnect::Receive(TQString input) { // Cut out CR int len,pos; - QString tmp; + TQString tmp; // Call us recursive until there are no CR left @@ -104,7 +104,7 @@ void KChildConnect::Receive(QString input) char *it; for (it=inputcache.first();it!=0;it=inputcache.next()) { - msg->AddString(QCString(it)); + msg->AddString(TQCString(it)); } // printf("+- CHILDprocess:: GOT MESSAGE::Emmiting slotReceiveMsg\n"); diff --git a/lskat/lskat/KChildConnect.h b/lskat/lskat/KChildConnect.h index d90c62ca..b8e48fcd 100644 --- a/lskat/lskat/KChildConnect.h +++ b/lskat/lskat/KChildConnect.h @@ -17,8 +17,8 @@ #ifndef _KCHILDCONNECT_H_ #define _KCHILDCONNECT_H_ -#include <qobject.h> -#include <qstrlist.h> +#include <tqobject.h> +#include <tqstrlist.h> #include "KEMessage.h" @@ -27,20 +27,20 @@ class KChildConnect: public QObject Q_OBJECT protected: - QStrList inputcache; + TQStrList inputcache; bool input_pending; - QString inputbuffer; + TQString inputbuffer; int ID; public: KChildConnect(); ~KChildConnect(); - void Receive(QString input); + void Receive(TQString input); int QueryID(); void SetID(int id); virtual bool SendMsg(KEMessage *msg); - virtual bool Send(QString str); + virtual bool Send(TQString str); virtual KR_STATUS QueryStatus(); public slots: diff --git a/lskat/lskat/KEInput.cpp b/lskat/lskat/KEInput.cpp index b5765d00..091bf4e1 100644 --- a/lskat/lskat/KEInput.cpp +++ b/lskat/lskat/KEInput.cpp @@ -22,8 +22,8 @@ #include "KEInput.moc" -KEInput::KEInput(QObject * parent) - : QObject(parent,0) +KEInput::KEInput(TQObject * parent) + : TQObject(parent,0) { number_of_inputs=0; locked=FALSE; @@ -127,22 +127,22 @@ bool KEInput::SetInputDevice(int no, KG_INPUTTYPE type,KEMessage *msg) switch(QueryType(no)) { case KG_INPUTTYPE_INTERACTIVE: - connect(playerArray[no].QueryInteractiveConnect(),SIGNAL(signalReceiveMsg(KEMessage *,int )), - this,SLOT(slotSetInput(KEMessage *,int ))); - connect(playerArray[no].QueryInteractiveConnect(),SIGNAL(signalPrepareMove(KEMessage *,KG_INPUTTYPE)), - this,SLOT(slotPrepareMove(KEMessage *,KG_INPUTTYPE))); + connect(playerArray[no].QueryInteractiveConnect(),TQT_SIGNAL(signalReceiveMsg(KEMessage *,int )), + this,TQT_SLOT(slotSetInput(KEMessage *,int ))); + connect(playerArray[no].QueryInteractiveConnect(),TQT_SIGNAL(signalPrepareMove(KEMessage *,KG_INPUTTYPE)), + this,TQT_SLOT(slotPrepareMove(KEMessage *,KG_INPUTTYPE))); break; case KG_INPUTTYPE_REMOTE: - connect(playerArray[no].QueryRemoteConnect(),SIGNAL(signalReceiveMsg(KEMessage *,int )), - this,SLOT(slotSetInput(KEMessage *,int ))); - connect(playerArray[no].QueryRemoteConnect(),SIGNAL(signalPrepareMove(KEMessage *,KG_INPUTTYPE)), - this,SLOT(slotPrepareMove(KEMessage *,KG_INPUTTYPE))); + connect(playerArray[no].QueryRemoteConnect(),TQT_SIGNAL(signalReceiveMsg(KEMessage *,int )), + this,TQT_SLOT(slotSetInput(KEMessage *,int ))); + connect(playerArray[no].QueryRemoteConnect(),TQT_SIGNAL(signalPrepareMove(KEMessage *,KG_INPUTTYPE)), + this,TQT_SLOT(slotPrepareMove(KEMessage *,KG_INPUTTYPE))); break; case KG_INPUTTYPE_PROCESS: - connect(playerArray[no].QueryProcessConnect(),SIGNAL(signalReceiveMsg(KEMessage *,int )), - this,SLOT(slotSetInput(KEMessage *,int ))); - connect(playerArray[no].QueryProcessConnect(),SIGNAL(signalPrepareMove(KEMessage *,KG_INPUTTYPE)), - this,SLOT(slotPrepareMove(KEMessage *,KG_INPUTTYPE))); + connect(playerArray[no].QueryProcessConnect(),TQT_SIGNAL(signalReceiveMsg(KEMessage *,int )), + this,TQT_SLOT(slotSetInput(KEMessage *,int ))); + connect(playerArray[no].QueryProcessConnect(),TQT_SIGNAL(signalPrepareMove(KEMessage *,KG_INPUTTYPE)), + this,TQT_SLOT(slotPrepareMove(KEMessage *,KG_INPUTTYPE))); break; default: break; @@ -189,8 +189,8 @@ bool KEInput::Next(int number, bool force) { // delay non interactive move to allow interactive inout if (cTimer) delete cTimer; // Ouch... - cTimer=new QTimer(this); - connect(cTimer,SIGNAL(timeout()),this,SLOT(slotTimerNextRemote())); + cTimer=new TQTimer(this); + connect(cTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(slotTimerNextRemote())); cTimer->start(K_INPUT_DELAY,TRUE); } else @@ -203,8 +203,8 @@ bool KEInput::Next(int number, bool force) QueryType(previous_input)!=KG_INPUTTYPE_INTERACTIVE) { // delay non interactive move to allow interactive inout - cTimer=new QTimer(this); - connect(cTimer,SIGNAL(timeout()),this,SLOT(slotTimerNextProcess())); + cTimer=new TQTimer(this); + connect(cTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(slotTimerNextProcess())); cTimer->start(K_INPUT_DELAY,TRUE); } else diff --git a/lskat/lskat/KEInput.h b/lskat/lskat/KEInput.h index e2f3ef8b..4e83f36a 100644 --- a/lskat/lskat/KEInput.h +++ b/lskat/lskat/KEInput.h @@ -17,10 +17,10 @@ #ifndef _KEINPUT_H_ #define _KEINPUT_H_ -#include <qptrlist.h> -#include <qobject.h> -#include <qtimer.h> -#include <qmemarray.h> +#include <tqptrlist.h> +#include <tqobject.h> +#include <tqtimer.h> +#include <tqmemarray.h> #include "KConnectEntry.h" #include "KRemoteConnect.h" #include "KProcessConnect.h" @@ -38,15 +38,15 @@ class KEInput : public QObject int previous_input,next_input; bool locked; // KEMessage *mMsg; - QTimer *cTimer; + TQTimer *cTimer; - QPtrList<KRemoteConnect> remoteList; - QPtrList<KProcessConnect> computerList; - QPtrList<KInteractiveConnect> interactiveList; - QMemArray<KConnectEntry> playerArray; + TQPtrList<KRemoteConnect> remoteList; + TQPtrList<KProcessConnect> computerList; + TQPtrList<KInteractiveConnect> interactiveList; + TQMemArray<KConnectEntry> playerArray; public: - KEInput(QObject * parent=0); + KEInput(TQObject * parent=0); ~KEInput(); int QueryNumberOfInputs(); int QueryNext(); diff --git a/lskat/lskat/KEMessage.cpp b/lskat/lskat/KEMessage.cpp index 9d3d3d3f..38cd2e8d 100644 --- a/lskat/lskat/KEMessage.cpp +++ b/lskat/lskat/KEMessage.cpp @@ -19,7 +19,7 @@ #include <stdlib.h> #include "KEMessage.h" -void KEMessage::AddEntry(QString key,KMessageEntry *entry) +void KEMessage::AddEntry(TQString key,KMessageEntry *entry) { // printf(" AddingEntry: %s with data field %p\n",(char *)key,entry->QueryData()); if (!entry) return ; @@ -27,7 +27,7 @@ void KEMessage::AddEntry(QString key,KMessageEntry *entry) keys.append(key.latin1()); } -void KEMessage::AddDataType(QString key,int size,const char *data,KGM_TYPE type) +void KEMessage::AddDataType(TQString key,int size,const char *data,KGM_TYPE type) { // printf("AddDataType for %s size=%d\n",(const char *)key,size); if (size<=0) return ; @@ -37,28 +37,28 @@ void KEMessage::AddDataType(QString key,int size,const char *data,KGM_TYPE type) AddEntry(key,entry); } -void KEMessage::AddData(QString key,short data) +void KEMessage::AddData(TQString key,short data) { AddDataType(key,sizeof(short),(char *)&data,KGM_TYPE_SHORT); } -void KEMessage::AddData(QString key,long data) +void KEMessage::AddData(TQString key,long data) { AddDataType(key,sizeof(long),(char *)&data,KGM_TYPE_LONG); } -void KEMessage::AddData(QString key,float data) +void KEMessage::AddData(TQString key,float data) { AddDataType(key,sizeof(float),(char *)&data,KGM_TYPE_FLOAT); } -void KEMessage::AddData(QString key, const char *data,int size) +void KEMessage::AddData(TQString key, const char *data,int size) { if (size<0) size=strlen(data)+1; // +1 for 0 Byte AddDataType(key,size,data,KGM_TYPE_DATA); } -KGM_TYPE KEMessage::QueryType(QString key) +KGM_TYPE KEMessage::QueryType(TQString key) { KMessageEntry *entry; entry=dict.find(key); @@ -66,7 +66,7 @@ KGM_TYPE KEMessage::QueryType(QString key) return entry->QueryType(); } -bool KEMessage::HasKey(QString key) +bool KEMessage::HasKey(TQString key) { KMessageEntry *entry; entry=dict.find(key); @@ -74,7 +74,7 @@ bool KEMessage::HasKey(QString key) return true; } -bool KEMessage::GetData(QString key,short &s) +bool KEMessage::GetData(TQString key,short &s) { short *result; KMessageEntry *entry; @@ -87,7 +87,7 @@ bool KEMessage::GetData(QString key,short &s) return true; } -bool KEMessage::GetData(QString key,long &l) +bool KEMessage::GetData(TQString key,long &l) { long *result; KMessageEntry *entry; @@ -99,7 +99,7 @@ bool KEMessage::GetData(QString key,long &l) return true; } -bool KEMessage::GetData(QString key,float &f) +bool KEMessage::GetData(TQString key,float &f) { float *result; KMessageEntry *entry; @@ -112,7 +112,7 @@ bool KEMessage::GetData(QString key,float &f) return true; } -bool KEMessage::GetData(QString key,char * &c,int &size) +bool KEMessage::GetData(TQString key,char * &c,int &size) { KMessageEntry *entry; entry=dict.find(key); @@ -123,13 +123,13 @@ bool KEMessage::GetData(QString key,char * &c,int &size) return true; } -QString KEMessage::EntryToString(char *key,KMessageEntry *entry) +TQString KEMessage::EntryToString(char *key,KMessageEntry *entry) { - QString s,tmp; + TQString s,tmp; int size,i; KGM_TYPE type; char *data; - s=QCString(""); + s=TQCString(""); if (!entry) return s; size=entry->QuerySize(); type=entry->QueryType(); @@ -142,7 +142,7 @@ QString KEMessage::EntryToString(char *key,KMessageEntry *entry) size,KEMESSAGE_SEP, (int)type,KEMESSAGE_SEP); */ - tmp=QCString(key); + tmp=TQCString(key); s+=tmp; s+=KEMESSAGE_SEP; tmp.sprintf("%d",size); @@ -168,31 +168,31 @@ QString KEMessage::EntryToString(char *key,KMessageEntry *entry) return s; } -QString KEMessage::StringToEntry(QString str,KMessageEntry *entry) +TQString KEMessage::StringToEntry(TQString str,KMessageEntry *entry) { int pos,oldpos,cnt,len; - QString key,size,type,data; + TQString key,size,type,data; const char *p; char *q; char c; len=KEMESSAGE_SEP.length(); - if (!entry) return QString(); + if (!entry) return TQString(); pos=str.find(KEMESSAGE_SEP,0); - if (pos<0) return QString(); // wrong format + if (pos<0) return TQString(); // wrong format key=str.left(pos); oldpos=pos; pos=str.find(KEMESSAGE_SEP,oldpos+len); - if (pos<0) return QString(); // wrong format + if (pos<0) return TQString(); // wrong format size=str.mid(oldpos+len,pos-oldpos-len); oldpos=pos; pos=str.find(KEMESSAGE_SEP,oldpos+len); - if (pos<0) return QString(); // wrong format + if (pos<0) return TQString(); // wrong format type=str.mid(oldpos+len,pos-oldpos-len); @@ -205,10 +205,10 @@ QString KEMessage::StringToEntry(QString str,KMessageEntry *entry) // I hope this works with unicode strings as well p=data.latin1(); q=(char *)calloc(data.length()/2,sizeof(char)); - if (!q) return QString(); + if (!q) return TQString(); for(pos=0;pos<cnt;pos++) { - if (pos*2+1>(int)data.length()) return QString(); // SEVERE ERROR + if (pos*2+1>(int)data.length()) return TQString(); // SEVERE ERROR c=*(p+2*pos)-'a' | ((*(p+2*pos+1)-'a')<<4); q[pos]=c; } @@ -218,35 +218,35 @@ QString KEMessage::StringToEntry(QString str,KMessageEntry *entry) return key; } -QString KEMessage::ToString() +TQString KEMessage::ToString() { - QString s; + TQString s; KMessageEntry *entry; char *it; s=KEMESSAGE_HEAD+KEMESSAGE_CR; for (it=keys.first();it!=0;it=keys.next()) { - entry=dict.find(QCString(it)); + entry=dict.find(TQCString(it)); s+=EntryToString(it,entry); } s+=KEMESSAGE_TAIL+KEMESSAGE_CR; return s; } -bool KEMessage::AddString(QString s) +bool KEMessage::AddString(TQString s) { // break s into key,size and data - QString key; + TQString key; KMessageEntry *entry=new KMessageEntry; key=StringToEntry(s,entry); if (!key) return false; AddEntry(key,entry); return true; } -bool KEMessage::AddStringMsg(QString str) +bool KEMessage::AddStringMsg(TQString str) { bool result; - QString data; + TQString data; int pos,oldpos,len; len=KEMESSAGE_CR.length(); @@ -277,7 +277,7 @@ void KEMessage::RemoveAll() dict.clear(); } -void KEMessage::Remove(QString key) +void KEMessage::Remove(TQString key) { keys.remove(key.latin1()); dict.remove(key); @@ -287,7 +287,7 @@ uint KEMessage::QueryNumberOfKeys() { return keys.count(); } -QStrList *KEMessage::QueryKeys() +TQStrList *KEMessage::QueryKeys() { return &keys; } @@ -315,10 +315,10 @@ KEMessage &KEMessage::operator=(KEMessage &msg) // printf("Assigning = KEMessage from %p to %p\n",&msg,this); for (it=msg.keys.first();it!=0;it=msg.keys.next()) { - entry=msg.dict.find(QCString(it)); + entry=msg.dict.find(TQCString(it)); newentry=new KMessageEntry; *newentry=*entry; - AddEntry(QCString(it),newentry); + AddEntry(TQCString(it),newentry); } // return *newmsg; diff --git a/lskat/lskat/KEMessage.h b/lskat/lskat/KEMessage.h index 0a1913cc..9e4d6912 100644 --- a/lskat/lskat/KEMessage.h +++ b/lskat/lskat/KEMessage.h @@ -18,44 +18,44 @@ #define _KEMESSAGE_H_ #include <string.h> -#include <qstring.h> -#include <qstrlist.h> -#include <qdict.h> +#include <tqstring.h> +#include <tqstrlist.h> +#include <tqdict.h> #include "KMessageEntry.h" -#define KEMESSAGE_HEAD QString(QCString("BEGIN_V1000")) -#define KEMESSAGE_TAIL QString(QCString("END_V1000")) -#define KEMESSAGE_CR QString(QCString("\n")) -#define KEMESSAGE_SEP QString(QCString(":::")) +#define KEMESSAGE_HEAD TQString(TQCString("BEGIN_V1000")) +#define KEMESSAGE_TAIL TQString(TQCString("END_V1000")) +#define KEMESSAGE_CR TQString(TQCString("\n")) +#define KEMESSAGE_SEP TQString(TQCString(":::")) class KEMessage { private: - QStrList keys; - QDict<KMessageEntry> dict; + TQStrList keys; + TQDict<KMessageEntry> dict; protected: - void AddEntry(QString key,KMessageEntry *entry); + void AddEntry(TQString key,KMessageEntry *entry); public: - QStrList *QueryKeys(); + TQStrList *QueryKeys(); uint QueryNumberOfKeys(); - void AddDataType(QString key,int size,const char *data,KGM_TYPE type); - void AddData(QString key,short data); - void AddData(QString key,long data); - void AddData(QString key,float data); - void AddData(QString key,const char *data,int size=-1); - bool GetData(QString key,short &s); - bool GetData(QString key,long &l); - bool GetData(QString key,float &f); - bool GetData(QString key,char * &c,int &size); - bool HasKey(QString key); - void Remove(QString key); - KGM_TYPE QueryType(QString key); - QString ToString(); - QString EntryToString(char *key,KMessageEntry *entry); - QString StringToEntry(QString str,KMessageEntry *entry); - bool AddString(QString s); - bool AddStringMsg(QString str); + void AddDataType(TQString key,int size,const char *data,KGM_TYPE type); + void AddData(TQString key,short data); + void AddData(TQString key,long data); + void AddData(TQString key,float data); + void AddData(TQString key,const char *data,int size=-1); + bool GetData(TQString key,short &s); + bool GetData(TQString key,long &l); + bool GetData(TQString key,float &f); + bool GetData(TQString key,char * &c,int &size); + bool HasKey(TQString key); + void Remove(TQString key); + KGM_TYPE QueryType(TQString key); + TQString ToString(); + TQString EntryToString(char *key,KMessageEntry *entry); + TQString StringToEntry(TQString str,KMessageEntry *entry); + bool AddString(TQString s); + bool AddStringMsg(TQString str); void RemoveAll(); ~KEMessage(); KEMessage(); diff --git a/lskat/lskat/KInputChildProcess.cpp b/lskat/lskat/KInputChildProcess.cpp index fb6e743a..bd78235c 100644 --- a/lskat/lskat/KInputChildProcess.cpp +++ b/lskat/lskat/KInputChildProcess.cpp @@ -9,7 +9,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <qstring.h> +#include <tqstring.h> #include "KInputChildProcess.h" #include "KInputChildProcess.moc" @@ -21,7 +21,7 @@ KInputChildProcess::~KInputChildProcess() delete childConnect; } KInputChildProcess::KInputChildProcess(int size_buffer) - : QObject(0,0) + : TQObject(0,0) { buffersize=size_buffer; if (buffersize<1) buffersize=1024; @@ -32,12 +32,12 @@ KInputChildProcess::KInputChildProcess(int size_buffer) bool KInputChildProcess::exec() { int pos; - QString s; + TQString s; childConnect=new KChildConnect; if (!childConnect) return false; - connect(childConnect,SIGNAL(signalReceiveMsg(KEMessage *,int)), - this,SLOT(slotReceiveMsg(KEMessage *,int))); + connect(childConnect,TQT_SIGNAL(signalReceiveMsg(KEMessage *,int)), + this,TQT_SLOT(slotReceiveMsg(KEMessage *,int))); do { // Wait for input diff --git a/lskat/lskat/KInputChildProcess.h b/lskat/lskat/KInputChildProcess.h index b4694df5..2f964e71 100644 --- a/lskat/lskat/KInputChildProcess.h +++ b/lskat/lskat/KInputChildProcess.h @@ -17,7 +17,7 @@ #ifndef _KINPUTCHILDPROCESS_H_ #define _KINPUTCHILDPROCESS_H_ -#include <qobject.h> +#include <tqobject.h> #include "KEMessage.h" #include "KChildConnect.h" @@ -28,7 +28,7 @@ class KInputChildProcess : public QObject private: char *buffer; - QString inputbuffer; + TQString inputbuffer; int buffersize; bool terminateChild; protected: diff --git a/lskat/lskat/KInteractiveConnect.cpp b/lskat/lskat/KInteractiveConnect.cpp index e95dcbe1..d0fe3437 100644 --- a/lskat/lskat/KInteractiveConnect.cpp +++ b/lskat/lskat/KInteractiveConnect.cpp @@ -73,7 +73,7 @@ bool KInteractiveConnect::SendMsg(KEMessage *msg) } // Try not to use this..prodices just unnecessary string-msg // conversion -bool KInteractiveConnect::Send(QString str) +bool KInteractiveConnect::Send(TQString str) { Receive(str); return true; diff --git a/lskat/lskat/KInteractiveConnect.h b/lskat/lskat/KInteractiveConnect.h index 5a393c26..1585f60f 100644 --- a/lskat/lskat/KInteractiveConnect.h +++ b/lskat/lskat/KInteractiveConnect.h @@ -31,7 +31,7 @@ class KInteractiveConnect:public KChildConnect bool Init(int id=0,KEMessage *msg=0); bool Exit(); bool SendMsg(KEMessage *msg); - bool Send(QString str); + bool Send(TQString str); signals: void signalPrepareMove(KEMessage *msg,KG_INPUTTYPE type); diff --git a/lskat/lskat/KProcessConnect.cpp b/lskat/lskat/KProcessConnect.cpp index 740486b3..97cd9221 100644 --- a/lskat/lskat/KProcessConnect.cpp +++ b/lskat/lskat/KProcessConnect.cpp @@ -57,13 +57,13 @@ bool KProcessConnect::Init(int id,KEMessage *msg) SetID(id); if (msg) { - if (!msg->GetData(QCString("ProcessName"),p,size)) return false; // no process name + if (!msg->GetData(TQCString("ProcessName"),p,size)) return false; // no process name processname=p; /* printf("Found processname '%s' size %d size=%u\n", p,size,msg->QueryNumberOfKeys()); */ - msg->Remove(QCString("ProcessName")); + msg->Remove(TQCString("ProcessName")); } if (processname.length()<1) return false; @@ -75,13 +75,13 @@ bool KProcessConnect::Init(int id,KEMessage *msg) // create process process=new KProcess; *process << processname; - connect(process, SIGNAL(receivedStdout(KProcess *, char *, int )), - this, SLOT(slotReceivedStdout(KProcess *, char * , int ))); - connect(process, SIGNAL(processExited(KProcess *)), - this, SLOT(slotProcessExited(KProcess *))); + connect(process, TQT_SIGNAL(receivedStdout(KProcess *, char *, int )), + this, TQT_SLOT(slotReceivedStdout(KProcess *, char * , int ))); + connect(process, TQT_SIGNAL(processExited(KProcess *)), + this, TQT_SLOT(slotProcessExited(KProcess *))); /* - connect(process, SIGNAL(wroteStdin(KProcess *)), - this, SLOT(slotWroteStdin(KProcess *))); + connect(process, TQT_SIGNAL(wroteStdin(KProcess *)), + this, TQT_SLOT(slotWroteStdin(KProcess *))); */ // TRUE if ok @@ -97,7 +97,7 @@ bool KProcessConnect::Init(int id,KEMessage *msg) void KProcessConnect::slotReceivedStdout(KProcess *, char *buffer, int buflen) { - QString s; + TQString s; char c; int pos; @@ -174,14 +174,14 @@ bool KProcessConnect::Next() } // Send string to child -bool KProcessConnect::Send(QString str) +bool KProcessConnect::Send(TQString str) { bool result; // printf("****** PROCESS:SEND\n"); if (!running || !process) return false; if (!str || str.length()<1) return true; // no need to send crap // TODO ..why? - QString s; + TQString s; s=KEMESSAGE_CR+KEMESSAGE_CR; str=s+str; // printf("+++ Sending to child '%s'!!!\n",(const char *)str); diff --git a/lskat/lskat/KProcessConnect.h b/lskat/lskat/KProcessConnect.h index 9229ddd4..0e7b491a 100644 --- a/lskat/lskat/KProcessConnect.h +++ b/lskat/lskat/KProcessConnect.h @@ -30,7 +30,7 @@ class KProcessConnect: public KChildConnect private: KProcess *process; - QString processname; + TQString processname; bool running; public: @@ -40,8 +40,8 @@ class KProcessConnect: public KChildConnect bool Exit(); bool Next(); // bool SendMsg(KEMessage *msg); - virtual bool Send(QString str); - // void Receive(QString input); + virtual bool Send(TQString str); + // void Receive(TQString input); public slots: void slotReceivedStdout(KProcess *proc, char *buffer, int buflen); diff --git a/lskat/lskat/KRSocket.cpp b/lskat/lskat/KRSocket.cpp index 0a699600..91c5e42e 100644 --- a/lskat/lskat/KRSocket.cpp +++ b/lskat/lskat/KRSocket.cpp @@ -94,7 +94,7 @@ #define SOMAXCONN 5 #endif -#include <qsocketnotifier.h> +#include <tqsocketnotifier.h> #ifndef UNIX_PATH_MAX #define UNIX_PATH_MAX 108 // this is the value, I found under Linux @@ -113,8 +113,8 @@ KRServerSocket::KRServerSocket( const char *_path, int optname, int value, int l return; } - notifier = new QSocketNotifier( sock, QSocketNotifier::Read ); - connect( notifier, SIGNAL( activated(int) ), this, SLOT( slotAccept(int) ) ); + notifier = new TQSocketNotifier( sock, TQSocketNotifier::Read ); + connect( notifier, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( slotAccept(int) ) ); } KRServerSocket::KRServerSocket( const char *_path ) : @@ -128,8 +128,8 @@ KRServerSocket::KRServerSocket( const char *_path ) : return; } - notifier = new QSocketNotifier( sock, QSocketNotifier::Read ); - connect( notifier, SIGNAL( activated(int) ), this, SLOT( slotAccept(int) ) ); + notifier = new TQSocketNotifier( sock, TQSocketNotifier::Read ); + connect( notifier, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( slotAccept(int) ) ); } KRServerSocket::KRServerSocket( unsigned short int _port ) : @@ -143,8 +143,8 @@ KRServerSocket::KRServerSocket( unsigned short int _port ) : return; } - notifier = new QSocketNotifier( sock, QSocketNotifier::Read ); - connect( notifier, SIGNAL( activated(int) ), this, SLOT( slotAccept(int) ) ); + notifier = new TQSocketNotifier( sock, TQSocketNotifier::Read ); + connect( notifier, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( slotAccept(int) ) ); } KRServerSocket::KRServerSocket( unsigned short int _port,int optname,int value,int level ) : @@ -158,8 +158,8 @@ KRServerSocket::KRServerSocket( unsigned short int _port,int optname,int value,i return; } - notifier = new QSocketNotifier( sock, QSocketNotifier::Read ); - connect( notifier, SIGNAL( activated(int) ), this, SLOT( slotAccept(int) ) ); + notifier = new TQSocketNotifier( sock, TQSocketNotifier::Read ); + connect( notifier, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( slotAccept(int) ) ); } bool KRServerSocket::init( const char *_path ) diff --git a/lskat/lskat/KRSocket.h b/lskat/lskat/KRSocket.h index 6c0b9974..40c1e51c 100644 --- a/lskat/lskat/KRSocket.h +++ b/lskat/lskat/KRSocket.h @@ -24,7 +24,7 @@ #ifndef KRSOCK_H #define KRSOCK_H -#include <qobject.h> +#include <tqobject.h> #include <sys/types.h> // we define STRICT_ANSI to get rid of some warnings in glibc #ifndef __STRICT_ANSI__ @@ -129,7 +129,7 @@ protected: /** * Notifies us when there is something to read on the port. */ - QSocketNotifier *notifier; + TQSocketNotifier *notifier; /** * The file descriptor for this socket. sock may be -1. diff --git a/lskat/lskat/KRemoteConnect.cpp b/lskat/lskat/KRemoteConnect.cpp index f1bcb4f3..315d2a96 100644 --- a/lskat/lskat/KRemoteConnect.cpp +++ b/lskat/lskat/KRemoteConnect.cpp @@ -78,20 +78,20 @@ bool tryserver; SetID(id); if (msg) { - if (msg->GetData(QCString("Port"),prt)) + if (msg->GetData(TQCString("Port"),prt)) { port=(unsigned int)prt; - msg->Remove(QCString("Port")); + msg->Remove(TQCString("Port")); } - if (msg->GetData(QCString("IP"),p,size)) + if (msg->GetData(TQCString("IP"),p,size)) { - IP=QCString(p); - msg->Remove(QCString("IP")); + IP=TQCString(p); + msg->Remove(TQCString("IP")); } - if (msg->GetData(QCString("Name"),p,size)) + if (msg->GetData(TQCString("Name"),p,size)) { - Name=QString::fromUtf8(p); - msg->Remove(QCString("Name")); + Name=TQString::fromUtf8(p); + msg->Remove(TQCString("Name")); } } /* @@ -110,13 +110,13 @@ bool tryserver; { kSocket->enableRead(TRUE); //kSocket->enableWrite(TRUE); - connect(kSocket,SIGNAL(closeEvent(KSocket *)), - this,SLOT(socketClosed(KSocket *))); - connect(kSocket,SIGNAL(readEvent(KSocket *)), - this,SLOT(socketRead(KSocket *))); + connect(kSocket,TQT_SIGNAL(closeEvent(KSocket *)), + this,TQT_SLOT(socketClosed(KSocket *))); + connect(kSocket,TQT_SIGNAL(readEvent(KSocket *)), + this,TQT_SLOT(socketRead(KSocket *))); /* - connect(kSocket,SIGNAL(writeEvent(KSocket *)), - this,SLOT(socketWrite(KSocket *))); + connect(kSocket,TQT_SIGNAL(writeEvent(KSocket *)), + this,TQT_SLOT(socketWrite(KSocket *))); */ /* printf("Socket(%d) %p connection built to a server\n", @@ -127,7 +127,7 @@ bool tryserver; // Send msg if any if (msg->QueryNumberOfKeys()>0) { - msg->AddData(QCString("Server"),(short)QueryID()); + msg->AddData(TQCString("Server"),(short)QueryID()); SendMsg(msg); } @@ -187,8 +187,8 @@ bool KRemoteConnect::OfferServerSocket() printf("Offering socket and publishing stuff\n"); service = new DNSSD::PublicService(Name,LSKAT_SERVICE,port); service->publishAsync(); - connect(kServerSocket,SIGNAL(accepted(KSocket *)), - this,SLOT(socketRequest(KSocket *))); + connect(kServerSocket,TQT_SIGNAL(accepted(KSocket *)), + this,TQT_SLOT(socketRequest(KSocket *))); return true; } @@ -206,13 +206,13 @@ void KRemoteConnect::socketRequest(KSocket *sock) { kSocket->enableRead(TRUE); //kSocket->enableWrite(TRUE); - connect(kSocket,SIGNAL(closeEvent(KSocket *)), - this,SLOT(socketClosed(KSocket *))); - connect(kSocket,SIGNAL(readEvent(KSocket *)), - this,SLOT(socketRead(KSocket *))); + connect(kSocket,TQT_SIGNAL(closeEvent(KSocket *)), + this,TQT_SLOT(socketClosed(KSocket *))); + connect(kSocket,TQT_SIGNAL(readEvent(KSocket *)), + this,TQT_SLOT(socketRead(KSocket *))); /* - connect(kSocket,SIGNAL(writeEvent(KSocket *)), - this,SLOT(socketWrite(KSocket *))); + connect(kSocket,TQT_SIGNAL(writeEvent(KSocket *)), + this,TQT_SLOT(socketWrite(KSocket *))); */ socketStatus=KR_SERVER; delete kServerSocket; // no more connections @@ -220,7 +220,7 @@ void KRemoteConnect::socketRequest(KSocket *sock) if (bufferMsg) { // Delayed sending of init msg - bufferMsg->AddData(QCString("Client"),(short)QueryID()); + bufferMsg->AddData(TQCString("Client"),(short)QueryID()); SendMsg(bufferMsg); delete bufferMsg; bufferMsg=0; @@ -234,14 +234,14 @@ void KRemoteConnect::socketClosed(KSocket *sock) kSocket=0; socketStatus=KR_INVALID; KEMessage *msg=new KEMessage; - msg->AddData(QCString("ConnectionLost"),(short)QueryID()); + msg->AddData(TQCString("ConnectionLost"),(short)QueryID()); emit signalReceiveMsg(msg,QueryID()); delete msg; } void KRemoteConnect::socketRead(KSocket *sock) { ssize_t buflen; - QString s; + TQString s; char c; int pos; @@ -319,7 +319,7 @@ bool KRemoteConnect::Next() } // Send string to child -bool KRemoteConnect::Send(QString str) +bool KRemoteConnect::Send(TQString str) { // connected? if (!kSocket || kSocket->socket()==-1) return false; diff --git a/lskat/lskat/KRemoteConnect.h b/lskat/lskat/KRemoteConnect.h index baa005d6..99f9280d 100644 --- a/lskat/lskat/KRemoteConnect.h +++ b/lskat/lskat/KRemoteConnect.h @@ -33,16 +33,16 @@ class KRemoteConnect: public KChildConnect protected: KRServerSocket *kServerSocket; KSocket *kSocket; - QString IP; - QString Name; + TQString IP; + TQString Name; ushort port; KR_STATUS socketStatus; char *buffer; KEMessage *bufferMsg; DNSSD::PublicService *service; -// QString inputbuffer; +// TQString inputbuffer; // bool input_pending; -// QStrList inputcache; +// TQStrList inputcache; public: KRemoteConnect(); @@ -51,8 +51,8 @@ class KRemoteConnect: public KChildConnect bool Exit(); bool Next(); // bool SendMsg(KEMessage *msg); - virtual bool Send(QString str); -// void Receive(QString input); + virtual bool Send(TQString str); +// void Receive(TQString input); virtual KR_STATUS QueryStatus(); protected: diff --git a/lskat/lskat/lskat.cpp b/lskat/lskat/lskat.cpp index 9d1ce7a6..41309afd 100644 --- a/lskat/lskat/lskat.cpp +++ b/lskat/lskat/lskat.cpp @@ -16,7 +16,7 @@ ***************************************************************************/ // include files for QT -#include <qprogressdialog.h> +#include <tqprogressdialog.h> // include files for KDE #include <kstandarddirs.h> @@ -50,10 +50,10 @@ LSkatApp::LSkatApp() : KMainWindow(0) config=kapp->config(); // localise data file - QString file=QString::fromLatin1("lskat/grafix/t1.png"); + TQString file=TQString::fromLatin1("lskat/grafix/t1.png"); mGrafix=kapp->dirs()->findResourceDir("data", file); - if (mGrafix.isNull()) mGrafix = QCString("grafix/"); - else mGrafix+=QCString("lskat/grafix/"); + if (mGrafix.isNull()) mGrafix = TQCString("grafix/"); + else mGrafix+=TQCString("lskat/grafix/"); if (global_debug>3) printf("Localised datafile=%s\n",mGrafix.latin1()); @@ -63,7 +63,7 @@ LSkatApp::LSkatApp() : KMainWindow(0) initStatusBar(); setupGUI(KMainWindow::StatusBar | Save); - createGUI(QString::null, false); + createGUI(TQString::null, false); initDocument(); initView(); @@ -75,14 +75,14 @@ LSkatApp::LSkatApp() : KMainWindow(0) mInput=new KEInput(this); doc->SetInputHandler(mInput); - connect(mInput,SIGNAL(signalPrepareProcessMove(KEMessage *)), - this,SLOT(slotPrepareProcessMove(KEMessage *))); - connect(mInput,SIGNAL(signalPrepareRemoteMove(KEMessage *)), - this,SLOT(slotPrepareRemoteMove(KEMessage *))); - connect(mInput,SIGNAL(signalPrepareInteractiveMove(KEMessage *)), - this,SLOT(slotPrepareInteractiveMove(KEMessage *))); - connect(mInput,SIGNAL(signalReceiveInput(KEMessage *, int)), - this,SLOT(slotReceiveInput(KEMessage *,int ))); + connect(mInput,TQT_SIGNAL(signalPrepareProcessMove(KEMessage *)), + this,TQT_SLOT(slotPrepareProcessMove(KEMessage *))); + connect(mInput,TQT_SIGNAL(signalPrepareRemoteMove(KEMessage *)), + this,TQT_SLOT(slotPrepareRemoteMove(KEMessage *))); + connect(mInput,TQT_SIGNAL(signalPrepareInteractiveMove(KEMessage *)), + this,TQT_SLOT(slotPrepareInteractiveMove(KEMessage *))); + connect(mInput,TQT_SIGNAL(signalReceiveInput(KEMessage *, int)), + this,TQT_SLOT(slotReceiveInput(KEMessage *,int ))); setMinimumSize(640,480); setMaximumSize(800,600); @@ -156,28 +156,28 @@ void LSkatApp::checkMenus(int menu) void LSkatApp::initGUI() { - QStringList list; + TQStringList list; - (void)KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection(), "new_game"); + (void)KStdAction::openNew(this, TQT_SLOT(slotFileNew()), actionCollection(), "new_game"); ACTION("new_game")->setStatusText(i18n("Starting a new game...")); ACTION("new_game")->setWhatsThis(i18n("Starting a new game...")); - (void)new KAction(i18n("&End Game"),"stop", 0, this, SLOT(slotFileEnd()), + (void)new KAction(i18n("&End Game"),"stop", 0, this, TQT_SLOT(slotFileEnd()), actionCollection(), "end_game"); ACTION("end_game")->setStatusText(i18n("Ending the current game...")); ACTION("end_game")->setWhatsThis(i18n("Aborts a currently played game. No winner will be declared.")); - (void)new KAction(i18n("&Clear Statistics"),"flag", 0, this, SLOT(slotFileStatistics()), + (void)new KAction(i18n("&Clear Statistics"),"flag", 0, this, TQT_SLOT(slotFileStatistics()), actionCollection(), "clear_statistics"); ACTION("clear_statistics")->setStatusText(i18n("Delete all time statistics...")); ACTION("clear_statistics")->setWhatsThis(i18n("Clears the all time statistics which is kept in all sessions.")); - (void)new KAction(i18n("Send &Message..."), CTRL+Key_M, this, SLOT(slotFileMessage()), + (void)new KAction(i18n("Send &Message..."), CTRL+Key_M, this, TQT_SLOT(slotFileMessage()), actionCollection(), "send_message"); ACTION("send_message")->setStatusText(i18n("Sending message to remote player...")); ACTION("send_message")->setWhatsThis(i18n("Allows you to talk with a remote player.")); - (void)KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection(), "game_exit"); + (void)KStdAction::quit(this, TQT_SLOT(slotFileQuit()), actionCollection(), "game_exit"); ACTION("game_exit")->setStatusText(i18n("Exiting...")); ACTION("game_exit")->setWhatsThis(i18n("Quits the program.")); - (void)new KSelectAction(i18n("Starting Player"),0,this,SLOT(slotStartplayer()), + (void)new KSelectAction(i18n("Starting Player"),0,this,TQT_SLOT(slotStartplayer()), actionCollection(), "startplayer"); ACTION("startplayer")->setStatusText(i18n("Changing starting player...")); ACTION("startplayer")->setWhatsThis(i18n("Chooses which player begins the next game.")); @@ -186,7 +186,7 @@ void LSkatApp::initGUI() list.append(i18n("Player &2")); ((KSelectAction *)ACTION("startplayer"))->setItems(list); - (void)new KSelectAction(i18n("Player &1 Played By"),0,this,SLOT(slotPlayer1By()), + (void)new KSelectAction(i18n("Player &1 Played By"),0,this,TQT_SLOT(slotPlayer1By()), actionCollection(), "player1"); ACTION("player1")->setStatusText(i18n("Changing who plays player 1...")); ACTION("player1")->setWhatsThis(i18n("Changing who plays player 1...")); @@ -195,13 +195,13 @@ void LSkatApp::initGUI() list.append(i18n("&Computer")); list.append(i18n("&Remote")); ((KSelectAction *)ACTION("player1"))->setItems(list); - (void)new KSelectAction(i18n("Player &2 Played By"),0,this,SLOT(slotPlayer2By()), + (void)new KSelectAction(i18n("Player &2 Played By"),0,this,TQT_SLOT(slotPlayer2By()), actionCollection(), "player2"); ACTION("player1")->setStatusText(i18n("Changing who plays player 2...")); ACTION("player1")->setWhatsThis(i18n("Changing who plays player 2...")); ((KSelectAction *)ACTION("player2"))->setItems(list); - (void)new KSelectAction(i18n("&Level"),0,this,SLOT(slotLevel()), + (void)new KSelectAction(i18n("&Level"),0,this,TQT_SLOT(slotLevel()), actionCollection(), "choose_level"); ACTION("choose_level")->setStatusText(i18n("Change level...")); ACTION("choose_level")->setWhatsThis(i18n("Change the strength of the computer player.")); @@ -211,21 +211,21 @@ void LSkatApp::initGUI() list.append(i18n("&Hard")); ((KSelectAction *)ACTION("choose_level"))->setItems(list); - (void)new KAction(i18n("Select &Card Deck..."), 0, this, SLOT(slotOptionsCardDeck()), + (void)new KAction(i18n("Select &Card Deck..."), 0, this, TQT_SLOT(slotOptionsCardDeck()), actionCollection(), "select_carddeck"); ACTION("select_carddeck")->setStatusText(i18n("Configure card decks...")); ACTION("select_carddeck")->setWhatsThis(i18n("Choose how the cards should look.")); - (void)new KAction(i18n("Change &Names..."), 0, this, SLOT(slotOptionsNames()), + (void)new KAction(i18n("Change &Names..."), 0, this, TQT_SLOT(slotOptionsNames()), actionCollection(), "change_names"); ACTION("change_names")->setStatusText(i18n("Configure player names...")); ACTION("change_names")->setWhatsThis(i18n("Configure player names...")); actionCollection()->setHighlightingEnabled(true); - connect(actionCollection(), SIGNAL(actionStatusText(const QString &)), SLOT(slotStatusMsg(const QString &))); - connect(actionCollection(), SIGNAL(clearStatusText()), SLOT(slotClearStatusMsg())); + connect(actionCollection(), TQT_SIGNAL(actionStatusText(const TQString &)), TQT_SLOT(slotStatusMsg(const TQString &))); + connect(actionCollection(), TQT_SIGNAL(clearStatusText()), TQT_SLOT(slotClearStatusMsg())); - KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), + KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); } @@ -242,8 +242,8 @@ void LSkatApp::initStatusBar() slotStatusMsg(i18n("Welcome to Lieutenant Skat")); // computer move timer - procTimer=new QTimer(this); - connect(procTimer,SIGNAL(timeout()),this,SLOT(slotProcTimer())); + procTimer=new TQTimer(this); + connect(procTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(slotProcTimer())); } void LSkatApp::initDocument() @@ -295,11 +295,11 @@ void LSkatApp::saveProperties(KConfig *_cfg) } else { - QString filename=doc->getAbsFilePath(); + TQString filename=doc->getAbsFilePath(); _cfg->writePathEntry("filename", filename); _cfg->writeEntry("modified", doc->isModified()); - QString tempname = kapp->tempSaveName(filename); + TQString tempname = kapp->tempSaveName(filename); doc->saveDocument(tempname); } } @@ -307,21 +307,21 @@ void LSkatApp::saveProperties(KConfig *_cfg) void LSkatApp::readProperties(KConfig* _cfg) { - QString filename = _cfg->readPathEntry("filename"); + TQString filename = _cfg->readPathEntry("filename"); bool modified = _cfg->readBoolEntry("modified", false); if(modified) { bool canRecover; - QString tempname = kapp->checkRecoverFile(filename, canRecover); + TQString tempname = kapp->checkRecoverFile(filename, canRecover); if(canRecover) { doc->openDocument(tempname); doc->setModified(); - QFileInfo info(filename); + TQFileInfo info(filename); doc->setAbsFilePath(info.absFilePath()); doc->setTitle(info.fileName()); - QFile::remove(tempname); + TQFile::remove(tempname); } } else @@ -332,7 +332,7 @@ void LSkatApp::readProperties(KConfig* _cfg) } } - //QString caption=kapp->caption(); + //TQString caption=kapp->caption(); setCaption(i18n("Lieutenant Skat")); } @@ -349,16 +349,16 @@ bool LSkatApp::queryExit() } ///////////////////////////////////////////////////////////////////// -// SLOT IMPLEMENTATION +// TQT_SLOT IMPLEMENTATION ///////////////////////////////////////////////////////////////////// void LSkatApp::slotFileStatistics() { - QString message; + TQString message; message=i18n("Do you really want to clear the all time " "statistical data?"); - if (KMessageBox::Yes==KMessageBox::questionYesNo(this,message,QString::null,KStdGuiItem::clear())) + if (KMessageBox::Yes==KMessageBox::questionYesNo(this,message,TQString::null,KStdGuiItem::clear())) { doc->ClearStats(); doc->slotUpdateAllViews(0); @@ -370,18 +370,18 @@ void LSkatApp::slotFileMessage() { int res; - MsgDlg *dlg=new MsgDlg(this,QCString("Send message...")); + MsgDlg *dlg=new MsgDlg(this,TQCString("Send message...")); res=dlg->exec(); - if (res==QDialog::Accepted) + if (res==TQDialog::Accepted) { - QString s; + TQString s; s=dlg->GetMsg(); - if (!s || s.length()<1) s=QCString("..."); + if (!s || s.length()<1) s=TQCString("..."); KEMessage *msg=new KEMessage; // printf("Msg: %s\n",(char *)msg); - msg->AddData(QCString("Message"),(char *)(s.latin1())); + msg->AddData(TQCString("Message"),(char *)(s.latin1())); if (mInput->QueryType(0)==KG_INPUTTYPE_REMOTE) mInput->SendMsg(msg,0); if (mInput->QueryType(1)==KG_INPUTTYPE_REMOTE) @@ -403,14 +403,14 @@ void LSkatApp::slotFileEnd() slotStatusMsg(i18n("Game ended...start a new one...")); KEMessage *msg=new KEMessage; - msg->AddData(QCString("EndGame"),(short)1); + msg->AddData(TQCString("EndGame"),(short)1); if (mInput->QueryType(0)==KG_INPUTTYPE_REMOTE) mInput->SendMsg(msg,0); if (mInput->QueryType(1)==KG_INPUTTYPE_REMOTE) mInput->SendMsg(msg,1); msg->RemoveAll(); - msg->AddData(QCString("Terminate"),(short)1); + msg->AddData(TQCString("Terminate"),(short)1); if (mInput->QueryType(0)==KG_INPUTTYPE_PROCESS) mInput->SendMsg(msg,0); if (mInput->QueryType(1)==KG_INPUTTYPE_PROCESS) @@ -503,11 +503,11 @@ void LSkatApp::slotPlayer2(KG_INPUTTYPE i) void LSkatApp::slotOptionsNames() { - NameDlg *dlg=new NameDlg(this,QCString("Enter your name...")); + NameDlg *dlg=new NameDlg(this,TQCString("Enter your name...")); dlg->SetNames(doc->GetName(0),doc->GetName(1)); - if (dlg->exec()==QDialog::Accepted) + if (dlg->exec()==TQDialog::Accepted) { - QString n1,n2; + TQString n1,n2; dlg->GetNames(n1,n2); doc->SetName(0,n1); doc->SetName(1,n2); @@ -518,13 +518,13 @@ void LSkatApp::slotOptionsNames() void LSkatApp::slotOptionsCardDeck() { - QString s1,s2; + TQString s1,s2; int result; s1=doc->GetDeckpath(); s2=doc->GetCardpath(); result=KCardDialog::getCardDeck(s1,s2); - if (result==QDialog::Accepted) + if (result==TQDialog::Accepted) { doc->SetCardDeckPath(s1,s2); doc->slotUpdateAllViews(0); @@ -545,7 +545,7 @@ void LSkatApp::slotClearStatusMsg() slotStatusMsg(i18n("Ready")); } -void LSkatApp::slotStatusMsg(const QString &text) +void LSkatApp::slotStatusMsg(const TQString &text) { /////////////////////////////////////////////////////////////////// // change status message permanently @@ -553,7 +553,7 @@ void LSkatApp::slotStatusMsg(const QString &text) statusBar()->changeItem(text, ID_STATUS_MSG); } -void LSkatApp::slotStatusMover(const QString &text) +void LSkatApp::slotStatusMover(const TQString &text) { /////////////////////////////////////////////////////////////////// // change status mover permanently @@ -562,7 +562,7 @@ void LSkatApp::slotStatusMover(const QString &text) } -void LSkatApp::slotStatusHelpMsg(const QString &text) +void LSkatApp::slotStatusHelpMsg(const TQString &text) { /////////////////////////////////////////////////////////////////// // change status message of whole statusbar temporary (text, msec) @@ -583,7 +583,7 @@ void LSkatApp::slotProcTimer(void) /** Set the names in the mover field */ void LSkatApp::slotStatusNames(){ - QString msg; + TQString msg; if (!doc->IsRunning()) msg=i18n("No game running"); else { @@ -653,9 +653,9 @@ bool LSkatApp::MakeInputDevice(int no) } else if (type==KG_INPUTTYPE_REMOTE) { - QString host; + TQString host; short port; - QString Name; + TQString Name; msg=new KEMessage; PrepareGame(msg); // Build new connection @@ -665,14 +665,14 @@ bool LSkatApp::MakeInputDevice(int no) port=doc->QueryPort(); host=doc->QueryHost(); Name=doc->QueryName(); - msg->AddData(QCString("Port"),(short)port); - msg->AddData(QCString("IP"),(char *)(host.latin1())); - msg->AddData(QCString("Name"),(const char *)(Name.utf8())); + msg->AddData(TQCString("Port"),(short)port); + msg->AddData(TQCString("IP"),(char *)(host.latin1())); + msg->AddData(TQCString("Name"),(const char *)(Name.utf8())); res=mInput->SetInputDevice(no,type,msg); if (!res) { - QProgressDialog *progress; - QString s; + TQProgressDialog *progress; + TQString s; int tim,j; tim=10000; if (!host.isEmpty()) @@ -683,7 +683,7 @@ bool LSkatApp::MakeInputDevice(int no) { s=i18n("Offering remote connection on port %1...").arg(port); } - progress=new QProgressDialog(s, i18n("Abort"), tim, this,0,true ); + progress=new TQProgressDialog(s, i18n("Abort"), tim, this,0,true ); progress->setCaption(i18n("Lieutenant Skat")); for (j=0; j<tim; j++) { @@ -704,7 +704,7 @@ bool LSkatApp::MakeInputDevice(int no) { if (global_debug>10) printf("We want theother one to be client\n"); - msg->AddData(QCString("Client"),(short)-1); // force client + msg->AddData(TQCString("Client"),(short)-1); // force client mInput->SendMsg(msg,no); } // resp server @@ -712,7 +712,7 @@ bool LSkatApp::MakeInputDevice(int no) { if (global_debug>10) printf("We want theother one to be server\n"); - msg->AddData(QCString("Server"),(short)-1); // force server + msg->AddData(TQCString("Server"),(short)-1); // force server mInput->SendMsg(msg,no); } } @@ -728,8 +728,8 @@ bool LSkatApp::MakeInputDevice(int no) { if (mInput->QueryType(no)!=type) { - // QString path=kapp->dirs()->findExe(doc->QueryProcessName()); - QString path=doc->GetProcess(); + // TQString path=kapp->dirs()->findExe(doc->QueryProcessName()); + TQString path=doc->GetProcess(); if (global_debug>5) { printf("Make Process %d\n",no); @@ -737,7 +737,7 @@ bool LSkatApp::MakeInputDevice(int no) } if (path.isNull()) return false; msg=new KEMessage; - msg->AddData(QCString("ProcessName"),(char *)(path.latin1())); + msg->AddData(TQCString("ProcessName"),(char *)(path.latin1())); // msg->AddData("ProcessName",doc->QueryProcessName()); res=mInput->SetInputDevice(no,KG_INPUTTYPE_PROCESS,msg); delete msg; @@ -751,7 +751,7 @@ void LSkatApp::OptionsNetwork() { int res; - NetworkDlg *dlg=new NetworkDlg(this,QCString("Configure a network game...")); + NetworkDlg *dlg=new NetworkDlg(this,TQCString("Configure a network game...")); dlg->SetPort(doc->QueryPort()); dlg->SetHost(doc->QueryHost()); dlg->SetName(doc->QueryName()); @@ -768,13 +768,13 @@ void LSkatApp::slotPrepareProcessMove(KEMessage *msg) printf("+++ main should prepare process move\n"); slotStatusMsg(i18n("Waiting for the computer to move...")); - msg->AddData(QCString("Hint"),(short)0); - msg->AddData(QCString("Move"),(short)1); + msg->AddData(TQCString("Hint"),(short)0); + msg->AddData(TQCString("Move"),(short)1); if (global_debug>3) printf("PREPARE GAME in processmove\n"); if (global_debug>1) - msg->AddData(QCString("KLogSendMsg"),"process.log"); + msg->AddData(TQCString("KLogSendMsg"),"process.log"); PrepareGame(msg); } @@ -797,7 +797,7 @@ void LSkatApp::slotReceiveInput(KEMessage *msg,int ) /* if (global_debug>=0) { - QStrList *keys=msg->QueryKeys(); + TQStrList *keys=msg->QueryKeys(); char *it; printf(" MESSAGESIZE=%u\n",msg->QueryNumberOfKeys()); for (it=keys->first();it!=0;it=keys->next()) @@ -807,20 +807,20 @@ void LSkatApp::slotReceiveInput(KEMessage *msg,int ) } */ short move; - QString message; + TQString message; short x,y,player; bool remotesend; int size; - if (msg->HasKey(QCString("Debug"))) + if (msg->HasKey(TQCString("Debug"))) { char *debug; - msg->GetData(QCString("Debug"),debug,size); + msg->GetData(TQCString("Debug"),debug,size); printf("Received Debug: %d <%s>\n",size,debug); } - if (msg->HasKey(QCString("ConnectionLost"))) + if (msg->HasKey(TQCString("ConnectionLost"))) { - if (msg->GetData(QCString("ConnectionLost"),move)) + if (msg->GetData(TQCString("ConnectionLost"),move)) { if (move==0) { @@ -838,10 +838,10 @@ void LSkatApp::slotReceiveInput(KEMessage *msg,int ) } } } - if (msg->HasKey(QCString("Message"))) + if (msg->HasKey(TQCString("Message"))) { char *p; - if (msg->GetData(QCString("Message"),p,size)) + if (msg->GetData(TQCString("Message"),p,size)) { message=i18n("Message from remote player:\n")+p; KMessageBox::information(this,message); @@ -849,18 +849,18 @@ void LSkatApp::slotReceiveInput(KEMessage *msg,int ) printf("MESSAGE **** %s ****\n",message.latin1()); } } - if (msg->HasKey(QCString("EndGame"))) + if (msg->HasKey(TQCString("EndGame"))) { KEMessage *msg2=new KEMessage; - msg2->AddData(QCString("Terminate"),(short)1); + msg2->AddData(TQCString("Terminate"),(short)1); if (mInput->QueryType(0)==KG_INPUTTYPE_PROCESS) mInput->SendMsg(msg2,0); if (mInput->QueryType(1)==KG_INPUTTYPE_PROCESS) mInput->SendMsg(msg2,1); delete msg2; - msg->GetData(QCString("EndGame"),move); + msg->GetData(TQCString("EndGame"),move); message=i18n("Remote player ended game..."); KMessageBox::information(this,message); slotStatusMsg(message); @@ -870,19 +870,19 @@ void LSkatApp::slotReceiveInput(KEMessage *msg,int ) slotStatusNames(); } - if (msg->HasKey(QCString("Move"))) + if (msg->HasKey(TQCString("Move"))) { slotStatusMsg(i18n("Ready")); - msg->GetData(QCString("Move"),player); - msg->GetData(QCString("MoveX"),x); - msg->GetData(QCString("MoveY"),y); - remotesend=msg->HasKey(QCString("RemoteMove")); + msg->GetData(TQCString("Move"),player); + msg->GetData(TQCString("MoveX"),x); + msg->GetData(TQCString("MoveY"),y); + remotesend=msg->HasKey(TQCString("RemoteMove")); if (remotesend && doc->IsRemoteSwitch()) player=1-player; Move((int)x,(int)y,(int)player,remotesend); } // Client key is automatically added by message system !!! - if (msg->HasKey(QCString("Client"))) + if (msg->HasKey(TQCString("Client"))) { if (global_debug>5) printf("We are client and extracting game data now.\n"); @@ -895,7 +895,7 @@ void LSkatApp::slotReceiveInput(KEMessage *msg,int ) mInput->Next(doc->GetStartPlayer()); } // Server key is automatically added by message system !!! - if (msg->HasKey(QCString("Server"))) + if (msg->HasKey(TQCString("Server"))) { if (global_debug>5) printf("We are server now.\n"); @@ -910,7 +910,7 @@ void LSkatApp::slotReceiveInput(KEMessage *msg,int ) void LSkatApp::MoveFinished() { int res=doc->MakeMove(); - QString ld,s; + TQString ld,s; if (res==2) // end game { doc->EvaluateGame(); @@ -969,10 +969,10 @@ void LSkatApp::Move(int x,int y,int player,bool remote) { msg=new KEMessage; if (doc->IsRemoteSwitch()) player=1-player; - msg->AddData(QCString("Move"),(short)player); - msg->AddData(QCString("MoveX"),(short)x); - msg->AddData(QCString("MoveY"),(short)y); - msg->AddData(QCString("RemoteMove"),(short)1); + msg->AddData(TQCString("Move"),(short)player); + msg->AddData(TQCString("MoveX"),(short)x); + msg->AddData(TQCString("MoveY"),(short)y); + msg->AddData(TQCString("RemoteMove"),(short)1); if (mInput->QueryType(0)==KG_INPUTTYPE_REMOTE) mInput->SendMsg(msg,0); if (mInput->QueryType(1)==KG_INPUTTYPE_REMOTE) @@ -1004,22 +1004,22 @@ void LSkatApp::PrepareGame(KEMessage *msg) if (!msg) return; - msg->AddData(QCString("Cards"),(char *)doc->GetCardP(),NO_OF_CARDS*sizeof(int)); - msg->AddData(QCString("Startplayer"),(short)doc->GetStartPlayer()); - msg->AddData(QCString("CurrentPlayer"),(short)doc->GetCurrentPlayer()); + msg->AddData(TQCString("Cards"),(char *)doc->GetCardP(),NO_OF_CARDS*sizeof(int)); + msg->AddData(TQCString("Startplayer"),(short)doc->GetStartPlayer()); + msg->AddData(TQCString("CurrentPlayer"),(short)doc->GetCurrentPlayer()); if (doc->GetPlayedBy(0)==KG_INPUTTYPE_REMOTE) - msg->AddData(QCString("RemoteIs"),(short)0); + msg->AddData(TQCString("RemoteIs"),(short)0); else if (doc->GetPlayedBy(1)==KG_INPUTTYPE_REMOTE) - msg->AddData(QCString("RemoteIs"),(short)1); - msg->AddData(QCString("Trump"),(short)doc->GetTrump()); + msg->AddData(TQCString("RemoteIs"),(short)1); + msg->AddData(TQCString("Trump"),(short)doc->GetTrump()); // For computer player // -1 or the current played card - msg->AddData(QCString("CurrentMove"),(short)doc->GetMove(doc->GetStartPlayer())); - msg->AddData(QCString("Height"),(char *)doc->GetCardHeightP(),NO_OF_CARDS/2*sizeof(int)); - msg->AddData(QCString("No"),(short)doc->GetMoveNo()); - msg->AddData(QCString("Sc1"),(short)doc->GetScore(0)); - msg->AddData(QCString("Sc2"),(short)doc->GetScore(1)); - msg->AddData(QCString("Level"),(short)doc->GetComputerLevel()); + msg->AddData(TQCString("CurrentMove"),(short)doc->GetMove(doc->GetStartPlayer())); + msg->AddData(TQCString("Height"),(char *)doc->GetCardHeightP(),NO_OF_CARDS/2*sizeof(int)); + msg->AddData(TQCString("No"),(short)doc->GetMoveNo()); + msg->AddData(TQCString("Sc1"),(short)doc->GetScore(0)); + msg->AddData(TQCString("Sc2"),(short)doc->GetScore(1)); + msg->AddData(TQCString("Level"),(short)doc->GetComputerLevel()); } void LSkatApp::ExtractGame(KEMessage *msg) @@ -1029,7 +1029,7 @@ void LSkatApp::ExtractGame(KEMessage *msg) // Do we have to switch players? bool switchit; short remote; - msg->GetData(QCString("RemoteIs"),remote); + msg->GetData(TQCString("RemoteIs"),remote); if (doc->GetPlayedBy(remote)==KG_INPUTTYPE_REMOTE) switchit=true; else switchit=false; @@ -1038,10 +1038,10 @@ void LSkatApp::ExtractGame(KEMessage *msg) int *cards; char *p; short trump; - msg->GetData(QCString("Startplayer"),start); - msg->GetData(QCString("Cards"),p,size); + msg->GetData(TQCString("Startplayer"),start); + msg->GetData(TQCString("Cards"),p,size); cards=(int *)p; - msg->GetData(QCString("Trump"),trump); + msg->GetData(TQCString("Trump"),trump); if (size!=NO_OF_CARDS*sizeof(int)) { printf("Error: Transmission of cards failed..wrong sizes\n"); @@ -1073,7 +1073,7 @@ void LSkatApp::ExtractGame(KEMessage *msg) } -void LSkatApp::SetGrafix(QString s) +void LSkatApp::SetGrafix(TQString s) { mGrafix=s; } diff --git a/lskat/lskat/lskat.h b/lskat/lskat/lskat.h index b5686dde..e44f7e1b 100644 --- a/lskat/lskat/lskat.h +++ b/lskat/lskat/lskat.h @@ -24,7 +24,7 @@ #endif // include files for Qt -#include <qstrlist.h> +#include <tqstrlist.h> // include files for KDE #include <kapplication.h> @@ -91,7 +91,7 @@ class LSkatApp : public KMainWindow LSkatDoc *getDocument() const; void MoveFinished(); void Move(int x,int y,int player,bool remote); - void SetGrafix(QString s); + void SetGrafix(TQString s); protected: void NewGame(); @@ -166,16 +166,16 @@ class LSkatApp : public KMainWindow /** changes the statusbar contents for the standard label permanently, used to indicate current actions. * @param text the text that is displayed in the statusbar */ - void slotStatusMsg(const QString &text); + void slotStatusMsg(const TQString &text); void slotClearStatusMsg(); /** changes the status message of the whole statusbar for two seconds, then restores the last status. This is used to display * statusbar messages that give information about actions for toolbar icons and menuentries. * @param text the text that is displayed in the statusbar */ - void slotStatusHelpMsg(const QString &text); + void slotStatusHelpMsg(const TQString &text); /** Set the names in the mover field */ void slotStatusNames(); - void slotStatusMover(const QString &text); + void slotStatusMover(const TQString &text); void slotLevel(); void slotStartplayer(); @@ -194,13 +194,13 @@ protected: // Protected attributes /** */ /** Counts the time in the status bar */ - QTimer * procTimer; + TQTimer * procTimer; KEInput *mInput; - QString mGrafix; + TQString mGrafix; private: /** contains the recently used filenames */ - QStrList recentFiles; + TQStrList recentFiles; /** the configuration object of the application */ KConfig *config; diff --git a/lskat/lskat/lskatdoc.cpp b/lskat/lskat/lskatdoc.cpp index 8da62ea4..fd95f0c8 100644 --- a/lskat/lskat/lskatdoc.cpp +++ b/lskat/lskat/lskatdoc.cpp @@ -16,8 +16,8 @@ ***************************************************************************/ // include files for Qt -#include <qdir.h> -#include <qfileinfo.h> +#include <tqdir.h> +#include <tqfileinfo.h> #include <time.h> #include <unistd.h> #include <stdlib.h> @@ -34,14 +34,14 @@ #include "lskatview.h" #include <kcarddialog.h> -QPtrList<LSkatView> *LSkatDoc::pViewList = 0L; +TQPtrList<LSkatView> *LSkatDoc::pViewList = 0L; -LSkatDoc::LSkatDoc(QWidget *parent, const char *name) : QObject(parent, name) +LSkatDoc::LSkatDoc(TQWidget *parent, const char *name) : TQObject(parent, name) { int i; if(!pViewList) { - pViewList = new QPtrList<LSkatView>(); + pViewList = new TQPtrList<LSkatView>(); } pViewList->setAutoDelete(true); @@ -95,22 +95,22 @@ void LSkatDoc::removeView(LSkatView *view) pViewList->remove(view); } -void LSkatDoc::setAbsFilePath(const QString &filename) +void LSkatDoc::setAbsFilePath(const TQString &filename) { absFilePath=filename; } -const QString &LSkatDoc::getAbsFilePath() const +const TQString &LSkatDoc::getAbsFilePath() const { return absFilePath; } -void LSkatDoc::setTitle(const QString &_t) +void LSkatDoc::setTitle(const TQString &_t) { title=_t; } -const QString &LSkatDoc::getTitle() const +const TQString &LSkatDoc::getTitle() const { return title; } @@ -162,11 +162,11 @@ void LSkatDoc::closeDocument() deleteContents(); } -bool LSkatDoc::newDocument(KConfig * /*config*/,QString path) +bool LSkatDoc::newDocument(KConfig * /*config*/,TQString path) { int res; modified=false; - absFilePath=QDir::homeDirPath(); + absFilePath=TQDir::homeDirPath(); title=i18n("Untitled"); if (global_debug>1) printf("path=%s\n",path.latin1()); res=LoadBitmap(path); @@ -174,7 +174,7 @@ bool LSkatDoc::newDocument(KConfig * /*config*/,QString path) return true; } -bool LSkatDoc::LoadGrafix(QString path) +bool LSkatDoc::LoadGrafix(TQString path) { int res; res=LoadCards(cardPath); @@ -184,7 +184,7 @@ bool LSkatDoc::LoadGrafix(QString path) return true; } -bool LSkatDoc::SetCardDeckPath(QString deck,QString card) +bool LSkatDoc::SetCardDeckPath(TQString deck,TQString card) { bool update=false; if (!deck.isNull() && deck!=deckPath) @@ -202,9 +202,9 @@ bool LSkatDoc::SetCardDeckPath(QString deck,QString card) return update; } -bool LSkatDoc::openDocument(const QString &filename, const char * /*format*/ /*=0*/) +bool LSkatDoc::openDocument(const TQString &filename, const char * /*format*/ /*=0*/) { - QFileInfo fileInfo(filename); + TQFileInfo fileInfo(filename); title=fileInfo.fileName(); absFilePath=fileInfo.absFilePath(); ///////////////////////////////////////////////// @@ -215,7 +215,7 @@ bool LSkatDoc::openDocument(const QString &filename, const char * /*format*/ /*= return true; } -bool LSkatDoc::saveDocument(const QString & /*filename*/, const char * /*format*/ /*=0*/) +bool LSkatDoc::saveDocument(const TQString & /*filename*/, const char * /*format*/ /*=0*/) { ///////////////////////////////////////////////// // TODO: Add your document saving code here @@ -535,8 +535,8 @@ void LSkatDoc::SetCurrentPlayer(int i) {currentplayer=i;} int LSkatDoc::GetStartPlayer() {return startplayer;} void LSkatDoc::SetStartPlayer(int i) {startplayer=i;} -void LSkatDoc::SetName(int no, QString n) { names[no]=n; } -QString LSkatDoc::GetName(int no) {return names[no];} +void LSkatDoc::SetName(int no, TQString n) { names[no]=n; } +TQString LSkatDoc::GetName(int no) {return names[no];} int LSkatDoc::GetScore(int no) {return score[no];} int LSkatDoc::GetMoveNo() {return moveno;} @@ -562,10 +562,10 @@ bool LSkatDoc::IsIntro() {return isintro;} bool LSkatDoc::WasRunning() {return wasgame;} void LSkatDoc::SetIntro(bool b) {isintro=b;} -int LSkatDoc::LoadBitmap(QString path) +int LSkatDoc::LoadBitmap(TQString path) { int i; - QString buf; + TQString buf; if (global_debug>5) printf("Loading bitmaps\n"); for (i=0;i<NO_OF_TRUMPS;i++) { @@ -606,9 +606,9 @@ int LSkatDoc::LoadBitmap(QString path) } -int LSkatDoc::LoadCards(QString path) +int LSkatDoc::LoadCards(TQString path) { - QString buf; + TQString buf; for (int i=0;i<NO_OF_CARDS;i++) { buf.sprintf("%s%d.png",path.latin1(),i+1); @@ -622,7 +622,7 @@ int LSkatDoc::LoadCards(QString path) return 1; } -int LSkatDoc::LoadDeck(QString path) +int LSkatDoc::LoadDeck(TQString path) { if (!mPixDeck.load(path))return 0; return 1; @@ -651,11 +651,11 @@ void LSkatDoc::SetServer(bool b) { server=b; } -void LSkatDoc::SetHost(QString h) +void LSkatDoc::SetHost(TQString h) { host=h; } -void LSkatDoc::SetName(const QString& n) +void LSkatDoc::SetName(const TQString& n) { Name=n; } @@ -663,7 +663,7 @@ void LSkatDoc::SetPort(short p) { port=p; } -QString LSkatDoc::QueryHost() +TQString LSkatDoc::QueryHost() { return host; } @@ -671,7 +671,7 @@ short LSkatDoc::QueryPort() { return port; } -QString LSkatDoc::QueryName() const +TQString LSkatDoc::QueryName() const { return Name; } @@ -714,7 +714,7 @@ int LSkatDoc::GetStatPoints(int no) return stat_points[no]; } -QString LSkatDoc::GetProcess() +TQString LSkatDoc::GetProcess() { return procfile; } @@ -733,18 +733,18 @@ void LSkatDoc::ReadConfig(KConfig *config) { KConfig emailCfg( "emaildefaults", true ); emailCfg.setGroup( "UserInfo" ); - QString name = emailCfg.readEntry( "FullName" ); + TQString name = emailCfg.readEntry( "FullName" ); if ( name.isEmpty() ) { struct passwd *pw = getpwuid( getuid() ); if ( pw ) - name = QString::fromLocal8Bit( pw->pw_gecos ); + name = TQString::fromLocal8Bit( pw->pw_gecos ); } config->setGroup("Parameter"); host=config->readEntry("host"); port=(unsigned short)config->readNumEntry("port",7432); - procfile=config->readEntry("process",QCString("lskatproc")); + procfile=config->readEntry("process",TQCString("lskatproc")); Name=config->readEntry("gamename"); names[0]=config->readEntry("Name1",i18n("Alice")); // names[1]=config->readEntry("Name2",i18n("Bob")); diff --git a/lskat/lskat/lskatdoc.h b/lskat/lskat/lskatdoc.h index 1b880360..8e62a27f 100644 --- a/lskat/lskat/lskatdoc.h +++ b/lskat/lskat/lskatdoc.h @@ -23,9 +23,9 @@ #endif // include files for QT -#include <qobject.h> -#include <qstring.h> -#include <qptrlist.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqptrlist.h> #include <kconfig.h> #include "lskat.h" @@ -49,7 +49,7 @@ class LSkatDoc : public QObject Q_OBJECT public: /** Constructor for the fileclass of the application */ - LSkatDoc(QWidget *parent, const char *name=0); + LSkatDoc(TQWidget *parent, const char *name=0); /** Destructor for the fileclass of the application */ ~LSkatDoc(); @@ -66,21 +66,21 @@ class LSkatDoc : public QObject /** deletes the document's contents */ void deleteContents(); /** initializes the document generally */ - bool newDocument(KConfig *config,QString path); + bool newDocument(KConfig *config,TQString path); /** closes the acutal document */ void closeDocument(); /** loads the document by filename and format and emits the updateViews() signal */ - bool openDocument(const QString &filename, const char *format=0); + bool openDocument(const TQString &filename, const char *format=0); /** saves the document under filename and format.*/ - bool saveDocument(const QString &filename, const char *format=0); + bool saveDocument(const TQString &filename, const char *format=0); /** sets the path to the file connected with the document */ - void setAbsFilePath(const QString &filename); + void setAbsFilePath(const TQString &filename); /** returns the pathname of the current document file*/ - const QString &getAbsFilePath() const; + const TQString &getAbsFilePath() const; /** sets the filename of the document */ - void setTitle(const QString &_t); + void setTitle(const TQString &_t); /** returns the title of the document */ - const QString &getTitle() const; + const TQString &getTitle() const; int random(int max); void NewGame(); @@ -102,8 +102,8 @@ class LSkatDoc : public QObject void SetCurrentPlayer(int i); int GetStartPlayer(); void SetStartPlayer(int i); - void SetName(int no,QString n); - QString GetName(int no); + void SetName(int no,TQString n); + TQString GetName(int no); int GetScore(int no); int GetMoveNo(); bool LegalMove(int card1, int card2); @@ -143,48 +143,48 @@ class LSkatDoc : public QObject void UpdateViews(int mode); bool IsServer(); void SetServer(bool b); - void SetHost(QString h); - void SetName(const QString& n); + void SetHost(TQString h); + void SetName(const TQString& n); void SetPort(short p); - QString QueryHost(); + TQString QueryHost(); short QueryPort(); - QString QueryName() const; + TQString QueryName() const; // Only for fast remote access int *GetCardP(); int *GetCardHeightP(); void SetCard(int i,int c); bool IsRemoteSwitch(); void SetRemoteSwitch(bool b); - QString GetProcess(); - int LoadCards(QString path); - int LoadDeck(QString path); - bool SetCardDeckPath(QString deck,QString card); - QString GetDeckpath() {return deckPath;} - QString GetCardpath() {return cardPath;} - bool LoadGrafix(QString path); + TQString GetProcess(); + int LoadCards(TQString path); + int LoadDeck(TQString path); + bool SetCardDeckPath(TQString deck,TQString card); + TQString GetDeckpath() {return deckPath;} + TQString GetCardpath() {return cardPath;} + bool LoadGrafix(TQString path); protected: void initrandom(); - int LoadBitmap(QString path); + int LoadBitmap(TQString path); public: - QPixmap mPixCard[NO_OF_CARDS]; - QPixmap mPixTrump[NO_OF_TRUMPS]; - QPixmap mPixDeck; - QPixmap mPixBackground; - QSize cardsize; - QPixmap mPixType[3]; - QPixmap mPixAnim[NO_OF_ANIM]; + TQPixmap mPixCard[NO_OF_CARDS]; + TQPixmap mPixTrump[NO_OF_TRUMPS]; + TQPixmap mPixDeck; + TQPixmap mPixBackground; + TQSize cardsize; + TQPixmap mPixType[3]; + TQPixmap mPixAnim[NO_OF_ANIM]; private: - QString procfile; - QString picpath; + TQString procfile; + TQString picpath; int delpath; bool remoteswitch; KEInput *inputHandler; short port; - QString host; - QString Name; + TQString host; + TQString Name; bool server; bool lock; int startplayer; @@ -198,7 +198,7 @@ public: int movestatus; int currentplayer; CCOLOUR trump; - QString names[2]; + TQString names[2]; int score[2]; int laststartplayer; int began_game; @@ -222,14 +222,14 @@ public: public: /** the list of the views currently connected to the document */ - static QPtrList<LSkatView> *pViewList; + static TQPtrList<LSkatView> *pViewList; private: /** the modified flag of the current document */ bool modified; - QString title; - QString absFilePath; - QString deckPath,cardPath; + TQString title; + TQString absFilePath; + TQString deckPath,cardPath; }; #endif // LSKATDOC_H diff --git a/lskat/lskat/lskatview.cpp b/lskat/lskat/lskatview.cpp index c14d5cee..a338bc00 100644 --- a/lskat/lskat/lskatview.cpp +++ b/lskat/lskat/lskatview.cpp @@ -16,14 +16,14 @@ ***************************************************************************/ // include files for Qt -#include <qpixmap.h> -#include <qcolor.h> -#include <qrect.h> -#include <qfontmetrics.h> -#include <qpoint.h> -#include <qstring.h> -#include <qpainter.h> -#include <qdatetime.h> +#include <tqpixmap.h> +#include <tqcolor.h> +#include <tqrect.h> +#include <tqfontmetrics.h> +#include <tqpoint.h> +#include <tqstring.h> +#include <tqpainter.h> +#include <tqdatetime.h> #include <kmessagebox.h> #include <kdebug.h> #include <klocale.h> @@ -92,39 +92,39 @@ //#define COL_STATUSLIGHT white #define COL_STATUSBORDER black -//#define COL_STATUSFIELD QColor(192,192,192) -//#define COL_STATUSDARK QColor(65,65,65) -#define COL_STATUSFIELD QColor(130,130,255) -#define COL_STATUSDARK QColor(0,0,65) -#define COL_STATUSLIGHT QColor(210,210,255) -#define COL_PLAYER QColor(255,255,0) +//#define COL_STATUSFIELD TQColor(192,192,192) +//#define COL_STATUSDARK TQColor(65,65,65) +#define COL_STATUSFIELD TQColor(130,130,255) +#define COL_STATUSDARK TQColor(0,0,65) +#define COL_STATUSLIGHT TQColor(210,210,255) +#define COL_PLAYER TQColor(255,255,0) #define DLGBOXTITLE TITLE #define MOVECOUNTER 20 // so many moves when playing card #define MOVE_TIMER_DELAY 7 // timer in milllisec default 7 -LSkatView::LSkatView(QWidget *parent, const char *name) : QWidget(parent, name) +LSkatView::LSkatView(TQWidget *parent, const char *name) : TQWidget(parent, name) { setBackgroundMode(PaletteBase); // setBackgroundMode(NoBackground); - status_rect1=QRect(412,CARD_Y_OFFSET+5,180,95+25); - status_rect2=QRect(412,310,180,95+25); - status_rect3=QRect(CARD_X_OFFSET+60,CARD_Y_OFFSET+5+100+15+20, + status_rect1=TQRect(412,CARD_Y_OFFSET+5,180,95+25); + status_rect2=TQRect(412,310,180,95+25); + status_rect3=TQRect(CARD_X_OFFSET+60,CARD_Y_OFFSET+5+100+15+20, 400,320-100-CARD_Y_OFFSET-30); - setBackgroundColor(QColor(0,0,128)); + setBackgroundColor(TQColor(0,0,128)); setBackgroundPixmap( getDocument()->mPixBackground ); - moveTimer=new QTimer(this); + moveTimer=new TQTimer(this); moveTimer->stop(); - connect(moveTimer,SIGNAL(timeout()),this,SLOT(moveTimerReady())); + connect(moveTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(moveTimerReady())); introcnt=0; - introTimer=new QTimer(this); + introTimer=new TQTimer(this); introTimer->stop(); - connect(introTimer,SIGNAL(timeout()),this,SLOT(introTimerReady())); + connect(introTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(introTimerReady())); introTimer->start(75,FALSE); for (int i=0;i<NO_OF_CARDS;i++) @@ -146,11 +146,11 @@ LSkatDoc *LSkatView::getDocument() const // offset: An offset to the rect to make it smaller // width: The width of the border // mode: 0: Light border, 1: dark border -void LSkatView::drawBorder(QPainter *p,QRect rect,int offset,int width,int mode) +void LSkatView::drawBorder(TQPainter *p,TQRect rect,int offset,int width,int mode) { -QPen graypen; +TQPen graypen; int i; -QPoint p1,p2; +TQPoint p1,p2; if (mode!=0 && mode!=1) return; @@ -179,16 +179,16 @@ QPoint p1,p2; // draw a move by animating the movment and turning of the // card. This is called until the card reaches its final // position -void LSkatView::drawMove(QPainter *p) +void LSkatView::drawMove(TQPainter *p) { int m1,m2; int below; - QPoint point1,point2; + TQPoint point1,point2; m1=getDocument()->GetMove(0); m2=getDocument()->GetMove(1); - point1=QPoint(CARD_X_MOVE1,CARD_Y_MOVE1); - point2=QPoint(CARD_X_MOVE2,CARD_Y_MOVE2); + point1=TQPoint(CARD_X_MOVE1,CARD_Y_MOVE1); + point2=TQPoint(CARD_X_MOVE2,CARD_Y_MOVE2); below=getDocument()->GetLastStartPlayer(); if (below<0) below=getDocument()->GetStartPlayer(); @@ -205,7 +205,7 @@ void LSkatView::drawMove(QPainter *p) } int card; - QPoint point; + TQPoint point; card=getDocument()->GetMoveStatus(); if (card>=0) { @@ -215,23 +215,23 @@ void LSkatView::drawMove(QPainter *p) // turn new card if ((double)cardmovecnt/(double)MOVECOUNTER>0.5) { - QPixmap pix1(getDocument()->mPixCard[cardmoveunder]); + TQPixmap pix1(getDocument()->mPixCard[cardmoveunder]); int wid=pix1.width(); - QWMatrix m; + TQWMatrix m; m.scale(2.0*((double)cardmovecnt/(double)MOVECOUNTER-0.5),1.0); pix1=pix1.xForm(m); - point=QPoint((wid-pix1.width())/2,0); + point=TQPoint((wid-pix1.width())/2,0); p->drawPixmap(cardorigin+point,pix1); } // turn deck else { - QPixmap pix1(getDocument()->mPixDeck); + TQPixmap pix1(getDocument()->mPixDeck); int wid=pix1.width(); - QWMatrix m; + TQWMatrix m; m.scale(1.0-2.0*((double)cardmovecnt/(double)MOVECOUNTER),1.0); pix1=pix1.xForm(m); - point=QPoint((wid-pix1.width())/2,0); + point=TQPoint((wid-pix1.width())/2,0); p->drawPixmap(cardorigin+point,pix1); } } /* end turn card */ @@ -244,18 +244,18 @@ void LSkatView::drawMove(QPainter *p) // Show the intro (Cards+Text) // This is called repeatetly -void LSkatView::drawIntro(QPainter *p) +void LSkatView::drawIntro(TQPainter *p) { int i,c1,c2,x,cnt,y,col,col2,col3,col4; // The window width; // int win_width = p->window().width(); - QPoint point,point1,p2; - QString s; + TQPoint point,point1,p2; + TQString s; // Get a nice font - QFont font = KGlobalSettings::generalFont(); + TQFont font = KGlobalSettings::generalFont(); font.setPointSize(48); // Get the font info to determine text sizes - QFontMetrics fontMetrics(font); + TQFontMetrics fontMetrics(font); p->setFont(font); @@ -264,17 +264,17 @@ void LSkatView::drawIntro(QPainter *p) i=0; - point=QPoint(20,20); - point1=QPoint(550,20); + point=TQPoint(20,20); + point1=TQPoint(550,20); for (i=0;i<cnt;i++) { x=(int)((i+10)*5*sin(1.5*i*M_PI/(float)NO_OF_CARDS)); c1=introCards[i]; c2=introCards[(i+17)%NO_OF_CARDS]; - p2=QPoint(i*10+x, i*10); + p2=TQPoint(i*10+x, i*10); p->drawPixmap(point+p2,getDocument()->mPixCard[c1]); - p2=QPoint(-i*10-x, i*10); + p2=TQPoint(-i*10-x, i*10); p->drawPixmap(point1+p2,getDocument()->mPixCard[c2]); } @@ -288,38 +288,38 @@ void LSkatView::drawIntro(QPainter *p) s=i18n("Lieutenant Skat"); x=310-fontMetrics.width(s)/2; y=-20+(int)(200.0*sin(0.5*M_PI/(float)NO_OF_CARDS*cnt)); - p->setPen(QColor(col4,col2,0)); + p->setPen(TQColor(col4,col2,0)); p->drawText(x-2,y+2,s); - p->setPen(QColor(col3,col,0)); + p->setPen(TQColor(col3,col,0)); p->drawText(x,y,s); s=i18n("for"); y=270+(NO_OF_CARDS-cnt)*3; x=-fontMetrics.width(s)/2+(int)(310.0*sin(0.5*M_PI/(float)NO_OF_CARDS*cnt)); - p->setPen(QColor(col4,col2,0)); + p->setPen(TQColor(col4,col2,0)); p->drawText(x-2,y+2,s); - p->setPen(QColor(col3,col,0)); + p->setPen(TQColor(col3,col,0)); p->drawText(x,y,s); s=i18n("K D E"); y=350+(NO_OF_CARDS-cnt)*3; // x=640-(int)(380.0*sin(0.5*M_PI/(float)NO_OF_CARDS*cnt)); x=570-fontMetrics.width(s)/2-(int)(260.0*sin(0.5*M_PI/(float)NO_OF_CARDS*cnt)); - p->setPen(QColor(col4,col2,0)); + p->setPen(TQColor(col4,col2,0)); p->drawText(x-2,y+2,s); - p->setPen(QColor(col3,col,0)); + p->setPen(TQColor(col3,col,0)); p->drawText(x,y,s); } // Draw all cards to create the game board -void LSkatView::drawDeck(QPainter *p) +void LSkatView::drawDeck(TQPainter *p) { int x,y,card; int player,pos,height; - QPoint point; + TQPoint point; for (y=0;y<4;y++) { @@ -338,7 +338,7 @@ void LSkatView::drawDeck(QPainter *p) if (height==2) - p->drawPixmap(point-QPoint(CARD_X_DECK,CARD_Y_DECK),getDocument()->mPixDeck); + p->drawPixmap(point-TQPoint(CARD_X_DECK,CARD_Y_DECK),getDocument()->mPixDeck); if (cardmovecnt<1 || x!=cardmovex || y!=cardmovey) { @@ -358,18 +358,18 @@ void LSkatView::drawDeck(QPainter *p) } } // Draw the winner field -void LSkatView::drawFinal(QPainter *p) +void LSkatView::drawFinal(TQPainter *p) { int sc1,sc0,pt0,pt1; - //QPoint p1,p2; + //TQPoint p1,p2; int trump; - //QRect r; - QString ld; + //TQRect r; + TQString ld; int ts[10]; - QFont font24 = KGlobalSettings::generalFont(); + TQFont font24 = KGlobalSettings::generalFont(); font24.setPointSize(24); - QFont font14 = KGlobalSettings::generalFont(); + TQFont font14 = KGlobalSettings::generalFont(); font14.setPointSize(13); //p1=status_rect3.topLeft(); @@ -394,14 +394,14 @@ void LSkatView::drawFinal(QPainter *p) - QString line1,line2,line3,line4,line5; - QString col1_3,col2_3,col3_3,col4_3; - QString col1_4,col2_4,col3_4,col4_4; - QRect sumrect; - QRect rect; - QRect brect1,brect2,brect3,brect4,brect5; - QRect brect1_3,brect2_3,brect3_3,brect4_3; - QRect brect1_4,brect2_4,brect3_4,brect4_4; + TQString line1,line2,line3,line4,line5; + TQString col1_3,col2_3,col3_3,col4_3; + TQString col1_4,col2_4,col3_4,col4_4; + TQRect sumrect; + TQRect rect; + TQRect brect1,brect2,brect3,brect4,brect5; + TQRect brect1_3,brect2_3,brect3_3,brect4_3; + TQRect brect1_4,brect2_4,brect3_4,brect4_4; // Calculate geometry line1=i18n("Game over"); @@ -409,14 +409,14 @@ void LSkatView::drawFinal(QPainter *p) //rect1.moveBy(0,FINAL_Y0-24); p->setFont(font24); brect1=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line1); - //QRect wrect=p->window(); + //TQRect wrect=p->window(); sumrect=brect1; if (sc0+sc1!=120) // aborted { line2=i18n("Game was aborted - no winner"); int hp=getDocument()->mPixTrump[trump].height()+5; - rect=QRect(0,hp>sumrect.height()?hp:sumrect.height(),p->window().width(),p->window().height()); + rect=TQRect(0,hp>sumrect.height()?hp:sumrect.height(),p->window().width(),p->window().height()); p->setFont(font14); brect2=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line2); sumrect|=brect2; @@ -436,55 +436,55 @@ void LSkatView::drawFinal(QPainter *p) line2=i18n("Player 2 - %1 won ").arg(getDocument()->GetName(1)); } int hp=getDocument()->mPixTrump[trump].height()+5; - rect=QRect(0,hp>sumrect.height()?hp:sumrect.height(),p->window().width(),p->window().height()); + rect=TQRect(0,hp>sumrect.height()?hp:sumrect.height(),p->window().width(),p->window().height()); p->setFont(font14); brect2=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line2); sumrect|=brect2; p->setFont(font14); col1_3=i18n("Score:"); - col1_4=QString(" "); - rect=QRect(0,0,p->window().width(),p->window().height()); + col1_4=TQString(" "); + rect=TQRect(0,0,p->window().width(),p->window().height()); brect1_3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col1_3); ts[0]=brect1_3.width()+10; col2_3=getDocument()->GetName(0); - rect=QRect(0,0,p->window().width(),p->window().height()); + rect=TQRect(0,0,p->window().width(),p->window().height()); brect2_3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col2_3); col2_4=getDocument()->GetName(1); - rect=QRect(0,0,p->window().width(),p->window().height()); + rect=TQRect(0,0,p->window().width(),p->window().height()); brect2_4=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col2_4); rect=brect2_3|brect2_4; ts[1]=ts[0]+rect.width()+10; col3_3.sprintf("%d",sc0); - rect=QRect(0,0,p->window().width(),p->window().height()); + rect=TQRect(0,0,p->window().width(),p->window().height()); brect3_3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col3_3); col3_4.sprintf("%d",sc1); - rect=QRect(0,0,p->window().width(),p->window().height()); + rect=TQRect(0,0,p->window().width(),p->window().height()); brect3_4=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col3_4); rect=brect3_3|brect3_4; ts[2]=ts[1]+rect.width()+30; col4_3=i18n("%1 points").arg(pt0); - rect=QRect(0,0,p->window().width(),p->window().height()); + rect=TQRect(0,0,p->window().width(),p->window().height()); brect4_3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col4_3); col4_4=i18n("%1 points").arg(pt1); - rect=QRect(0,0,p->window().width(),p->window().height()); + rect=TQRect(0,0,p->window().width(),p->window().height()); brect4_4=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col4_4); rect=brect4_3|brect4_4; ts[3]=ts[2]+rect.width()+10; ts[4]=0; - line3=col1_3+QString("\t")+col2_3+QString("\t")+col3_3+QString("\t")+col4_3; - line4=col1_4+QString("\t")+col2_4+QString("\t")+col3_4+QString("\t")+col4_4; - brect3=QRect(sumrect.left(),sumrect.bottom()+10,ts[3],brect4_3.height()); - brect4=QRect(sumrect.left(),sumrect.bottom()+10+brect4_3.height()+6,ts[3],brect4_4.height()); + line3=col1_3+TQString("\t")+col2_3+TQString("\t")+col3_3+TQString("\t")+col4_3; + line4=col1_4+TQString("\t")+col2_4+TQString("\t")+col3_4+TQString("\t")+col4_4; + brect3=TQRect(sumrect.left(),sumrect.bottom()+10,ts[3],brect4_3.height()); + brect4=TQRect(sumrect.left(),sumrect.bottom()+10+brect4_3.height()+6,ts[3],brect4_4.height()); sumrect|=brect3; sumrect|=brect4; @@ -493,7 +493,7 @@ void LSkatView::drawFinal(QPainter *p) if (sc0>=120) { line5=i18n("%1 won to nil. Congratulations!").arg(getDocument()->GetName(0)); - rect=QRect(0,sumrect.height()+10,p->window().width(),p->window().height()); + rect=TQRect(0,sumrect.height()+10,p->window().width(),p->window().height()); brect5=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5); sumrect|=brect5; } @@ -503,14 +503,14 @@ void LSkatView::drawFinal(QPainter *p) line5=i18n("%1 won with 90 points. Super!").arg(getDocument()->GetName(0)); else line5=i18n("%1 won over 90 points. Super!").arg(getDocument()->GetName(0)); - rect=QRect(0,sumrect.height()+10,p->window().width(),p->window().height()); + rect=TQRect(0,sumrect.height()+10,p->window().width(),p->window().height()); brect5=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5); sumrect|=brect5; } if (sc1>=120) { line5=i18n("%1 won to nil. Congratulations!").arg(getDocument()->GetName(1)); - rect=QRect(0,sumrect.height()+10,p->window().width(),p->window().height()); + rect=TQRect(0,sumrect.height()+10,p->window().width(),p->window().height()); brect5=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5); sumrect|=brect5; } @@ -520,18 +520,18 @@ void LSkatView::drawFinal(QPainter *p) line5=i18n("%1 won with 90 points. Super!").arg(getDocument()->GetName(1)); else line5=i18n("%1 won over 90 points. Super!").arg(getDocument()->GetName(1)); - rect=QRect(0,sumrect.height()+10,p->window().width(),p->window().height()); + rect=TQRect(0,sumrect.height()+10,p->window().width(),p->window().height()); brect5=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5); sumrect|=brect5; } } - QPoint offset=QPoint(status_rect3.left()-sumrect.left(),status_rect3.top()); + TQPoint offset=TQPoint(status_rect3.left()-sumrect.left(),status_rect3.top()); sumrect.moveBy(offset.x(),offset.y()); // draw actual strings and symbols - QRect borderrect=QRect(sumrect.left()-20,sumrect.top()-20,sumrect.width()+40,sumrect.height()+40); + TQRect borderrect=TQRect(sumrect.left()-20,sumrect.top()-20,sumrect.width()+40,sumrect.height()+40); p->drawRect(borderrect); drawBorder(p,borderrect,0,4,0); drawBorder(p,borderrect,10,1,1); @@ -551,8 +551,8 @@ void LSkatView::drawFinal(QPainter *p) //brect2.moveBy(offset.x(),offset.y()); p->drawText(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line2); - p->drawPixmap(sumrect.topLeft()+QPoint(-5,-5), getDocument()->mPixTrump[trump]); - p->drawPixmap(sumrect.topLeft()+QPoint(5,-5)+QPoint(sumrect.width()-getDocument()->mPixTrump[trump].width(),0), + p->drawPixmap(sumrect.topLeft()+TQPoint(-5,-5), getDocument()->mPixTrump[trump]); + p->drawPixmap(sumrect.topLeft()+TQPoint(5,-5)+TQPoint(sumrect.width()-getDocument()->mPixTrump[trump].width(),0), getDocument()->mPixTrump[trump]); @@ -585,7 +585,7 @@ void LSkatView::drawFinal(QPainter *p) // This function is just a workaround for the QT function drawText // with Qt::EXpandTAbs eanbled. For some strange reasons this crashes... -void LSkatView::drawTabText(QPainter *p,QRect rect,QString s,int *ts) +void LSkatView::drawTabText(TQPainter *p,TQRect rect,TQString s,int *ts) { int lcnt=0; @@ -600,9 +600,9 @@ void LSkatView::drawTabText(QPainter *p,QRect rect,QString s,int *ts) lpos=s.length(); rpos=0; } - QString tmp=s.left(lpos); + TQString tmp=s.left(lpos); s=s.right(rpos); - QRect rect2=rect; + TQRect rect2=rect; if (lcnt>0) rect2.setLeft(rect.left()+ts[lcnt-1]); p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,tmp); @@ -611,17 +611,17 @@ void LSkatView::drawTabText(QPainter *p,QRect rect,QString s,int *ts) } // Draw the status field at the right side -void LSkatView::drawStatus(QPainter *p) +void LSkatView::drawStatus(TQPainter *p) { - QPoint p1,p2; + TQPoint p1,p2; int trump; - QRect drawrect; + TQRect drawrect; // For loop - QRect srect[2]; + TQRect srect[2]; srect[0]=status_rect1; srect[1]=status_rect2; - QFont font10 = KGlobalSettings::generalFont(); + TQFont font10 = KGlobalSettings::generalFont(); font10.setPointSize(13); p->setFont(font10); @@ -629,14 +629,14 @@ void LSkatView::drawStatus(QPainter *p) // draw text - QString ld; - QString line1,line2,line3,line4,line2a,line2b,line2c; - QRect sumrect,rect,rect2,brect1,brect2,brect3,brect4; - QPoint pa; + TQString ld; + TQString line1,line2,line3,line4,line2a,line2b,line2c; + TQRect sumrect,rect,rect2,brect1,brect2,brect3,brect4; + TQPoint pa; for (int pl=0;pl<2;pl++) { - drawrect=QRect(srect[pl].left()+14,srect[pl].top()+14,srect[pl].width()-28,srect[pl].height()-28); + drawrect=TQRect(srect[pl].left()+14,srect[pl].top()+14,srect[pl].width()-28,srect[pl].height()-28); p1=drawrect.topLeft(); p2=drawrect.bottomRight(); @@ -649,7 +649,7 @@ void LSkatView::drawStatus(QPainter *p) // Player pl ------------------- - // line1=QString(i18n("Player 1"))+QString(QCString(" - "))+getDocument()->GetName(0); + // line1=TQString(i18n("Player 1"))+TQString(TQCString(" - "))+getDocument()->GetName(0); line1=getDocument()->GetName(pl); brect1=p->boundingRect(drawrect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line1); sumrect=brect1; @@ -658,11 +658,11 @@ void LSkatView::drawStatus(QPainter *p) { // Geometry and strings line2=i18n("Score:"); - rect=QRect(drawrect.left(),sumrect.bottom()+16,drawrect.width(),drawrect.height()-sumrect.height()); + rect=TQRect(drawrect.left(),sumrect.bottom()+16,drawrect.width(),drawrect.height()-sumrect.height()); brect2=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2); sumrect|=brect2; line3=i18n("Move:"); - rect=QRect(drawrect.left(),sumrect.bottom()+10,drawrect.width(),drawrect.height()-sumrect.height()); + rect=TQRect(drawrect.left(),sumrect.bottom()+10,drawrect.width(),drawrect.height()-sumrect.height()); brect3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line3); sumrect|=brect3; @@ -678,33 +678,33 @@ void LSkatView::drawStatus(QPainter *p) p->setPen(black); p->drawText(brect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2); p->drawText(brect3,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line3); - rect2=QRect(brect2.left()+rect.width(),brect2.top(),drawrect.width()-brect2.width()-rect.width(),brect2.height()); + rect2=TQRect(brect2.left()+rect.width(),brect2.top(),drawrect.width()-brect2.width()-rect.width(),brect2.height()); p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2a); - rect2=QRect(brect3.left()+rect.width(),brect3.top(),drawrect.width()-brect3.width()-rect.width(),brect3.height()); + rect2=TQRect(brect3.left()+rect.width(),brect3.top(),drawrect.width()-brect3.width()-rect.width(),brect3.height()); p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2b); - pa=QPoint(drawrect.width()-getDocument()->mPixTrump[trump].width(),drawrect.height()-getDocument()->mPixTrump[trump].height()); + pa=TQPoint(drawrect.width()-getDocument()->mPixTrump[trump].width(),drawrect.height()-getDocument()->mPixTrump[trump].height()); if (getDocument()->GetStartPlayer()==pl) - p->drawPixmap(p1+pa+QPoint(3,3),getDocument()->mPixTrump[trump]); + p->drawPixmap(p1+pa+TQPoint(3,3),getDocument()->mPixTrump[trump]); - pa=QPoint(drawrect.width()-getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1].width(),0); - p->drawPixmap(p1+pa+QPoint(3,-3), getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1]); + pa=TQPoint(drawrect.width()-getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1].width(),0); + p->drawPixmap(p1+pa+TQPoint(3,-3), getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1]); } else // draw all time score { // Geometry and strings line2=i18n("Points:"); - rect=QRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height()); + rect=TQRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height()); brect2=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2); sumrect|=brect2; line3=i18n("Won:"); - rect=QRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height()); + rect=TQRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height()); brect3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line3); sumrect|=brect3; line4=i18n("Games:"); - rect=QRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height()); + rect=TQRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height()); brect4=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line4); sumrect|=brect4; @@ -721,15 +721,15 @@ void LSkatView::drawStatus(QPainter *p) p->drawText(brect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2); p->drawText(brect3,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line3); p->drawText(brect4,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line4); - rect2=QRect(brect2.left()+rect.width(),brect2.top(),drawrect.width()-brect2.width()-rect.width()+5,brect2.height()); + rect2=TQRect(brect2.left()+rect.width(),brect2.top(),drawrect.width()-brect2.width()-rect.width()+5,brect2.height()); p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2a); - rect2=QRect(brect3.left()+rect.width(),brect3.top(),drawrect.width()-brect3.width()-rect.width()+5,brect3.height()); + rect2=TQRect(brect3.left()+rect.width(),brect3.top(),drawrect.width()-brect3.width()-rect.width()+5,brect3.height()); p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2b); - rect2=QRect(brect4.left()+rect.width(),brect4.top(),drawrect.width()-brect4.width()-rect.width()+5,brect4.height()); + rect2=TQRect(brect4.left()+rect.width(),brect4.top(),drawrect.width()-brect4.width()-rect.width()+5,brect4.height()); p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2c); - pa=QPoint(drawrect.width()-getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1].width(),0); - p->drawPixmap(p1+pa+QPoint(3,-3), getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1]); + pa=TQPoint(drawrect.width()-getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1].width(),0); + p->drawPixmap(p1+pa+TQPoint(3,-3), getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1]); } @@ -737,7 +737,7 @@ void LSkatView::drawStatus(QPainter *p) } // paint function -void LSkatView::Paint(QPainter *p) +void LSkatView::Paint(TQPainter *p) { // If game is running drawStatus(p); @@ -753,13 +753,13 @@ void LSkatView::Paint(QPainter *p) } // paint event -void LSkatView::paintEvent( QPaintEvent * e) +void LSkatView::paintEvent( TQPaintEvent * e) { if (getDocument()->IsIntro()) { - QPixmap pm(this->rect().size()); - QPainter p; - QBrush brush; + TQPixmap pm(this->rect().size()); + TQPainter p; + TQBrush brush; p.begin(&pm,this); brush.setPixmap( getDocument()->mPixBackground ); p.fillRect(0,0,this->rect().width(),this->rect().height(),brush); @@ -769,7 +769,7 @@ void LSkatView::paintEvent( QPaintEvent * e) } else { - QPainter paint( this ); + TQPainter paint( this ); paint.setClipRect(e->rect()); Paint( &paint ); } @@ -777,32 +777,32 @@ void LSkatView::paintEvent( QPaintEvent * e) // x=0..4, y=0..4 -QPoint LSkatView::calcCardPos(int x,int y) +TQPoint LSkatView::calcCardPos(int x,int y) { - QPoint point; - point=QPoint(CARD_X_OFFSET+x*(CARD_X_SPACE+getDocument()->cardsize.width()), + TQPoint point; + point=TQPoint(CARD_X_OFFSET+x*(CARD_X_SPACE+getDocument()->cardsize.width()), CARD_Y_OFFSET+y*(CARD_Y_SPACE+getDocument()->cardsize.height())); - if (y>=2) point+=QPoint(0,CARD_Y_BOARD_OFFSET); - point+=QPoint(CARD_X_DECK,CARD_Y_DECK); + if (y>=2) point+=TQPoint(0,CARD_Y_BOARD_OFFSET); + point+=TQPoint(CARD_X_DECK,CARD_Y_DECK); return point; } // mouse click event -void LSkatView::mousePressEvent( QMouseEvent *mouse ) +void LSkatView::mousePressEvent( TQMouseEvent *mouse ) { if (mouse->button()!=LeftButton) return ; if (!getDocument()->IsRunning()) return ; if (getDocument()->GetMoveStatus()!=-1) return ; - QPoint point; + TQPoint point; int mx,my,player; point=mouse->pos(); - point-=QPoint(CARD_X_OFFSET,CARD_Y_OFFSET); + point-=TQPoint(CARD_X_OFFSET,CARD_Y_OFFSET); if (point.y()>2*(getDocument()->cardsize.height()+CARD_Y_SPACE)) { - point-=QPoint(0,CARD_Y_BOARD_OFFSET+2*(getDocument()->cardsize.height()+CARD_Y_SPACE)); + point-=TQPoint(0,CARD_Y_BOARD_OFFSET+2*(getDocument()->cardsize.height()+CARD_Y_SPACE)); player=1; } else @@ -823,15 +823,15 @@ void LSkatView::mousePressEvent( QMouseEvent *mouse ) !getDocument()->IsLocked()) { KEMessage *msg=new KEMessage; - msg->AddData(QCString("Move"),(short)player); - msg->AddData(QCString("MoveX"),(short)mx); - msg->AddData(QCString("MoveY"),(short)my); + msg->AddData(TQCString("Move"),(short)player); + msg->AddData(TQCString("MoveX"),(short)mx); + msg->AddData(TQCString("MoveY"),(short)my); getDocument()->QueryInputHandler()->SetInput(msg); delete msg; } else { - QString m; + TQString m; switch(getDocument()->random(4)) { case 0: @@ -861,16 +861,16 @@ void LSkatView::InitMove(int player,int mx,int my) cardmovecnt=0; cardorigin=calcCardPos(mx,my+2*player); if (getDocument()->GetCurrentPlayer()==0) - cardend=QPoint(CARD_X_MOVE1,CARD_Y_MOVE1); - else cardend=QPoint(CARD_X_MOVE2,CARD_Y_MOVE2); - update(QRect( - cardorigin-QPoint(CARD_X_DECK,CARD_Y_DECK), - getDocument()->cardsize+QSize(CARD_X_DECK,CARD_Y_DECK))); - - QPoint point1=QPoint(CARD_X_MOVE1,CARD_Y_MOVE1); - QPoint point2=QPoint(CARD_X_MOVE2,CARD_Y_MOVE2); - update(QRect(point1,getDocument()->cardsize)); - update(QRect(point2,getDocument()->cardsize)); + cardend=TQPoint(CARD_X_MOVE1,CARD_Y_MOVE1); + else cardend=TQPoint(CARD_X_MOVE2,CARD_Y_MOVE2); + update(TQRect( + cardorigin-TQPoint(CARD_X_DECK,CARD_Y_DECK), + getDocument()->cardsize+TQSize(CARD_X_DECK,CARD_Y_DECK))); + + TQPoint point1=TQPoint(CARD_X_MOVE1,CARD_Y_MOVE1); + TQPoint point2=TQPoint(CARD_X_MOVE2,CARD_Y_MOVE2); + update(TQRect(point1,getDocument()->cardsize)); + update(TQRect(point2,getDocument()->cardsize)); } void LSkatView::introTimerReady() { @@ -896,15 +896,15 @@ void LSkatView::introTimerReady() void LSkatView::moveTimerReady() { - QPoint pos; - QString ld,s; + TQPoint pos; + TQString ld,s; if (cardmovecnt>=MOVECOUNTER) { LSkatApp *m=(LSkatApp *) parentWidget(); moveTimer->stop(); cardmovecnt=0; - update(QRect(cardend,getDocument()->cardsize)); - update(QRect(cardorigin,getDocument()->cardsize)); + update(TQRect(cardend,getDocument()->cardsize)); + update(TQRect(cardorigin,getDocument()->cardsize)); update(status_rect1); update(status_rect2); m->MoveFinished(); @@ -913,14 +913,14 @@ void LSkatView::moveTimerReady() else { pos=cardorigin+(cardend-cardorigin)*cardmovecnt/MOVECOUNTER; - update(QRect(pos,getDocument()->cardsize)); + update(TQRect(pos,getDocument()->cardsize)); cardmovecnt++; pos=cardorigin+(cardend-cardorigin)*cardmovecnt/MOVECOUNTER; - update(QRect(pos,getDocument()->cardsize)); + update(TQRect(pos,getDocument()->cardsize)); // Turning of the card if ( cardmoveunder>=0) { - update(QRect(cardorigin,getDocument()->cardsize)); + update(TQRect(cardorigin,getDocument()->cardsize)); } } } diff --git a/lskat/lskat/lskatview.h b/lskat/lskat/lskatview.h index 05b31356..19146cc5 100644 --- a/lskat/lskat/lskatview.h +++ b/lskat/lskat/lskatview.h @@ -22,14 +22,14 @@ #include <config.h> #endif -#include <qwidget.h> -#include <qrect.h> +#include <tqwidget.h> +#include <tqrect.h> #include "lskat.h" class LSkatDoc; /** The LSkatView class provides the view widget for the LSkatApp instance. - * The View instance inherits QWidget as a base class and represents the view object of a KTMainWindow. As LSkatView is part of the + * The View instance inherits TQWidget as a base class and represents the view object of a KTMainWindow. As LSkatView is part of the * docuement-view model, it needs a reference to the document object connected with it by the LSkatApp class to manipulate and display * the document structure provided by the LSkatDoc class. * @@ -41,7 +41,7 @@ class LSkatView : public QWidget Q_OBJECT public: /** Constructor for the main view */ - LSkatView(QWidget *parent = 0, const char *name=0); + LSkatView(TQWidget *parent = 0, const char *name=0); /** returns a pointer to the document connected to the view instance. Mind that this method requires a LSkatApp instance as a parent * widget to get to the window document pointer by calling the LSkatApp::getDocument() method. @@ -50,40 +50,40 @@ class LSkatView : public QWidget */ LSkatDoc *getDocument() const; - void paintEvent( QPaintEvent * p); - void Paint(QPainter *p); + void paintEvent( TQPaintEvent * p); + void Paint(TQPainter *p); void InitMove(int player,int x,int y); void updateStatus(); protected: - void drawDeck(QPainter *p); - void drawIntro(QPainter *p); - void drawMove(QPainter *p); - void drawStatus(QPainter *p); - void drawFinal(QPainter *p); - void drawBorder(QPainter *p,QRect rect,int offset,int width,int mode); - QPoint calcCardPos(int x,int y); + void drawDeck(TQPainter *p); + void drawIntro(TQPainter *p); + void drawMove(TQPainter *p); + void drawStatus(TQPainter *p); + void drawFinal(TQPainter *p); + void drawBorder(TQPainter *p,TQRect rect,int offset,int width,int mode); + TQPoint calcCardPos(int x,int y); - void mousePressEvent ( QMouseEvent *m ); + void mousePressEvent ( TQMouseEvent *m ); protected slots: void moveTimerReady(); void introTimerReady(); - void drawTabText(QPainter *p,QRect rect,QString s,int *ts); + void drawTabText(TQPainter *p,TQRect rect,TQString s,int *ts); private: - QRect status_rect1; - QRect status_rect2; - QRect status_rect3; - QTimer *moveTimer; - QTimer *introTimer; + TQRect status_rect1; + TQRect status_rect2; + TQRect status_rect3; + TQTimer *moveTimer; + TQTimer *introTimer; int introcnt; int cardmovecnt; int cardmovex,cardmovey; int cardmoveunder; - QPoint cardorigin; - QPoint cardend; + TQPoint cardorigin; + TQPoint cardend; int introCards[NO_OF_CARDS]; }; diff --git a/lskat/lskat/main.cpp b/lskat/lskat/main.cpp index 50910540..fa3a777f 100644 --- a/lskat/lskat/main.cpp +++ b/lskat/lskat/main.cpp @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) if (args->isSet("debug")) { - QString s = args->getOption("debug"); + TQString s = args->getOption("debug"); global_debug = s.toInt(); qDebug("Debug level set to %d\n", global_debug); } diff --git a/lskat/lskat/msgdlg.cpp b/lskat/lskat/msgdlg.cpp index daea1dac..cb3e6334 100644 --- a/lskat/lskat/msgdlg.cpp +++ b/lskat/lskat/msgdlg.cpp @@ -28,7 +28,7 @@ */ -#include <qgroupbox.h> +#include <tqgroupbox.h> #include <klocale.h> #include <kpushbutton.h> #include <kstdguiitem.h> @@ -37,36 +37,36 @@ // Create the dialog for changing the player names -MsgDlg::MsgDlg( QWidget *parent, const char *name,const char * /*sufi */ ) - : QDialog( parent, name,TRUE ) +MsgDlg::MsgDlg( TQWidget *parent, const char *name,const char * /*sufi */ ) + : TQDialog( parent, name,TRUE ) { setCaption(i18n("Send Message to Remote Player")); setMinimumSize(400,160); setMaximumSize(600,360); resize( 400, 160 ); - QGroupBox* grp; - grp = new QGroupBox(i18n("Enter Message"), this); + TQGroupBox* grp; + grp = new TQGroupBox(i18n("Enter Message"), this); grp->resize(380,100); grp->move(10,10); - MultiLine = new QMultiLineEdit( grp, "MLineEdit" ); + MultiLine = new TQMultiLineEdit( grp, "MLineEdit" ); MultiLine->setGeometry( 10, 20, 360, 70 ); - MultiLine->setText(QCString("") ); + MultiLine->setText(TQCString("") ); - QPushButton *PushButton; - PushButton = new QPushButton( i18n("Send" ), this, "PushButton_1" ); + TQPushButton *PushButton; + PushButton = new TQPushButton( i18n("Send" ), this, "PushButton_1" ); PushButton->setGeometry( 20, 120, 65, 30 ); - connect( PushButton, SIGNAL(clicked()), SLOT(accept()) ); + connect( PushButton, TQT_SIGNAL(clicked()), TQT_SLOT(accept()) ); PushButton->setAutoRepeat( FALSE ); PushButton = new KPushButton( KStdGuiItem::cancel(), this, "PushButton_2" ); PushButton->setGeometry( 305, 120, 65, 30 ); - connect( PushButton, SIGNAL(clicked()), SLOT(reject()) ); + connect( PushButton, TQT_SIGNAL(clicked()), TQT_SLOT(reject()) ); PushButton->setAutoRepeat( FALSE ); } -QString MsgDlg::GetMsg() +TQString MsgDlg::GetMsg() { return MultiLine->text(); } diff --git a/lskat/lskat/msgdlg.h b/lskat/lskat/msgdlg.h index 614fa332..6612597d 100644 --- a/lskat/lskat/msgdlg.h +++ b/lskat/lskat/msgdlg.h @@ -16,22 +16,22 @@ ***************************************************************************/ #ifndef __MSGDLG_H_ #define __MSGDLG_H_ -#include <qmultilineedit.h> -#include <qstring.h> -#include <qdialog.h> +#include <tqmultilineedit.h> +#include <tqstring.h> +#include <tqdialog.h> class MsgDlg : public QDialog { Q_OBJECT public: - MsgDlg (QWidget* parent = NULL,const char* name = NULL,const char *sufi=NULL); - QString GetMsg(); + MsgDlg (TQWidget* parent = NULL,const char* name = NULL,const char *sufi=NULL); + TQString GetMsg(); protected slots: protected: - QMultiLineEdit *MultiLine; + TQMultiLineEdit *MultiLine; diff --git a/lskat/lskat/namedlg.cpp b/lskat/lskat/namedlg.cpp index 478f5ea5..2004a9af 100644 --- a/lskat/lskat/namedlg.cpp +++ b/lskat/lskat/namedlg.cpp @@ -8,11 +8,11 @@ ****************************************************************************/ #include "namedlg.h" -#include <qgroupbox.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qlayout.h> -#include <qwhatsthis.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqlayout.h> +#include <tqwhatsthis.h> #include <klocale.h> @@ -25,16 +25,16 @@ * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ -NameDlg::NameDlg( QWidget *parent, const char *name,bool /* modal */, WFlags /* fl */ ) +NameDlg::NameDlg( TQWidget *parent, const char *name,bool /* modal */, WFlags /* fl */ ) : KDialogBase( Plain, i18n("Configure Names"), Ok|Cancel, Ok, parent, name, true,true ) { - QWidget *page = plainPage(); + TQWidget *page = plainPage(); if ( !name ) setName( "NameDlg" ); resize( 252, 186 ); // setCaption( i18n( "Configure Names" ) ); - vbox = new QVBoxLayout( page,spacingHint() ); + vbox = new TQVBoxLayout( page,spacingHint() ); vbox->setSpacing( 6 ); vbox->setMargin( 11 ); @@ -42,12 +42,12 @@ NameDlg::NameDlg( QWidget *parent, const char *name,bool /* modal */, WFlags /* hbox->setSpacing( 6 ); hbox->setMargin( 0 ); - player_names = new QGroupBox( page, "player_names" ); + player_names = new TQGroupBox( page, "player_names" ); player_names->setTitle(i18n("Player Names") ); player_names->setColumnLayout(0, Qt::Vertical ); player_names->layout()->setSpacing( 0 ); player_names->layout()->setMargin( 0 ); - vbox_2 = new QVBoxLayout( player_names->layout() ); + vbox_2 = new TQVBoxLayout( player_names->layout() ); vbox_2->setAlignment( Qt::AlignTop ); vbox_2->setSpacing( 6 ); vbox_2->setMargin( 11 ); @@ -60,13 +60,13 @@ NameDlg::NameDlg( QWidget *parent, const char *name,bool /* modal */, WFlags /* hbox_2->setSpacing( 6 ); hbox_2->setMargin( 0 ); - text_player1 = new QLabel( player_names, "text_player1" ); + text_player1 = new TQLabel( player_names, "text_player1" ); text_player1->setText( i18n("Player 1:" ) ); hbox_2->addWidget( text_player1 ); - edit_player1 = new QLineEdit( player_names, "edit_player1" ); + edit_player1 = new TQLineEdit( player_names, "edit_player1" ); edit_player1->setMaxLength( NAME_MAX_LEN ); - QWhatsThis::add( edit_player1, i18n( "Enter a player's name" ) ); + TQWhatsThis::add( edit_player1, i18n( "Enter a player's name" ) ); hbox_2->addWidget( edit_player1 ); vbox_3->addLayout( hbox_2 ); @@ -75,31 +75,31 @@ NameDlg::NameDlg( QWidget *parent, const char *name,bool /* modal */, WFlags /* hbox_3->setSpacing( 6 ); hbox_3->setMargin( 0 ); - text_player2 = new QLabel( player_names, "text_player2" ); + text_player2 = new TQLabel( player_names, "text_player2" ); text_player2->setText( i18n("Player 2:" ) ); hbox_3->addWidget( text_player2 ); - edit_player2 = new QLineEdit( player_names, "edit_player2" ); + edit_player2 = new TQLineEdit( player_names, "edit_player2" ); edit_player2->setMaxLength( NAME_MAX_LEN ); - QWhatsThis::add( edit_player2, i18n( "Enter a player's name" ) ); + TQWhatsThis::add( edit_player2, i18n( "Enter a player's name" ) ); hbox_3->addWidget( edit_player2 ); vbox_3->addLayout( hbox_3 ); vbox_2->addLayout( vbox_3 ); // left - QSpacerItem* spacer_3 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem* spacer_3 = new TQSpacerItem( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); hbox->addItem( spacer_3 ); hbox->addWidget( player_names ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); hbox->addItem( spacer ); // top - QSpacerItem* spacer_4 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer_4 = new TQSpacerItem( 0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); vbox->addItem( spacer_4 ); vbox->addLayout( hbox ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer_2 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); vbox->addItem( spacer_2 ); } @@ -113,12 +113,12 @@ NameDlg::~NameDlg() } // In and output the name strings -void NameDlg::SetNames(QString n1, QString n2) +void NameDlg::SetNames(TQString n1, TQString n2) { edit_player1->setText( n1 ); edit_player2->setText( n2 ); } -void NameDlg::GetNames(QString &n1, QString &n2) +void NameDlg::GetNames(TQString &n1, TQString &n2) { n1=edit_player1->text( ); n1.truncate(NAME_MAX_LEN); diff --git a/lskat/lskat/namedlg.h b/lskat/lskat/namedlg.h index c5d3391a..000de21e 100644 --- a/lskat/lskat/namedlg.h +++ b/lskat/lskat/namedlg.h @@ -23,27 +23,27 @@ class NameDlg : public KDialogBase Q_OBJECT public: - NameDlg( QWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0 ); + NameDlg( TQWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0 ); ~NameDlg(); - void SetNames(QString n1,QString n2); - void GetNames(QString &n1,QString &n2); + void SetNames(TQString n1,TQString n2); + void GetNames(TQString &n1,TQString &n2); - QGroupBox* player_names; - QLabel* text_player1; - QLineEdit* edit_player1; - QLabel* text_player2; - QLineEdit* edit_player2; - QPushButton* PushButton1; - QPushButton* PushButton2; + TQGroupBox* player_names; + TQLabel* text_player1; + TQLineEdit* edit_player1; + TQLabel* text_player2; + TQLineEdit* edit_player2; + TQPushButton* PushButton1; + TQPushButton* PushButton2; protected: - QHBoxLayout* hbox; - QHBoxLayout* hbox_2; - QHBoxLayout* hbox_3; - QHBoxLayout* hbox_4; - QVBoxLayout* vbox; - QVBoxLayout* vbox_2; - QVBoxLayout* vbox_3; + TQHBoxLayout* hbox; + TQHBoxLayout* hbox_2; + TQHBoxLayout* hbox_3; + TQHBoxLayout* hbox_4; + TQVBoxLayout* vbox; + TQVBoxLayout* vbox_2; + TQVBoxLayout* vbox_3; }; #endif // NAMEDLG_H diff --git a/lskat/lskat/networkdlg.cpp b/lskat/lskat/networkdlg.cpp index f43a1fd9..16e1716a 100644 --- a/lskat/lskat/networkdlg.cpp +++ b/lskat/lskat/networkdlg.cpp @@ -16,20 +16,20 @@ #include "networkdlg.h" -#include <qspinbox.h> -#include <qlineedit.h> -#include <qcombobox.h> -#include <qbuttongroup.h> -#include <qwidgetstack.h> +#include <tqspinbox.h> +#include <tqlineedit.h> +#include <tqcombobox.h> +#include <tqbuttongroup.h> +#include <tqwidgetstack.h> extern const char* LSKAT_SERVICE; // Create the dialog -NetworkDlg::NetworkDlg( QWidget *parent, const char *name ) +NetworkDlg::NetworkDlg( TQWidget *parent, const char *name ) : NetworkDlgBase( parent, name, TRUE ) { - browser = new DNSSD::ServiceBrowser(QString::fromLatin1(LSKAT_SERVICE)); - connect(browser,SIGNAL(finished()),SLOT(gamesFound())); + browser = new DNSSD::ServiceBrowser(TQString::fromLatin1(LSKAT_SERVICE)); + connect(browser,TQT_SIGNAL(finished()),TQT_SLOT(gamesFound())); browser->startBrowse(); } @@ -38,16 +38,16 @@ NetworkDlg::~NetworkDlg() delete browser; } -void NetworkDlg::SetHost(const QString& host) +void NetworkDlg::SetHost(const TQString& host) { hostname->setText(host); } -void NetworkDlg::SetName(const QString& name) +void NetworkDlg::SetName(const TQString& name) { serverName->setText(name); } -QString NetworkDlg::QueryName() const +TQString NetworkDlg::QueryName() const { return serverName->text(); } @@ -62,9 +62,9 @@ void NetworkDlg::gamesFound() bool autoselect=false; if (!clientName->count() && group->selectedId()==1) autoselect=true; clientName->clear(); - QStringList names; - QValueList<DNSSD::RemoteService::Ptr>::ConstIterator itEnd = browser->services().end(); - for (QValueList<DNSSD::RemoteService::Ptr>::ConstIterator it = browser->services().begin(); + TQStringList names; + TQValueList<DNSSD::RemoteService::Ptr>::ConstIterator itEnd = browser->services().end(); + for (TQValueList<DNSSD::RemoteService::Ptr>::ConstIterator it = browser->services().begin(); it!=itEnd; ++it) names << (*it)->serviceName(); clientName->insertStringList(names); if (autoselect && clientName->count()) gameSelected(0); @@ -84,7 +84,7 @@ unsigned short NetworkDlg::QueryPort() const return port->value(); } -QString NetworkDlg::QueryHost() const +TQString NetworkDlg::QueryHost() const { return hostname->text(); } @@ -97,7 +97,7 @@ void NetworkDlg::toggleServerClient() hostname->setEnabled(true); } else { - hostname->setText(QString::null); + hostname->setText(TQString::null); hostname->setEnabled(false); } } diff --git a/lskat/lskat/networkdlg.h b/lskat/lskat/networkdlg.h index fb180eeb..6efccd2f 100644 --- a/lskat/lskat/networkdlg.h +++ b/lskat/lskat/networkdlg.h @@ -17,7 +17,7 @@ #ifndef NETWORKDLG_H #define NETWORKDLG_H -#include <qstring.h> +#include <tqstring.h> #include <dnssd/servicebrowser.h> #include "networkdlgbase.h" @@ -27,14 +27,14 @@ class NetworkDlg : public NetworkDlgBase Q_OBJECT public: - NetworkDlg(QWidget* parent=NULL, const char* name=NULL); + NetworkDlg(TQWidget* parent=NULL, const char* name=NULL); ~NetworkDlg(); - void SetName(const QString& name); - void SetHost(const QString& host); + void SetName(const TQString& name); + void SetHost(const TQString& host); void SetPort(unsigned short port); - QString QueryName() const; + TQString QueryName() const; unsigned short QueryPort() const; - QString QueryHost() const; + TQString QueryHost() const; protected: virtual void toggleServerClient(); virtual void gameSelected(int nr); diff --git a/lskat/lskatproc/KChildConnect.cpp b/lskat/lskatproc/KChildConnect.cpp index 0308a3f0..6ea4b973 100644 --- a/lskat/lskatproc/KChildConnect.cpp +++ b/lskat/lskatproc/KChildConnect.cpp @@ -20,7 +20,7 @@ #include "KChildConnect.moc" KChildConnect::KChildConnect() - : QObject(0,0) + : TQObject(0,0) { input_pending=false; inputbuffer=""; @@ -38,14 +38,14 @@ KR_STATUS KChildConnect::QueryStatus() // Communication with process bool KChildConnect::SendMsg(KEMessage *msg) { - QString sendstring=msg->ToString(); + TQString sendstring=msg->ToString(); // Debug only - if (msg->HasKey(QCString("KLogSendMsg"))) + if (msg->HasKey(TQCString("KLogSendMsg"))) { char *p; int size; FILE *fp; - msg->GetData(QCString("KLogSendMsg"),p,size); + msg->GetData(TQCString("KLogSendMsg"),p,size); if (p && (fp=fopen(p,"a")) ) { fprintf(fp,"------------------------------------\n"); @@ -58,7 +58,7 @@ bool KChildConnect::SendMsg(KEMessage *msg) } // Send string to parent -bool KChildConnect::Send(QString str) +bool KChildConnect::Send(TQString str) { if (!str || str.length()<1) return true; // no need to send crap printf("%s",str.latin1()); @@ -66,11 +66,11 @@ bool KChildConnect::Send(QString str) return true; } -void KChildConnect::Receive(QString input) +void KChildConnect::Receive(TQString input) { // Cut out CR int len,pos; - QString tmp; + TQString tmp; // Call us recursive until there are no CR left @@ -86,14 +86,14 @@ void KChildConnect::Receive(QString input) } // printf(" ---> KChildConnect::Receive: '%s'\n",(const char *)input); - if (input==QString(KEMESSAGE_HEAD) && !input_pending) + if (input==TQString(KEMESSAGE_HEAD) && !input_pending) { input_pending=true; inputcache.clear(); return ; } if (!input_pending) return ; // ignore - if (input!=QString(KEMESSAGE_TAIL)) + if (input!=TQString(KEMESSAGE_TAIL)) { inputcache.append(input.latin1()); return; @@ -104,7 +104,7 @@ void KChildConnect::Receive(QString input) char *it; for (it=inputcache.first();it!=0;it=inputcache.next()) { - msg->AddString(QCString(it)); + msg->AddString(TQCString(it)); } // printf("+- CHILDprocess:: GOT MESSAGE::Emmiting slotReceiveMsg\n"); diff --git a/lskat/lskatproc/KChildConnect.h b/lskat/lskatproc/KChildConnect.h index 9cad1a5d..37339218 100644 --- a/lskat/lskatproc/KChildConnect.h +++ b/lskat/lskatproc/KChildConnect.h @@ -9,8 +9,8 @@ #ifndef _KCHILDCONNECT_H_ #define _KCHILDCONNECT_H_ -#include <qobject.h> -#include <qstrlist.h> +#include <tqobject.h> +#include <tqstrlist.h> #include "KEMessage.h" @@ -19,20 +19,20 @@ class KChildConnect: public QObject Q_OBJECT protected: - QStrList inputcache; + TQStrList inputcache; bool input_pending; - QString inputbuffer; + TQString inputbuffer; int ID; public: KChildConnect(); ~KChildConnect(); - void Receive(QString input); + void Receive(TQString input); int QueryID(); void SetID(int id); virtual bool SendMsg(KEMessage *msg); - virtual bool Send(QString str); + virtual bool Send(TQString str); virtual KR_STATUS QueryStatus(); public slots: diff --git a/lskat/lskatproc/KEMessage.cpp b/lskat/lskatproc/KEMessage.cpp index db598573..ce8985f3 100644 --- a/lskat/lskatproc/KEMessage.cpp +++ b/lskat/lskatproc/KEMessage.cpp @@ -19,7 +19,7 @@ #include <stdlib.h> #include "KEMessage.h" -void KEMessage::AddEntry(QString key,KMessageEntry *entry) +void KEMessage::AddEntry(TQString key,KMessageEntry *entry) { // printf(" AddingEntry: %s with data field %p\n",(char *)key,entry->QueryData()); if (!entry) return ; @@ -27,7 +27,7 @@ void KEMessage::AddEntry(QString key,KMessageEntry *entry) keys.append(key.latin1()); } -void KEMessage::AddDataType(QString key,int size,const char *data,KGM_TYPE type) +void KEMessage::AddDataType(TQString key,int size,const char *data,KGM_TYPE type) { // printf("AddDataType for %s size=%d\n",(const char *)key,size); if (size<=0) return ; @@ -37,28 +37,28 @@ void KEMessage::AddDataType(QString key,int size,const char *data,KGM_TYPE type) AddEntry(key,entry); } -void KEMessage::AddData(QString key,short data) +void KEMessage::AddData(TQString key,short data) { AddDataType(key,sizeof(short),(char *)&data,KGM_TYPE_SHORT); } -void KEMessage::AddData(QString key,long data) +void KEMessage::AddData(TQString key,long data) { AddDataType(key,sizeof(long),(char *)&data,KGM_TYPE_LONG); } -void KEMessage::AddData(QString key,float data) +void KEMessage::AddData(TQString key,float data) { AddDataType(key,sizeof(float),(char *)&data,KGM_TYPE_FLOAT); } -void KEMessage::AddData(QString key,const char *data,int size) +void KEMessage::AddData(TQString key,const char *data,int size) { if (size<0) size=strlen(data)+1; // +1 for 0 Byte AddDataType(key,size,data,KGM_TYPE_DATA); } -KGM_TYPE KEMessage::QueryType(QString key) +KGM_TYPE KEMessage::QueryType(TQString key) { KMessageEntry *entry; entry=dict.find(key); @@ -66,7 +66,7 @@ KGM_TYPE KEMessage::QueryType(QString key) return entry->QueryType(); } -bool KEMessage::HasKey(QString key) +bool KEMessage::HasKey(TQString key) { KMessageEntry *entry; entry=dict.find(key); @@ -74,7 +74,7 @@ bool KEMessage::HasKey(QString key) return true; } -bool KEMessage::GetData(QString key,short &s) +bool KEMessage::GetData(TQString key,short &s) { short *result; KMessageEntry *entry; @@ -87,7 +87,7 @@ bool KEMessage::GetData(QString key,short &s) return true; } -bool KEMessage::GetData(QString key,long &l) +bool KEMessage::GetData(TQString key,long &l) { long *result; KMessageEntry *entry; @@ -99,7 +99,7 @@ bool KEMessage::GetData(QString key,long &l) return true; } -bool KEMessage::GetData(QString key,float &f) +bool KEMessage::GetData(TQString key,float &f) { float *result; KMessageEntry *entry; @@ -112,7 +112,7 @@ bool KEMessage::GetData(QString key,float &f) return true; } -bool KEMessage::GetData(QString key,char * &c,int &size) +bool KEMessage::GetData(TQString key,char * &c,int &size) { KMessageEntry *entry; entry=dict.find(key); @@ -123,13 +123,13 @@ bool KEMessage::GetData(QString key,char * &c,int &size) return true; } -QString KEMessage::EntryToString(char *key,KMessageEntry *entry) +TQString KEMessage::EntryToString(char *key,KMessageEntry *entry) { - QString s,tmp; + TQString s,tmp; int size,i; KGM_TYPE type; char *data; - s=QCString(""); + s=TQCString(""); if (!entry) return s; size=entry->QuerySize(); type=entry->QueryType(); @@ -142,7 +142,7 @@ QString KEMessage::EntryToString(char *key,KMessageEntry *entry) size,KEMESSAGE_SEP, (int)type,KEMESSAGE_SEP); */ - tmp=QCString(key); + tmp=TQCString(key); s+=tmp; s+=KEMESSAGE_SEP; tmp.sprintf("%d",size); @@ -168,31 +168,31 @@ QString KEMessage::EntryToString(char *key,KMessageEntry *entry) return s; } -QString KEMessage::StringToEntry(QString str,KMessageEntry *entry) +TQString KEMessage::StringToEntry(TQString str,KMessageEntry *entry) { int pos,oldpos,cnt,len; - QString key,size,type,data; + TQString key,size,type,data; const char *p; char *q; char c; len=KEMESSAGE_SEP.length(); - if (!entry) return QString(); + if (!entry) return TQString(); pos=str.find(KEMESSAGE_SEP,0); - if (pos<0) return QString(); // wrong format + if (pos<0) return TQString(); // wrong format key=str.left(pos); oldpos=pos; pos=str.find(KEMESSAGE_SEP,oldpos+len); - if (pos<0) return QString(); // wrong format + if (pos<0) return TQString(); // wrong format size=str.mid(oldpos+len,pos-oldpos-len); oldpos=pos; pos=str.find(KEMESSAGE_SEP,oldpos+len); - if (pos<0) return QString(); // wrong format + if (pos<0) return TQString(); // wrong format type=str.mid(oldpos+len,pos-oldpos-len); @@ -205,10 +205,10 @@ QString KEMessage::StringToEntry(QString str,KMessageEntry *entry) // I hope this works with unicode strings as well p=data.latin1(); q=(char *)calloc(data.length()/2,sizeof(char)); - if (!q) return QString(); + if (!q) return TQString(); for(pos=0;pos<cnt;pos++) { - if (pos*2+1>(int)data.length()) return QString(); // SEVERE ERROR + if (pos*2+1>(int)data.length()) return TQString(); // SEVERE ERROR c=*(p+2*pos)-'a' | ((*(p+2*pos+1)-'a')<<4); q[pos]=c; } @@ -218,35 +218,35 @@ QString KEMessage::StringToEntry(QString str,KMessageEntry *entry) return key; } -QString KEMessage::ToString() +TQString KEMessage::ToString() { - QString s; + TQString s; KMessageEntry *entry; char *it; s=KEMESSAGE_HEAD+KEMESSAGE_CR; for (it=keys.first();it!=0;it=keys.next()) { - entry=dict.find(QCString(it)); + entry=dict.find(TQCString(it)); s+=EntryToString(it,entry); } s+=KEMESSAGE_TAIL+KEMESSAGE_CR; return s; } -bool KEMessage::AddString(QString s) +bool KEMessage::AddString(TQString s) { // break s into key,size and data - QString key; + TQString key; KMessageEntry *entry=new KMessageEntry; key=StringToEntry(s,entry); if (!key) return false; AddEntry(key,entry); return true; } -bool KEMessage::AddStringMsg(QString str) +bool KEMessage::AddStringMsg(TQString str) { bool result; - QString data; + TQString data; int pos,oldpos,len; len=KEMESSAGE_CR.length(); @@ -277,7 +277,7 @@ void KEMessage::RemoveAll() dict.clear(); } -void KEMessage::Remove(QString key) +void KEMessage::Remove(TQString key) { keys.remove(key.latin1()); dict.remove(key); @@ -287,7 +287,7 @@ uint KEMessage::QueryNumberOfKeys() { return keys.count(); } -QStrList *KEMessage::QueryKeys() +TQStrList *KEMessage::QueryKeys() { return &keys; } @@ -315,10 +315,10 @@ KEMessage &KEMessage::operator=(KEMessage &msg) // printf("Assigning = KEMessage from %p to %p\n",&msg,this); for (it=msg.keys.first();it!=0;it=msg.keys.next()) { - entry=msg.dict.find(QCString(it)); + entry=msg.dict.find(TQCString(it)); newentry=new KMessageEntry; *newentry=*entry; - AddEntry(QCString(it),newentry); + AddEntry(TQCString(it),newentry); } // return *newmsg; diff --git a/lskat/lskatproc/KEMessage.h b/lskat/lskatproc/KEMessage.h index 0a1913cc..9e4d6912 100644 --- a/lskat/lskatproc/KEMessage.h +++ b/lskat/lskatproc/KEMessage.h @@ -18,44 +18,44 @@ #define _KEMESSAGE_H_ #include <string.h> -#include <qstring.h> -#include <qstrlist.h> -#include <qdict.h> +#include <tqstring.h> +#include <tqstrlist.h> +#include <tqdict.h> #include "KMessageEntry.h" -#define KEMESSAGE_HEAD QString(QCString("BEGIN_V1000")) -#define KEMESSAGE_TAIL QString(QCString("END_V1000")) -#define KEMESSAGE_CR QString(QCString("\n")) -#define KEMESSAGE_SEP QString(QCString(":::")) +#define KEMESSAGE_HEAD TQString(TQCString("BEGIN_V1000")) +#define KEMESSAGE_TAIL TQString(TQCString("END_V1000")) +#define KEMESSAGE_CR TQString(TQCString("\n")) +#define KEMESSAGE_SEP TQString(TQCString(":::")) class KEMessage { private: - QStrList keys; - QDict<KMessageEntry> dict; + TQStrList keys; + TQDict<KMessageEntry> dict; protected: - void AddEntry(QString key,KMessageEntry *entry); + void AddEntry(TQString key,KMessageEntry *entry); public: - QStrList *QueryKeys(); + TQStrList *QueryKeys(); uint QueryNumberOfKeys(); - void AddDataType(QString key,int size,const char *data,KGM_TYPE type); - void AddData(QString key,short data); - void AddData(QString key,long data); - void AddData(QString key,float data); - void AddData(QString key,const char *data,int size=-1); - bool GetData(QString key,short &s); - bool GetData(QString key,long &l); - bool GetData(QString key,float &f); - bool GetData(QString key,char * &c,int &size); - bool HasKey(QString key); - void Remove(QString key); - KGM_TYPE QueryType(QString key); - QString ToString(); - QString EntryToString(char *key,KMessageEntry *entry); - QString StringToEntry(QString str,KMessageEntry *entry); - bool AddString(QString s); - bool AddStringMsg(QString str); + void AddDataType(TQString key,int size,const char *data,KGM_TYPE type); + void AddData(TQString key,short data); + void AddData(TQString key,long data); + void AddData(TQString key,float data); + void AddData(TQString key,const char *data,int size=-1); + bool GetData(TQString key,short &s); + bool GetData(TQString key,long &l); + bool GetData(TQString key,float &f); + bool GetData(TQString key,char * &c,int &size); + bool HasKey(TQString key); + void Remove(TQString key); + KGM_TYPE QueryType(TQString key); + TQString ToString(); + TQString EntryToString(char *key,KMessageEntry *entry); + TQString StringToEntry(TQString str,KMessageEntry *entry); + bool AddString(TQString s); + bool AddStringMsg(TQString str); void RemoveAll(); ~KEMessage(); KEMessage(); diff --git a/lskat/lskatproc/KInputChildProcess.cpp b/lskat/lskatproc/KInputChildProcess.cpp index a821aa7a..13e00b93 100644 --- a/lskat/lskatproc/KInputChildProcess.cpp +++ b/lskat/lskatproc/KInputChildProcess.cpp @@ -9,7 +9,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <qstring.h> +#include <tqstring.h> #include "KInputChildProcess.h" #include "KInputChildProcess.moc" @@ -21,7 +21,7 @@ KInputChildProcess::~KInputChildProcess() delete childConnect; } KInputChildProcess::KInputChildProcess(int size_buffer) - : QObject(0,0) + : TQObject(0,0) { buffersize=size_buffer; if (buffersize<1) buffersize=1024; @@ -32,12 +32,12 @@ KInputChildProcess::KInputChildProcess(int size_buffer) bool KInputChildProcess::exec() { int pos; - QString s; + TQString s; childConnect=new KChildConnect; if (!childConnect) return false; - connect(childConnect,SIGNAL(signalReceiveMsg(KEMessage *,int)), - this,SLOT(slotReceiveMsg(KEMessage *,int))); + connect(childConnect,TQT_SIGNAL(signalReceiveMsg(KEMessage *,int)), + this,TQT_SLOT(slotReceiveMsg(KEMessage *,int))); do { // Wait for input diff --git a/lskat/lskatproc/KInputChildProcess.h b/lskat/lskatproc/KInputChildProcess.h index b4694df5..2f964e71 100644 --- a/lskat/lskatproc/KInputChildProcess.h +++ b/lskat/lskatproc/KInputChildProcess.h @@ -17,7 +17,7 @@ #ifndef _KINPUTCHILDPROCESS_H_ #define _KINPUTCHILDPROCESS_H_ -#include <qobject.h> +#include <tqobject.h> #include "KEMessage.h" #include "KChildConnect.h" @@ -28,7 +28,7 @@ class KInputChildProcess : public QObject private: char *buffer; - QString inputbuffer; + TQString inputbuffer; int buffersize; bool terminateChild; protected: diff --git a/lskat/lskatproc/lskatproc.cpp b/lskat/lskatproc/lskatproc.cpp index c1fdcfba..7f40bd69 100644 --- a/lskat/lskatproc/lskatproc.cpp +++ b/lskat/lskatproc/lskatproc.cpp @@ -379,17 +379,17 @@ short x,y; SendDebug("Receiv Msg"); // end of process - if (msg->HasKey(QCString("Terminate"))) + if (msg->HasKey(TQCString("Terminate"))) { Terminate(); } // Init of process - if (msg->HasKey(QCString("Init"))) + if (msg->HasKey(TQCString("Init"))) { // No init necessary } // Make a move - if (msg->HasKey(QCString("Cards"))) + if (msg->HasKey(TQCString("Cards"))) { SendDebug("Process HasKey(Cards)"); // new game object @@ -422,9 +422,9 @@ short x,y; // report move msg->RemoveAll(); - msg->AddData(QCString("Move"),game.currentplayer); - msg->AddData(QCString("MoveX"),x); - msg->AddData(QCString("MoveY"),y); + msg->AddData(TQCString("Move"),game.currentplayer); + msg->AddData(TQCString("MoveX"),x); + msg->AddData(TQCString("MoveY"),y); //timee=time(0); // Sleep a minimum amount to slow down moves @@ -451,29 +451,29 @@ int lgame::ExtractGame(KEMessage *msg) char *p; int size; - msg->GetData(QCString("Startplayer"),startplayer); - msg->GetData(QCString("CurrentPlayer"),currentplayer); - msg->GetData(QCString("Cards"),p,size); - msg->GetData(QCString("Level"),level); + msg->GetData(TQCString("Startplayer"),startplayer); + msg->GetData(TQCString("CurrentPlayer"),currentplayer); + msg->GetData(TQCString("Cards"),p,size); + msg->GetData(TQCString("Level"),level); level--; // start with level 0 for (i=0;i<NO_OF_CARDS;i++) { card[i]=((int *)p)[i]; } - msg->GetData(QCString("Height"),p,size); + msg->GetData(TQCString("Height"),p,size); for (i=0;i<NO_OF_TILES;i++) { cardheight[i]=((int *)p)[i]; } - msg->GetData(QCString("Trump"),tmp); + msg->GetData(TQCString("Trump"),tmp); trump=(CCOLOUR)tmp; short mm; - msg->GetData(QCString("CurrentMove"),mm); + msg->GetData(TQCString("CurrentMove"),mm); curmove[1-currentplayer]=(int)mm; curmove[currentplayer]=-1; - msg->GetData(QCString("No"),movenumber); - msg->GetData(QCString("Sc1"),score[0]); - msg->GetData(QCString("Sc2"),score[1]); + msg->GetData(TQCString("No"),movenumber); + msg->GetData(TQCString("Sc1"),score[0]); + msg->GetData(TQCString("Sc2"),score[1]); return 1; } @@ -586,7 +586,7 @@ int lskatproc::GetComputerMove(lgame game,short &x,short &y,int rek) void lskatproc::SendDebug(const char *s) { KEMessage *msg=new KEMessage; - msg->AddData(QCString("Debug"),s); + msg->AddData(TQCString("Debug"),s); // msg->AddData("KLogSendMsg","debug.log"); // DEBUG // SendMsg(msg); |