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 -#include +#include +#include #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 +#include 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 -#include -#include +#include +#include +#include #include @@ -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 +#include 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 m_clients; + TQPtrList 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 +#include #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 +#include 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 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -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(0), "clear" ); + m_clear = new KAction( i18n("Clear"), "clear", NULL, this, TQT_SLOT( clear() ), static_cast(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 it(m_portfolioViews); *it; ++it) + for (TQPtrListIterator it(m_portfolioViews); *it; ++it) if ((portfolioView = dynamic_cast(*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 it(m_portfolioViews); *it; ++it) + for (TQPtrListIterator it(m_portfolioViews); *it; ++it) if ((portfolioView = dynamic_cast(*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 it(m_portfolioViews); (portfolioView = *it) ; ++it) + for (TQPtrListIterator 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 -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -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 m_portfolioViews; - QMap m_tradeGUIMap; + TQPtrList m_portfolioViews; + TQMap 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 -#include -#include -#include +#include +#include +#include +#include #include #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 -#include -#include +#include +#include +#include #include @@ -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 -#include +#include +#include #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 +#include 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 -#include -#include -#include +#include +#include +#include #include #include @@ -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 EventLog::events() +TQPtrList 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 events = m_eventLog->events(); - for (QPtrListIterator it( events ); (*it) ; ++it) + TQPtrList events = m_eventLog->events(); + for (TQPtrListIterator 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 events = m_eventLog->events(); - for (QPtrListIterator it( events ); (*it) ; ++it) + TQPtrList events = m_eventLog->events(); + for (TQPtrListIterator 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 -#include +#include +#include class QString; @@ -34,16 +34,16 @@ Q_OBJECT public: EventLog(); - QPtrList events(); + TQPtrList 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 m_events; + TQPtrList 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 -#include -#include +#include +#include +#include #include @@ -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 -#include -#include -#include +#include +#include +#include +#include #include #include @@ -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 -#include -#include +#include +#include #include #include @@ -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(m_checkBoxMap[command])) + if (TQCheckBox *checkBox = dynamic_cast(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 it = m_configBoxMap.begin() ; it != m_configBoxMap.end() ; ++it) + for (TQMapIterator 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 -#include -#include +#include +#include +#include #include #include @@ -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 m_optionCommandMap; - QMap m_configMap; - QMap m_configBoxMap; - QMap m_checkBoxMap; - QMap m_items; + TQMap m_optionCommandMap; + TQMap m_configMap; + TQMap m_configBoxMap; + TQMap m_checkBoxMap; + TQMap 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 -#include +#include +#include #include #include @@ -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 -#include +#include +#include #include #include @@ -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 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -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 -#include -#include +#include +#include +#include #include #include @@ -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 -#include +#include #include #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 it(m_trades); (trade = *it) ; ++it) + for (TQPtrListIterator 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 it(m_players); (player = *it) ; ++it) + for (TQPtrListIterator 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 it(m_games); (game = *it) ; ++it) + for (TQPtrListIterator it(m_games); (game = *it) ; ++it) { emit removeGUI(game); game->deleteLater(); @@ -98,7 +98,7 @@ Player *AtlanticCore::playerSelf() return m_playerSelf; } -QPtrList AtlanticCore::players() +TQPtrList 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 it(m_players); (player = *it) ; ++it) + for (TQPtrListIterator it(m_players); (player = *it) ; ++it) if (player->id() == playerId) return player; @@ -136,12 +136,12 @@ void AtlanticCore::removePlayer(Player *player) player->deleteLater(); } -QPtrList AtlanticCore::games() +TQPtrList 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 it(m_games); (game = *it) ; ++it) + for (TQPtrListIterator 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 it(m_games); (game = *it) ; ++it) + for (TQPtrListIterator 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 it(m_games); (*it) ; ++it) + for (TQPtrListIterator it(m_games); (*it) ; ++it) emit createGUI( (*it) ); } -QPtrList AtlanticCore::estates() +TQPtrList AtlanticCore::estates() { return m_estates; } @@ -210,7 +210,7 @@ Estate *AtlanticCore::newEstate(int estateId) Estate *AtlanticCore::findEstate(int estateId) { Estate *estate = 0; - for (QPtrListIterator it(m_estates); (estate = *it) ; ++it) + for (TQPtrListIterator 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 it(m_estates); (eTmp = *it) ; ++it) + for (TQPtrListIterator it(m_estates); (eTmp = *it) ; ++it) { if (!eFirst) eFirst = eTmp; @@ -233,7 +233,7 @@ Estate *AtlanticCore::estateAfter(Estate *estate) return eFirst; } -QPtrList AtlanticCore::estateGroups() +TQPtrList AtlanticCore::estateGroups() { return m_estateGroups; } @@ -248,14 +248,14 @@ EstateGroup *AtlanticCore::newEstateGroup(int groupId) EstateGroup *AtlanticCore::findEstateGroup(int groupId) { EstateGroup *estateGroup = 0; - for (QPtrListIterator it(m_estateGroups); (estateGroup = *it) ; ++it) + for (TQPtrListIterator it(m_estateGroups); (estateGroup = *it) ; ++it) if (estateGroup->id() == groupId) return estateGroup; return 0; } -QPtrList AtlanticCore::trades() +TQPtrList AtlanticCore::trades() { return m_trades; } @@ -273,7 +273,7 @@ Trade *AtlanticCore::newTrade(int tradeId) Trade *AtlanticCore::findTrade(int tradeId) { Trade *trade = 0; - for (QPtrListIterator it(m_trades); (trade = *it) ; ++it) + for (TQPtrListIterator it(m_trades); (trade = *it) ; ++it) if (trade->tradeId() == tradeId) return trade; @@ -287,7 +287,7 @@ void AtlanticCore::removeTrade(Trade *trade) trade->deleteLater(); } -QPtrList AtlanticCore::auctions() +TQPtrList AtlanticCore::auctions() { return m_auctions; } @@ -325,7 +325,7 @@ void AtlanticCore::removeConfigOption(ConfigOption *configOption) ConfigOption *AtlanticCore::findConfigOption(int configId) { ConfigOption *configOption = 0; - for (QPtrListIterator it(m_configOptions); (configOption = *it) ; ++it) + for (TQPtrListIterator 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 it(m_players); (player = *it) ; ++it) + for (TQPtrListIterator 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 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 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 it(m_estates); (estate = *it) ; ++it) + for (TQPtrListIterator it(m_estates); (estate = *it) ; ++it) std::cout << " E: " << estate->name().latin1() << std::endl; EstateGroup *estateGroup = 0; - for (QPtrListIterator it(m_estateGroups); (estateGroup = *it) ; ++it) + for (TQPtrListIterator it(m_estateGroups); (estateGroup = *it) ; ++it) std::cout << "EG: " << estateGroup->name().latin1() << std::endl; Auction *auction = 0; - for (QPtrListIterator it(m_auctions); (auction = *it) ; ++it) - std::cout << " A: " << QString::number(auction->auctionId()).latin1() << std::endl; + for (TQPtrListIterator it(m_auctions); (auction = *it) ; ++it) + std::cout << " A: " << TQString::number(auction->auctionId()).latin1() << std::endl; Trade *trade = 0; - for (QPtrListIterator it(m_trades); (trade = *it) ; ++it) - std::cout << " T: " << QString::number(trade->tradeId()).latin1() << std::endl; + for (TQPtrListIterator it(m_trades); (trade = *it) ; ++it) + std::cout << " T: " << TQString::number(trade->tradeId()).latin1() << std::endl; ConfigOption *configOption = 0; - for (QPtrListIterator it(m_configOptions); (configOption = *it) ; ++it) - std::cout << "CO:" << QString::number(configOption->id()).latin1() << " " << configOption->name().latin1() << " " << configOption->value().latin1() << std::endl; + for (TQPtrListIterator 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 -#include +#include +#include #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 players(); + TQPtrList players(); Player *newPlayer(int playerId, const bool &playerSelf = false); Player *findPlayer(int playerId); void removePlayer(Player *player); - QPtrList games(); - Game *newGame(int gameId, const QString &type = QString::null); - Game *findGame(const QString &type); // finds game types + TQPtrList 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 estates(); + TQPtrList estates(); Estate *newEstate(int estateId); Estate *findEstate(int estateId); Estate *estateAfter(Estate *estate); - QPtrList estateGroups(); + TQPtrList estateGroups(); EstateGroup *newEstateGroup(int groupId); EstateGroup *findEstateGroup(int groupId); - QPtrList trades(); + TQPtrList trades(); Trade *newTrade(int tradeId); Trade *findTrade(int tradeId); void removeTrade(Trade *trade); - QPtrList auctions(); + TQPtrList auctions(); Auction *newAuction(int auctionId, Estate *estate); void delAuction(Auction *auction); @@ -93,13 +93,13 @@ signals: private: Player *m_playerSelf; - QPtrList m_players; - QPtrList m_games; - QPtrList m_estates; - QPtrList m_estateGroups; - QPtrList m_trades; - QPtrList m_auctions; - QPtrList m_configOptions; + TQPtrList m_players; + TQPtrList m_games; + TQPtrList m_estates; + TQPtrList m_estateGroups; + TQPtrList m_trades; + TQPtrList m_auctions; + TQPtrList 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 +#include #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 -#include +#include +#include #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 -#include +#include +#include #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 +#include #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 +#include #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 +#include #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 -#include +#include +#include #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 it = m_playerAcceptMap.begin() ; it != m_playerAcceptMap.end() ; ++it) + for (TQMapIterator 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 i(mTradeItems); *i; ++i) + for (TQPtrListIterator i(mTradeItems); *i; ++i) { t=dynamic_cast(*i); @@ -100,7 +100,7 @@ void Trade::updateMoney(unsigned int money, Player *from, Player *to) { TradeMoney *t=0; - for (QPtrListIterator i(mTradeItems); *i; ++i) + for (TQPtrListIterator i(mTradeItems); *i; ++i) { t=dynamic_cast(*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 -#include -#include +#include +#include +#include #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 mPlayers; - QMap m_playerAcceptMap; + TQPtrList mPlayers; + TQMap m_playerAcceptMap; - QPtrList mTradeItems; + TQPtrList 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 -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -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 playerList = m_atlanticCore->players(); - for (QPtrListIterator it(playerList); (player = *it) ; ++it) + TQPtrList playerList = m_atlanticCore->players(); + for (TQPtrListIterator 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 +#include #include #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 m_playerLocationMap; - QMap m_auctions; + TQMap m_playerLocationMap; + TQMap 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 +#include /* #include @@ -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 +#include 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 -#include -#include -#include +#include +#include +#include +#include #include @@ -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 playerList = m_atlanticCore->players(); - for (QPtrListIterator it(playerList); *it; ++it) + TQPtrList playerList = m_atlanticCore->players(); + for (TQPtrListIterator 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 -#include -#include +#include +#include +#include #include @@ -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 m_playerItems; - QLabel *m_statusLabel; + TQVBoxLayout *m_mainLayout; + TQVGroupBox *m_playerGroupBox; + TQSpinBox *m_bidSpinBox; + TQMap 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 -#include -#include +#include +#include #include #include @@ -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 it(m_estateViews); *it; ++it) + for (TQPtrListIterator it(m_estateViews); *it; ++it) if ((estateView = dynamic_cast(*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 i(m_estateViews); *i; ++i) + for (TQPtrListIterator i(m_estateViews); *i; ++i) { estateView = dynamic_cast(*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 (estateIdaddWidget(estateView, sideLen, sideLen-estateId); @@ -167,8 +167,8 @@ void AtlantikBoard::addEstateView(Estate *estate, bool indicateUnowned, bool hig if (m_atlanticCore) { Player *player = 0; - QPtrList playerList = m_atlanticCore->players(); - for (QPtrListIterator it(playerList); (player = *it) ; ++it) + TQPtrList playerList = m_atlanticCore->players(); + for (TQPtrListIterator 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 it(m_tokens); (token = *it) ; ++it) + for (TQPtrListIterator 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 it(m_tokens); (token = *it) ; ++it) + for (TQPtrListIterator 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(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(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 -#include -#include -#include +#include +#include +#include +#include #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 m_estateViews; - QPtrList m_tokens; - QPtrList m_displayQueue; + TQPtrList m_estateViews; + TQPtrList m_tokens; + TQPtrList 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 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -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 +#include 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 m_buttonCommandMap; - QPtrList m_buttons; + TQVBoxLayout *m_mainLayout; + TQHBoxLayout *m_buttonBox; + TQVGroupBox *m_textGroupBox; + TQMap m_buttonCommandMap; + TQPtrList 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 -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -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(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 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 -#include +#include +#include #include @@ -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 -#include +#include +#include #include #include @@ -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 -#include +#include +#include #include 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 -#include -#include +#include +#include +#include #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 -#include +#include +#include #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 -#include +#include +#include #include #include @@ -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 estateGroups = m_atlanticCore->estateGroups(); + TQPtrList 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 it(estateGroups); *it; ++it) + for (TQPtrListIterator it(estateGroups); *it; ++it) { if ((estateGroup = *it)) { @@ -94,9 +94,9 @@ void PortfolioView::buildPortfolio() lastPE = 0; // Loop through estates - QPtrList estates = m_atlanticCore->estates(); + TQPtrList estates = m_atlanticCore->estates(); Estate *estate; - for (QPtrListIterator it(estates); *it; ++it) + for (TQPtrListIterator 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 -#include -#include +#include +#include +#include #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 m_portfolioEstates; + TQPtrList 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 -#include -#include -#include +#include +#include +#include #include @@ -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 +#include 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -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 estateList = m_atlanticCore->estates(); + TQPtrList estateList = m_atlanticCore->estates(); Estate *estate; - for (QPtrListIterator it(estateList); *it; ++it) + for (TQPtrListIterator 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 playerList = m_atlanticCore->players(); + TQPtrList 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 it(playerList); *it; ++it) + for (TQPtrListIterator 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(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::Iterator it=m_componentRevMap.begin() ; it != m_componentRevMap.end() && (item = *it) ; ++it) + for (TQMap::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(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 -#include +#include +#include #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 m_componentMap; - QMap m_componentRevMap; - QMap m_estateMap; - QMap m_estateRevMap; - QMap m_playerFromMap, m_playerTargetMap; - QMap m_playerFromRevMap, m_playerTargetRevMap; + TQMap m_componentMap; + TQMap m_componentRevMap; + TQMap m_estateMap; + TQMap m_estateRevMap; + TQMap m_playerFromMap, m_playerTargetMap; + TQMap 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 +#include #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 -#include +#include +#include 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 mCRanges; + TQPtrList 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 +#include #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 -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -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(event); - if (event->type() == QEvent::AccelOverride) + TQKeyEvent *e = static_cast(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::Iterator it = keycodes.begin(); + TQMap::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::Iterator it = keycodes.begin(); + TQMap::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 #include -#include -#include +#include +#include #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 soundDict; + TQDict 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 keycodes; + TQMap 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(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 it(missiles); + TQPtrListIterator 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 it( powerups ); + TQPtrListIterator 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 -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "sprites.h" #include @@ -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 animation; - QPtrList rocks; - QPtrList missiles; - QPtrList bits; - QPtrList exhaust; - QPtrList powerups; + TQCanvas field; + TQCanvasView view; + TQIntDict animation; + TQPtrList rocks; + TQPtrList missiles; + TQPtrList bits; + TQPtrList exhaust; + TQPtrList 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 #include #include -#include -#include -#include +#include +#include +#include #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 -#include -#include +#include +#include +#include #include @@ -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 #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -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 -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -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 +#include 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 #include -#include -#include -#include -#include +#include +#include +#include +#include #include "atom.h" -#include +#include 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 atoms; - QString mname; - QSize _size; + TQValueList 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 +#include #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 -#include +#include +#include #include #include @@ -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 #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include -#include +#include +#include #include #include -#include +#include #include #include #include -#include +#include #include #include @@ -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("
") + line + "

"; + rxCollect += TQString("
") + line + "

"; 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 += "
    " + 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 += "
" + 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], "

"); 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("

" + 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("") + rxCollect + ""); + emit infoText(TQString("") + rxCollect + ""); 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 %1. To fully activate " + TQString text = i18n("Your account has been created. Your new login is %1. 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("

" + text + "

"); @@ -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("
") + line + ""; + rxCollect = TQString("
") + line + ""; 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("
") + emit infoText(TQString("
") + 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 -#include -#include +#include +#include +#include #include @@ -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 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -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 *mName2ID; + TQDict *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(17, true); + d->mName2ID = new TQDict(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 it(*d->mName2ID); + TQDictIterator 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("%1 tells you: %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), "")); + cMsg = i18n("%1 tells you: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; 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("%1 shouts: %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), "")); + cMsg = i18n("%1 shouts: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; } else cMsg = ""; @@ -566,7 +566,7 @@ void KBgChat::handleData(const QString &msg) case CLIP_WHISPERS: if (!d->mGag.contains(user)) { - cMsg = i18n("%1 whispers: %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), "")); + cMsg = i18n("%1 whispers: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); } else @@ -575,7 +575,7 @@ void KBgChat::handleData(const QString &msg) case CLIP_KIBITZES: if (!d->mGag.contains(user)) { - cMsg = i18n("%1 kibitzes: %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), "")); + cMsg = i18n("%1 kibitzes: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); } else @@ -583,31 +583,31 @@ void KBgChat::handleData(const QString &msg) break; case CLIP_YOU_SAY: - cMsg = i18n("You tell %1: %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), "")); + cMsg = i18n("You tell %1: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; case CLIP_YOU_SHOUT: cMsg = i18n("You shout: %1").arg(cMsg); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; case CLIP_YOU_WHISPER: cMsg = i18n("You whisper: %1").arg(cMsg); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; case CLIP_YOU_KIBITZ: cMsg = i18n("You kibitz: %1").arg(cMsg); cMsg = "" + cMsg + ""; 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("User %1 left a message at %2: %3").arg(user).arg(date.toString()).arg(cMsg); cMsg = "" + cMsg + ""; 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("") + cMsg + ""; + cMsg = TQString("") + cMsg + ""; 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("") + cMsg + ""; + cMsg = TQString("") + cMsg + ""; 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("You say to yourself: ")); } 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(""); + TQString msg(""); msg += i18n("The gag list is now empty."); msg += ""; - addMessage(QString::null, msg); + addMessage(TQString::null, msg); } /* @@ -740,11 +740,11 @@ void KBgChat::slotGag() { d->mGag.append(d->mName[0]); - QString msg(""); + TQString msg(""); msg += i18n("You won't hear what %1 says and shouts.").arg(d->mName[0]); msg += ""; - addMessage(QString::null, msg); + addMessage(TQString::null, msg); } /* @@ -762,11 +762,11 @@ void KBgChat::slotUngag() { d->mGag.remove(d->mName[0]); - QString msg(""); + TQString msg(""); msg += i18n("You will again hear what %1 says and shouts.").arg(d->mName[0]); msg += ""; - 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 = "" + i18n("You will not hear what people shout.") + ""; else msg = "" + i18n("You will hear what people shout.") + ""; - addMessage(QString::null, msg); + addMessage(TQString::null, msg); } /* @@ -797,10 +797,10 @@ void KBgChat::slotSilent() */ void KBgChat::slotCopy() { - d->mText.replace(QRegExp(""), ""); - d->mText.replace(QRegExp(""), ""); - d->mText.replace(QRegExp(""), ""); - d->mText.replace(QRegExp("^.*\">"), ""); + d->mText.replace(TQRegExp(""), ""); + d->mText.replace(TQRegExp(""), ""); + d->mText.replace(TQRegExp(""), ""); + 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 -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -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 -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -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 -#include +#include +#include #include @@ -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 #endif -#include +#include 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 #include #include -#include +#include #include #include -#include -#include +#include +#include #include #include #include #include #include -#include +#include #include #include @@ -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.

")); @@ -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("
") + i18n("The GNU Backgammon process (%1) has exited. ") + emit infoText(TQString("
") + i18n("The GNU Backgammon process (%1) has exited. ") .arg(proc->pid()) + "
"); 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 -#include -#include +#include +#include #include #include #include -#include +#include /** * @@ -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 #include #include -#include +#include #include #include -#include -#include +#include +#include #include #include #include #include #include -#include -#include -#include +#include +#include +#include #include @@ -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 -#include +#include +#include #include -#include +#include #include #include @@ -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 -#include +#include 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 -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -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 -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -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 l; + TQValueList 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 #include #include -#include -#include -#include +#include +#include +#include #include -#include -#include +#include +#include #include #include #include @@ -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 it(moveHistory); + TQPtrListIterator 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 #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -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 moveHistory; - QPtrList redoHistory; + TQPopupMenu *contextMenu; + TQPtrList moveHistory; + TQPtrList 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 #endif -#include +#include /** @@ -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 #include #include -#include +#include #include #include @@ -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("" + l + "
\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 -#include +#include /** - * 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 -#include +#include #include #include #include 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 +#include #include @@ -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 -#include +#include +#include #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 -#include +#include +#include #include #include @@ -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 DeathValueList; + typedef TQValueList 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 DeathValueList; + typedef TQValueList 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 #include -#include +#include #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 #endif #include -#include +#include #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("")) >= 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 -#include +#include #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 #endif #include -#include +#include #include #include #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("")) >= 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 -#include +#include #include #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 +#include #include #include #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(event); + TQKeyEvent *keyEvent = static_cast(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(event); + TQKeyEvent *keyEvent = static_cast(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(event); + TQMouseEvent *mouseEvent = static_cast(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(event); + TQMouseEvent *mouseEvent = static_cast(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 -#include -#include -#include -#include +#include +#include +#include +#include #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 KBStrategy::masterShotList() +TQValueList 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 -#include +#include +#include #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 masterShotList(); + TQValueList 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 m_prevShots; + TQValueList 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 #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 -#include -#include +#include +#include +#include #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 -#include +#include +#include #include #include #include #include -#include +#include #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::ConstIterator itEnd = m_browser->services().end(); - for (QValueList::ConstIterator it = m_browser->services().begin(); + TQStringList names; + TQValueList::ConstIterator itEnd = m_browser->services().end(); + for (TQValueList::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 #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #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 -#include -#include +#include +#include +#include #include #include @@ -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 +#include 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 -#include +#include +#include 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 #include -#include +#include #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 #include -#include +#include #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 -#include -#include -#include +#include +#include +#include +#include #include @@ -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 -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 #include -#include +#include #include "kbattlefield.h" #include "kship.h" @@ -51,7 +51,7 @@ signals: void sigOwnFieldDataChanged(int, int, int); private: - QPtrList m_shiplist; + TQPtrList 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 -#include +#include +#include #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 -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -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 -#include -#include -#include -#include +#include +#include +#include +#include +#include #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 -#include +#include +#include #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 -#include +#include #include #include #include -#include +#include #include #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; ncount(); 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; xsetTile( 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; nstart( 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 -#include -#include +#include +#include +#include #if HAVE_ARTS #include @@ -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 m_backTiles; + TQPixmap m_tiles; + TQMemArray 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 m_balls; - QCanvasPixmapArray *m_ballPixmaps; - QCanvasText *m_text; + TQPtrList 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 +#include #include #include #include #include -#include -#include +#include +#include #include #include #include @@ -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 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 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 -#include -#include +#include +#include +#include #include #include @@ -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; isetItems(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; isetItems(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 (factory()->container("rmbPopup",this)); + TQPopupMenu* rmbMenu = static_cast (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; iconfig(); 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 -#include -#include -#include +#include +#include +#include +#include #include #include 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 -#include -#include -#include -#include +#include +#include +#include +#include +#include /* 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 balls; + TQPtrList 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 positions; - QMemArray animations; + TQMemArray positions; + TQMemArray 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 -#include -#include +#include +#include #include #include @@ -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 +#include #include #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 -#include -#include +#include +#include +#include #include #include @@ -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 -#include +#include +#include #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 -#include -#include +#include +#include +#include #include -#include -#include +#include +#include #include #include @@ -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;isetText( 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;iwriteEntry("MoveValues", entry); entry.sprintf("%d", _inARowValue[0]); for(int i=1;iwriteEntry("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 +#include #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 #include -#include +#include #include #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 +#include 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 #include -#include -#include -#include +#include +#include +#include class Listener { public: @@ -49,10 +49,10 @@ class Network: public QObject private: bool sendString(struct sockaddr_in sin, char* str, int len); - QPtrList listeners; + TQPtrList 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 -#include -#include +#include +#include +#include #include #include @@ -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;iaddLayout( 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;iaddLayout( 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 +#include #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 +#include #include #include 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 free(matrix().width()); + TQMemArray 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 _field; - QMemArray _groups, _chainedPuyos; + TQMemArray _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 +#include #include #include @@ -10,11 +10,11 @@ #include "board.h" -FEField::FEField(QWidget *parent) +FEField::FEField(TQWidget *parent) : Field(parent) { Board *b = static_cast(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(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 -#include -#include +#include +#include #include @@ -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 -#include -#include +#include +#include #include #include @@ -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 +#include 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 pmList; + TQPixmap pm; + TQValueList 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 pmList; - QList ptList; + TQPixmap * pm; + TQPoint * pt; + QList pmList; + QList 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 (); + enemySprites = new TQPtrList (); #else - enemySprites = new QList (); + enemySprites = new QList (); #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 #endif -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include 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 * enemySprites; + TQPtrList * enemySprites; #else - QList * enemySprites; + QList * 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 & gamesList, KGrGame * theGame, - QWidget * parent, const char * name) - : QDialog (parent, name, TRUE, + TQPtrList & 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 & gamesList, KGrGame * theGame, - QWidget * parent, const char * name) + TQPtrList & 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 ("" + i18n("Level 1 of the selected game is:") + "", 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 & gamesList, - QWidget * parent, const char * name) - : QDialog (parent, name, TRUE, + TQPtrList & gamesList, + TQWidget * parent, const char * name) + : TQDialog (parent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrECDialog::KGrECDialog (int action, int collnIndex, - QPtrList & gamesList, - QWidget * parent, const char * name) + TQPtrList & 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 & collections, - QWidget * parent, const char * name) - : QDialog (parent, name, TRUE, +KGrLGDialog::KGrLGDialog (TQFile * savedGames, + TQPtrList & collections, + TQWidget * parent, const char * name) + : TQDialog (parent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else -KGrLGDialog::KGrLGDialog (QFile * savedGames, - QPtrList & collections, - QWidget * parent, const char * name) +KGrLGDialog::KGrLGDialog (TQFile * savedGames, + TQPtrList & 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, "" + text + ""); #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, "" + text + "", 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 +#include #define KGR_DIALOG QDialog -#include +#include #else #include @@ -25,22 +25,22 @@ #include #endif -#include +#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #ifdef QT3 -#include +#include #else -#include +#include #endif -#include +#include /** @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 & gamesList, KGrGame * theGame, - QWidget * parent = 0, const char *name = 0); + TQPtrList & 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 collections; // List of games. + TQPtrList 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 & gamesList, - QWidget *parent = 0, const char *name = 0); + TQPtrList & gamesList, + TQWidget *parent = 0, const char *name = 0); ~KGrECDialog(); QString getName() {return (ecName->text());} @@ -154,28 +154,28 @@ private slots: void ecSetTrad(); private: - QPtrList collections; // List of existing games. + TQPtrList 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 -#include +#include +#include class KGrLGDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase { Q_OBJECT public: - KGrLGDialog (QFile * savedGames, QPtrList & collections, - QWidget * parent, const char * name); - QString getCurrentText() {return (lgList->currentText());} + KGrLGDialog (TQFile * savedGames, TQPtrList & 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 *e) +void KGrHero::setEnemyList(TQPtrList *e) #else void KGrHero::setEnemyList(QList *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 *e) +void KGrEnemy::setEnemyList(TQPtrList *e) #else void KGrEnemy::setEnemyList(QList *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 #include -#include +#include #ifdef QT3 -#include +#include #else -#include +#include #endif -#include -#include -#include -#include +#include +#include +#include +#include #include // 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 *); + void setEnemyList(TQPtrList *); #else void setEnemyList(QList *); #endif @@ -129,7 +129,7 @@ public: private: #ifdef QT3 - QPtrList *enemies; + TQPtrList *enemies; #else QList *enemies; #endif @@ -167,7 +167,7 @@ public: void showFigure(); void startSearching(); #ifdef QT3 - void setEnemyList(QPtrList *); + void setEnemyList(TQPtrList *); #else void setEnemyList(QList *); #endif @@ -184,10 +184,10 @@ private: int birthX, birthY; int searchStatus; int captiveCounter; - QTimer *captiveTimer; + TQTimer *captiveTimer; bool canWalkUp(); #ifdef QT3 - QPtrList *enemies; + TQPtrList *enemies; #else QList *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 = "" + i18n("GAME OVER !!!") + ""; + TQString gameOver = "" + i18n("GAME OVER !!!") + ""; 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("Congratulations !!! " "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 ( "

KGoldrunner Hall of Fame


" "

\"%1\" Game

") .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 +#include #ifdef QT3 -#include +#include #else -#include +#include #endif -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include /** 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 enemies; // The list of enemies. + TQPtrList enemies; // The list of enemies. #else QList 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 collections; // List of ALL collections. + TQPtrList collections; // List of ALL collections. #else QList 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 #include -#include +#include #include // 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 #include -#include -#include +#include +#include #include #include #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(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(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(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;isetCoordinates(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 +#include class QGridLayout; class CubeBox; @@ -48,14 +48,14 @@ struct Loop }; -class KCubeBoxWidget : public QWidget , public CubeBoxBase +class KCubeBoxWidget : public TQWidget , public CubeBoxBase { 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 -#include +#include +#include #include #include @@ -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=(hsetBrush(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 +#include #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 +#include #include #include @@ -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(list.first()); + TQCanvasSprite *spr = static_cast(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 heights(matrix().width()); + TQMemArray heights(matrix().width()); for (uint i=1; i groups = findGroups(field, 2, true); + TQMemArray 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 field; bool sliding; - QMemArray empty; + TQMemArray 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 -#include +#include +#include #include #include @@ -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("Display the number of remaining " + TQWhatsThis::add(sc, i18n("Display the number of remaining " "blocks.
" "It turns blue" " 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 +#include #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 +#include #include #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 #include //#include "shotcounter.h" -#include +#include #include "linesboard.h" -//#include -#include +//#include +#include #include #include #include @@ -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 -#include +#include +#include #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 -#include +#include +#include #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 -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -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; isetItems(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 -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -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 -#include -#include -#include +#include +#include +#include +#include #include @@ -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 -#include -#include +#include +#include #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 -#include -#include -#include +#include +#include +#include +#include #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 +#include #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 +#include #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 +#include 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 +#include 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 -#include -#include +#include +#include +#include @@ -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 +#include #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 #include -#include -#include +#include +#include #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 -#include +#include +#include #include #include #include @@ -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 -#include +#include +#include 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 -#include +#include +#include #include #include "klocale.h" #include #include -#include -#include +#include +#include #include #include #include -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; rowsetGeometry( 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; pcount(); 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 +#include 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 #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #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 -#include +#include #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 #include "Tileset.h" -#include +#include #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 +#include 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 #include -#include -#include +#include +#include #include #include -#include +#include #include /** * 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 -#include +#include +#include #include @@ -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 +#include 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -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; isetFixedWidth(100); } for (uint i=0; isetFixedWidth(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 +#include #include #include @@ -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 -#include -#include -#include +#include +#include +#include #include #include @@ -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 -#include -#include -#include +#include +#include +#include +#include #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 -#include -#include +#include +#include +#include #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 s; + TQMemArray 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(factory()->container(popupName, this)); + TQPopupMenu *popup = + static_cast(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(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(sender())); + _widgets.remove(static_cast(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 it(_widgets); + TQPtrListIterator 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 _widgets; + TQPtrList _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 +#include #include #include @@ -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 list = _keybCollection->actions(); - QValueList::Iterator it; + TQValueList list = _keybCollection->actions(); + TQValueList::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 +#include #include #include @@ -36,8 +36,8 @@ class BaseField : public KGrid2D::Square, 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, 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 #include -#include -#include -#include +#include +#include +#include #include #include @@ -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 -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -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("Mines left.
" + TQWhatsThis::add(left, i18n("Mines left.
" "It turns red " "when you have flagged more cases than " "present mines.
")); @@ -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("Time elapsed.
" + TQWhatsThis::add(dg, i18n("Time elapsed.
" "It turns blue " "if it is a highscore " "and red " @@ -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=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 (; klevel(); 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; kdoAction((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 +#include #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 -#include +#include +#include #include #include @@ -26,7 +26,7 @@ Cell::PixmapMap Cell::disconnectedpixmap; void Cell::initPixmaps() { - typedef QMap NamesMap; + typedef TQMap 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 -#include +#include +#include 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 PixmapMap; + typedef TQMap 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 s; + TQMemArray 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(ka