diff --git a/atlantik/COPYING.LIB b/atlantik/COPYING.LIB index ae23fcfd..fbb61ee9 100644 --- a/atlantik/COPYING.LIB +++ b/atlantik/COPYING.LIB @@ -135,7 +135,7 @@ included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated +all the source code for all modules it tqcontains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. @@ -257,7 +257,7 @@ linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline +structure tqlayouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the diff --git a/atlantik/atlanticd/atlanticclient.cpp b/atlantik/atlanticd/atlanticclient.cpp index 0e4e3e12..a3baf2e6 100644 --- a/atlantik/atlanticd/atlanticclient.cpp +++ b/atlantik/atlanticd/atlanticclient.cpp @@ -20,7 +20,7 @@ #include "atlanticclient.h" #include "atlanticclient.moc" -AtlanticClient::AtlanticClient(TQObject *parent, const char *name) : TQSocket(parent, name) +AtlanticClient::AtlanticClient(TQObject *tqparent, const char *name) : TQSocket(tqparent, name) { connect(this, TQT_SIGNAL(readyRead()), this, TQT_SLOT(readData())); } diff --git a/atlantik/atlanticd/atlanticclient.h b/atlantik/atlanticd/atlanticclient.h index 8f63b88c..7b4dc19a 100644 --- a/atlantik/atlanticd/atlanticclient.h +++ b/atlantik/atlanticd/atlanticclient.h @@ -19,12 +19,13 @@ #include -class AtlanticClient : public QSocket +class AtlanticClient : public TQSocket { Q_OBJECT + TQ_OBJECT public: - AtlanticClient(TQObject *parent = 0, const char *name = 0); + AtlanticClient(TQObject *tqparent = 0, const char *name = 0); void sendData(const TQString &data); private slots: diff --git a/atlantik/atlanticd/atlanticdaemon.h b/atlantik/atlanticd/atlanticdaemon.h index 2e107a0a..8de64c3e 100644 --- a/atlantik/atlanticd/atlanticdaemon.h +++ b/atlantik/atlanticd/atlanticdaemon.h @@ -25,9 +25,10 @@ class AtlanticCore; class AtlanticClient; class ServerSocket; -class AtlanticDaemon : public QObject +class AtlanticDaemon : public TQObject { Q_OBJECT + TQ_OBJECT public: AtlanticDaemon(); diff --git a/atlantik/atlanticd/serversocket.h b/atlantik/atlanticd/serversocket.h index cc31c8ab..29550769 100644 --- a/atlantik/atlanticd/serversocket.h +++ b/atlantik/atlanticd/serversocket.h @@ -21,9 +21,10 @@ class AtlanticClient; -class ServerSocket : public QServerSocket +class ServerSocket : public TQServerSocket { Q_OBJECT + TQ_OBJECT public: ServerSocket(int port, int backlog); diff --git a/atlantik/client/atlantik.cpp b/atlantik/client/atlantik.cpp index f1e24645..2ad1bf98 100644 --- a/atlantik/client/atlantik.cpp +++ b/atlantik/client/atlantik.cpp @@ -64,15 +64,15 @@ #include "selectgame_widget.h" #include "selectconfiguration_widget.h" -LogTextEdit::LogTextEdit( TQWidget *parent, const char *name ) : TQTextEdit( parent, name ) +LogTextEdit::LogTextEdit( TQWidget *tqparent, const char *name ) : TQTextEdit( tqparent, name ) { #ifdef KDE_3_2_FEATURES - m_clear = KStdAction::clear( this, TQT_SLOT( clear() ), 0 ); + m_clear = KStdAction::clear( TQT_TQOBJECT(this), TQT_SLOT( clear() ), 0 ); #else - m_clear = new KAction( i18n("Clear"), "clear", NULL, this, TQT_SLOT( clear() ), static_cast(0), "clear" ); + m_clear = new KAction( i18n("Clear"), "clear", NULL, TQT_TQOBJECT(this), TQT_SLOT( clear() ), static_cast(0), "clear" ); #endif - m_selectAll = KStdAction::selectAll( this, TQT_SLOT( selectAll() ), 0 ); - m_copy = KStdAction::copy( this, TQT_SLOT( copy() ), 0 ); + m_selectAll = KStdAction::selectAll( TQT_TQOBJECT(this), TQT_SLOT( selectAll() ), 0 ); + m_copy = KStdAction::copy( TQT_TQOBJECT(this), TQT_SLOT( copy() ), 0 ); } LogTextEdit::~LogTextEdit() @@ -103,12 +103,12 @@ Atlantik::Atlantik () // Toolbar: Game // 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"); + m_showEventLog = new KAction(i18n("Show Event &Log")/*, "atlantik_showeventlog"*/, CTRL+Key_L, TQT_TQOBJECT(this), TQT_SLOT(showEventLog()), actionCollection(), "showeventlog"); + KStdGameAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(closeAllWindows()), actionCollection(), "game_quit"); // Toolbar: Settings - KStdAction::preferences(this, TQT_SLOT(slotConfigure()), actionCollection()); - KStdAction::configureNotifications(this, TQT_SLOT(configureNotifications()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(slotConfigure()), actionCollection()); + KStdAction::configureNotifications(TQT_TQOBJECT(this), TQT_SLOT(configureNotifications()), actionCollection()); // Initialize pointers to 0L m_configDialog = 0; @@ -120,37 +120,37 @@ Atlantik::Atlantik () m_atlantikNetwork = 0; // Game and network core - m_atlanticCore = new AtlanticCore(this, "atlanticCore"); - 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 *))); + m_atlanticCore = new AtlanticCore(TQT_TQOBJECT(this), "atlanticCore"); + connect(m_atlanticCore, TQT_SIGNAL(createGUI(Player *)), TQT_TQOBJECT(this), TQT_SLOT(newPlayer(Player *))); + connect(m_atlanticCore, TQT_SIGNAL(removeGUI(Player *)), TQT_TQOBJECT(this), TQT_SLOT(removeGUI(Player *))); + connect(m_atlanticCore, TQT_SIGNAL(createGUI(Trade *)), TQT_TQOBJECT(this), TQT_SLOT(newTrade(Trade *))); + connect(m_atlanticCore, TQT_SIGNAL(removeGUI(Trade *)), TQT_TQOBJECT(this), TQT_SLOT(removeGUI(Trade *))); initEventLog(); initNetworkObject(); // Menu,toolbar: Move - m_roll = KStdGameAction::roll(this, TQT_SIGNAL(rollDice()), actionCollection()); + m_roll = KStdGameAction::roll(TQT_TQOBJECT(this), TQT_SIGNAL(rollDice()), actionCollection()); m_roll->setEnabled(false); - m_buyEstate = new KAction(i18n("&Buy"), "atlantik_buy_estate", CTRL+Key_B, this, TQT_SIGNAL(buyEstate()), actionCollection(), "buy_estate"); + m_buyEstate = new KAction(i18n("&Buy"), "atlantik_buy_estate", CTRL+Key_B, TQT_TQOBJECT(this), TQT_SIGNAL(buyEstate()), actionCollection(), "buy_estate"); m_buyEstate->setEnabled(false); - m_auctionEstate = new KAction(i18n("&Auction"), "auction", CTRL+Key_A, this, TQT_SIGNAL(auctionEstate()), actionCollection(), "auction"); + m_auctionEstate = new KAction(i18n("&Auction"), "auction", CTRL+Key_A, TQT_TQOBJECT(this), TQT_SIGNAL(auctionEstate()), actionCollection(), "auction"); m_auctionEstate->setEnabled(false); - m_endTurn = KStdGameAction::endTurn(this, TQT_SIGNAL(endTurn()), actionCollection()); + m_endTurn = KStdGameAction::endTurn(TQT_TQOBJECT(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, TQT_SIGNAL(jailCard()), actionCollection(), "move_jailcard"); + m_jailCard = new KAction(i18n("Use Card to Leave Jail")/*, "atlantik_move_jail_card"*/, 0, TQT_TQOBJECT(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, TQT_SIGNAL(jailPay()), actionCollection(), "move_jailpay"); + m_jailPay = new KAction(i18n("&Pay to Leave Jail"), "jail_pay", CTRL+Key_P, TQT_TQOBJECT(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, TQT_SIGNAL(jailRoll()), actionCollection(), "move_jailroll"); + m_jailRoll = new KAction(i18n("Roll to Leave &Jail")/*, "atlantik_move_jail_roll"*/, CTRL+Key_J, TQT_TQOBJECT(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(TQString::null, 1); - connect(statusBar(), TQT_SIGNAL(released(int)), this, TQT_SLOT(statusBarClick(int))); + KMainWindow::statusBar()->insertItem(TQString(), 1); + connect(statusBar(), TQT_SIGNAL(released(int)), TQT_TQOBJECT(this), TQT_SLOT(statusBarClick(int))); // Main widget, containing all others m_mainWidget = new TQWidget(this, "main"); @@ -158,7 +158,7 @@ Atlantik::Atlantik () m_mainLayout = new TQGridLayout(m_mainWidget, 3, 2); setCentralWidget(m_mainWidget); - // Vertical view area for portfolios. + //Qt::Vertical view area for portfolios. m_portfolioScroll = new TQScrollView(m_mainWidget, "pfScroll"); m_mainLayout->addWidget( m_portfolioScroll, 0, 0 ); m_portfolioScroll->setHScrollBarMode( TQScrollView::AlwaysOff ); @@ -192,7 +192,7 @@ Atlantik::Atlantik () m_serverMsgs->setFocusProxy(m_input); - connect(m_input, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotSendMsg())); + connect(m_input, TQT_SIGNAL(returnPressed()), TQT_TQOBJECT(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 @@ -253,8 +253,8 @@ void Atlantik::newPlayer(Player *player) // we'd better force an update. 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 *)), TQT_TQOBJECT(this), TQT_SLOT(playerChanged(Player *))); + connect(player, TQT_SIGNAL(gainedTurn()), TQT_TQOBJECT(this), TQT_SLOT(gainedTurn())); connect(player, TQT_SIGNAL(changed(Player *)), m_board, TQT_SLOT(playerChanged(Player *))); KNotifyClient::event(winId(), "newplayer"); @@ -315,7 +315,7 @@ void Atlantik::showSelectServer() initNetworkObject(); 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 &))); + connect(m_selectServer, TQT_SIGNAL(msgtqStatus(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotMsgtqStatus(const TQString &))); m_selectServer->slotRefresh( m_config.connectOnStart ); } @@ -356,8 +356,8 @@ void Atlantik::showSelectGame() 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 &))); + connect(m_selectGame, TQT_SIGNAL(leaveServer()), TQT_TQOBJECT(this), TQT_SLOT(showSelectServer())); + connect(m_selectGame, TQT_SIGNAL(msgtqStatus(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotMsgtqStatus(const TQString &))); } void Atlantik::showSelectConfiguration() @@ -383,7 +383,7 @@ void Atlantik::showSelectConfiguration() 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 &))); + connect(m_selectConfiguration, TQT_SIGNAL(statusMessage(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotMsgtqStatus(const TQString &))); } void Atlantik::initBoard() @@ -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()), TQString("connect_no") ); + slotMsgtqStatus( i18n("Connection with server %1:%2 lost.").tqarg(m_atlantikNetwork->host()).tqarg(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()), TQString("connect_no") ); + slotMsgtqStatus( i18n("Disconnected from %1:%2.").tqarg(m_atlantikNetwork->host()).tqarg(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, TQT_SIGNAL(okClicked()), this, TQT_SLOT(slotUpdateConfig())); + connect(m_configDialog, TQT_SIGNAL(okClicked()), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateConfig())); } void Atlantik::showEventLog() @@ -612,7 +612,7 @@ void Atlantik::slotUpdateConfig() void Atlantik::slotSendMsg() { m_atlantikNetwork->cmdChat(m_input->text()); - m_input->setText(TQString::null); + m_input->setText(TQString()); } void Atlantik::slotMsgInfo(TQString msg) @@ -625,7 +625,7 @@ void Atlantik::slotMsgError(TQString msg) serverMsgsAppend("Error: " + msg); } -void Atlantik::slotMsgStatus(const TQString &message, const TQString &icon) +void Atlantik::slotMsgtqStatus(const TQString &message, const TQString &icon) { KMainWindow::statusBar()->changeItem(message, 1); m_eventLog->addEvent(message, icon); @@ -636,7 +636,7 @@ void Atlantik::slotMsgChat(TQString player, TQString msg) if (m_config.chatTimestamps) { TQTime time = TQTime::currentTime(); - serverMsgsAppend(TQString("[%1] %2: %3").arg(time.toString("hh:mm")).arg(player).arg(msg)); + serverMsgsAppend(TQString("[%1] %2: %3").tqarg(time.toString("hh:mm")).tqarg(player).tqarg(msg)); } else serverMsgsAppend(player + ": " + msg); @@ -728,26 +728,26 @@ void Atlantik::initNetworkObject() } m_atlantikNetwork = new AtlantikNetwork(m_atlanticCore); - 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, TQT_SIGNAL(msgInfo(TQString)), TQT_TQOBJECT(this), TQT_SLOT(slotMsgInfo(TQString))); + connect(m_atlantikNetwork, TQT_SIGNAL(msgError(TQString)), TQT_TQOBJECT(this), TQT_SLOT(slotMsgError(TQString))); + connect(m_atlantikNetwork, TQT_SIGNAL(msgtqStatus(const TQString &, const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotMsgtqStatus(const TQString &, const TQString &))); + connect(m_atlantikNetwork, TQT_SIGNAL(msgChat(TQString, TQString)), TQT_TQOBJECT(this), TQT_SLOT(slotMsgChat(TQString, TQString))); - 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, TQT_SIGNAL(connectionSuccess()), TQT_TQOBJECT(this), TQT_SLOT(slotNetworkConnected())); + connect(m_atlantikNetwork, TQT_SIGNAL(connectionFailed(int)), TQT_TQOBJECT(this), TQT_SLOT(slotNetworkError(int))); + connect(m_atlantikNetwork, TQT_SIGNAL(closed(int)), TQT_TQOBJECT(this), TQT_SLOT(networkClosed(int))); - connect(m_atlantikNetwork, TQT_SIGNAL(receivedHandshake()), this, TQT_SLOT(sendHandshake())); + connect(m_atlantikNetwork, TQT_SIGNAL(receivedHandshake()), TQT_TQOBJECT(this), TQT_SLOT(sendHandshake())); - 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, TQT_SIGNAL(gameConfig()), TQT_TQOBJECT(this), TQT_SLOT(showSelectConfiguration())); + connect(m_atlantikNetwork, TQT_SIGNAL(gameInit()), TQT_TQOBJECT(this), TQT_SLOT(initBoard())); + connect(m_atlantikNetwork, TQT_SIGNAL(gameRun()), TQT_TQOBJECT(this), TQT_SLOT(showBoard())); + connect(m_atlantikNetwork, TQT_SIGNAL(gameEnd()), TQT_TQOBJECT(this), TQT_SLOT(freezeBoard())); - 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, TQT_SIGNAL(newEstate(Estate *)), TQT_TQOBJECT(this), TQT_SLOT(newEstate(Estate *))); + connect(m_atlantikNetwork, TQT_SIGNAL(newAuction(Auction *)), TQT_TQOBJECT(this), TQT_SLOT(newAuction(Auction *))); - connect(m_atlantikNetwork, TQT_SIGNAL(clientCookie(TQString)), this, TQT_SLOT(clientCookie(TQString))); + connect(m_atlantikNetwork, TQT_SIGNAL(clientCookie(TQString)), TQT_TQOBJECT(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, TQT_SIGNAL(rollDice()), m_atlantikNetwork, TQT_SLOT(rollDice())); diff --git a/atlantik/client/atlantik.h b/atlantik/client/atlantik.h index d3eac354..24b989d3 100644 --- a/atlantik/client/atlantik.h +++ b/atlantik/client/atlantik.h @@ -68,12 +68,13 @@ class Player; class Estate; class Trade; -class LogTextEdit : public QTextEdit +class LogTextEdit : public TQTextEdit { Q_OBJECT + TQ_OBJECT public: - LogTextEdit( TQWidget *parent = 0, const char *name = 0 ); + LogTextEdit( TQWidget *tqparent = 0, const char *name = 0 ); virtual ~LogTextEdit(); TQPopupMenu *createPopupMenu( const TQPoint & pos ); @@ -91,6 +92,7 @@ private: class Atlantik : public KMainWindow { Q_OBJECT + TQ_OBJECT public: /** @@ -186,7 +188,7 @@ public slots: */ void slotMsgInfo(TQString msg); - void slotMsgStatus(const TQString &message, const TQString &icon = TQString::null); + void slotMsgtqStatus(const TQString &message, const TQString &icon = TQString()); /** * Informs serverMsgs() to append an incoming message from the diff --git a/atlantik/client/configdlg.cpp b/atlantik/client/configdlg.cpp index 9e936147..b5d1ecae 100644 --- a/atlantik/client/configdlg.cpp +++ b/atlantik/client/configdlg.cpp @@ -40,9 +40,9 @@ #include "atlantik.h" #include "configdlg.moc" -ConfigDialog::ConfigDialog(Atlantik* parent, const char *name) : KDialogBase(IconList, i18n("Configure Atlantik"), Ok|Cancel, Ok, parent, "config_atlantik", false, name) +ConfigDialog::ConfigDialog(Atlantik* tqparent, const char *name) : KDialogBase(IconList, i18n("Configure Atlantik"), Ok|Cancel, Ok, tqparent, "config_atlantik", false, name) { - m_parent = parent; + m_parent = tqparent; p_general = addPage(i18n("General"), i18n("General"), BarIcon("configure", KIcon::SizeMedium)); p_p13n = addPage(i18n("Personalization"), i18n("Personalization"), BarIcon("personal", KIcon::SizeMedium)); p_board = addPage(i18n("Board"), i18n("Board"), BarIcon("monop_board", KIcon::SizeMedium)); @@ -53,7 +53,7 @@ ConfigDialog::ConfigDialog(Atlantik* parent, const char *name) : KDialogBase(Ico configBoard = new ConfigBoard(this, p_board, "configBoard"); configMonopigator = new ConfigMonopigator(this, p_monopigator, "configMonopigator"); - setMinimumSize(sizeHint()); + setMinimumSize(tqsizeHint()); } bool ConfigDialog::chatTimestamps() @@ -111,26 +111,26 @@ AtlantikConfig ConfigDialog::config() return m_parent->config(); } -ConfigPlayer::ConfigPlayer(ConfigDialog* configDialog, TQWidget *parent, const char *name) : TQWidget(parent, name) +ConfigPlayer::ConfigPlayer(ConfigDialog* configDialog, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_configDialog = configDialog; - TQVBoxLayout *layout = new TQVBoxLayout(parent, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(tqparent, KDialog::marginHint(), KDialog::spacingHint()); - TQLabel *label = new TQLabel(i18n("Player name:"), parent); - layout->addWidget(label); + TQLabel *label = new TQLabel(i18n("Player name:"), tqparent); + tqlayout->addWidget(label); - m_playerName = new TQLineEdit(parent); - layout->addWidget(m_playerName); + m_playerName = new TQLineEdit(tqparent); + tqlayout->addWidget(m_playerName); - TQLabel *label2 = new TQLabel(i18n("Player image:"), parent); - layout->addWidget(label2); + TQLabel *label2 = new TQLabel(i18n("Player image:"), tqparent); + tqlayout->addWidget(label2); - m_playerIcon = new KPushButton(parent, "playerIcon"); - layout->addWidget(m_playerIcon); + m_playerIcon = new KPushButton(tqparent, "playerIcon"); + tqlayout->addWidget(m_playerIcon); connect( m_playerIcon, TQT_SIGNAL(clicked()), this, TQT_SLOT(chooseImage()) ); - layout->addStretch(1); + tqlayout->addStretch(1); reset(); } @@ -182,21 +182,21 @@ void ConfigPlayer::reset() setImage(); } -ConfigMonopigator::ConfigMonopigator(ConfigDialog *configDialog, TQWidget *parent, const char *name) : TQWidget(parent, name) +ConfigMonopigator::ConfigMonopigator(ConfigDialog *configDialog, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_configDialog = configDialog; - TQVBoxLayout *layout = new TQVBoxLayout(parent, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(tqparent, KDialog::marginHint(), KDialog::spacingHint()); - m_connectOnStart = new TQCheckBox(i18n("Request list of Internet servers on start-up"), parent); - layout->addWidget(m_connectOnStart); + m_connectOnStart = new TQCheckBox(i18n("Request list of Internet servers on start-up"), tqparent); + tqlayout->addWidget(m_connectOnStart); TQString message=i18n( "If checked, Atlantik connects to a meta server on start-up to\n" "request a list of Internet servers.\n"); TQWhatsThis::add(m_connectOnStart, message); - m_hideDevelopmentServers = new TQCheckBox(i18n("Hide development servers"), parent); - layout->addWidget(m_hideDevelopmentServers); + m_hideDevelopmentServers = new TQCheckBox(i18n("Hide development servers"), tqparent); + tqlayout->addWidget(m_hideDevelopmentServers); message=i18n( "Some of the Internet servers might be running development\n" @@ -204,7 +204,7 @@ ConfigMonopigator::ConfigMonopigator(ConfigDialog *configDialog, TQWidget *paren "display these servers.\n"); TQWhatsThis::add(m_hideDevelopmentServers, message); - layout->addStretch(1); + tqlayout->addStretch(1); reset(); } @@ -225,20 +225,20 @@ void ConfigMonopigator::reset() m_hideDevelopmentServers->setChecked(m_configDialog->config().hideDevelopmentServers); } -ConfigGeneral::ConfigGeneral(ConfigDialog *configDialog, TQWidget *parent, const char *name) : TQWidget(parent, name) +ConfigGeneral::ConfigGeneral(ConfigDialog *configDialog, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_configDialog = configDialog; - TQVBoxLayout *layout = new TQVBoxLayout(parent, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(tqparent, KDialog::marginHint(), KDialog::spacingHint()); - m_chatTimestamps = new TQCheckBox(i18n("Show timestamps in chat messages"), parent); - layout->addWidget(m_chatTimestamps); + m_chatTimestamps = new TQCheckBox(i18n("Show timestamps in chat messages"), tqparent); + tqlayout->addWidget(m_chatTimestamps); TQString message=i18n( "If checked, Atlantik will add timestamps in front of chat\n" "messages.\n"); TQWhatsThis::add(m_chatTimestamps, message); - layout->addStretch(1); + tqlayout->addStretch(1); reset(); } @@ -253,13 +253,13 @@ void ConfigGeneral::reset() m_chatTimestamps->setChecked(m_configDialog->config().chatTimestamps); } -ConfigBoard::ConfigBoard(ConfigDialog *configDialog, TQWidget *parent, const char *name) : TQWidget(parent, name) +ConfigBoard::ConfigBoard(ConfigDialog *configDialog, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_configDialog = configDialog; - TQVBoxLayout *layout = new TQVBoxLayout(parent, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(tqparent, KDialog::marginHint(), KDialog::spacingHint()); - TQGroupBox *box = new TQGroupBox(1, Qt::Horizontal, i18n("Game Status Feedback"), parent); - layout->addWidget(box); + TQGroupBox *box = new TQGroupBox(1, Qt::Horizontal, i18n("Game tqStatus Feedback"), tqparent); + tqlayout->addWidget(box); m_indicateUnowned = new TQCheckBox(i18n("Display title deed card on unowned properties"), box); TQString message=i18n( @@ -291,10 +291,10 @@ ConfigBoard::ConfigBoard(ConfigDialog *configDialog, TQWidget *parent, const cha "will have a Quartz effect similar to the Quartz KWin style.\n"); TQWhatsThis::add(m_quartzEffects, message); -// box = new TQGroupBox(1, Qt::Horizontal, i18n("Size"), parent); -// layout->addWidget(box); +// box = new TQGroupBox(1, Qt::Horizontal, i18n("Size"), tqparent); +// tqlayout->addWidget(box); - layout->addStretch(1); + tqlayout->addStretch(1); reset(); } diff --git a/atlantik/client/configdlg.h b/atlantik/client/configdlg.h index 41843ca6..c28e3a98 100644 --- a/atlantik/client/configdlg.h +++ b/atlantik/client/configdlg.h @@ -32,12 +32,13 @@ class ConfigDialog; struct AtlantikConfig; -class ConfigPlayer : public QWidget +class ConfigPlayer : public TQWidget { Q_OBJECT + TQ_OBJECT public: - ConfigPlayer(ConfigDialog *configDialog, TQWidget *parent, const char *name=0); + ConfigPlayer(ConfigDialog *configDialog, TQWidget *tqparent, const char *name=0); TQString playerName(); TQString playerImage(); @@ -55,12 +56,13 @@ private: KPushButton *m_playerIcon; }; -class ConfigBoard : public QWidget +class ConfigBoard : public TQWidget { Q_OBJECT + TQ_OBJECT public: - ConfigBoard(ConfigDialog *configDialog, TQWidget *parent, const char *name=0); + ConfigBoard(ConfigDialog *configDialog, TQWidget *tqparent, const char *name=0); bool indicateUnowned(); bool highliteUnowned(); @@ -75,12 +77,13 @@ private: TQCheckBox *m_indicateUnowned, *m_highliteUnowned, *m_darkenMortgaged, *m_animateToken, *m_quartzEffects; }; -class ConfigMonopigator : public QWidget +class ConfigMonopigator : public TQWidget { Q_OBJECT + TQ_OBJECT public: - ConfigMonopigator(ConfigDialog *dialog, TQWidget *parent, const char *name = 0); + ConfigMonopigator(ConfigDialog *dialog, TQWidget *tqparent, const char *name = 0); bool connectOnStart(); bool hideDevelopmentServers(); @@ -92,12 +95,13 @@ private: TQCheckBox *m_connectOnStart, *m_hideDevelopmentServers; }; -class ConfigGeneral : public QWidget +class ConfigGeneral : public TQWidget { Q_OBJECT + TQ_OBJECT public: - ConfigGeneral(ConfigDialog *dialog, TQWidget *parent, const char *name = 0); + ConfigGeneral(ConfigDialog *dialog, TQWidget *tqparent, const char *name = 0); bool chatTimestamps(); @@ -111,9 +115,10 @@ private: class ConfigDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - ConfigDialog(Atlantik *parent, const char *name=0); + ConfigDialog(Atlantik *tqparent, const char *name=0); bool chatTimestamps(); bool indicateUnowned(); diff --git a/atlantik/client/event.h b/atlantik/client/event.h index dc3b6c9b..96d02c41 100644 --- a/atlantik/client/event.h +++ b/atlantik/client/event.h @@ -22,12 +22,13 @@ class TQDateTime; class TQString; -class Event : public QObject +class Event : public TQObject { Q_OBJECT + TQ_OBJECT public: - Event(const TQDateTime &dateTime, const TQString &description, const TQString &icon = TQString::null); + Event(const TQDateTime &dateTime, const TQString &description, const TQString &icon = TQString()); TQDateTime dateTime() const; TQString description() const; TQString icon() const; diff --git a/atlantik/client/eventlogwidget.cpp b/atlantik/client/eventlogwidget.cpp index 6bc81b04..2821253a 100644 --- a/atlantik/client/eventlogwidget.cpp +++ b/atlantik/client/eventlogwidget.cpp @@ -37,7 +37,7 @@ EventLog::EventLog() void EventLog::addEvent(const TQString &description, const TQString &icon) { - Event *event = new Event(TQDateTime::currentDateTime(), description, icon); + Event *event = new Event(TQDateTime::tqcurrentDateTime(), description, icon); m_events.append(event); emit newEvent(event); } @@ -47,8 +47,8 @@ TQPtrList EventLog::events() return m_events; } -EventLogWidget::EventLogWidget(EventLog *eventLog, TQWidget *parent, const char *name) - : TQWidget(parent, name, +EventLogWidget::EventLogWidget(EventLog *eventLog, TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name, WType_Dialog | WStyle_Customize | WStyle_DialogBorder | WStyle_Title | WStyle_Minimize | WStyle_ContextHelp ) { @@ -113,7 +113,7 @@ void EventLogWidget::save() { TQTextStream stream(&file); - stream << i18n( "Atlantik log file, saved at %1." ).arg( TQDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss") ) << endl; + stream << i18n( "Atlantik log file, saved at %1." ).tqarg( TQDateTime::tqcurrentDateTime().toString("yyyy-MM-dd hh:mm:ss") ) << endl; TQPtrList events = m_eventLog->events(); for (TQPtrListIterator it( events ); (*it) ; ++it) diff --git a/atlantik/client/eventlogwidget.h b/atlantik/client/eventlogwidget.h index c9e1eacd..3b2d1883 100644 --- a/atlantik/client/eventlogwidget.h +++ b/atlantik/client/eventlogwidget.h @@ -28,16 +28,17 @@ class KListView; class KListViewItem; class KPushButton; -class EventLog : public QObject +class EventLog : public TQObject { Q_OBJECT + TQ_OBJECT public: EventLog(); TQPtrList events(); public slots: - void addEvent(const TQString &description, const TQString &icon = TQString::null); + void addEvent(const TQString &description, const TQString &icon = TQString()); signals: void newEvent(Event *event); @@ -46,14 +47,15 @@ private: TQPtrList m_events; }; -class EventLogWidget : public QWidget +class EventLogWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: enum EventLogType { Default, Net_In, Net_Out }; - EventLogWidget(EventLog *eventLog, TQWidget *parent=0, const char *name = 0); + EventLogWidget(EventLog *eventLog, TQWidget *tqparent=0, const char *name = 0); public slots: void addEvent(Event *event); diff --git a/atlantik/client/monopigator.cpp b/atlantik/client/monopigator.cpp index 7e0a834d..22081de0 100644 --- a/atlantik/client/monopigator.cpp +++ b/atlantik/client/monopigator.cpp @@ -46,7 +46,7 @@ void Monopigator::loadData(const KURL &url) m_downloadData->reset(); m_job = KIO::get(url, true, false); - m_job->addMetaData(TQString::fromLatin1("UserAgent"), TQString::fromLatin1("Atlantik/" ATLANTIK_VERSION_STRING)); + m_job->addMetaData(TQString::tqfromLatin1("UserAgent"), TQString::tqfromLatin1("Atlantik/" ATLANTIK_VERSION_STRING)); if (!m_timer) { @@ -108,12 +108,12 @@ void Monopigator::processData(const TQByteArray &data, bool okSoFar) } } -MonopigatorEntry::MonopigatorEntry(TQListView *parent, TQString host, TQString latency, TQString version, TQString users, TQString port, TQString ip) : TQObject(), TQListViewItem(parent, host, latency, version, users, port) +MonopigatorEntry::MonopigatorEntry(TQListView *tqparent, TQString host, TQString latency, TQString version, TQString users, TQString port, TQString ip) : TQObject(), TQListViewItem(tqparent, host, latency, version, users, port) { - m_isDev = ( version.find( TQRegExp("(CVS|-dev)") ) != -1 ) ? true : false; + m_isDev = ( version.tqfind( TQRegExp("(CVS|-dev)") ) != -1 ) ? true : false; setEnabled(false); - parent->sort(); + tqparent->sort(); if ( !ip.isEmpty() ) host = ip; diff --git a/atlantik/client/monopigator.h b/atlantik/client/monopigator.h index dd88b0ae..c785b980 100644 --- a/atlantik/client/monopigator.h +++ b/atlantik/client/monopigator.h @@ -28,9 +28,10 @@ class KExtendedSocket; class TQTime; -class Monopigator : public QObject +class Monopigator : public TQObject { Q_OBJECT + TQ_OBJECT public: Monopigator(); @@ -55,12 +56,13 @@ private: KIO::Job *m_job; }; -class MonopigatorEntry : public TQObject, public QListViewItem +class MonopigatorEntry : public TQObject, public TQListViewItem { Q_OBJECT + TQ_OBJECT public: - MonopigatorEntry(TQListView *parent, TQString host, TQString latency, TQString version, TQString users, TQString port, TQString ip); + MonopigatorEntry(TQListView *tqparent, TQString host, TQString latency, TQString version, TQString users, TQString port, TQString ip); int compare(TQListViewItem *i, int col, bool ascending) const; bool isDev() const; diff --git a/atlantik/client/selectconfiguration_widget.cpp b/atlantik/client/selectconfiguration_widget.cpp index b40bdd4f..1cb7a142 100644 --- a/atlantik/client/selectconfiguration_widget.cpp +++ b/atlantik/client/selectconfiguration_widget.cpp @@ -33,7 +33,7 @@ #include "selectconfiguration_widget.moc" -SelectConfiguration::SelectConfiguration(AtlanticCore *atlanticCore, TQWidget *parent, const char *name) : TQWidget(parent, name) +SelectConfiguration::SelectConfiguration(AtlanticCore *atlanticCore, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_atlanticCore = atlanticCore; m_game = 0; @@ -51,7 +51,7 @@ SelectConfiguration::SelectConfiguration(AtlanticCore *atlanticCore, TQWidget *p playerButtons->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum)); - // Vertical spacer. + //Qt::Vertical spacer. m_mainLayout->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding)); // Server buttons. @@ -127,11 +127,11 @@ void SelectConfiguration::gameOption(TQString title, TQString type, TQString val void SelectConfiguration::changeOption() { - ConfigOption *configOption = m_configMap[(TQObject *)TQObject::sender()]; + ConfigOption *configOption = m_configMap[(TQObject *)TQT_BASE_OBJECT_NAME::sender()]; if (configOption) { - kdDebug() << "checked " << ((TQCheckBox *)TQObject::sender())->isChecked() << endl; - emit changeOption( configOption->id(), TQString::number( ((TQCheckBox *)TQObject::sender())->isChecked() ) ); + kdDebug() << "checked " << ((TQCheckBox *)TQT_BASE_OBJECT_NAME::sender())->isChecked() << endl; + emit changeOption( configOption->id(), TQString::number( ((TQCheckBox *)TQT_BASE_OBJECT_NAME::sender())->isChecked() ) ); } } @@ -148,7 +148,7 @@ void SelectConfiguration::optionChanged(ConfigOption *configOption) void SelectConfiguration::optionChanged() { - TQString command = m_optionCommandMap[(TQObject *)TQObject::sender()]; + TQString command = m_optionCommandMap[(TQObject *)TQT_BASE_OBJECT_NAME::sender()]; if (TQCheckBox *checkBox = m_checkBoxMap[command]) { diff --git a/atlantik/client/selectconfiguration_widget.h b/atlantik/client/selectconfiguration_widget.h index a0cfcd24..0ad747d0 100644 --- a/atlantik/client/selectconfiguration_widget.h +++ b/atlantik/client/selectconfiguration_widget.h @@ -32,12 +32,13 @@ class ConfigOption; class Game; class Player; -class SelectConfiguration : public QWidget +class SelectConfiguration : public TQWidget { Q_OBJECT + TQ_OBJECT public: - SelectConfiguration(AtlanticCore *atlanticCore, TQWidget *parent, const char *name=0); + SelectConfiguration(AtlanticCore *atlanticCore, TQWidget *tqparent, const char *name=0); void setCanStart(const bool &canStart); TQString hostToConnect() const; diff --git a/atlantik/client/selectgame_widget.cpp b/atlantik/client/selectgame_widget.cpp index 8f39ff08..e634b3c2 100644 --- a/atlantik/client/selectgame_widget.cpp +++ b/atlantik/client/selectgame_widget.cpp @@ -29,7 +29,7 @@ #include "selectgame_widget.h" -SelectGame::SelectGame(AtlanticCore *atlanticCore, TQWidget *parent, const char *name) : TQWidget(parent, name) +SelectGame::SelectGame(AtlanticCore *atlanticCore, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_atlanticCore = atlanticCore; @@ -80,13 +80,13 @@ void SelectGame::addGame(Game *game) if (game->id() == -1) { - TQListViewItem *item = new TQListViewItem( m_gameList, i18n("Create a new %1 Game").arg(game->name()), game->description(), TQString::null, TQString::null, game->type() ); + TQListViewItem *item = new TQListViewItem( m_gameList, i18n("Create a new %1 Game").tqarg(game->name()), game->description(), TQString(), TQString(), game->type() ); item->setPixmap(0, TQPixmap(SmallIcon("filenew"))); } else { Player *master = game->master(); - 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() ); + TQListViewItem *item = new TQListViewItem( m_gameList, i18n("Join %1's %2 Game").tqarg( (master ? master->name() : TQString()), game->name() ), game->description(), TQString::number(game->id()), TQString::number(game->players()), game->type() ); item->setPixmap( 0, TQPixmap(SmallIcon("atlantik")) ); item->setEnabled(game->canBeJoined()); @@ -118,11 +118,11 @@ void SelectGame::updateGame(Game *game) item->setText( 1, game->description() ); if (game->id() == -1) - item->setText(0, i18n("Create a new %1 Game").arg(game->name())); + item->setText(0, i18n("Create a new %1 Game").tqarg(game->name())); else { Player *master = game->master(); - item->setText( 0, i18n("Join %1's %2 Game").arg( (master ? master->name() : TQString::null), game->name() ) ); + item->setText( 0, i18n("Join %1's %2 Game").tqarg( (master ? master->name() : TQString()), game->name() ) ); item->setText( 3, TQString::number( game->players() ) ); item->setEnabled( game->canBeJoined() ); @@ -143,7 +143,7 @@ void SelectGame::playerChanged(Player *player) game = m_atlanticCore->findGame( item->text(2).toInt() ); if ( game && game->master() == player ) { - item->setText( 0, i18n("Join %1's %2 Game").arg( player->name(), game->name() ) ); + item->setText( 0, i18n("Join %1's %2 Game").tqarg( player->name(), game->name() ) ); return; } item = item->nextSibling(); diff --git a/atlantik/client/selectgame_widget.h b/atlantik/client/selectgame_widget.h index f6d28f43..42ec3350 100644 --- a/atlantik/client/selectgame_widget.h +++ b/atlantik/client/selectgame_widget.h @@ -27,12 +27,13 @@ class AtlanticCore; class Game; class Player; -class SelectGame : public QWidget +class SelectGame : public TQWidget { Q_OBJECT + TQ_OBJECT public: - SelectGame(AtlanticCore *atlanticCore, TQWidget *parent, const char *name=0); + SelectGame(AtlanticCore *atlanticCore, TQWidget *tqparent, const char *name=0); void initPage(); bool validateNext(); @@ -51,7 +52,7 @@ signals: void joinGame(int gameId); void newGame(const TQString &gameType); void leaveServer(); - void msgStatus(const TQString &status); + void msgtqStatus(const TQString &status); private: TQListViewItem *findItem(Game *game); diff --git a/atlantik/client/selectserver_widget.cpp b/atlantik/client/selectserver_widget.cpp index 97a594c4..2404ebd1 100644 --- a/atlantik/client/selectserver_widget.cpp +++ b/atlantik/client/selectserver_widget.cpp @@ -28,7 +28,7 @@ #include "selectserver_widget.moc" -SelectServer::SelectServer(bool useMonopigatorOnStart, bool hideDevelopmentServers, TQWidget *parent, const char *name) : TQWidget(parent, name) +SelectServer::SelectServer(bool useMonopigatorOnStart, bool hideDevelopmentServers, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_hideDevelopmentServers = hideDevelopmentServers; @@ -42,12 +42,12 @@ SelectServer::SelectServer(bool useMonopigatorOnStart, bool hideDevelopmentServe TQLabel *hostLabel = new TQLabel(i18n("Hostname:"), customGroup); m_hostEdit = new KLineEdit(customGroup); - m_hostEdit->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum)); + m_hostEdit->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum)); TQLabel *portLabel = new TQLabel(i18n("Port:"), customGroup); m_portEdit = new KLineEdit(TQString::number(1234), customGroup); - m_portEdit->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Minimum)); + m_portEdit->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Minimum)); KPushButton *connectButton = new KPushButton( KGuiItem(i18n("Connect"), "network"), customGroup); connect(connectButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(customConnect())); @@ -113,7 +113,7 @@ void SelectServer::setHideDevelopmentServers(bool hideDevelopmentServers) void SelectServer::initMonopigator() { // Hardcoded, but there aren't any other Monopigator root servers at the moment - emit msgStatus(i18n("Retrieving server list...")); + emit msgtqStatus(i18n("Retrieving server list...")); m_refreshButton->setGuiItem(KGuiItem(i18n("Reload Server List"), "reload")); m_monopigator->loadData(KURL( "http://monopd-gator.kde.org/")); @@ -135,13 +135,13 @@ void SelectServer::slotMonopigatorAdd(TQString ip, TQString host, TQString port, void SelectServer::monopigatorFinished() { - emit msgStatus(i18n("Retrieved server list.")); + emit msgtqStatus(i18n("Retrieved server list.")); m_refreshButton->setEnabled(true); } void SelectServer::monopigatorTimeout() { - emit msgStatus(i18n("Error while retrieving the server list.")); + emit msgtqStatus(i18n("Error while retrieving the server list.")); m_refreshButton->setEnabled(true); } diff --git a/atlantik/client/selectserver_widget.h b/atlantik/client/selectserver_widget.h index 471bc8d2..7e4ba45d 100644 --- a/atlantik/client/selectserver_widget.h +++ b/atlantik/client/selectserver_widget.h @@ -29,12 +29,13 @@ class KExtendedSocket; -class SelectServer : public QWidget +class SelectServer : public TQWidget { Q_OBJECT + TQ_OBJECT public: - SelectServer(bool useMonopigatorOnStart, bool hideDevelopmentServers, TQWidget *parent, const char *name=0); + SelectServer(bool useMonopigatorOnStart, bool hideDevelopmentServers, TQWidget *tqparent, const char *name=0); virtual ~SelectServer(); void initPage(); @@ -56,7 +57,7 @@ private slots: signals: void serverConnect(const TQString host, int port); - void msgStatus(const TQString &message); + void msgtqStatus(const TQString &message); void showDevelopmentServers(bool show); private: diff --git a/atlantik/kio_atlantik/kio_atlantik.cpp b/atlantik/kio_atlantik/kio_atlantik.cpp index de74a1e0..fcf425e1 100644 --- a/atlantik/kio_atlantik/kio_atlantik.cpp +++ b/atlantik/kio_atlantik/kio_atlantik.cpp @@ -55,7 +55,7 @@ void AtlantikProtocol::get( const KURL& url ) #endif TQString port = TQString::number( url.port() ? url.port() : 1234 ); int game = url.queryItem("game").toInt(); - TQString gameString = game ? TQString::number( game ) : TQString::null; + TQString gameString = game ? TQString::number( game ) : TQString(); if (!host.isNull() && !port.isNull()) { diff --git a/atlantik/libatlantic/atlantic_core.cpp b/atlantik/libatlantic/atlantic_core.cpp index 9139e6ed..c73b6e0f 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(TQObject *parent, const char *name) : TQObject(parent, name) +AtlanticCore::AtlanticCore(TQObject *tqparent, const char *name) : TQObject(tqparent, name) { m_playerSelf = 0; } diff --git a/atlantik/libatlantic/atlantic_core.h b/atlantik/libatlantic/atlantic_core.h index 197fca91..2ea9f25c 100644 --- a/atlantik/libatlantic/atlantic_core.h +++ b/atlantik/libatlantic/atlantic_core.h @@ -30,12 +30,13 @@ class Game; class Trade; class Auction; -class LIBATLANTIC_EXPORT AtlanticCore : public QObject +class LIBATLANTIC_EXPORT AtlanticCore : public TQObject { Q_OBJECT + TQ_OBJECT public: - AtlanticCore(TQObject *parent, const char *name); + AtlanticCore(TQObject *tqparent, const char *name); void reset(bool deletePermanents = false); @@ -50,7 +51,7 @@ public: void removePlayer(Player *player); TQPtrList games(); - Game *newGame(int gameId, const TQString &type = TQString::null); + Game *newGame(int gameId, const TQString &type = TQString()); Game *findGame(const TQString &type); // finds game types Game *findGame(int gameId); // finds actual games Game *gameSelf(); diff --git a/atlantik/libatlantic/auction.cpp b/atlantik/libatlantic/auction.cpp index 2e09a685..ebc6c40e 100644 --- a/atlantik/libatlantic/auction.cpp +++ b/atlantik/libatlantic/auction.cpp @@ -32,7 +32,7 @@ Auction::~Auction() emit completed(); } -void Auction::setStatus(int status) +void Auction::settqStatus(int status) { if (m_status != status) { diff --git a/atlantik/libatlantic/auction.h b/atlantik/libatlantic/auction.h index 80633bc8..c482416e 100644 --- a/atlantik/libatlantic/auction.h +++ b/atlantik/libatlantic/auction.h @@ -24,9 +24,10 @@ class Player; class Estate; -class LIBATLANTIC_EXPORT Auction : public QObject +class LIBATLANTIC_EXPORT Auction : public TQObject { Q_OBJECT + TQ_OBJECT public: Auction(int auctionId, Estate *estate); @@ -35,7 +36,7 @@ public: int auctionId() { return m_auctionId; } Estate *estate() { return m_estate; } - void setStatus(int status); + void settqStatus(int status); int status() { return m_status; } void newBid(Player *player, int bid); diff --git a/atlantik/libatlantic/configoption.h b/atlantik/libatlantic/configoption.h index 823938c8..b988e22f 100644 --- a/atlantik/libatlantic/configoption.h +++ b/atlantik/libatlantic/configoption.h @@ -22,9 +22,10 @@ #include "libatlantic_export.h" -class LIBATLANTIC_EXPORT ConfigOption : public QObject +class LIBATLANTIC_EXPORT ConfigOption : public TQObject { Q_OBJECT + TQ_OBJECT public: ConfigOption(int configId); diff --git a/atlantik/libatlantic/estate.cpp b/atlantik/libatlantic/estate.cpp index c9b40e73..ec86c6ff 100644 --- a/atlantik/libatlantic/estate.cpp +++ b/atlantik/libatlantic/estate.cpp @@ -23,7 +23,7 @@ Estate::Estate(int estateId) : TQObject() { m_id = estateId; - m_name = TQString::null; + m_name = TQString(); m_owner = 0; m_houses = 0; m_price = 0; diff --git a/atlantik/libatlantic/estate.h b/atlantik/libatlantic/estate.h index cbbd51e1..dc92fd5f 100644 --- a/atlantik/libatlantic/estate.h +++ b/atlantik/libatlantic/estate.h @@ -25,9 +25,10 @@ class EstateGroup; class Player; -class LIBATLANTIC_EXPORT Estate : public QObject +class LIBATLANTIC_EXPORT Estate : public TQObject { Q_OBJECT + TQ_OBJECT public: Estate(int estateId); diff --git a/atlantik/libatlantic/estategroup.h b/atlantik/libatlantic/estategroup.h index 9e0399bc..48c81a8b 100644 --- a/atlantik/libatlantic/estategroup.h +++ b/atlantik/libatlantic/estategroup.h @@ -21,9 +21,10 @@ #include "libatlantic_export.h" -class LIBATLANTIC_EXPORT EstateGroup : public QObject +class LIBATLANTIC_EXPORT EstateGroup : public TQObject { Q_OBJECT + TQ_OBJECT public: EstateGroup(const int id); diff --git a/atlantik/libatlantic/game.cpp b/atlantik/libatlantic/game.cpp index 308a827d..8a310e16 100644 --- a/atlantik/libatlantic/game.cpp +++ b/atlantik/libatlantic/game.cpp @@ -21,8 +21,8 @@ Game::Game(int gameId) : TQObject() { m_id = gameId; - m_description = TQString::null; - m_type = TQString::null; + m_description = TQString(); + m_type = TQString(); m_players = 0; m_master = 0; diff --git a/atlantik/libatlantic/game.h b/atlantik/libatlantic/game.h index c2e8138f..34a40b73 100644 --- a/atlantik/libatlantic/game.h +++ b/atlantik/libatlantic/game.h @@ -25,9 +25,10 @@ class TQString; class Player; -class LIBATLANTIC_EXPORT Game : public QObject +class LIBATLANTIC_EXPORT Game : public TQObject { Q_OBJECT + TQ_OBJECT public: Game(int gameId); diff --git a/atlantik/libatlantic/player.h b/atlantik/libatlantic/player.h index f36b1e8a..98f67f89 100644 --- a/atlantik/libatlantic/player.h +++ b/atlantik/libatlantic/player.h @@ -25,9 +25,10 @@ class Estate; class Game; -class LIBATLANTIC_EXPORT Player : public QObject +class LIBATLANTIC_EXPORT Player : public TQObject { Q_OBJECT + TQ_OBJECT public: Player(int playerId); diff --git a/atlantik/libatlantic/trade.cpp b/atlantik/libatlantic/trade.cpp index 7bd638c9..7bd3aee1 100644 --- a/atlantik/libatlantic/trade.cpp +++ b/atlantik/libatlantic/trade.cpp @@ -196,5 +196,5 @@ void TradeMoney::setMoney(unsigned int money) TQString TradeMoney::text() const { - return TQString("$%1").arg(m_money); + return TQString("$%1").tqarg(m_money); } diff --git a/atlantik/libatlantic/trade.h b/atlantik/libatlantic/trade.h index 0d168f0a..5ee399d1 100644 --- a/atlantik/libatlantic/trade.h +++ b/atlantik/libatlantic/trade.h @@ -28,9 +28,10 @@ class Player; class Trade; class Estate; -class LIBATLANTIC_EXPORT TradeItem : public QObject +class LIBATLANTIC_EXPORT TradeItem : public TQObject { Q_OBJECT + TQ_OBJECT public: TradeItem(Trade *trade, Player *from, Player *to); @@ -60,6 +61,7 @@ private: class LIBATLANTIC_EXPORT TradeEstate : public TradeItem { Q_OBJECT + TQ_OBJECT public: TradeEstate(Estate *estate, Trade *trade, Player *to); @@ -79,6 +81,7 @@ private: class LIBATLANTIC_EXPORT TradeMoney : public TradeItem { Q_OBJECT + TQ_OBJECT public: TradeMoney(unsigned int money, Trade *trade, Player *from, Player *to); @@ -96,9 +99,10 @@ private: }; -class LIBATLANTIC_EXPORT Trade : public QObject +class LIBATLANTIC_EXPORT Trade : public TQObject { Q_OBJECT + TQ_OBJECT public: Trade(int tradeId); diff --git a/atlantik/libatlantikclient/atlantik_network.cpp b/atlantik/libatlantikclient/atlantik_network.cpp index 51347f84..7b980ef8 100644 --- a/atlantik/libatlantikclient/atlantik_network.cpp +++ b/atlantik/libatlantikclient/atlantik_network.cpp @@ -95,37 +95,37 @@ void AtlantikNetwork::endTurn() void AtlantikNetwork::setName(TQString name) { // Almost deprecated, will be replaced by libmonopdprotocol - writeData(TQString(".n%1").arg(name)); + writeData(TQString(".n%1").tqarg(name)); } void AtlantikNetwork::tokenConfirmation(Estate *estate) { - writeData(TQString(".t%1").arg(estate ? estate->id() : -1)); + writeData(TQString(".t%1").tqarg(estate ? estate->id() : -1)); } void AtlantikNetwork::estateToggleMortgage(Estate *estate) { - writeData(TQString(".em%1").arg(estate ? estate->id() : -1)); + writeData(TQString(".em%1").tqarg(estate ? estate->id() : -1)); } void AtlantikNetwork::estateHouseBuy(Estate *estate) { - writeData(TQString(".hb%1").arg(estate ? estate->id() : -1)); + writeData(TQString(".hb%1").tqarg(estate ? estate->id() : -1)); } void AtlantikNetwork::estateHouseSell(Estate *estate) { - writeData(TQString(".hs%1").arg(estate ? estate->id() : -1)); + writeData(TQString(".hs%1").tqarg(estate ? estate->id() : -1)); } void AtlantikNetwork::newGame(const TQString &gameType) { - writeData(TQString(".gn%1").arg(gameType)); + writeData(TQString(".gn%1").tqarg(gameType)); } void AtlantikNetwork::joinGame(int gameId) { - writeData(TQString(".gj%1").arg(gameId)); + writeData(TQString(".gj%1").tqarg(gameId)); } void AtlantikNetwork::cmdChat(TQString msg) @@ -135,42 +135,42 @@ void AtlantikNetwork::cmdChat(TQString msg) void AtlantikNetwork::newTrade(Player *player) { - writeData(TQString(".Tn%1").arg(player ? player->id() : -1)); + writeData(TQString(".Tn%1").tqarg(player ? player->id() : -1)); } void AtlantikNetwork::kickPlayer(Player *player) { - writeData(TQString(".gk%1").arg(player ? player->id() : -1)); + writeData(TQString(".gk%1").tqarg(player ? player->id() : -1)); } void AtlantikNetwork::tradeUpdateEstate(Trade *trade, Estate *estate, Player *player) { - writeData(TQString(".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").tqarg(trade ? trade->tradeId() : -1).tqarg(estate ? estate->id() : -1).tqarg(player ? player->id() : -1)); } void AtlantikNetwork::tradeUpdateMoney(Trade *trade, unsigned int money, Player *pFrom, Player *pTo) { - writeData(TQString(".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").tqarg(trade ? trade->tradeId() : -1).tqarg(pFrom ? pFrom->id() : -1).tqarg(pTo ? pTo->id() : -1).tqarg(money)); } void AtlantikNetwork::tradeReject(Trade *trade) { - writeData(TQString(".Tr%1").arg(trade ? trade->tradeId() : -1)); + writeData(TQString(".Tr%1").tqarg(trade ? trade->tradeId() : -1)); } void AtlantikNetwork::tradeAccept(Trade *trade) { - writeData(TQString(".Ta%1:%2").arg(trade ? trade->tradeId() : -1).arg(trade ? trade->revision() : -1)); + writeData(TQString(".Ta%1:%2").tqarg(trade ? trade->tradeId() : -1).tqarg(trade ? trade->revision() : -1)); } void AtlantikNetwork::auctionBid(Auction *auction, int amount) { - writeData(TQString(".ab%1:%2").arg(auction ? auction->auctionId() : -1).arg(amount)); + writeData(TQString(".ab%1:%2").tqarg(auction ? auction->auctionId() : -1).tqarg(amount)); } void AtlantikNetwork::setImage(const TQString &name) { - writeData(TQString(".pi%1").arg(name)); + writeData(TQString(".pi%1").tqarg(name)); } void AtlantikNetwork::jailPay() @@ -190,7 +190,7 @@ void AtlantikNetwork::jailCard() void AtlantikNetwork::changeOption(int configId, const TQString &value) { - writeData( TQString(".gc%1:%2").arg(configId).arg(value) ); + writeData( TQString(".gc%1:%2").tqarg(configId).tqarg(value) ); } void AtlantikNetwork::writeData(TQString msg) @@ -607,7 +607,7 @@ void AtlantikNetwork::processNode(TQDomNode n) Estate *estate = 0; bool b_newEstate = false; - // FIXME: allow any estateId, GUI should not use it to determin its geometry + // FIXME: allow any estateId, GUI should not use it to determin its tqgeometry if (estateId >= 0 && estateId < 100 && !(estate = m_atlanticCore->findEstate(a.value().toInt()))) { // Create estate object @@ -872,7 +872,7 @@ void AtlantikNetwork::processNode(TQDomNode n) if (auction && !a.isNull()) { int status = a.value().toInt(); - auction->setStatus(status); + auction->settqStatus(status); // TODO: find a good way to visualise "sold!" if (status == 3) @@ -906,23 +906,23 @@ void AtlantikNetwork::serverConnect(const TQString host, int port) { setAddress(host, port); enableRead(true); - emit msgStatus(i18n("Connecting to %1:%2...").arg(host).arg(TQString::number(port)), "connect_creating"); + emit msgtqStatus(i18n("Connecting to %1:%2...").tqarg(host).tqarg(TQString::number(port)), "connect_creating"); startAsyncConnect(); } void AtlantikNetwork::slotLookupFinished(int count) { - emit msgStatus(i18n("Server host name lookup finished...")); + emit msgtqStatus(i18n("Server host name lookup finished...")); } void AtlantikNetwork::slotConnectionSuccess() { - emit msgStatus(i18n("Connected to %1:%2.").arg(host()).arg(port()), "connect_established"); + emit msgtqStatus(i18n("Connected to %1:%2.").tqarg(host()).tqarg(port()), "connect_established"); } void AtlantikNetwork::slotConnectionFailed(int error) { - emit msgStatus(i18n("Connection failed! Error code: %1").arg(error), "connect_no"); + emit msgtqStatus(i18n("Connection failed! Error code: %1").tqarg(error), "connect_no"); } #include "atlantik_network.moc" diff --git a/atlantik/libatlantikclient/atlantik_network.h b/atlantik/libatlantikclient/atlantik_network.h index 44099121..3164bf18 100644 --- a/atlantik/libatlantikclient/atlantik_network.h +++ b/atlantik/libatlantikclient/atlantik_network.h @@ -35,6 +35,7 @@ class Auction; class LIBATLANTIC_EXPORT AtlantikNetwork : public KExtendedSocket { Q_OBJECT + TQ_OBJECT public: AtlantikNetwork(AtlanticCore *atlanticCore); @@ -101,7 +102,7 @@ signals: void msgInfo(TQString); void msgError(TQString); void msgChat(TQString, TQString); - void msgStatus(const TQString &data, const TQString &icon = TQString::null); + void msgtqStatus(const TQString &data, const TQString &icon = TQString()); void networkEvent(const TQString &data, const TQString &icon); void displayDetails(TQString text, bool clearText, bool clearButtons, Estate *estate = 0); diff --git a/atlantik/libatlantikclient/monopdprotocol.cpp b/atlantik/libatlantikclient/monopdprotocol.cpp index f024f163..39f8fb81 100644 --- a/atlantik/libatlantikclient/monopdprotocol.cpp +++ b/atlantik/libatlantikclient/monopdprotocol.cpp @@ -36,12 +36,12 @@ MonopdProtocol::MonopdProtocol() : TQObject() void MonopdProtocol::auctionEstate() { - sendData(TQString::fromLatin1(".ea")); + sendData(TQString::tqfromLatin1(".ea")); } void MonopdProtocol::buyEstate() { - sendData(TQString::fromLatin1(".eb")); + sendData(TQString::tqfromLatin1(".eb")); } void MonopdProtocol::confirmTokenLocation(Estate *estate) @@ -53,12 +53,12 @@ void MonopdProtocol::confirmTokenLocation(Estate *estate) void MonopdProtocol::endTurn() { - sendData(TQString::fromLatin1(".E")); + sendData(TQString::tqfromLatin1(".E")); } void MonopdProtocol::rollDice() { - sendData(TQString::fromLatin1(".r")); + sendData(TQString::tqfromLatin1(".r")); } void MonopdProtocol::setName(TQString name) @@ -70,7 +70,7 @@ void MonopdProtocol::setName(TQString name) void MonopdProtocol::startGame() { - sendData(TQString::fromLatin1(".gs")); + sendData(TQString::tqfromLatin1(".gs")); } void MonopdProtocol::sendData(TQString) diff --git a/atlantik/libatlantikclient/monopdprotocol.h b/atlantik/libatlantikclient/monopdprotocol.h index b2162715..f5569d43 100644 --- a/atlantik/libatlantikclient/monopdprotocol.h +++ b/atlantik/libatlantikclient/monopdprotocol.h @@ -35,9 +35,10 @@ class Auction; class Estate; -class MonopdProtocol : public QObject +class MonopdProtocol : public TQObject { Q_OBJECT + TQ_OBJECT public: MonopdProtocol(); diff --git a/atlantik/libatlantikui/auction_widget.cpp b/atlantik/libatlantikui/auction_widget.cpp index 219c8b2b..2bb582fe 100644 --- a/atlantik/libatlantikui/auction_widget.cpp +++ b/atlantik/libatlantikui/auction_widget.cpp @@ -33,7 +33,7 @@ #include "auction_widget.moc" -AuctionWidget::AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, TQWidget *parent, const char *name) : TQWidget(parent, name) +AuctionWidget::AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_atlanticCore = atlanticCore; @@ -47,7 +47,7 @@ AuctionWidget::AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, TQWid // Player list Estate *estate = auction->estate(); - m_playerGroupBox = new TQVGroupBox(estate ? i18n("Auction: %1").arg(estate->name()) : i18n("Auction"), this, "groupBox"); + m_playerGroupBox = new TQVGroupBox(estate ? i18n("Auction: %1").tqarg(estate->name()) : i18n("Auction"), this, "groupBox"); m_mainLayout->addWidget(m_playerGroupBox); m_playerList = new KListView(m_playerGroupBox); @@ -80,7 +80,7 @@ AuctionWidget::AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, TQWid KPushButton *bidButton = new KPushButton(i18n("Make Bid"), bidBox, "bidButton"); connect(bidButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBidButtonClicked())); - // Status label + // tqStatus label m_statusLabel = new TQLabel(this, "statusLabel"); m_mainLayout->addWidget(m_statusLabel); } @@ -103,7 +103,7 @@ void AuctionWidget::auctionChanged() break; default: - status = TQString::null; + status = TQString(); } m_statusLabel->setText(status); } diff --git a/atlantik/libatlantikui/auction_widget.h b/atlantik/libatlantikui/auction_widget.h index 92e20c5c..5a21c95b 100644 --- a/atlantik/libatlantikui/auction_widget.h +++ b/atlantik/libatlantikui/auction_widget.h @@ -33,12 +33,13 @@ class AtlanticCore; class Player; class Auction; -class AuctionWidget : public QWidget +class AuctionWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, TQWidget *parent, const char *name=0); + AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, TQWidget *tqparent, const char *name=0); private slots: void auctionChanged(); diff --git a/atlantik/libatlantikui/board.cpp b/atlantik/libatlantikui/board.cpp index 1b9ae0b5..6b48b40d 100644 --- a/atlantik/libatlantikui/board.cpp +++ b/atlantik/libatlantikui/board.cpp @@ -35,7 +35,7 @@ #include "board.h" #include "board.moc" -AtlantikBoard::AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, DisplayMode mode, TQWidget *parent, const char *name) : TQWidget(parent, name) +AtlantikBoard::AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, DisplayMode mode, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_atlanticCore = atlanticCore; m_maxEstates = maxEstates; @@ -351,13 +351,13 @@ TQPoint AtlantikBoard::calculateTokenDestination(Token *token, Estate *eDest) int x = 0, y = 0; if (token->player()->inJail()) { - x = evDest->geometry().right() - token->width() - 2; - y = evDest->geometry().top(); + x = evDest->tqgeometry().right() - token->width() - 2; + y = evDest->tqgeometry().top(); } else { - x = evDest->geometry().center().x() - (token->width()/2); - y = evDest->geometry().center().y() - (token->height()/2); + x = evDest->tqgeometry().center().x() - (token->width()/2); + y = evDest->tqgeometry().center().y() - (token->height()/2); /* // Re-center because of EstateView headers @@ -394,8 +394,8 @@ void AtlantikBoard::slotMoveToken() } // Where are we? - int xCurrent = m_movingToken->geometry().x(); - int yCurrent = m_movingToken->geometry().y(); + int xCurrent = m_movingToken->tqgeometry().x(); + int yCurrent = m_movingToken->tqgeometry().y(); // Where do we want to go today? Estate *eDest = m_atlanticCore->estateAfter(m_movingToken->location()); @@ -560,7 +560,7 @@ void AtlantikBoard::prependEstateDetails(Estate *estate) if (m_displayQueue.getFirst() == m_lastServerDisplay) { - eDetails = new EstateDetails(estate, TQString::null, this); + eDetails = new EstateDetails(estate, TQString(), this); m_displayQueue.prepend(eDetails); connect(eDetails, TQT_SIGNAL(buttonCommand(TQString)), this, TQT_SIGNAL(buttonCommand(TQString))); @@ -572,7 +572,7 @@ void AtlantikBoard::prependEstateDetails(Estate *estate) if (eDetails) { eDetails->setEstate(estate); - eDetails->setText( TQString::null ); + eDetails->setText( TQString() ); // eDetails->clearButtons(); } else diff --git a/atlantik/libatlantikui/board.h b/atlantik/libatlantikui/board.h index 11194336..6240568d 100644 --- a/atlantik/libatlantikui/board.h +++ b/atlantik/libatlantikui/board.h @@ -32,14 +32,15 @@ class Token; class EstateView; -class LIBATLANTIKUI_EXPORT AtlantikBoard : public QWidget +class LIBATLANTIKUI_EXPORT AtlantikBoard : public TQWidget { Q_OBJECT + TQ_OBJECT public: enum DisplayMode { Play, Edit }; - AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, DisplayMode mode, TQWidget *parent, const char *name=0); + AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, DisplayMode mode, TQWidget *tqparent, const char *name=0); ~AtlantikBoard(); void reset(); diff --git a/atlantik/libatlantikui/estatedetails.cpp b/atlantik/libatlantikui/estatedetails.cpp index 3a71f25a..d2690a91 100644 --- a/atlantik/libatlantikui/estatedetails.cpp +++ b/atlantik/libatlantikui/estatedetails.cpp @@ -39,7 +39,7 @@ #include "estatedetails.h" #include "kwrappedlistviewitem.h" -EstateDetails::EstateDetails(Estate *estate, TQString text, TQWidget *parent, const char *name) : TQWidget(parent, name) +EstateDetails::EstateDetails(Estate *estate, TQString text, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_pixmap = 0; m_quartzBlocks = 0; @@ -114,11 +114,11 @@ void EstateDetails::paintEvent(TQPaintEvent *) TQColor greenHouse(0, 255, 0); TQColor redHotel(255, 51, 51); TQPainter painter; - painter.begin(m_pixmap, this); + painter.tqbegin(TQT_TQPAINTDEVICE(m_pixmap), this); - painter.setPen(Qt::black); + painter.setPen(TQt::black); - painter.setBrush(m_estate ? m_estate->bgColor() : Qt::white); + painter.setBrush(m_estate ? m_estate->bgColor() : TQt::white); painter.drawRect(rect()); /* @@ -136,7 +136,7 @@ void EstateDetails::paintEvent(TQPaintEvent *) quartzBuffer->resize(25, (height()/4)-2); TQPainter quartzPainter; - quartzPainter.begin(quartzBuffer, this); + quartzPainter.tqbegin(TQT_TQPAINTDEVICE(quartzBuffer), this); painter.setBrush(titleColor); painter.drawRect(0, 0, width(), titleHeight); @@ -173,15 +173,15 @@ void EstateDetails::paintEvent(TQPaintEvent *) // TODO: steal blur code from kicker/taskbar/taskcontainer.cpp // Estate name - painter.setPen(Qt::white); + painter.setPen(TQt::white); int fontSize = KGlobalSettings::generalFont().pointSize(); if (fontSize == -1) fontSize = KGlobalSettings::generalFont().pixelSize(); 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.drawText(KDialog::marginHint(), KDialog::marginHint(), width()-KDialog::marginHint(), titleHeight, TQt::AlignJustify, m_estate->name()); - painter.setPen(Qt::black); + painter.setPen(TQt::black); int xText = 0; @@ -190,7 +190,7 @@ void EstateDetails::paintEvent(TQPaintEvent *) { xText = titleHeight - fontSize - KDialog::marginHint(); painter.setFont(TQFont(KGlobalSettings::generalFont().family(), fontSize, TQFont::Bold)); - painter.drawText(5, xText, width()-10, titleHeight, Qt::AlignRight, m_estate->estateGroup()->name().upper()); + painter.drawText(5, xText, width()-10, titleHeight, TQt::AlignRight, m_estate->estateGroup()->name().upper()); } xText = titleHeight + fontSize + 5; @@ -217,22 +217,22 @@ void EstateDetails::addDetails() // Price if (m_estate->price()) { - infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Price: %1").arg(m_estate->price())); + infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Price: %1").tqarg(m_estate->price())); infoText->setPixmap(0, TQPixmap(SmallIcon("info"))); } // Owner, houses, isMortgaged if (m_estate && m_estate->canBeOwned()) { - infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Owner: %1").arg(m_estate->owner() ? m_estate->owner()->name() : i18n("unowned"))); + infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Owner: %1").tqarg(m_estate->owner() ? m_estate->owner()->name() : i18n("unowned"))); infoText->setPixmap(0, TQPixmap(SmallIcon("info"))); if (m_estate->isOwned()) { - infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Houses: %1").arg(m_estate->houses())); + infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Houses: %1").tqarg(m_estate->houses())); infoText->setPixmap(0, TQPixmap(SmallIcon("info"))); - infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Mortgaged: %1").arg(m_estate->isMortgaged() ? i18n("Yes") : i18n("No"))); + infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Mortgaged: %1").tqarg(m_estate->isMortgaged() ? i18n("Yes") : i18n("No"))); infoText->setPixmap(0, TQPixmap(SmallIcon("info"))); } } @@ -250,7 +250,7 @@ void EstateDetails::addButton(TQString command, TQString caption, bool enabled) { TQColor bgColor, fgColor; bgColor = m_estate->bgColor().light(110); - fgColor = ( bgColor.red() + bgColor.green() + bgColor.blue() < 255 ) ? Qt::white : Qt::black; + fgColor = ( bgColor.red() + bgColor.green() + bgColor.blue() < 255 ) ? TQt::white : TQt::black; button->setPaletteForegroundColor( fgColor ); button->setPaletteBackgroundColor( bgColor ); @@ -298,7 +298,7 @@ void EstateDetails::appendText(TQString text) KWrappedListViewItem *infoText = new KWrappedListViewItem(m_infoListView, m_infoListView->lastItem(), text); - if ( text.find( TQRegExp("rolls") ) != -1 ) + if ( text.tqfind( TQRegExp("rolls") ) != -1 ) infoText->setPixmap(0, TQPixmap(SmallIcon("roll"))); else infoText->setPixmap(0, TQPixmap(SmallIcon("atlantik"))); @@ -321,7 +321,7 @@ void EstateDetails::clearButtons() void EstateDetails::buttonPressed() { - emit buttonCommand(TQString(m_buttonCommandMap[(TQObject *)TQObject::sender()])); + emit buttonCommand(TQString(m_buttonCommandMap[(TQObject *)TQT_BASE_OBJECT_NAME::sender()])); } #include "estatedetails.moc" diff --git a/atlantik/libatlantikui/estatedetails.h b/atlantik/libatlantikui/estatedetails.h index 6659055a..315bfa5f 100644 --- a/atlantik/libatlantikui/estatedetails.h +++ b/atlantik/libatlantikui/estatedetails.h @@ -32,12 +32,13 @@ class KPushButton; class Player; class Estate; -class EstateDetails : public QWidget +class EstateDetails : public TQWidget { -Q_OBJECT + Q_OBJECT + TQ_OBJECT public: - EstateDetails(Estate *estate, TQString text, TQWidget *parent, const char *name = 0); + EstateDetails(Estate *estate, TQString text, TQWidget *tqparent, const char *name = 0); ~EstateDetails(); Estate *estate() { return m_estate; } diff --git a/atlantik/libatlantikui/estateview.cpp b/atlantik/libatlantikui/estateview.cpp index 4755ccd3..19eec4d5 100644 --- a/atlantik/libatlantikui/estateview.cpp +++ b/atlantik/libatlantikui/estateview.cpp @@ -36,7 +36,7 @@ #include "estateview.moc" #include "config.h" -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) +EstateView::EstateView(Estate *estate, EstateOrientation orientation, const TQString &_icon, bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name, WResizeNoErase) { m_estate = estate; m_orientation = orientation; @@ -72,20 +72,20 @@ void EstateView::updateToolTip() TQString toolTip = m_estate->name(); if ( m_estate->isOwned() ) { - toolTip.append( "\n" + i18n("Owner: %1").arg( m_estate->owner()->name() ) ); + toolTip.append( "\n" + i18n("Owner: %1").tqarg( m_estate->owner()->name() ) ); if ( m_estate->isMortgaged() ) - toolTip.append( "\n" + i18n("Unmortgage Price: %1").arg( m_estate->unmortgagePrice() ) ); + toolTip.append( "\n" + i18n("Unmortgage Price: %1").tqarg( m_estate->unmortgagePrice() ) ); else - toolTip.append( "\n" + i18n("Mortgage Value: %1").arg( m_estate->mortgagePrice() ) ); + toolTip.append( "\n" + i18n("Mortgage Value: %1").tqarg( m_estate->mortgagePrice() ) ); if ( m_estate->canSellHouses() ) - toolTip.append( "\n" + i18n("House Value: %1").arg( m_estate->houseSellPrice() ) ); + toolTip.append( "\n" + i18n("House Value: %1").tqarg( m_estate->houseSellPrice() ) ); if ( m_estate->canBuyHouses() ) - toolTip.append( "\n" + i18n("House Price: %1").arg( m_estate->housePrice() ) ); + toolTip.append( "\n" + i18n("House Price: %1").tqarg( m_estate->housePrice() ) ); } else if ( m_estate->canBeOwned() ) - toolTip.append( "\n" + i18n("Price: %1").arg( m_estate->price() ) ); + toolTip.append( "\n" + i18n("Price: %1").tqarg( m_estate->price() ) ); else if ( m_estate->money() ) - toolTip.append( "\n" + i18n("Money: %1").arg( m_estate->money() ) ); + toolTip.append( "\n" + i18n("Money: %1").tqarg( m_estate->money() ) ); TQToolTip::add( this, toolTip ); } @@ -255,9 +255,9 @@ void EstateView::paintEvent(TQPaintEvent *) TQColor greenHouse(0, 255, 0); TQColor redHotel(255, 51, 51); TQPainter painter; - painter.begin(qpixmap, this); + painter.tqbegin(TQT_TQPAINTDEVICE(qpixmap), this); - painter.setPen(Qt::black); + painter.setPen(TQt::black); if (m_darkenMortgaged==true && m_estate->isMortgaged()) painter.setBrush(m_estate->bgColor().light(10)); @@ -281,7 +281,7 @@ void EstateView::paintEvent(TQPaintEvent *) quartzBuffer->resize(m_titleWidth-2, 25); TQPainter quartzPainter; - quartzPainter.begin(quartzBuffer, this); + quartzPainter.tqbegin(TQT_TQPAINTDEVICE(quartzBuffer), this); painter.setBrush(m_estate->color()); switch(m_orientation) @@ -432,7 +432,7 @@ void EstateView::resizeEvent(TQResizeEvent *) void EstateView::mousePressEvent(TQMouseEvent *e) { - if (e->button()==RightButton && m_estate->isOwned()) + if (e->button()==Qt::RightButton && m_estate->isOwned()) { KPopupMenu *rmbMenu = new KPopupMenu(this); rmbMenu->insertTitle(m_estate->name()); @@ -477,7 +477,7 @@ void EstateView::mousePressEvent(TQMouseEvent *e) { // Request trade if (Player *player = m_estate->owner()) - rmbMenu->insertItem(i18n("Request Trade with %1").arg(player->name()), 3); + rmbMenu->insertItem(i18n("Request Trade with %1").tqarg(player->name()), 3); } KPopupMenu *pm = dynamic_cast(rmbMenu); @@ -488,7 +488,7 @@ void EstateView::mousePressEvent(TQMouseEvent *e) rmbMenu->exec(g); delete rmbMenu; } - else if (e->button()==LeftButton) + else if (e->button()==Qt::LeftButton) emit LMBClicked(m_estate); } diff --git a/atlantik/libatlantikui/estateview.h b/atlantik/libatlantikui/estateview.h index 7e1d8cdc..a24d6888 100644 --- a/atlantik/libatlantikui/estateview.h +++ b/atlantik/libatlantikui/estateview.h @@ -29,12 +29,13 @@ enum EstateOrientation { North=0, East=1, South=2, West=3 }; class Player; class Estate; -class EstateView : public QWidget +class EstateView : public TQWidget { Q_OBJECT + TQ_OBJECT public: - EstateView(Estate *estate, EstateOrientation orientation, const TQString &, bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects, TQWidget *parent, const char *name = 0); + EstateView(Estate *estate, EstateOrientation orientation, const TQString &, bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects, TQWidget *tqparent, const char *name = 0); void setViewProperties(bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects); Estate *estate() { return m_estate; } void updatePE(); diff --git a/atlantik/libatlantikui/kwrappedlistviewitem.cpp b/atlantik/libatlantikui/kwrappedlistviewitem.cpp index 38c0d636..81f06dd7 100644 --- a/atlantik/libatlantikui/kwrappedlistviewitem.cpp +++ b/atlantik/libatlantikui/kwrappedlistviewitem.cpp @@ -31,16 +31,16 @@ #include "kwrappedlistviewitem.h" -KWrappedListViewItem::KWrappedListViewItem( TQListView *parent, TQString text, TQString t2 ) -: TQObject(), KListViewItem( parent ) +KWrappedListViewItem::KWrappedListViewItem( TQListView *tqparent, TQString text, TQString t2 ) +: TQObject(), KListViewItem( tqparent ) { - init( parent, text, t2 ); + init( tqparent, text, t2 ); } -KWrappedListViewItem::KWrappedListViewItem( TQListView *parent, TQListViewItem *after, TQString text, TQString t2 ) -: TQObject(), KListViewItem( parent, after ) +KWrappedListViewItem::KWrappedListViewItem( TQListView *tqparent, TQListViewItem *after, TQString text, TQString t2 ) +: TQObject(), KListViewItem( tqparent, after ) { - init( parent, text, t2 ); + init( tqparent, text, t2 ); } void KWrappedListViewItem::setup() @@ -83,7 +83,7 @@ void KWrappedListViewItem::wrapColumn( int c ) KWordWrap *wrap = KWordWrap::formatText( fm, rect, 0, m_origText ); setText( c, wrap->wrappedString() ); - int lc = text(c).contains( TQChar( '\n' ) ) + 1; + int lc = text(c).tqcontains( 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( TQListView *parent, TQString text, TQString t2 ) +void KWrappedListViewItem::init( TQListView *tqparent, TQString text, TQString t2 ) { m_wrapColumn = 0; setMultiLinesEnabled( true ); - parent->setResizeMode( TQListView::LastColumn ); + tqparent->setResizeMode( TQListView::LastColumn ); m_origText = text; @@ -110,7 +110,7 @@ void KWrappedListViewItem::init( TQListView *parent, TQString text, TQString t2 wrapColumn( m_wrapColumn ); - connect( parent->header(), TQT_SIGNAL(sizeChange(int, int, int)), this, TQT_SLOT(wrapColumn(int))); + connect( tqparent->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 ceda1afe..0107fef3 100644 --- a/atlantik/libatlantikui/kwrappedlistviewitem.h +++ b/atlantik/libatlantikui/kwrappedlistviewitem.h @@ -35,10 +35,11 @@ class KWordWrap; class KWrappedListViewItem : public TQObject, public KListViewItem { Q_OBJECT + TQ_OBJECT public: - KWrappedListViewItem( TQListView *parent, TQString text, QString=TQString::null ); - KWrappedListViewItem( TQListView *parent, TQListViewItem *after, TQString text, QString=TQString::null ); + KWrappedListViewItem( TQListView *tqparent, TQString text, TQString=TQString() ); + KWrappedListViewItem( TQListView *tqparent, TQListViewItem *after, TQString text, TQString=TQString() ); void setup(); // int width(const TQFontMetrics& fm, const TQListView* lv, int c) const; @@ -46,7 +47,7 @@ private slots: void wrapColumn( int c ); private: - void init( TQListView *parent, TQString text, QString=TQString::null ); + void init( TQListView *tqparent, TQString text, TQString=TQString() ); TQString m_origText; int m_wrapColumn; }; diff --git a/atlantik/libatlantikui/portfolioestate.cpp b/atlantik/libatlantikui/portfolioestate.cpp index 3bfed677..9b55b565 100644 --- a/atlantik/libatlantikui/portfolioestate.cpp +++ b/atlantik/libatlantikui/portfolioestate.cpp @@ -21,7 +21,7 @@ #include "portfolioestate.moc" #include "estate.h" -PortfolioEstate::PortfolioEstate(Estate *estate, Player *player, bool alwaysOwned, TQWidget *parent, const char *name) : TQWidget(parent, name) +PortfolioEstate::PortfolioEstate(Estate *estate, Player *player, bool alwaysOwned, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_estate = estate; m_player = player; @@ -55,7 +55,7 @@ TQPixmap PortfolioEstate::drawPixmap(Estate *estate, Player *player, bool always for (int y=5;y<=13;y+=2) painter.drawLine(2, y, 10, y); - painter.setPen(Qt::white); + painter.setPen(TQt::white); painter.drawPoint(8, 5); painter.drawPoint(8, 7); painter.drawPoint(8, 9); @@ -89,6 +89,6 @@ void PortfolioEstate::paintEvent(TQPaintEvent *) void PortfolioEstate::mousePressEvent(TQMouseEvent *e) { - if (e->button()==LeftButton) + if (e->button()==Qt::LeftButton) emit estateClicked(m_estate); } diff --git a/atlantik/libatlantikui/portfolioestate.h b/atlantik/libatlantikui/portfolioestate.h index fb1dc8d3..93ddde8d 100644 --- a/atlantik/libatlantikui/portfolioestate.h +++ b/atlantik/libatlantikui/portfolioestate.h @@ -26,12 +26,13 @@ class Estate; class Player; -class PortfolioEstate : public QWidget +class PortfolioEstate : public TQWidget { Q_OBJECT + TQ_OBJECT public: - PortfolioEstate(Estate *estate, Player *player, bool alwaysOwned, TQWidget *parent, const char *name = 0); + PortfolioEstate(Estate *estate, Player *player, bool alwaysOwned, TQWidget *tqparent, const char *name = 0); Estate *estate() { return m_estate; } static TQPixmap drawPixmap(Estate *estate, Player *player = 0, bool alwaysOwned = true); diff --git a/atlantik/libatlantikui/portfolioview.cpp b/atlantik/libatlantikui/portfolioview.cpp index 6725cbca..83d2b0d2 100644 --- a/atlantik/libatlantikui/portfolioview.cpp +++ b/atlantik/libatlantikui/portfolioview.cpp @@ -40,7 +40,7 @@ #define PE_MARGINH 2 #define ICONSIZE 48 -PortfolioView::PortfolioView(AtlanticCore *core, Player *player, TQColor activeColor, TQColor inactiveColor, TQWidget *parent, const char *name) : TQWidget(parent, name) +PortfolioView::PortfolioView(AtlanticCore *core, Player *player, TQColor activeColor, TQColor inactiveColor, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_atlanticCore = core; m_player = player; @@ -52,7 +52,7 @@ PortfolioView::PortfolioView(AtlanticCore *core, Player *player, TQColor activeC b_recreate = true; m_portfolioEstates.setAutoDelete(true); - setBackgroundColor(Qt::white); + setBackgroundColor(TQt::white); setMinimumHeight(ICONSIZE); // Init icon @@ -196,26 +196,26 @@ void PortfolioView::paintEvent(TQPaintEvent *) qpixmap = new TQPixmap(width(), height()); TQPainter painter; - painter.begin(qpixmap, this); + painter.tqbegin(TQT_TQPAINTDEVICE(qpixmap), this); - painter.setPen(Qt::white); - painter.setBrush(Qt::white); + painter.setPen(TQt::white); + painter.setBrush(TQt::white); painter.drawRect(rect()); - painter.setPen(m_player->hasTurn() ? m_activeColor : Qt::black); - painter.setBrush(m_player->hasTurn() ? m_activeColor : Qt::black); + painter.setPen(m_player->hasTurn() ? m_activeColor : TQt::black); + painter.setBrush(m_player->hasTurn() ? m_activeColor : TQt::black); painter.drawRect(0, 0, width(), 20); if (m_image) { - painter.setPen(Qt::black); - painter.setBrush(Qt::white); + painter.setPen(TQt::black); + painter.setBrush(TQt::white); painter.drawRect(0, 0, ICONSIZE, ICONSIZE); painter.drawPixmap(0, 0, *m_image); } - painter.setPen(Qt::white); + painter.setPen(TQt::white); painter.setFont(TQFont(KGlobalSettings::generalFont().family(), KGlobalSettings::generalFont().pointSize(), TQFont::Bold)); painter.drawText(ICONSIZE + KDialog::marginHint(), 15, m_player->name()); @@ -223,8 +223,8 @@ void PortfolioView::paintEvent(TQPaintEvent *) painter.drawText(width() - 50, 15, TQString::number(m_player->money())); else { - painter.setPen(Qt::black); - painter.setBrush(Qt::white); + painter.setPen(TQt::black); + painter.setBrush(TQt::white); painter.setFont(TQFont(KGlobalSettings::generalFont().family(), KGlobalSettings::generalFont().pointSize(), TQFont::Normal)); painter.drawText(ICONSIZE + KDialog::marginHint(), 30, m_player->host()); @@ -252,7 +252,7 @@ void PortfolioView::mousePressEvent(TQMouseEvent *e) { Player *playerSelf = m_atlanticCore->playerSelf(); - if ( e->button()==RightButton && (m_player != playerSelf) ) + if ( e->button()==Qt::RightButton && (m_player != playerSelf) ) { KPopupMenu *rmbMenu = new KPopupMenu(this); rmbMenu->insertTitle(m_player->name()); @@ -260,12 +260,12 @@ void PortfolioView::mousePressEvent(TQMouseEvent *e) if ( m_portfolioEstates.count() ) { // Start trade - rmbMenu->insertItem(i18n("Request Trade with %1").arg(m_player->name()), 0); + rmbMenu->insertItem(i18n("Request Trade with %1").tqarg(m_player->name()), 0); } else { // Kick player - rmbMenu->insertItem(i18n("Boot Player %1 to Lounge").arg(m_player->name()), 0); + rmbMenu->insertItem(i18n("Boot Player %1 to Lounge").tqarg(m_player->name()), 0); rmbMenu->setItemEnabled( 0, m_atlanticCore->selfIsMaster() ); } diff --git a/atlantik/libatlantikui/portfolioview.h b/atlantik/libatlantikui/portfolioview.h index 524f568f..d07aacda 100644 --- a/atlantik/libatlantikui/portfolioview.h +++ b/atlantik/libatlantikui/portfolioview.h @@ -30,12 +30,13 @@ class AtlanticCore; class Player; class Estate; -class LIBATLANTIKUI_EXPORT PortfolioView : public QWidget +class LIBATLANTIKUI_EXPORT PortfolioView : public TQWidget { Q_OBJECT + TQ_OBJECT public: - PortfolioView(AtlanticCore *core, Player *_player, TQColor activeColor, TQColor inactiveColor, TQWidget *parent, const char *name = 0); + PortfolioView(AtlanticCore *core, Player *_player, TQColor activeColor, TQColor inactiveColor, TQWidget *tqparent, const char *name = 0); ~PortfolioView(); void buildPortfolio(); diff --git a/atlantik/libatlantikui/token.cpp b/atlantik/libatlantikui/token.cpp index c77aeadb..0a4f5193 100644 --- a/atlantik/libatlantikui/token.cpp +++ b/atlantik/libatlantikui/token.cpp @@ -33,11 +33,11 @@ #define TOKEN_ICONSIZE 32 -Token::Token(Player *player, AtlantikBoard *parent, const char *name) : TQWidget(parent, name) +Token::Token(Player *player, AtlantikBoard *tqparent, const char *name) : TQWidget(tqparent, name) { setBackgroundMode(NoBackground); // avoid flickering - m_parentBoard = parent; + m_parentBoard = tqparent; m_player = player; connect(m_player, TQT_SIGNAL(changed(Player *)), this, TQT_SLOT(playerChanged())); @@ -127,24 +127,24 @@ void Token::paintEvent(TQPaintEvent *) qpixmap = new TQPixmap(width(), height()); TQPainter painter; - painter.begin(qpixmap, this); + painter.tqbegin(TQT_TQPAINTDEVICE(qpixmap), this); if (m_image) { - painter.setPen(Qt::black); - painter.setBrush(Qt::white); + painter.setPen(TQt::black); + painter.setBrush(TQt::white); painter.drawRect(0, 0, TOKEN_ICONSIZE, TOKEN_ICONSIZE); painter.drawPixmap(0, 0, *m_image); } - painter.setPen(Qt::black); - painter.setBrush(Qt::black); + painter.setPen(TQt::black); + painter.setBrush(TQt::black); painter.drawRect(0, TOKEN_ICONSIZE, width(), KGlobalSettings::generalFont().pointSize()); - painter.setPen(Qt::white); + painter.setPen(TQt::white); painter.setFont(TQFont(KGlobalSettings::generalFont().family(), KGlobalSettings::generalFont().pointSize(), TQFont::DemiBold)); - painter.drawText(1, height()-1, (m_player ? m_player->name() : TQString::null)); + painter.drawText(1, height()-1, (m_player ? m_player->name() : TQString())); b_recreate = false; } diff --git a/atlantik/libatlantikui/token.h b/atlantik/libatlantikui/token.h index 30d43c61..ea45888d 100644 --- a/atlantik/libatlantikui/token.h +++ b/atlantik/libatlantikui/token.h @@ -25,12 +25,13 @@ class Player; class Estate; class AtlantikBoard; -class Token : public QWidget +class Token : public TQWidget { Q_OBJECT + TQ_OBJECT public: - Token (Player *player, AtlantikBoard *parent, const char *name = 0); + Token (Player *player, AtlantikBoard *tqparent, const char *name = 0); ~Token(); Player *player(); void setLocation(Estate *estate); diff --git a/atlantik/libatlantikui/trade_widget.cpp b/atlantik/libatlantikui/trade_widget.cpp index be8b2749..bf4eeac6 100644 --- a/atlantik/libatlantikui/trade_widget.cpp +++ b/atlantik/libatlantikui/trade_widget.cpp @@ -44,15 +44,15 @@ #include "trade_widget.moc" -TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, TQWidget *parent, const char *name) - : TQWidget(parent, name, +TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name, WType_Dialog | WStyle_Customize | WStyle_DialogBorder | WStyle_Title | WStyle_Minimize | WStyle_ContextHelp ) { m_trade = trade; m_atlanticCore = atlanticCore; - setCaption(i18n("Trade %1").arg(trade->tradeId())); + setCaption(i18n("Trade %1").tqarg(trade->tradeId())); TQVBoxLayout *listCompBox = new TQVBoxLayout(this, KDialog::marginHint()); @@ -143,7 +143,7 @@ TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, TQWidget *p 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 ) ) ); + m_status->setText( i18n( "%1 out of %2 players accept current trade proposal." ).tqarg( m_trade->count( true ) ).tqarg( m_trade->count( false ) ) ); // mPlayerList->header()->hide(); // mPlayerList->setRootIsDecorated(true); @@ -216,7 +216,7 @@ void TradeDisplay::tradeChanged() { // TODO: add notification whether playerSelf has accepted or not and // enable/disable accept button based on that - m_status->setText( i18n( "%1 out of %2 players accept current trade proposal." ).arg( m_trade->count( true ) ).arg( m_trade->count( false ) ) ); + m_status->setText( i18n( "%1 out of %2 players accept current trade proposal." ).tqarg( m_trade->count( true ) ).tqarg( m_trade->count( false ) ) ); } void TradeDisplay::playerChanged(Player *player) @@ -232,7 +232,7 @@ void TradeDisplay::playerChanged(Player *player) void TradeDisplay::tradeRejected(Player *player) { if (player) - m_status->setText(i18n("Trade proposal was rejected by %1.").arg(player->name())); + m_status->setText(i18n("Trade proposal was rejected by %1.").tqarg(player->name())); else m_status->setText(i18n("Trade proposal was rejected.")); diff --git a/atlantik/libatlantikui/trade_widget.h b/atlantik/libatlantikui/trade_widget.h index 73842a91..ebaba426 100644 --- a/atlantik/libatlantikui/trade_widget.h +++ b/atlantik/libatlantikui/trade_widget.h @@ -36,12 +36,13 @@ class Player; class Trade; class TradeItem; -class LIBATLANTIKUI_EXPORT TradeDisplay : public QWidget +class LIBATLANTIKUI_EXPORT TradeDisplay : public TQWidget { Q_OBJECT + TQ_OBJECT public: - TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, TQWidget *parent=0, const char *name = 0); + TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, TQWidget *tqparent=0, const char *name = 0); Trade *trade() { return mTrade; } @@ -86,7 +87,7 @@ private: Trade *mTrade, *m_trade; TradeItem *m_contextTradeItem; - // TODO: Wouldn't QPair make more sense here? + // TODO: Wouldn't TQPair make more sense here? TQMap m_componentMap; TQMap m_componentRevMap; TQMap m_estateMap; diff --git a/kasteroids/ledmeter.cpp b/kasteroids/ledmeter.cpp index 1d807d18..d2250c28 100644 --- a/kasteroids/ledmeter.cpp +++ b/kasteroids/ledmeter.cpp @@ -8,7 +8,7 @@ #include "ledmeter.h" #include "ledmeter.moc" -KALedMeter::KALedMeter( TQWidget *parent ) : TQFrame( parent ) +KALedMeter::KALedMeter( TQWidget *tqparent ) : TQFrame( tqparent ) { mCRanges.setAutoDelete( true ); mRange = 100; @@ -76,7 +76,7 @@ void KALedMeter::drawContents( TQPainter *p ) unsigned cidx = 0; int ncol = mCount; - TQColor col = colorGroup().foreground(); + TQColor col = tqcolorGroup().foreground(); if ( !mCRanges.isEmpty() ) { diff --git a/kasteroids/ledmeter.h b/kasteroids/ledmeter.h index 307b5bfc..7547bcd1 100644 --- a/kasteroids/ledmeter.h +++ b/kasteroids/ledmeter.h @@ -11,11 +11,12 @@ #include -class KALedMeter : public QFrame +class KALedMeter : public TQFrame { - Q_OBJECT + Q_OBJECT + TQ_OBJECT public: - KALedMeter( TQWidget *parent ); + KALedMeter( TQWidget *tqparent ); int range() const { return mRange; } void setRange( int r ); diff --git a/kasteroids/sprites.h b/kasteroids/sprites.h index 43dc34ea..1f39e74a 100644 --- a/kasteroids/sprites.h +++ b/kasteroids/sprites.h @@ -31,7 +31,7 @@ #define MAX_POWERUP_AGE 500 #define MAX_MISSILE_AGE 40 -class KMissile : public QCanvasSprite +class KMissile : public TQCanvasSprite { public: KMissile( TQCanvasPixmapArray *s, TQCanvas *c ) : TQCanvasSprite( s, c ) @@ -46,7 +46,7 @@ private: int myAge; }; -class KBit : public QCanvasSprite +class KBit : public TQCanvasSprite { public: KBit( TQCanvasPixmapArray *s, TQCanvas *c ) : TQCanvasSprite( s, c ) @@ -62,7 +62,7 @@ private: int death; }; -class KExhaust : public QCanvasSprite +class KExhaust : public TQCanvasSprite { public: KExhaust( TQCanvasPixmapArray *s, TQCanvas *c ) : TQCanvasSprite( s, c ) @@ -78,7 +78,7 @@ private: int death; }; -class KPowerup : public QCanvasSprite +class KPowerup : public TQCanvasSprite { public: KPowerup( TQCanvasPixmapArray *s, TQCanvas *c, int t ) : TQCanvasSprite( s, c ), @@ -94,7 +94,7 @@ protected: int type; }; -class KRock : public QCanvasSprite +class KRock : public TQCanvasSprite { public: KRock (TQCanvasPixmapArray *s, TQCanvas *c, int t, int sk, int st) : TQCanvasSprite( s, c ) @@ -104,7 +104,7 @@ public: { if (cskip-- <= 0) { setFrame( (frame()+step+frameCount())%frameCount() ); - cskip = QABS(skip); + cskip = TQABS(skip); } } @@ -117,7 +117,7 @@ private: int step; }; -class KShield : public QCanvasSprite +class KShield : public TQCanvasSprite { public: KShield( TQCanvasPixmapArray *s, TQCanvas *c ) diff --git a/kasteroids/sprites/rock1/rock1.pov b/kasteroids/sprites/rock1/rock1.pov index 58298c05..bcf4c8a7 100644 --- a/kasteroids/sprites/rock1/rock1.pov +++ b/kasteroids/sprites/rock1/rock1.pov @@ -1,5 +1,5 @@ #include "colors.inc" -#include "shapes.inc" +#include "tqshapes.inc" #include "textures.inc" // #include "stones.inc" diff --git a/kasteroids/sprites/rock2/rock2.pov b/kasteroids/sprites/rock2/rock2.pov index 2f37a206..625c7854 100644 --- a/kasteroids/sprites/rock2/rock2.pov +++ b/kasteroids/sprites/rock2/rock2.pov @@ -1,5 +1,5 @@ #include "colors.inc" -#include "shapes.inc" +#include "tqshapes.inc" #include "textures.inc" // #include "stones.inc" diff --git a/kasteroids/sprites/rock3/rock3.pov b/kasteroids/sprites/rock3/rock3.pov index 2f37a206..625c7854 100644 --- a/kasteroids/sprites/rock3/rock3.pov +++ b/kasteroids/sprites/rock3/rock3.pov @@ -1,5 +1,5 @@ #include "colors.inc" -#include "shapes.inc" +#include "tqshapes.inc" #include "textures.inc" // #include "stones.inc" diff --git a/kasteroids/toplevel.cpp b/kasteroids/toplevel.cpp index d9a22a2b..ffc6b8e2 100644 --- a/kasteroids/toplevel.cpp +++ b/kasteroids/toplevel.cpp @@ -29,7 +29,7 @@ #include "toplevel.moc" -#if defined Q_WS_X11 && ! defined K_WS_QTONLY +#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY #include #endif #include @@ -102,7 +102,7 @@ KAstTopLevel::KAstTopLevel() label = new TQLabel( i18n("Score"), mainWin ); label->setFont( labelFont ); label->setPalette( pal ); - label->setFixedWidth( label->sizeHint().width() ); + label->setFixedWidth( label->tqsizeHint().width() ); hb->addWidget( label ); scoreLCD = new TQLCDNumber( 6, mainWin ); @@ -116,7 +116,7 @@ KAstTopLevel::KAstTopLevel() label = new TQLabel( i18n("Level"), mainWin ); label->setFont( labelFont ); label->setPalette( pal ); - label->setFixedWidth( label->sizeHint().width() ); + label->setFixedWidth( label->tqsizeHint().width() ); hb->addWidget( label ); levelLCD = new TQLCDNumber( 2, mainWin ); @@ -129,7 +129,7 @@ KAstTopLevel::KAstTopLevel() label = new TQLabel( i18n("Ships"), mainWin ); label->setFont( labelFont ); - label->setFixedWidth( label->sizeHint().width() ); + label->setFixedWidth( label->tqsizeHint().width() ); label->setPalette( pal ); hb->addWidget( label ); @@ -151,7 +151,7 @@ KAstTopLevel::KAstTopLevel() vb->addWidget( view, 10 ); -// -- bottom layout: +// -- bottom tqlayout: TQFrame *sep2 = new TQFrame( mainWin ); sep2->setMaximumHeight( 1 ); sep2->setFrameStyle( TQFrame::HLine | TQFrame::Raised ); @@ -168,7 +168,7 @@ KAstTopLevel::KAstTopLevel() /* label = new TQLabel( i18n( "T" ), mainWin ); label->setFont( smallFont ); - label->setFixedWidth( label->sizeHint().width() ); + label->setFixedWidth( label->tqsizeHint().width() ); label->setPalette( pal ); hbd->addWidget( label ); @@ -184,7 +184,7 @@ KAstTopLevel::KAstTopLevel() TQPixmap pm( sprites_prefix + "powerups/brake.png" ); label = new TQLabel( mainWin ); label->setPixmap( pm ); - label->setFixedWidth( label->sizeHint().width() ); + label->setFixedWidth( label->tqsizeHint().width() ); label->setPalette( pal ); hbd->addWidget( label ); @@ -200,7 +200,7 @@ KAstTopLevel::KAstTopLevel() pm.load( sprites_prefix + "powerups/shield.png" ); label = new TQLabel( mainWin ); label->setPixmap( pm ); - label->setFixedWidth( label->sizeHint().width() ); + label->setFixedWidth( label->tqsizeHint().width() ); label->setPalette( pal ); hbd->addWidget( label ); @@ -216,7 +216,7 @@ KAstTopLevel::KAstTopLevel() pm.load( sprites_prefix + "powerups/shoot.png" ); label = new TQLabel( mainWin ); label->setPixmap( pm ); - label->setFixedWidth( label->sizeHint().width() ); + label->setFixedWidth( label->tqsizeHint().width() ); label->setPalette( pal ); hbd->addWidget( label ); @@ -231,7 +231,7 @@ KAstTopLevel::KAstTopLevel() label = new TQLabel( i18n( "Fuel" ), mainWin ); label->setFont( smallFont ); - label->setFixedWidth( label->sizeHint().width() + 10 ); + label->setFixedWidth( label->tqsizeHint().width() + 10 ); label->setPalette( pal ); hbd->addWidget( label ); @@ -252,7 +252,7 @@ KAstTopLevel::KAstTopLevel() setupGUI( KMainWindow::Save | Create ); - setFocusPolicy( StrongFocus ); + setFocusPolicy( TQ_StrongFocus ); setFocus(); #ifdef KA_ENABLE_SOUND @@ -267,7 +267,7 @@ KAstTopLevel::KAstTopLevel() KAstTopLevel::~KAstTopLevel() { -#if defined Q_WS_X11 && ! defined K_WS_QTONLY +#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY XAutoRepeatOn( qt_xdisplay() ); #endif soundDict.setAutoDelete(true); @@ -280,24 +280,24 @@ KAstTopLevel::~KAstTopLevel() void KAstTopLevel::initKAction() { // game - 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()); + KStdGameAction::gameNew( TQT_TQOBJECT(this), TQT_SLOT( slotNewGame() ), actionCollection() ); + KStdGameAction::highscores( TQT_TQOBJECT(this), TQT_SLOT( slotShowHighscores() ), actionCollection() ); + KStdGameAction::pause( TQT_TQOBJECT(this), TQT_SLOT( slotPause() ), actionCollection() ); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT( close() ), actionCollection()); // settings - KStdAction::keyBindings(this, TQT_SLOT( slotKeyConfig() ), actionCollection()); - KStdAction::preferences(this, TQT_SLOT( slotPref() ), actionCollection()); + KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT( slotKeyConfig() ), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT( slotPref() ), actionCollection()); // keyboard-only actions - keycodes.insert(Thrust, new KAction(i18n("Thrust"), Qt::Key_Up, 0, 0, actionCollection(), "Thrust")); - keycodes.insert(RotateLeft, new KAction(i18n("Rotate Left"), Qt::Key_Left, 0, 0, actionCollection(), "RotateLeft")); - keycodes.insert(RotateRight, new KAction(i18n("Rotate Right"), Qt::Key_Right, 0, 0, actionCollection(), "RotateRight")); - keycodes.insert(Shoot, new KAction(i18n("Shoot"), Qt::Key_Space, 0, 0, actionCollection(), "Shoot")); -// 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, TQT_SLOT(slotLaunch()), actionCollection(), "Launch"); + keycodes.insert(Thrust, new KAction(i18n("Thrust"), TQt::Key_Up, 0, 0, actionCollection(), "Thrust")); + keycodes.insert(RotateLeft, new KAction(i18n("Rotate Left"), TQt::Key_Left, 0, 0, actionCollection(), "RotateLeft")); + keycodes.insert(RotateRight, new KAction(i18n("Rotate Right"), TQt::Key_Right, 0, 0, actionCollection(), "RotateRight")); + keycodes.insert(Shoot, new KAction(i18n("Shoot"), TQt::Key_Space, 0, 0, actionCollection(), "Shoot")); +// keycodes.insert(Teleport, new KAction(i18n("Teleport"), TQt::Key_Z, 0, 0, actionCollection(), "Teleport")); + keycodes.insert(Brake, new KAction(i18n("Brake"), TQt::Key_X, 0, 0, actionCollection(), "Brake")); + keycodes.insert(Shield, new KAction(i18n("Shield"), TQt::Key_S, 0, 0, actionCollection(), "Shield")); + launchAction = new KAction(i18n("Launch"), TQt::Key_L, TQT_TQOBJECT(this), TQT_SLOT(slotLaunch()), actionCollection(), "Launch"); } @@ -336,7 +336,7 @@ return; // remove this and the above when the sound below is working correctly bool KAstTopLevel::eventFilter( TQObject* /* object */, TQEvent *event ) { - TQKeyEvent *e = static_cast(event); + TQKeyEvent *e = TQT_TQKEYEVENT(event); if (event->type() == TQEvent::AccelOverride) { if (processKeyPress(e)) return true; @@ -457,7 +457,7 @@ bool KAstTopLevel::processKeyRelease( TQKeyEvent *event ) void KAstTopLevel::focusInEvent( TQFocusEvent *e ) { view->pause( false ); -#if defined Q_WS_X11 && ! defined K_WS_QTONLY +#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY XAutoRepeatOff( qt_xdisplay() ); #endif KMainWindow::focusInEvent(e); @@ -466,7 +466,7 @@ void KAstTopLevel::focusInEvent( TQFocusEvent *e ) void KAstTopLevel::focusOutEvent( TQFocusEvent *e ) { view->pause( true ); -#if defined Q_WS_X11 && ! defined K_WS_QTONLY +#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY XAutoRepeatOn( qt_xdisplay() ); #endif KMainWindow::focusOutEvent(e); @@ -484,7 +484,7 @@ void KAstTopLevel::slotNewGame() view->setRockSpeed( levels[0].rockSpeed ); view->addRocks( levels[0].nrocks ); view->showText( i18n( "Press %1 to launch." ) - .arg(launchAction->shortcut().seq(0).toString()), + .tqarg(launchAction->shortcut().seq(0).toString()), yellow ); waitShip = true; gameOver = false; @@ -492,7 +492,7 @@ void KAstTopLevel::slotNewGame() bool KAstTopLevel::queryExit() { -#if defined Q_WS_X11 && ! defined K_WS_QTONLY +#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY XAutoRepeatOn( qt_xdisplay() ); #endif return true; @@ -509,7 +509,7 @@ void KAstTopLevel::slotShipKilled() { waitShip = true; view->showText( i18n( "Ship Destroyed. Press %1 to launch.") - .arg(launchAction->shortcut().seq(0).toString()), + .tqarg(launchAction->shortcut().seq(0).toString()), yellow ); } else @@ -529,7 +529,7 @@ void KAstTopLevel::slotShipKilled() } else { - TQTimer::singleShot(1000, this, TQT_SLOT(slotGameOver())); + TQTimer::singleShot(1000, TQT_TQOBJECT(this), TQT_SLOT(slotGameOver())); } } } @@ -577,7 +577,7 @@ void KAstTopLevel::slotKeyConfig() { KKeyDialog::configure( actionCollection(), this ); if ( waitShip ) view->showText( i18n( "Press %1 to launch." ) - .arg(launchAction->shortcut().seq(0).toString()), + .tqarg(launchAction->shortcut().seq(0).toString()), yellow, false ); } @@ -613,7 +613,7 @@ void KAstTopLevel::slotPref() /* Done */ dialog->addPage(w, i18n("General"), "package_settings"); - connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), TQT_TQOBJECT(this), TQT_SLOT(loadSettings())); dialog->show(); } @@ -637,9 +637,9 @@ void KAstTopLevel::doStats() " Hit:\t%2\n" " Missed:\t%3\n" "Hit ratio:\t%4 %\t\t") - .arg(view->shots()).arg(view->hits()) - .arg(view->shots() - view->hits()) - .arg(r); + .tqarg(view->shots()).tqarg(view->hits()) + .tqarg(view->shots() - view->hits()) + .tqarg(r); view->showText( s, green, FALSE ); } diff --git a/kasteroids/toplevel.h b/kasteroids/toplevel.h index c75710eb..54af5130 100644 --- a/kasteroids/toplevel.h +++ b/kasteroids/toplevel.h @@ -23,6 +23,7 @@ class KDialogBase; class KAstTopLevel : public KMainWindow { Q_OBJECT + TQ_OBJECT public: KAstTopLevel(); virtual ~KAstTopLevel(); diff --git a/kasteroids/view.cpp b/kasteroids/view.cpp index e203ffb5..0fea036b 100644 --- a/kasteroids/view.cpp +++ b/kasteroids/view.cpp @@ -63,8 +63,8 @@ kas_animations [] = -KAsteroidsView::KAsteroidsView( TQWidget *parent, const char *name ) - : TQWidget( parent, name ), +KAsteroidsView::KAsteroidsView( TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ), field(640, 440), view(&field,this) { @@ -78,7 +78,7 @@ KAsteroidsView::KAsteroidsView( TQWidget *parent, const char *name ) field.setBackgroundColor(black); TQPixmap pm( locate("sprite", IMG_BACKGROUND) ); - field.setBackgroundPixmap( pm ); + field.tqsetBackgroundPixmap( pm ); textSprite = new TQCanvasText( &field ); TQFont font( KGlobalSettings::generalFont().family(), 18 ); diff --git a/kasteroids/view.h b/kasteroids/view.h index 5d62f640..48b72e9f 100644 --- a/kasteroids/view.h +++ b/kasteroids/view.h @@ -17,11 +17,12 @@ #define MAX_POWER_LEVEL 1000 -class KAsteroidsView : public QWidget +class KAsteroidsView : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KAsteroidsView( TQWidget *parent = 0, const char *name = 0 ); + KAsteroidsView( TQWidget *tqparent = 0, const char *name = 0 ); virtual ~KAsteroidsView(); int refreshRate; diff --git a/katomic/configbox.cpp b/katomic/configbox.cpp index d6fcde23..30c77dd3 100644 --- a/katomic/configbox.cpp +++ b/katomic/configbox.cpp @@ -16,8 +16,8 @@ extern Options settings; -ConfigBox::ConfigBox ( TQWidget *parent, const char *name) - : KDialogBase ( parent, name, true, i18n("Configure"), Ok | Cancel, Ok, true ) +ConfigBox::ConfigBox ( TQWidget *tqparent, const char *name) + : KDialogBase ( tqparent, name, true, i18n("Configure"), Ok | Cancel, Ok, true ) { TQWidget *page = makeMainWidget(); @@ -33,7 +33,7 @@ ConfigBox::ConfigBox ( TQWidget *parent, const char *name) glay->addWidget(disp, 1, 2); disp->display(1); - speed = new TQSlider(1, 10, 1, 1, TQSlider::Horizontal, page); + speed = new TQSlider(1, 10, 1, 1, Qt::Horizontal, page); glay->addMultiCellWidget(speed, 2, 2, 2, 3); connect(speed, TQT_SIGNAL(valueChanged(int)), disp, TQT_SLOT(display(int))); diff --git a/katomic/configbox.h b/katomic/configbox.h index b3d8dfe2..5bffb932 100644 --- a/katomic/configbox.h +++ b/katomic/configbox.h @@ -16,6 +16,7 @@ class ConfigBox : public KDialogBase { Q_OBJECT + TQ_OBJECT public: ConfigBox ( TQWidget *, const char* name ); diff --git a/katomic/feld.cpp b/katomic/feld.cpp index e01060cb..48150efd 100644 --- a/katomic/feld.cpp +++ b/katomic/feld.cpp @@ -1,15 +1,15 @@ /**************************************************************** ** -** Implementation Feld class, derieved from Qt tutorial 8 +** Implementation Feld class, derieved from TQt tutorial 8 ** ****************************************************************/ // bemerkungen : wenn paintEvent aufgerufen wird, wird das komplette -// widget gelöscht und nur die sachen gezeichnet, die in +// widget gel�scht und nur die sachen gezeichnet, die in // paintEvent stehen ! sollen dinge z.b nur bei maustasten- -// druck gezeichnet werden, so muß dies in mousePressEvent +// druck gezeichnet werden, so mu� dies in mousePressEvent // stehen ! -// paintEvent wird aufgerufen, falls fenster überdeckt wird, +// paintEvent wird aufgerufen, falls fenster �berdeckt wird, // oder auch einfach bewegt wird #include @@ -26,8 +26,8 @@ extern Options settings; -Feld::Feld( TQWidget *parent, const char *name ) : - TQWidget( parent, name ), +Feld::Feld( TQWidget *tqparent, const char *name ) : + TQWidget( tqparent, name ), data(locate("appdata", "pics/abilder.png")), undoBegin (0), undoSize (0), redoSize (0) { @@ -45,7 +45,7 @@ Feld::Feld( TQWidget *parent, const char *name ) : setMouseTracking(true); - setFocusPolicy(TQWidget::StrongFocus); + setFocusPolicy(TQ_StrongFocus); setBackgroundColor( TQColor( 0, 0, 0) ); setFixedSize(15 * 30, 15 * 30); @@ -70,7 +70,7 @@ void Feld::resetValidDirs() void Feld::load (const KSimpleConfig& config) { if(moving) - killTimers(); + TQT_TQOBJECT(this)->killTimers(); mol->load(config); @@ -124,7 +124,7 @@ void Feld::mousePressEvent (TQMouseEvent *e) resetValidDirs(); chosen = false; } - emitStatus(); + emittqStatus(); } const atom& Feld::getAtom(uint index) const @@ -154,7 +154,7 @@ void Feld::nextAtom() xpos = x; ypos = y; chosen = true; resetValidDirs(); - emitStatus(); + emittqStatus(); return; } } @@ -187,7 +187,7 @@ void Feld::previousAtom() xpos = x; ypos = y; chosen = true; resetValidDirs(); - emitStatus(); + emittqStatus(); return; } } @@ -198,7 +198,7 @@ void Feld::previousAtom() } -void Feld::emitStatus() +void Feld::emittqStatus() { if (!chosen || moving) {} else { @@ -231,7 +231,7 @@ void Feld::done () if (moving) return; - emitStatus(); + emittqStatus(); if (checkDone()) emit gameOver(moves); @@ -492,7 +492,7 @@ void Feld::timerEvent (TQTimerEvent *) if (frames <= 0) { moving = false; - killTimers (); + TQT_TQOBJECT(this)->killTimers (); done(); dir = None; } @@ -574,7 +574,7 @@ void Feld::paintEvent( TQPaintEvent * ) x = i * 30; y = j * 30; - // zeichnet Randstücke + // zeichnet Randst�cke if (feld [i] [j] == 254) { putNonAtom(i, j, Feld::None, true); continue; } @@ -628,7 +628,7 @@ void Feld::paintEvent( TQPaintEvent * ) } - // zeichnet Verbindungsstäbe + // zeichnet Verbindungsst�be if (getAtom(feld [i] [j]).obj >= 'A' && getAtom(feld [i] [j]).obj <= 'F') bitBlt (this, x, y, diff --git a/katomic/feld.h b/katomic/feld.h index b48ebf39..6383441c 100644 --- a/katomic/feld.h +++ b/katomic/feld.h @@ -27,12 +27,13 @@ class Molek; #define FIELD_SIZE 15 -class Feld : public QWidget +class Feld : public TQWidget { Q_OBJECT + TQ_OBJECT public: - Feld (TQWidget *parent=0, const char *name=0); + Feld (TQWidget *tqparent=0, const char *name=0); ~Feld (); enum Direction { None = 0, @@ -64,7 +65,7 @@ protected: void paintMovingAtom(); void mousePressEvent (TQMouseEvent *); void mouseMoveEvent (TQMouseEvent *); - void emitStatus(); + void emittqStatus(); protected: struct UndoInfo { diff --git a/katomic/gamewidget.cpp b/katomic/gamewidget.cpp index 2c9ccf0a..2bda7d0f 100644 --- a/katomic/gamewidget.cpp +++ b/katomic/gamewidget.cpp @@ -1,6 +1,6 @@ /* toplevel.cpp - Copyright (C) 1998 Andreas Wüst (AndreasWuest@gmx.de) + Copyright (C) 1998 Andreas W�st (AndreasWuest@gmx.de) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -95,11 +95,11 @@ void GameWidget::doRedo () } void GameWidget::gameOver(int moves) { - KMessageBox::information(this, i18n("You solved level %1 with %2 moves!").arg(level).arg(moves), i18n("Congratulations")); + KMessageBox::information(this, i18n("You solved level %1 with %2 moves!").tqarg(level).tqarg(moves), i18n("Congratulations")); KScoreDialog high(KScoreDialog::Name | KScoreDialog::Score, this); - high.setCaption(i18n("Level %1 Highscores").arg(level)); - high.setConfigGroup(TQString("Highscores Level %1").arg(level)); + high.setCaption(i18n("Level %1 Highscores").tqarg(level)); + high.setConfigGroup(TQString("Highscores Level %1").tqarg(level)); KScoreDialog::FieldInfo scoreInfo; @@ -118,8 +118,8 @@ void GameWidget::getMoves(int moves) void GameWidget::mergeHighScores(int l) { - KConfigGroup oldConfig(kapp->config(), TQString("High Scores Level %1").arg(l).utf8()); - KConfigGroup newConfig(kapp->config(), TQString("Highscores Level %1").arg(l).utf8()); + KConfigGroup oldConfig(kapp->config(), TQString("High Scores Level %1").tqarg(l).utf8()); + KConfigGroup newConfig(kapp->config(), TQString("Highscores Level %1").tqarg(l).utf8()); newConfig.writeEntry("LastPlayer", oldConfig.readEntry("LastPlayer")); @@ -138,7 +138,7 @@ void GameWidget::mergeHighScores(int l) void GameWidget::updateLevel (int l) { level=l; - TQString levelFile = locate("appdata", TQString("levels/level_%1").arg(l)); + TQString levelFile = locate("appdata", TQString("levels/level_%1").tqarg(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(TQString("Highscores Level %1").arg(level)) && - kapp->config()->hasGroup(TQString("High Scores Level %1").arg(level))) + if (!kapp->config()->hasGroup(TQString("Highscores Level %1").tqarg(level)) && + kapp->config()->hasGroup(TQString("High Scores Level %1").tqarg(level))) mergeHighScores(level); - highScore->setConfigGroup(TQString("Highscores Level %1").arg(level)); + highScore->setConfigGroup(TQString("Highscores Level %1").tqarg(level)); highest.setNum(highScore->highScore()); if (highest != "0" ) hs->setText(highest); @@ -159,7 +159,7 @@ void GameWidget::updateLevel (int l) ys->setText("0"); scrl->setValue(level); - feld->repaint(); + feld->tqrepaint(); } void GameWidget::restartLevel() @@ -167,8 +167,8 @@ void GameWidget::restartLevel() updateLevel(level); } -GameWidget::GameWidget ( TQWidget *parent, const char* name ) - : TQWidget( parent, name ) +GameWidget::GameWidget ( TQWidget *tqparent, const char* name ) + : TQWidget( tqparent, name ) { level = 1; nlevels = KGlobal::dirs()->findAllResources("appdata", "levels/level_*", @@ -188,10 +188,10 @@ GameWidget::GameWidget ( TQWidget *parent, const char* name ) // scrollbar scrl = new TQScrollBar(1, nlevels, 1, - 5, 1, TQScrollBar::Horizontal, vb, "scrl" ); + 5, 1, Qt::Horizontal, vb, "scrl" ); connect (scrl, TQT_SIGNAL (valueChanged (int)), TQT_SLOT (updateLevel (int))); - // molekül + // molek�l molek = new Molek (vb, "molek"); feld->setMolek(molek); @@ -214,7 +214,7 @@ GameWidget::GameWidget ( TQWidget *parent, const char* name ) headerFont.setBold(true); hs = new TQLabel (highest, bg); - hs->setAlignment(Qt::AlignRight); + hs->tqsetAlignment(TQt::AlignRight); hs->setFont(headerFont); slay->addWidget(hs); @@ -223,7 +223,7 @@ GameWidget::GameWidget ( TQWidget *parent, const char* name ) slay->addWidget(new TQLabel(i18n("Your score so far:"), bg)); ys = new TQLabel (current, bg); - ys->setAlignment(Qt::AlignRight); + ys->tqsetAlignment(TQt::AlignRight); ys->setFont(headerFont); slay->addWidget(ys); @@ -245,8 +245,8 @@ GameWidget::~GameWidget() void GameWidget::showHighscores () { KScoreDialog high(KScoreDialog::Name | KScoreDialog::Score, this); - high.setCaption(i18n("Level %1 Highscores").arg(level)); - high.setConfigGroup(TQString("Highscores Level %1").arg(level)); + high.setCaption(i18n("Level %1 Highscores").tqarg(level)); + high.setConfigGroup(TQString("Highscores Level %1").tqarg(level)); high.exec(); } diff --git a/katomic/gamewidget.h b/katomic/gamewidget.h index a998c80a..839faa17 100644 --- a/katomic/gamewidget.h +++ b/katomic/gamewidget.h @@ -10,13 +10,14 @@ class KScoreDialog; #include -class GameWidget : public QWidget +class GameWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - GameWidget ( TQWidget *parent, const char *name=0 ); + GameWidget ( TQWidget *tqparent, const char *name=0 ); ~GameWidget(); diff --git a/katomic/molek.cpp b/katomic/molek.cpp index 26cbcbf6..7555736b 100644 --- a/katomic/molek.cpp +++ b/katomic/molek.cpp @@ -1,15 +1,15 @@ /**************************************************************** ** -** Implementation Molek class, derieved from Qt tutorial 8 +** Implementation Molek class, derieved from TQt tutorial 8 ** ****************************************************************/ // bemerkungen : wenn paintEvent aufgerufen wird, wird das komplette -// widget gelöscht und nur die sachen gezeichnet, die in +// widget gel�scht und nur die sachen gezeichnet, die in // paintEvent stehen ! sollen dinge z.b nur bei maustasten- -// druck gezeichnet werden, so muß dies in mousePressEvent +// druck gezeichnet werden, so mu� dies in mousePressEvent // stehen ! -// paintEvent wird aufgerufen, falls fenster überdeckt wird, +// paintEvent wird aufgerufen, falls fenster �berdeckt wird, // oder auch einfach bewegt wird #include @@ -26,7 +26,7 @@ extern int level; -Molek::Molek( TQWidget *parent, const char *name ) : TQWidget( parent, name ), +Molek::Molek( TQWidget *tqparent, const char *name ) : TQWidget( tqparent, name ), data(locate("appdata", "pics/molek.png")) { setBackgroundColor (TQColor (0, 0, 0)); @@ -62,13 +62,13 @@ void Molek::load (const KSimpleConfig& config) if (value.isEmpty()) break; - current.obj = value.at(0).latin1(); + current.obj = value.tqat(0).latin1(); value = value.mid(2); if (value.isNull()) value = ""; strlcpy(current.conn, value.ascii(), sizeof(current.conn)); - kdWarning( atoms.find(current) != atoms.end() ) + kdWarning( atoms.tqfind(current) != atoms.end() ) << "OOOPS, duplicate atom definition in " << key << endl; atoms.append(current); atom_index++; @@ -82,7 +82,7 @@ void Molek::load (const KSimpleConfig& config) line = config.readEntry(key); for (int i = 0; i < MOLEK_SIZE; i++) - molek[i][j] = atom2int(line.at(i).latin1()); + molek[i][j] = atom2int(line.tqat(i).latin1()); } mname = i18n(config.readEntry("Name", I18N_NOOP("Noname")).latin1()); @@ -103,12 +103,12 @@ void Molek::load (const KSimpleConfig& config) height++; width++; - repaint (); + tqrepaint (); } void Molek::paintEvent( TQPaintEvent * ) { - TQString st = i18n("Level: %1").arg(level); + TQString st = i18n("Level: %1").tqarg(level); TQPainter paint (this); paint.setPen (TQColor (190, 190, 190)); diff --git a/katomic/molek.h b/katomic/molek.h index 354cf49b..4100fe46 100644 --- a/katomic/molek.h +++ b/katomic/molek.h @@ -20,12 +20,13 @@ class KSimpleConfig; #define MOLEK_SIZE 15 -class Molek : public QWidget +class Molek : public TQWidget { Q_OBJECT + TQ_OBJECT public: - Molek (TQWidget *parent=0, const char *name=0); + Molek (TQWidget *tqparent=0, const char *name=0); ~Molek (); void load(const KSimpleConfig& config); diff --git a/katomic/toplevel.cpp b/katomic/toplevel.cpp index bb9613f2..e2d9e745 100644 --- a/katomic/toplevel.cpp +++ b/katomic/toplevel.cpp @@ -1,6 +1,6 @@ /* toplevel.cpp - Copyright (C) 1998 Andreas Wüst (AndreasWuest@gmx.de) + Copyright (C) 1998 Andreas W�st (AndreasWuest@gmx.de) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,27 +40,27 @@ extern Options settings; void AtomTopLevel::createMenu() { - KAction *act = KStdGameAction::highscores(main, TQT_SLOT(showHighscores()), actionCollection()); + KAction *act = KStdGameAction::highscores(TQT_TQOBJECT(main), TQT_SLOT(showHighscores()), actionCollection()); act->setText(i18n("Show &Highscores")); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); - KStdGameAction::restart(main, TQT_SLOT(restartLevel()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + KStdGameAction::restart(TQT_TQOBJECT(main), TQT_SLOT(restartLevel()), actionCollection()); - KStdAction::preferences(this, TQT_SLOT(configopts()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(configopts()), actionCollection()); - undoAction = KStdGameAction::undo (main, TQT_SLOT(doUndo()), actionCollection()); - redoAction = KStdGameAction::redo (main, TQT_SLOT(doRedo()), actionCollection()); + undoAction = KStdGameAction::undo (TQT_TQOBJECT(main), TQT_SLOT(doUndo()), actionCollection()); + redoAction = KStdGameAction::redo (TQT_TQOBJECT(main), TQT_SLOT(doRedo()), actionCollection()); undoAction->setEnabled(false); redoAction->setEnabled(false); 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, 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("Atom Up"), Key_Up, TQT_TQOBJECT(main), TQT_SLOT(moveUp()), actionCollection(), "atom_up"); + new KAction(i18n("Atom Down"), Key_Down, TQT_TQOBJECT(main), TQT_SLOT(moveDown()), actionCollection(), "atom_down"); + new KAction(i18n("Atom Left"), Key_Left, TQT_TQOBJECT(main), TQT_SLOT(moveLeft()), actionCollection(), "atom_left"); + new KAction(i18n("Atom Right"), Key_Right, TQT_TQOBJECT(main), TQT_SLOT(moveRight()), actionCollection(), "atom_right"); - 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"); + new KAction(i18n("Next Atom"), Key_Tab, TQT_TQOBJECT(main), TQT_SLOT(nextAtom()), actionCollection(), "next_atom"); + new KAction(i18n("Previous Atom"), SHIFT+Key_Tab, TQT_TQOBJECT(main), TQT_SLOT(previousAtom()), actionCollection(), "prev_atom"); } void AtomTopLevel::configopts() diff --git a/katomic/toplevel.h b/katomic/toplevel.h index 38c613d0..6a62a3a2 100644 --- a/katomic/toplevel.h +++ b/katomic/toplevel.h @@ -24,6 +24,7 @@ class KConfig; class AtomTopLevel : public KMainWindow { Q_OBJECT + TQ_OBJECT public: diff --git a/kbackgammon/engines/fibs/kbgfibs.cpp b/kbackgammon/engines/fibs/kbgfibs.cpp index 4e7fd2f4..1492ad2c 100644 --- a/kbackgammon/engines/fibs/kbgfibs.cpp +++ b/kbackgammon/engines/fibs/kbgfibs.cpp @@ -81,7 +81,7 @@ void KBgEngineFIBS::start() // == configuration handling =================================================== /* - * Restore settings and ask children to do the same + * Restore settings and ask tqchildren to do the same */ void KBgEngineFIBS::readConfig() { @@ -110,7 +110,7 @@ void KBgEngineFIBS::readConfig() autoMsg[MsgLos] = config->readEntry("msg-los", ""); autoMsg[MsgWin] = config->readEntry("msg-win", ""); - // ask the children to read their config options + // ask the tqchildren to read their config options playerlist->readConfig(); chatWindow->readConfig(); } @@ -145,7 +145,7 @@ void KBgEngineFIBS::saveConfig() config->writeEntry("msg-los", autoMsg[MsgLos]); config->writeEntry("msg-win", autoMsg[MsgWin]); - // ask the children to read their config options + // ask the tqchildren to read their config options playerlist->saveConfig(); chatWindow->saveConfig(); } @@ -343,7 +343,7 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) 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)); + "if you do not have flat-rate Internet access.").tqarg(PROG_NAME)); cbk->setChecked(keepalive); @@ -357,7 +357,7 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) tc->addTab(w, i18n("&Connection")); /* - * Ask children for settings + * Ask tqchildren for settings */ chatWindow->getSetupPages(tc, nb->spacingHint()); playerlist->getSetupPages(tc, nb->spacingHint()); @@ -380,7 +380,7 @@ void KBgEngineFIBS::cancelJoin(const TQString &info) TQRegExp patt = TQRegExp("^" + info + " "); for (int i = 0; i <= numJoin; i++) { - if (actJoin[i]->text().contains(patt)) { + if (actJoin[i]->text().tqcontains(patt)) { // move all entries starting at i+1 up by one... for (int j = i; j < numJoin; j++) actJoin[j]->setText(actJoin[j+1]->text()); @@ -426,33 +426,33 @@ void KBgEngineFIBS::changeJoin(const TQString &info) for (TQStringList::Iterator it = invitations.begin(); it != invitations.end(); ++it) { - if ((*it).contains(patt)) { + if ((*it).tqcontains(patt)) { TQString text, menu; - if ((*it).contains(TQRegExp(" r$"))) { - menu = i18n("R means resume", "%1 (R)").arg(name); + if ((*it).tqcontains(TQRegExp(" r$"))) { + menu = i18n("R means resume", "%1 (R)").tqarg(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); + "'join %4').").tqarg(name).tqarg(expi_s).tqarg(rate_s).tqarg(name); KNotifyClient::event("invitation", i18n("%1 wants to resume a saved match with you"). arg(name)); - } else if ((*it).contains(TQRegExp(" u$"))) { - menu = i18n("U means unlimited", "%1 (U)").arg(name); + } else if ((*it).tqcontains(TQRegExp(" u$"))) { + menu = i18n("U means unlimited", "%1 (U)").tqarg(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 " - "'join %4').").arg(name).arg(expi_s).arg(rate_s).arg(name); + "'join %4').").tqarg(name).tqarg(expi_s).tqarg(rate_s).tqarg(name); KNotifyClient::event("invitation", i18n("%1 has invited you to an unlimited match"). arg(name)); } else { 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); + "%1 (%2)").tqarg(name).tqarg(len); text = i18n("%1 (experience %2, rating %3) wants to play a %4 point match with you. " "If you want to play, use the corresponding menu entry to join (or type " - "'join %5').").arg(name).arg(expi_s).arg(rate_s).arg(len).arg(name); + "'join %5').").tqarg(name).tqarg(expi_s).tqarg(rate_s).tqarg(len).tqarg(name); KNotifyClient::event("invitation", i18n("%1 has invited you for a %2 point match"). - arg(name).arg(len)); + tqarg(name).tqarg(len)); } emit serverString("rawwho " + name); // this avoids a race if (whoisInvite) { @@ -493,7 +493,7 @@ void KBgEngineFIBS::changeJoin(const TQString &info) */ void KBgEngineFIBS::keepAlive() { - emit serverString("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + emit serverString("ABCDEFGHIJKLMNOPTQRSTUVWXYZ"); } /* @@ -578,8 +578,8 @@ void KBgEngineFIBS::done() emit allowCommand(Roll, false); // Transform the string to FIBS cormat - lastMove.replace(0, 2, "move "); - lastMove.replace(pat[PlsChar], "-"); + lastMove.tqreplace(0, 2, "move "); + lastMove.tqreplace(pat[PlsChar], "-"); // sent it to the server emit serverString(lastMove); @@ -642,7 +642,7 @@ bool KBgEngineFIBS::queryClose() if (connection->state() == TQSocket::Idle) return true; - switch (KMessageBox::warningYesNoCancel((TQWidget *)parent(),i18n("Still connected. Log out first?"),TQString::null,i18n("Log Out"), i18n("Stay Connected"))) { + switch (KMessageBox::warningYesNoCancel((TQWidget *)tqparent(),i18n("Still connected. Log out first?"),TQString(),i18n("Log Out"), i18n("Stay Connected"))) { case KMessageBox::Yes : disconnectFIBS(); return true; @@ -731,7 +731,7 @@ void KBgEngineFIBS::away() bool ret; TQString msg = KLineEditDlg::getText(i18n("Please type the message that should be displayed to other\n" "users while you are away."), - lastAway, &ret, (TQWidget *)parent()); + lastAway, &ret, (TQWidget *)tqparent()); if (ret) { lastAway = msg; emit serverString("away " + msg); @@ -809,7 +809,7 @@ void KBgEngineFIBS::load() */ void KBgEngineFIBS::join(const TQString &msg) { - emit serverString("join " + msg.left(msg.find('('))); + emit serverString("join " + msg.left(msg.tqfind('('))); } void KBgEngineFIBS::join_0() { join(actJoin[0]->text()); } void KBgEngineFIBS::join_1() { join(actJoin[1]->text()); } @@ -877,7 +877,7 @@ void KBgEngineFIBS::connectFIBS() /* * Connect */ - emit infoText(i18n("Looking up %1").arg(infoFIBS[FIBSHost])); + emit infoText(i18n("Looking up %1").tqarg(infoFIBS[FIBSHost])); connection->connectToHost(infoFIBS[FIBSHost], infoFIBS[FIBSPort].toUShort()); return; @@ -888,7 +888,7 @@ void KBgEngineFIBS::connectFIBS() */ void KBgEngineFIBS::hostFound() { - emit infoText(i18n("Connecting to %1").arg(infoFIBS[FIBSHost])); + emit infoText(i18n("Connecting to %1").tqarg(infoFIBS[FIBSHost])); } /* @@ -947,7 +947,7 @@ void KBgEngineFIBS::connected() /* * Initialize the rx state machine */ - rxStatus = RxConnect; + rxtqStatus = RxConnect; rxCollect = ""; /* @@ -992,7 +992,7 @@ void KBgEngineFIBS::newAccount() if (!queryConnection(true)) return; - rxStatus = RxNewLogin; + rxtqStatus = RxNewLogin; rxCollect = ""; login = false; connectFIBS(); @@ -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, (TQWidget *)parent()); + infoFIBS[FIBSHost], &ret, (TQWidget *)tqparent()); 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, (TQWidget *)parent()); + infoFIBS[FIBSPort], &ret, (TQWidget *)tqparent()); if (ret) infoFIBS[FIBSPort] = msg; @@ -1077,24 +1077,24 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) text = i18n("Enter the login you would like to use on the server %1. The login may not\n" "contain spaces or colons. If the login you choose is not available, you'll later be\n" - "given the opportunity to pick another one.\n\n").arg(infoFIBS[FIBSHost]); + "given the opportunity to pick another one.\n\n").tqarg(infoFIBS[FIBSHost]); else text = i18n("Enter your login on the server %1. If you don't have a login, you\n" - "should create one using the corresponding menu option.\n\n").arg(infoFIBS[FIBSHost]); + "should create one using the corresponding menu option.\n\n").tqarg(infoFIBS[FIBSHost]); first = true; do { msg = (KLineEditDlg::getText(text, infoFIBS[FIBSUser], &ret, - (TQWidget *)parent())).stripWhiteSpace(); + (TQWidget *)tqparent())).stripWhiteSpace(); if (first) { text += i18n("The login may not contain spaces or colons!"); first = false; } - } while (ret && (msg.isEmpty() || msg.contains(' ') || msg.contains(':'))); + } while (ret && (msg.isEmpty() || msg.tqcontains(' ') || msg.tqcontains(':'))); if (ret) infoFIBS[FIBSUser] = msg; @@ -1107,12 +1107,12 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) text = i18n("Enter the password you would like to use with the login %1\n" "on the server %2. It may not contain colons.\n\n"). - arg(infoFIBS[FIBSUser]).arg(infoFIBS[FIBSHost]); + tqarg(infoFIBS[FIBSUser]).tqarg(infoFIBS[FIBSHost]); else text = i18n("Enter the password for the login %1 on the server %2.\n\n"). - arg(infoFIBS[FIBSUser]).arg(infoFIBS[FIBSHost]); + tqarg(infoFIBS[FIBSUser]).tqarg(infoFIBS[FIBSHost]); first = true; do { @@ -1130,7 +1130,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) first = false; } - } while (ret && (msg.isEmpty() || msg.contains(' ') || msg.contains(':'))); + } while (ret && (msg.isEmpty() || msg.tqcontains(' ') || msg.tqcontains(':'))); if (ret) infoFIBS[FIBSPswd] = msg; @@ -1234,7 +1234,7 @@ void KBgEngineFIBS::initPattern() 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[KeepAlv] = TQRegExp("^\\*\\* Unknown command: 'ABCDEFGHIJKLMNOPTQRSTUVWXYZ'"); 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\\.$"); @@ -1281,15 +1281,15 @@ void KBgEngineFIBS::handleServerData(TQString &line) /* * Fix-up any HTML-like tags in the line */ - line.replace(pat[HTML_lt], "<"); - line.replace(pat[HTML_gt], ">"); + line.tqreplace(pat[HTML_lt], "<"); + line.tqreplace(pat[HTML_gt], ">"); /* * FIBS sometimes sends tabs, where it should send 8 spaces... */ - line.replace(pat[TabChar], " "); + line.tqreplace(pat[TabChar], " "); - switch (rxStatus) { + switch (rxtqStatus) { case RxConnect: handleMessageConnect(line, rawline); @@ -1344,8 +1344,8 @@ void KBgEngineFIBS::handleServerData(TQString &line) void KBgEngineFIBS::handleMessageWhois(const TQString &line) { rxCollect += "
    " + line; - if (line.contains(pat[WhoisE1]) || line.contains(pat[WhoisE2])) { - rxStatus = RxNormal; + if (line.tqcontains(pat[WhoisE1]) || line.tqcontains(pat[WhoisE2])) { + rxtqStatus = RxNormal; emit infoText("" + rxCollect + "
"); } } @@ -1356,9 +1356,9 @@ void KBgEngineFIBS::handleMessageWhois(const TQString &line) void KBgEngineFIBS::handleMessageRating(const TQString &line) { rxCollect += "
" + line; - if (line.contains(pat[EndRate]) && ++rxCount == 2) { + if (line.tqcontains(pat[EndRate]) && ++rxCount == 2) { emit infoText("" + rxCollect + "
"); - rxStatus = RxNormal; + rxtqStatus = RxNormal; } } @@ -1367,8 +1367,8 @@ void KBgEngineFIBS::handleMessageRating(const TQString &line) */ void KBgEngineFIBS::handleMessageMotd(const TQString &line) { - if (line.contains(pat[MotdEnd])) { - rxStatus = RxNormal; + if (line.tqcontains(pat[MotdEnd])) { + rxtqStatus = RxNormal; emit infoText("
" + rxCollect + "
"); /* * just to be on the safe side, we set the value of boardstyle. @@ -1378,9 +1378,9 @@ void KBgEngineFIBS::handleMessageMotd(const TQString &line) emit serverString("set boardstyle 3"); } else { TQString tline = line; - tline.replace(pat[BoxHori], "

"); - tline.replace(pat[BoxVer1], ""); - tline.replace(pat[BoxVer2], ""); + tline.tqreplace(pat[BoxHori], "

"); + tline.tqreplace(pat[BoxVer1], ""); + tline.tqreplace(pat[BoxVer2], ""); rxCollect += "
" + tline; } } @@ -1393,14 +1393,14 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r /* * Two possibilities: either we are logged in or we sent bad password/login */ - if (line.contains("login:")) { + if (line.tqcontains("login:")) { /* * This can only happen if the password/login is wrong. */ if (rxCollect.isEmpty()) { - rxStatus = RxIgnore; + rxtqStatus = RxIgnore; int ret = KMessageBox::warningContinueCancel - ((TQWidget *)parent(), i18n("There was a problem with " + ((TQWidget *)tqparent(), i18n("There was a problem with " "your login and password. " "You can reenter\n" "your login and password and " @@ -1411,9 +1411,9 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r infoFIBS[FIBSUser] = ""; infoFIBS[FIBSPswd] = ""; login = true; - connectFIBS(); // will reset the rxStatus + connectFIBS(); // will reset the rxtqStatus } else { - rxStatus = RxConnect; + rxtqStatus = RxConnect; emit serverString(""); emit serverString(""); } @@ -1428,14 +1428,14 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r * Ok, we are logged in! Now receive personal information. These * are completely useless but what the heck. */ - if (line.contains(pat[Welcome])) { + if (line.tqcontains(pat[Welcome])) { char p[3][256]; time_t tmp; // 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) { 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()); + TQString text = i18n("%1, last logged in from %2 at %3.").tqarg(p[1]).tqarg(p[2]).tqarg(d.toString()); emit infoText("

" + text); playerlist->setName(p[1]); } @@ -1471,9 +1471,9 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r * p[3] - timezone * */ - if (line.contains(pat[OwnInfo])) { + if (line.tqcontains(pat[OwnInfo])) { - rxStatus = RxNormal; + rxtqStatus = RxNormal; int fibsOptions[NumFIBSOpt]; @@ -1537,8 +1537,8 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r /* * The beginning of a new login procedure starts starts here */ - if (line.contains(pat[OneName])) { - rxStatus = RxNewLogin; + if (line.tqcontains(pat[OneName])) { + rxtqStatus = RxNewLogin; emit infoText(TQString("") + rxCollect + ""); rxCollect = ""; TQString tmp = rawline; @@ -1560,26 +1560,26 @@ void KBgEngineFIBS::handleMessageNewLogin(const TQString &line) /* * Request the new login */ - if (line.contains(pat[OneName])) { + if (line.tqcontains(pat[OneName])) { emit serverString(TQString("name ") + infoFIBS[FIBSUser]); return; } /* * Ooops, user name already exists */ - if (line.contains(pat[OthrNam])) { + if (line.tqcontains(pat[OthrNam])) { TQString text = i18n("The selected login is alreay in use! Please select another one."); bool ret, first = true; TQString msg; do { msg = (KLineEditDlg::getText(text, infoFIBS[FIBSUser], &ret, - (TQWidget *)parent())).stripWhiteSpace(); + (TQWidget *)tqparent())).stripWhiteSpace(); if (first) { text += i18n("\n\nThe login may not contain spaces or colons!"); first = false; } - } while (msg.contains(' ') || msg.contains(':')); + } while (msg.tqcontains(' ') || msg.tqcontains(':')); if (ret) { infoFIBS[FIBSUser] = msg; @@ -1592,28 +1592,28 @@ void KBgEngineFIBS::handleMessageNewLogin(const TQString &line) /* * first time we send the password */ - if (line.contains(pat[YourNam])) { + if (line.tqcontains(pat[YourNam])) { emit serverString(infoFIBS[FIBSPswd]); return; } /* * second time we send the password */ - if (line.contains(pat[GivePwd])) { + if (line.tqcontains(pat[GivePwd])) { emit serverString(infoFIBS[FIBSPswd]); return; } /* * at this point we are done creating the account */ - if (line.contains(pat[RetypeP])) { + if (line.tqcontains(pat[RetypeP])) { 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]); + "playing backgammon on FIBS.").tqarg(infoFIBS[FIBSUser]); emit infoText("

" + text + "

"); emit serverString("bye"); - rxStatus = RxNormal; + rxtqStatus = RxNormal; rxCollect = ""; return; } @@ -1632,7 +1632,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * For now, the waves are ignored. They should probably go into * the chat window -- but only optional */ - if (line.contains(pat[OneWave]) || line.contains(pat[TwoWave]) || line.contains(pat[YouWave])) { + if (line.tqcontains(pat[OneWave]) || line.tqcontains(pat[TwoWave]) || line.tqcontains(pat[YouWave])) { return; } @@ -1642,8 +1642,8 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * ever gets a games window, they should be in there. For now, they * are ignored. */ - else if (line.contains(pat[GameBG1]) || line.contains(pat[GameBG2]) || line.contains(pat[GameRE1]) || - line.contains(pat[GameRE2]) || line.contains(pat[GameEnd])) { + else if (line.tqcontains(pat[GameBG1]) || line.tqcontains(pat[GameBG2]) || line.tqcontains(pat[GameRE1]) || + line.tqcontains(pat[GameRE2]) || line.tqcontains(pat[GameEnd])) { return; } @@ -1651,7 +1651,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Artefact caused by the login test procedure utilized. */ - else if (line.contains(pat[NoLogin])) { + else if (line.tqcontains(pat[NoLogin])) { return; } @@ -1659,7 +1659,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Connection keep-alive response */ - else if (line.contains(pat[KeepAlv])) { + else if (line.tqcontains(pat[KeepAlv])) { return; } @@ -1670,10 +1670,10 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * Chat and personal messages - note that the chat window sends these messages * back to us so we can display them if the user wants that. */ - else if (line.contains(pat[ChatSay]) || line.contains(pat[ChatSht]) || line.contains(pat[ChatWis]) || - line.contains(pat[ChatKib]) || line.contains(pat[SelfSay]) || line.contains(pat[SelfSht]) || - line.contains(pat[SelfWis]) || line.contains(pat[SelfKib]) || line.contains(pat[SelfSlf]) || - line.contains(pat[MsgPers]) || line.contains(pat[MsgDeli]) || line.contains(pat[MsgSave])) { + else if (line.tqcontains(pat[ChatSay]) || line.tqcontains(pat[ChatSht]) || line.tqcontains(pat[ChatWis]) || + line.tqcontains(pat[ChatKib]) || line.tqcontains(pat[SelfSay]) || line.tqcontains(pat[SelfSht]) || + line.tqcontains(pat[SelfWis]) || line.tqcontains(pat[SelfKib]) || line.tqcontains(pat[SelfSlf]) || + line.tqcontains(pat[MsgPers]) || line.tqcontains(pat[MsgDeli]) || line.tqcontains(pat[MsgSave])) { emit chatMessage(line); return; @@ -1684,12 +1684,12 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Beginning of games. In all these cases we are playing and not watching. */ - else if (line.contains(pat[MatchB1]) || line.contains(pat[MatchB2])) { + else if (line.tqcontains(pat[MatchB1]) || line.tqcontains(pat[MatchB2])) { if (useAutoMsg[MsgBeg] && !autoMsg[MsgBeg].stripWhiteSpace().isEmpty()) emit serverString("kibitz " + autoMsg[MsgBeg]); } - else if (line.contains(pat[MatchB3]) || line.contains(pat[MatchB4])) { + else if (line.tqcontains(pat[MatchB3]) || line.tqcontains(pat[MatchB4])) { if (useAutoMsg[MsgBeg] && !autoMsg[MsgBeg].stripWhiteSpace().isEmpty()) emit serverString("kibitz " + autoMsg[MsgBeg]); @@ -1702,7 +1702,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * The help should be handled separately. A fairly complete implementation of a * help parsing can be found in KFibs. */ - else if (line.contains(pat[HelpTxt])) { + else if (line.tqcontains(pat[HelpTxt])) { // do nothing } @@ -1712,12 +1712,12 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Simple cases without the need for many comments... */ - else if (line.contains(pat[RawBord])) { + else if (line.tqcontains(pat[RawBord])) { /* * Save the board string and create a new game state */ - KBgStatus *st = new KBgStatus(currBoard = rawline); + KBgtqStatus *st = new KBgtqStatus(currBoard = rawline); /* * Save important state data and stop the timeout @@ -1736,15 +1736,15 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * Update the caption string */ if (st->turn() < 0) - caption = i18n("%1 (%2) vs. %3 (%4) - game over").arg(pname[US]). - arg(st->points(US)).arg(pname[THEM]).arg(st->points(THEM)); + caption = i18n("%1 (%2) vs. %3 (%4) - game over").tqarg(pname[US]). + tqarg(st->points(US)).tqarg(pname[THEM]).tqarg(st->points(THEM)); else if (st->length() < 0) - caption = i18n("%1 (%2) vs. %3 (%4) - unlimited match").arg(pname[US]). - arg(st->points(US)).arg(pname[THEM]).arg(st->points(THEM)); + caption = i18n("%1 (%2) vs. %3 (%4) - unlimited match").tqarg(pname[US]). + tqarg(st->points(US)).tqarg(pname[THEM]).tqarg(st->points(THEM)); else - caption = i18n("%1 (%2) vs. %3 (%4) - %5 point match").arg(pname[US]). - arg(st->points(US)).arg(pname[THEM]).arg(st->points(THEM)). - arg(st->length()); + caption = i18n("%1 (%2) vs. %3 (%4) - %5 point match").tqarg(pname[US]). + tqarg(st->points(US)).tqarg(pname[THEM]).tqarg(st->points(THEM)). + tqarg(st->length()); emit statText(caption); @@ -1766,7 +1766,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) return; } - else if (line.contains(pat[PlsMove]) || line.contains(pat[YouMove])) { + else if (line.tqcontains(pat[PlsMove]) || line.tqcontains(pat[YouMove])) { KNotifyClient::event("move", i18n("Please make your move")); @@ -1777,15 +1777,15 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Being away and coming back */ - else if (line.contains(pat[YouAway])) { + else if (line.tqcontains(pat[YouAway])) { - emit changePlayerStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, true); + emit changePlayertqStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, true); actBack->setEnabled(true); line += "
  
" + i18n("(or use the corresponding menu entry to join the match)"); } - else if (line.contains(pat[YouBack])) { + else if (line.tqcontains(pat[YouBack])) { - emit changePlayerStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, false); + emit changePlayertqStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, false); actBack->setEnabled(false); actAway->setEnabled(true); } @@ -1795,7 +1795,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Catch the response of the user responding to double or resign */ - else if (line.contains(pat[YouGive]) || line.contains(pat[RejCont]) || line.contains(pat[AcptWin])) { + else if (line.tqcontains(pat[YouGive]) || line.tqcontains(pat[RejCont]) || line.tqcontains(pat[AcptWin])) { actAccept->setEnabled(false); actReject->setEnabled(false); @@ -1806,20 +1806,20 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Catch the responses to newly set toggles */ - else if (line.contains(pat[GreedyY]) || line.contains(pat[GreedyN])) { + else if (line.tqcontains(pat[GreedyY]) || line.tqcontains(pat[GreedyN])) { - fibsOpt[OptGreedy]->setChecked(line.contains(pat[GreedyY])); + fibsOpt[OptGreedy]->setChecked(line.tqcontains(pat[GreedyY])); line = "" + line + ""; } - else if (line.contains(pat[DoubleY]) || line.contains(pat[DoubleN])) { + else if (line.tqcontains(pat[DoubleY]) || line.tqcontains(pat[DoubleN])) { - fibsOpt[OptDouble]->setChecked(line.contains(pat[DoubleY])); + fibsOpt[OptDouble]->setChecked(line.tqcontains(pat[DoubleY])); line = "" + line + ""; } - else if (line.contains(pat[RatingY]) || line.contains(pat[RatingN])) { + else if (line.tqcontains(pat[RatingY]) || line.tqcontains(pat[RatingN])) { - fibsOpt[OptRatings]->setChecked(line.contains(pat[RatingY])); + fibsOpt[OptRatings]->setChecked(line.tqcontains(pat[RatingY])); line = "" + line + ""; } @@ -1828,7 +1828,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * It's our turn to roll or double */ - else if (line.contains(pat[YouTurn]) || line.contains(pat[YouRoll])) { + else if (line.tqcontains(pat[YouTurn]) || line.tqcontains(pat[YouRoll])) { emit allowCommand(Cube, playing); emit allowCommand(Roll, playing); @@ -1843,17 +1843,17 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Got an invitation for a match */ - else if (line.contains(pat[Invite0]) || line.contains(pat[Invite2]) || line.contains(pat[Invite3])) { + else if (line.tqcontains(pat[Invite0]) || line.tqcontains(pat[Invite2]) || line.tqcontains(pat[Invite3])) { - rxCollect = rawline.left(rawline.find(' ')); + rxCollect = rawline.left(rawline.tqfind(' ')); emit serverString("rawwho " + rxCollect); - if (line.contains(pat[Invite0])) { - rawline.replace(pat[Invite1], ""); - rawline = rxCollect + " "+ rawline.left(rawline.find(' ')); - } else if (line.contains(pat[Invite2])) { + if (line.tqcontains(pat[Invite0])) { + rawline.tqreplace(pat[Invite1], ""); + rawline = rxCollect + " "+ rawline.left(rawline.tqfind(' ')); + } else if (line.tqcontains(pat[Invite2])) { rawline = rxCollect + " r"; - } else if (line.contains(pat[Invite3])) { + } else if (line.tqcontains(pat[Invite3])) { invitations += rxCollect + " u"; } invitations += rawline; @@ -1862,24 +1862,24 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) // - rx status changes ------------------------------------------------------------ - else if (line.contains(pat[WhoisBG])) { - rxStatus = RxWhois; + else if (line.tqcontains(pat[WhoisBG])) { + rxtqStatus = RxWhois; rxCollect = TQString("
") + line + ""; return; } - else if (line.contains(pat[MotdBeg])) { - rxStatus = RxMotd; + else if (line.tqcontains(pat[MotdBeg])) { + rxtqStatus = RxMotd; rxCollect = ""; return; } - else if (line.contains(pat[BegRate])) { - rxStatus = RxRating; + else if (line.tqcontains(pat[BegRate])) { + rxtqStatus = RxRating; rxCount = 0; rxCollect = "
" + line; return; } - else if (line.contains(pat[Goodbye])) { - rxStatus = RxGoodbye; + else if (line.tqcontains(pat[Goodbye])) { + rxtqStatus = RxGoodbye; rxCollect = "


"; handleServerData(rawline); // danger: recursion! return; @@ -1893,7 +1893,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Continue a mutli game match? We have to either leave or continue */ - else if (line.contains(pat[ConLeav])) { + else if (line.tqcontains(pat[ConLeav])) { actConti->setEnabled(true); actLeave->setEnabled(true); line.append("
  
" + i18n("(or use the corresponding menu " @@ -1902,9 +1902,9 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Beginning and end of user updates */ - else if (line.contains(pat[WhoInfo])) { - rawline.replace(pat[WhoInfo], ""); - if (rawline.contains(TQRegExp("^" + infoFIBS[FIBSUser] + " "))) { + else if (line.tqcontains(pat[WhoInfo])) { + rawline.tqreplace(pat[WhoInfo], ""); + if (rawline.tqcontains(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); @@ -1913,7 +1913,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) emit fibsWhoInfo(rawline); return; } - else if (line.contains(pat[WhoEnde])) { + else if (line.tqcontains(pat[WhoEnde])) { emit fibsWhoEnd(); return; } @@ -1921,43 +1921,43 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * This message is ignored. The instruction is given elsewhere (and slightly * delayed in the flow of time). */ - if (line.contains(pat[TypJoin])) { + if (line.tqcontains(pat[TypJoin])) { return; } /* * Watching other players */ - else if (line.contains(pat[BegWtch])) { + else if (line.tqcontains(pat[BegWtch])) { emit allowCommand(Load, true); - rawline.replace(pat[BegWtch], ""); + rawline.tqreplace(pat[BegWtch], ""); rawline.truncate(rawline.length()-1); emit fibsStartNewGame(rawline); load(); } - else if (line.contains(pat[EndWtch])) { + else if (line.tqcontains(pat[EndWtch])) { emit gameOver(); } /* * Blinding of players, the actual blind is handled by * the player list */ - else if (line.contains(pat[BegBlnd])) { - rawline.replace(pat[BegBlnd], ""); + else if (line.tqcontains(pat[BegBlnd])) { + rawline.tqreplace(pat[BegBlnd], ""); rawline.truncate(rawline.length()-1); - emit changePlayerStatus(rawline, KFibsPlayerList::Blind, true); + emit changePlayertqStatus(rawline, KFibsPlayerList::Blind, true); line = "" + line + ""; } - else if (line.contains(pat[EndBlnd])) { - rawline.replace(pat[EndBlnd], ""); + else if (line.tqcontains(pat[EndBlnd])) { + rawline.tqreplace(pat[EndBlnd], ""); rawline.truncate(rawline.length()-1); - emit changePlayerStatus(rawline, KFibsPlayerList::Blind, false); + emit changePlayertqStatus(rawline, KFibsPlayerList::Blind, false); line = "" + line + ""; } /* * Starting or reloading games or matches */ - else if (line.contains(pat[BegGame])) { - rawline.replace(pat[BegGame], ""); + else if (line.tqcontains(pat[BegGame])) { + rawline.tqreplace(pat[BegGame], ""); rawline.truncate(rawline.length()-1); emit fibsStartNewGame(rawline); fibsOpt[OptDouble]->setChecked(true); @@ -1965,9 +1965,9 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) actConti->setEnabled(false); actLeave->setEnabled(false); } - else if (line.contains(pat[Reload1])) { - rawline.replace(pat[Reload1], ""); - rawline = rawline.left(rawline.find(' ')); + else if (line.tqcontains(pat[Reload1])) { + rawline.tqreplace(pat[Reload1], ""); + rawline = rawline.left(rawline.tqfind(' ')); rawline.truncate(rawline.length()-1); emit fibsStartNewGame(rawline); fibsOpt[OptDouble]->setChecked(true); @@ -1976,8 +1976,8 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) actLeave->setEnabled(false); load(); } - else if (line.contains(pat[Reload2])) { - rawline.replace(pat[Reload2], ""); + else if (line.tqcontains(pat[Reload2])) { + rawline.tqreplace(pat[Reload2], ""); emit fibsStartNewGame(rawline); fibsOpt[OptDouble]->setChecked(true); fibsOpt[OptGreedy]->setChecked(false); @@ -1989,7 +1989,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * Opponent offered resignation or the cube. We have to accept * or reject the offer. */ - else if (line.contains(pat[RejAcpt])) { + else if (line.tqcontains(pat[RejAcpt])) { actAccept->setEnabled(true); actReject->setEnabled(true); line += "
  
" + i18n("(or use the corresponding menu " @@ -1999,10 +1999,10 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * This is strange: FIBS seems to not send a newline at the * end of this pattern. So we work around that. */ - else if (line.contains(pat[YouAcpt])) { + else if (line.tqcontains(pat[YouAcpt])) { actAccept->setEnabled(false); actReject->setEnabled(false); - rawline.replace(pat[YouAcpt], ""); + rawline.tqreplace(pat[YouAcpt], ""); line.truncate(line.length()-rawline.length()); if (!rawline.stripWhiteSpace().isEmpty()) { handleServerData(rawline); @@ -2011,7 +2011,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Ending of games */ - else if (line.contains(pat[EndLose])) { + else if (line.tqcontains(pat[EndLose])) { if (playing) { KNotifyClient::event("game over l", i18n("Sorry, you lost the game.")); if (useAutoMsg[MsgLos] && !autoMsg[MsgLos].stripWhiteSpace().isEmpty()) @@ -2019,7 +2019,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) } emit gameOver(); } - else if (line.contains(pat[EndVict])) { + else if (line.tqcontains(pat[EndVict])) { if (playing) { KNotifyClient::event("game over w", i18n("Congratulations, you won the game!")); if (useAutoMsg[MsgWin] && !autoMsg[MsgWin].stripWhiteSpace().isEmpty()) @@ -2027,24 +2027,24 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) } emit gameOver(); } - else if (line.contains(pat[GameSav])) { + else if (line.tqcontains(pat[GameSav])) { emit gameOver(); } /* * User logs out. This has to be signalled to the player * list. Get the true user names by working on the rawline. */ - else if (line.contains(pat[UserLot])) { - rawline.replace(pat[UserLot], ""); - emit fibsLogout(rawline.left(rawline.find(' '))); + else if (line.tqcontains(pat[UserLot])) { + rawline.tqreplace(pat[UserLot], ""); + emit fibsLogout(rawline.left(rawline.tqfind(' '))); return; } /* * Emit the name of the newly logged in user. */ - else if (line.contains(pat[UserLin])) { - rawline.replace(pat[UserLin], ""); - emit fibsLogin(rawline.left(rawline.find(' '))); + else if (line.tqcontains(pat[UserLin])) { + rawline.tqreplace(pat[UserLin], ""); + emit fibsLogin(rawline.left(rawline.tqfind(' '))); return; } /* @@ -2052,11 +2052,11 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * the 'boardstyle' variable, since we will not be able to display * the board properly without it. */ - else if (line.contains(pat[BoardSY])) { + else if (line.tqcontains(pat[BoardSY])) { // ignored return; } - else if (line.contains(pat[BoardSN])) { + else if (line.tqcontains(pat[BoardSN])) { emit serverString("set boardstyle 3"); emit infoText(TQString("
") + i18n("You should never set the 'boardstyle' variable " @@ -2071,7 +2071,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * hasn't been processed, make it red, since it is a server resp. * to something we just did. */ - else if (line.contains(pat[TwoStar])) { + else if (line.tqcontains(pat[TwoStar])) { line = "" + line + ""; } @@ -2091,13 +2091,13 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Constructor */ -KBgEngineFIBS::KBgEngineFIBS(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) - : KBgEngine(parent, name, pmenu) +KBgEngineFIBS::KBgEngineFIBS(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu) + : KBgEngine(tqparent, name, pmenu) { /* * No connection, not playing, ready for login */ - connection = new TQSocket(parent, "fibs connection"); + connection = new TQSocket(TQT_TQOBJECT(tqparent), "fibs connection"); playing = false; login = true; @@ -2128,8 +2128,8 @@ KBgEngineFIBS::KBgEngineFIBS(TQWidget *parent, TQString *name, TQPopupMenu *pmen 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(this, TQT_SIGNAL(changePlayertqStatus(const TQString &, int, bool)), + playerlist, TQT_SLOT(changePlayertqStatus(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 &))); diff --git a/kbackgammon/engines/fibs/kbgfibs.h b/kbackgammon/engines/fibs/kbgfibs.h index b46ae3a2..d044c642 100644 --- a/kbackgammon/engines/fibs/kbgfibs.h +++ b/kbackgammon/engines/fibs/kbgfibs.h @@ -60,13 +60,14 @@ class KToggleAction; class KBgEngineFIBS : public KBgEngine { Q_OBJECT + TQ_OBJECT public: /** * Constructor */ - KBgEngineFIBS(TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); + KBgEngineFIBS(TQWidget *tqparent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); /** * Destructor @@ -174,7 +175,7 @@ signals: void fibsConnectionClosed(); - void changePlayerStatus(const TQString &, int, bool); + void changePlayertqStatus(const TQString &, int, bool); void chatMessage(const TQString &msg); @@ -198,7 +199,7 @@ private: TQString currBoard, caption; - //KBgStatus *currBoard + //KBgtqStatus *currBoard //KBgFIBSBoard *boardHandler; TQStringList invitations; @@ -399,10 +400,10 @@ protected slots: protected: - enum RxStatus {RxIgnore, RxConnect, RxWhois, RxMotd, RxRating, + enum RxtqStatus {RxIgnore, RxConnect, RxWhois, RxMotd, RxRating, RxNewLogin, RxGoodbye, RxNormal}; - int rxStatus, rxCount; + int rxtqStatus, rxCount; TQString rxCollect; diff --git a/kbackgammon/engines/fibs/kbgfibschat.cpp b/kbackgammon/engines/fibs/kbgfibschat.cpp index 7b34bae0..c1eca59d 100644 --- a/kbackgammon/engines/fibs/kbgfibschat.cpp +++ b/kbackgammon/engines/fibs/kbgfibschat.cpp @@ -63,7 +63,7 @@ * Private utility class that might become more generally useful in * the future. Basically, it implements rich text TQListBox items. */ -class KLBT : public QListBoxText +class KLBT : public TQListBoxText { public: @@ -71,10 +71,10 @@ public: /* * Constructor */ - KLBT(TQWidget *parent, const TQString &text = TQString::null, const TQString &player = TQString::null) + KLBT(TQWidget *tqparent, const TQString &text = TQString(), const TQString &player = TQString()) : TQListBoxText(text) { - w = parent; + w = tqparent; n = new TQString(player); t = new TQSimpleRichText(text, w->font()); @@ -123,7 +123,7 @@ protected: */ virtual void paint(TQPainter *p) { - t->draw(p, 1, 1, TQRegion(p->viewport()), w->colorGroup()); + t->draw(p, 1, 1, TQRegion(p->viewport()), w->tqcolorGroup()); } private: @@ -189,18 +189,18 @@ public: /* * Constructor of the chat window. */ -KBgChat::KBgChat(TQWidget *parent, const char *name) - : KChat(parent, false) +KBgChat::KBgChat(TQWidget *tqparent, const char *name) + : KChat(tqparent, false) { d = new KBgChatPrivate(); KActionCollection* actions = new KActionCollection(this); - d->mName[0] = TQString::null; + d->mName[0] = TQString(); d->mChat = 0; d->mInvt = new TQPopupMenu(); setAutoAddMessages(false); // we get an echo from FIBS - setFromNickname(i18n("%1 user").arg(PROG_NAME)); + setFromNickname(i18n("%1 user").tqarg(PROG_NAME)); if (!addSendingEntry(i18n("Kibitz to watchers and players"), CLIP_YOU_KIBITZ)) kdDebug(10500) << "adding kibitz" << endl; @@ -233,31 +233,31 @@ KBgChat::KBgChat(TQWidget *parent, const char *name) d->mAct[KBgChatPrivate::Inquire] = new KAction(i18n("Info On"), TQIconSet(kapp->iconLoader()->loadIcon( "help.xpm", KIcon::Small)), - 0, this, TQT_SLOT(slotInquire()), actions); + 0, TQT_TQOBJECT(this), TQT_SLOT(slotInquire()), actions); d->mAct[KBgChatPrivate::Talk] = new KAction(i18n("Talk To"), TQIconSet(kapp->iconLoader()->loadIcon( PROG_NAME "-chat.png", KIcon::Small)), - 0, this, TQT_SLOT(slotTalk()), actions); + 0, TQT_TQOBJECT(this), TQT_SLOT(slotTalk()), actions); - d->mAct[KBgChatPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, this, + d->mAct[KBgChatPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInviteD()), actions); - d->mAct[KBgChatPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, this, + d->mAct[KBgChatPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite1()), actions); - d->mAct[KBgChatPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, this, + d->mAct[KBgChatPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite2()), actions); - d->mAct[KBgChatPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, this, + d->mAct[KBgChatPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite3()), actions); - d->mAct[KBgChatPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, this, + d->mAct[KBgChatPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite4()), actions); - d->mAct[KBgChatPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, this, + d->mAct[KBgChatPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite5()), actions); - d->mAct[KBgChatPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, this, + d->mAct[KBgChatPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite6()), actions); - d->mAct[KBgChatPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, this, + d->mAct[KBgChatPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite7()), actions); - d->mAct[KBgChatPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, this, + d->mAct[KBgChatPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInviteU()), actions); - d->mAct[KBgChatPrivate::InviteR] = new KAction(i18n("Resume"), 0, this, + d->mAct[KBgChatPrivate::InviteR] = new KAction(i18n("Resume"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInviteR()), actions); d->mAct[KBgChatPrivate::InviteD]->plug(d->mInvt); @@ -277,13 +277,13 @@ KBgChat::KBgChat(TQWidget *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, 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); + d->mAct[KBgChatPrivate::Gag] = new KAction(i18n("Gag"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotGag()), actions); + d->mAct[KBgChatPrivate::Ungag] = new KAction(i18n("Ungag"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotUngag()), actions); + d->mAct[KBgChatPrivate::Cleargag] = new KAction(i18n("Clear Gag List"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotCleargag()), actions); + d->mAct[KBgChatPrivate::Copy] = KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(slotCopy()), actions); + d->mAct[KBgChatPrivate::Clear] = new KAction(i18n("Clear"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotClear()), actions); + d->mAct[KBgChatPrivate::Close] = KStdAction::close(TQT_TQOBJECT(this), TQT_SLOT(hide()), actions); + d->mAct[KBgChatPrivate::Silent] = new KToggleAction(i18n("Silent"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotSilent()), actions); } @@ -416,7 +416,7 @@ void KBgChat::setupDefault() /* * Overloaded member to create a TQListBoxItem for the chat window. */ -TQListBoxItem* KBgChat::layoutMessage(const TQString& fromName, const TQString& text) +TQListBoxItem* KBgChat::tqlayoutMessage(const TQString& fromName, const TQString& text) { TQListBoxText* message = new KLBT(this, text, fromName); return message; @@ -446,11 +446,11 @@ void KBgChat::hideEvent(TQHideEvent *e) */ void KBgChat::startGame(const TQString &name) { - int *id = d->mName2ID->find(d->mName[1] = name); + int *id = d->mName2ID->tqfind(d->mName[1] = name); if (!id) { id = new int(nextId()); d->mName2ID->insert(name, id); - addSendingEntry(i18n("Talk to %1").arg(name), *id); + addSendingEntry(i18n("Talk to %1").tqarg(name), *id); } setSendingEntry(CLIP_YOU_KIBITZ); } @@ -460,7 +460,7 @@ void KBgChat::startGame(const TQString &name) */ void KBgChat::endGame() { - int *id = d->mName2ID->find(d->mName[1]); + int *id = d->mName2ID->tqfind(d->mName[1]); if (id) setSendingEntry(*id); else @@ -472,11 +472,11 @@ void KBgChat::endGame() */ void KBgChat::fibsTalk(const TQString &name) { - int *id = d->mName2ID->find(name); + int *id = d->mName2ID->tqfind(name); if (!id) { id = new int(nextId()); d->mName2ID->insert(name, id); - addSendingEntry(i18n("Talk to %1").arg(name), *id); + addSendingEntry(i18n("Talk to %1").tqarg(name), *id); } setSendingEntry(*id); } @@ -486,7 +486,7 @@ void KBgChat::fibsTalk(const TQString &name) */ void KBgChat::deletePlayer(const TQString &name) { - int *id = d->mName2ID->find(name); + int *id = d->mName2ID->tqfind(name); if (id) { removeSendingEntry(*id); d->mName2ID->remove(name); @@ -535,21 +535,21 @@ void KBgChat::handleCommand(int id, const TQString& msg) */ void KBgChat::handleData(const TQString &msg) { - TQString clip = msg.left(msg.find(' ')), user, cMsg = msg; + TQString clip = msg.left(msg.tqfind(' ')), user, cMsg = msg; TQDateTime date; bool flag = false; int cmd = clip.toInt(&flag); if (flag) { - cMsg.replace(0, cMsg.find(' ')+1, ""); + cMsg.tqreplace(0, cMsg.tqfind(' ')+1, ""); - user = cMsg.left(cMsg.find(' ')); + user = cMsg.left(cMsg.tqfind(' ')); switch (cmd) { case CLIP_SAYS: - if (!d->mGag.contains(user)) { - cMsg = i18n("%1 tells you: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); + if (!d->mGag.tqcontains(user)) { + cMsg = i18n("%1 tells you: %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); } else @@ -557,16 +557,16 @@ void KBgChat::handleData(const TQString &msg) break; case CLIP_SHOUTS: - if ((!((KToggleAction *)d->mAct[KBgChatPrivate::Silent])->isChecked()) && (!d->mGag.contains(user))) { - cMsg = i18n("%1 shouts: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); + if ((!((KToggleAction *)d->mAct[KBgChatPrivate::Silent])->isChecked()) && (!d->mGag.tqcontains(user))) { + cMsg = i18n("%1 shouts: %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; } else cMsg = ""; break; case CLIP_WHISPERS: - if (!d->mGag.contains(user)) { - cMsg = i18n("%1 whispers: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); + if (!d->mGag.tqcontains(user)) { + cMsg = i18n("%1 whispers: %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); } else @@ -574,8 +574,8 @@ void KBgChat::handleData(const TQString &msg) break; case CLIP_KIBITZES: - if (!d->mGag.contains(user)) { - cMsg = i18n("%1 kibitzes: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); + if (!d->mGag.tqcontains(user)) { + cMsg = i18n("%1 kibitzes: %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); } else @@ -583,56 +583,56 @@ void KBgChat::handleData(const TQString &msg) break; case CLIP_YOU_SAY: - cMsg = i18n("You tell %1: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); + cMsg = i18n("You tell %1: %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = TQString::null; + user = TQString(); break; case CLIP_YOU_SHOUT: - cMsg = i18n("You shout: %1").arg(cMsg); + cMsg = i18n("You shout: %1").tqarg(cMsg); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = TQString::null; + user = TQString(); break; case CLIP_YOU_WHISPER: - cMsg = i18n("You whisper: %1").arg(cMsg); + cMsg = i18n("You whisper: %1").tqarg(cMsg); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = TQString::null; + user = TQString(); break; case CLIP_YOU_KIBITZ: - cMsg = i18n("You kibitz: %1").arg(cMsg); + cMsg = i18n("You kibitz: %1").tqarg(cMsg); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = TQString::null; + user = TQString(); break; case CLIP_MESSAGE: - user = cMsg.left(cMsg.find(' ')+1); - cMsg.remove(0, cMsg.find(' ')+1); - date.setTime_t(cMsg.left(cMsg.find(' ')+1).toUInt()); - cMsg.remove(0, cMsg.find(' ')); - cMsg = i18n("User %1 left a message at %2: %3").arg(user).arg(date.toString()).arg(cMsg); + user = cMsg.left(cMsg.tqfind(' ')+1); + cMsg.remove(0, cMsg.tqfind(' ')+1); + date.setTime_t(cMsg.left(cMsg.tqfind(' ')+1).toUInt()); + cMsg.remove(0, cMsg.tqfind(' ')); + cMsg = i18n("User %1 left a message at %2: %3").tqarg(user).tqarg(date.toString()).tqarg(cMsg); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = TQString::null; + user = TQString(); break; case CLIP_MESSAGE_DELIVERED: - cMsg = i18n("Your message for %1 has been delivered.").arg(user); + cMsg = i18n("Your message for %1 has been delivered.").tqarg(user); cMsg = TQString("") + cMsg + ""; emit personalMessage(cMsg); - user = TQString::null; + user = TQString(); break; case CLIP_MESSAGE_SAVED: - cMsg = i18n("Your message for %1 has been saved.").arg(user); + cMsg = i18n("Your message for %1 has been saved.").tqarg(user); cMsg = TQString("") + cMsg + ""; emit personalMessage(cMsg); - user = TQString::null; + user = TQString(); break; default: // ignore the message @@ -644,8 +644,8 @@ void KBgChat::handleData(const TQString &msg) /* * Special treatment for non-CLIP messages */ - if (cMsg.contains(TQRegExp("^You say to yourself: "))) { - cMsg.replace(TQRegExp("^You say to yourself: "), + if (cMsg.tqcontains(TQRegExp("^You say to yourself: "))) { + cMsg.tqreplace(TQRegExp("^You say to yourself: "), i18n("You say to yourself: ")); } else { kdDebug(user.isNull(), 10500) << "KBgChat::handleData unhandled message: " @@ -667,10 +667,10 @@ void KBgChat::handleData(const TQString &msg) void KBgChat::contextMenu(TQListBoxItem *i, const TQPoint &p) { /* - * Even if i is non-null, user might still be TQString::null + * Even if i is non-null, user might still be TQString() */ - d->mName[0] = (i == 0) ? TQString::null : ((KLBT *)i)->player(); - d->mText = (i == 0) ? TQString::null : ((KLBT *)i)->text(); + d->mName[0] = (i == 0) ? TQString() : ((KLBT *)i)->player(); + d->mText = (i == 0) ? TQString() : ((KLBT *)i)->text(); /* * Get a new context menu every time. Safe to delete the 0 @@ -683,22 +683,22 @@ void KBgChat::contextMenu(TQListBoxItem *i, const TQPoint &p) */ if (!d->mName[0].isNull()) { - d->mAct[KBgChatPrivate::Talk]->setText(i18n("Talk to %1").arg(d->mName[0])); + d->mAct[KBgChatPrivate::Talk]->setText(i18n("Talk to %1").tqarg(d->mName[0])); d->mAct[KBgChatPrivate::Talk]->plug(d->mChat); - d->mAct[KBgChatPrivate::Inquire]->setText(i18n("Info on %1").arg(d->mName[0])); + d->mAct[KBgChatPrivate::Inquire]->setText(i18n("Info on %1").tqarg(d->mName[0])); d->mAct[KBgChatPrivate::Inquire]->plug(d->mChat); // invite menu is always the same - d->mChat->insertItem(i18n("Invite %1").arg(d->mName[0]), d->mInvt); + d->mChat->insertItem(i18n("Invite %1").tqarg(d->mName[0]), d->mInvt); d->mChat->insertSeparator(); - if (d->mGag.contains(d->mName[0]) <= 0) { - d->mAct[KBgChatPrivate::Gag]->setText(i18n("Gag %1").arg(d->mName[0])); + if (d->mGag.tqcontains(d->mName[0]) <= 0) { + d->mAct[KBgChatPrivate::Gag]->setText(i18n("Gag %1").tqarg(d->mName[0])); d->mAct[KBgChatPrivate::Gag]->plug(d->mChat); } else { - d->mAct[KBgChatPrivate::Ungag]->setText(i18n("Ungag %1").arg(d->mName[0])); + d->mAct[KBgChatPrivate::Ungag]->setText(i18n("Ungag %1").tqarg(d->mName[0])); d->mAct[KBgChatPrivate::Ungag]->plug(d->mChat); } } @@ -730,7 +730,7 @@ void KBgChat::slotCleargag() msg += i18n("The gag list is now empty."); msg += "
"; - addMessage(TQString::null, msg); + addMessage(TQString(), msg); } /* @@ -741,10 +741,10 @@ void KBgChat::slotGag() d->mGag.append(d->mName[0]); TQString msg(""); - msg += i18n("You won't hear what %1 says and shouts.").arg(d->mName[0]); + msg += i18n("You won't hear what %1 says and shouts.").tqarg(d->mName[0]); msg += ""; - addMessage(TQString::null, msg); + addMessage(TQString(), msg); } /* @@ -763,10 +763,10 @@ void KBgChat::slotUngag() d->mGag.remove(d->mName[0]); TQString msg(""); - msg += i18n("You will again hear what %1 says and shouts.").arg(d->mName[0]); + msg += i18n("You will again hear what %1 says and shouts.").tqarg(d->mName[0]); msg += ""; - addMessage(TQString::null, msg); + addMessage(TQString(), msg); } /* @@ -788,7 +788,7 @@ void KBgChat::slotSilent() msg = "" + i18n("You will not hear what people shout.") + ""; else msg = "" + i18n("You will hear what people shout.") + ""; - addMessage(TQString::null, msg); + addMessage(TQString(), msg); } /* @@ -797,10 +797,10 @@ void KBgChat::slotSilent() */ void KBgChat::slotCopy() { - d->mText.replace(TQRegExp(""), ""); - d->mText.replace(TQRegExp(""), ""); - d->mText.replace(TQRegExp(""), ""); - d->mText.replace(TQRegExp("^.*\">"), ""); + d->mText.tqreplace(TQRegExp(""), ""); + d->mText.tqreplace(TQRegExp(""), ""); + d->mText.tqreplace(TQRegExp(""), ""); + d->mText.tqreplace(TQRegExp("^.*\">"), ""); kapp->clipboard()->setText(d->mText); } diff --git a/kbackgammon/engines/fibs/kbgfibschat.h b/kbackgammon/engines/fibs/kbgfibschat.h index 5e1fefa4..7dc0cfaf 100644 --- a/kbackgammon/engines/fibs/kbgfibschat.h +++ b/kbackgammon/engines/fibs/kbgfibschat.h @@ -55,13 +55,14 @@ class KBgChatPrivate; class KBgChat : public KChat { Q_OBJECT + TQ_OBJECT public: /** * Constructor */ - KBgChat(TQWidget *parent = 0, const char *name = 0); + KBgChat(TQWidget *tqparent = 0, const char *name = 0); /** * Destructor @@ -170,7 +171,7 @@ protected: * Create a custom ListBoxItem that contains a formated string * for the chat window. */ - virtual TQListBoxItem* layoutMessage(const TQString& fromName, const TQString& text); + virtual TQListBoxItem* tqlayoutMessage(const TQString& fromName, const TQString& text); protected slots: diff --git a/kbackgammon/engines/fibs/kbginvite.cpp b/kbackgammon/engines/fibs/kbginvite.cpp index f43c3b6a..666ba4c5 100644 --- a/kbackgammon/engines/fibs/kbginvite.cpp +++ b/kbackgammon/engines/fibs/kbginvite.cpp @@ -75,7 +75,7 @@ KBgInvite::KBgInvite(const char *name) hLine->setFrameStyle(TQFrame::Sunken|TQFrame::HLine); /* - * Set up layouts + * Set up tqlayouts */ TQBoxLayout *vbox = new TQVBoxLayout(this); @@ -103,9 +103,9 @@ KBgInvite::KBgInvite(const char *name) * Adjust widget sizes and resize the dialog */ KDialog::resizeLayout(this, marginHint(), spacingHint()); - setMinimumSize(childrenRect().size()); + setMinimumSize(tqchildrenRect().size()); vbox->activate(); - resize(minimumSize()); + resize(tqminimumSize()); /* * Set focus and default buttons diff --git a/kbackgammon/engines/fibs/kbginvite.h b/kbackgammon/engines/fibs/kbginvite.h index 7bc5f3f7..4c33b169 100644 --- a/kbackgammon/engines/fibs/kbginvite.h +++ b/kbackgammon/engines/fibs/kbginvite.h @@ -46,6 +46,7 @@ class KBgInvitePrivate; class KBgInvite : public KDialog { Q_OBJECT + TQ_OBJECT public: diff --git a/kbackgammon/engines/fibs/kplayerlist.cpp b/kbackgammon/engines/fibs/kplayerlist.cpp index 06b724e5..a928de7e 100644 --- a/kbackgammon/engines/fibs/kplayerlist.cpp +++ b/kbackgammon/engines/fibs/kplayerlist.cpp @@ -79,7 +79,7 @@ public: /* * Constructor */ - KFibsPlayerListLVI(KFibsPlayerList *parent) : KListViewItem(parent) { _plist = parent; } + KFibsPlayerListLVI(KFibsPlayerList *tqparent) : KListViewItem(tqparent) { _plist = tqparent; } /* * Destructor @@ -101,7 +101,7 @@ public: case KFibsPlayerList::Watches: case KFibsPlayerList::Client: case KFibsPlayerList::Email: - case KFibsPlayerList::Status: + case KFibsPlayerList::tqStatus: case KFibsPlayerList::Host: s = s.lower(); break; @@ -175,7 +175,7 @@ public: /* * Short abbreviations for Blind, Ready, and Away. */ - TQString mAbrv[KFibsPlayerList::MaxStatus]; + TQString mAbrv[KFibsPlayerList::MaxtqStatus]; /* * Name of the last selected player - for internal purposes @@ -200,8 +200,8 @@ public: /* * Construct the playerlist and do some initial setup */ -KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) - : KListView(parent, name) +KFibsPlayerList::KFibsPlayerList(TQWidget *tqparent, const char *name) + : KListView(tqparent, name) { d = new KFibsPlayerListPrivate(); KActionCollection* actions = new KActionCollection(this); @@ -218,7 +218,7 @@ KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) d->mCol[Player]->name = i18n("Player"); d->mCol[Opponent]->name = i18n("Opponent"); d->mCol[Watches]->name = i18n("Watches"); - d->mCol[Status]->name = i18n("Status"); + d->mCol[tqStatus]->name = i18n("tqStatus"); d->mCol[Rating]->name = i18n("Rating"); d->mCol[Experience]->name = i18n("Exp."); d->mCol[Idle]->name = i18n("Idle"); @@ -231,7 +231,7 @@ KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) d->mCol[Player]->key = "player"; d->mCol[Opponent]->key = "opponent"; d->mCol[Watches]->key = "watches"; - d->mCol[Status]->key = "status"; + d->mCol[tqStatus]->key = "status"; d->mCol[Rating]->key = "rating"; d->mCol[Experience]->key = "experience"; d->mCol[Idle]->key = "idle"; @@ -246,7 +246,7 @@ KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) d->mAbrv[Away ] = i18n("abreviate away", "A"); d->mAbrv[Ready] = i18n("abreviate ready", "R"); - d->mName = TQString::null; + d->mName = TQString(); d->mWatch = false; @@ -289,41 +289,41 @@ KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) d->mAct[KFibsPlayerListPrivate::Info] = new KAction(i18n("Info"), TQIconSet(kapp->iconLoader()->loadIcon ("help.xpm", KIcon::Small)), - 0, this, TQT_SLOT(slotInfo()), actions); + 0, TQT_TQOBJECT(this), TQT_SLOT(slotInfo()), actions); d->mAct[KFibsPlayerListPrivate::Talk] = new KAction(i18n("Talk"), TQIconSet(kapp->iconLoader()->loadIcon (PROG_NAME "-chat.png", KIcon::Small)), - 0, this, TQT_SLOT(slotTalk()), actions); + 0, TQT_TQOBJECT(this), TQT_SLOT(slotTalk()), 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::Look] = new KAction(i18n("Look"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotLook()), actions); + d->mAct[KFibsPlayerListPrivate::Watch] = new KAction(i18n("Watch"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotWatch()), actions); + d->mAct[KFibsPlayerListPrivate::Unwatch] = new KAction(i18n("Unwatch"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotUnwatch()),actions); + d->mAct[KFibsPlayerListPrivate::BlindAct] = new KAction(i18n("Blind"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotBlind()), actions); + d->mAct[KFibsPlayerListPrivate::Update] = new KAction(i18n("Update"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotUpdate()), 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::Reload] = KStdAction::redisplay(TQT_TQOBJECT(this), TQT_SLOT(slotReload()), actions); + d->mAct[KFibsPlayerListPrivate::Mail] = KStdAction::mail(TQT_TQOBJECT(this), TQT_SLOT(slotMail()), actions); + d->mAct[KFibsPlayerListPrivate::Close] = KStdAction::close(TQT_TQOBJECT(this), TQT_SLOT(hide()), actions); - d->mAct[KFibsPlayerListPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, this, + d->mAct[KFibsPlayerListPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInviteD()), actions); - d->mAct[KFibsPlayerListPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite1()), actions); - d->mAct[KFibsPlayerListPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite2()), actions); - d->mAct[KFibsPlayerListPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite3()), actions); - d->mAct[KFibsPlayerListPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite4()), actions); - d->mAct[KFibsPlayerListPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite5()), actions); - d->mAct[KFibsPlayerListPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite6()), actions); - d->mAct[KFibsPlayerListPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite7()), actions); - d->mAct[KFibsPlayerListPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, this, + d->mAct[KFibsPlayerListPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInviteU()), actions); - d->mAct[KFibsPlayerListPrivate::InviteR] = new KAction(i18n("Resume"), 0, this, + d->mAct[KFibsPlayerListPrivate::InviteR] = new KAction(i18n("Resume"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInviteR()), actions); /* @@ -469,7 +469,7 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space) gl = new TQGridLayout(gbl, LVEnd, 2, 20); gl->addWidget(lb, 0, 0); - // two column layout.... + // two column tqlayout.... for (i = 1; i < LVEnd/2; i++) { gl->addWidget(d->mCol[2*i-1]->cb, i, 0); gl->addWidget(d->mCol[2*i ]->cb, i, 1); @@ -483,7 +483,7 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space) */ nb->addTab(w, i18n("&Playerlist")); - connect(nb, TQT_SIGNAL(applyButtonPressed()), this, TQT_SLOT(setupOk())); + connect(nb, TQT_SIGNAL(applyButtonPressed()), TQT_TQOBJECT(this), TQT_SLOT(setupOk())); } /* @@ -567,14 +567,14 @@ void KFibsPlayerList::showContextMenu(KListView *, TQListViewItem *i, const TQPo /* * Get the name of the selected player */ - d->mUser = (i ? i->text(Player) : TQString::null); + d->mUser = (i ? i->text(Player) : TQString()); - d->mAct[KFibsPlayerListPrivate::Info ]->setText(i18n("Info on %1" ).arg(d->mUser)); - d->mAct[KFibsPlayerListPrivate::Talk ]->setText(i18n("Talk to %1" ).arg(d->mUser)); - d->mAct[KFibsPlayerListPrivate::Mail ]->setText(i18n("Email to %1").arg(d->mUser)); - d->mAct[KFibsPlayerListPrivate::Look ]->setText(i18n("Look at %1" ).arg(d->mUser)); - d->mAct[KFibsPlayerListPrivate::Watch ]->setText(i18n("Watch %1" ).arg(d->mUser)); - d->mAct[KFibsPlayerListPrivate::Update]->setText(i18n("Update %1" ).arg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Info ]->setText(i18n("Info on %1" ).tqarg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Talk ]->setText(i18n("Talk to %1" ).tqarg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Mail ]->setText(i18n("Email to %1").tqarg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Look ]->setText(i18n("Look at %1" ).tqarg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Watch ]->setText(i18n("Watch %1" ).tqarg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Update]->setText(i18n("Update %1" ).tqarg(d->mUser)); d->mAct[KFibsPlayerListPrivate::Info ]->setEnabled(i); d->mAct[KFibsPlayerListPrivate::Talk ]->setEnabled(i); @@ -587,15 +587,15 @@ void KFibsPlayerList::showContextMenu(KListView *, TQListViewItem *i, const TQPo d->mAct[KFibsPlayerListPrivate::Unwatch]->setEnabled(d->mWatch); d->mPm[0]->setItemEnabled(d->mInID, i && d->mName != d->mUser); - d->mPm[0]->changeItem(d->mInID, i18n("Invite %1").arg(d->mUser)); + d->mPm[0]->changeItem(d->mInID, i18n("Invite %1").tqarg(d->mUser)); - d->mMail = (i && d->mCol[Email]->show ? i->text(d->mCol[Email]->index) : TQString::null); + d->mMail = (i && d->mCol[Email]->show ? i->text(d->mCol[Email]->index) : TQString()); d->mAct[KFibsPlayerListPrivate::Mail]->setEnabled(!d->mMail.isEmpty()); - if (i && d->mCol[Status]->show) + if (i && d->mCol[tqStatus]->show) d->mAct[KFibsPlayerListPrivate::BlindAct]->setText - ((i->text(d->mCol[Status]->index).contains(d->mAbrv[Blind])) ? - i18n("Unblind %1").arg(d->mUser) : i18n("Blind %1").arg(d->mUser)); + ((i->text(d->mCol[tqStatus]->index).tqcontains(d->mAbrv[Blind])) ? + i18n("Unblind %1").tqarg(d->mUser) : i18n("Blind %1").tqarg(d->mUser)); else d->mAct[KFibsPlayerListPrivate::BlindAct]->setText(i18n("Blind")); @@ -657,7 +657,7 @@ void KFibsPlayerList::slotLook() */ void KFibsPlayerList::slotMail() { - kapp->invokeMailer(d->mMail, TQString::null); + kapp->invokeMailer(d->mMail, TQString()); } /* @@ -721,7 +721,7 @@ void KFibsPlayerList::changePlayer(const TQString &line) TQDateTime fromEpoch; TQString str_entry[LVEnd], tmp; - entry[Status][0] = '\0'; + entry[tqStatus][0] = '\0'; // the line comes from FIBS and is 7 bit ASCII sscanf(line.latin1(), "%99s %99s %99s %1s %1s %99s %99s %99s %99s %99s %99s %99s", entry[Player], entry[Opponent], @@ -738,9 +738,9 @@ void KFibsPlayerList::changePlayer(const TQString &line) if ((str_entry[j] = entry[j]) == "-") str_entry[j] = ""; } - str_entry[Status].replace(Ready, 1, ready[0] == '0' ? "-" : d->mAbrv[Ready]); - str_entry[Status].replace(Away, 1, away [0] == '0' ? "-" : d->mAbrv[Away ]); - str_entry[Status].replace(Blind, 1, "-"); + str_entry[tqStatus].tqreplace(Ready, 1, ready[0] == '0' ? "-" : d->mAbrv[Ready]); + str_entry[tqStatus].tqreplace(Away, 1, away [0] == '0' ? "-" : d->mAbrv[Away ]); + str_entry[tqStatus].tqreplace(Blind, 1, "-"); // disable drawing until the end of update setUpdatesEnabled(false); @@ -758,9 +758,9 @@ void KFibsPlayerList::changePlayer(const TQString &line) i = new KFibsPlayerListLVI(this); // count the KFibs and KBackgammon clients - if (str_entry[Client].contains("KFibs")) + if (str_entry[Client].tqcontains("KFibs")) d->mCount[0]++; - else if (str_entry[Client].contains(PROG_NAME)) + else if (str_entry[Client].tqcontains(PROG_NAME)) d->mCount[1]++; // new entry requires an update to the player count @@ -771,7 +771,7 @@ void KFibsPlayerList::changePlayer(const TQString &line) found: // getting here means the player is in the list - update private status - str_entry[Status].replace(Blind,1,i->text(Status).contains + str_entry[tqStatus].tqreplace(Blind,1,i->text(tqStatus).tqcontains (d->mAbrv[Blind]) ? d->mAbrv[Blind] : "-"); update: @@ -794,9 +794,9 @@ void KFibsPlayerList::deletePlayer(const TQString &player) TQListViewItemIterator it(this); for ( ; it.current(); ++it) { if (it.current()->text(0) == player) { - if (it.current()->text(Client).contains(PROG_NAME)) + if (it.current()->text(Client).tqcontains(PROG_NAME)) --d->mCount[1]; - else if (it.current()->text(Client).contains("KFibs")) + else if (it.current()->text(Client).tqcontains("KFibs")) --d->mCount[0]; delete it.current(); updateCaption(); @@ -808,7 +808,7 @@ void KFibsPlayerList::deletePlayer(const TQString &player) /* * Set/Unset the status stat in the corresponding column of the list */ -void KFibsPlayerList::changePlayerStatus(const TQString &player, int stat, bool flag) +void KFibsPlayerList::changePlayertqStatus(const TQString &player, int stat, bool flag) { TQListViewItem *i = 0; @@ -827,7 +827,7 @@ void KFibsPlayerList::changePlayerStatus(const TQString &player, int stat, bool /* * Update the status flag */ - i->setText(Status, i->text(Status).replace(stat, 1, (flag) ? d->mAbrv[stat] : "-")); + i->setText(tqStatus, i->text(tqStatus).tqreplace(stat, 1, (flag) ? d->mAbrv[stat] : "-")); } @@ -886,7 +886,7 @@ void KFibsPlayerList::setName(const TQString &name) */ void KFibsPlayerList::updateCaption() { - setCaption(i18n("Player List - %1 - %2/%3").arg(childCount()).arg(d->mCount[0]).arg(d->mCount[1])); + setCaption(i18n("Player List - %1 - %2/%3").tqarg(childCount()).tqarg(d->mCount[0]).tqarg(d->mCount[1])); } /* diff --git a/kbackgammon/engines/fibs/kplayerlist.h b/kbackgammon/engines/fibs/kplayerlist.h index 27fd825f..7fe45218 100644 --- a/kbackgammon/engines/fibs/kplayerlist.h +++ b/kbackgammon/engines/fibs/kplayerlist.h @@ -46,24 +46,25 @@ class KFibsPlayerListPrivate; class KFibsPlayerList : public KListView { Q_OBJECT + TQ_OBJECT public: /** * Enumerate player status */ - enum PStatus {Ready, Away, Blind, MaxStatus}; + enum PtqStatus {Ready, Away, Blind, MaxtqStatus}; /** * Enumerate the different columns of the list */ - enum {Player, Opponent, Watches, Status, Rating, Experience, + enum {Player, Opponent, Watches, tqStatus, Rating, Experience, Idle, Time, Host, Client, Email, LVEnd}; /** * Constructor */ - KFibsPlayerList(TQWidget *parent = 0, const char *name = 0); + KFibsPlayerList(TQWidget *tqparent = 0, const char *name = 0); /** * Destructor @@ -110,7 +111,7 @@ public slots: /** * Change the status of a player */ - void changePlayerStatus(const TQString &player, int stat, bool flag); + void changePlayertqStatus(const TQString &player, int stat, bool flag); /** * Fills the playerlist page into the notebook diff --git a/kbackgammon/engines/generic/kbgengine.cpp b/kbackgammon/engines/generic/kbgengine.cpp index 59c19e2f..ac217bd0 100644 --- a/kbackgammon/engines/generic/kbgengine.cpp +++ b/kbackgammon/engines/generic/kbgengine.cpp @@ -31,10 +31,10 @@ /* - * Constructor initializes the QObject + * Constructor initializes the TQObject */ -KBgEngine::KBgEngine(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) - : TQObject(parent, name->local8Bit()) +KBgEngine::KBgEngine(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu) + : TQObject(tqparent, name->local8Bit()) { menu = pmenu; cl = -1; diff --git a/kbackgammon/engines/generic/kbgengine.h b/kbackgammon/engines/generic/kbgengine.h index d254a910..c43b31b5 100644 --- a/kbackgammon/engines/generic/kbgengine.h +++ b/kbackgammon/engines/generic/kbgengine.h @@ -35,7 +35,7 @@ class TQPopupMenu; class KDialogBase; -class KBgStatus; +class KBgtqStatus; /** * @@ -58,16 +58,18 @@ class KBgStatus; * @author Jens Hoefkens * */ -class KBgEngine:public QObject +class KBgEngine:public TQObject { - Q_OBJECT public: + Q_OBJECT + TQ_OBJECT +public: enum Command { Redo, Undo, Roll, Cube, Done, Load }; /** * Constructor */ - KBgEngine (TQWidget * parent = 0, TQString * name = 0, TQPopupMenu * pmenu = 0); + KBgEngine (TQWidget * tqparent = 0, TQString * name = 0, TQPopupMenu * pmenu = 0); /** * Destructor @@ -247,12 +249,12 @@ signals: /** * Emit the most recent game state */ - void newState (const KBgStatus &); + void newState (const KBgtqStatus &); /** * Tell the board that we need the current state of the board. */ - void getState (KBgStatus *); + void getState (KBgtqStatus *); /** * Starts/ends the edit mode of the board diff --git a/kbackgammon/engines/gnubg/kbggnubg.cpp b/kbackgammon/engines/gnubg/kbggnubg.cpp index d17a6f88..e6f853a2 100644 --- a/kbackgammon/engines/gnubg/kbggnubg.cpp +++ b/kbackgammon/engines/gnubg/kbggnubg.cpp @@ -85,7 +85,7 @@ void KBgEngineGNU::handleLine(const TQString &l) /* * Start of a new game/match */ - if (line.contains(TQRegExp("^gnubg rolls [1-6], .* rolls [1-6]\\."))) { + if (line.tqcontains(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 TQString &l) /* * Bug fixes for older versions of GNUBG - to be removed */ - if (line.contains(TQRegExp("^.* cannot move\\..+$"))) { + if (line.tqcontains(TQRegExp("^.* cannot move\\..+$"))) { KRegExp e("(^.* cannot move.)(.*$)"); e.match(line.latin1()); handleLine(e.group(1)); handleLine(e.group(2)); return; } - if (line.contains(TQRegExp("^Are you sure you want to start a new game, and discard the one in progress\\?"))) { + if (line.tqcontains(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,25 +113,25 @@ void KBgEngineGNU::handleLine(const TQString &l) /* * Cube handling */ - if (line.contains(TQRegExp("^gnubg accepts and immediately redoubles to [0-9]+\\.$"))) { + if (line.tqcontains(TQRegExp("^gnubg accepts and immediately redoubles to [0-9]+\\.$"))) { // redoubles mess up the game counter "turn" - //KBgStatus st(board); + //KBgtqStatus st(board); //st.setCube(32, BOTH); //emit newState(st); } - if (line.contains(TQRegExp("^gnubg doubles\\.$"))) { + if (line.tqcontains(TQRegExp("^gnubg doubles\\.$"))) { // TODO: we need some generic class for this. the class // can be shared between all engines #if 0 - KBgStatus st(board); + KBgtqStatus st(board); int ret = KMessageBox::warningYesNoCancel - (0, i18n("gnubg doubles the cube to %1.").arg(2*st.cube(THEM)), + (0, i18n("gnubg doubles the cube to %1.").tqarg(2*st.cube(THEM)), i18n("gnubg doubles"), i18n("&Accept"), i18n("Re&double"), i18n("&Reject"), true); @@ -155,16 +155,16 @@ void KBgEngineGNU::handleLine(const TQString &l) /* * Ignore the following messages */ - if (line.contains(TQRegExp("^TTY boards will be given in raw format"))) { + if (line.tqcontains(TQRegExp("^TTY boards will be given in raw format"))) { line = " "; } /* * Board messages */ - if (line.contains(TQRegExp("^board:"))) { + if (line.tqcontains(TQRegExp("^board:"))) { - KBgStatus st(line); + KBgtqStatus st(line); /* * Do preliminary analysis of board @@ -199,7 +199,7 @@ void KBgEngineGNU::handleLine(const TQString &l) case uMove: st.setDice(THEM, 0, 0); st.setDice(THEM, 1, 0); - emit infoText(i18n("You roll %1 and %2.").arg(st.dice(US, 0)).arg(st.dice(US, 1))); + emit infoText(i18n("You roll %1 and %2.").tqarg(st.dice(US, 0)).tqarg(st.dice(US, 1))); switch (st.moves()) { case 0: // get a message @@ -208,7 +208,7 @@ void KBgEngineGNU::handleLine(const TQString &l) emit infoText(i18n("Please move 1 piece.")); break; default: - emit infoText(i18n("Please move %1 pieces.").arg(st.moves())); + emit infoText(i18n("Please move %1 pieces.").tqarg(st.moves())); break; } emit allowCommand(Roll, false); @@ -220,7 +220,7 @@ void KBgEngineGNU::handleLine(const TQString &l) case tMove: st.setDice(US, 0, 0); st.setDice(US, 1, 0); - emit infoText(i18n("gnubg rolls %1 and %2.").arg(st.dice(THEM, 0)).arg(st.dice(THEM, 1))); + emit infoText(i18n("gnubg rolls %1 and %2.").tqarg(st.dice(THEM, 0)).tqarg(st.dice(THEM, 1))); if (st.moves() == 0) emit infoText(i18n("gnubg cannot move.")); @@ -236,7 +236,7 @@ void KBgEngineGNU::handleLine(const TQString &l) emit allowMoving(st.turn() == US); emit newState(st); - emit statText(i18n("%1 vs. %2").arg(st.player(US)).arg(st.player(THEM))); + emit statText(i18n("%1 vs. %2").tqarg(st.player(US)).tqarg(st.player(THEM))); emit allowCommand(Load, true ); emit allowCommand(Undo, false); @@ -248,7 +248,7 @@ void KBgEngineGNU::handleLine(const TQString &l) /* * Show the line... */ - line.replace(TQRegExp(" "), " "); + line.tqreplace(TQRegExp(" "), " "); if (!line.isEmpty()) emit infoText(line); } @@ -275,10 +275,10 @@ void KBgEngineGNU::newGame() /* * If there is a game running we warn the user first */ - if (gameRunning && (KMessageBox::warningYesNo((TQWidget *)parent(), + if (gameRunning && (KMessageBox::warningYesNo((TQWidget *)tqparent(), i18n("A game is currently in progress. " "Starting a new one will terminate it."), - TQString::null, i18n("Start New Game"), i18n("Continue Old Game")) + TQString(), i18n("Start New Game"), i18n("Continue Old Game")) == KMessageBox::No)) return; @@ -422,8 +422,8 @@ void KBgEngineGNU::saveConfig() /* * Constructor */ -KBgEngineGNU::KBgEngineGNU(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) - : KBgEngine(parent, name, pmenu) +KBgEngineGNU::KBgEngineGNU(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu) + : KBgEngine(tqparent, name, pmenu) { // obsolete nameUS = "US"; @@ -503,7 +503,7 @@ void KBgEngineGNU::startGNU() resAction->setEnabled(false); if (!gnubg.start(KProcess::NotifyOnExit, KProcess::All)) - KMessageBox::information((TQWidget *)parent(), + KMessageBox::information((TQWidget *)tqparent(), i18n("Could not start the GNU Backgammon process.\n" "Make sure the program is in your PATH and is " "called \"gnubg\".\n" @@ -533,7 +533,7 @@ void KBgEngineGNU::gnubgExit(KProcess *proc) emit allowMoving(false); emit infoText(TQString("
") + i18n("The GNU Backgammon process (%1) has exited. ") - .arg(proc->pid()) + "
"); + .tqarg(proc->pid()) + "
"); resAction->setEnabled(true); } @@ -564,12 +564,12 @@ void KBgEngineGNU::nextCommand() TQString s = (*it) + "\n"; if (!gnubg.writeStdin(s.latin1(), strlen(s.latin1()))) { cmdTimer->start(250, true); - cmdList.remove(TQString::null); + cmdList.remove(TQString()); return; } - (*it) = TQString::null; + (*it) = TQString(); } - cmdList.remove(TQString::null); + cmdList.remove(TQString()); cmdTimer->stop(); } @@ -625,9 +625,9 @@ void KBgEngineGNU::done() emit allowCommand(Redo, false); // Transform the string to FIBS format - lastmove.replace(0, 2, "move "); - lastmove.replace(TQRegExp("\\+"), " "); - lastmove.replace(TQRegExp("\\-"), " "); + lastmove.tqreplace(0, 2, "move "); + lastmove.tqreplace(TQRegExp("\\+"), " "); + lastmove.tqreplace(TQRegExp("\\-"), " "); // sent it to the server handleCommand(lastmove); @@ -669,7 +669,7 @@ void KBgEngineGNU::handleMove(TQString *s) lastmove = *s; int index = 0; - TQString t = s->mid(index, s->find(' ', index)); + TQString t = s->mid(index, s->tqfind(' ', index)); index += 1 + t.length(); int moves = t.toInt(); diff --git a/kbackgammon/engines/gnubg/kbggnubg.h b/kbackgammon/engines/gnubg/kbggnubg.h index acb007f1..78b4566e 100644 --- a/kbackgammon/engines/gnubg/kbggnubg.h +++ b/kbackgammon/engines/gnubg/kbggnubg.h @@ -44,13 +44,14 @@ class KBgEngineGNU : public KBgEngine { Q_OBJECT + TQ_OBJECT public: /* * Constructor and destructor */ - KBgEngineGNU(TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); + KBgEngineGNU(TQWidget *tqparent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); virtual ~KBgEngineGNU(); /** diff --git a/kbackgammon/engines/nextgen/kbggame.cpp b/kbackgammon/engines/nextgen/kbggame.cpp index 13ae076a..d00c1966 100644 --- a/kbackgammon/engines/nextgen/kbggame.cpp +++ b/kbackgammon/engines/nextgen/kbggame.cpp @@ -31,15 +31,15 @@ /* * Constructor */ -KBgGame::KBgGame(int cookie, TQObject *parent) - : KGame(cookie, parent) +KBgGame::KBgGame(int cookie, TQObject *tqparent) + : KGame(cookie, tqparent) { // do nothing... } bool KBgGame::playerInput(TQDataStream &msg,KPlayer *player) { - Q_INT32 move; + TQ_INT32 move; msg >> move; cerr << " Player " << player->id() << " moved to " << move << endl; return true; diff --git a/kbackgammon/engines/nextgen/kbggame.h b/kbackgammon/engines/nextgen/kbggame.h index 7888be62..255a3483 100644 --- a/kbackgammon/engines/nextgen/kbggame.h +++ b/kbackgammon/engines/nextgen/kbggame.h @@ -40,12 +40,13 @@ class KPlayer; class KDE_EXPORT KBgGame : public KGame { Q_OBJECT + TQ_OBJECT public: enum MsgID {Text, Cmd, MaxMsg}; - KBgGame(int cookie = 42, TQObject *parent = 0); + KBgGame(int cookie = 42, TQObject *tqparent = 0); protected: diff --git a/kbackgammon/engines/nextgen/kbgng.cpp b/kbackgammon/engines/nextgen/kbgng.cpp index 302cbb58..f2f04066 100644 --- a/kbackgammon/engines/nextgen/kbgng.cpp +++ b/kbackgammon/engines/nextgen/kbgng.cpp @@ -51,8 +51,8 @@ /* * Constructor */ -KBgEngineNg::KBgEngineNg(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) - : KBgEngine(parent, name, pmenu) +KBgEngineNg::KBgEngineNg(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu) + : KBgEngine(tqparent, name, pmenu) { // get a new game initGame(); @@ -124,7 +124,7 @@ void KBgEngineNg::setGame() // initialize a new game bool ret = false; TQString label, port_s, host_s; - Q_UINT16 port; + TQ_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, (TQWidget *)parent()); + port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)tqparent()); if (!ret) return; port = port_s.toUShort(&ret); @@ -150,7 +150,7 @@ void KBgEngineNg::setGame() emit infoText(i18n("Now waiting for incoming connections on port %1."). arg(_port = port)); else - emit infoText(i18n("Failed to offer connections on port %1.").arg(port)); + emit infoText(i18n("Failed to offer connections on port %1.").tqarg(port)); _game->addPlayer(createPlayer(0, _name[0])); break; @@ -159,16 +159,16 @@ 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, (TQWidget *)parent()); + host_s = KLineEditDlg::getText(label, host_s, &ret, (TQWidget *)tqparent()); if (!ret) return; } while (host_s.isEmpty()); label = i18n("Type the port number on %1 you want to connect to.\nThe " - "number should be between 1024 and 65535.").arg(host_s); + "number should be between 1024 and 65535.").tqarg(host_s); port_s.setNum(_port); do { - port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)parent()); + port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)tqparent()); if (!ret) return; port = port_s.toUShort(&ret); @@ -183,10 +183,10 @@ void KBgEngineNg::setGame() _game->addPlayer(createPlayer(0, _name[0])); if (_game->connectToServer(host_s, port)) - emit infoText(i18n("Now connected to %1:%2.").arg(_host = host_s). + emit infoText(i18n("Now connected to %1:%2.").tqarg(_host = host_s). arg(_port = port)); else - emit infoText(i18n("Failed to connect to %1:%2.").arg(_host = host_s). + emit infoText(i18n("Failed to connect to %1:%2.").tqarg(_host = host_s). arg(_port = port)); // @@ -202,13 +202,13 @@ void KBgEngineNg::setGame() // we are still having problems with player creation... - // FIXME - which status _game->setGameStatus(KGame::End); + // FIXME - which status _game->setGametqStatus(KGame::End); } void KBgEngineNg::slotPlayerJoinedGame(KPlayer *p) { - emit infoText(i18n("Player %1 (%2) has joined the game.").arg(p->name()).arg(p->id())); - cerr << i18n("Player %1 (%2) has joined the game.").arg(p->name()).arg(p->id()).latin1() << endl; + emit infoText(i18n("Player %1 (%2) has joined the game.").tqarg(p->name()).tqarg(p->id())); + cerr << i18n("Player %1 (%2) has joined the game.").tqarg(p->name()).tqarg(p->id()).latin1() << endl; } void KBgEngineNg::slotCreatePlayer(KPlayer *&p, int rtti, int io, bool v, KGame *g) @@ -216,16 +216,16 @@ void KBgEngineNg::slotCreatePlayer(KPlayer *&p, int rtti, int io, bool v, KGame Q_UNUSED(rtti) Q_UNUSED(g) Q_UNUSED(io) - emit infoText(i18n("creating player. virtual=%1").arg(v)); + emit infoText(i18n("creating player. virtual=%1").tqarg(v)); p = createPlayer(1); } -void KBgEngineNg::slotClientConnected(Q_UINT32) +void KBgEngineNg::slotClientConnected(TQ_UINT32) { cerr << "client has joint the game..." << endl; } -void KBgEngineNg::slotClientDisconnected(Q_UINT32, bool) +void KBgEngineNg::slotClientDisconnected(TQ_UINT32, bool) { cerr << "KBgEngineNg::slotClientDisconnected" << endl; } @@ -507,7 +507,7 @@ void KBgEngineNg::slotPropertyChanged(KGamePropertyBase *p, KPlayer *me) case KGamePropertyBase::IdName: emit infoText(i18n("Player %1 has changed the name to %2.") - .arg(_name[player]).arg(me->name())); + .tqarg(_name[player]).tqarg(me->name())); _name[player] = me->name(); break; @@ -542,14 +542,14 @@ void KBgEngineNg::changeName() TQString name; for (int i = 0; i < 2; i++) { - name = TQString::null; + name = TQString(); while (!_player[i]->isVirtual() && name.isEmpty()) { if (i == 0) name = KLineEditDlg::getText(i18n("Type the name of the first player:"), - _name[i], &ok, (TQWidget *)parent()); + _name[i], &ok, (TQWidget *)tqparent()); else name = KLineEditDlg::getText(i18n("Type the name of the second player:"), - _name[i], &ok, (TQWidget *)parent()); + _name[i], &ok, (TQWidget *)tqparent()); 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 TQByteArray &msg, Q_UINT32 r, Q_UINT32 s) +void KBgEngineNg::slotNetworkData(int msgid, const TQByteArray &msg, TQ_UINT32 r, TQ_UINT32 s) { Q_UNUSED(r); Q_UNUSED(s); @@ -567,8 +567,8 @@ void KBgEngineNg::slotNetworkData(int msgid, const TQByteArray &msg, Q_UINT32 r, case KBgGame::Cmd: emit infoText(msg); - emit infoText(i18n("Players are %1 and %2").arg(_player[0]->name()) - .arg(_player[1]->name())); + emit infoText(i18n("Players are %1 and %2").tqarg(_player[0]->name()) + .tqarg(_player[1]->name())); break; default: @@ -608,15 +608,15 @@ void KBgEngineNg::initGame() connect(_game, TQT_SIGNAL(signalCreatePlayer(KPlayer *&, int, int, bool, KGame *)), this, TQT_SLOT(slotCreatePlayer(KPlayer *&, int, int, bool, KGame *))); - 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, TQT_SIGNAL(signalClientConnected(TQ_UINT32)), + this, TQT_SLOT(slotClientConnected(TQ_UINT32))); + connect(_game, TQT_SIGNAL(signalClientDisconnected(TQ_UINT32, bool)), + this, TQT_SLOT(slotClientDisconnected(TQ_UINT32, bool))); 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))); + connect(_game, TQT_SIGNAL(signalNetworkData(int,const TQByteArray &, TQ_UINT32, TQ_UINT32)), + this, TQT_SLOT(slotNetworkData(int,const TQByteArray &, TQ_UINT32, TQ_UINT32))); } // EOF diff --git a/kbackgammon/engines/nextgen/kbgng.h b/kbackgammon/engines/nextgen/kbgng.h index 99ea82c1..12c94140 100644 --- a/kbackgammon/engines/nextgen/kbgng.h +++ b/kbackgammon/engines/nextgen/kbgng.h @@ -51,13 +51,14 @@ class KBgEngineNg : public KBgEngine { Q_OBJECT + TQ_OBJECT public: /* * Constructor and destructor */ - KBgEngineNg( TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); + KBgEngineNg( TQWidget *tqparent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); virtual ~KBgEngineNg(); /** @@ -152,11 +153,11 @@ public slots: void slotPlayerJoinedGame(KPlayer *p); - void slotNetworkData(int msgid, const TQByteArray &msg, Q_UINT32 receiver, Q_UINT32 sender); + void slotNetworkData(int msgid, const TQByteArray &msg, TQ_UINT32 receiver, TQ_UINT32 sender); void slotCreatePlayer(KPlayer *&, int, int, bool, KGame *); - void slotClientDisconnected(Q_UINT32, bool); - void slotClientConnected(Q_UINT32); + void slotClientDisconnected(TQ_UINT32, bool); + void slotClientConnected(TQ_UINT32); void slotPropertyChanged(KGamePropertyBase *p, KGame *me); void slotPropertyChanged(KGamePropertyBase *p, KPlayer *me); @@ -220,7 +221,7 @@ private: int _nplayers; TQString _host; - Q_UINT16 _port; + TQ_UINT16 _port; // ************************************************************ // ************************************************************ @@ -244,11 +245,11 @@ private: /** * Create the i-th player. Legal values for i are 0 and 1. The - * name of the player is taken from @ref _name and the parent of + * name of the player is taken from @ref _name and the tqparent of * the player is @ref _player. That means that the players are * automatically deleted. */ - KBgPlayer * createPlayer(int i, TQString name = TQString::null); + KBgPlayer * createPlayer(int i, TQString name = TQString()); private: diff --git a/kbackgammon/engines/nextgen/kbgplayer.h b/kbackgammon/engines/nextgen/kbgplayer.h index 8d6536de..c9fcdb1c 100644 --- a/kbackgammon/engines/nextgen/kbgplayer.h +++ b/kbackgammon/engines/nextgen/kbgplayer.h @@ -41,6 +41,7 @@ class KGame; class KBgPlayer : public KPlayer { Q_OBJECT + TQ_OBJECT public: diff --git a/kbackgammon/engines/offline/kbgoffline.cpp b/kbackgammon/engines/offline/kbgoffline.cpp index 4a9e1755..14197f54 100644 --- a/kbackgammon/engines/offline/kbgoffline.cpp +++ b/kbackgammon/engines/offline/kbgoffline.cpp @@ -60,7 +60,7 @@ public: /* * Store two copies of the game: one backup and a working copy */ - KBgStatus mGame[2]; + KBgtqStatus mGame[2]; /* * Use the standard method of obtaining random numbers @@ -106,8 +106,8 @@ public: /* * Constructor */ -KBgEngineOffline::KBgEngineOffline(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) - : KBgEngine(parent, name, pmenu) +KBgEngineOffline::KBgEngineOffline(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu) + : KBgEngine(tqparent, name, pmenu) { d = new KBgEngineOfflinePrivate(); @@ -282,10 +282,10 @@ void KBgEngineOffline::newGame() /* * If there is a game running we warn the user first */ - if (d->mGameFlag && (KMessageBox::warningYesNo((TQWidget *)parent(), + if (d->mGameFlag && (KMessageBox::warningYesNo((TQWidget *)tqparent(), i18n("A game is currently in progress. " "Starting a new one will terminate it."), - TQString::null, i18n("Start New Game"), + TQString(), i18n("Start New Game"), i18n("Continue Old Game")) == KMessageBox::No)) return; @@ -318,14 +318,14 @@ void KBgEngineOffline::newGame() u = getRandom(); t = getRandom(); emit infoText(i18n("%1 rolls %2, %3 rolls %4."). - arg(d->mName[0]).arg(u).arg(d->mName[1]).arg(t)); + tqarg(d->mName[0]).tqarg(u).tqarg(d->mName[1]).tqarg(t)); } if (u > t) { - emit infoText(i18n("%1 makes the first move.").arg(d->mName[0])); + emit infoText(i18n("%1 makes the first move.").tqarg(d->mName[0])); d->mRoll = US; } else { - emit infoText(i18n("%1 makes the first move.").arg(d->mName[1])); + emit infoText(i18n("%1 makes the first move.").tqarg(d->mName[1])); d->mRoll = THEM; int n = u; u = t; t = n; } @@ -338,7 +338,7 @@ void KBgEngineOffline::newGame() /* * tell the user */ - emit statText(i18n("%1 vs. %2").arg(d->mName[0]).arg(d->mName[1])); + emit statText(i18n("%1 vs. %2").tqarg(d->mName[0]).tqarg(d->mName[1])); } /* @@ -397,7 +397,7 @@ bool KBgEngineOffline::queryPlayerName(int w) } do { - *name = KLineEditDlg::getText(text, *name, &ret, (TQWidget *)parent()); + *name = KLineEditDlg::getText(text, *name, &ret, (TQWidget *)tqparent()); if (!ret) break; } while (name->isEmpty()); @@ -484,7 +484,7 @@ void KBgEngineOffline::redo() void KBgEngineOffline::handleMove(TQString *s) { int index = 0; - TQString t = s->mid(index, s->find(' ', index)); + TQString t = s->mid(index, s->tqfind(' ', index)); index += 1 + t.length(); int moves = t.toInt(); @@ -510,22 +510,22 @@ void KBgEngineOffline::handleMove(TQString *s) */ for (int i = 0; i < moves; i++) { bool kick = false; - t = s->mid(index, s->find(' ', index) - index); + t = s->mid(index, s->tqfind(' ', index) - index); index += 1 + t.length(); char c = '-'; - if (t.contains('+')) { + if (t.tqcontains('+')) { c = '+'; kick = true; } - TQString r = t.left(t.find(c)); - if (r.contains("bar")) { + TQString r = t.left(t.tqfind(c)); + if (r.tqcontains("bar")) { d->mGame[0].setBar(d->mRoll, abs(d->mGame[0].bar(d->mRoll)) - 1); } else { int from = r.toInt(); d->mGame[0].setBoard(from, d->mRoll, abs(d->mGame[0].board(from)) - 1); } t.remove(0, 1 + r.length()); - if (t.contains("off")) { + if (t.tqcontains("off")) { d->mGame[0].setHome(d->mRoll, abs(d->mGame[0].home(d->mRoll)) + 1); } else { int to = t.toInt(); @@ -645,7 +645,7 @@ void KBgEngineOffline::cube() if (d->mRollFlag && d->mGame[0].cube(w) > 0) { emit allowCommand(Cube, false); - if (KMessageBox::questionYesNo((TQWidget *)parent(), + if (KMessageBox::questionYesNo((TQWidget *)tqparent(), 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((TQWidget *)parent(), + switch (KMessageBox::warningContinueCancel((TQWidget *)tqparent(), i18n("In the middle of a game. " - "Really quit?"), TQString::null, KStdGuiItem::quit())) { + "Really quit?"), TQString(), KStdGuiItem::quit())) { case KMessageBox::Continue : return TRUE; case KMessageBox::Cancel : @@ -722,7 +722,7 @@ bool KBgEngineOffline::queryExit() void KBgEngineOffline::handleCommand(const TQString& cmd) { emit infoText(i18n("Text commands are not yet working. " - "The command '%1' has been ignored.").arg(cmd)); + "The command '%1' has been ignored.").tqarg(cmd)); } /* @@ -791,11 +791,11 @@ void KBgEngineOffline::toggleEditMode() emit allowCommand(Roll, false); emit allowCommand(Done, false); emit allowCommand(Cube, false); - emit statText(i18n("%1 vs. %2 - Edit Mode").arg(d->mName[0]).arg(d->mName[1])); + emit statText(i18n("%1 vs. %2 - Edit Mode").tqarg(d->mName[0]).tqarg(d->mName[1])); } else { d->mNew->setEnabled(true); d->mSwap->setEnabled(true); - emit statText(i18n("%1 vs. %2").arg(d->mName[0]).arg(d->mName[1])); + emit statText(i18n("%1 vs. %2").tqarg(d->mName[0]).tqarg(d->mName[1])); emit getState(&d->mGame[1]); d->mGame[0] = d->mGame[1]; emit allowCommand(Done, d->mDoneFlag); diff --git a/kbackgammon/engines/offline/kbgoffline.h b/kbackgammon/engines/offline/kbgoffline.h index 8a6448fb..a0217920 100644 --- a/kbackgammon/engines/offline/kbgoffline.h +++ b/kbackgammon/engines/offline/kbgoffline.h @@ -49,13 +49,14 @@ class KBgEngineOfflinePrivate; class KBgEngineOffline : public KBgEngine { Q_OBJECT + TQ_OBJECT public: /** * Constructor */ - KBgEngineOffline(TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); + KBgEngineOffline(TQWidget *tqparent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); /** * Destructor diff --git a/kbackgammon/kbg.cpp b/kbackgammon/kbg.cpp index 711471ad..0c01d8f1 100644 --- a/kbackgammon/kbg.cpp +++ b/kbackgammon/kbg.cpp @@ -89,7 +89,7 @@ KBg::KBg() /* * The main view is shared between the board and a small text window */ - panner = new TQSplitter(Vertical, this, "panner"); + panner = new TQSplitter(Qt::Vertical, this, "panner"); board = new KBgBoardSetup(panner, "board"); status = new KBgTextView(panner, "status"); setCentralWidget(panner); @@ -97,45 +97,45 @@ KBg::KBg() /* * Create all actions needed by the application */ - newAction = KStdGameAction::gameNew(this, TQT_SLOT(openNew()), actionCollection()); + newAction = KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(openNew()), actionCollection()); newAction->setEnabled(false); - KStdGameAction::print(this, TQT_SLOT(print()), actionCollection()); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdGameAction::print(TQT_TQOBJECT(this), TQT_SLOT(print()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); TQStringList list; for (int i = 0; i < MaxEngine; i++) list.append(engineString[i]); - engineSet = new KSelectAction(i18n("&Engine"), 0, this, TQT_SLOT(setupEngine()), actionCollection(), + engineSet = new KSelectAction(i18n("&Engine"), 0, TQT_TQOBJECT(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, TQT_SLOT(load()), actionCollection(), "move_load"); + loadAction = KStdAction::redisplay(TQT_TQOBJECT(this), TQT_SLOT(load()), actionCollection(), "move_load"); loadAction->setEnabled(false); - undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); + undoAction = KStdGameAction::undo(TQT_TQOBJECT(this), TQT_SLOT(undo()), actionCollection()); undoAction->setEnabled(false); - redoAction = KStdGameAction::redo(this, TQT_SLOT(redo()), actionCollection()); + redoAction = KStdGameAction::redo(TQT_TQOBJECT(this), TQT_SLOT(redo()), actionCollection()); redoAction->setEnabled(false); - rollAction = KStdGameAction::roll(this, TQT_SLOT(roll()), actionCollection()); + rollAction = KStdGameAction::roll(TQT_TQOBJECT(this), TQT_SLOT(roll()), actionCollection()); rollAction->setEnabled(false); - endAction = KStdGameAction::endTurn(this, TQT_SLOT(done()), actionCollection()); + endAction = KStdGameAction::endTurn(TQT_TQOBJECT(this), TQT_SLOT(done()), actionCollection()); endAction->setEnabled(false); cubeAction = new KAction(i18n("Double Cube"), TQIconSet(kapp->iconLoader()->loadIcon (PROG_NAME "-double.xpm", KIcon::Toolbar)), - 0, this, TQT_SLOT(cube()), actionCollection(), "move_cube"); + 0, TQT_TQOBJECT(this), TQT_SLOT(cube()), actionCollection(), "move_cube"); cubeAction->setEnabled(false); - KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); - KStdAction::preferences(this, TQT_SLOT(setupDlg()), actionCollection()); - KStdAction::saveOptions(this, TQT_SLOT(saveConfig()), actionCollection()); + KStdAction::showMenubar(TQT_TQOBJECT(this), TQT_SLOT(toggleMenubar()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(setupDlg()), actionCollection()); + KStdAction::saveOptions(TQT_TQOBJECT(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, TQT_SLOT(wwwFIBS()), + (new KAction(helpTopic[FIBSHome][0], 0, TQT_TQOBJECT(this), TQT_SLOT(wwwFIBS()), actionCollection(), "help_www_fibs"))->plug(p); - (new KAction(helpTopic[RuleHome][0], 0, this, TQT_SLOT(wwwRule()), + (new KAction(helpTopic[RuleHome][0], 0, TQT_TQOBJECT(this), TQT_SLOT(wwwRule()), actionCollection(), "help_www_rule"))->plug(p); /* @@ -145,11 +145,11 @@ KBg::KBg() 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, TQString::null, 0, 0, 0, actionCollection(), "command_lineedit"); + KWidgetAction* actionCmdLine = new KWidgetAction( cmdLine, TQString(), 0, 0, 0, actionCollection(), "command_lineedit"); actionCmdLine->setAutoSized(true); cmdLine->completionObject()->setOrder(KCompletion::Weighted); - connect(cmdLine, TQT_SIGNAL(returnPressed(const TQString &)), this, TQT_SLOT(handleCmd(const TQString &))); + connect(cmdLine, TQT_SIGNAL(returnPressed(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(handleCmd(const TQString &))); /* * Done with the actions, create the XML-defined parts of the * user interface @@ -275,7 +275,7 @@ void KBg::setupEngine() newAction->setEnabled(engine[currEngine]->haveNewGame()); // engine -> this - connect(engine[currEngine], TQT_SIGNAL(statText(const TQString &)), this, TQT_SLOT(updateCaption(const TQString &))); + connect(engine[currEngine], TQT_SIGNAL(statText(const TQString &)), TQT_TQOBJECT(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))); @@ -293,8 +293,8 @@ void KBg::setupEngine() 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 &))); + connect(engine[currEngine], TQT_SIGNAL(getState(KBgtqStatus *)), board, TQT_SLOT(getState(KBgtqStatus *))); + connect(engine[currEngine], TQT_SIGNAL(newState(const KBgtqStatus &)), board, TQT_SLOT(setState(const KBgtqStatus &))); // now that all signals are connected, start the engine engine[currEngine]->start(); @@ -371,8 +371,8 @@ void KBg::readConfig() status->setFont(config->readFontEntry("font", &kappFont)); TQValueList l; - l.append(qRound( config->readDoubleNumEntry("panner", 0.75) *panner->height())); - l.append(qRound((1-config->readDoubleNumEntry("panner", 0.75))*panner->height())); + l.append(tqRound( config->readDoubleNumEntry("panner", 0.75) *panner->height())); + l.append(tqRound((1-config->readDoubleNumEntry("panner", 0.75))*panner->height())); panner->setSizes(l); applyMainWindowSettings(config, "main window"); @@ -421,7 +421,7 @@ void KBg::setupOk() if (cbm->isChecked()) KMessageBox::enableAllMessages(); - // tell children to read their changes + // tell tqchildren to read their changes board->setupOk(); // engines @@ -575,7 +575,7 @@ void KBg::setupDlg() 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()); + lab->setMaximumSize(lab->tqsizeHint()); gle->addWidget(lab, 0, 0); connect(lab, TQT_SIGNAL(leftClickedURL(const TQString &)), TQT_SLOT(startKCM(const TQString &))); @@ -617,12 +617,12 @@ void KBg::setupDlg() */ 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(cancelClicked()), TQT_TQOBJECT(this), TQT_SLOT(setupCancel())); connect(nb, TQT_SIGNAL(defaultClicked()),this, TQT_SLOT(setupDefault())); - connect(nb, TQT_SIGNAL(finished()), this, TQT_SLOT(setupDone())); + connect(nb, TQT_SIGNAL(finished()), TQT_TQOBJECT(this), TQT_SLOT(setupDone())); - nb->resize(nb->minimumSize()); + nb->resize(nb->tqminimumSize()); nb->show(); } @@ -646,7 +646,7 @@ void KBg::print() prt->setPageSize((KPrinter::PageSize) config->readNumEntry("pagesize", KPrinter::A4)); prt->setOrientation((KPrinter::Orientation)config->readNumEntry("orientation", KPrinter::Landscape)); - if (prt->setup(this, i18n("Print %1").arg(baseCaption))) { + if (prt->setup(this, i18n("Print %1").tqarg(baseCaption))) { TQPainter p; p.begin(prt); board->print(&p); diff --git a/kbackgammon/kbg.h b/kbackgammon/kbg.h index 94f4aab9..81c5f4fd 100644 --- a/kbackgammon/kbg.h +++ b/kbackgammon/kbg.h @@ -48,6 +48,7 @@ class KBgBoardSetup; class KBg : public KMainWindow { Q_OBJECT + TQ_OBJECT public: diff --git a/kbackgammon/kbgboard.cpp b/kbackgammon/kbgboard.cpp index fc024ab8..b47c6192 100644 --- a/kbackgammon/kbgboard.cpp +++ b/kbackgammon/kbgboard.cpp @@ -196,7 +196,7 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb) "move a checker the shortest possible distance.")); for (int i = 0; i < 3; i++) { - rbMove[i]->setMinimumSize(rbMove[i]->sizeHint()); + rbMove[i]->setMinimumSize(rbMove[i]->tqsizeHint()); blm->addWidget(rbMove[i]); rbMove[i]->setChecked(i == getShortMoveMode()); } @@ -248,8 +248,8 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb) /* * Empty constructor calls the board constructor */ -KBgBoardSetup::KBgBoardSetup(TQWidget *parent, const char *name, TQPopupMenu *menu) - : KBgBoard(parent, name, menu) +KBgBoardSetup::KBgBoardSetup(TQWidget *tqparent, const char *name, TQPopupMenu *menu) + : KBgBoard(tqparent, name, menu) { // empty } @@ -360,10 +360,10 @@ void KBgBoard::setFont(const TQFont& f) */ void KBgBoard::queryCube() { - KBgStatus *st = new KBgStatus(); + KBgtqStatus *st = new KBgtqStatus(); getState(st); - KBgBoardQCube *dlg = - new KBgBoardQCube(abs(st->cube()), (st->cube(US) > 0), (st->cube(THEM) > 0)); + KBgBoardTQCube *dlg = + new KBgBoardTQCube(abs(st->cube()), (st->cube(US) > 0), (st->cube(THEM) > 0)); if (dlg->exec()) { bool u = ((dlg->getCubeValue() == 0) || (dlg->getCubeOwner() == US )); bool t = ((dlg->getCubeValue() == 0) || (dlg->getCubeOwner() == THEM)); @@ -377,7 +377,7 @@ void KBgBoard::queryCube() /* * Constructor, creates the dialog but does not show nor execute it. */ -KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them) +KBgBoardTQCube::KBgBoardTQCube(int val, bool us, bool them) : TQDialog(0, 0, true) { setCaption(i18n("Set Cube Values")); @@ -395,7 +395,7 @@ KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them) "double. Note that a face value of 1 automatically allows both\n" "players to double.")); - info->setMinimumSize(info->sizeHint()); + info->setMinimumSize(info->tqsizeHint()); vbox->addWidget(info, 0); @@ -454,17 +454,17 @@ KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them) else if (them) cb[1]->setCurrentItem(THEM); - cb[0]->setMinimumSize(cb[0]->sizeHint()); - cb[1]->setMinimumSize(cb[1]->sizeHint()); + cb[0]->setMinimumSize(cb[0]->tqsizeHint()); + cb[1]->setMinimumSize(cb[1]->tqsizeHint()); - ok->setMinimumSize(ok->sizeHint()); - cancel->setMinimumSize(cancel->sizeHint()); + ok->setMinimumSize(ok->tqsizeHint()); + cancel->setMinimumSize(cancel->tqsizeHint()); - setMinimumSize(childrenRect().size()); + setMinimumSize(tqchildrenRect().size()); vbox->activate(); - resize(minimumSize()); + resize(tqminimumSize()); ok->setAutoDefault (true); ok->setDefault(true); @@ -481,7 +481,7 @@ KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them) /* * Deconstructor, empty. */ -KBgBoardQCube::~KBgBoardQCube() +KBgBoardTQCube::~KBgBoardTQCube() { // nothing } @@ -489,7 +489,7 @@ KBgBoardQCube::~KBgBoardQCube() /* * Get the face value of the cube */ -int KBgBoardQCube::getCubeValue() +int KBgBoardTQCube::getCubeValue() { return cb[0]->currentItem(); } @@ -497,7 +497,7 @@ int KBgBoardQCube::getCubeValue() /* * Get the owner of the cube */ -int KBgBoardQCube::getCubeOwner() +int KBgBoardTQCube::getCubeOwner() { return cb[1]->currentItem(); } @@ -505,7 +505,7 @@ int KBgBoardQCube::getCubeOwner() /* * If the cube is open, the value can only be 1 */ -void KBgBoardQCube::changeValue(int player) +void KBgBoardTQCube::changeValue(int player) { if (player == BOTH) cb[0]->setCurrentItem(0); @@ -516,7 +516,7 @@ void KBgBoardQCube::changeValue(int player) * If the value is 1, the cube has to be open; and if the value * becomes bigger than 1, the player cannot stay open. */ -void KBgBoardQCube::changePlayer(int val) +void KBgBoardTQCube::changePlayer(int val) { if (val == 0) cb[1]->setCurrentItem(BOTH); @@ -527,7 +527,7 @@ void KBgBoardQCube::changePlayer(int val) /* * Constructor, creates the dialog but does not show nor execute it. */ -KBgBoardQDice::KBgBoardQDice(const char *name) +KBgBoardTQDice::KBgBoardTQDice(const char *name) : TQDialog(0, name, true) { setCaption(i18n("Set Dice Values")); @@ -544,7 +544,7 @@ KBgBoardQDice::KBgBoardQDice(const char *name) info->setText(i18n("Set the face values of the selected dice. The other player's\n" "dice will be cleared and it will be the dice's owner's turn.")); - info->setMinimumSize(info->sizeHint()); + info->setMinimumSize(info->tqsizeHint()); vbox->addWidget(info, 0); @@ -560,17 +560,17 @@ KBgBoardQDice::KBgBoardQDice(const char *name) hbox_2->addWidget(ok); hbox_2->addWidget(cancel); - sb[0]->setMinimumSize(sb[0]->sizeHint()); - sb[1]->setMinimumSize(sb[1]->sizeHint()); + sb[0]->setMinimumSize(sb[0]->tqsizeHint()); + sb[1]->setMinimumSize(sb[1]->tqsizeHint()); - ok->setMinimumSize(ok->sizeHint()); - cancel->setMinimumSize(cancel->sizeHint()); + ok->setMinimumSize(ok->tqsizeHint()); + cancel->setMinimumSize(cancel->tqsizeHint()); - setMinimumSize(childrenRect().size()); + setMinimumSize(tqchildrenRect().size()); vbox->activate(); - resize(minimumSize()); + resize(tqminimumSize()); ok->setAutoDefault (true); ok->setDefault(true); @@ -590,7 +590,7 @@ KBgBoardQDice::KBgBoardQDice(const char *name) /* * Deconstructor, empty. */ -KBgBoardQDice::~KBgBoardQDice() +KBgBoardTQDice::~KBgBoardTQDice() { // nothing } @@ -598,7 +598,7 @@ KBgBoardQDice::~KBgBoardQDice() /* * Get the face value of the dice */ -int KBgBoardQDice::getDice(int n) +int KBgBoardTQDice::getDice(int n) { return sb[n]->value(); } @@ -628,10 +628,10 @@ bool KBgBoard::getEditMode() const } /* - * This function takes a KBgStatus object and fills it with the current + * This function takes a KBgtqStatus object and fills it with the current * board status. */ -KBgStatus* KBgBoard::getState(KBgStatus *st) const +KBgtqStatus* KBgBoard::getState(KBgtqStatus *st) const { st->setColor(color); st->setDirection(direction); @@ -915,7 +915,7 @@ void KBgBoardBar::paintCell(TQPainter *p, int xo, int yo, double sf) const * the center belongs to two(!) fields - both bars. * * If we are not printing on paper we use the fact that - * Qt will clip the drawing for us. So we print the upper + * TQt will clip the drawing for us. So we print the upper * half of the cube and the lower half on different cells. * * Since there is no such thing as clipping when we print @@ -1103,7 +1103,7 @@ void KBgBoardHome::drawDiceFrame(TQPainter *p, int col, int num, */ void KBgBoardCell::mousePressEvent(TQMouseEvent *e) { - if (e->button() == RightButton) + if (e->button() == Qt::RightButton) board->showContextMenu(); else mouseButton = e->button(); @@ -1142,7 +1142,7 @@ int KBgBoard::getShortMoveMode() */ void KBgBoardCell::checkAndMakeShortMove(TQMouseEvent *e, int m) { - if ((e->button() == LeftButton) && + if ((e->button() == Qt::LeftButton) && (board->getShortMoveMode() == m) && (dragPossible()) && (!board->getEditMode())) @@ -1166,7 +1166,7 @@ void KBgBoardBar::mouseDoubleClickEvent(TQMouseEvent *e) { TQRect r = cubeRect(cellID == BAR_THEM ? CUBE_UPPER : CUBE_LOWER, true); if (board->canDouble(US) && - board->canDouble(THEM) && r.contains(e->pos())) { + board->canDouble(THEM) && r.tqcontains(e->pos())) { if (board->getEditMode()) board->queryCube(); else @@ -1318,7 +1318,7 @@ int KBgBoard::getPipCount(const int& w) const */ void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e) { - if (e->button() != LeftButton) + if (e->button() != Qt::LeftButton) return; /* * Check whether this is the bookkeeping home... @@ -1332,12 +1332,12 @@ void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e) US : THEM); for (int i = 0; i < 2; ++i) { TQRect r = diceRect(i, true); - if (r.contains(e->pos())) { + if (r.tqcontains(e->pos())) { if (board->getEditMode()) { - KBgBoardQDice *dlg = new KBgBoardQDice(); + KBgBoardTQDice *dlg = new KBgBoardTQDice(); if (dlg->exec()) { - KBgStatus *st = new KBgStatus(); + KBgtqStatus *st = new KBgtqStatus(); board->getState(st); st->setDice(w, 0, dlg->getDice(0)); st->setDice(w, 1, dlg->getDice(1)); @@ -1356,7 +1356,7 @@ void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e) if (board->canDouble(w) && !(board->canDouble(US) && board->canDouble(THEM))) { TQRect r = cubeRect(w, true); - if (r.contains(e->pos())) + if (r.tqcontains(e->pos())) if (board->getEditMode()) board->queryCube(); else @@ -1367,7 +1367,7 @@ void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e) /* * This function determines if a checker can be dropped on this field. - * It checks whether the field is already owned, empty or contains + * It checks whether the field is already owned, empty or tqcontains * only one opponents piece. Then the dice are checked. */ bool KBgBoardField::dropPossible(int fromCellID, int newColor) @@ -1435,7 +1435,7 @@ bool KBgBoard::moveOffPossible() const KBgBoardCell* KBgBoard::getCellByPos(const TQPoint& p) const { for (int i = 0; i < 30; ++i) { - if (cells[i]->rect().contains(cells[i]->mapFromParent(p))) + if (TQT_TQRECT_OBJECT(cells[i]->rect()).tqcontains(cells[i]->mapFromParent(p))) return cells[i]; } return NULL; @@ -1610,8 +1610,8 @@ KBgBoardField::~KBgBoardField() * This is the constructor of the bars. It calls the base class' constructor * and defines the TQWhatsThis string. */ -KBgBoardBar::KBgBoardBar(TQWidget * parent, int numID) - : KBgBoardCell(parent, numID) +KBgBoardBar::KBgBoardBar(TQWidget * tqparent, int numID) + : KBgBoardCell(tqparent, numID) { TQWhatsThis::add(this, i18n("This is the bar of the backgammon board.\n\n" "Checkers that have been kicked from the board are put " @@ -1627,8 +1627,8 @@ KBgBoardBar::KBgBoardBar(TQWidget * parent, int numID) * This is the constructor of regular fields. It calls the base class' constructor * and defines the TQWhatsThis string. */ -KBgBoardField::KBgBoardField(TQWidget * parent, int numID) - : KBgBoardCell(parent, numID) +KBgBoardField::KBgBoardField(TQWidget * tqparent, int numID) + : KBgBoardCell(tqparent, numID) { 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 " @@ -1641,8 +1641,8 @@ KBgBoardField::KBgBoardField(TQWidget * parent, int numID) * This is the constructor of the homes. It calls the base class' constructor * and defines the TQWhatsThis string. */ -KBgBoardHome::KBgBoardHome(TQWidget * parent, int numID) - : KBgBoardCell(parent, numID) +KBgBoardHome::KBgBoardHome(TQWidget * tqparent, int numID) + : KBgBoardCell(tqparent, numID) { 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 " @@ -1734,10 +1734,10 @@ 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(TQWidget * parent, int numID) - : TQLabel(parent) +KBgBoardCell::KBgBoardCell(TQWidget * tqparent, int numID) + : TQLabel(tqparent) { - board = (KBgBoard *)parent; + board = (KBgBoard *)tqparent; direction = +1; color = -1; @@ -1746,10 +1746,10 @@ KBgBoardCell::KBgBoardCell(TQWidget * parent, int numID) stateChanged = false; colorChanged = false; directionChanged = false; - mouseButton = NoButton; + mouseButton = Qt::NoButton; dragInProgress = false; - connect(parent, TQT_SIGNAL(finishedUpdate()), this, TQT_SLOT(refresh())); + connect(tqparent, TQT_SIGNAL(finishedUpdate()), this, TQT_SLOT(refresh())); } /* @@ -1854,7 +1854,7 @@ void KBgBoard::updateField(int f, int v) } /* - * This function displays the context menu our parent may have given us + * This function displays the context menu our tqparent may have given us */ void KBgBoard::showContextMenu() { @@ -2085,7 +2085,7 @@ bool KBgBoard::diceAllowMove(int src, int dest) * This is the most important of all members of the board class. It takes * a single board status object and initializes the internal status. */ -void KBgBoard::setState(const KBgStatus &st) +void KBgBoard::setState(const KBgtqStatus &st) { color = st.color(); direction = st.direction(); @@ -2151,7 +2151,7 @@ void KBgBoard::setState(const KBgStatus &st) */ void KBgBoardCell::mouseMoveEvent(TQMouseEvent *) { - if ((mouseButton == LeftButton) && dragPossible()) { + if ((mouseButton == Qt::LeftButton) && dragPossible()) { dragInProgress = true; TQRect cr(0, 0, 1+getCheckerDiameter(), 1+getCheckerDiameter()); cr.moveBottomLeft(rect().bottomLeft()); @@ -2162,15 +2162,15 @@ void KBgBoardCell::mouseMoveEvent(TQMouseEvent *) board->drawSimpleChecker(&tmp, 0, 0, pcs, getCheckerDiameter()); tmp.end(); pix.setMask(pix.createHeuristicMask()); - TQBitmap mask = *(pix.mask()); + TQBitmap tqmask = *(pix.tqmask()); TQBitmap newCursor; - newCursor = pix; - board->replaceCursor(TQCursor(newCursor, mask)); + newCursor = TQBitmap(pix); + board->replaceCursor(TQCursor(newCursor, tqmask)); if (board->getEditMode()) board->storeTurn(pcs); getPiece(); } - mouseButton = NoButton; + mouseButton = Qt::NoButton; } /* @@ -2653,7 +2653,7 @@ void KBgBoard::redoMove() } /* - * This function performs and undo for the last move and updates the parent + * This function performs and undo for the last move and updates the tqparent * of the board by calling sendMove() after the undo. */ void KBgBoard::undoMove() @@ -2820,11 +2820,11 @@ void KBgBoard::getRollDice(const int w) * This is the constructor of the KBgBoard class. It creates * a backgammon board with an initial distribution of checkers, empty * dice and a cube with face value 1. The initial board is not usable! - * You have to change the status by passing a KBgStatus + * You have to change the status by passing a KBgtqStatus * object to setState(...) before you can play! */ -KBgBoard::KBgBoard(TQWidget *parent, const char *name, TQPopupMenu *menu) - : TQWidget(parent, name) +KBgBoard::KBgBoard(TQWidget *tqparent, const char *name, TQPopupMenu *menu) + : TQWidget(tqparent, name) { /* * The following lines set up internal bookkeeping data. @@ -2838,7 +2838,7 @@ KBgBoard::KBgBoard(TQWidget *parent, const char *name, TQPopupMenu *menu) checkerDiam = MINIMUM_CHECKER_SIZE; /* - * We may be initialized with a popup menu by our parent. + * We may be initialized with a popup menu by our tqparent. */ contextMenu = menu; @@ -2868,7 +2868,7 @@ KBgBoard::KBgBoard(TQWidget *parent, const char *name, TQPopupMenu *menu) * Get the default seeting of the board and initialize the * state of it. */ - KBgStatus *st = new KBgStatus(); + KBgtqStatus *st = new KBgtqStatus(); st->setCube(1, true, true); st->setDirection(+1); @@ -2907,12 +2907,12 @@ KBgBoard::KBgBoard(TQWidget *parent, const char *name, TQPopupMenu *menu) setFont(TQApplication::font()); } -TQSize KBgBoard::minimumSizeHint() const +TQSize KBgBoard::tqminimumSizeHint() const { return TQSize(MINIMUM_CHECKER_SIZE * 15, MINIMUM_CHECKER_SIZE * 11); } -TQSize KBgBoard::sizeHint() const { +TQSize KBgBoard::tqsizeHint() const { return TQSize(MINIMUM_CHECKER_SIZE *15*4,MINIMUM_CHECKER_SIZE*11*2); } diff --git a/kbackgammon/kbgboard.h b/kbackgammon/kbgboard.h index 54ad506c..04cac55f 100644 --- a/kbackgammon/kbgboard.h +++ b/kbackgammon/kbgboard.h @@ -64,9 +64,9 @@ /* * Just some internal constants and classes */ -const int US = KBgStatus::US; -const int THEM = KBgStatus::THEM; -const int BOTH = KBgStatus::BOTH; +const int US = KBgtqStatus::US; +const int THEM = KBgtqStatus::THEM; +const int BOTH = KBgtqStatus::BOTH; const int HOME_US_LEFT = 101; const int HOME_US_RIGHT = 102; @@ -87,7 +87,7 @@ class KBgBoardMove; class KBgBoardHome; class KBgBoardBar; class KBgBoardField; -class KBgBoardQDice; +class KBgBoardTQDice; /** @@ -95,9 +95,10 @@ class KBgBoardQDice; * * This class handles all game operations of the client. */ -class KBgBoard : public QWidget +class KBgBoard : public TQWidget { Q_OBJECT + TQ_OBJECT friend class KBgBoardCell; friend class KBgBoardHome; @@ -109,7 +110,7 @@ class KBgBoard : public QWidget /** * Constructor and destructor. Parameter as usual. */ - KBgBoard(TQWidget *parent = 0, const char *name = 0, + KBgBoard(TQWidget *tqparent = 0, const char *name = 0, TQPopupMenu *menu = 0); virtual ~KBgBoard(); @@ -180,7 +181,7 @@ class KBgBoard : public QWidget * This function has to be reimplemented to provide a minimum size for * the playing area. */ - TQSize minimumSizeHint() const; + TQSize tqminimumSizeHint() const; public slots: /** @@ -194,7 +195,7 @@ public slots: * Overwritten resize event handler. * * We overwrite the handler to make sure that all the cells are - * repainted as well. + * tqrepainted as well. */ virtual void resizeEvent(TQResizeEvent *); @@ -210,10 +211,10 @@ public slots: /** * This is the most important public member. It takes - * a board status - s. the KBgBoardStatus class - + * a board status - s. the KBgBoardtqStatus class - * and sets the board accordingly. */ - void setState(const KBgStatus &); + void setState(const KBgtqStatus &); /** * Set the context menu @@ -223,7 +224,7 @@ public slots: /** * Get the current state of the board. */ - KBgStatus *getState(KBgStatus *st) const; + KBgtqStatus *getState(KBgtqStatus *st) const; /** * Sets the edit mode of the board. In that mode the board can be @@ -291,7 +292,7 @@ public slots: /* ************************************************** */ protected: - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; TQColor baseColors[2]; TQFont boardFont; @@ -458,21 +459,22 @@ protected: * on a backgammon board. It has a bunch of virtual functions that * are overloaded in the derived classes. */ -class KBgBoardCell : public QLabel +class KBgBoardCell : public TQLabel { Q_OBJECT + TQ_OBJECT public: /** * Constructor and destructor */ - KBgBoardCell(TQWidget * parent, int numID); + KBgBoardCell(TQWidget * tqparent, int numID); virtual ~KBgBoardCell(); /** * sets the number and color of checkers on this cell - * takes care of repainting + * takes care of tqrepainting */ virtual void cellUpdate(const int p, const bool cubechanged = false) = 0; @@ -533,7 +535,7 @@ protected: virtual void drawContents(TQPainter *); /** - * Status numbers that store the current board status. + * tqStatus numbers that store the current board status. */ int mouseButton; int direction; @@ -550,7 +552,7 @@ protected: int cellID; /** - * Indicates whether this cell needs to repaint itself after + * Indicates whether this cell needs to tqrepaint itself after * the board has been processed. */ bool stateChanged; @@ -558,7 +560,7 @@ protected: /** * the board and the pieces are one unit (none makes - * sense without the other). So the pieces know and access their parent. + * sense without the other). So the pieces know and access their tqparent. */ KBgBoard *board; void checkAndMakeShortMove(TQMouseEvent *e, int m); @@ -615,11 +617,12 @@ protected: class KBgBoardHome : public KBgBoardCell { Q_OBJECT + TQ_OBJECT public: /** * sets the number and color of checkers on this cell - * takes care of repainting + * takes care of tqrepainting */ virtual void cellUpdate(const int p, const bool cubechanged = false); @@ -632,7 +635,7 @@ class KBgBoardHome : public KBgBoardCell /** * Constructor and destructor */ - KBgBoardHome( TQWidget * parent, int numID); + KBgBoardHome( TQWidget * tqparent, int numID); virtual ~KBgBoardHome(); /** @@ -664,7 +667,7 @@ class KBgBoardHome : public KBgBoardCell private: /** - * Save old dice to avoid repainting + * Save old dice to avoid tqrepainting */ int savedDice[2]; @@ -677,11 +680,12 @@ class KBgBoardHome : public KBgBoardCell class KBgBoardBar : public KBgBoardCell { Q_OBJECT + TQ_OBJECT public: /** * sets the number and color of checkers on this cell - * takes care of repainting + * takes care of tqrepainting */ virtual void cellUpdate(const int p, const bool cubechanged = false); @@ -694,7 +698,7 @@ class KBgBoardBar : public KBgBoardCell /** * Constructor */ - KBgBoardBar( TQWidget * parent, int numID ); + KBgBoardBar( TQWidget * tqparent, int numID ); /** * Destructor @@ -724,17 +728,18 @@ class KBgBoardBar : public KBgBoardCell class KBgBoardField : public KBgBoardCell { Q_OBJECT + TQ_OBJECT public: /** * Constructor and destructor */ - KBgBoardField( TQWidget * parent, int numID); + KBgBoardField( TQWidget * tqparent, int numID); virtual ~KBgBoardField(); /** * sets the number and color of checkers on this cell - * takes care of repainting + * takes care of tqrepainting */ virtual void cellUpdate(const int p, const bool cubechanged = false); @@ -816,22 +821,23 @@ class KBgBoardMove * * A very simple dialog with two SpinBoxes and two buttons. */ -class KBgBoardQDice : public QDialog +class KBgBoardTQDice : public TQDialog { Q_OBJECT + TQ_OBJECT public: /** * Constructor and destructor */ - KBgBoardQDice(const char *name = 0); - virtual ~KBgBoardQDice(); + KBgBoardTQDice(const char *name = 0); + virtual ~KBgBoardTQDice(); protected: /** - * Spin boxes and buttons are children + * Spin boxes and buttons are tqchildren */ TQSpinBox *sb[2]; TQPushButton *ok; @@ -849,22 +855,23 @@ public slots: /** * Simple dialog that allows to query the user for the cube value. */ -class KBgBoardQCube : public QDialog +class KBgBoardTQCube : public TQDialog { Q_OBJECT + TQ_OBJECT public: /** * Constructor and destructor */ - KBgBoardQCube(int val, bool us, bool them); - virtual ~KBgBoardQCube(); + KBgBoardTQCube(int val, bool us, bool them); + virtual ~KBgBoardTQCube(); protected: /** - * Spin boxes and buttons are children + * Spin boxes and buttons are tqchildren */ TQComboBox *cb[2]; TQPushButton *ok; @@ -897,13 +904,14 @@ protected slots: class KBgBoardSetup : public KBgBoard { Q_OBJECT + TQ_OBJECT public: /** * Constructor */ - KBgBoardSetup(TQWidget *parent = 0, const char *name = 0, + KBgBoardSetup(TQWidget *tqparent = 0, const char *name = 0, TQPopupMenu *menu = 0); /** diff --git a/kbackgammon/kbgstatus.cpp b/kbackgammon/kbgstatus.cpp index 4f5db3c0..e9e8d4e5 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 TQString &rawboard) +KBgtqStatus::KBgtqStatus(const TQString &rawboard) { /* * This is the format string from hell... @@ -116,7 +116,7 @@ KBgStatus::KBgStatus(const TQString &rawboard) * Constructor initializes the status to an empty board with cube one * and empty dice. */ -KBgStatus::KBgStatus() +KBgtqStatus::KBgtqStatus() : TQObject() { /* @@ -131,7 +131,7 @@ KBgStatus::KBgStatus() setHome (i, 0); setBar (i, 0); setPoints(i, -1); - setPlayer(i, TQString::null); + setPlayer(i, TQString()); } setColor(White, US); setCube(1, BOTH); // also initializes maydouble @@ -146,7 +146,7 @@ KBgStatus::KBgStatus() /* * Copy constructor calls private utility function. */ -KBgStatus::KBgStatus(const KBgStatus &rhs) +KBgtqStatus::KBgtqStatus(const KBgtqStatus &rhs) : TQObject() { copy(rhs); @@ -155,7 +155,7 @@ KBgStatus::KBgStatus(const KBgStatus &rhs) /* * Destructor */ -KBgStatus::~KBgStatus() +KBgtqStatus::~KBgtqStatus() { // nothing to do } @@ -164,14 +164,14 @@ KBgStatus::~KBgStatus() * Assignment operator shares a lot of code with the copy * constructor. */ -KBgStatus& KBgStatus::operator=(const KBgStatus &rhs) +KBgtqStatus& KBgtqStatus::operator=(const KBgtqStatus &rhs) { if (this == &rhs) return *this; copy(rhs); return *this; } -void KBgStatus::copy(const KBgStatus &rhs) +void KBgtqStatus::copy(const KBgtqStatus &rhs) { for (int i = 0; i < 26; i++) board_[i] = rhs.board_[i]; @@ -199,32 +199,32 @@ void KBgStatus::copy(const KBgStatus &rhs) /* * Access functions */ -int KBgStatus::board(const int &i) const +int KBgtqStatus::board(const int &i) const { return ((0 < i && i < 25) ? color_*board_[i] : 0); } -int KBgStatus::home(const int &w) const +int KBgtqStatus::home(const int &w) const { return ((w == US || w == THEM) ? color_*home_[w] : 0); } -int KBgStatus::bar(const int &w) const +int KBgtqStatus::bar(const int &w) const { return ((w == US || w == THEM) ? color_*bar_[w] : 0); } -int KBgStatus::color(const int &w) const +int KBgtqStatus::color(const int &w) const { return ((w == THEM) ? -color_ : color_); } -int KBgStatus::direction() const +int KBgtqStatus::direction() const { return direction_; } -int KBgStatus::dice(const int &w, const int &n) const +int KBgtqStatus::dice(const int &w, const int &n) const { if ((w == US || w == THEM) && (n == 0 || n == 1)) return dice_[w][n]; @@ -232,34 +232,34 @@ int KBgStatus::dice(const int &w, const int &n) const return 0; } -int KBgStatus::cube(const int &w) const +int KBgtqStatus::cube(const int &w) const { if (w == US || w == THEM) return ((maydouble_[w]) ? cube_ : -cube_); return 0; } -int KBgStatus::points(const int& w) const +int KBgtqStatus::points(const int& w) const { return ((w == US || w == THEM) ? points_[w] : -1); } -TQString KBgStatus::player(const int &w) const +TQString KBgtqStatus::player(const int &w) const { - return ((w == US || w == THEM) ? player_[w] : TQString::null); + return ((w == US || w == THEM) ? player_[w] : TQString()); } -int KBgStatus::length() const +int KBgtqStatus::length() const { return length_; } -int KBgStatus::turn() const +int KBgtqStatus::turn() const { return turn_; } -bool KBgStatus::doubled() const +bool KBgtqStatus::doubled() const { return doubled_; } @@ -268,7 +268,7 @@ bool KBgStatus::doubled() const /* * Assignment functions */ -void KBgStatus::setBoard(const int &i, const int &w, const int &v) +void KBgtqStatus::setBoard(const int &i, const int &w, const int &v) { if (0 < i && i < 25) { if (w == US) @@ -278,7 +278,7 @@ void KBgStatus::setBoard(const int &i, const int &w, const int &v) } } -void KBgStatus::setHome(const int &w, const int &v) +void KBgtqStatus::setHome(const int &w, const int &v) { if (w == US) home_[w] = abs(v); @@ -286,7 +286,7 @@ void KBgStatus::setHome(const int &w, const int &v) home_[w] = -abs(v); } -void KBgStatus::setBar(const int& w, const int& v) +void KBgtqStatus::setBar(const int& w, const int& v) { if (w == US) bar_[w] = abs(v); @@ -294,7 +294,7 @@ void KBgStatus::setBar(const int& w, const int& v) bar_[w] = -abs(v); } -void KBgStatus::setColor(const int &c, const int &w) +void KBgtqStatus::setColor(const int &c, const int &w) { if (w == US) color_ = ((c < 0) ? Black : White); @@ -302,12 +302,12 @@ void KBgStatus::setColor(const int &c, const int &w) color_ = ((c < 0) ? White : Black); } -void KBgStatus::setDirection(const int &dir) +void KBgtqStatus::setDirection(const int &dir) { direction_ = ((dir < 0) ? -1 : +1); } -void KBgStatus::setDice(const int &w, const int &n, const int &v) +void KBgtqStatus::setDice(const int &w, const int &n, const int &v) { if ((w == US || w == THEM) && (n == 0 || n == 1)) { if (0 <= v && v <= 6) @@ -317,7 +317,7 @@ void KBgStatus::setDice(const int &w, const int &n, const int &v) } } -void KBgStatus::setCube(const int &c, const bool &us, const bool &them) +void KBgtqStatus::setCube(const int &c, const bool &us, const bool &them) { int w = NONE; if (us) w = US; @@ -326,7 +326,7 @@ void KBgStatus::setCube(const int &c, const bool &us, const bool &them) setCube(c, w); } -void KBgStatus::setCube(const int &c, const int &w) +void KBgtqStatus::setCube(const int &c, const int &w) { // assume that int has at least 32 bits... for (int i = 0; i < 31; i++) { @@ -337,24 +337,24 @@ void KBgStatus::setCube(const int &c, const int &w) maydouble_[THEM] = (w == THEM || w == BOTH); } -void KBgStatus::setPoints(const int &w, const int &p) +void KBgtqStatus::setPoints(const int &w, const int &p) { if (w == US || w == THEM) points_[w] = p; } -void KBgStatus::setPlayer(const int &w, const TQString &name) +void KBgtqStatus::setPlayer(const int &w, const TQString &name) { if (w == US || w == THEM) player_[w] = name; } -void KBgStatus::setLength(const int &l) +void KBgtqStatus::setLength(const int &l) { length_ = l; } -void KBgStatus::setTurn(const int &w) +void KBgtqStatus::setTurn(const int &w) { if (w == US || w == THEM || w == BOTH) turn_ = w; @@ -364,7 +364,7 @@ void KBgStatus::setTurn(const int &w) /* * Utility functions */ -int KBgStatus::moves() const +int KBgtqStatus::moves() const { int start, dir; @@ -407,7 +407,7 @@ int KBgStatus::moves() const * Get a copy of ourselves. That way we can mess around with * the internals of the game. */ - KBgStatus sc(*this); + KBgtqStatus sc(*this); /* * Start with getting all checkers off the bar @@ -490,7 +490,7 @@ int KBgStatus::moves() const } } -bool KBgStatus::movePossible(KBgStatus &sc, int a, int start, int dir) const +bool KBgtqStatus::movePossible(KBgtqStatus &sc, int a, int start, int dir) const { /* * Determine where the first checker in moving direction is diff --git a/kbackgammon/kbgstatus.h b/kbackgammon/kbgstatus.h index afcc2f6a..05348157 100644 --- a/kbackgammon/kbgstatus.h +++ b/kbackgammon/kbgstatus.h @@ -43,10 +43,11 @@ * @author Jens Hoefkens * @version $Id$ */ -class KBgStatus : public QObject +class KBgtqStatus : public TQObject { Q_OBJECT + TQ_OBJECT public: @@ -65,27 +66,27 @@ class KBgStatus : public QObject * The default constructor initializes the status to an "empty" * state. The board and dice are empty and the cube shows 1. */ - KBgStatus(); + KBgtqStatus(); /** * Constructor from a FIBS rawboard string */ - KBgStatus(const TQString &rawboard); + KBgtqStatus(const TQString &rawboard); /** * Copy constructor */ - KBgStatus(const KBgStatus &rhs); + KBgtqStatus(const KBgtqStatus &rhs); /** * Assignment operator */ - KBgStatus& operator=(const KBgStatus &rhs); + KBgtqStatus& operator=(const KBgtqStatus &rhs); /** * Destructor */ - virtual ~KBgStatus(); + virtual ~KBgtqStatus(); /* @@ -156,7 +157,7 @@ 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, TQString::null is + * the player names have not been set, TQString() is * returned. */ TQString player(const int &w = US) const; @@ -231,7 +232,7 @@ class KBgStatus : public QObject /* * Set the n-th dice of player w to v. Nothing is done if w is * invalid or if n is out of bounds. If v is invalid, the - * value zero is assigned (i.e., the dice is invalidated). + * value zero is assigned (i.e., the dice is tqinvalidated). */ void setDice(const int &w, const int &n, const int &v); @@ -288,12 +289,12 @@ class KBgStatus : public QObject * anywhere starting from start or later into direction * dir in the game given by sc. */ - bool movePossible(KBgStatus &sc, int a, int start, int dir) const; + bool movePossible(KBgtqStatus &sc, int a, int start, int dir) const; /* * Copy constr. and assignment share a lot of code. */ - void copy(const KBgStatus &rhs); + void copy(const KBgtqStatus &rhs); /* * Private variables with self-expalanatory names. diff --git a/kbackgammon/kbgtextview.cpp b/kbackgammon/kbgtextview.cpp index a2199b05..30b8b671 100644 --- a/kbackgammon/kbgtextview.cpp +++ b/kbackgammon/kbgtextview.cpp @@ -36,8 +36,8 @@ /* * Constructor */ -KBgTextView::KBgTextView(TQWidget *parent, const char *name) - : KTextBrowser(parent, name) +KBgTextView::KBgTextView(TQWidget *tqparent, const char *name) + : KTextBrowser(tqparent, name) { clear(); setLinkUnderline(true); diff --git a/kbackgammon/kbgtextview.h b/kbackgammon/kbgtextview.h index 8b8b8389..87d783a0 100644 --- a/kbackgammon/kbgtextview.h +++ b/kbackgammon/kbgtextview.h @@ -36,13 +36,14 @@ class KBgTextView : public KTextBrowser { Q_OBJECT + TQ_OBJECT public: /** * Constructor */ - KBgTextView(TQWidget *parent = 0, const char *name = 0); + KBgTextView(TQWidget *tqparent = 0, const char *name = 0); /** * Destructor diff --git a/kbattleship/CLIENTS b/kbattleship/CLIENTS index 393dda40..54c82ec3 100644 --- a/kbattleship/CLIENTS +++ b/kbattleship/CLIENTS @@ -1,6 +1,6 @@ Information about other KBattleship-compatible clients: -Client OS Status Homepage/Screenshots +Client OS tqStatus Homepage/Screenshots KBattleship Linux/KDE 100% http://games.kde.org/kbattleship Mac KBattleship Mac OS + Mac OS X 100% http://www.sebek.de/ diff --git a/kbattleship/kbattleship/dialogs/chatDlg.ui b/kbattleship/kbattleship/dialogs/chatDlg.ui index 40ffdbf3..ed8329cc 100644 --- a/kbattleship/kbattleship/dialogs/chatDlg.ui +++ b/kbattleship/kbattleship/dialogs/chatDlg.ui @@ -1,10 +1,10 @@ chatDlg - + chatDlg - + 0 0 @@ -25,9 +25,9 @@ 3 - + - layouter + tqlayouter @@ -39,7 +39,7 @@ 6 - + commentEdit @@ -47,7 +47,7 @@ Enter a message here - + sendBtn @@ -64,7 +64,7 @@ - + chatView @@ -75,7 +75,7 @@ true - + chatLabel @@ -87,5 +87,5 @@ - + diff --git a/kbattleship/kbattleship/dialogs/connectDlg.ui b/kbattleship/kbattleship/dialogs/connectDlg.ui index 1a5b53de..a59803ab 100644 --- a/kbattleship/kbattleship/dialogs/connectDlg.ui +++ b/kbattleship/kbattleship/dialogs/connectDlg.ui @@ -1,10 +1,10 @@ clientConnectDlg - + clientConnectDlg - + 0 0 @@ -15,15 +15,15 @@ Connect to Server - + - + unnamed - + nicknameLabel @@ -38,7 +38,7 @@ &Nick name: - + AlignVCenter|AlignLeft @@ -47,7 +47,7 @@ - + nicknameEdit @@ -58,7 +58,7 @@ Enter a name that identifies you in the game - + serverLabel @@ -73,7 +73,7 @@ &Server: - + AlignVCenter|AlignLeft @@ -82,7 +82,7 @@ - + lanLabel @@ -93,7 +93,7 @@ lanBox - + Layout4 @@ -120,7 +120,7 @@ - + portLabel @@ -135,7 +135,7 @@ &Port: - + AlignVCenter|AlignLeft @@ -146,7 +146,7 @@ - + portEdit @@ -174,7 +174,7 @@ kcombobox.h - + kcombobox.h klineedit.h diff --git a/kbattleship/kbattleship/dialogs/infoDlg.ui b/kbattleship/kbattleship/dialogs/infoDlg.ui index 3c66d854..b000b050 100644 --- a/kbattleship/kbattleship/dialogs/infoDlg.ui +++ b/kbattleship/kbattleship/dialogs/infoDlg.ui @@ -1,10 +1,10 @@ KInfoDialog - + KInfoDialog - + 0 0 @@ -25,7 +25,7 @@ 6 - + Frame8 @@ -45,7 +45,7 @@ 6 - + Layout6 @@ -59,7 +59,7 @@ 6 - + lbl_clientIdentfierLabel @@ -72,7 +72,7 @@ Client identifier: - + lbl_ClientInformationLabel @@ -91,7 +91,7 @@ Client information: - + lbl_clientVersion @@ -107,7 +107,7 @@ CV - + lbl_clientVersionLabel @@ -120,7 +120,7 @@ Client version: - + lbl_ProtocolVersionLabel @@ -133,7 +133,7 @@ Protocol version: - + lbl_ProtocolVersion @@ -149,7 +149,7 @@ PV - + lbl_ClientInformation @@ -165,7 +165,7 @@ CI - + lbl_clientIdentfier @@ -185,7 +185,7 @@ - + Layout7 @@ -210,7 +210,7 @@ Expanding - + PushButton7 @@ -244,5 +244,5 @@ accept() - + diff --git a/kbattleship/kbattleship/dialogs/serverDlg.ui b/kbattleship/kbattleship/dialogs/serverDlg.ui index f16216b5..dbd6b52f 100644 --- a/kbattleship/kbattleship/dialogs/serverDlg.ui +++ b/kbattleship/kbattleship/dialogs/serverDlg.ui @@ -1,10 +1,10 @@ serverStartDlg - + serverStartDlg - + 0 0 @@ -15,15 +15,15 @@ Start Server - + - + unnamed - + gamenameLabel @@ -34,7 +34,7 @@ gamenameEdit - + portEdit @@ -48,7 +48,7 @@ Choose a port where the server listens on - + portLabel_2 @@ -63,7 +63,7 @@ &Port: - + AlignVCenter|AlignLeft @@ -74,7 +74,7 @@ - + nicknameLabel @@ -95,7 +95,7 @@ &Nick name: - + AlignVCenter|AlignLeft @@ -104,7 +104,7 @@ - + gamenameEdit @@ -115,7 +115,7 @@ Enter a name that identifies you in the game - + nicknameEdit @@ -128,5 +128,5 @@ - + diff --git a/kbattleship/kbattleship/dialogs/statDlg.ui b/kbattleship/kbattleship/dialogs/statDlg.ui index 7ff2c202..6af104de 100644 --- a/kbattleship/kbattleship/dialogs/statDlg.ui +++ b/kbattleship/kbattleship/dialogs/statDlg.ui @@ -1,10 +1,10 @@ statDlg - + statDlg - + 0 0 @@ -32,14 +32,14 @@ Expanding - + 20 20 - + Layout8 @@ -63,14 +63,14 @@ Expanding - + 20 20 - + OwnLabel @@ -84,7 +84,7 @@ 0 - + TextLabel1 @@ -97,13 +97,13 @@ : - + AlignCenter - + EnemyLabel @@ -116,7 +116,7 @@ 0 - + AlignVCenter|AlignRight @@ -132,7 +132,7 @@ Expanding - + 20 20 @@ -151,14 +151,14 @@ Expanding - + 20 20 - + gbShots @@ -181,7 +181,7 @@ 6 - + Layout17 @@ -195,7 +195,7 @@ 6 - + pShots_2 @@ -224,14 +224,14 @@ Expanding - + 20 20 - + ShotLCD @@ -255,7 +255,7 @@ - + gbHits @@ -272,7 +272,7 @@ 6 - + Layout15 @@ -286,7 +286,7 @@ 6 - + pHits_2 @@ -315,14 +315,14 @@ Expanding - + 20 20 - + HitLCD @@ -343,7 +343,7 @@ - + gbWater @@ -360,7 +360,7 @@ 6 - + Layout18 @@ -374,7 +374,7 @@ 6 - + pWater_2 @@ -403,14 +403,14 @@ Expanding - + 20 20 - + WaterLCD @@ -441,7 +441,7 @@ Expanding - + 20 20 @@ -461,5 +461,5 @@ 789c3d98d9522b460e86efcf53504777a7a614e3dd959a0bc060035e31669b9a0bb51730c678df989a77cfef96d421247ca8b5fc92ba7d92bffe9cbd749a677ffefab5dec86632381b7cc8eaeccf703b9b1dfff3df7fffefd7ef5ce60c7f670bd9b3ecef7ffdfa1d32678333cae0af522ef29d71def8d2b86cfc9038447e331e987d9d58ed7de7b2dadbcae719b5d3dcd9ecf7c679655a189795799f38faf393f140996e94b319b31f8df3957c8cff9c7810b96a3c50e60be55cc6ec1abfec7ab8a79cea6767ab6f636cf5f3dad8ea0fb789355e30b6fef020b1da0fcaae275c39ab1e1e1bbbbe4262d533342eab9dae13abfdc3d8f487aeb2ebe76767d1f87963ef5fd6d9ece7c665657e3cf1799a273f18fb3cb789a3beeec6d8f5af945dbf8871deec7d67ebc7c2d8f4f22cb1eaf9311e987d9258ed2367ab7fa99cfaf1eeac7609c6a69fbb89b53f7563ef4727b1da73c69eef32b1da5f94f31965a6c8691f588c4dbfd48c7dbf76ce66a7c4311e358dad1f524dacf637e59ced1bb5136b3d5367ad9f5ac6b61f5475b6fd38248e76c9185b7fe822b1eaef197b7f3e136b7cd3effd09afce41cf5f19fb3c5ace6aa7983f9bf6452ac6de8f5162cdf7a29cde8799b3d5ff6cecf7efdbd9ec2563dfc7b9b3f587126bbeacb1e9a75e62ed9fc71fa81ea92be7bd9e65628d977336fd0563eb0f579dad7f2de3b29d7f30f67c711fb215d7136ace763fae8cbd7f4767d37b9358ed3fca5e3f7f2556bd0767cb3f36f67d1a385bfd569fd72f6f8987d1ee6c7ac23e71b493cea352f07d7a491ced12fb933bcff9fbfa6a6c7a65e66cf36828bbbeb04dacfd5b199b1eba74b6fedf1bfb7e1c9cadfea5b1f7b3e36cfef9c4aaef56b9e0f98fcea6b796389e0f4de382d96f126b3fe27ee5d2fce4d6d8eb3d37f6fdbd76b6fa878935de93b2d7270fcea6a79858cf4f8dbdbe4662d53b741e14e2f90be38a9dbf4eacfb5171b6f31de3a1e5ff4eacf9e3e7511ef3b2f96f8c5d6f4139f5bbe16cfbb932b6fa696fecf5349db59e3032f67a2689f57cddd9ce4f958be776be9658ebbf71b6f38fc6de2fcd2f5e5fb830b6fae4ced8ea916c62dd9f0f678b1f94bd1ef94aacf3da3a5bfefbc46a777fab8fc689d5de35f6f9c5fd2f640b05dbcf86b2e70b3fce16af6c6c7ae53db19eff74363d8bc4da0f67eb0fad9cf53ce7126bbcb9b1efd3d1d9cebf26567b4fb9e4fd89f32a88d71b06ce66ff34f6793d3b5bfdef89d5be36f67a76ce564f39b1da4bce43eddf9d72c9f76be26cfeb789d53e7436ff91b1f733be87c5acdbb9686c76ce38ab5d96c6a68f7689751e5fce966f6d6c7ac2d859ed21def762aa3fec8cbdbfe7c63edfbbc45affd6d9f23d195b3fe923b19eef3adbf94fe5b2efffccd9f4c679947229de5439d98bc6deaf92b3d95f138fa2ffc0d8ea0df1fd2b8574fec7d8f55c258efef2616c7ae8d1d9e2c5fee38f7b43cbf7ae5cf1f91612477bb8761e15238bb1d5132689357ffcefb372a8b8de7b67b3bf386b3cda185bfdd47756bbec8dadde10cf57f26ea78ab1e9e37367b57336b1fab3b2b8def83e550662fa649e58eba91b8bdabb1b26160e3ce0218f78cceffcc113fee429fef9c5337c7ff39c17bc846582af39af78cd1bde763731df8677bce7031ff9872ff892afb8cad77cc335aef32dbeeef89e1bdce4167ed386adc35d9c7ee01e3f44ff47eec3ff899f91b3c52ffcca6f9ce173ce728ef35ce02297f05319bf7be50ae2bee0dc1bef88cd7f83cafba8eb8a88845b14b844031ad288c6f44e1f34e137fa44ee6b6ed094be6846df88d2e715cdd59f167ca4254edcd08ad6b4a12ded28d09e0e74a41fe86dd305f7e91267eafc4a57885425a12a8fa3ff135dd30db886c8759aa1ca3addd21ddd53951ad4a4166a5b529bdac8dfa13d7297a94b0fd4e369f43ff57dc22fa8f791fa34e25b7aa2677aa1577aa30c9df39cb298d152274039cad3150dd1c9776a47ff211f68498553975073910aa0364fa94465aa0843fb2b1d857823c27d0950b34505797451f52ff92003be95217ed7a4aa8c507755c6f22e1ff42113f99429ede44b66f48c492fe59b6b72ea89f02afaa343b482e62f78f7a014ded496057dd2a32c29c80adf4b59d34a3694e505f5309b2ff4d0f2a3331df438275bc4cc4125b64b76b2e73b643dc8024adb3493a3fcc8858ce15fe51bb9c446d4e839eef79554e51a14d09b3636b3cf5f31f717a69fc50cdb98213443c10dcfa52675e8bcc5e97b5e46ff5bb9433fa6728fcaaad8a6be4c658f0dda4a439ad2a21769c3a3814daed1443ab8050dd94a97afa51af52fe8809343587bf07d40b706d2931d8d642d8fd297963c207f40bc23b7e409353c23ff0a3bacf39fa3b217799537c9a0febe9c43f71e9dcf626a39c11f74a881c91631a1a21cb14fd82129a19b2b91e83f96326ac3ecf95b3252917a60da7109678b98c4919e0261b773320912023ab20c03dc8a3cf2af63ff73d4912e5d85217fa303cf61848c35dc8470ea12badf44e426faf1888a3e70977a50b285da0bf5c75635b077537c8454b14b1bec721ffbbfc2366fd1f11aedc3587ab486f7845af09a8577dcc9a2d47911ebefe35e35691d3ee880fdeaf3166fd14c1ec204a74af0df05fc1bb3dc63b3dbb8b53dd83ee50691ecff4fe1a56ae34e8c30a34fd4b0a6676cef17b47e4a8f9bf2c1af612a0ff406db842e90ad717a63907f1ffd2788dae67af8a229269b0933d480b72f7ccb2eccd1c53db41c51f951821cb81d16e8de90af4fbb12fd0f889943059f88104e5b80aeb730d53195b16b3dec47239ceeffe95435ac30bd4beae2055986b5ea87822a5ebe06ee652e6c4eb700b358e06b0eef1dfcaaa77b2b6fd4099f611b7698247a110eda7fbc9c630c768f19d730f52ee2bf862366dec6bd20285923f712513be107fe1738d5c01b7d7a95a27fb80c57f0afe2b737785f6fa1af18f05606dc16fe0eb530c44f5fb0e28e40770df716d5867ab8d5fe87bb704f0bbc8105bc22d7786df0e663f7bba7379f0ea181cc43dc864e68483634d1834bbe0c2da87e228efeb7618daf76b8c21b56c31d29a136dde82ddefc1c174307113ba78d42f62a7ad8c50eddd33ce8fbbf0e0fb408f7bc878a1eb6fa0dd3bcc6e7c07778c4cf3778d1d7127f4fe8c9e9f303afd03ef4a13bfa87a7987f8d78cfdcc1fb38c73754e27daba2ceabd00a2fd0fb125e4f1cead073dddd40f53af463fe157e7a0b99b0c64b7efaf43cbde647be4435e7211bb2e8d765c885163e217a218fd8b81fe13eb45173e1f7fffffef50feb776dab - + diff --git a/kbattleship/kbattleship/kbaiplayer.h b/kbattleship/kbattleship/kbaiplayer.h index c5aa3a79..9f7128c3 100644 --- a/kbattleship/kbattleship/kbaiplayer.h +++ b/kbattleship/kbattleship/kbaiplayer.h @@ -26,9 +26,10 @@ #include "kbattlefield.h" #include "kshiplist.h" -class KBAIPlayer : public QObject +class KBAIPlayer : public TQObject { Q_OBJECT + TQ_OBJECT public: KBAIPlayer(); ~KBAIPlayer(); diff --git a/kbattleship/kbattleship/kbattlefield.cpp b/kbattleship/kbattleship/kbattlefield.cpp index c4a9e422..bb6cbd5a 100644 --- a/kbattleship/kbattleship/kbattlefield.cpp +++ b/kbattleship/kbattleship/kbattlefield.cpp @@ -20,10 +20,10 @@ #include "kbattlefield.h" -KBattleField::KBattleField(TQWidget *parent, bool grid) : KGridWidget(parent, grid) +KBattleField::KBattleField(TQWidget *tqparent, bool grid) : KGridWidget(tqparent, grid) { - m_parent = parent; - m_width = parent->width(); + m_parent = tqparent; + m_width = tqparent->width(); m_canDraw = true; m_ownfieldx = 10; @@ -91,7 +91,7 @@ void KBattleField::drawOwnField() if(!m_canDraw) return; - KBattleshipWindow *window = static_cast(m_parent->parent()->parent()); + KBattleshipWindow *window = static_cast(TQT_TQWIDGET(m_parent->tqparent()->tqparent())); KShip *ship = 0; int data; @@ -151,7 +151,7 @@ void KBattleField::drawEnemyField() if(!m_canDraw) return; - KBattleshipWindow *window = static_cast(m_parent->parent()->parent()); + KBattleshipWindow *window = static_cast(TQT_TQWIDGET(m_parent->tqparent()->tqparent())); for(int i = 0; i != m_enemyfieldx; i++) { diff --git a/kbattleship/kbattleship/kbattlefield.h b/kbattleship/kbattleship/kbattlefield.h index 94bcf3f5..51c62198 100644 --- a/kbattleship/kbattleship/kbattlefield.h +++ b/kbattleship/kbattleship/kbattlefield.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(TQWidget *parent, bool grid); + KBattleField(TQWidget *tqparent, bool grid); void clearOwnField(); void clearEnemyField(); diff --git a/kbattleship/kbattleship/kbattleship.cpp b/kbattleship/kbattleship/kbattleship.cpp index 32759e28..62952b19 100644 --- a/kbattleship/kbattleship/kbattleship.cpp +++ b/kbattleship/kbattleship/kbattleship.cpp @@ -84,24 +84,24 @@ void KBattleshipWindow::initStatusBar() { m_ownNickname = "-"; m_enemyNickname = "-"; - statusBar()->insertItem(i18n(" Player 1: %1 ").arg(m_ownNickname), ID_PLAYER_OWN, 0, true); - statusBar()->insertItem(i18n(" Player 2: %1 ").arg(m_enemyNickname), ID_PLAYER_ENEMY, 0, true); + statusBar()->insertItem(i18n(" Player 1: %1 ").tqarg(m_ownNickname), ID_PLAYER_OWN, 0, true); + statusBar()->insertItem(i18n(" Player 2: %1 ").tqarg(m_enemyNickname), ID_PLAYER_ENEMY, 0, true); statusBar()->insertItem(i18n("Ready"), ID_STATUS_MSG, 1); statusBar()->setItemAlignment(ID_STATUS_MSG, AlignLeft); } void KBattleshipWindow::initActions() { - 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"); + KStdAction::configureNotifications(TQT_TQOBJECT(this), TQT_SLOT(slotConfigureNotifications()), actionCollection()); + m_gameServerConnect = new KAction(i18n("&Connect to Server..."), "connect_no", Key_F2, TQT_TQOBJECT(this), TQT_SLOT(slotServerConnect()), actionCollection(), "game_serverconnect"); + m_gameNewServer = new KAction(i18n("&Start Server..."), "network", Key_F3, TQT_TQOBJECT(this), TQT_SLOT(slotNewServer()), actionCollection(), "game_newserver"); + m_gameSingle = new KAction(i18n("S&ingle Player..."), "gear", Key_F4, TQT_TQOBJECT(this), TQT_SLOT(slotSinglePlayer()), actionCollection(), "game_singleplayer"); + m_gameQuit = KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(slotHighscore()), actionCollection()); + m_gameEnemyInfo = new KAction(i18n("&Enemy Info"), "view_text", Key_F11, TQT_TQOBJECT(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, TQT_SLOT(slotShowGrid()), actionCollection(), "options_show_grid"); + m_configGrid = new KToggleAction(i18n("&Show Grid"), 0, TQT_TQOBJECT(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, 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 &))); + connect(m_chat, TQT_SIGNAL(sigSendMessage(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotSendChatMessage(const TQString &))); + connect(m_chat, TQT_SIGNAL(sigChangeEnemyNickname(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + connect(m_chat, TQT_SIGNAL(sigChangeOwnNickname(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotChangedNickCommand(const TQString &))); } void KBattleshipWindow::changeShipPlacementDirection(){ @@ -122,8 +122,8 @@ void KBattleshipWindow::changeShipPlacementDirection(){ void KBattleshipWindow::initShipPlacing() { - 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())); + connect(m_ownshiplist, TQT_SIGNAL(sigOwnFieldDataChanged(int, int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotChangeOwnFieldData(int, int, int))); + connect(m_ownshiplist, TQT_SIGNAL(sigLastShipAdded()), TQT_TQOBJECT(this), TQT_SLOT(slotShipsReady())); } void KBattleshipWindow::initView() @@ -148,10 +148,10 @@ void KBattleshipWindow::initView() m_view->startDrawing(); setFocusProxy(m_view); - 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())); + connect(m_view, TQT_SIGNAL(sigEnemyFieldClicked(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotEnemyFieldClick(int, int))); + connect(m_view, TQT_SIGNAL(sigOwnFieldClicked(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotPlaceShip(int, int))); + connect(m_view, TQT_SIGNAL(sigMouseOverField(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotPlaceShipPreview(int, int))); + connect(m_view, TQT_SIGNAL(changeShipPlacementDirection()), TQT_TQOBJECT(this), TQT_SLOT(changeShipPlacementDirection())); } void KBattleshipWindow::slotDeleteAI() @@ -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?"),TQString::null,i18n("Restart"),i18n("Do Not Restart"))) + switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"),TQString(),i18n("Restart"),i18n("Do Not Restart"))) { case KMessageBox::Yes: - TQTimer::singleShot(0, this, TQT_SLOT(slotRestartAI())); + TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(slotRestartAI())); break; case KMessageBox::No: - TQTimer::singleShot(0, this, TQT_SLOT(slotDeleteAI())); + TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(slotDeleteAI())); break; } return; @@ -697,8 +697,8 @@ void KBattleshipWindow::slotServerConnect() slotStatusMsg(i18n("Loading Connect-Server dialog...")); m_client = new KClientDialog(this); - connect(m_client, TQT_SIGNAL(sigConnectServer()), this, TQT_SLOT(slotConnectToBattleshipServer())); - connect(m_client, TQT_SIGNAL(sigCancelConnect()), this, TQT_SLOT(slotDeleteConnectDialog())); + connect(m_client, TQT_SIGNAL(sigConnectServer()), TQT_TQOBJECT(this), TQT_SLOT(slotConnectToBattleshipServer())); + connect(m_client, TQT_SIGNAL(sigCancelConnect()), TQT_TQOBJECT(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?"),TQString::null,i18n("Accept Restart"), i18n("Deny Restart"))) + switch(KMessageBox::questionYesNo(this, i18n("The client is asking to restart the game. Do you accept?"),TQString(),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?"), TQString::null, i18n("Restart"), i18n("Do Not Restart"))) + switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"), TQString(), 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?"), TQString::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(), 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, TQT_SIGNAL(okClicked()), this, TQT_SLOT(slotStartBattleshipServer())); - connect(m_server, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(slotDeleteServerDialog())); + connect(m_server, TQT_SIGNAL(okClicked()), TQT_TQOBJECT(this), TQT_SLOT(slotStartBattleshipServer())); + connect(m_server, TQT_SIGNAL(cancelClicked()), TQT_TQOBJECT(this), TQT_SLOT(slotDeleteServerDialog())); m_server->show(); slotStatusMsg(i18n("Ready")); @@ -828,7 +828,7 @@ void KBattleshipWindow::slotSendVersion() msg->versionMessage(); slotSendMessage(msg); - TQTimer::singleShot(150, this, TQT_SLOT(slotSendGreet())); + TQTimer::singleShot(150, TQT_TQOBJECT(this), TQT_SLOT(slotSendGreet())); } void KBattleshipWindow::slotSendGreet() @@ -862,49 +862,49 @@ void KBattleshipWindow::slotStartBattleshipServer() if(m_connection == 0) { m_connection = new KonnectionHandling(this, m_kbserver); - 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(sigStatusBar(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotStatusMsg(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigSendNickname()), TQT_TQOBJECT(this), TQT_SLOT(slotSendGreet())); + connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetPlaceable(bool))); + connect(m_connection, TQT_SIGNAL(sigShootable(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetShootable(bool))); + connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotSendEnemyFieldState(int, int))); + connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + connect(m_connection, TQT_SIGNAL(sigClientLost()), TQT_TQOBJECT(this), TQT_SLOT(slotClientLost())); + connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), TQT_TQOBJECT(this), TQT_SLOT(slotAbortNetworkGame())); + connect(m_connection, TQT_SIGNAL(sigReplay()), TQT_TQOBJECT(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 *))); + connect(m_connection, TQT_SIGNAL(sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedClientInformation(const TQString &, const TQString &, const TQString &, const TQString &))); + connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), TQT_TQOBJECT(this), TQT_SLOT(slotLost(KMessage *))); } else { if(m_connection->type() == KonnectionHandling::CLIENT) { - 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_kbclient, TQT_SIGNAL(sigConnected()), TQT_TQOBJECT(this), TQT_SLOT(slotSendVersion())); + disconnect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), TQT_TQOBJECT(this), TQT_SLOT(slotAbortNetworkGame())); + disconnect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotStatusMsg(const TQString &))); + disconnect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + disconnect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotSendEnemyFieldState(int, int))); + disconnect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + disconnect(m_connection, TQT_SIGNAL(sigShootable(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetShootable(bool))); + disconnect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetPlaceable(bool))); + disconnect(m_connection, TQT_SIGNAL(sigServerLost()), TQT_TQOBJECT(this), TQT_SLOT(slotServerLost())); + disconnect(m_connection, TQT_SIGNAL(sigReplay()), TQT_TQOBJECT(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 *))); + disconnect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), TQT_TQOBJECT(this), TQT_SLOT(slotLost(KMessage *))); m_connection->updateInternal(m_kbserver); - 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(sigStatusBar(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotStatusMsg(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigSendNickname()), TQT_TQOBJECT(this), TQT_SLOT(slotSendGreet())); + connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetPlaceable(bool))); + connect(m_connection, TQT_SIGNAL(sigShootable(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetShootable(bool))); + connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotSendEnemyFieldState(int, int))); + connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + connect(m_connection, TQT_SIGNAL(sigClientLost()), TQT_TQOBJECT(this), TQT_SLOT(slotClientLost())); + connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), TQT_TQOBJECT(this), TQT_SLOT(slotAbortNetworkGame())); + connect(m_connection, TQT_SIGNAL(sigReplay()), TQT_TQOBJECT(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 *))); + connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), TQT_TQOBJECT(this), TQT_SLOT(slotLost(KMessage *))); } else m_connection->updateInternal(m_kbserver); @@ -1075,14 +1075,14 @@ void KBattleshipWindow::parseCommandLine() { if( !u.isValid()) { KMessageBox::sorry(this, i18n("The URL passed to KDE Battleship '%1' is not a valid url") - .arg(args->arg(0))); + .tqarg(args->arg(0))); return; } if( u.protocol() != "kbattleship" ) { KMessageBox::sorry(this, i18n("The URL passed to KDE Battleship '%1' is not recognised " "as a Battleship game.") - .arg(args->arg(0))); + .tqarg(args->arg(0))); return; } @@ -1119,51 +1119,51 @@ void KBattleshipWindow::slotConnectToBattleshipServer(const TQString &host, int if(m_connection == 0) { m_connection = new KonnectionHandling(this, m_kbclient); - 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_kbclient, TQT_SIGNAL(sigConnected()), TQT_TQOBJECT(this), TQT_SLOT(slotSendVersion())); + connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), TQT_TQOBJECT(this), TQT_SLOT(slotAbortNetworkGame())); + connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotStatusMsg(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotSendEnemyFieldState(int, int))); + connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + connect(m_connection, TQT_SIGNAL(sigShootable(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetShootable(bool))); + connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetPlaceable(bool))); + connect(m_connection, TQT_SIGNAL(sigServerLost()), TQT_TQOBJECT(this), TQT_SLOT(slotServerLost())); + connect(m_connection, TQT_SIGNAL(sigReplay()), TQT_TQOBJECT(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 *))); + connect(m_connection, TQT_SIGNAL(sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedClientInformation(const TQString &, const TQString &, const TQString &, const TQString &))); + connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), TQT_TQOBJECT(this), TQT_SLOT(slotLost(KMessage *))); } else { if(m_connection->type() == KonnectionHandling::SERVER) { - 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(sigStatusBar(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotStatusMsg(const TQString &))); + disconnect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + disconnect(m_connection, TQT_SIGNAL(sigSendNickname()), TQT_TQOBJECT(this), TQT_SLOT(slotSendGreet())); + disconnect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetPlaceable(bool))); + disconnect(m_connection, TQT_SIGNAL(sigShootable(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetShootable(bool))); + disconnect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotSendEnemyFieldState(int, int))); + disconnect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + disconnect(m_connection, TQT_SIGNAL(sigClientLost()), TQT_TQOBJECT(this), TQT_SLOT(slotClientLost())); + disconnect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), TQT_TQOBJECT(this), TQT_SLOT(slotAbortNetworkGame())); + disconnect(m_connection, TQT_SIGNAL(sigReplay()), TQT_TQOBJECT(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 *))); + disconnect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), TQT_TQOBJECT(this), TQT_SLOT(slotLost(KMessage *))); m_connection->updateInternal(m_kbclient); - 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_kbclient, TQT_SIGNAL(sigConnected()), TQT_TQOBJECT(this), TQT_SLOT(slotSendVersion())); + connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), TQT_TQOBJECT(this), TQT_SLOT(slotAbortNetworkGame())); + connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotStatusMsg(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotSendEnemyFieldState(int, int))); + connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + connect(m_connection, TQT_SIGNAL(sigShootable(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetShootable(bool))); + connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetPlaceable(bool))); + connect(m_connection, TQT_SIGNAL(sigServerLost()), TQT_TQOBJECT(this), TQT_SLOT(slotServerLost())); + connect(m_connection, TQT_SIGNAL(sigReplay()), TQT_TQOBJECT(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, 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 *))); + connect(m_connection, TQT_SIGNAL(sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedClientInformation(const TQString &, const TQString &, const TQString &, const TQString &))); + connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), TQT_TQOBJECT(this), TQT_SLOT(slotLost(KMessage *))); } else m_connection->updateInternal(m_kbclient); @@ -1198,13 +1198,13 @@ void KBattleshipWindow::slotStatusMsg(const TQString &text) void KBattleshipWindow::slotChangeOwnPlayer(const TQString &text) { statusBar()->clear(); - statusBar()->changeItem(i18n(" Player 1: %1 ").arg(text), ID_PLAYER_OWN); + statusBar()->changeItem(i18n(" Player 1: %1 ").tqarg(text), ID_PLAYER_OWN); } void KBattleshipWindow::slotChangeEnemyPlayer(const TQString &text) { statusBar()->clear(); - statusBar()->changeItem(i18n(" Player 2: %1 ").arg(text), ID_PLAYER_ENEMY); + statusBar()->changeItem(i18n(" Player 2: %1 ").tqarg(text), ID_PLAYER_ENEMY); } void KBattleshipWindow::slotSinglePlayer() @@ -1234,7 +1234,7 @@ void KBattleshipWindow::slotSinglePlayer() slotStatusMsg(i18n("Ready")); m_stat->clear(); m_chat->clear(); - TQTimer::singleShot(0, this, TQT_SLOT(slotDeleteAI())); + TQTimer::singleShot(0, TQT_TQOBJECT(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, TQT_SIGNAL(sigReady()), this, TQT_SLOT(slotAIReady())); - connect(m_aiPlayer, TQT_SIGNAL(sigShootAt(const TQPoint)), this, TQT_SLOT(slotAIShootsAt(const TQPoint))); + connect(m_aiPlayer, TQT_SIGNAL(sigReady()), TQT_TQOBJECT(this), TQT_SLOT(slotAIReady())); + connect(m_aiPlayer, TQT_SIGNAL(sigShootAt(const TQPoint)), TQT_TQOBJECT(this), TQT_SLOT(slotAIShootsAt(const TQPoint))); } m_aiPlayer->slotRestart(); } @@ -1317,14 +1317,14 @@ void KBattleshipWindow::slotAIShootsAt(const TQPoint 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?"), TQString::null, i18n("Restart"), i18n("Do Not Restart"))) + switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"), TQString(), i18n("Restart"), i18n("Do Not Restart"))) { case KMessageBox::Yes: - TQTimer::singleShot(0, this, TQT_SLOT(slotRestartAI())); + TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(slotRestartAI())); break; case KMessageBox::No: - TQTimer::singleShot(0, this, TQT_SLOT(slotDeleteAI())); + TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(slotDeleteAI())); break; } } diff --git a/kbattleship/kbattleship/kbattleship.h b/kbattleship/kbattleship/kbattleship.h index 9ba86eac..e90c16f0 100644 --- a/kbattleship/kbattleship/kbattleship.h +++ b/kbattleship/kbattleship/kbattleship.h @@ -47,6 +47,7 @@ class KBattleshipWindow : public KMainWindow { Q_OBJECT + TQ_OBJECT public: enum{ID_STATUS_MSG, ID_PLAYER_OWN, ID_PLAYER_ENEMY}; KBattleshipWindow(); diff --git a/kbattleship/kbattleship/kbattleshipclient.cpp b/kbattleship/kbattleship/kbattleshipclient.cpp index e7d61638..550323b1 100644 --- a/kbattleship/kbattleship/kbattleshipclient.cpp +++ b/kbattleship/kbattleship/kbattleshipclient.cpp @@ -43,8 +43,8 @@ void KBattleshipClient::init() return; } - m_readNotifier = new TQSocketNotifier(fd(), TQSocketNotifier::Read, this); - TQObject::connect(m_readNotifier, TQT_SIGNAL(activated(int)), TQT_SLOT(slotReadData())); + m_readNotifier = new TQSocketNotifier(fd(), TQSocketNotifier::Read, TQT_TQOBJECT(this)); + TQT_BASE_OBJECT_NAME::connect(m_readNotifier, TQT_SIGNAL(activated(int)), TQT_SLOT(slotReadData())); emit sigConnected(); } @@ -73,7 +73,7 @@ void KBattleshipClient::slotReadData() m_readBuffer += TQString::fromUtf8(buf); delete []buf; int pos; - while ((pos = m_readBuffer.find("")) >= 0) + while ((pos = m_readBuffer.tqfind("")) >= 0) { pos += 11; // Length of "" KMessage *msg = new KMessage(); diff --git a/kbattleship/kbattleship/kbattleshipclient.h b/kbattleship/kbattleship/kbattleshipclient.h index 1f6bdd96..8ea29fb8 100644 --- a/kbattleship/kbattleship/kbattleshipclient.h +++ b/kbattleship/kbattleship/kbattleshipclient.h @@ -25,6 +25,7 @@ class KBattleshipClient : public KExtendedSocket { Q_OBJECT + TQ_OBJECT public: KBattleshipClient(const TQString &host, int port); diff --git a/kbattleship/kbattleship/kbattleshipserver.cpp b/kbattleship/kbattleship/kbattleshipserver.cpp index a90533cc..34be153d 100644 --- a/kbattleship/kbattleship/kbattleshipserver.cpp +++ b/kbattleship/kbattleship/kbattleshipserver.cpp @@ -31,7 +31,7 @@ #include "kbattleshipserver.moc" KBattleshipServer::KBattleshipServer(int port, const TQString& name) - : KExtendedSocket(TQString::null, port, inetSocket | passiveSocket), m_name(name) + : KExtendedSocket(TQString(), port, inetSocket | passiveSocket), m_name(name) { m_port = port; m_serverSocket = 0; @@ -41,7 +41,7 @@ void KBattleshipServer::init() { if(listen()) { - KMessageBox::error(0L, i18n("Failed to bind to local port \"%1\"\n\nPlease check if another KBattleship server instance\nis running or another application uses this port.").arg(m_port)); + KMessageBox::error(0L, i18n("Failed to bind to local port \"%1\"\n\nPlease check if another KBattleship server instance\nis running or another application uses this port.").tqarg(m_port)); emit sigServerFailure(); return; } @@ -49,8 +49,8 @@ void KBattleshipServer::init() m_service.setType(BATTLESHIP_SERVICE); m_service.setPort(m_port); m_service.publishAsync(); - m_connectNotifier = new TQSocketNotifier(fd(), TQSocketNotifier::Read, this); - TQObject::connect(m_connectNotifier, TQT_SIGNAL(activated(int)), TQT_SLOT(slotNewConnection())); + m_connectNotifier = new TQSocketNotifier(fd(), TQSocketNotifier::Read, TQT_TQOBJECT(this)); + TQT_BASE_OBJECT_NAME::connect(m_connectNotifier, TQT_SIGNAL(activated(int)), TQT_SLOT(slotNewConnection())); } void KBattleshipServer::slotNewConnection() @@ -61,7 +61,7 @@ void KBattleshipServer::slotNewConnection() { m_service.stop(); m_serverSocket = sock; - m_readNotifier = new TQSocketNotifier(sock->fd(), TQSocketNotifier::Read, this); + m_readNotifier = new TQSocketNotifier(sock->fd(), TQSocketNotifier::Read, TQT_TQOBJECT(this)); TQObject::connect(m_readNotifier, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotReadClient())); emit sigNewConnect(); } @@ -85,7 +85,7 @@ void KBattleshipServer::slotReadClient() m_readBuffer += TQString::fromUtf8(buf); delete []buf; int pos; - while ((pos = m_readBuffer.find("")) >= 0) + while ((pos = m_readBuffer.tqfind("")) >= 0) { pos += 11; // Length of "" KMessage *msg = new KMessage(); diff --git a/kbattleship/kbattleship/kbattleshipserver.h b/kbattleship/kbattleship/kbattleshipserver.h index bb198db8..010165ca 100644 --- a/kbattleship/kbattleship/kbattleshipserver.h +++ b/kbattleship/kbattleship/kbattleshipserver.h @@ -26,6 +26,7 @@ class KBattleshipServer : public KExtendedSocket { Q_OBJECT + TQ_OBJECT public: KBattleshipServer(int port, const TQString& name); void init(); diff --git a/kbattleship/kbattleship/kbattleshipview.cpp b/kbattleship/kbattleship/kbattleshipview.cpp index 14339d78..35e1a06a 100644 --- a/kbattleship/kbattleship/kbattleshipview.cpp +++ b/kbattleship/kbattleship/kbattleshipview.cpp @@ -22,8 +22,8 @@ #include "kbattleship.h" #include "kbattleshipview.moc" -KBattleshipView::KBattleshipView(TQWidget *parent, const char *name, bool draw) - : TQWidget(parent, name, WResizeNoErase), m_drawGrid(draw) +KBattleshipView::KBattleshipView(TQWidget *tqparent, const char *name, bool draw) + : TQWidget(tqparent, 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(TQString("ship%1").arg(i)).isNull()) + while (!msg->field(TQString("ship%1").tqarg(i)).isNull()) { - 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(); + posx = msg->field(TQString("ship%1").tqarg(i)).section(" ", 0, 0).toInt(); + posy = msg->field(TQString("ship%1").tqarg(i)).section(" ", 1, 1).toInt(); + placedLeft = msg->field(TQString("ship%1").tqarg(i)).section(" ", 2, 2).toInt(); if (placedLeft == 0) left = false; else left = true; list->addNewShip(!left, posx, posy); @@ -152,7 +152,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) { if(event->type() == TQEvent::KeyPress && m_decide) { - TQKeyEvent *keyEvent = static_cast(event); + TQKeyEvent *keyEvent = TQT_TQKEYEVENT(event); if(keyEvent->key() == Key_Shift){ emit sigMouseOverField(m_lastX, m_lastY); emit changeShipPlacementDirection(); @@ -160,7 +160,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) } else if(event->type() == TQEvent::KeyRelease && m_decide) { - TQKeyEvent *keyEvent = static_cast(event); + TQKeyEvent *keyEvent = TQT_TQKEYEVENT(event); if(keyEvent->key() == Key_Shift){ emit sigMouseOverField(m_lastX, m_lastY); emit changeShipPlacementDirection(); @@ -170,15 +170,15 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) { m_decide = false; - TQMouseEvent *mouseEvent = static_cast(event); + TQMouseEvent *mouseEvent = TQT_TQMOUSEEVENT(event); - if(mouseEvent->button() == RightButton){ + if(mouseEvent->button() == Qt::RightButton){ emit sigMouseOverField(m_lastX, m_lastY); emit changeShipPlacementDirection(); return true; } - if(mouseEvent->button() != LeftButton) + if(mouseEvent->button() != Qt::LeftButton) return false; TQPoint point(mouseEvent->x(), mouseEvent->y()); @@ -190,9 +190,9 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) int fieldx = 0; int fieldy = 0; - if(ownRect.contains(point)) + if(ownRect.tqcontains(point)) newRect = ownRect; - else if(enemyRect.contains(point)) + else if(enemyRect.tqcontains(point)) newRect = enemyRect; else return false; @@ -204,7 +204,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) j++; TQRect tempRect(i, newRect.top(), m_battlefield->gridSize(), newRect.bottom() - newRect.top()); - if(tempRect.contains(point)) + if(tempRect.tqcontains(point)) { fieldx = j; break; @@ -218,7 +218,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) j++; TQRect tempRect(newRect.left(), i, newRect.right() - newRect.left(), m_battlefield->gridSize()); - if(tempRect.contains(point)) + if(tempRect.tqcontains(point)) { fieldy = j; break; @@ -237,7 +237,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) setFocus(); m_decide = true; - TQMouseEvent *mouseEvent = static_cast(event); + TQMouseEvent *mouseEvent = TQT_TQMOUSEEVENT(event); TQPoint point(mouseEvent->x(), mouseEvent->y()); TQRect ownRect = m_battlefield->ownRect(); @@ -245,7 +245,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) int fieldx = 0; int fieldy = 0; - if(ownRect.contains(point)) + if(ownRect.tqcontains(point)) { int j = -1; @@ -254,7 +254,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) j++; TQRect tempRect(i, ownRect.top(), m_battlefield->gridSize(), ownRect.bottom() - ownRect.top()); - if(tempRect.contains(point)) + if(tempRect.tqcontains(point)) { fieldx = j; break; @@ -268,7 +268,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) j++; TQRect tempRect(ownRect.left(), i, ownRect.right() - ownRect.left(), m_battlefield->gridSize()); - if(tempRect.contains(point)) + if(tempRect.tqcontains(point)) { fieldy = j; break; diff --git a/kbattleship/kbattleship/kbattleshipview.h b/kbattleship/kbattleship/kbattleshipview.h index 51d1fcc3..7e65b9f3 100644 --- a/kbattleship/kbattleship/kbattleshipview.h +++ b/kbattleship/kbattleship/kbattleshipview.h @@ -30,11 +30,12 @@ #include "kship.h" #include "kshiplist.h" -class KBattleshipView : public QWidget +class KBattleshipView : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KBattleshipView(TQWidget *parent = 0, const char *name = 0, bool draw = false); + KBattleshipView(TQWidget *tqparent = 0, const char *name = 0, bool draw = false); ~KBattleshipView(); KBattleField *field() { return m_battlefield; } diff --git a/kbattleship/kbattleship/kbchooserstrategy.cpp b/kbattleship/kbattleship/kbchooserstrategy.cpp index 6473e73b..fc832086 100644 --- a/kbattleship/kbattleship/kbchooserstrategy.cpp +++ b/kbattleship/kbattleship/kbchooserstrategy.cpp @@ -25,7 +25,7 @@ #define MAX_CHILD_NUM 4 -KBChooserStrategy::KBChooserStrategy(KBStrategy *parent) : KBStrategy(parent) +KBChooserStrategy::KBChooserStrategy(KBStrategy *tqparent) : KBStrategy(tqparent) { m_destroyer = new KBDestroyShipStrategy(this); m_destroying = false; diff --git a/kbattleship/kbattleship/kbchooserstrategy.h b/kbattleship/kbattleship/kbchooserstrategy.h index 5ac7d7c2..c2df5103 100644 --- a/kbattleship/kbattleship/kbchooserstrategy.h +++ b/kbattleship/kbattleship/kbchooserstrategy.h @@ -25,7 +25,7 @@ class KBChooserStrategy : public KBStrategy { public: - KBChooserStrategy(KBStrategy *parent = 0); + KBChooserStrategy(KBStrategy *tqparent = 0); virtual ~KBChooserStrategy(); virtual void init(KBattleField *field, const TQRect &field_rect); diff --git a/kbattleship/kbattleship/kbdestroyshipstrategy.cpp b/kbattleship/kbattleship/kbdestroyshipstrategy.cpp index a3882963..05095311 100644 --- a/kbattleship/kbattleship/kbdestroyshipstrategy.cpp +++ b/kbattleship/kbattleship/kbdestroyshipstrategy.cpp @@ -17,7 +17,7 @@ #include "kbdestroyshipstrategy.h" -KBDestroyShipStrategy::KBDestroyShipStrategy(KBStrategy *parent) : KBStrategy(parent) +KBDestroyShipStrategy::KBDestroyShipStrategy(KBStrategy *tqparent) : KBStrategy(tqparent) { m_working = false; } @@ -320,7 +320,7 @@ void KBDestroyShipStrategy::markBorderingFields() if (m_direction == VERTICAL) { - while (m_fieldRect.contains(col, row) && + while (m_fieldRect.tqcontains(col, row) && m_battleField->ownState(col, row) == KBattleField::HIT) { row--; @@ -332,24 +332,24 @@ void KBDestroyShipStrategy::markBorderingFields() row++; i = col+1; // right of the ship j = col-1; // left of the ship - while (m_fieldRect.contains(col, row) && + while (m_fieldRect.tqcontains(col, row) && m_battleField->ownState(col, row) == KBattleField::HIT) { - if (m_fieldRect.contains(i, row)) + if (m_fieldRect.tqcontains(i, row)) setViablePos(i, row, false); - if (m_fieldRect.contains(j, row)) + if (m_fieldRect.tqcontains(j, row)) setViablePos(j, row, false); setViablePos(col, row, false); row++; } - if (m_fieldRect.contains(col, row)) + if (m_fieldRect.tqcontains(col, row)) { // below the ship setViablePos(col, row, false); } } else if (m_direction == HORIZONTAL) { - while (m_fieldRect.contains(col, row) && + while (m_fieldRect.tqcontains(col, row) && m_battleField->ownState(col, row) == KBattleField::HIT) { col--; @@ -361,17 +361,17 @@ void KBDestroyShipStrategy::markBorderingFields() col++; i = row+1; // below the ship j = row-1; // above the ship - while (m_fieldRect.contains(col, row) && + while (m_fieldRect.tqcontains(col, row) && m_battleField->ownState(col, row) == KBattleField::HIT) { - if (m_fieldRect.contains(col, i)) + if (m_fieldRect.tqcontains(col, i)) setViablePos(col, i, false); - if (m_fieldRect.contains(col, j)) + if (m_fieldRect.tqcontains(col, j)) setViablePos(col, j, false); setViablePos(col, row, false); col++; } - if (m_fieldRect.contains(col, row)) + if (m_fieldRect.tqcontains(col, row)) { // right of the ship setViablePos(col, row, false); } diff --git a/kbattleship/kbattleship/kbdestroyshipstrategy.h b/kbattleship/kbattleship/kbdestroyshipstrategy.h index 41503be1..c6e758a3 100644 --- a/kbattleship/kbattleship/kbdestroyshipstrategy.h +++ b/kbattleship/kbattleship/kbdestroyshipstrategy.h @@ -23,7 +23,7 @@ class KBDestroyShipStrategy : public KBStrategy { public: - KBDestroyShipStrategy(KBStrategy *parent = 0); + KBDestroyShipStrategy(KBStrategy *tqparent = 0); virtual void init(KBattleField *field, const TQRect &field_rect); virtual const TQPoint nextShot(); diff --git a/kbattleship/kbattleship/kbdiagonalshotstrategy.cpp b/kbattleship/kbattleship/kbdiagonalshotstrategy.cpp index db83bc75..57dc317d 100644 --- a/kbattleship/kbattleship/kbdiagonalshotstrategy.cpp +++ b/kbattleship/kbattleship/kbdiagonalshotstrategy.cpp @@ -16,7 +16,7 @@ #include "kbdiagonalshotstrategy.h" -KBDiagonalShotStrategy::KBDiagonalShotStrategy(KBStrategy *parent) : KBStrategy(parent) +KBDiagonalShotStrategy::KBDiagonalShotStrategy(KBStrategy *tqparent) : KBStrategy(tqparent) { m_column = 0; m_row = 0; @@ -34,7 +34,7 @@ const TQPoint KBDiagonalShotStrategy::nextShot() bool KBDiagonalShotStrategy::advance() { - while (m_fieldRect.contains(m_column, m_row)) + while (m_fieldRect.tqcontains(m_column, m_row)) { if(enemyFieldStateAt(m_column, m_row) != KBStrategy::SHOT) return true; @@ -97,7 +97,7 @@ TQPoint KBDiagonalShotStrategy::endPoint() if(m_vertical == 0 || m_horizontal == 0) return TQPoint(col, row); - while(m_fieldRect.contains(col, row)) + while(m_fieldRect.tqcontains(col, row)) { row += m_vertical; col += m_horizontal; diff --git a/kbattleship/kbattleship/kbdiagonalshotstrategy.h b/kbattleship/kbattleship/kbdiagonalshotstrategy.h index e328fad2..47af1240 100644 --- a/kbattleship/kbattleship/kbdiagonalshotstrategy.h +++ b/kbattleship/kbattleship/kbdiagonalshotstrategy.h @@ -23,7 +23,7 @@ class KBDiagonalShotStrategy : public KBStrategy { public: enum Direction {LEFTUP, LEFTDOWN, RIGHTUP, RIGHTDOWN}; - KBDiagonalShotStrategy(KBStrategy *parent = 0); + KBDiagonalShotStrategy(KBStrategy *tqparent = 0); virtual const TQPoint nextShot(); virtual bool hasMoreShots(); diff --git a/kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp b/kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp index 7055403b..7f0a305e 100644 --- a/kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp +++ b/kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp @@ -17,11 +17,11 @@ #include #include "kbdiagonalwrapstrategy.h" -KBDiagonalWrapStrategy::KBDiagonalWrapStrategy(KBStrategy *parent) : KBStrategy(parent) +KBDiagonalWrapStrategy::KBDiagonalWrapStrategy(KBStrategy *tqparent) : KBStrategy(tqparent) { m_child = new KBDiagonalShotStrategy(this); - if(parent == 0) + if(tqparent == 0) { m_destroyer = new KBDestroyShipStrategy(this); m_destroying = false; diff --git a/kbattleship/kbattleship/kbdiagonalwrapstrategy.h b/kbattleship/kbattleship/kbdiagonalwrapstrategy.h index f4a7c28d..26c271d1 100644 --- a/kbattleship/kbattleship/kbdiagonalwrapstrategy.h +++ b/kbattleship/kbattleship/kbdiagonalwrapstrategy.h @@ -24,7 +24,7 @@ class KBDiagonalWrapStrategy : public KBStrategy { public: - KBDiagonalWrapStrategy(KBStrategy *parent = 0); + KBDiagonalWrapStrategy(KBStrategy *tqparent = 0); virtual ~KBDiagonalWrapStrategy(); virtual void init(KBattleField *field, const TQRect &field_rect); diff --git a/kbattleship/kbattleship/kbhorizontalstepstrategy.cpp b/kbattleship/kbattleship/kbhorizontalstepstrategy.cpp index a6e931da..63ee74fa 100644 --- a/kbattleship/kbattleship/kbhorizontalstepstrategy.cpp +++ b/kbattleship/kbattleship/kbhorizontalstepstrategy.cpp @@ -17,10 +17,10 @@ #include #include "kbhorizontalstepstrategy.h" -KBHorizontalStepStrategy::KBHorizontalStepStrategy(KBStrategy *parent) : KBStrategy(parent) +KBHorizontalStepStrategy::KBHorizontalStepStrategy(KBStrategy *tqparent) : KBStrategy(tqparent) { m_child = 0; - if(parent == 0) // only the master destroys ships + if(tqparent == 0) // only the master destroys ships { m_destroyer = new KBDestroyShipStrategy(this); m_destroying = false; diff --git a/kbattleship/kbattleship/kbhorizontalstepstrategy.h b/kbattleship/kbattleship/kbhorizontalstepstrategy.h index 80ec7b72..21bfac4e 100644 --- a/kbattleship/kbattleship/kbhorizontalstepstrategy.h +++ b/kbattleship/kbattleship/kbhorizontalstepstrategy.h @@ -23,7 +23,7 @@ class KBHorizontalStepStrategy : public KBStrategy { public: - KBHorizontalStepStrategy(KBStrategy *parent = 0); + KBHorizontalStepStrategy(KBStrategy *tqparent = 0); virtual ~KBHorizontalStepStrategy(); virtual void init(KBattleField *field, const TQRect &field_rect); diff --git a/kbattleship/kbattleship/kbrandomshotstrategy.cpp b/kbattleship/kbattleship/kbrandomshotstrategy.cpp index 62416350..901fbe75 100644 --- a/kbattleship/kbattleship/kbrandomshotstrategy.cpp +++ b/kbattleship/kbattleship/kbrandomshotstrategy.cpp @@ -16,7 +16,7 @@ #include "kbrandomshotstrategy.h" -KBRandomShotStrategy::KBRandomShotStrategy(KBStrategy *parent) : KBStrategy(parent) +KBRandomShotStrategy::KBRandomShotStrategy(KBStrategy *tqparent) : KBStrategy(tqparent) { m_destroyer = new KBDestroyShipStrategy(this); m_destroying = false; diff --git a/kbattleship/kbattleship/kbrandomshotstrategy.h b/kbattleship/kbattleship/kbrandomshotstrategy.h index 141961b9..79e15018 100644 --- a/kbattleship/kbattleship/kbrandomshotstrategy.h +++ b/kbattleship/kbattleship/kbrandomshotstrategy.h @@ -25,7 +25,7 @@ class KBRandomShotStrategy : public KBStrategy { public: - KBRandomShotStrategy(KBStrategy *parent = 0); + KBRandomShotStrategy(KBStrategy *tqparent = 0); virtual ~KBRandomShotStrategy(); virtual void init(KBattleField *field, const TQRect &field_rect); diff --git a/kbattleship/kbattleship/kbstrategy.cpp b/kbattleship/kbattleship/kbstrategy.cpp index be445559..e7ce823a 100644 --- a/kbattleship/kbattleship/kbstrategy.cpp +++ b/kbattleship/kbattleship/kbstrategy.cpp @@ -17,9 +17,9 @@ #include "kbstrategy.h" -KBStrategy::KBStrategy(KBStrategy *parent) +KBStrategy::KBStrategy(KBStrategy *tqparent) { - m_parent = parent; + m_parent = tqparent; m_viableShots = 0; } diff --git a/kbattleship/kbattleship/kbstrategy.h b/kbattleship/kbattleship/kbstrategy.h index 9c4cdf15..04ade696 100644 --- a/kbattleship/kbattleship/kbstrategy.h +++ b/kbattleship/kbattleship/kbstrategy.h @@ -26,7 +26,7 @@ class KBStrategy { public: enum{FREE, SHOT, SHIP}; - KBStrategy(KBStrategy *parent = 0); + KBStrategy(KBStrategy *tqparent = 0); virtual ~KBStrategy(); virtual const TQPoint nextShot() = 0; diff --git a/kbattleship/kbattleship/kbverticalstepstrategy.cpp b/kbattleship/kbattleship/kbverticalstepstrategy.cpp index 7642ccaf..a9784463 100644 --- a/kbattleship/kbattleship/kbverticalstepstrategy.cpp +++ b/kbattleship/kbattleship/kbverticalstepstrategy.cpp @@ -18,11 +18,11 @@ #include #include "kbverticalstepstrategy.h" -KBVerticalStepStrategy::KBVerticalStepStrategy(KBStrategy *parent) : KBStrategy(parent) +KBVerticalStepStrategy::KBVerticalStepStrategy(KBStrategy *tqparent) : KBStrategy(tqparent) { m_child = 0; - if(parent == 0) // only the master destroys ships + if(tqparent == 0) // only the master destroys ships { m_destroyer = new KBDestroyShipStrategy(this); m_destroying = false; diff --git a/kbattleship/kbattleship/kbverticalstepstrategy.h b/kbattleship/kbattleship/kbverticalstepstrategy.h index a5d614c6..642210ca 100644 --- a/kbattleship/kbattleship/kbverticalstepstrategy.h +++ b/kbattleship/kbattleship/kbverticalstepstrategy.h @@ -24,7 +24,7 @@ class KBVerticalStepStrategy : public KBStrategy { public: - KBVerticalStepStrategy(KBStrategy *parent = 0); + KBVerticalStepStrategy(KBStrategy *tqparent = 0); virtual ~KBVerticalStepStrategy(); virtual void init(KBattleField *field, const TQRect &field_rect); diff --git a/kbattleship/kbattleship/kchatwidget.cpp b/kbattleship/kbattleship/kchatwidget.cpp index 9d5e12af..1e9dd005 100644 --- a/kbattleship/kbattleship/kchatwidget.cpp +++ b/kbattleship/kbattleship/kchatwidget.cpp @@ -18,7 +18,7 @@ #include #include "kchatwidget.moc" -KChatWidget::KChatWidget(TQWidget *parent, const char *name) : chatDlg(parent, name) +KChatWidget::KChatWidget(TQWidget *tqparent, const char *name) : chatDlg(tqparent, name) { connect(sendBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotComputeMessage())); connect(commentEdit, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotComputeMessage())); @@ -26,13 +26,13 @@ KChatWidget::KChatWidget(TQWidget *parent, const char *name) : chatDlg(parent, n chatView->setMinimumSize(0, 50); commentEdit->installEventFilter(this); - m_currentNickname = TQString::null; + m_currentNickname = TQString(); slotAcceptMsg(false); } void KChatWidget::clear() { - m_currentNickname = TQString::null; + m_currentNickname = TQString(); slotAcceptMsg(false); chatView->clear(); commentEdit->clear(); @@ -61,9 +61,9 @@ void KChatWidget::slotReceivedMessage(const TQString &nickname, const TQString & bool KChatWidget::eventFilter(TQObject *obj, TQEvent *e) { - if(obj == commentEdit && e->type() == TQEvent::Wheel) + if(TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(commentEdit) && e->type() == TQEvent::Wheel) { - kapp->notify(chatView, e); + kapp->notify(TQT_TQOBJECT(chatView), e); return true; } return chatDlg::eventFilter(obj, e); diff --git a/kbattleship/kbattleship/kchatwidget.h b/kbattleship/kbattleship/kchatwidget.h index 7a0f0bed..574e8648 100644 --- a/kbattleship/kbattleship/kchatwidget.h +++ b/kbattleship/kbattleship/kchatwidget.h @@ -27,8 +27,9 @@ class KChatWidget : public chatDlg { Q_OBJECT + TQ_OBJECT public: - KChatWidget(TQWidget *parent = 0, const char *name = 0); + KChatWidget(TQWidget *tqparent = 0, const char *name = 0); void clear(); void setNickname(const TQString &nickname) { m_currentNickname = nickname; } diff --git a/kbattleship/kbattleship/kclientdialog.cpp b/kbattleship/kbattleship/kclientdialog.cpp index 97015b71..37cd7fe7 100644 --- a/kbattleship/kbattleship/kclientdialog.cpp +++ b/kbattleship/kbattleship/kclientdialog.cpp @@ -25,8 +25,8 @@ #include "kbattleshipserver.h" // for BATTLESHIP_SERVICE #include "kclientdialog.moc" -KClientDialog::KClientDialog(TQWidget *parent, const char *name) - : KDialogBase(Plain, i18n("Connect to Server"), Ok|Cancel, Ok, parent, name, true, false, KGuiItem(i18n("&Connect"))) +KClientDialog::KClientDialog(TQWidget *tqparent, const char *name) + : KDialogBase(Plain, i18n("Connect to Server"), Ok|Cancel, Ok, tqparent, name, true, false, KGuiItem(i18n("&Connect"))) { TQFrame* page = plainPage(); TQGridLayout* pageLayout = new TQGridLayout(page, 1, 1, 0, 0); @@ -42,7 +42,7 @@ KClientDialog::KClientDialog(TQWidget *parent, const char *name) connect(m_mainWidget->serverEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotCheckEnableOk())); m_config->setGroup("History"); - m_browser = new DNSSD::ServiceBrowser(TQString::fromLatin1(BATTLESHIP_SERVICE)); + m_browser = new DNSSD::ServiceBrowser(TQString::tqfromLatin1(BATTLESHIP_SERVICE)); connect(m_browser,TQT_SIGNAL(finished()),TQT_SLOT(nextBatch())); m_browser->startBrowse(); connect(m_mainWidget->lanBox,TQT_SIGNAL(activated(int)),TQT_SLOT(gameSelected(int))); diff --git a/kbattleship/kbattleship/kclientdialog.h b/kbattleship/kbattleship/kclientdialog.h index f424baf6..f46018ab 100644 --- a/kbattleship/kbattleship/kclientdialog.h +++ b/kbattleship/kbattleship/kclientdialog.h @@ -32,8 +32,9 @@ class KClientDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KClientDialog(TQWidget *parent = 0, const char *name = 0); + KClientDialog(TQWidget *tqparent = 0, const char *name = 0); ~KClientDialog(); TQString port() const; diff --git a/kbattleship/kbattleship/kgridwidget.cpp b/kbattleship/kbattleship/kgridwidget.cpp index 6cc660d7..cb6e573e 100644 --- a/kbattleship/kbattleship/kgridwidget.cpp +++ b/kbattleship/kbattleship/kgridwidget.cpp @@ -26,10 +26,10 @@ #include "kbattlefield.h" #include "kgridwidget.h" -KGridWidget::KGridWidget(TQWidget *parent, bool draw) : m_drawGrid(draw) +KGridWidget::KGridWidget(TQWidget *tqparent, bool draw) : m_drawGrid(draw) { - m_doubleBuffer = new TQPixmap(parent->width(), parent->height()); - m_parent = parent; + m_doubleBuffer = new TQPixmap(tqparent->width(), tqparent->height()); + m_parent = tqparent; cleanBuffer(); cacheImages(); @@ -392,8 +392,8 @@ void KGridWidget::drawIcon(const TQPixmap &icon, bool hitBlend, bool waterBlend, painter.end(); else { - painter.setBrush(Qt::NoBrush); - painter.setPen(Qt::black); + painter.setBrush(TQt::NoBrush); + painter.setPen(TQt::black); painter.drawRect(m_x, m_y, m_size, m_size); painter.end(); } diff --git a/kbattleship/kbattleship/kgridwidget.h b/kbattleship/kbattleship/kgridwidget.h index 1026695b..96ecde3a 100644 --- a/kbattleship/kbattleship/kgridwidget.h +++ b/kbattleship/kbattleship/kgridwidget.h @@ -23,7 +23,7 @@ class KGridWidget { public: - KGridWidget(TQWidget *parent, bool draw); + KGridWidget(TQWidget *tqparent, bool draw); ~KGridWidget(); void enableGrid() { m_drawGrid = true; } diff --git a/kbattleship/kbattleship/kmessage.cpp b/kbattleship/kbattleship/kmessage.cpp index a316b314..f17e4bf5 100644 --- a/kbattleship/kbattleship/kmessage.cpp +++ b/kbattleship/kbattleship/kmessage.cpp @@ -78,7 +78,7 @@ TQString KMessage::field(const TQString &name) const TQDomNode xmlNode = m_xmlDocument.documentElement().namedItem(name); if(!xmlNode.isNull()) return (xmlNode.toElement()).text(); - return TQString::null; + return TQString(); } int KMessage::type() diff --git a/kbattleship/kbattleship/konnectionhandling.cpp b/kbattleship/kbattleship/konnectionhandling.cpp index 5d5c1026..dc1a5880 100644 --- a/kbattleship/kbattleship/konnectionhandling.cpp +++ b/kbattleship/kbattleship/konnectionhandling.cpp @@ -19,7 +19,7 @@ extern const char *protocolVersion; -KonnectionHandling::KonnectionHandling(TQWidget *parent, KBattleshipServer *server) : TQObject(parent) +KonnectionHandling::KonnectionHandling(TQWidget *tqparent, KBattleshipServer *server) : TQObject(tqparent) { m_kbserver = server; m_kbclient = 0; @@ -31,7 +31,7 @@ KonnectionHandling::KonnectionHandling(TQWidget *parent, KBattleshipServer *serv connect(server, TQT_SIGNAL(sigMessageSent(KMessage *)), this, TQT_SLOT(slotMessageSent(KMessage *))); } -KonnectionHandling::KonnectionHandling(TQWidget *parent, KBattleshipClient *client) : TQObject(parent) +KonnectionHandling::KonnectionHandling(TQWidget *tqparent, KBattleshipClient *client) : TQObject(tqparent) { m_kbclient = client; m_kbserver = 0; @@ -94,7 +94,7 @@ void KonnectionHandling::slotNewMessage(KMessage *msg) case KMessage::DISCARD: 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)); + KMessageBox::error(0L, i18n("Connection dropped by enemy. The client's protocol implementation (%1) is not compatible with our (%2) version.").tqarg(msg->field("reason")).tqarg(protocolVersion)); emit sigAbortNetworkGame(); } else @@ -156,10 +156,10 @@ void KonnectionHandling::slotNewMessage(KMessage *msg) { // First message....got client information case KMessage::GETVERSION: - if(msg->field("protocolVersion") != TQString::fromLatin1(protocolVersion)) + if(msg->field("protocolVersion") != TQString::tqfromLatin1(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)); + KMessageBox::error(0L, i18n("Connection to client dropped. The client's protocol implementation (%1) is not compatible with our (%2) version.").tqarg(msg->field("protocolVersion")).tqarg(protocolVersion)); } else emit sigClientInformation(msg->field("clientName"), msg->field("clientVersion"), msg->field("clientDescription"), msg->field("protocolVersion")); @@ -232,7 +232,7 @@ void KonnectionHandling::slotSocketError(int error) break; default: - KMessageBox::error(0L, i18n("Unknown error; No: %1").arg(error)); + KMessageBox::error(0L, i18n("Unknown error; No: %1").tqarg(error)); break; } diff --git a/kbattleship/kbattleship/konnectionhandling.h b/kbattleship/kbattleship/konnectionhandling.h index 95615d66..598225c5 100644 --- a/kbattleship/kbattleship/konnectionhandling.h +++ b/kbattleship/kbattleship/konnectionhandling.h @@ -27,13 +27,14 @@ #include "kbattleshipserver.h" #include "kmessage.h" -class KonnectionHandling : public QObject +class KonnectionHandling : public TQObject { Q_OBJECT + TQ_OBJECT public: enum{SERVER, CLIENT}; - KonnectionHandling(TQWidget *parent, KBattleshipServer *server); - KonnectionHandling(TQWidget *parent, KBattleshipClient *client); + KonnectionHandling(TQWidget *tqparent, KBattleshipServer *server); + KonnectionHandling(TQWidget *tqparent, KBattleshipClient *client); int type() { return m_type; } diff --git a/kbattleship/kbattleship/kserverdialog.cpp b/kbattleship/kbattleship/kserverdialog.cpp index d8fa1b1d..2574757f 100644 --- a/kbattleship/kbattleship/kserverdialog.cpp +++ b/kbattleship/kbattleship/kserverdialog.cpp @@ -21,8 +21,8 @@ #include "kserverdialog.h" -KServerDialog::KServerDialog(TQWidget *parent, const char *name) : - KDialogBase(Plain, i18n("Start Server"), Ok|Cancel, Ok, parent, name, true, false, KGuiItem(i18n("&Start"))) +KServerDialog::KServerDialog(TQWidget *tqparent, const char *name) : + KDialogBase(Plain, i18n("Start Server"), Ok|Cancel, Ok, tqparent, name, true, false, KGuiItem(i18n("&Start"))) { TQFrame* page = plainPage(); TQGridLayout* pageLayout = new TQGridLayout(page, 1, 1, 0, 0); diff --git a/kbattleship/kbattleship/kserverdialog.h b/kbattleship/kbattleship/kserverdialog.h index ca455509..ad7cc499 100644 --- a/kbattleship/kbattleship/kserverdialog.h +++ b/kbattleship/kbattleship/kserverdialog.h @@ -31,8 +31,9 @@ class KServerDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KServerDialog(TQWidget *parent = 0, const char *name = 0); + KServerDialog(TQWidget *tqparent = 0, const char *name = 0); TQString port() const; TQString nickname() const; diff --git a/kbattleship/kbattleship/kship.cpp b/kbattleship/kbattleship/kship.cpp index a9fbb558..05e893b3 100644 --- a/kbattleship/kbattleship/kship.cpp +++ b/kbattleship/kbattleship/kship.cpp @@ -60,7 +60,7 @@ bool KShip::placedLeft() return m_placedLeft; } -bool KShip::contains(int x, int y) +bool KShip::tqcontains(int x, int y) { return (x >= m_shipxstart && x <= m_shipxstop) && (y >= m_shipystart && y <= m_shipystop); } @@ -69,7 +69,7 @@ int KShip::shipTypeEnum(int x, int y) { int ret; ret = KBattleField::WATER; - if (contains(x, y)) + if (tqcontains(x, y)) { switch(m_shiptype) { diff --git a/kbattleship/kbattleship/kship.h b/kbattleship/kbattleship/kship.h index df436c7a..6d60ac62 100644 --- a/kbattleship/kbattleship/kship.h +++ b/kbattleship/kbattleship/kship.h @@ -32,7 +32,7 @@ public: int shipTypeEnum(int x, int y); bool placedLeft(); - bool contains(int x, int y); + bool tqcontains(int x, int y); private: int m_shipxstart; diff --git a/kbattleship/kbattleship/kshiplist.cpp b/kbattleship/kbattleship/kshiplist.cpp index 6a3463af..b28f95f4 100644 --- a/kbattleship/kbattleship/kshiplist.cpp +++ b/kbattleship/kbattleship/kshiplist.cpp @@ -118,7 +118,7 @@ bool KShipList::canAddShips() void KShipList::addNewShip(int button, int fieldx, int fieldy) { - if(!addNewShip(!(button == LeftButton), fieldx, fieldy)) + if(!addNewShip(!(button == Qt::LeftButton), fieldx, fieldy)) KMessageBox::information(0L, i18n("You cannot place the ship here.")); } @@ -126,20 +126,20 @@ bool KShipList::addNewShip(bool vertical, int fieldx, int 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)) + if(!field.tqcontains(ship)) return false; for(KShip *placedShip = m_shiplist.first(); placedShip != 0; placedShip = m_shiplist.next()) { for(int i = fieldx-1; i < (fieldx + ship.width()+1); i++) { - if(placedShip->contains(i, fieldy - 1) || placedShip->contains(i, fieldy + ship.height())) + if(placedShip->tqcontains(i, fieldy - 1) || placedShip->tqcontains(i, fieldy + ship.height())) return false; } for(int i = fieldy-1; i < (fieldy + ship.height()+1); i++) { - if(placedShip->contains(fieldx - 1, i) || placedShip->contains(fieldx + ship.width(), i)) + if(placedShip->tqcontains(fieldx - 1, i) || placedShip->tqcontains(fieldx + ship.width(), i)) return false; } } diff --git a/kbattleship/kbattleship/kshiplist.h b/kbattleship/kbattleship/kshiplist.h index e27705b6..eddaa412 100644 --- a/kbattleship/kbattleship/kshiplist.h +++ b/kbattleship/kbattleship/kshiplist.h @@ -25,9 +25,10 @@ #include "kbattlefield.h" #include "kship.h" -class KShipList : public QObject +class KShipList : public TQObject { Q_OBJECT + TQ_OBJECT public: KShipList(); diff --git a/kbattleship/kbattleship/kstatdialog.cpp b/kbattleship/kbattleship/kstatdialog.cpp index 03bc7d41..28b9c142 100644 --- a/kbattleship/kbattleship/kstatdialog.cpp +++ b/kbattleship/kbattleship/kstatdialog.cpp @@ -19,7 +19,7 @@ #include #include "kstatdialog.moc" -KStatDialog::KStatDialog(TQWidget *parent, const char *name) : statDlg(parent, name) +KStatDialog::KStatDialog(TQWidget *tqparent, const char *name) : statDlg(tqparent, name) { } diff --git a/kbattleship/kbattleship/kstatdialog.h b/kbattleship/kbattleship/kstatdialog.h index 5657fccd..172b7e47 100644 --- a/kbattleship/kbattleship/kstatdialog.h +++ b/kbattleship/kbattleship/kstatdialog.h @@ -23,8 +23,9 @@ class KStatDialog : public statDlg { Q_OBJECT + TQ_OBJECT public: - KStatDialog(TQWidget *parent = 0, const char *name = 0); + KStatDialog(TQWidget *tqparent = 0, const char *name = 0); void setShot(); void setShot(int shot); diff --git a/kblackbox/CHANGES b/kblackbox/CHANGES index 985fa5c9..50f44446 100644 --- a/kblackbox/CHANGES +++ b/kblackbox/CHANGES @@ -11,7 +11,7 @@ - the game is active after starting - fixed bad drawing after setting the board size - config. scripts from new kexample (KDE 1.0) - - moc dependencies in Makefile.am done by automoc to + - tqmoc dependencies in Makefile.am done by autotqmoc to avoid problems on Solaris (bug report by David Faure) - some string fixes for better translation 0.2.5 from 0.2.4 (19.3.1998) diff --git a/kblackbox/kbbgame.cpp b/kblackbox/kbbgame.cpp index c663e2eb..f13c0106 100644 --- a/kblackbox/kbbgame.cpp +++ b/kblackbox/kbbgame.cpp @@ -174,7 +174,7 @@ KBBGame::~KBBGame() kConf->writeEntry( "tutorial", (int) tutorial ); delete gameBoard; - // All the rest has "this" for parent so it doesn't need to be deleted. + // All the rest has "this" for tqparent so it doesn't need to be deleted. } @@ -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?"),TQString::null,i18n("Give Up")) + i18n("Do you really want to give up this game?"),TQString(),i18n("Give Up")) == KMessageBox::Cancel; if (cancel) return; @@ -298,7 +298,7 @@ void KBBGame::newGame() randomBalls( balls ); remap( gameBoard, gr->getGraphicBoard() ); - gr->repaint( TRUE ); + gr->tqrepaint( TRUE ); setScore( 0 ); detourCounter = -1; ballsPlaced = 0; @@ -326,12 +326,12 @@ void KBBGame::gameFinished() "I guess you need more practice."); KMessageBox::information(this, - s.arg(KGlobal::locale()->formatNumber(score, 0))); + s.tqarg(KGlobal::locale()->formatNumber(score, 0))); } else { s = i18n( "You should place %1 balls!\n" "You have placed %2.") - .arg(KGlobal::locale()->formatNumber(balls, 0)) - .arg(KGlobal::locale()->formatNumber(ballsPlaced, 0)); + .tqarg(KGlobal::locale()->formatNumber(balls, 0)) + .tqarg(KGlobal::locale()->formatNumber(ballsPlaced, 0)); KMessageBox::sorry(this, s); } @@ -388,7 +388,7 @@ void KBBGame::giveUp() bool stop; stop = KMessageBox::warningContinueCancel(0, i18n( - "Do you really want to give up this game?"),TQString::null,i18n("Give Up")) + "Do you really want to give up this game?"),TQString(),i18n("Give Up")) == KMessageBox::Continue; if (stop) { @@ -428,7 +428,7 @@ void KBBGame::updateStats() void KBBGame::setScore( int n ) { score = n; - statusBar()->changeItem( i18n("Score: %1").arg(n), SSCORE ); + statusBar()->changeItem( i18n("Score: %1").tqarg(n), SSCORE ); } /* @@ -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!"),TQString::null,i18n("End Game")) + "This will be the end of the current game!"),TQString(),i18n("End Game")) == KMessageBox::Continue; } else ok = TRUE; @@ -454,7 +454,7 @@ bool KBBGame::setSize( int w, int h ) gameBoard = new RectOnArray( gr->numC(), gr->numR() ); if (running) abortGame(); newGame(); - // gr->repaint( TRUE ); + // gr->tqrepaint( TRUE ); } } return ok; @@ -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!"),TQString::null,i18n("End Game")) + i18n("This will be the end of the current game!"),TQString(),i18n("End Game")) == KMessageBox::Continue; } else ok = TRUE; if (ok) { @@ -622,7 +622,7 @@ void KBBGame::gotInputAt( int col, int row, int state ) int w = gameBoard->width() - 2; int h = gameBoard->height() - 2; - if (state & LeftButton) { + if (state & Qt::LeftButton) { switch (type) { case WBALLBBG: // because of the tutorial mode case INNERBBG: @@ -681,7 +681,7 @@ void KBBGame::gotInputAt( int col, int row, int state ) } break; } - } else if (state & RightButton) { + } else if (state & Qt::RightButton) { switch (type) { case INNERBBG: r->set( col, row, MARK1BBG ); @@ -698,37 +698,37 @@ void KBBGame::gotInputAt( int col, int row, int state ) void KBBGame::initKAction() { // game - 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()); + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection()); + (void)new KAction( i18n("&Give Up"), SmallIcon("giveup"), 0, TQT_TQOBJECT(this), TQT_SLOT(giveUp()), actionCollection(), "game_giveup" ); + (void)new KAction( i18n("&Done"), SmallIcon("done"), 0, TQT_TQOBJECT(this), TQT_SLOT(gameFinished()), actionCollection(), "game_done" ); + (void)new KAction( i18n("&Resize"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotResize()), actionCollection(), "game_resize" ); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); // settings - sizeAction = new KSelectAction( i18n("&Size"), 0, this, TQT_SLOT(slotSize()), actionCollection(), "options_size"); + sizeAction = new KSelectAction( i18n("&Size"), 0, TQT_TQOBJECT(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, TQT_SLOT(slotBalls()), actionCollection(), "options_balls"); + ballsAction = new KSelectAction( i18n("&Balls"), 0, TQT_TQOBJECT(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, TQT_SLOT(tutorialSwitch()), actionCollection(), "options_tutorial" ); + tutorialAction = new KToggleAction( i18n("&Tutorial"), 0, TQT_TQOBJECT(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, 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)new KAction( i18n("Move Down"), TQt::Key_Down, TQT_TQOBJECT(gr), TQT_SLOT(slotDown()), actionCollection(), "move_down" ); + (void)new KAction( i18n("Move Up"), TQt::Key_Up, TQT_TQOBJECT(gr), TQT_SLOT(slotUp()), actionCollection(), "move_up" ); + (void)new KAction( i18n("Move Left"), TQt::Key_Left, TQT_TQOBJECT(gr), TQT_SLOT(slotLeft()), actionCollection(), "move_left" ); + (void)new KAction( i18n("Move Right"), TQt::Key_Right, TQT_TQOBJECT(gr), TQT_SLOT(slotRight()), actionCollection(), "move_right" ); + (void)new KAction( i18n("Trigger Action"), TQt::Key_Return, TQT_TQOBJECT(gr), TQT_SLOT(slotInput()), actionCollection(), "move_trigger" ); } void KBBGame::slotResize() diff --git a/kblackbox/kbbgame.h b/kblackbox/kbbgame.h index 85b12e29..38b8a0fc 100644 --- a/kblackbox/kbbgame.h +++ b/kblackbox/kbbgame.h @@ -50,6 +50,7 @@ class KToggleAction; class KBBGame : public KMainWindow { Q_OBJECT + TQ_OBJECT public: KBBGame(); ~KBBGame(); diff --git a/kblackbox/kbbgfx.cpp b/kblackbox/kbbgfx.cpp index b38a2c9e..26d47952 100644 --- a/kblackbox/kbbgfx.cpp +++ b/kblackbox/kbbgfx.cpp @@ -22,13 +22,13 @@ Constructs a KBBGraphic widget. */ -KBBGraphic::KBBGraphic( TQPixmap **p, TQWidget* parent, const char* name ) - : TQWidget( parent, name ) +KBBGraphic::KBBGraphic( TQPixmap **p, TQWidget* tqparent, const char* name ) + : TQWidget( tqparent, name ) { int i; curRow = curCol = 0; - setFocusPolicy( NoFocus ); + setFocusPolicy( TQ_NoFocus ); setBackgroundColor( gray ); setCellWidth( CELLW ); // set width of cell in pixels setCellHeight( CELLH ); // set height of cell in pixels @@ -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; } -TQSize KBBGraphic::sizeHint() const { return TQSize(wHint(), hHint()); } +TQSize KBBGraphic::tqsizeHint() const { return TQSize(wHint(), hHint()); } /* Returns a pointer to graphicBoard @@ -342,7 +342,7 @@ void KBBGraphic::mousePressEvent( TQMouseEvent* e ) /* * Middle click finishes the game. */ - if (e->button() == MidButton) { + if (e->button() == Qt::MidButton) { emit endMouseClicked(); return; } @@ -413,7 +413,7 @@ void KBBGraphic::slotInput() if ( !inputAccepted ) { return; } - emit inputAt( curCol, curRow, LeftButton ); + emit inputAt( curCol, curRow, Qt::LeftButton ); // updateElement( curCol, curRow ); } @@ -434,7 +434,7 @@ void KBBGraphic::moveSelection(int drow, int dcol) void KBBGraphic::focusInEvent( TQFocusEvent* ) { - repaint( FALSE ); + tqrepaint( FALSE ); } @@ -444,7 +444,7 @@ void KBBGraphic::focusInEvent( TQFocusEvent* ) void KBBGraphic::focusOutEvent( TQFocusEvent* ) { - repaint( FALSE ); + tqrepaint( FALSE ); } /* @@ -454,8 +454,8 @@ void KBBGraphic::focusOutEvent( TQFocusEvent* ) void KBBGraphic::setInputAccepted( bool b ) { inputAccepted = b; - if (b) setFocusPolicy( StrongFocus ); - else setFocusPolicy( NoFocus ); + if (b) setFocusPolicy( TQ_StrongFocus ); + else setFocusPolicy( TQ_NoFocus ); } /* diff --git a/kblackbox/kbbgfx.h b/kblackbox/kbbgfx.h index 16d97298..5eca56c9 100644 --- a/kblackbox/kbbgfx.h +++ b/kblackbox/kbbgfx.h @@ -50,11 +50,12 @@ Negative numbers are deflected lasers... */ -class KBBGraphic : public QWidget +class KBBGraphic : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KBBGraphic( TQPixmap** p=0, TQWidget* parent=0, const char* name=0 ); + KBBGraphic( TQPixmap** p=0, TQWidget* tqparent=0, const char* name=0 ); ~KBBGraphic(); friend class KBBGame; @@ -87,7 +88,7 @@ signals: void endMouseClicked(); protected: - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; void paintEvent( TQPaintEvent* ); void mousePressEvent( TQMouseEvent* ); void mouseMoveEvent( TQMouseEvent* ); diff --git a/kbounce/game.cpp b/kbounce/game.cpp index 0c5f1e2d..84cfae2f 100644 --- a/kbounce/game.cpp +++ b/kbounce/game.cpp @@ -136,8 +136,8 @@ bool Ball::collide( double dx, double dy ) /*************************************************************************/ -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 ), +Wall::Wall( JezzField *field, int x, int y, Direction dir, int tile, TQObject *tqparent, const char *name ) + : TQObject( tqparent, 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; @@ -236,8 +236,8 @@ void Wall::fill( bool black ) /*************************************************************************/ -JezzField::JezzField( const TQPixmap &tiles, const TQPixmap &background, TQObject* parent, const char* name ) - : TQCanvas( parent, name ), m_tiles( tiles ) +JezzField::JezzField( const TQPixmap &tiles, const TQPixmap &background, TQObject* tqparent, const char* name ) + : TQCanvas( tqparent, name ), m_tiles( tiles ) { setPixmaps( tiles, background ); } @@ -314,8 +314,8 @@ void JezzField::setPixmaps( const TQPixmap &tiles, const TQPixmap &background ) /*************************************************************************/ -JezzView::JezzView(TQCanvas* viewing, TQWidget* parent, const char* name, WFlags f) - : TQCanvasView( viewing, parent, name, f ), m_vertical( false ) +JezzView::JezzView(TQCanvas* viewing, TQWidget* tqparent, const char* name, WFlags f) + : TQCanvasView( viewing, tqparent, name, f ), m_vertical( false ) { setResizePolicy( AutoOne ); setHScrollBarMode( AlwaysOff ); @@ -326,13 +326,13 @@ JezzView::JezzView(TQCanvas* viewing, TQWidget* parent, const char* name, WFlags void JezzView::viewportMouseReleaseEvent( TQMouseEvent *ev ) { - if ( ev->button() & RightButton ) + if ( ev->button() & Qt::RightButton ) { m_vertical = !m_vertical; if ( m_vertical ) setCursor( sizeVerCursor ); else setCursor( sizeHorCursor ); } - if ( ev->button() & LeftButton ) + if ( ev->button() & Qt::LeftButton ) { emit buildWall( ev->x()/TILE_SIZE, ev->y()/TILE_SIZE, m_vertical ); } @@ -340,8 +340,8 @@ void JezzView::viewportMouseReleaseEvent( TQMouseEvent *ev ) /*************************************************************************/ -JezzGame::JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent, const char *name ) - : TQWidget( parent, name ), m_wall1( 0 ), m_wall2( 0 ), +JezzGame::JezzGame( const TQPixmap &background, int ballNum, TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ), m_wall1( 0 ), m_wall2( 0 ), m_text( 0 ), m_running( false ), m_percent( 0 ), m_pictured( false ) { TQString path = kapp->dirs()->findResourceDir( "data", "kbounce/pics/ball0000.png" ) + "kbounce/pics/"; @@ -363,7 +363,7 @@ JezzGame::JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent, c "kbounce/sounds/"; // create field - m_field = new JezzField( tiles, background, this, "m_field" ); + m_field = new JezzField( tiles, background, TQT_TQOBJECT(this), "m_field" ); m_field->resize( TILE_SIZE*FIELD_WIDTH, TILE_SIZE*FIELD_HEIGHT ); for ( int x=0; xstart( GAME_DELAY ); - // setup geometry + // setup tqgeometry setFixedSize( m_view->size() ); } @@ -500,7 +500,7 @@ void JezzGame::makeBlack() } m_field->update(); - m_view->repaint(); + m_view->tqrepaint(); // count percent value of occupied area int p = percent(); @@ -586,7 +586,7 @@ void JezzGame::ballCollision( Ball */*ball*/, int /*x*/, int /*y*/, int tile ) // update view m_field->update(); - m_view->repaint(); + m_view->tqrepaint(); // send death msg emit died(); @@ -617,7 +617,7 @@ void JezzGame::buildWall( int x, int y, bool vertical ) m_wall1 = new Wall( m_field, x, y, vertical? Wall::Up : Wall::Left, vertical? TILE_WALLUP : TILE_WALLLEFT, - this, "m_wall1" ); + TQT_TQOBJECT(this), "m_wall1" ); connect( m_wall1, TQT_SIGNAL(finished(Wall *, int)), this, TQT_SLOT(wallFinished(Wall *, int)) ); } @@ -626,7 +626,7 @@ void JezzGame::buildWall( int x, int y, bool vertical ) m_wall2 = new Wall( m_field, x, y, vertical? Wall::Down: Wall::Right, vertical? TILE_WALLDOWN : TILE_WALLRIGHT, - this, "m_wall2" ); + TQT_TQOBJECT(this), "m_wall2" ); connect( m_wall2, TQT_SIGNAL(finished(Wall *, int)), this, TQT_SLOT(wallFinished(Wall *, int)) ); } @@ -671,7 +671,7 @@ void JezzGame::wallFinished( Wall *wall, int tile ) } m_field->update(); - m_view->repaint(); + m_view->tqrepaint(); makeBlack(); } diff --git a/kbounce/game.h b/kbounce/game.h index 1f66c288..d07516de 100644 --- a/kbounce/game.h +++ b/kbounce/game.h @@ -35,7 +35,7 @@ class JezzField; #define FIELD_WIDTH 32 #define FIELD_HEIGHT 20 -class Ball : public QCanvasSprite +class Ball : public TQCanvasSprite { public: Ball(TQCanvasPixmapArray* array, TQCanvas* canvas); @@ -50,14 +50,15 @@ class Ball : public QCanvasSprite }; -class Wall : public QObject +class Wall : public TQObject { Q_OBJECT + TQ_OBJECT public: enum Direction { Up, Down, Left, Right }; Wall( JezzField *field, int x, int y, Direction dir, int tile, - TQObject *parent=0, const char *name=0 ); + TQObject *tqparent=0, const char *name=0 ); void finish(); void fill( bool black ); @@ -83,11 +84,12 @@ private: }; -class JezzField : public QCanvas +class JezzField : public TQCanvas { Q_OBJECT + TQ_OBJECT public: - JezzField( const TQPixmap &tiles, const TQPixmap &background, TQObject* parent = 0, const char* name = 0 ); + JezzField( const TQPixmap &tiles, const TQPixmap &background, TQObject* tqparent = 0, const char* name = 0 ); void setGameTile( int x, int y, bool black ); void setBackground( const TQPixmap &background ); @@ -108,11 +110,12 @@ private: }; -class JezzView : public QCanvasView +class JezzView : public TQCanvasView { Q_OBJECT + TQ_OBJECT public: - JezzView(TQCanvas* viewing=0, TQWidget* parent=0, const char* name=0, WFlags f=0); + JezzView(TQCanvas* viewing=0, TQWidget* tqparent=0, const char* name=0, WFlags f=0); signals: void buildWall( int x, int y, bool vertical ); @@ -125,12 +128,13 @@ private: }; -class JezzGame : public QWidget +class JezzGame : public TQWidget { Q_OBJECT + TQ_OBJECT public: - JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent=0, const char *name=0 ); + JezzGame( const TQPixmap &background, int ballNum, TQWidget *tqparent=0, const char *name=0 ); ~JezzGame(); int percent(); diff --git a/kbounce/highscores.cpp b/kbounce/highscores.cpp index fec2d1e6..5dc3bf47 100644 --- a/kbounce/highscores.cpp +++ b/kbounce/highscores.cpp @@ -6,7 +6,7 @@ using namespace KExtHighscore; ExtManager::ExtManager() { - Item *item = new Item((uint)0, i18n("Level"), Qt::AlignRight); + Item *item = new Item((uint)0, i18n("Level"), TQt::AlignRight); addScoreItem("level", item); } diff --git a/kbounce/kbounce.cpp b/kbounce/kbounce.cpp index 5bfcc320..2d4fe887 100644 --- a/kbounce/kbounce.cpp +++ b/kbounce/kbounce.cpp @@ -89,21 +89,21 @@ KJezzball::KJezzball() // create timers m_nextLevelTimer = new TQTimer( this, "m_nextLevelTimer" ); - connect( m_nextLevelTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(switchLevel()) ); + connect( m_nextLevelTimer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(switchLevel()) ); m_gameOverTimer = new TQTimer( this, "m_gameOverTimer" ); - connect( m_gameOverTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(gameOverNow()) ); + connect( m_gameOverTimer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(gameOverNow()) ); m_timer = new TQTimer( this, "m_timer" ); - connect( m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(second()) ); + connect( m_timer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(second()) ); // create demo game createLevel( 1 ); statusBar()->message( i18n("Press %1 to start a game!") - .arg(m_newAction->shortcut().toString()) ); + .tqarg(m_newAction->shortcut().toString()) ); //m_gameWidget->display( i18n("Press to start a game!") ); - setFocusPolicy(TQWidget::StrongFocus); + setFocusPolicy(TQ_StrongFocus); setFocus(); setupGUI(); } @@ -119,23 +119,23 @@ KJezzball::~KJezzball() */ void KJezzball::initXMLUI() { - m_newAction = KStdGameAction::gameNew( this, TQT_SLOT(newGame()), actionCollection() ); + m_newAction = KStdGameAction::gameNew( TQT_TQOBJECT(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(TQKeySequence(Key_Space))); m_newAction->setShortcut(s); - 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()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection() ); + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighscore()), actionCollection() ); + m_pauseButton = KStdGameAction::pause(TQT_TQOBJECT(this), TQT_SLOT(pauseGame()), actionCollection()); + KStdGameAction::end(TQT_TQOBJECT(this), TQT_SLOT(closeGame()), actionCollection()); + KStdGameAction::configureHighscores(TQT_TQOBJECT(this), TQT_SLOT(configureHighscores()),actionCollection()); - new KAction( i18n("&Select Background Folder..."), 0, this, TQT_SLOT(selectBackground()), + new KAction( i18n("&Select Background Folder..."), 0, TQT_TQOBJECT(this), TQT_SLOT(selectBackground()), actionCollection(), "background_select" ); m_backgroundShowAction = - new KToggleAction( i18n("Show &Backgrounds"), 0, this, TQT_SLOT(showBackground()), + new KToggleAction( i18n("Show &Backgrounds"), 0, TQT_TQOBJECT(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?"), TQString::null, KStdGuiItem::close(), KStdGuiItem::cancel() ); + int ret = KMessageBox::questionYesNo( this, i18n("Do you really want to close the running game?"), TQString(), 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( TQString::null ); + //m_gameWidget->display( TQString() ); startLevel(); break; @@ -228,7 +228,7 @@ void KJezzball::gameOverNow() TQString score; score.setNum( m_game.score ); - KMessageBox::information( this, i18n("Game Over! Score: %1").arg(score) ); + KMessageBox::information( this, i18n("Game Over! Score: %1").tqarg(score) ); statusBar()->message( i18n("Game over. Press for a new game") ); //m_gameWidget->display( i18n("Game over. Press for a new game!") ); highscore(); @@ -347,7 +347,7 @@ void KJezzball::focusInEvent ( TQFocusEvent *ev ) m_state = Running; statusBar()->clear(); m_pauseButton->setChecked(false); - //m_gameWidget->display( TQString::null ); + //m_gameWidget->display( TQString() ); } KMainWindow::focusInEvent( ev ); @@ -400,8 +400,8 @@ void KJezzball::createLevel( int level ) m_gameWidget->show(); m_layout->addWidget( m_gameWidget, 0, 0 ); - connect( m_gameWidget, TQT_SIGNAL(died()), this, TQT_SLOT(died()) ); - connect( m_gameWidget, TQT_SIGNAL(newPercent(int)), this, TQT_SLOT(newPercent(int)) ); + connect( m_gameWidget, TQT_SIGNAL(died()), TQT_TQOBJECT(this), TQT_SLOT(died()) ); + connect( m_gameWidget, TQT_SIGNAL(newPercent(int)), TQT_TQOBJECT(this), TQT_SLOT(newPercent(int)) ); connect( m_soundAction, TQT_SIGNAL(toggled(bool)), m_gameWidget, TQT_SLOT(setSound(bool)) ); // update displays @@ -461,16 +461,16 @@ void KJezzball::switchLevel() 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)) + -i18n("%1 points: Total score for this level\n").arg(score) + -i18n("On to level %1. Remember you get %2 lives this time!")).arg(m_game.level+1).arg(m_game.level+2); +i18n("%1 points: 15 points per remaining life\n").tqarg(m_level.lifes*15) + +i18n("%1 points: Bonus\n").tqarg((m_gameWidget->percent()-75)*2*(m_game.level+5)) + +i18n("%1 points: Total score for this level\n").tqarg(score) + +i18n("On to level %1. Remember you get %2 lives this time!")).tqarg(m_game.level+1).tqarg(m_game.level+2); KMessageBox::information( this,foo ); // KMessageBox::information( this, i18n("You've completed level %1 with " - // "a score of %2.\nGet ready for the next one!").arg(level).arg(score)); + // "a score of %2.\nGet ready for the next one!").tqarg(level).tqarg(score)); m_game.level++; m_levelLCD->display( m_game.level ); diff --git a/kbounce/kbounce.h b/kbounce/kbounce.h index 60fd49bf..4ca84600 100644 --- a/kbounce/kbounce.h +++ b/kbounce/kbounce.h @@ -30,6 +30,7 @@ class KAction; class KJezzball : public KMainWindow { Q_OBJECT + TQ_OBJECT public: KJezzball(); diff --git a/kenolaba/AbTop.cpp b/kenolaba/AbTop.cpp index a6ef7d05..f107408d 100644 --- a/kenolaba/AbTop.cpp +++ b/kenolaba/AbTop.cpp @@ -63,12 +63,12 @@ AbTop::AbTop() timer = new TQTimer; - connect( timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timerDone()) ); + connect( timer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(timerDone()) ); board = new Board(); setMoveNo(0); - connect( board, TQT_SIGNAL(searchBreak()), this, TQT_SLOT(searchBreak()) ); + connect( board, TQT_SIGNAL(searchBreak()), TQT_TQOBJECT(this), TQT_SLOT(searchBreak()) ); Q_CHECK_PTR(board); boardWidget = new BoardWidget(*board,this); @@ -77,7 +77,7 @@ AbTop::AbTop() #endif connect( boardWidget, TQT_SIGNAL(updateSpy(TQString)), - this, TQT_SLOT(updateSpy(TQString)) ); + TQT_TQOBJECT(this), TQT_SLOT(updateSpy(TQString)) ); setCentralWidget(boardWidget); boardWidget->show(); @@ -89,16 +89,16 @@ AbTop::AbTop() // RMB context menu connect( boardWidget, TQT_SIGNAL(rightButtonPressed(int,const TQPoint&)), - this, TQT_SLOT(rightButtonPressed(int,const TQPoint&)) ); + TQT_TQOBJECT(this), TQT_SLOT(rightButtonPressed(int,const TQPoint&)) ); connect( boardWidget, TQT_SIGNAL(edited(int)), - this, TQT_SLOT(edited(int)) ); + TQT_TQOBJECT(this), TQT_SLOT(edited(int)) ); connect( board, TQT_SIGNAL(updateBestMove(Move&,int)), - this, TQT_SLOT(updateBestMove(Move&,int)) ); + TQT_TQOBJECT(this), TQT_SLOT(updateBestMove(Move&,int)) ); connect( boardWidget, TQT_SIGNAL(moveChoosen(Move&)), - this, TQT_SLOT(moveChoosen(Move&)) ); + TQT_TQOBJECT(this), TQT_SLOT(moveChoosen(Move&)) ); /* default */ setLevel(Easy); @@ -107,7 +107,7 @@ AbTop::AbTop() showSpy = false; renderBalls = true; - updateStatus(); + updatetqStatus(); updateActions(); setupGUI(); } @@ -132,61 +132,61 @@ AbTop::~AbTop() void AbTop::setupActions() { - newAction = KStdGameAction::gameNew( this, TQT_SLOT(newGame()), actionCollection() ); - KStdGameAction::quit( this, TQT_SLOT(close()), actionCollection() ); + newAction = KStdGameAction::gameNew( TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection() ); + KStdGameAction::quit( TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection() ); - stopAction = new KAction( i18n("&Stop Search"), "stop", Key_S, this, + stopAction = new KAction( i18n("&Stop Search"), "stop", Key_S, TQT_TQOBJECT(this), TQT_SLOT(stopSearch()), actionCollection(), "move_stop"); backAction = new KAction( i18n("Take &Back"), "back", - KStdAccel::shortcut(KStdAccel::Prior), this, + KStdAccel::shortcut(KStdAccel::Prior), TQT_TQOBJECT(this), TQT_SLOT(back()), actionCollection(), "move_back"); forwardAction = new KAction( i18n("&Forward"), "forward", - KStdAccel::shortcut(KStdAccel::Next), this, + KStdAccel::shortcut(KStdAccel::Next), TQT_TQOBJECT(this), TQT_SLOT(forward()), actionCollection(), "move_forward"); - hintAction = KStdGameAction::hint(this, TQT_SLOT(suggestion()), actionCollection()); + hintAction = KStdGameAction::hint(TQT_TQOBJECT(this), TQT_SLOT(suggestion()), actionCollection()); - KStdAction::copy( this, TQT_SLOT(copy()), actionCollection()); - pasteAction = KStdAction::paste( this, TQT_SLOT(paste()), actionCollection()); + KStdAction::copy( TQT_TQOBJECT(this), TQT_SLOT(copy()), actionCollection()); + pasteAction = KStdAction::paste( TQT_TQOBJECT(this), TQT_SLOT(paste()), actionCollection()); (void) new KAction( i18n("&Restore Position"), KStdAccel::shortcut(KStdAccel::Open), - this, TQT_SLOT(restorePosition()), + TQT_TQOBJECT(this), TQT_SLOT(restorePosition()), actionCollection(), "edit_restore" ); (void) new KAction( i18n("&Save Position"), KStdAccel::shortcut(KStdAccel::Save), - this, TQT_SLOT(savePosition()), + TQT_TQOBJECT(this), TQT_SLOT(savePosition()), actionCollection(), "edit_save" ); KToggleAction *ta; ta = new KToggleAction( i18n("&Network Play"), "network", Key_N, actionCollection(), "game_net"); - connect(ta, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(gameNetwork(bool))); + connect(ta, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(gameNetwork(bool))); editAction = new KToggleAction( i18n("&Modify"), "edit", CTRL+Key_Insert, actionCollection(), "edit_modify"); - connect(editAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT( editModify(bool))); + connect(editAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT( editModify(bool))); - showMenubar = KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); - KStdAction::saveOptions( this, TQT_SLOT(writeConfig()), actionCollection()); + showMenubar = KStdAction::showMenubar(TQT_TQOBJECT(this), TQT_SLOT(toggleMenubar()), actionCollection()); + KStdAction::saveOptions( TQT_TQOBJECT(this), TQT_SLOT(writeConfig()), actionCollection()); - KStdAction::preferences( this, TQT_SLOT(configure()), actionCollection()); + KStdAction::preferences( TQT_TQOBJECT(this), TQT_SLOT(configure()), actionCollection()); moveSlowAction = new KToggleAction( i18n("&Move Slow"), 0, actionCollection(), "options_moveSlow"); - connect(moveSlowAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(optionMoveSlow(bool))); + connect(moveSlowAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(optionMoveSlow(bool))); renderBallsAction = new KToggleAction( i18n("&Render Balls"), 0, actionCollection(), "options_renderBalls"); - connect(renderBallsAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(optionRenderBalls(bool))); + connect(renderBallsAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(optionRenderBalls(bool))); showSpyAction = new KToggleAction( i18n("&Spy"), 0, actionCollection(), "options_showSpy"); - connect(showSpyAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(optionShowSpy(bool))); + connect(showSpyAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(optionShowSpy(bool))); levelAction = KStdGameAction::chooseGameType(0, 0, actionCollection()); @@ -381,7 +381,7 @@ void AbTop::setupStatusBar() { TQString tmp; - TQString t = i18n("Press %1 for a new game").arg( newAction->shortcut().toString()); + TQString t = i18n("Press %1 for a new game").tqarg( newAction->shortcut().toString()); statusLabel = new TQLabel( t, statusBar(), "statusLabel" ); statusBar()->addWidget(statusLabel,1,false); @@ -391,8 +391,8 @@ void AbTop::setupStatusBar() warningPix = BarIcon( "warning" ); okPix = BarIcon( "ok" ); validLabel = new TQLabel( "", statusBar(), "validLabel" ); - validLabel->setFixedSize( 18, statusLabel->sizeHint().height() ); - validLabel->setAlignment( AlignCenter ); + validLabel->setFixedSize( 18, statusLabel->tqsizeHint().height() ); + validLabel->tqsetAlignment( AlignCenter ); validLabel->hide(); validShown = false; @@ -401,11 +401,11 @@ void AbTop::setupStatusBar() noBall = BarIcon( "noball" ); ballLabel = new TQLabel( "", statusBar(), "ballLabel" ); ballLabel->setPixmap(noBall); - ballLabel->setFixedSize( 18, statusLabel->sizeHint().height() ); - ballLabel->setAlignment( AlignCenter ); + ballLabel->setFixedSize( 18, statusLabel->tqsizeHint().height() ); + ballLabel->tqsetAlignment( AlignCenter ); statusBar()->addWidget(ballLabel, 0, true); - moveLabel = new TQLabel( i18n("Move %1").arg("--"), statusBar(), "moveLabel" ); + moveLabel = new TQLabel( i18n("Move %1").tqarg("--"), statusBar(), "moveLabel" ); statusBar()->addWidget(moveLabel, 0, true); #ifdef MYTRACE @@ -422,7 +422,7 @@ void AbTop::setupStatusBar() spyPopup->insertItem(spy2, 2); spyPopup->insertItem(spy3, 3); connect( spyPopup, TQT_SIGNAL(activated(int)), - this, TQT_SLOT(setSpy(int)) ); + TQT_TQOBJECT(this), TQT_SLOT(setSpy(int)) ); tb->insertButton(spy0, 30, spyPopup, TRUE, i18n("Spy")); } @@ -436,7 +436,7 @@ void AbTop::updateSpy(TQString s) { if (showSpy) { if (s.isEmpty()) { - updateStatus(); + updatetqStatus(); // statusBar()->clear(); } else @@ -458,17 +458,17 @@ void AbTop::updateBestMove(Move& m, int value) } -void AbTop::updateStatus() +void AbTop::updatetqStatus() { TQString tmp; bool showValid = false; if (!editMode && timerState == noGame) { - tmp = i18n("Move %1").arg("--"); + tmp = i18n("Move %1").tqarg("--"); ballLabel->setPixmap(noBall); } else { - tmp = i18n("Move %1").arg(moveNo/2 + 1); + tmp = i18n("Move %1").tqarg(moveNo/2 + 1); ballLabel->setPixmap( (board->actColor() == Board::color1) ? redBall : yellowBall); } @@ -476,15 +476,15 @@ void AbTop::updateStatus() if (editMode) { tmp = TQString("%1: %2 %3 - %4 %5") - .arg( i18n("Edit") ) - .arg( i18n("Red") ).arg(boardWidget->getColor1Count()) - .arg( i18n("Yellow") ).arg(boardWidget->getColor2Count()); + .tqarg( i18n("Edit") ) + .tqarg( i18n("Red") ).tqarg(boardWidget->getColor1Count()) + .tqarg( i18n("Yellow") ).tqarg(boardWidget->getColor2Count()); validLabel->setPixmap( (board->validState() == Board::invalid) ? warningPix:okPix ); showValid = true; } else if (timerState == noGame) { - tmp = i18n("Press %1 for a new game").arg( newAction->shortcut().toString()); + tmp = i18n("Press %1 for a new game").tqarg( newAction->shortcut().toString()); } else { if (timerState == gameOver) { @@ -495,9 +495,9 @@ void AbTop::updateStatus() } else { tmp = TQString("%1 - %2") - .arg( (board->actColor() == Board::color1) ? + .tqarg( (board->actColor() == Board::color1) ? i18n("Red"):i18n("Yellow") ) - .arg( iPlayNow() ? + .tqarg( iPlayNow() ? i18n("I am thinking...") : i18n("It is your turn!") ); } } @@ -514,7 +514,7 @@ void AbTop::updateStatus() validShown = showValid; } statusBar()->clear(); - statusBar()->repaint(); + statusBar()->tqrepaint(); } void AbTop::edited(int vState) @@ -522,7 +522,7 @@ void AbTop::edited(int vState) if (vState == Board::empty) timerState = noGame; - updateStatus(); + updatetqStatus(); } /* only , , have to be updated */ @@ -662,7 +662,7 @@ void AbTop::playGame() timerState = gameOver; } - updateStatus(); + updatetqStatus(); updateActions(); boardWidget->setCursor(crossCursor); if (stop) return; @@ -733,7 +733,7 @@ void AbTop::newGame() /* Copy ASCII representation into Clipboard */ void AbTop::copy() { - QClipboard *cb = TQApplication::clipboard(); + TQClipboard *cb = TQApplication::tqclipboard(); cb->setText( board->getASCIIState( moveNo ).ascii() ); } @@ -741,7 +741,7 @@ void AbTop::paste() { if (!pastePossible) return; - QClipboard *cb = TQApplication::clipboard(); + TQClipboard *cb = TQApplication::tqclipboard(); pastePosition( cb->text().ascii() ); /* don't do this in pastePosition: RECURSION !! */ @@ -801,7 +801,7 @@ void AbTop::gameNetwork(bool on) net->addListener(h2, p); } TQObject::connect(net, TQT_SIGNAL(gotPosition(const char *)), - this, TQT_SLOT(pastePosition(const char *)) ); + TQT_TQOBJECT(this), TQT_SLOT(pastePosition(const char *)) ); } @@ -814,7 +814,7 @@ void AbTop::editModify(bool on) timerState = noGame; updateActions(); - updateStatus(); + updatetqStatus(); if (!editMode && vState == Board::valid) { actMove.type = Move::none; timerState = moveShown; @@ -864,7 +864,7 @@ void AbTop::setMoveNo(int m, bool updateGUI) board->setActColor( ((moveNo%2)==0) ? Board::color1 : Board::color2 ); if (updateGUI) { - updateStatus(); + updatetqStatus(); updateActions(); } } diff --git a/kenolaba/AbTop.h b/kenolaba/AbTop.h index ed7c8fba..049a64a2 100644 --- a/kenolaba/AbTop.h +++ b/kenolaba/AbTop.h @@ -34,6 +34,7 @@ class Spy; class AbTop: public KMainWindow { Q_OBJECT + TQ_OBJECT public: AbTop(); @@ -89,7 +90,7 @@ public slots: private: void setupActions(); - void updateStatus(); + void updatetqStatus(); void userMove(); void playGame(); void loadPixmaps(); diff --git a/kenolaba/Ball.cpp b/kenolaba/Ball.cpp index 525f919b..b0584287 100644 --- a/kenolaba/Ball.cpp +++ b/kenolaba/Ball.cpp @@ -21,14 +21,14 @@ void Ball::setSize(int x, int y) sizeX = x; sizeY = y; - invalidate(); + tqinvalidate(); } -void Ball::invalidate() +void Ball::tqinvalidate() { Ball *b; - /* invalidate all Balls... */ + /* tqinvalidate all Balls... */ for(b=first;b!=0;b=b->next) b->pm.resize(0,0); } @@ -43,7 +43,7 @@ void Ball::setLight(int x, int y, int z, const TQColor& c) lightColor = c; - invalidate(); + tqinvalidate(); } @@ -52,7 +52,7 @@ void Ball::setTexture(double c, double d) rippleCount = c; rippleDepth = d; - invalidate(); + tqinvalidate(); } @@ -155,13 +155,13 @@ void Ball::render() green = .2 * bColor.green() + .8 * ll * green; blue = .2 * bColor.blue() + .8 * ll * blue; - image.setPixel(x,y, qRgb( (int)red, (int)green, (int)blue )); + image.setPixel(x,y, tqRgb( (int)red, (int)green, (int)blue )); } } } const TQImage iMask = image.createHeuristicMask(); TQBitmap bMask; - bMask = iMask; + bMask.convertFromImage(iMask); pm.convertFromImage( image, 0 ); pm.setMask(bMask); } @@ -213,8 +213,8 @@ BallPosition::BallPosition(int xp,int yp, Ball* d) /* Class BallWidget */ -BallWidget::BallWidget( int _freq, int bFr, TQWidget *parent, const char *name ) - : TQWidget(parent,name), positions(MAX_POSITION), animations(MAX_ANIMATION) +BallWidget::BallWidget( int _freq, int bFr, TQWidget *tqparent, const char *name ) + : TQWidget(tqparent,name), positions(MAX_POSITION), animations(MAX_ANIMATION) { int i; @@ -309,12 +309,12 @@ void BallWidget::resizeEvent(TQResizeEvent *) realSize = (w>h) ? h:w; Ball::setSize( realSize/ballFraction, realSize/ballFraction ); - repaint(); + tqrepaint(); } void BallWidget::paintEvent(TQPaintEvent *) { - paint(this); + paint(TQT_TQPAINTDEVICE(this)); } @@ -414,15 +414,15 @@ void BallWidget::animate() timer->start(1000/freq,true); } - // repaint( false ); + // tqrepaint( false ); } /* Ball Test */ -BallTest::BallTest( TQWidget *parent, const char *name ) - : BallWidget(10,2,parent,name) +BallTest::BallTest( TQWidget *tqparent, const char *name ) + : BallWidget(10,2,tqparent,name) { int w,h; diff --git a/kenolaba/Ball.h b/kenolaba/Ball.h index 1fcf1b37..25fd13eb 100644 --- a/kenolaba/Ball.h +++ b/kenolaba/Ball.h @@ -49,7 +49,7 @@ class Ball { private: void render(); - static void invalidate(); + static void tqinvalidate(); //static TQImage back; static int sizeX, sizeY; @@ -94,12 +94,13 @@ class BallPosition { #define MAX_POSITION 130 #define MAX_ANIMATION 20 -class BallWidget : public QWidget +class BallWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - BallWidget(int _freq, int bFr, TQWidget *parent = 0, const char *name = 0); + BallWidget(int _freq, int bFr, TQWidget *tqparent = 0, const char *name = 0); ~BallWidget(); void createBlending(int, int, Ball* , Ball* ); @@ -140,8 +141,9 @@ class BallWidget : public QWidget class BallTest: public BallWidget { Q_OBJECT + TQ_OBJECT public: - BallTest(TQWidget *parent=0, const char *name=0 ); + BallTest(TQWidget *tqparent=0, const char *name=0 ); protected: void mousePressEvent( TQMouseEvent * ); void mouseReleaseEvent( TQMouseEvent * ); diff --git a/kenolaba/Board.cpp b/kenolaba/Board.cpp index d939ad09..119557d2 100644 --- a/kenolaba/Board.cpp +++ b/kenolaba/Board.cpp @@ -1386,13 +1386,13 @@ int Board::setASCIIState(const TQString& state) int color2Count = 0; /* get moveNo if supplied */ - if ((index = state.find("#"))>=0) + if ((index = state.tqfind("#"))>=0) moveNo = state.mid(index+1,3).toInt(); int f=12, row=0, rowEnd = 17; char c = ' '; - index=state.find("/"); + index=state.tqfind("/"); while(index>=0) { @@ -1420,17 +1420,17 @@ int Board::setASCIIState(const TQString& state) if (f == rowEnd) { row++; if (row <4) { - index = state.find("/",index); + index = state.tqfind("/",index); f = 12 + row*11; rowEnd = row*12+17; } else if (row==4) { - index = state.find("|",index); + index = state.tqfind("|",index); f = 56; rowEnd = 65; } else if (row <9) { - index = state.find("\\",index); + index = state.tqfind("\\",index); f = 8 + row*12; rowEnd = 21 + row*11; } diff --git a/kenolaba/Board.h b/kenolaba/Board.h index 81b589d9..b07a9d65 100644 --- a/kenolaba/Board.h +++ b/kenolaba/Board.h @@ -41,9 +41,10 @@ private: }; -class Board : public QObject +class Board : public TQObject { Q_OBJECT + TQ_OBJECT public: Board(); diff --git a/kenolaba/BoardWidget.cpp b/kenolaba/BoardWidget.cpp index da6358c7..af4a103a 100644 --- a/kenolaba/BoardWidget.cpp +++ b/kenolaba/BoardWidget.cpp @@ -34,8 +34,8 @@ #include "bitmaps/Arrow6" #include "bitmaps/Arrow6Mask" -BoardWidget::BoardWidget(Board& b, TQWidget *parent, const char *name) - : BallWidget(10,9,parent, name), board(b) +BoardWidget::BoardWidget(Board& b, TQWidget *tqparent, const char *name) + : BallWidget(10,9,tqparent, name), board(b) { pList =0; gettingMove = false; @@ -164,7 +164,7 @@ void BoardWidget::paintEvent(TQPaintEvent *) { if (renderMode) { pm = boardPM; - BallWidget::paint(&pm); + BallWidget::paint(TQT_TQPAINTDEVICE(&pm)); } else draw(); @@ -237,7 +237,7 @@ void BoardWidget::drawBoard() #ifndef HAVE_KIR TQColorGroup g = TQPalette( *boardColor ).active(); - TQColorGroup g2 = TQWidget::colorGroup(); + TQColorGroup g2 = TQWidget::tqcolorGroup(); int boardSize = width() *10/12; if (boardSize > height()) boardSize = height(); @@ -345,7 +345,7 @@ void BoardWidget::draw() if (renderMode) { updateBalls(); - repaint(false); + tqrepaint(false); return; } @@ -631,7 +631,7 @@ void BoardWidget::choseMove(MoveList *pl) */ int BoardWidget::positionOf(int xx, int yy) { - int boardSize = QMIN( width()*10/12, height() ); + int boardSize = TQMIN( width()*10/12, height() ); int x = (1000 * (xx- (width()-boardSize)/2)) / boardSize; int y = (1000 * (yy- (height()-boardSize)/2)) / boardSize; @@ -834,7 +834,7 @@ void BoardWidget::mousePressEvent( TQMouseEvent* pEvent ) int pos = positionOf( pEvent->x(), pEvent->y() ); int f = fieldOf(pos); - if (pEvent->button() == RightButton) { + if (pEvent->button() == Qt::RightButton) { emit rightButtonPressed(f, pEvent->globalPos()); return; } @@ -846,9 +846,9 @@ void BoardWidget::mousePressEvent( TQMouseEvent* pEvent ) if (editMode) { - editColor = (pEvent->button() == MidButton) ? + editColor = (pEvent->button() == Qt::MidButton) ? Board::color2 : Board::color1; - int newColor = (pEvent->button() == MidButton) ? + int newColor = (pEvent->button() == Qt::MidButton) ? Board::color2bright : Board::color1bright; if (field[f] == Board::free) { @@ -877,7 +877,7 @@ void BoardWidget::mousePressEvent( TQMouseEvent* pEvent ) return; } - startValid = isValidStart(pos, (pEvent->button() == MidButton)); + startValid = isValidStart(pos, (pEvent->button() == Qt::MidButton)); kdDebug(12011) << "Start pos " << pos << " is valid: " << startValid << endl; // actMove.print(); @@ -889,7 +889,7 @@ void BoardWidget::mousePressEvent( TQMouseEvent* pEvent ) TQString tmp; actValue = - board.calcEvaluation(); - tmp = i18n("Board value: %1").arg(actValue); + tmp = i18n("Board value: %1").tqarg(actValue); emit updateSpy(tmp); } @@ -918,7 +918,7 @@ void BoardWidget::mouseMoveEvent( TQMouseEvent* pEvent ) if (!startValid) { /* We haven't a valid move yet. Check if we are over a valid start */ - startValid = isValidStart(pos, (pEvent->button() == MidButton)); + startValid = isValidStart(pos, (pEvent->button() == Qt::MidButton)); kdDebug(12011) << "Start pos " << pos << " is valid: " << startValid << endl; // actMove.print(); @@ -930,7 +930,7 @@ void BoardWidget::mouseMoveEvent( TQMouseEvent* pEvent ) TQString tmp; actValue = - board.calcEvaluation(); - tmp = i18n("Board value: %1").arg(actValue); + tmp = i18n("Board value: %1").tqarg(actValue); emit updateSpy(tmp); return; } @@ -948,7 +948,7 @@ void BoardWidget::mouseMoveEvent( TQMouseEvent* pEvent ) TQString tmp; tmp.sprintf("%+d", v-actValue); - TQString str = TQString("%1 : %2").arg(actMove.name()).arg(tmp); + TQString str = TQString("%1 : %2").tqarg(actMove.name()).tqarg(tmp); emit updateSpy(str); showMove(actMove,3); @@ -961,7 +961,7 @@ void BoardWidget::mouseMoveEvent( TQMouseEvent* pEvent ) if (pos == startPos) { showStart(actMove,1); startShown = true; - tmp = i18n("Board value: %1").arg(actValue); + tmp = i18n("Board value: %1").tqarg(actValue); } else draw(); @@ -1019,7 +1019,7 @@ void BoardWidget::mouseReleaseEvent( TQMouseEvent* pEvent ) emit updateSpy(tmp); } -TQSize BoardWidget::sizeHint() const +TQSize BoardWidget::tqsizeHint() const { return TQSize(400, 350); } diff --git a/kenolaba/BoardWidget.h b/kenolaba/BoardWidget.h index f3cfd969..2f123fc9 100644 --- a/kenolaba/BoardWidget.h +++ b/kenolaba/BoardWidget.h @@ -15,9 +15,10 @@ class KIRenderer; class BoardWidget : public BallWidget { Q_OBJECT + TQ_OBJECT public: - BoardWidget(Board&, TQWidget *parent = 0, const char *name = 0); + BoardWidget(Board&, TQWidget *tqparent = 0, const char *name = 0); ~BoardWidget(); void createPos(int , int , int , Ball*); @@ -77,7 +78,7 @@ class BoardWidget : public BallWidget void updateSpy(TQString); void edited(int); protected: - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; private: int positionOf(int x, int y); diff --git a/kenolaba/EvalDlg.ui b/kenolaba/EvalDlg.ui index 06931458..ee649f2a 100644 --- a/kenolaba/EvalDlg.ui +++ b/kenolaba/EvalDlg.ui @@ -1,10 +1,10 @@ EvalDlg - + EvalDlg - + 0 0 @@ -25,13 +25,13 @@ 6 - + TabWidget2 - + - + moves @@ -48,7 +48,7 @@ 6 - + Layout17 @@ -62,11 +62,11 @@ 6 - + Layout35 - + @@ -78,7 +78,7 @@ 4 - + moveEval1 @@ -90,19 +90,19 @@ 0 - + 30 32767 - + AlignLeft - + PixmapLabel3_2 @@ -113,7 +113,7 @@ false - + moveEval2 @@ -125,19 +125,19 @@ 0 - + 30 32767 - + AlignLeft - + PixmapLabel1_2_5 @@ -148,7 +148,7 @@ false - + moveEval3 @@ -160,19 +160,19 @@ 0 - + 30 32767 - + AlignLeft - + PixmapLabel3_3 @@ -183,7 +183,7 @@ false - + unnamed @@ -194,7 +194,7 @@ false - + PixmapLabel1_2_6 @@ -205,7 +205,7 @@ false - + PixmapLabel1_2_4 @@ -216,7 +216,7 @@ false - + PixmapLabel3 @@ -227,7 +227,7 @@ false - + PixmapLabel1_2 @@ -238,7 +238,7 @@ false - + PixmapLabel1_3 @@ -262,14 +262,14 @@ - + TextLabel4_2_2 Push Out - + AlignTop|AlignLeft @@ -286,24 +286,24 @@ Expanding - + TextLabel4_2 Push - + AlignTop|AlignLeft - + Layout37 - + @@ -315,7 +315,7 @@ 4 - + PixmapLabel1_2_5_2_3 @@ -326,7 +326,7 @@ false - + PixmapLabel3_3_2_3 @@ -337,7 +337,7 @@ false - + PixmapLabel3_3_2_2 @@ -348,7 +348,7 @@ false - + moveEval4 @@ -360,19 +360,19 @@ 0 - + 30 32767 - + AlignLeft - + moveEval5 @@ -384,19 +384,19 @@ 0 - + 30 32767 - + AlignLeft - + PixmapLabel2_3 @@ -407,7 +407,7 @@ false - + PixmapLabel1_2_5_2 @@ -418,7 +418,7 @@ false - + PixmapLabel3_3_2 @@ -429,7 +429,7 @@ false - + PixmapLabel2_2_2 @@ -440,7 +440,7 @@ false - + PixmapLabel1_3_2 @@ -462,7 +462,7 @@ Expanding - + moveEval6 @@ -474,19 +474,19 @@ 0 - + 30 32767 - + AlignLeft - + PixmapLabel1_4 @@ -497,7 +497,7 @@ false - + PixmapLabel1_2_2 @@ -508,7 +508,7 @@ false - + PixmapLabel2_2 @@ -519,7 +519,7 @@ false - + PixmapLabel1_4_3 @@ -530,7 +530,7 @@ false - + PixmapLabel1_2_5_2_2 @@ -538,7 +538,7 @@ image1 - + PixmapLabel2 @@ -549,7 +549,7 @@ false - + PixmapLabel1_4_2 @@ -573,11 +573,11 @@ Expanding - + Layout38 - + @@ -589,7 +589,7 @@ 4 - + PixmapLabel2_4 @@ -600,7 +600,7 @@ false - + PixmapLabel1_3_2_2 @@ -611,7 +611,7 @@ false - + PixmapLabel1_2_5_2_2_2 @@ -630,7 +630,7 @@ Expanding - + moveEval7 @@ -642,19 +642,19 @@ 0 - + 30 32767 - + AlignLeft - + PixmapLabel1_2_2_2 @@ -665,7 +665,7 @@ false - + PixmapLabel2_2_2_3 @@ -676,7 +676,7 @@ false - + moveEval9 @@ -688,19 +688,19 @@ 0 - + 30 32767 - + AlignLeft - + PixmapLabel1_4_2_2 @@ -711,7 +711,7 @@ false - + PixmapLabel1_2_5_2_3_3 @@ -722,7 +722,7 @@ false - + moveEval8 @@ -734,19 +734,19 @@ 0 - + 30 32767 - + AlignLeft - + PixmapLabel1_4_3_2 @@ -757,7 +757,7 @@ false - + PixmapLabel1_4_4 @@ -768,7 +768,7 @@ false - + PixmapLabel1_2_5_2_4 @@ -779,7 +779,7 @@ false - + PixmapLabel2_3_3 @@ -790,7 +790,7 @@ false - + PixmapLabel2_2_3 @@ -803,14 +803,14 @@ - + TextLabel4 Normal - + AlignTop|AlignLeft @@ -818,11 +818,11 @@ - + TextLabel5 - + 0 20 @@ -831,7 +831,7 @@ For every move possible the given points are added to the Evaluation. - + WordBreak|AlignTop|AlignLeft @@ -852,7 +852,7 @@ - + position @@ -869,7 +869,7 @@ 6 - + Layout63 @@ -894,7 +894,7 @@ Expanding - + Layout62 @@ -908,7 +908,7 @@ 6 - + TextLabel1_2_3_2 @@ -916,55 +916,55 @@ Inner ring 3: - + posEval3 - + 30 32767 - + AlignLeft - + posEval5 - + 30 32767 - + AlignLeft - + posEval2 - + 30 32767 - + AlignLeft - + TextLabel1_2 @@ -972,55 +972,55 @@ Outermost ring: - + diffEval2 - + 30 32767 - + AlignLeft - + diffEval3 - + 30 32767 - + AlignLeft - + posEval4 - + 30 32767 - + AlignLeft - + TextLabel1_2_2 @@ -1028,39 +1028,39 @@ Middle position: - + diffEval5 - + 30 32767 - + AlignLeft - + posEval1 - + 30 32767 - + AlignLeft - + TextLabel1_2_3 @@ -1068,7 +1068,7 @@ Inner ring 2: - + TextLabel3_4 @@ -1076,7 +1076,7 @@ +/- - + TextLabel3_3 @@ -1084,23 +1084,23 @@ +/- - + diffEval4 - + 30 32767 - + AlignLeft - + TextLabel3_2 @@ -1108,7 +1108,7 @@ +/- - + TextLabel1_2_2_2 @@ -1116,7 +1116,7 @@ Innermost ring: - + TextLabel3 @@ -1139,14 +1139,14 @@ - + TextLabel6 For every ball, the given points are added to the evaluation depending on the balls position. The bonus for a given position is changed randomly in the +/- range. - + WordBreak|AlignTop|AlignLeft @@ -1167,7 +1167,7 @@ - + inarow @@ -1184,7 +1184,7 @@ 6 - + Layout64 @@ -1209,7 +1209,7 @@ Expanding - + Layout42 @@ -1223,71 +1223,71 @@ 6 - + rowEval3 - + 30 32767 - + AlignLeft - + rowEval2 - + 30 32767 - + AlignLeft - + rowEval5 - + 30 32767 - + AlignLeft - + rowEval4 - + 30 32767 - + AlignLeft - + TextLabel1_2_2_3_2 @@ -1295,7 +1295,7 @@ Three in-a-row: - + TextLabel1_2_2_3 @@ -1303,7 +1303,7 @@ Two in-a-row: - + TextLabel1_2_2_3_3 @@ -1311,7 +1311,7 @@ Four in-a-row: - + TextLabel1_2_2_3_4 @@ -1334,14 +1334,14 @@ - + TextLabel6_2 For a number of balls In-a-Row, the given points are added to the evaluation - + WordBreak|AlignTop|AlignLeft @@ -1362,7 +1362,7 @@ - + count @@ -1379,7 +1379,7 @@ 6 - + Layout66 @@ -1404,7 +1404,7 @@ Expanding - + Layout65 @@ -1418,23 +1418,23 @@ 6 - + countEval2 - + 40 32767 - + AlignLeft - + TextLabel1_2_2_3_4_2 @@ -1442,39 +1442,39 @@ 4 Balls more: - + countEval5 - + 40 32767 - + AlignLeft - + countEval4 - + 40 32767 - + AlignLeft - + TextLabel1_2_2_3_3_2 @@ -1482,7 +1482,7 @@ 3 Balls more: - + TextLabel1_2_2_3_4_2_2 @@ -1490,23 +1490,23 @@ 5 Balls more: - + countEval1 - + 40 32767 - + AlignLeft - + TextLabel1_2_2_3_2_2 @@ -1514,23 +1514,23 @@ 2 Balls more: - + countEval3 - + 40 32767 - + AlignLeft - + TextLabel1_2_2_3_5 @@ -1553,14 +1553,14 @@ - + TextLabel6_2_2 For a difference in the number of balls, the given points are added to the evaluation. A difference of 6 only can be a lost/won game. - + WordBreak|AlignTop|AlignLeft @@ -1581,7 +1581,7 @@ - + tab @@ -1598,12 +1598,12 @@ 6 - + evalList - + Layout13 @@ -1617,7 +1617,7 @@ 6 - + evalSaveAs @@ -1625,7 +1625,7 @@ Save As... - + evalDelete @@ -1635,14 +1635,14 @@ - + TextLabel1 Your evaluation scheme, defined in all other tabs of this dialog, can be stored here. - + WordBreak|AlignTop|AlignLeft @@ -1653,7 +1653,7 @@ - + Layout13 @@ -1678,7 +1678,7 @@ Expanding - + TextLabel9 @@ -1686,7 +1686,7 @@ Evaluation of actual position: - + actualEval @@ -1756,5 +1756,5 @@ kseparator.h - + diff --git a/kenolaba/EvalDlgImpl.cpp b/kenolaba/EvalDlgImpl.cpp index 70662629..e0ab3006 100644 --- a/kenolaba/EvalDlgImpl.cpp +++ b/kenolaba/EvalDlgImpl.cpp @@ -19,8 +19,8 @@ #include "Board.h" #include "EvalScheme.h" -EvalDlgImpl::EvalDlgImpl(TQWidget* parent, Board* board) - :EvalDlg(parent) +EvalDlgImpl::EvalDlgImpl(TQWidget* tqparent, Board* board) + :EvalDlg(tqparent) { _board = board; _origScheme = board->evalScheme(); @@ -246,7 +246,7 @@ void EvalDlgImpl::deleteEntry() void EvalDlgImpl::saveas() { - KLineEditDlg dlg(i18n("Name for scheme:"), TQString::null, this); + KLineEditDlg dlg(i18n("Name for scheme:"), TQString(), this); dlg.setCaption(i18n("Save Scheme")); if (dlg.exec()) { @@ -254,10 +254,10 @@ void EvalDlgImpl::saveas() KConfig* config = kapp->config(); config->setGroup("General"); TQStringList list = config->readListEntry("EvalSchemes"); - TQListBoxItem *it = evalList->findItem(name); + TQListBoxItem *it = evalList->tqfindItem(name); if (!it) { evalList->insertItem(name); - it = evalList->findItem(name); + it = evalList->tqfindItem(name); list << name; config->writeEntry("EvalSchemes", list); } diff --git a/kenolaba/EvalDlgImpl.h b/kenolaba/EvalDlgImpl.h index e7e4cb0d..07cb57a9 100644 --- a/kenolaba/EvalDlgImpl.h +++ b/kenolaba/EvalDlgImpl.h @@ -14,9 +14,10 @@ class Board; class EvalDlgImpl: public EvalDlg { Q_OBJECT + TQ_OBJECT public: - EvalDlgImpl(TQWidget* parent, Board* board); + EvalDlgImpl(TQWidget* tqparent, Board* board); ~EvalDlgImpl(); EvalScheme* evalScheme() { return _scheme; } diff --git a/kenolaba/EvalScheme.cpp b/kenolaba/EvalScheme.cpp index d884f398..063ca5f2 100644 --- a/kenolaba/EvalScheme.cpp +++ b/kenolaba/EvalScheme.cpp @@ -76,7 +76,7 @@ void EvalScheme::setDefaults() void EvalScheme::read(KConfig *config) { - TQString confSection = TQString("%1 Evaluation Scheme").arg(_name); + TQString confSection = TQString("%1 Evaluation Scheme").tqarg(_name); config->setGroup(confSection); TQStringList list; @@ -117,7 +117,7 @@ void EvalScheme::read(KConfig *config) void EvalScheme::save(KConfig* config) { - TQString confSection = TQString("%1 Evaluation Scheme").arg(_name); + TQString confSection = TQString("%1 Evaluation Scheme").tqarg(_name); config->setGroup(confSection); TQString entry; @@ -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], @@ -184,7 +184,7 @@ void EvalScheme::setInARowValue(int stones, int value) EvalScheme* EvalScheme::create(TQString scheme) { - int pos = scheme.find('='); + int pos = scheme.tqfind('='); if (pos<0) return 0; EvalScheme* evalScheme = new EvalScheme( scheme.left(pos) ); @@ -217,15 +217,15 @@ TQString EvalScheme::ascii() res.sprintf("%s=%d", _name.ascii(), _stoneValue[1]); for(i=1;i<6;i++) - res += TQString(",%1").arg( _stoneValue[i] ); + res += TQString(",%1").tqarg( _stoneValue[i] ); for(i=0;isetText( i18n("Actual examined position:") ); - l->setFixedHeight( l->sizeHint().height() ); - l->setAlignment( AlignVCenter | AlignLeft ); + l->setFixedHeight( l->tqsizeHint().height() ); + l->tqsetAlignment( AlignVCenter | AlignLeft ); top->addWidget( l ); TQHBoxLayout* b1 = new TQHBoxLayout(); @@ -38,8 +38,8 @@ Spy::Spy(Board& b) actLabel[i] = new TQLabel(this); actLabel[i]->setText("---"); // actLabel[i]->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - actLabel[i]->setAlignment( AlignHCenter | AlignVCenter); - actLabel[i]->setFixedHeight( actLabel[i]->sizeHint().height() ); + actLabel[i]->tqsetAlignment( AlignHCenter | AlignVCenter); + actLabel[i]->setFixedHeight( actLabel[i]->tqsizeHint().height() ); b2->addWidget( actBoard[i] ); b2->addWidget( actLabel[i] ); @@ -48,8 +48,8 @@ Spy::Spy(Board& b) l = new TQLabel(this); l->setText( i18n("Best move so far:") ); - l->setFixedHeight( l->sizeHint().height() ); - l->setAlignment( AlignVCenter | AlignLeft ); + l->setFixedHeight( l->tqsizeHint().height() ); + l->tqsetAlignment( AlignVCenter | AlignLeft ); top->addWidget( l ); b1 = new TQHBoxLayout(); @@ -63,8 +63,8 @@ Spy::Spy(Board& b) bestLabel[i] = new TQLabel(this); bestLabel[i]->setText("---"); // bestLabel[i]->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - bestLabel[i]->setAlignment( AlignHCenter | AlignVCenter); - bestLabel[i]->setFixedHeight( bestLabel[i]->sizeHint().height() ); + bestLabel[i]->tqsetAlignment( AlignHCenter | AlignVCenter); + bestLabel[i]->setFixedHeight( bestLabel[i]->tqsizeHint().height() ); b2->addWidget( bestBoard[i] ); b2->addWidget( bestLabel[i] ); diff --git a/kenolaba/Spy.h b/kenolaba/Spy.h index cbb03ad8..719b8d4f 100644 --- a/kenolaba/Spy.h +++ b/kenolaba/Spy.h @@ -14,9 +14,10 @@ class BoardWidget; class TQLabel; -class Spy: public QWidget +class Spy: public TQWidget { Q_OBJECT + TQ_OBJECT public: Spy(Board&); diff --git a/kfouleggs/ai.h b/kfouleggs/ai.h index 86e8f5b2..9885d3c8 100644 --- a/kfouleggs/ai.h +++ b/kfouleggs/ai.h @@ -7,6 +7,7 @@ class FEAI : public AI { Q_OBJECT + TQ_OBJECT public: FEAI(); diff --git a/kfouleggs/board.cpp b/kfouleggs/board.cpp index 5383c619..e719ce2f 100644 --- a/kfouleggs/board.cpp +++ b/kfouleggs/board.cpp @@ -9,8 +9,8 @@ using namespace KGrid2D; -FEBoard::FEBoard(bool graphic, TQWidget *parent) -: Board(graphic, new GiftPool(parent), parent), +FEBoard::FEBoard(bool graphic, TQWidget *tqparent) +: Board(graphic, new GiftPool(tqparent), tqparent), _field(matrix().width(), matrix().height()), _chainedPuyos(4) { init(); diff --git a/kfouleggs/board.h b/kfouleggs/board.h index da5a6275..e3b4229e 100644 --- a/kfouleggs/board.h +++ b/kfouleggs/board.h @@ -7,8 +7,9 @@ class FEBoard : public Board { Q_OBJECT + TQ_OBJECT public: - FEBoard(bool graphic, TQWidget *parent); + FEBoard(bool graphic, TQWidget *tqparent); void copy(const GenericTetris &); void start(const GTInitData &); diff --git a/kfouleggs/field.cpp b/kfouleggs/field.cpp index ae9bcdce..997e4f48 100644 --- a/kfouleggs/field.cpp +++ b/kfouleggs/field.cpp @@ -10,8 +10,8 @@ #include "board.h" -FEField::FEField(TQWidget *parent) - : Field(parent) +FEField::FEField(TQWidget *tqparent) + : Field(tqparent) { Board *b = static_cast(board); TQWhatsThis::add(b->giftPool(), i18n("Display the amount of foul eggs sent by your opponent.")); diff --git a/kfouleggs/field.h b/kfouleggs/field.h index a1c9824e..59cdcee8 100644 --- a/kfouleggs/field.h +++ b/kfouleggs/field.h @@ -8,8 +8,9 @@ class FEField : public Field { Q_OBJECT + TQ_OBJECT public: - FEField(TQWidget *parent); + FEField(TQWidget *tqparent); private slots: virtual void removedUpdated(); diff --git a/kfouleggs/main.cpp b/kfouleggs/main.cpp index 89295d08..ce083c7c 100644 --- a/kfouleggs/main.cpp +++ b/kfouleggs/main.cpp @@ -65,9 +65,9 @@ FEFactory::FEFactory() : CommonFactory(MAIN_DATA, BASE_BOARD_INFO, COMMON_BOARD_INFO) {} -BaseInterface *FEFactory::createInterface(TQWidget *parent) +BaseInterface *FEFactory::createInterface(TQWidget *tqparent) { - return new Interface(MP_GAME_INFO, parent); + return new Interface(MP_GAME_INFO, tqparent); } diff --git a/kfouleggs/main.h b/kfouleggs/main.h index 52108b2d..12aca31f 100644 --- a/kfouleggs/main.h +++ b/kfouleggs/main.h @@ -15,11 +15,11 @@ class FEFactory : public CommonFactory FEFactory(); protected: - virtual BaseBoard *createBoard(bool graphic, TQWidget *parent) - { return new FEBoard(graphic, parent); } - virtual BaseField *createField(TQWidget *parent) - { return new FEField(parent); } - virtual BaseInterface *createInterface(TQWidget *parent); + virtual BaseBoard *createBoard(bool graphic, TQWidget *tqparent) + { return new FEBoard(graphic, tqparent); } + virtual BaseField *createField(TQWidget *tqparent) + { return new FEField(tqparent); } + virtual BaseInterface *createInterface(TQWidget *tqparent); virtual AI *createAI() { return new FEAI; } }; @@ -27,6 +27,7 @@ class FEFactory : public CommonFactory class FEMainWindow : public MainWindow { Q_OBJECT + TQ_OBJECT public: FEMainWindow() { init(); } }; diff --git a/kfouleggs/piece.cpp b/kfouleggs/piece.cpp index bb5aad42..c2e8a186 100644 --- a/kfouleggs/piece.cpp +++ b/kfouleggs/piece.cpp @@ -28,7 +28,7 @@ TQColor FEPieceInfo::defaultColor(uint i) const TQString FEPieceInfo::colorLabel(uint i) const { return (i==NB_NORM_BLOCK_TYPES ? i18n("Garbage color:") - : i18n("Color #%1:").arg(i+1)); + : i18n("Color #%1:").tqarg(i+1)); } void FEPieceInfo::draw(TQPixmap *pixmap, uint blockType, uint, @@ -44,8 +44,8 @@ void FEPieceInfo::setMask(TQPixmap *pixmap, uint blockMode) const Q_ASSERT( pixmap->width()==pixmap->height() ); // drawing code assumes that TQBitmap bitmap(pixmap->size(), true); TQPainter p(&bitmap); - p.setBrush(Qt::color1); - p.setPen( TQPen(Qt::NoPen) ); + p.setBrush(TQt::color1); + p.setPen( TQPen(TQt::NoPen) ); // base circle int w = pixmap->width(); @@ -66,7 +66,7 @@ void FEPieceInfo::setMask(TQPixmap *pixmap, uint blockMode) const if ( blockMode & BaseBoard::Left ) p.drawRect( 0, 0, a, w); // second drawing with color0 - p.setBrush(Qt::color0); + p.setBrush(TQt::color0); if ( (blockMode & BaseBoard::Up) || (blockMode & BaseBoard::Left) ) { cr.moveCenter(TQPoint(0, 0)); p.drawEllipse(cr); diff --git a/kgoldrunner/Doxyfile b/kgoldrunner/Doxyfile index e76fadd7..25996b5a 100644 --- a/kgoldrunner/Doxyfile +++ b/kgoldrunner/Doxyfile @@ -82,7 +82,7 @@ FILE_PATTERNS = *.c \ *.tlh \ *.diff \ *.patch \ - *.moc \ + *.tqmoc \ *.xpm RECURSIVE = yes EXCLUDE = diff --git a/kgoldrunner/gamedata/levels.tar b/kgoldrunner/gamedata/levels.tar index 851ff50e..1e30bd67 100644 Binary files a/kgoldrunner/gamedata/levels.tar and b/kgoldrunner/gamedata/levels.tar differ diff --git a/kgoldrunner/src/kgoldrunner.cpp b/kgoldrunner/src/kgoldrunner.cpp index 13300f9e..7d5676c5 100644 --- a/kgoldrunner/src/kgoldrunner.cpp +++ b/kgoldrunner/src/kgoldrunner.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 Ian Wadham and Marco Krüger + * Copyright (C) 2003 Ian Wadham and Marco Kr�ger */ #include @@ -130,7 +130,7 @@ KGoldrunner::KGoldrunner() show(); // Force the main widget to appear before the "Start Game" dialog does. - qApp->processEvents(); + tqApp->processEvents(); // Call the "Start Game" function and pop up the "Start Game" dialog. game->startLevelOne(); @@ -193,7 +193,7 @@ void KGoldrunner::setupActions() myPause = KStdGameAction:: pause ( - this, TQT_SLOT(stopStart()), actionCollection()); + TQT_TQOBJECT(this), TQT_SLOT(stopStart()), actionCollection()); myPause-> setShortcut (Key_Escape); // Alternate key. highScore = KStdGameAction:: highscores ( @@ -214,7 +214,7 @@ void KGoldrunner::setupActions() (void) KStdGameAction:: quit ( - this, TQT_SLOT(close()), actionCollection()); + TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); /**************************************************************************/ /*************************** GAME EDITOR MENU **************************/ @@ -228,17 +228,17 @@ void KGoldrunner::setupActions() (void) new KAction ( i18n("&Create Level"), 0, - game, TQT_SLOT(createLevel()), actionCollection(), + TQT_TQOBJECT(game), TQT_SLOT(createLevel()), actionCollection(), "create"); (void) new KAction ( i18n("&Edit Any Level..."), 0, - game, TQT_SLOT(updateLevel()), actionCollection(), + TQT_TQOBJECT(game), TQT_SLOT(updateLevel()), actionCollection(), "edit_any"); (void) new KAction ( i18n("Edit &Next Level..."), 0, - game, TQT_SLOT(updateNext()), actionCollection(), + TQT_TQOBJECT(game), TQT_SLOT(updateNext()), actionCollection(), "edit_next"); // Save Edits... @@ -249,19 +249,19 @@ void KGoldrunner::setupActions() saveEdits = new KAction ( i18n("&Save Edits..."), 0, - game, TQT_SLOT(saveLevelFile()), actionCollection(), + TQT_TQOBJECT(game), TQT_SLOT(saveLevelFile()), actionCollection(), "save_edits"); saveEdits->setEnabled (FALSE); // Nothing to save, yet. (void) new KAction ( i18n("&Move Level..."), 0, - game, TQT_SLOT(moveLevelFile()), actionCollection(), + TQT_TQOBJECT(game), TQT_SLOT(moveLevelFile()), actionCollection(), "move_level"); (void) new KAction ( i18n("&Delete Level..."), 0, - game, + TQT_TQOBJECT(game), TQT_SLOT(deleteLevelFile()), actionCollection(), "delete_level"); @@ -272,12 +272,12 @@ void KGoldrunner::setupActions() (void) new KAction ( i18n("Create Game..."), 0, - this, TQT_SLOT(createGame()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(createGame()), actionCollection(), "create_game"); (void) new KAction ( i18n("Edit Game Info..."), 0, - this, + TQT_TQOBJECT(this), TQT_SLOT(editGameInfo()), actionCollection(), "edit_game"); @@ -290,27 +290,27 @@ void KGoldrunner::setupActions() setKGoldrunner = new KRadioAction ( "K&Goldrunner", 0, // Default Shift+G - this, TQT_SLOT(lsKGoldrunner()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(lsKGoldrunner()), actionCollection(), "kgoldrunner"); setAppleII = new KRadioAction ( "&Apple II", 0, // Default Shift+A - this, TQT_SLOT(lsApple2()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(lsApple2()), actionCollection(), "apple_2"); setIceCave = new KRadioAction ( i18n("&Ice Cave"), 0, // Default Shift+I - this, TQT_SLOT(lsIceCave()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(lsIceCave()), actionCollection(), "ice_cave"); setMidnight = new KRadioAction ( i18n("&Midnight"), 0, // Default Shift+M - this, TQT_SLOT(lsMidnight()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(lsMidnight()), actionCollection(), "midnight"); setKDEKool = new KRadioAction ( i18n("&KDE Kool"), 0, // Default Shift+K - this, TQT_SLOT(lsKDEKool()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(lsKDEKool()), actionCollection(), "kde_kool"); setKGoldrunner-> setExclusiveGroup ("landscapes"); @@ -331,13 +331,13 @@ void KGoldrunner::setupActions() setMouse = new KRadioAction ( i18n("&Mouse Controls Hero"), 0, - this, + TQT_TQOBJECT(this), TQT_SLOT(setMouseMode()), actionCollection(), "mouse_mode"); setKeyboard = new KRadioAction ( i18n("&Keyboard Controls Hero"), 0, - this, + TQT_TQOBJECT(this), TQT_SLOT(setKeyBoardMode()), actionCollection(), "keyboard_mode"); @@ -355,27 +355,27 @@ void KGoldrunner::setupActions() KRadioAction * nSpeed = new KRadioAction ( i18n("Normal Speed"), 0, - this, TQT_SLOT(normalSpeed()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(normalSpeed()), actionCollection(), "normal_speed"); KRadioAction * bSpeed = new KRadioAction ( i18n("Beginner Speed"), 0, - this, TQT_SLOT(beginSpeed()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(beginSpeed()), actionCollection(), "beginner_speed"); KRadioAction * cSpeed = new KRadioAction ( i18n("Champion Speed"), 0, - this, TQT_SLOT(champSpeed()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(champSpeed()), actionCollection(), "champion_speed"); (void) new KAction ( // Repeatable action. i18n("Increase Speed"), Key_Plus, - this, TQT_SLOT(incSpeed()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(incSpeed()), actionCollection(), "increase_speed"); (void) new KAction ( // Repeatable action. i18n("Decrease Speed"), Key_Minus, - this, TQT_SLOT(decSpeed()), actionCollection(), + TQT_TQOBJECT(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, TQT_SLOT(setTradRules()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(setTradRules()), actionCollection(), "trad_rules"); kgrRules = new KRadioAction ( i18n("K&Goldrunner Rules"), 0, - this, TQT_SLOT(setKGrRules()), actionCollection(), + TQT_TQOBJECT(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, TQT_SLOT(makeLarger()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(makeLarger()), actionCollection(), "larger_area"); (void) new KAction ( i18n("Smaller Playing Area"), 0, - this, TQT_SLOT(makeSmaller()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(makeSmaller()), actionCollection(), "smaller_area"); // Configure Shortcuts... @@ -422,7 +422,7 @@ void KGoldrunner::setupActions() // -------------------------- KStdAction::keyBindings ( - this, TQT_SLOT(optionsConfigureKeys()), + TQT_TQOBJECT(this), TQT_SLOT(optionsConfigureKeys()), actionCollection()); // KStdAction::configureToolbars ( // this, TQT_SLOT(optionsConfigureToolbars()), @@ -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, TQT_SLOT(goUp()), actionCollection(), "move_up"); + TQT_TQOBJECT(this), TQT_SLOT(goUp()), actionCollection(), "move_up"); (void) new KAction (i18n("Move Right"), Key_Right, - this, TQT_SLOT(goR()), actionCollection(), "move_right"); + TQT_TQOBJECT(this), TQT_SLOT(goR()), actionCollection(), "move_right"); (void) new KAction (i18n("Move Down"), Key_Down, - this, TQT_SLOT(goDown()), actionCollection(), "move_down"); + TQT_TQOBJECT(this), TQT_SLOT(goDown()), actionCollection(), "move_down"); (void) new KAction (i18n("Move Left"), Key_Left, - this, TQT_SLOT(goL()), actionCollection(), "move_left"); + TQT_TQOBJECT(this), TQT_SLOT(goL()), actionCollection(), "move_left"); (void) new KAction (i18n("Stop"), Key_Space, - this, TQT_SLOT(stop()), actionCollection(), "stop"); + TQT_TQOBJECT(this), TQT_SLOT(stop()), actionCollection(), "stop"); (void) new KAction (i18n("Dig Right"), Key_C, - this, TQT_SLOT(digR()), actionCollection(), "dig_right"); + TQT_TQOBJECT(this), TQT_SLOT(digR()), actionCollection(), "dig_right"); (void) new KAction (i18n("Dig Left"), Key_Z, - this, TQT_SLOT(digL()), actionCollection(), "dig_left"); + TQT_TQOBJECT(this), TQT_SLOT(digL()), actionCollection(), "dig_left"); // Alternate one-handed controls. Set up in "kgoldrunnerui.rc". @@ -522,7 +522,7 @@ void KGoldrunner::initStatusBar() // Set the PAUSE/RESUME key-names into the status bar message. pauseKeys = myPause->shortcut().toString(); - pauseKeys = pauseKeys.replace (';', "\" " + i18n("or") + " \""); + pauseKeys = pauseKeys.tqreplace (';', "\" " + i18n("or") + " \""); gameFreeze (FALSE); statusBar()->setItemFixed (ID_LIVES, -1); // Fix current sizes. @@ -572,10 +572,10 @@ void KGoldrunner::gameFreeze (bool on_off) { if (on_off) statusBar()->changeItem - (i18n("Press \"%1\" to RESUME").arg(pauseKeys), ID_MSG); + (i18n("Press \"%1\" to RESUME").tqarg(pauseKeys), ID_MSG); else statusBar()->changeItem - (i18n("Press \"%1\" to PAUSE").arg(pauseKeys), ID_MSG); + (i18n("Press \"%1\" to PAUSE").tqarg(pauseKeys), ID_MSG); } void KGoldrunner::adjustHintAction (bool hintAvailable) @@ -760,7 +760,7 @@ void KGoldrunner::optionsConfigureKeys() // Update the PAUSE/RESUME message in the status bar. pauseKeys = myPause->shortcut().toString(); - pauseKeys = pauseKeys.replace (';', "\" " + i18n("or") + " \""); + pauseKeys = pauseKeys.tqreplace (';', "\" " + i18n("or") + " \""); gameFreeze (KGrObject::frozen); // Refresh the status bar text. } @@ -849,7 +849,7 @@ bool KGoldrunner::getDirectories() KGrMessage::information (this, i18n("Get Folders"), i18n("Cannot find documentation sub-folder 'en/%1/' " "in area '%2' of the KDE folder ($KDEDIRS).") - .arg(myDir).arg(dirs->kde_default ("html"))); + .tqarg(myDir).tqarg(dirs->kde_default ("html"))); // result = FALSE; // Don't abort if the doc is missing. } else @@ -861,7 +861,7 @@ bool KGoldrunner::getDirectories() KGrMessage::information (this, i18n("Get Folders"), i18n("Cannot find system games sub-folder '%1/system/' " "in area '%2' of the KDE folder ($KDEDIRS).") - .arg(myDir).arg(dirs->kde_default ("data"))); + .tqarg(myDir).tqarg(dirs->kde_default ("data"))); result = FALSE; // ABORT if the games data is missing. } else @@ -874,7 +874,7 @@ bool KGoldrunner::getDirectories() KGrMessage::information (this, i18n("Get Folders"), i18n("Cannot find or create user games sub-folder '%1/user/' " "in area '%2' of the KDE user area ($KDEHOME).") - .arg(myDir).arg(dirs->kde_default ("data"))); + .tqarg(myDir).tqarg(dirs->kde_default ("data"))); // result = FALSE; // Don't abort if user area is missing. } else { @@ -882,7 +882,7 @@ bool KGoldrunner::getDirectories() if (! create) { KGrMessage::information (this, i18n("Get Folders"), i18n("Cannot find or create 'levels/' folder in " - "sub-folder '%1/user/' in the KDE user area ($KDEHOME).").arg(myDir)); + "sub-folder '%1/user/' in the KDE user area ($KDEHOME).").tqarg(myDir)); // result = FALSE; // Don't abort if user area is missing. } } @@ -987,7 +987,7 @@ void KGoldrunner::makeEditToolbar() edenemybg = edenemybg.xForm (w); } - editToolbar = new KToolBar (this, Qt::DockTop, TRUE, "Editor", TRUE); + editToolbar = new KToolBar (this, TQt::DockTop, TRUE, "Editor", TRUE); // Choose a colour that enhances visibility of the KGoldrunner pixmaps. // editToolbar->setPalette (TQPalette (TQColor (150, 150, 230))); @@ -995,7 +995,7 @@ void KGoldrunner::makeEditToolbar() // editToolbar->setHorizontallyStretchable (TRUE); // Not effective in KDE. // All those separators are just to get reasonable visual spacing of the - // pixmaps in KDE. "setHorizontallyStretchable(TRUE)" does it in Qt. + // pixmaps in KDE. "setHorizontallyStretchable(TRUE)" does it in TQt. editToolbar->insertSeparator(); @@ -1015,34 +1015,34 @@ void KGoldrunner::makeEditToolbar() editToolbar->insertSeparator(); editToolbar->insertSeparator(); - editToolbar->insertButton (freebg, (int)FREE, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (freebg, (int)FREE, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT(freeSlot()), TRUE, i18n("Empty space")); editToolbar->insertSeparator(); - editToolbar->insertButton (edherobg, (int)HERO, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (edherobg, (int)HERO, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (edheroSlot()), TRUE, i18n("Hero")); editToolbar->insertSeparator(); - editToolbar->insertButton (edenemybg, (int)ENEMY, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (edenemybg, (int)ENEMY, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (edenemySlot()), TRUE, i18n("Enemy")); editToolbar->insertSeparator(); - editToolbar->insertButton (brickbg, (int)BRICK, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (brickbg, (int)BRICK, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (brickSlot()), TRUE, i18n("Brick (can dig)")); editToolbar->insertSeparator(); - editToolbar->insertButton (betonbg, (int)BETON, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (betonbg, (int)BETON, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (betonSlot()), TRUE, i18n("Concrete (cannot dig)")); editToolbar->insertSeparator(); - editToolbar->insertButton (fbrickbg, (int)FBRICK, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (fbrickbg, (int)FBRICK, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (fbrickSlot()), TRUE, i18n("Trap (can fall through)")); editToolbar->insertSeparator(); - editToolbar->insertButton (ladderbg, (int)LADDER, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (ladderbg, (int)LADDER, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (ladderSlot()), TRUE, i18n("Ladder")); editToolbar->insertSeparator(); - editToolbar->insertButton (hladderbg, (int)HLADDER, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (hladderbg, (int)HLADDER, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (hladderSlot()), TRUE, i18n("Hidden ladder")); editToolbar->insertSeparator(); - editToolbar->insertButton (polebg, (int)POLE, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (polebg, (int)POLE, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (poleSlot()), TRUE, i18n("Pole (or bar)")); editToolbar->insertSeparator(); - editToolbar->insertButton (nuggetbg, (int)NUGGET, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (nuggetbg, (int)NUGGET, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (nuggetSlot()), TRUE, i18n("Gold nugget")); editToolbar->setToggle ((int) FREE, TRUE); diff --git a/kgoldrunner/src/kgoldrunner.h b/kgoldrunner/src/kgoldrunner.h index 358a5561..2959b3d0 100644 --- a/kgoldrunner/src/kgoldrunner.h +++ b/kgoldrunner/src/kgoldrunner.h @@ -9,7 +9,7 @@ #include #endif -// Status bar +// tqStatus bar const int ID_LIVES = 0; // Field IDs in KDE status bar. const int ID_SCORE = 1; const int ID_LEVEL = 2; @@ -40,6 +40,7 @@ class KGrHero; class KGoldrunner : public KMainWindow { Q_OBJECT + TQ_OBJECT public: /** * Default Constructor @@ -136,7 +137,7 @@ private slots: void showLevel (int); // Show the current level number. void showLives (long); // Show how many lives are remaining. void showScore (long); // Show the player's score. - void gameFreeze (bool); // Status feedback on freeze/unfreeze. + void gameFreeze (bool); // tqStatus feedback on freeze/unfreeze. void adjustHintAction (bool); // Enable/disable "Hint" action. void markRuleType (char ruleType); // Check game's rule type in the menu. @@ -163,7 +164,7 @@ private: KAction * saveGame; // Save game, level, lives and score. KAction * myPause; // Pause or resume the game. - QString pauseKeys; // Keystroke names to put in status bar. + TQString pauseKeys; // Keystroke names to put in status bar. KAction * hintAction; // Display a hint, if available. KAction * killHero; // Kill hero (disabled during edits). diff --git a/kgoldrunner/src/kgrcanvas.cpp b/kgoldrunner/src/kgrcanvas.cpp index 111913a1..907463e5 100644 --- a/kgoldrunner/src/kgrcanvas.cpp +++ b/kgoldrunner/src/kgrcanvas.cpp @@ -2,7 +2,7 @@ kgrcanvas.cpp - description ------------------- begin : Wed Jan 23 2002 - copyright : (C) 2002 by Marco Krüger and Ian Wadham + copyright : (C) 2002 by Marco Kr�ger and Ian Wadham email : See menu "Help, About KGoldrunner" ***************************************************************************/ @@ -34,8 +34,8 @@ class KGoldrunner; -KGrCanvas::KGrCanvas (TQWidget * parent, const char *name) - : TQCanvasView (0, parent, name) +KGrCanvas::KGrCanvas (TQWidget * tqparent, const char *name) + : TQCanvasView (0, tqparent, name) { setBackgroundMode (NoBackground); m = new TQCursor (); // For handling the mouse. @@ -117,7 +117,7 @@ bool KGrCanvas::changeSize (int d) return FALSE; } - TQWMatrix wm = worldMatrix(); + TQWMatrix wm = tqworldMatrix(); double wmScale = 1.0; // Set the scale back to 1:1 and calculate the new scale factor. @@ -145,7 +145,7 @@ bool KGrCanvas::changeSize (int d) #else KGrMessage::information (this, i18n( "Change Size" ), i18n( "Sorry, you cannot change the size of the playing area. " - "That function requires Qt Library version 3 or later." )); + "That function requires TQt Library version 3 or later." )); return FALSE; #endif } @@ -196,8 +196,8 @@ void KGrCanvas::setTitle (TQString newTitle) void KGrCanvas::makeTitle () { - // 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). + // This uses a calculated TQLabel and TQFont size because a TQCanvasText + // object does not always display scaled-up fonts cleanly (in TQt 3.1.1). if (title != 0) title->close (TRUE); // Close and delete previous title. @@ -210,7 +210,7 @@ void KGrCanvas::makeTitle () title->setPaletteForegroundColor (textColor); title->setFont (TQFont (fontInfo().family(), (baseFontSize * scaleStep) / baseScale, TQFont::Bold)); - title->setAlignment (Qt::AlignCenter); + title->tqsetAlignment (TQt::AlignCenter); title->raise(); title->show(); } @@ -257,12 +257,12 @@ void KGrCanvas::makeHeroSprite (int i, int j, int startFrame) i++; j++; heroSprite->move (i * 4 * STEP, j * 4 * STEP, startFrame); heroSprite->setZ (1); - heroSprite->setVisible (TRUE); + heroSprite->tqsetVisible (TRUE); } void KGrCanvas::setHeroVisible (bool newState) { - heroSprite->setVisible (newState); // Show or hide the hero. + heroSprite->tqsetVisible (newState); // Show or hide the hero. } void KGrCanvas::makeEnemySprite (int i, int j, int startFrame) @@ -396,8 +396,8 @@ void KGrCanvas::initView() #else TQPixmap * pm; TQPoint * pt; - QList pmList; - QList ptList; + TQList pmList; + TQList ptList; pt = new TQPoint (0, 0); // "Hot spot" not used in KGoldrunner. @@ -469,7 +469,7 @@ void KGrCanvas::initView() #ifdef QT3 enemySprites = new TQPtrList (); #else - enemySprites = new QList (); + enemySprites = new TQList (); #endif enemySprites->setAutoDelete(TRUE); } diff --git a/kgoldrunner/src/kgrcanvas.h b/kgoldrunner/src/kgrcanvas.h index 2c0ab270..cfabc408 100644 --- a/kgoldrunner/src/kgrcanvas.h +++ b/kgoldrunner/src/kgrcanvas.h @@ -28,11 +28,12 @@ #include #include -class KGrCanvas : public QCanvasView +class KGrCanvas : public TQCanvasView { Q_OBJECT + TQ_OBJECT public: - KGrCanvas (TQWidget * parent = 0, const char *name = 0); + KGrCanvas (TQWidget * tqparent = 0, const char *name = 0); virtual ~KGrCanvas(); void changeLandscape (const TQString & name); @@ -95,7 +96,7 @@ private: #ifdef QT3 TQPtrList * enemySprites; #else - QList * enemySprites; + TQList * enemySprites; #endif void initView(); diff --git a/kgoldrunner/src/kgrconsts.h b/kgoldrunner/src/kgrconsts.h index 2006648a..ce5ada47 100644 --- a/kgoldrunner/src/kgrconsts.h +++ b/kgoldrunner/src/kgrconsts.h @@ -70,7 +70,7 @@ enum Position {RIGHTWALK1,RIGHTWALK2,RIGHTWALK3,RIGHTWALK4, LEFTCLIMB1,LEFTCLIMB2,LEFTCLIMB3,LEFTCLIMB4, CLIMB1,CLIMB2, FALL1,FALL2}; -enum Status {STANDING,FALLING,WALKING,CLIMBING,CAPTIVE}; +enum tqStatus {STANDING,FALLING,WALKING,CLIMBING,CAPTIVE}; enum Direction {RIGHT,LEFT,UP,DOWN,STAND}; enum SearchStrategy {LOW,MEDIUM,HIGH}; diff --git a/kgoldrunner/src/kgrdialog.cpp b/kgoldrunner/src/kgrdialog.cpp index 632eb617..011f56dc 100644 --- a/kgoldrunner/src/kgrdialog.cpp +++ b/kgoldrunner/src/kgrdialog.cpp @@ -29,16 +29,16 @@ #ifdef KGR_PORTABLE KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, TQPtrList & gamesList, KGrGame * theGame, - TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + TQWidget * tqparent, const char * name) + : TQDialog (tqparent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, TQPtrList & gamesList, KGrGame * theGame, - TQWidget * parent, const char * name) + TQWidget * tqparent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Select Game"), KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help, - KDialogBase::Ok, parent, name) + KDialogBase::Ok, tqparent, name) #endif { slAction = action; @@ -47,7 +47,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, collections = gamesList; game = theGame; collection = collections.at(defaultGame); - slParent = parent; + slParent = tqparent; #ifdef KGR_PORTABLE int margin = 10; @@ -84,7 +84,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, if ((action == SL_START) || (action == SL_UPD_GAME)) { dad-> setCaption (i18n("Select Game")); - TQLabel * startMsg = new QLabel + TQLabel * startMsg = new TQLabel ("" + i18n("Level 1 of the selected game is:") + "", dad); mainLayout->addWidget (startMsg); } @@ -99,7 +99,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, // Initial range 1->150, small step 1, big step 10 and default value 1. number = new TQScrollBar (1, 150, 1, 10, 1, - TQScrollBar::Horizontal, dad); + Qt::Horizontal, dad); grid->addWidget (number, 1, 1); TQHBox * numberPair = new TQHBox (dad); @@ -117,7 +117,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, grid->addMultiCellWidget (thumbNail, 1, 3, 2, 2); // Set thumbnail cell size to about 1/5 of game cell size. - int cellSize = parent->width() / (5 * (FIELDWIDTH + 4)); + int cellSize = tqparent->width() / (5 * (FIELDWIDTH + 4)); thumbNail-> setFixedWidth ((FIELDWIDTH * cellSize) + 2); thumbNail-> setFixedHeight ((FIELDHEIGHT * cellSize) + 2); @@ -125,15 +125,15 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, TQHBox * buttons = new TQHBox (this); mainLayout->addWidget (buttons); buttons->setSpacing (spacing); - // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. + // Buttons are for TQt-only portability. NOT COMPILED in KDE environment. HELP = new TQPushButton (i18n("Help"), buttons); OK = new TQPushButton (i18n("&OK"), buttons); CANCEL = new TQPushButton (i18n("&Cancel"), buttons); - TQPoint p = parent->mapToGlobal (TQPoint (0,0)); + TQPoint p = tqparent->mapToGlobal (TQPoint (0,0)); - // Base the geometry of the dialog box on the playing area. - int cell = parent->width() / (FIELDWIDTH + 4); + // Base the tqgeometry of the dialog box on the playing area. + int cell = tqparent->width() / (FIELDWIDTH + 4); dad-> move (p.x()+2*cell, p.y()+2*cell); dad-> setMinimumSize ((FIELDWIDTH*cell/2), (FIELDHEIGHT-1)*cell); @@ -357,7 +357,7 @@ void KGrSLDialog::slAboutColln () { // User clicked the "About" button ... int n = slCollnIndex; - QString title = i18n("About \"%1\"").arg(collections.at(n)->name); + TQString title = i18n("About \"%1\"").tqarg(collections.at(n)->name); if (collections.at(n)->about.length() > 0) { // Convert game description to ASCII and UTF-8 codes, then translate it. @@ -401,10 +401,10 @@ void KGrSLDialog::slPaintLevel () if (n < 0) { return; // Owner has no collections. } - QString filePath = game->getFilePath + TQString filePath = game->getFilePath (collections.at(n)->owner, collections.at(n), number->value()); thumbNail->setFilePath (filePath, slName); - thumbNail->repaint(); // Will call "drawContents (p)". + thumbNail->tqrepaint(); // Will call "drawContents (p)". } void KGrSLDialog::slotHelp () @@ -486,15 +486,15 @@ void KGrSLDialog::slotHelp () #ifdef KGR_PORTABLE KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, - TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + TQWidget * tqparent, const char * name) + : TQDialog (tqparent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, - TQWidget * parent, const char * name) + TQWidget * tqparent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Edit Name & Hint"), KDialogBase::Ok | KDialogBase::Cancel, - KDialogBase::Ok, parent, name) + KDialogBase::Ok, tqparent, name) #endif { #ifdef KGR_PORTABLE @@ -530,21 +530,21 @@ KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, TQHBox * buttons = new TQHBox (dad); mainLayout->addWidget (buttons); buttons->setSpacing (spacing); - // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. + // Buttons are for TQt-only portability. NOT COMPILED in KDE environment. 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 (TQPoint (0,0)); - int c = parent->width() / (FIELDWIDTH + 4); + // Base the tqgeometry of the text box on the playing area. + TQPoint p = tqparent->mapToGlobal (TQPoint (0,0)); + int c = tqparent->width() / (FIELDWIDTH + 4); dad-> move (p.x()+4*c, p.y()+4*c); mle-> setMinimumSize ((FIELDWIDTH*c/2), (FIELDHEIGHT/2)*c); // Configure the text box. - mle-> setAlignment (AlignLeft); + mle-> tqsetAlignment (AlignLeft); #ifndef QT3 mle-> setWordWrap (TQMultiLineEdit::WidgetWidth); mle-> setFixedVisibleLines (9); @@ -573,16 +573,16 @@ KGrNHDialog::~KGrNHDialog() #ifdef KGR_PORTABLE KGrECDialog::KGrECDialog (int action, int collnIndex, TQPtrList & gamesList, - TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + TQWidget * tqparent, const char * name) + : TQDialog (tqparent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrECDialog::KGrECDialog (int action, int collnIndex, TQPtrList & gamesList, - TQWidget * parent, const char * name) + TQWidget * tqparent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Edit Game Info"), KDialogBase::Ok | KDialogBase::Cancel, - KDialogBase::Ok, parent, name) + KDialogBase::Ok, tqparent, name) #endif { collections = gamesList; @@ -612,7 +612,7 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, prefixL = new TQLabel (i18n("File name prefix:"), prefixBox); ecPrefix = new TQLineEdit (prefixBox); - ecGrp = new TQButtonGroup (1, TQButtonGroup::Horizontal, 0, dad); + ecGrp = new TQButtonGroup (1, Qt::Horizontal, 0, dad); mainLayout->addWidget (ecGrp); ecTradB = new TQRadioButton (i18n("Traditional rules"), ecGrp); ecKGrB = new TQRadioButton (i18n("KGoldrunner rules"), ecGrp); @@ -636,14 +636,14 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, TQHBox * buttons = new TQHBox (dad); mainLayout->addWidget (buttons); buttons->setSpacing (spacing); - // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. + // Buttons are for TQt-only portability. NOT COMPILED in KDE environment. OK = new TQPushButton (i18n("&OK"), buttons); CANCEL = new TQPushButton (i18n("&Cancel"), buttons); - TQPoint p = parent->mapToGlobal (TQPoint (0,0)); + TQPoint p = tqparent->mapToGlobal (TQPoint (0,0)); - // Base the geometry of the dialog box on the playing area. - int cell = parent->width() / (FIELDWIDTH + 4); + // Base the tqgeometry of the dialog box on the playing area. + int cell = tqparent->width() / (FIELDWIDTH + 4); dad-> move (p.x()+2*cell, p.y()+2*cell); dad-> setMinimumSize ((FIELDWIDTH*cell/2), (FIELDHEIGHT-1)*cell); #endif @@ -663,13 +663,13 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, // Collection already has some levels, so cannot change the prefix. ecPrefix-> setEnabled (FALSE); } - QString s; + TQString s; #ifndef KGR_PORTABLE nLevL-> setText (i18n("1 level", "%n levels", collections.at(defaultGame)->nLevels)); #else nLevL-> setText (i18n("%1 levels") - .arg(collections.at(defaultGame)->nLevels)); + .tqarg(collections.at(defaultGame)->nLevels)); #endif OKText = i18n("Save Changes"); } @@ -694,7 +694,7 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, } // Configure the edit box. - mle-> setAlignment (AlignLeft); + mle-> tqsetAlignment (AlignLeft); #ifndef QT3 mle-> setWordWrap (TQMultiLineEdit::WidgetWidth); mle-> setFixedVisibleLines (8); @@ -750,16 +750,16 @@ void KGrECDialog::ecSetTrad () {ecSetRules ('T');} #ifdef KGR_PORTABLE KGrLGDialog::KGrLGDialog (TQFile * savedGames, TQPtrList & collections, - TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + TQWidget * tqparent, const char * name) + : TQDialog (tqparent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrLGDialog::KGrLGDialog (TQFile * savedGames, TQPtrList & collections, - TQWidget * parent, const char * name) + TQWidget * tqparent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Select Saved Game"), KDialogBase::Ok | KDialogBase::Cancel, - KDialogBase::Ok, parent, name) + KDialogBase::Ok, tqparent, name) #endif { #ifdef KGR_PORTABLE @@ -780,9 +780,9 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames, lgList = new TQListBox (dad); #ifdef KGR_PORTABLE - QFont f ("courier", 12); + TQFont f ("courier", 12); #else - QFont f = KGlobalSettings::fixedFont(); // KDE version. + TQFont f = KGlobalSettings::fixedFont(); // KDE version. #endif f.setFixedPitch (TRUE); lgList-> setFont (f); @@ -795,16 +795,16 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames, #ifdef KGR_PORTABLE TQHBox * buttons = new TQHBox (dad); buttons-> setSpacing (spacing); - // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. + // Buttons are for TQt-only portability. NOT COMPILED in KDE environment. 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 (TQPoint (0,0)); - int c = parent->width() / (FIELDWIDTH + 4); + // Base the tqgeometry of the list box on the playing area. + TQPoint p = tqparent->mapToGlobal (TQPoint (0,0)); + int c = tqparent->width() / (FIELDWIDTH + 4); dad-> move (p.x()+2*c, p.y()+2*c); lgList-> setMinimumHeight ((FIELDHEIGHT/2)*c); OK-> setMaximumWidth (4*c); @@ -816,16 +816,16 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames, lgHighlight = -1; - QTextStream gameText (savedGames); - QString s = ""; - QString pr = ""; + TQTextStream gameText (savedGames); + TQString s = ""; + TQString pr = ""; int i; int imax = collections.count(); // Read the saved games into the list box. while (! gameText.endData()) { s = gameText.readLine(); // Read in one saved game. - pr = s.left (s.find (" ", 0, FALSE)); // Get the collection prefix. + pr = s.left (s.tqfind (" ", 0, FALSE)); // Get the collection prefix. for (i = 0; i < imax; i++) { // Get the collection name. if (collections.at(i)->prefix == pr) { s = s.insert (0, @@ -858,26 +858,26 @@ void KGrLGDialog::lgSelect (int n) *********************** CENTRALISED MESSAGE FUNCTIONS ************************ *******************************************************************************/ -void KGrMessage::information (TQWidget * parent, const TQString &caption, const TQString &text) +void KGrMessage::information (TQWidget * tqparent, const TQString &caption, const TQString &text) { #ifdef KGR_PORTABLE - // Force Qt to do word-wrapping (but it ignores "\n" line-breaks). - TQMessageBox::information (parent, caption, + // Force TQt to do word-wrapping (but it ignores "\n" line-breaks). + TQMessageBox::information (tqparent, caption, "" + text + ""); #else // KDE does word-wrapping and will observe "\n" line-breaks. - KMessageBox::information (parent, text, caption); + KMessageBox::information (tqparent, text, caption); #endif } -int KGrMessage::warning (TQWidget * parent, TQString caption, TQString text, +int KGrMessage::warning (TQWidget * tqparent, 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 = TQMessageBox::warning (parent, caption, + // Force TQt to do word-wrapping (but it ignores "\n" line-breaks). + ans = TQMessageBox::warning (tqparent, caption, "" + text + "", label0, label1, label2, 0, (label2.isEmpty()) ? 1 : 2); @@ -885,13 +885,13 @@ int KGrMessage::warning (TQWidget * parent, TQString caption, TQString text, // KDE does word-wrapping and will observe "\n" line-breaks. if (label2.isEmpty()) { // Display a box with 2 buttons. - ans = KMessageBox::questionYesNo (parent, text, caption, + ans = KMessageBox::questionYesNo (tqparent, text, caption, label0, label1); ans = (ans == KMessageBox::Yes) ? 0 : 1; } else { // Display a box with 3 buttons. - ans = KMessageBox::questionYesNoCancel (parent, text, caption, + ans = KMessageBox::questionYesNoCancel (tqparent, text, caption, label0, label1); if (ans == KMessageBox::Cancel) ans = 2; @@ -906,12 +906,12 @@ int KGrMessage::warning (TQWidget * parent, TQString caption, TQString text, /********************** WORD-WRAPPED MESSAGE BOX ************************/ /******************************************************************************/ -void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents) +void KGrMessage::wrapped (TQWidget * tqparent, TQString title, TQString contents) { #ifndef KGR_PORTABLE - KMessageBox::information (parent, contents, title); + KMessageBox::information (tqparent, contents, title); #else - TQDialog * mm = new TQDialog (parent, "wrappedMessage", TRUE, + TQDialog * mm = new TQDialog (tqparent, "wrappedMessage", TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title); int margin = 10; @@ -919,7 +919,7 @@ void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents) TQVBoxLayout * mainLayout = new TQVBoxLayout (mm, margin, spacing); // Make text background grey not white (i.e. same as widget background). - QPalette pl = mm->palette(); + TQPalette pl = mm->palette(); #ifdef QT3 pl.setColor (TQColorGroup::Base, mm->paletteBackgroundColor()); #else @@ -936,21 +936,21 @@ void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents) #endif mainLayout->addWidget (mle); - // Button is for Qt-only portability. NOT COMPILED in KDE environment. + // Button is for TQt-only portability. NOT COMPILED in KDE environment. TQPushButton * OK = new TQPushButton (i18n("&OK"), mm); - mainLayout->addWidget (OK, Qt::AlignHCenter); + mainLayout->addWidget (OK, TQt::AlignHCenter); mm-> setCaption (title); - // Base the geometry of the text box on the playing area. - QPoint p = parent->mapToGlobal (TQPoint (0,0)); - int c = parent->width() / (FIELDWIDTH + 4); + // Base the tqgeometry of the text box on the playing area. + TQPoint p = tqparent->mapToGlobal (TQPoint (0,0)); + int c = tqparent->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 (TQFrame::NoFrame); - mle-> setAlignment (AlignLeft); + mle-> tqsetAlignment (AlignLeft); mle-> setReadOnly (TRUE); mle-> setText (contents); diff --git a/kgoldrunner/src/kgrdialog.h b/kgoldrunner/src/kgrdialog.h index 860328eb..cbf4735a 100644 --- a/kgoldrunner/src/kgrdialog.h +++ b/kgoldrunner/src/kgrdialog.h @@ -7,15 +7,15 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ -#ifndef KGRDIALOG_QT_H -#define KGRDIALOG_QT_H +#ifndef KGRDIALOG_TQT_H +#define KGRDIALOG_TQT_H // If portable version, use TQDialog and TQMessageBox. // If KDE version, use KDialogBase and KMessageBox. #ifdef KGR_PORTABLE #include -#define KGR_DIALOG QDialog +#define KGR_DIALOG TQDialog #include #else @@ -55,13 +55,14 @@ class KGrThumbNail; /******************* DIALOG TO SELECT A GAME AND LEVEL *******************/ /******************************************************************************/ -class KGrSLDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase +class KGrSLDialog : public KGR_DIALOG // KGR_PORTABLE sets TQDialog/KDialogBase { Q_OBJECT + TQ_OBJECT public: KGrSLDialog (int action, int requestedLevel, int collnIndex, TQPtrList & gamesList, KGrGame * theGame, - TQWidget * parent = 0, const char *name = 0); + TQWidget * tqparent = 0, const char *name = 0); ~KGrSLDialog(); int selectedLevel() {return (number->value());} @@ -110,16 +111,17 @@ private: *************** DIALOG BOX TO CREATE/EDIT A LEVEL NAME AND HINT **************** *******************************************************************************/ -class KGrNHDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase +class KGrNHDialog : public KGR_DIALOG // KGR_PORTABLE sets TQDialog/KDialogBase { Q_OBJECT + TQ_OBJECT public: KGrNHDialog (const TQString & levelName, const TQString & levelHint, - TQWidget * parent = 0, const char * name = 0); + TQWidget * tqparent = 0, const char * name = 0); ~KGrNHDialog(); - QString getName() {return (nhName->text());} - QString getHint() {return (mle->text());} + TQString getName() {return (nhName->text());} + TQString getHint() {return (mle->text());} private: TQLineEdit * nhName; @@ -134,19 +136,20 @@ private: ***************** DIALOG TO CREATE OR EDIT A GAME (COLLECTION) ***************** *******************************************************************************/ -class KGrECDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase +class KGrECDialog : public KGR_DIALOG // KGR_PORTABLE sets TQDialog/KDialogBase { Q_OBJECT + TQ_OBJECT public: KGrECDialog (int action, int collnIndex, TQPtrList & gamesList, - TQWidget *parent = 0, const char *name = 0); + TQWidget *tqparent = 0, const char *name = 0); ~KGrECDialog(); - QString getName() {return (ecName->text());} - QString getPrefix() {return (ecPrefix->text());} + TQString getName() {return (ecName->text());} + TQString getPrefix() {return (ecPrefix->text());} bool isTrad() {return (ecTradB->isChecked());} - QString getAboutText() {return (mle->text());} + TQString getAboutText() {return (mle->text());} private slots: void ecSetRules (const char settings); @@ -186,12 +189,13 @@ private: #include #include -class KGrLGDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase +class KGrLGDialog : public KGR_DIALOG // KGR_PORTABLE sets TQDialog/KDialogBase { Q_OBJECT + TQ_OBJECT public: KGrLGDialog (TQFile * savedGames, TQPtrList & collections, - TQWidget * parent, const char * name); + TQWidget * tqparent, const char * name); TQString getCurrentText() {return (lgList->currentText());} private slots: @@ -203,16 +207,16 @@ private: }; /******************************************************************************* -****************** PORTABLE MESSAGE FUNCTIONS (Qt Version) ******************* +****************** PORTABLE MESSAGE FUNCTIONS (TQt Version) ******************* *******************************************************************************/ -class KGrMessage : public QDialog +class KGrMessage : public TQDialog { public: - static void information (TQWidget * parent, const TQString &caption, const TQString &text); - static int warning (TQWidget * parent, TQString caption, TQString text, + static void information (TQWidget * tqparent, const TQString &caption, const TQString &text); + static int warning (TQWidget * tqparent, TQString caption, TQString text, TQString label0, TQString label1, TQString label2 = ""); - static void wrapped (TQWidget * parent, TQString caption, TQString text); + static void wrapped (TQWidget * tqparent, TQString caption, TQString text); }; #endif diff --git a/kgoldrunner/src/kgrfigure.cpp b/kgoldrunner/src/kgrfigure.cpp index 0dcb68af..7c640e88 100644 --- a/kgoldrunner/src/kgrfigure.cpp +++ b/kgoldrunner/src/kgrfigure.cpp @@ -76,7 +76,7 @@ int KGrFigure::gety() return absy; } -Status KGrFigure::getStatus() +tqStatus KGrFigure::gettqStatus() { return status; } @@ -713,7 +713,7 @@ void KGrHero::digRight(){ #ifdef QT3 void KGrHero::setEnemyList(TQPtrList *e) #else -void KGrHero::setEnemyList(QList *e) +void KGrHero::setEnemyList(TQList *e) #endif { enemies = e; @@ -733,7 +733,7 @@ bool KGrHero::standOnEnemy() (((absx - 16) < enemy->getx()) && ((absx + 16) > enemy->getx()))) { if (((absy + 12) == enemy->gety()) && - (enemy->getStatus() != FALLING)) { + (enemy->gettqStatus() != FALLING)) { absy = absy - rely; // Bounce back from overlap, to avoid rely = 0; // hero-enemy mid-cycle deadlock. walkCounter = 1; @@ -807,7 +807,7 @@ KGrEnemy :: KGrEnemy (KGrCanvas * view, int x, int y) walkCounter = 1; captiveCounter = 0; - searchStatus = HORIZONTAL; + searchtqStatus = HORIZONTAL; birthX=x; birthY=y; @@ -849,7 +849,7 @@ void KGrEnemy::showState(char option) case 's': printf (" nuggets %02d status %d walk-ctr %d ", nuggets, status, walkCounter); printf ("dirn %d search %d capt-ctr %d\n", - direction, searchStatus, captiveCounter); + direction, searchtqStatus, captiveCounter); printf (" rel (%02d,%02d) abs (%03d,%03d)", relx, rely, absx, absy); printf (" pix %02d", actualPixmap); @@ -907,7 +907,7 @@ void KGrEnemy::walkTimeDone () case RIGHT: walkRight (WALKDELAY, FALLDELAY); break; case LEFT: walkLeft (WALKDELAY, FALLDELAY); break; default: // Switch search direction in KGoldrunner search (only). - searchStatus = (searchStatus==VERTIKAL) ? + searchtqStatus = (searchtqStatus==VERTIKAL) ? HORIZONTAL : VERTIKAL; // In KGoldrunner rules, if a hole opens under an enemy @@ -942,7 +942,7 @@ void KGrEnemy::walkTimeDone () // In KGoldrunner rules, change the search strategy, // to avoid enemy-enemy deadlock. - searchStatus = (searchStatus==VERTIKAL) ? HORIZONTAL : VERTIKAL; + searchtqStatus = (searchtqStatus==VERTIKAL) ? HORIZONTAL : VERTIKAL; dirn = searchbestway (x, y, herox, heroy); if ((dirn != direction) && ((*playfield)[x][y]->whatIam() != USEDHOLE)) { @@ -1221,7 +1221,7 @@ Direction KGrEnemy::searchbestway(int ew,int eh,int hw,int hh) // KGoldrunner search strategy. case MEDIUM: case HIGH: - if(searchStatus==VERTIKAL){ + if(searchtqStatus==VERTIKAL){ if (eh > hh) return searchupway(ew,eh); if (eh < hh) @@ -1673,7 +1673,7 @@ bool KGrEnemy::willNotFall (int x, int y) #ifdef QT3 void KGrEnemy::setEnemyList(TQPtrList *e) #else -void KGrEnemy::setEnemyList(QList *e) +void KGrEnemy::setEnemyList(TQList *e) #endif { enemies = e; diff --git a/kgoldrunner/src/kgrfigure.h b/kgoldrunner/src/kgrfigure.h index 12551418..fd7de606 100644 --- a/kgoldrunner/src/kgrfigure.h +++ b/kgoldrunner/src/kgrfigure.h @@ -33,9 +33,10 @@ class KGrCanvas; class KGrObject; class KGrEnemy; -class KGrFigure : public QObject +class KGrFigure : public TQObject { Q_OBJECT + TQ_OBJECT public: KGrFigure (int, int); virtual ~KGrFigure(); @@ -53,7 +54,7 @@ public: // dependent on number of enemies. int getx(); int gety(); - Status getStatus(); + tqStatus gettqStatus(); int getnuggets(); void setNuggets(int n); @@ -80,7 +81,7 @@ protected: TQTimer *fallTimer; KGrObject *(*playfield)[30][22]; - Status status; + tqStatus status; Direction direction; bool canWalkRight(); bool canWalkLeft(); @@ -102,6 +103,7 @@ protected: class KGrHero : public KGrFigure { Q_OBJECT + TQ_OBJECT public: KGrHero(KGrCanvas *, int , int); virtual ~KGrHero(); @@ -114,7 +116,7 @@ public: #ifdef QT3 void setEnemyList(TQPtrList *); #else - void setEnemyList(QList *); + void setEnemyList(TQList *); #endif void init(int,int); void setKey(Direction); @@ -131,7 +133,7 @@ private: #ifdef QT3 TQPtrList *enemies; #else - QList *enemies; + TQList *enemies; #endif KGrCanvas * heroView; bool standOnEnemy(); @@ -161,6 +163,7 @@ signals: class KGrEnemy : public KGrFigure { Q_OBJECT + TQ_OBJECT public: KGrEnemy (KGrCanvas *, int , int); virtual ~KGrEnemy(); @@ -169,7 +172,7 @@ public: #ifdef QT3 void setEnemyList(TQPtrList *); #else - void setEnemyList(QList *); + void setEnemyList(TQList *); #endif virtual void init(int,int); static int WALKDELAY; @@ -182,14 +185,14 @@ public: private: KGrCanvas * enemyView; int birthX, birthY; - int searchStatus; + int searchtqStatus; int captiveCounter; TQTimer *captiveTimer; bool canWalkUp(); #ifdef QT3 TQPtrList *enemies; #else - QList *enemies; + TQList *enemies; #endif bool standOnEnemy(); bool bumpingFriend(); diff --git a/kgoldrunner/src/kgrgame.cpp b/kgoldrunner/src/kgrgame.cpp index 985d0783..b83b35ed 100644 --- a/kgoldrunner/src/kgrgame.cpp +++ b/kgoldrunner/src/kgrgame.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2003 by Ian Wadham and Marco Krüger * + * Copyright (C) 2003 by Ian Wadham and Marco Kr�ger * * ianw2@optusnet.com.au * * * * This program is free software; you can redistribute it and/or modify * @@ -190,7 +190,7 @@ void KGrGame::goUpOneLevel() KGrMessage::information (view, collection->name, i18n("CONGRATULATIONS !!!!" "

You have conquered the last level in the %1 game !!

") - .arg("\"" + collection->name + "\"")); + .tqarg("\"" + collection->name + "\"")); checkHighScore(); // Check if there is a high score for this game. unfreeze(); @@ -384,7 +384,7 @@ void KGrGame::startTutorial() KGrMessage::information (view, i18n("Start Tutorial"), i18n("Cannot find the tutorial game (file-prefix %1) in " "the %2 files.") - .arg("'tute'").arg("'games.dat'")); + .tqarg("'tute'").tqarg("'games.dat'")); } } @@ -514,14 +514,14 @@ bool KGrGame::openLevelFile (int levelNo, TQFile & openlevel) KGrMessage::information (view, i18n("Load Level"), i18n("Cannot find file '%1'. Please make sure '%2' has been " "run in the '%3' folder.") - .arg(filePath).arg("tar xf levels.tar").arg(systemDataDir.myStr())); + .tqarg(filePath).tqarg("tar xf levels.tar").tqarg(systemDataDir.myStr())); return (FALSE); } - // öffne Level zum lesen + // �ffne Level zum lesen if (! openlevel.open (IO_ReadOnly)) { KGrMessage::information (view, i18n("Load Level"), - i18n("Cannot open file '%1' for read-only.").arg(filePath)); + i18n("Cannot open file '%1' for read-only.").tqarg(filePath)); return (FALSE); } @@ -741,8 +741,8 @@ void KGrGame::doDig (int button) { startPlaying(); // If first player-input, start playing. } switch (button) { - case LeftButton: hero->digLeft (); break; - case RightButton: hero->digRight (); break; + case Qt::LeftButton: hero->digLeft (); break; + case Qt::RightButton: hero->digRight (); break; default: break; } } @@ -769,7 +769,7 @@ void KGrGame::saveGame() // Save game ID, score and level. { if (editMode) {myMessage (view, i18n("Save Game"), i18n("Sorry, you cannot save your game play while you are editing. " - "Please try menu item %1.").arg("\"" + i18n("&Save Edits...") + "\"")); + "Please try menu item %1.").tqarg("\"" + i18n("&Save Edits...") + "\"")); return; } if (hero->started) {myMessage (view, i18n("Save Game"), @@ -778,7 +778,7 @@ void KGrGame::saveGame() // Save game ID, score and level. "level, not as they are now.")); } - TQDate today = TQDate::currentDate(); + TQDate today = TQDate::tqcurrentDate(); TQTime now = TQTime::currentTime(); TQString saved; TQString day; @@ -800,7 +800,7 @@ void KGrGame::saveGame() // Save game ID, score and level. if (! file2.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Save Game"), i18n("Cannot open file '%1' for output.") - .arg(userDataDir + "savegame.tmp")); + .tqarg(userDataDir + "savegame.tmp")); return; } TQTextStream text2 (&file2); @@ -810,7 +810,7 @@ void KGrGame::saveGame() // Save game ID, score and level. if (! file1.open (IO_ReadOnly)) { KGrMessage::information (view, i18n("Save Game"), i18n("Cannot open file '%1' for read-only.") - .arg(userDataDir + "savegame.dat")); + .tqarg(userDataDir + "savegame.dat")); return; } @@ -848,7 +848,7 @@ void KGrGame::loadGame() // Re-load game, score and level. if (! savedGames.open (IO_ReadOnly)) { KGrMessage::information (view, i18n("Load Game"), i18n("Cannot open file '%1' for read-only.") - .arg(userDataDir + "savegame.dat")); + .tqarg(userDataDir + "savegame.dat")); return; } @@ -876,7 +876,7 @@ void KGrGame::loadGame() // Re-load game, score and level. if (! s.isNull()) { pr = s.mid (21, 7); // Get the collection prefix. - pr = pr.left (pr.find (" ", 0, FALSE)); + pr = pr.left (pr.tqfind (" ", 0, FALSE)); for (i = 0; i < imax; i++) { // Find the collection. if (collections.at(i)->prefix == pr) { @@ -899,7 +899,7 @@ void KGrGame::loadGame() // Re-load game, score and level. } else { KGrMessage::information (view, i18n("Load Game"), - i18n("Cannot find the game with prefix '%1'.").arg(pr)); + i18n("Cannot find the game with prefix '%1'.").tqarg(pr)); } } @@ -919,9 +919,9 @@ void KGrGame::loadGame() // Re-load game, score and level. void KGrGame::checkHighScore() { bool prevHigh = TRUE; - Q_INT16 prevLevel = 0; - Q_INT32 prevScore = 0; - QString thisUser = i18n("Unknown"); + TQ_INT16 prevLevel = 0; + TQ_INT32 prevScore = 0; + TQString thisUser = i18n("Unknown"); int highCount = 0; // Don't keep high scores for tutorial games. @@ -947,7 +947,7 @@ void KGrGame::checkHighScore() if (! high1.open (IO_ReadOnly)) { TQString high1_name = high1.name(); KGrMessage::information (view, i18n("Check for High Score"), - i18n("Cannot open file '%1' for read-only.").arg(high1_name)); + i18n("Cannot open file '%1' for read-only.").tqarg(high1_name)); return; } @@ -987,7 +987,7 @@ void KGrGame::checkHighScore() if (! high2.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Check for High Score"), i18n("Cannot open file '%1' for output.") - .arg(userDataDir + "hi_" + collection->prefix + ".tmp")); + .tqarg(userDataDir + "hi_" + collection->prefix + ".tmp")); return; } @@ -1014,7 +1014,7 @@ void KGrGame::checkHighScore() hsn-> setCaption (i18n("Save High Score")); - QPoint p = view->mapToGlobal (TQPoint (0,0)); + TQPoint p = view->mapToGlobal (TQPoint (0,0)); hsn-> move (p.x() + 50, p.y() + 50); OK-> setAccel (Key_Return); @@ -1034,7 +1034,7 @@ void KGrGame::checkHighScore() delete hsn; - TQDate today = TQDate::currentDate(); + TQDate today = TQDate::tqcurrentDate(); TQString hsDate; #ifdef QT3 TQString day = today.shortDayName(today.dayOfWeek()); @@ -1061,11 +1061,11 @@ void KGrGame::checkHighScore() s1 >> prevDate; if ((! scoreRecorded) && (score > prevScore)) { highCount++; - // Recode the user's name as UTF-8, in case it contains - // non-ASCII chars (e.g. "Krüger" is encoded as "Krüger"). + // Recode the user's name as UTF-8, in case it tqcontains + // non-ASCII chars (e.g. "Kr�ger" is encoded as "Krüger"). s2 << (const char *) thisUser.utf8(); - s2 << (Q_INT16) level; - s2 << (Q_INT32) score; + s2 << (TQ_INT16) level; + s2 << (TQ_INT32) score; s2 << hsDate.myStr(); scoreRecorded = TRUE; } @@ -1080,21 +1080,21 @@ void KGrGame::checkHighScore() delete prevDate; } if ((! scoreRecorded) && (highCount < 10)) { - // Recode the user's name as UTF-8, in case it contains - // non-ASCII chars (e.g. "Krüger" is encoded as "Krüger"). + // Recode the user's name as UTF-8, in case it tqcontains + // non-ASCII chars (e.g. "Kr�ger" is encoded as "Krüger"). s2 << (const char *) thisUser.utf8(); - s2 << (Q_INT16) level; - s2 << (Q_INT32) score; + s2 << (TQ_INT16) level; + s2 << (TQ_INT32) score; s2 << hsDate.myStr(); } high1.close(); } else { - // Recode the user's name as UTF-8, in case it contains - // non-ASCII chars (e.g. "Krüger" is encoded as "Krüger"). + // Recode the user's name as UTF-8, in case it tqcontains + // non-ASCII chars (e.g. "Kr�ger" is encoded as "Krüger"). s2 << (const char *) thisUser.utf8(); - s2 << (Q_INT16) level; - s2 << (Q_INT32) score; + s2 << (TQ_INT16) level; + s2 << (TQ_INT32) score; s2 << hsDate.myStr(); } @@ -1119,8 +1119,8 @@ void KGrGame::showHighScores() return; } - Q_INT16 prevLevel = 0; - Q_INT32 prevScore = 0; + TQ_INT16 prevLevel = 0; + TQ_INT32 prevScore = 0; int n = 0; // Look for user's high-score file or for a released high-score file. @@ -1132,7 +1132,7 @@ void KGrGame::showHighScores() if (! high1.exists()) { KGrMessage::information (view, i18n("Show High Scores"), i18n("Sorry, there are no high scores for the %1 game yet.") - .arg("\"" + collection->name + "\"")); + .tqarg("\"" + collection->name + "\"")); return; } } @@ -1140,7 +1140,7 @@ void KGrGame::showHighScores() if (! high1.open (IO_ReadOnly)) { TQString high1_name = high1.name(); KGrMessage::information (view, i18n("Show High Scores"), - i18n("Cannot open file '%1' for read-only.").arg(high1_name)); + i18n("Cannot open file '%1' for read-only.").tqarg(high1_name)); return; } @@ -1154,15 +1154,15 @@ void KGrGame::showHighScores() TQLabel * hsHeader = new TQLabel (i18n ( "

KGoldrunner Hall of Fame


" "

\"%1\" Game

") - .arg(collection->name), + .tqarg(collection->name), hs); TQLabel * hsColHeader = new TQLabel ( i18n(" Name " "Level Score Date"), hs); #ifdef KGR_PORTABLE - QFont f ("courier", 12); + TQFont f ("courier", 12); #else - QFont f = KGlobalSettings::fixedFont(); // KDE version. + TQFont f = KGlobalSettings::fixedFont(); // KDE version. #endif f. setFixedPitch (TRUE); f. setBold (TRUE); @@ -1183,7 +1183,7 @@ void KGrGame::showHighScores() // Set up the format for the high-score lines. f. setBold (FALSE); - QString line; + TQString line; const char * hsFormat = "%2d. %-30.30s %3d %7ld %s"; // Read and display the users, levels and scores from the high score file. @@ -1199,7 +1199,7 @@ void KGrGame::showHighScores() // 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). + // 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); @@ -1219,7 +1219,7 @@ void KGrGame::showHighScores() OK-> setMaximumWidth (100); mainLayout-> addWidget (buttons); - QPoint p = view->mapToGlobal (TQPoint (0,0)); + TQPoint p = view->mapToGlobal (TQPoint (0,0)); hs-> move (p.x() + 50, p.y() + 50); // Start up the dialog box. @@ -1481,7 +1481,7 @@ void KGrGame::loadEditLevel (int lev) // Retain the original language of the name and hint when editing, // but remove the final \n and convert non-ASCII, UTF-8 substrings - // to Unicode (eg. ü to ü). + // to Unicode (eg. ü to �). int len = levelHintC.length(); if (len > 0) levelHint = TQString::fromUtf8((const char *) levelHintC.left(len-1)); @@ -1584,7 +1584,7 @@ bool KGrGame::saveLevelFile() // Open the output file. if (! levelFile.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Save Level"), - i18n("Cannot open file '%1' for output.").arg(filePath)); + i18n("Cannot open file '%1' for output.").tqarg(filePath)); return (FALSE); } @@ -1596,7 +1596,7 @@ bool KGrGame::saveLevelFile() } levelFile.putch ('\n'); - // Save the level name, changing non-ASCII chars to UTF-8 (eg. ü to ü). + // Save the level name, changing non-ASCII chars to UTF-8 (eg. � to ü). TQCString levelNameC = levelName.utf8(); int len1 = levelNameC.length(); if (len1 > 0) { @@ -1605,7 +1605,7 @@ bool KGrGame::saveLevelFile() levelFile.putch ('\n'); // Add a newline. } - // Save the level hint, changing non-ASCII chars to UTF-8 (eg. ü to ü). + // Save the level hint, changing non-ASCII chars to UTF-8 (eg. � to ü). TQCString levelHintC = levelHint.utf8(); int len2 = levelHintC.length(); char ch = '\0'; @@ -1642,8 +1642,8 @@ void KGrGame::moveLevelFile () KGrMessage::information (view, i18n("Move Level"), i18n("You must first load a level to be moved. Use " "the %1 or %2 menu.") - .arg("\"" + i18n("Game") + "\"") - .arg("\"" + i18n("Editor") + "\"")); + .tqarg("\"" + i18n("Game") + "\"") + .tqarg("\"" + i18n("Editor") + "\"")); return; } @@ -1780,7 +1780,7 @@ void KGrGame::deleteLevelFile () } else { KGrMessage::information (view, i18n("Delete Level"), - i18n("Cannot find file '%1' to be deleted.").arg(filePath)); + i18n("Cannot find file '%1' to be deleted.").tqarg(filePath)); return; } @@ -1883,7 +1883,7 @@ void KGrGame::editCollection (int action) if (duplicatePrefix) { KGrMessage::information (view, i18n("Save Game Info"), i18n("The filename prefix '%1' is already in use.") - .arg(ecPrefix)); + .tqarg(ecPrefix)); continue; } } @@ -1919,7 +1919,7 @@ bool KGrGame::saveOK (bool exiting) { int i, j; bool result; - QString option2 = i18n("&Go on editing"); + TQString option2 = i18n("&Go on editing"); result = TRUE; @@ -2061,7 +2061,7 @@ bool KGrGame::reNumberLevels (int cIndex, int first, int last, int inc) if (! dir.rename (file1, file2, TRUE)) { // Allow absolute paths. KGrMessage::information (view, i18n("Save Level"), i18n("Cannot rename file '%1' to '%2'.") - .arg(file1).arg(file2)); + .tqarg(file1).tqarg(file2)); return (FALSE); } i = i + step; @@ -2090,8 +2090,8 @@ void KGrGame::doEdit (int button) i = p.x(); j = p.y(); switch (button) { - case LeftButton: - case RightButton: + case Qt::LeftButton: + case Qt::RightButton: paintEditObj = TRUE; insertEditObj (i, j); view->updateCanvas(); @@ -2113,8 +2113,8 @@ void KGrGame::endEdit (int button) i = p.x(); j = p.y(); switch (button) { - case LeftButton: - case RightButton: + case Qt::LeftButton: + case Qt::RightButton: paintEditObj = FALSE; if ((i != oldI) || (j != oldJ)) { insertEditObj (i, j); @@ -2181,8 +2181,8 @@ int KGrGame::selectLevel (int action, int requestedLevel) KGrMessage::information (view, i18n("Select Level"), i18n("There is no level %1 in %2, " "so you cannot play or edit it.") - .arg(selectedLevel) - .arg("\"" + collections.at(selectedGame)->name + "\"")); + .tqarg(selectedLevel) + .tqarg("\"" + collections.at(selectedGame)->name + "\"")); selectedLevel = 0; // Set an invalid selection. continue; // Re-run the dialog box. } @@ -2226,10 +2226,10 @@ bool KGrGame::ownerOK (Owner o) /********************** CLASS TO DISPLAY THUMBNAIL ***********************/ /******************************************************************************/ -KGrThumbNail::KGrThumbNail (TQWidget * parent, const char * name) - : TQFrame (parent, name) +KGrThumbNail::KGrThumbNail (TQWidget * tqparent, const char * name) + : TQFrame (tqparent, name) { - // Let the parent do all the work. We need a class here so that + // Let the tqparent do all the work. We need a class here so that // TQFrame::drawContents (TQPainter *) can be re-implemented and // the thumbnail can be automatically re-painted when required. } @@ -2247,8 +2247,8 @@ void KGrThumbNail::setFilePath (TQString & fp, TQLabel * sln) void KGrThumbNail::drawContents (TQPainter * p) // Activated via "paintEvent". { - QFile openFile; - QPen pen = p->pen(); + TQFile openFile; + TQPen pen = p->pen(); char obj = FREE; int fw = 1; // Set frame width. int n = width() / FIELDWIDTH; // Set thumbnail cell-size. @@ -2330,7 +2330,7 @@ void KGrThumbNail::drawContents (TQPainter * p) // Activated via "paintEvent". /******************************************************************************/ // NOTE: Macros "myStr" and "myChar", defined in "kgrgame.h", are used -// to smooth out differences between Qt 1 and Qt2 TQString classes. +// to smooth out differences between TQt 1 and TQt2 TQString classes. bool KGrGame::initCollections () { @@ -2354,11 +2354,11 @@ bool KGrGame::initCollections () void KGrGame::mapCollections() { - QDir d; + TQDir d; KGrCollection * colln; - QString d_path; - QString fileName1; - QString fileName2; + TQString d_path; + TQString fileName1; + TQString fileName2; // Find KGoldrunner level files, sorted by name (same as numerical order). for (colln = collections.first(); colln != 0; colln = collections.next()) { @@ -2372,25 +2372,25 @@ void KGrGame::mapCollections() i18n("There is no folder '%1' to hold levels for" " the '%2' game. Please make sure '%3' " "has been run in the '%4' folder.") - .arg(d_path) - .arg(colln->name) - .arg("tar xf levels.tar") - .arg(systemDataDir)); + .tqarg(d_path) + .tqarg(colln->name) + .tqarg("tar xf levels.tar") + .tqarg(systemDataDir)); } continue; } - const QFileInfoList * files = d.entryInfoList + const TQFileInfoList * files = d.entryInfoList (colln->prefix + "???.grl", TQDir::Files, TQDir::Name); - QFileInfoListIterator i (* files); + TQFileInfoListIterator i (* files); TQFileInfo * file; if ((files->count() <= 0) && (colln->nLevels > 0)) { KGrMessage::information (view, i18n("Check Games & Levels"), i18n("There are no files '%1/%2???.grl' for the %3 game.") - .arg(d_path) - .arg(colln->prefix) - .arg("\"" + colln->name + "\"")); + .tqarg(d_path) + .tqarg(colln->prefix) + .tqarg("\"" + colln->name + "\"")); continue; } @@ -2413,8 +2413,8 @@ void KGrGame::mapCollections() i18n("Check Games & Levels"), i18n("File '%1' is beyond the highest level for " "the %2 game and cannot be played.") - .arg(fileName1) - .arg("\"" + colln->name + "\"")); + .tqarg(fileName1) + .tqarg("\"" + colln->name + "\"")); break; } else if (fileName1 == fileName2) { @@ -2426,16 +2426,16 @@ void KGrGame::mapCollections() i18n("Check Games & Levels"), i18n("File '%1' is before the lowest level for " "the %2 game and cannot be played.") - .arg(fileName1) - .arg("\"" + colln->name + "\"")); + .tqarg(fileName1) + .tqarg("\"" + colln->name + "\"")); break; } else { KGrMessage::information (view, i18n("Check Games & Levels"), i18n("Cannot find file '%1' for the %2 game.") - .arg(fileName2) - .arg("\"" + colln->name + "\"")); + .tqarg(fileName2) + .tqarg("\"" + colln->name + "\"")); lev++; } } @@ -2446,7 +2446,7 @@ void KGrGame::mapCollections() bool KGrGame::loadCollections (Owner o) { - QString filePath; + TQString filePath; filePath = ((o == SYSTEM)? systemDataDir : userDataDir) + "games.dat"; @@ -2457,20 +2457,20 @@ bool KGrGame::loadCollections (Owner o) if (o == SYSTEM) { KGrMessage::information (view, i18n("Load Game Info"), i18n("Cannot find game info file '%1'.") - .arg(filePath)); + .tqarg(filePath)); } return (FALSE); } if (! c.open (IO_ReadOnly)) { KGrMessage::information (view, i18n("Load Game Info"), - i18n("Cannot open file '%1' for read-only.").arg(filePath)); + i18n("Cannot open file '%1' for read-only.").tqarg(filePath)); return (FALSE); } - QCString line = ""; - QCString name = ""; - QString prefix = ""; + TQCString line = ""; + TQCString name = ""; + TQString prefix = ""; char settings = ' '; int nLevels = -1; @@ -2496,9 +2496,9 @@ bool KGrGame::loadCollections (Owner o) line = line.simplifyWhiteSpace(); int i, j, len; len = line.length(); - i = 0; j = line.find(' ',i); nLevels = line.left(j).toInt(); - i = j+1; j = line.find(' ',i); settings = line[i]; - i = j+1; j = line.find(' ',i); prefix = line.mid(i,j-i); + i = 0; j = line.tqfind(' ',i); nLevels = line.left(j).toInt(); + i = j+1; j = line.tqfind(' ',i); settings = line[i]; + i = j+1; j = line.tqfind(' ',i); prefix = line.mid(i,j-i); i = j+1; name = line.right(len-i); } // If first character is not a digit, the line should be an "about". @@ -2513,7 +2513,7 @@ bool KGrGame::loadCollections (Owner o) // Not EOF: it's an empty line or out-of-context "about" line. KGrMessage::information (view, i18n("Load Game Info"), i18n("Format error in game info file '%1'.") - .arg(filePath)); + .tqarg(filePath)); c.close(); return (FALSE); } @@ -2527,7 +2527,7 @@ bool KGrGame::loadCollections (Owner o) bool KGrGame::saveCollections (Owner o) { - QString filePath; + TQString filePath; if (o != USER) { KGrMessage::information (view, i18n("Save Game Info"), @@ -2542,13 +2542,13 @@ bool KGrGame::saveCollections (Owner o) // Open the output file. if (! c.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Save Game Info"), - i18n("Cannot open file '%1' for output.").arg(filePath)); + i18n("Cannot open file '%1' for output.").tqarg(filePath)); return (FALSE); } // Save the collections. KGrCollection * colln; - QCString line; + TQCString line; int i, len; char ch; @@ -2588,12 +2588,12 @@ bool KGrGame::saveCollections (Owner o) /********************** WORD-WRAPPED MESSAGE BOX ************************/ /******************************************************************************/ -void KGrGame::myMessage (TQWidget * parent, TQString title, TQString contents) +void KGrGame::myMessage (TQWidget * tqparent, TQString title, TQString contents) { // Halt the game while the message is displayed. setMessageFreeze (TRUE); - KGrMessage::wrapped (parent, title, contents); + KGrMessage::wrapped (tqparent, title, contents); // Unfreeze the game, but only if it was previously unfrozen. setMessageFreeze (FALSE); diff --git a/kgoldrunner/src/kgrgame.h b/kgoldrunner/src/kgrgame.h index 18003e3c..5637329c 100644 --- a/kgoldrunner/src/kgrgame.h +++ b/kgoldrunner/src/kgrgame.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2003 by Ian Wadham and Marco Krüger * + * Copyright (C) 2003 by Ian Wadham and Marco Kr�ger * * ianw2@optusnet.com.au * * * * This program is free software; you can redistribute it and/or modify * @@ -10,14 +10,14 @@ #ifndef KGRGAME_H #define KGRGAME_H -// Macros to smooth out the differences between Qt 1 and Qt 2 classes. +// Macros to smooth out the differences between TQt 1 and TQt 2 classes. // // "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 myChar(i) tqat((i)).latin1() #define endData atEnd #include @@ -47,9 +47,10 @@ class KGrHero; class KGrEnemy; class KGrCollection; -class KGrGame : public QObject +class KGrGame : public TQObject { Q_OBJECT + TQ_OBJECT public: KGrGame (KGrCanvas * theView, TQString theSystemDir, TQString theUserDir); ~KGrGame(); @@ -67,7 +68,7 @@ public: bool saveOK (bool exiting); // Check if edits were saved. - QString getTitle(); // Collection - Level NNN, Name. + TQString getTitle(); // Collection - Level NNN, Name. void setEditObj (char newEditObj); // Set object for editor to paint. @@ -136,16 +137,16 @@ private: private: KGrCanvas * view; // Where the game is displayed. - QString systemDataDir; // System games are stored here. - QString userDataDir; // User games are stored here. + TQString systemDataDir; // System games are stored here. + TQString userDataDir; // User games are stored here. KGrObject * playfield[30][22]; // Array of playfield objects. char editObjArray[30][22]; // Character-code equivalent. char lastSaveArray[30][22]; // Copy for use in "saveOK()". int level; // Current play/edit level. - QString levelName; // Level name (optional). - QString levelHint; // Level hint (optional). + TQString levelName; // Level name (optional). + TQString levelHint; // Level hint (optional). long lives; // Lives remaining. long score; // Current score. @@ -157,7 +158,7 @@ private: #ifdef QT3 TQPtrList enemies; // The list of enemies. #else - QList enemies; // The list of enemies. + TQList enemies; // The list of enemies. #endif int enemyCount; // How many enemies. KGrEnemy * enemy; // One of the enemies. @@ -229,7 +230,7 @@ private: bool reNumberLevels (int, int, int, int); bool ownerOK (Owner o); - // Pixmaps for repainting objects as they are edited. + // Pixmaps for tqrepainting objects as they are edited. TQPixmap digpix[10]; TQPixmap brickbg, fbrickbg; TQPixmap freebg, nuggetbg, polebg, betonbg, ladderbg, hladderbg; @@ -249,7 +250,7 @@ private: #ifdef QT3 TQPtrList collections; // List of ALL collections. #else - QList collections; // List of ALL collections. + TQList collections; // List of ALL collections. #endif KGrCollection * collection; // Collection currently in use. @@ -264,17 +265,17 @@ private: /********************** WORD-WRAPPED MESSAGE BOX ************************/ /******************************************************************************/ - void myMessage (TQWidget * parent, TQString title, TQString contents); + void myMessage (TQWidget * tqparent, TQString title, TQString contents); }; /******************************************************************************/ /********************** CLASS TO DISPLAY THUMBNAIL ***********************/ /******************************************************************************/ -class KGrThumbNail : public QFrame +class KGrThumbNail : public TQFrame { public: - KGrThumbNail (TQWidget *parent = 0, const char *name = 0); + KGrThumbNail (TQWidget *tqparent = 0, const char *name = 0); void setFilePath (TQString &, TQLabel *); // Set filepath and name field. static TQColor backgroundColor; @@ -299,11 +300,11 @@ public: 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. + TQString name; // Collection name. + TQString prefix; // Collection's filename prefix. char settings; // Collection rules: KGoldrunner or Traditional. int nLevels; // Number of levels in the collection. - QString about; // Optional text about the collection. + TQString about; // Optional text about the collection. }; #endif diff --git a/kgoldrunner/src/kgrobject.h b/kgoldrunner/src/kgrobject.h index cc262d0d..e7445873 100644 --- a/kgoldrunner/src/kgrobject.h +++ b/kgoldrunner/src/kgrobject.h @@ -26,9 +26,10 @@ class KGrCanvas; -class KGrObject : public QObject +class KGrObject : public TQObject { Q_OBJECT + TQ_OBJECT public: KGrObject (char objType); virtual ~KGrObject(); @@ -53,6 +54,7 @@ protected: class KGrEditable : public KGrObject { Q_OBJECT + TQ_OBJECT public: KGrEditable (char editType); virtual ~KGrEditable (); @@ -61,6 +63,7 @@ public: class KGrFree : public KGrObject { Q_OBJECT + TQ_OBJECT public: KGrFree (char objType, int i, int j, KGrCanvas * view); virtual ~KGrFree(); @@ -73,6 +76,7 @@ protected: class KGrBrick : public KGrObject { Q_OBJECT + TQ_OBJECT public: KGrBrick (char objType, int i, int j, KGrCanvas * view); virtual ~KGrBrick(); @@ -97,6 +101,7 @@ private: class KGrHladder : public KGrFree { Q_OBJECT + TQ_OBJECT public: // BUG FIX - Ian W., 21/6/01 - must inherit "setNugget()" from "KGrFree". KGrHladder (char objType, int i, int j, KGrCanvas * view); diff --git a/kjumpingcube/kcubeboxwidget.cpp b/kjumpingcube/kcubeboxwidget.cpp index bca13210..57aecd15 100644 --- a/kjumpingcube/kcubeboxwidget.cpp +++ b/kjumpingcube/kcubeboxwidget.cpp @@ -30,8 +30,8 @@ #include "prefs.h" -KCubeBoxWidget::KCubeBoxWidget(const int d,TQWidget *parent,const char *name) - : TQWidget(parent,name), +KCubeBoxWidget::KCubeBoxWidget(const int d,TQWidget *tqparent,const char *name) + : TQWidget(tqparent,name), CubeBoxBase(d) { init(); @@ -39,8 +39,8 @@ KCubeBoxWidget::KCubeBoxWidget(const int d,TQWidget *parent,const char *name) -KCubeBoxWidget::KCubeBoxWidget(CubeBox& box,TQWidget *parent,const char *name) - :TQWidget(parent,name), +KCubeBoxWidget::KCubeBoxWidget(CubeBox& box,TQWidget *tqparent,const char *name) + :TQWidget(tqparent,name), CubeBoxBase(box.dim()) { init(); @@ -57,8 +57,8 @@ KCubeBoxWidget::KCubeBoxWidget(CubeBox& box,TQWidget *parent,const char *name) -KCubeBoxWidget::KCubeBoxWidget(const KCubeBoxWidget& box,TQWidget *parent,const char *name) - :TQWidget(parent,name), +KCubeBoxWidget::KCubeBoxWidget(const KCubeBoxWidget& box,TQWidget *tqparent,const char *name) + :TQWidget(tqparent,name), CubeBoxBase(box.dim()) { init(); @@ -453,13 +453,13 @@ void KCubeBoxWidget::initCubes() int i,j; // create Layout - layout=new TQGridLayout(this,s,s); + tqlayout=new TQGridLayout(this,s,s); for(i=0;isetRowStretch(i,1); - layout->setColStretch(i,1); + tqlayout->setRowStretch(i,1); + tqlayout->setColStretch(i,1); } @@ -474,7 +474,7 @@ void KCubeBoxWidget::initCubes() { cubes[i][j]=new KCubeWidget(this); cubes[i][j]->setCoordinates(i,j); - layout->addWidget(cubes[i][j],i,j); + tqlayout->addWidget(cubes[i][j],i,j); cubes[i][j]->show(); 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))); @@ -504,15 +504,15 @@ void KCubeBoxWidget::initCubes() } -TQSize KCubeBoxWidget::sizeHint() const +TQSize KCubeBoxWidget::tqsizeHint() const { return TQSize(400,400); } void KCubeBoxWidget::deleteCubes() { - if(layout) - delete layout; + if(tqlayout) + delete tqlayout; CubeBoxBase::deleteCubes(); } diff --git a/kjumpingcube/kcubeboxwidget.h b/kjumpingcube/kcubeboxwidget.h index e2bf73ca..e8d0553e 100644 --- a/kjumpingcube/kcubeboxwidget.h +++ b/kjumpingcube/kcubeboxwidget.h @@ -51,11 +51,12 @@ struct Loop class KCubeBoxWidget : public TQWidget , public CubeBoxBase { Q_OBJECT + TQ_OBJECT public: - KCubeBoxWidget(const int dim=1,TQWidget *parent=0,const char *name=0); + KCubeBoxWidget(const int dim=1,TQWidget *tqparent=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); + KCubeBoxWidget(CubeBox& box, TQWidget *tqparent=0,const char *name=0); + KCubeBoxWidget(const KCubeBoxWidget& box,TQWidget *tqparent=0,const char *name=0); virtual ~KCubeBoxWidget(); KCubeBoxWidget& operator= (CubeBox& box); @@ -130,7 +131,7 @@ signals: void stoppedThinking(); protected: - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; virtual void deleteCubes(); virtual void initCubes(); @@ -146,7 +147,7 @@ protected slots: private: void init(); - TQGridLayout *layout; + TQGridLayout *tqlayout; CubeBox *undoBox; Brain brain; diff --git a/kjumpingcube/kcubewidget.cpp b/kjumpingcube/kcubewidget.cpp index 27797683..d4556eac 100644 --- a/kjumpingcube/kcubewidget.cpp +++ b/kjumpingcube/kcubewidget.cpp @@ -73,9 +73,9 @@ TQPalette KCubeWidget::color(Owner forWhom) ** public functions ** ** ****************************************************** */ -KCubeWidget::KCubeWidget(TQWidget* parent,const char* name +KCubeWidget::KCubeWidget(TQWidget* tqparent,const char* name ,Owner owner,int value,int max) - : TQFrame(parent,name), + : TQFrame(tqparent,name), Cube(owner,value,max) { setFrameStyle(Panel|Raised); @@ -85,7 +85,7 @@ KCubeWidget::KCubeWidget(TQWidget* parent,const char* name setCoordinates(0,0); //initialize hintTimer - // will be automatically destroyed by the parent + // will be automatically destroyed by the tqparent hintTimer = new TQTimer(this); hintCounter=0; connect(hintTimer,TQT_SIGNAL(timeout()),TQT_SLOT(hint())); @@ -93,7 +93,7 @@ KCubeWidget::KCubeWidget(TQWidget* parent,const char* name setPalette(kapp->palette()); // show values - repaint(false); + tqrepaint(false); } KCubeWidget::~KCubeWidget() @@ -240,7 +240,7 @@ void KCubeWidget::mouseReleaseEvent(TQMouseEvent *e) if(e->x()< 0 || e->x() > width() || e->y() < 0 || e->y() > height()) return; - if(e->button() == LeftButton && _clicksAllowed) + if(e->button() == Qt::LeftButton && _clicksAllowed) { stopHint(); emit clicked(row(),column(),true); diff --git a/kjumpingcube/kcubewidget.h b/kjumpingcube/kcubewidget.h index 804a9db4..3f578c13 100644 --- a/kjumpingcube/kcubewidget.h +++ b/kjumpingcube/kcubewidget.h @@ -35,10 +35,11 @@ class TQTimer; class KCubeWidget : public TQFrame , public Cube { Q_OBJECT + TQ_OBJECT public: /** constructs a new KCubeWidget*/ - KCubeWidget(TQWidget* parent=0,const char* name=0 + KCubeWidget(TQWidget* tqparent=0,const char* name=0 ,Owner owner=Cube::Nobody,int value=1,int max=0); virtual ~KCubeWidget(); diff --git a/kjumpingcube/kjumpingcube.cpp b/kjumpingcube/kjumpingcube.cpp index f63665af..a35dcf19 100644 --- a/kjumpingcube/kjumpingcube.cpp +++ b/kjumpingcube/kjumpingcube.cpp @@ -64,7 +64,7 @@ KJumpingCube::KJumpingCube() 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() ); + statusBar()->setFixedHeight( statusBar()->tqsizeHint().height() ); currentPlayer = new TQWidget(this, "currentPlayer"); currentPlayer->setFixedWidth(40); @@ -76,19 +76,19 @@ KJumpingCube::KJumpingCube() } void KJumpingCube::initKAction() { - 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()); + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection()); + KStdGameAction::load(TQT_TQOBJECT(this), TQT_SLOT(openGame()), actionCollection()); + KStdGameAction::save(TQT_TQOBJECT(this), TQT_SLOT(save()), actionCollection()); + KStdGameAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(saveAs()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); - hintAction = KStdGameAction::hint(view, TQT_SLOT(getHint()), actionCollection()); + hintAction = KStdGameAction::hint(TQT_TQOBJECT(view), TQT_SLOT(getHint()), actionCollection()); stopAction = new KAction(i18n("Stop &Thinking"), "stop", - Qt::Key_Escape, this, TQT_SLOT(stop()), actionCollection(), "game_stop"); + TQt::Key_Escape, TQT_TQOBJECT(this), TQT_SLOT(stop()), actionCollection(), "game_stop"); stopAction->setEnabled(false); - undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); + undoAction = KStdGameAction::undo(TQT_TQOBJECT(this), TQT_SLOT(undo()), actionCollection()); undoAction->setEnabled(false); - KStdAction::preferences(this, TQT_SLOT(showOptions()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(showOptions()), actionCollection()); setupGUI(); } @@ -123,8 +123,8 @@ void KJumpingCube::saveGame(bool saveAs) if(KIO::NetAccess::exists(url,false,this)) { TQString mes=i18n("The file %1 exists.\n" - "Do you want to overwrite it?").arg(url.url()); - result = KMessageBox::warningContinueCancel(this, mes, TQString::null, i18n("Overwrite")); + "Do you want to overwrite it?").tqarg(url.url()); + result = KMessageBox::warningContinueCancel(this, mes, TQString(), i18n("Overwrite")); if(result==KMessageBox::Cancel) return; } @@ -147,12 +147,12 @@ void KJumpingCube::saveGame(bool saveAs) if(KIO::NetAccess::upload( tempFile.name(),gameURL,this )) { TQString s=i18n("game saved as %1"); - s=s.arg(gameURL.url()); + s=s.tqarg(gameURL.url()); statusBar()->message(s,MESSAGE_TIME); } else { - KMessageBox::sorry(this,i18n("There was an error in saving file\n%1").arg(gameURL.url())); + KMessageBox::sorry(this,i18n("There was an error in saving file\n%1").tqarg(gameURL.url())); } } @@ -168,7 +168,7 @@ void KJumpingCube::openGame() return; if(!KIO::NetAccess::exists(url,true,this)) { - TQString mes=i18n("The file %1 does not exist!").arg(url.url()); + TQString mes=i18n("The file %1 does not exist!").tqarg(url.url()); KMessageBox::sorry(this,mes); fileOk=false; } @@ -183,7 +183,7 @@ void KJumpingCube::openGame() if(!config.hasKey("Version")) { TQString mes=i18n("The file %1 isn't a KJumpingCube gamefile!") - .arg(url.url()); + .tqarg(url.url()); KMessageBox::sorry(this,mes); return; } @@ -197,7 +197,7 @@ void KJumpingCube::openGame() KIO::NetAccess::removeTempFile( tempFile ); } else - KMessageBox::sorry(this,i18n("There was an error loading file\n%1").arg( url.url() )); + KMessageBox::sorry(this,i18n("There was an error loading file\n%1").tqarg( url.url() )); } void KJumpingCube::stop() @@ -223,11 +223,11 @@ void KJumpingCube::changePlayer(int newPlayer) { undoAction->setEnabled(true); currentPlayer->setBackgroundColor(newPlayer == 1 ? Prefs::color1() : Prefs::color2()); - currentPlayer->repaint(); + currentPlayer->tqrepaint(); } void KJumpingCube::showWinner(int player) { - TQString s=i18n("Winner is Player %1!").arg(player); + TQString s=i18n("Winner is Player %1!").tqarg(player); KMessageBox::information(this,s,i18n("Winner")); view->reset(); } diff --git a/kjumpingcube/kjumpingcube.h b/kjumpingcube/kjumpingcube.h index 3d2774f4..14216922 100644 --- a/kjumpingcube/kjumpingcube.h +++ b/kjumpingcube/kjumpingcube.h @@ -42,6 +42,7 @@ class KCubeBoxWidget; */ class KJumpingCube : public KMainWindow { Q_OBJECT + TQ_OBJECT public: /** Default Constructor */ diff --git a/kjumpingcube/settings.ui b/kjumpingcube/settings.ui index 43908b76..d632e88a 100644 --- a/kjumpingcube/settings.ui +++ b/kjumpingcube/settings.ui @@ -1,10 +1,10 @@ Settings - + Settings - + 0 0 @@ -22,7 +22,7 @@ 0 - + frame3 @@ -39,7 +39,7 @@ unnamed - + groupBox3 @@ -56,7 +56,7 @@ unnamed - + kcfg_CubeDim @@ -79,7 +79,7 @@ Right - + textLabel6 @@ -87,14 +87,14 @@ 5x5 - + textLabel8 10x10 - + AlignVCenter|AlignRight @@ -110,14 +110,14 @@ Expanding - + 20 16 - + groupBox7 @@ -136,7 +136,7 @@ - + textLabel1 @@ -144,7 +144,7 @@ Player 1: - + textLabel2 @@ -162,7 +162,7 @@ - + groupBox2 @@ -173,18 +173,18 @@ unnamed - + textLabel4 Average - + AlignCenter - + textLabel3 @@ -192,18 +192,18 @@ Beginner - + textLabel5 Expert - + AlignVCenter|AlignRight - + kcfg_Skill @@ -225,7 +225,7 @@ - + groupBox1 @@ -236,7 +236,7 @@ unnamed - + kcfg_ComputerPlayer1 @@ -244,7 +244,7 @@ Player 1 - + kcfg_ComputerPlayer2 @@ -261,7 +261,7 @@ - + kcolorbutton.h diff --git a/klickety/board.cpp b/klickety/board.cpp index b60e766a..4b531b5b 100644 --- a/klickety/board.cpp +++ b/klickety/board.cpp @@ -8,7 +8,7 @@ using namespace KGrid2D; void KLBoard::contentsMouseReleaseEvent(TQMouseEvent *e) { - if ( e->button()!=LeftButton || blocked ) return; + if ( e->button()!=Qt::LeftButton || blocked ) return; TQCanvasItemList list = canvas()->collisions(e->pos()); if ( list.count()==0 ) return; @@ -26,8 +26,8 @@ void KLBoard::contentsMouseReleaseEvent(TQMouseEvent *e) } } -KLBoard::KLBoard(TQWidget *parent) - : BaseBoard(true, parent), +KLBoard::KLBoard(TQWidget *tqparent) + : BaseBoard(true, tqparent), field(matrix().width(), matrix().height()), empty(matrix().width()), blocked(false) diff --git a/klickety/board.h b/klickety/board.h index 472556b7..f67e4926 100644 --- a/klickety/board.h +++ b/klickety/board.h @@ -7,8 +7,9 @@ class KLBoard : public BaseBoard { Q_OBJECT + TQ_OBJECT public: - KLBoard(TQWidget *parent); + KLBoard(TQWidget *tqparent); void start(const GTInitData &data); diff --git a/klickety/field.cpp b/klickety/field.cpp index 67533acc..1c497eb2 100644 --- a/klickety/field.cpp +++ b/klickety/field.cpp @@ -11,8 +11,8 @@ #include "base/board.h" -Field::Field(TQWidget *parent) - : TQWidget(parent, "field"), BaseField(this) +Field::Field(TQWidget *tqparent) + : TQWidget(tqparent, "field"), BaseField(this) { KGameLCDList *sc = new KGameLCDList(i18n("Remaining blocks"), this); showScore = new KGameLCD(3, sc); @@ -37,7 +37,7 @@ Field::Field(TQWidget *parent) connect(board, TQT_SIGNAL(gameOverSignal()), TQT_SLOT(gameOver())); settingsChanged(); - connect(parent, TQT_SIGNAL(settingsChanged()), TQT_SLOT(settingsChanged())); + connect(tqparent, TQT_SIGNAL(settingsChanged()), TQT_SLOT(settingsChanged())); TQTimer::singleShot(0, this, TQT_SLOT(start())); } @@ -52,7 +52,7 @@ void Field::pause() void Field::start() { - init(false, false, true, true, TQString::null); + init(false, false, true, true, TQString()); GTInitData data; data.seed = kapp->random(); BaseField::start(data); diff --git a/klickety/field.h b/klickety/field.h index 7f1acb4f..64951006 100644 --- a/klickety/field.h +++ b/klickety/field.h @@ -11,8 +11,9 @@ class KGameLCDClock; class Field : public TQWidget, public BaseField, public BaseInterface { Q_OBJECT + TQ_OBJECT public: - Field(TQWidget *parent); + Field(TQWidget *tqparent); private slots: void scoreUpdatedSlot() { scoreUpdated(); } diff --git a/klickety/main.h b/klickety/main.h index 54443103..6ff71a4c 100644 --- a/klickety/main.h +++ b/klickety/main.h @@ -13,15 +13,16 @@ class KLFactory : public BaseFactory KLFactory(); protected: - virtual BaseBoard *createBoard(bool, TQWidget *parent) - { return new KLBoard(parent); } - virtual BaseInterface *createInterface(TQWidget *parent) - { return new Field(parent); } + virtual BaseBoard *createBoard(bool, TQWidget *tqparent) + { return new KLBoard(tqparent); } + virtual BaseInterface *createInterface(TQWidget *tqparent) + { return new Field(tqparent); } }; class KLMainWindow : public BaseMainWindow { Q_OBJECT + TQ_OBJECT public: KLMainWindow(); }; diff --git a/klickety/piece.cpp b/klickety/piece.cpp index fcc2fdff..2d35300b 100644 --- a/klickety/piece.cpp +++ b/klickety/piece.cpp @@ -17,7 +17,7 @@ TQColor KLPieceInfo::defaultColor(uint i) const TQString KLPieceInfo::colorLabel(uint i) const { - return i18n("Color #%1:").arg(i+1); + return i18n("Color #%1:").tqarg(i+1); } void KLPieceInfo::draw(TQPixmap *pixmap, uint blockType, uint bMode, diff --git a/klines/ballpainter.cpp b/klines/ballpainter.cpp index 76156f11..131b81f8 100644 --- a/klines/ballpainter.cpp +++ b/klines/ballpainter.cpp @@ -67,7 +67,7 @@ void BallPainter::createPix() locate( "appdata", "fire.jpg" )); if (balls->isNull() ||backgroundPix->isNull() || fire->isNull() ) { KMessageBox::error(0, i18n("Unable to find graphics. Check your installation."), i18n("Error")); - qApp->exit(1); + tqApp->exit(1); return; // Error } @@ -82,12 +82,12 @@ void BallPainter::createPix() if (Prefs::numberedBalls() && (t == NORMALBALL)) { if ((c == 2) || (c == 3) || (c == 6)) - p.setPen(Qt::black); + p.setPen(TQt::black); else - p.setPen(Qt::white); + p.setPen(TQt::white); TQString tmp; tmp.setNum(c+1); - p.drawText(TQRect(0,0,CELLSIZE,CELLSIZE), Qt::AlignCenter, tmp); + p.drawText(TQRect(0,0,CELLSIZE,CELLSIZE), TQt::AlignCenter, tmp); } } diff --git a/klines/ballpainter.h b/klines/ballpainter.h index 522a3928..55754117 100644 --- a/klines/ballpainter.h +++ b/klines/ballpainter.h @@ -24,9 +24,10 @@ #define CELLSIZE 32 -class BallPainter : public QObject +class BallPainter : public TQObject { Q_OBJECT + TQ_OBJECT TQPixmap* imgCash[NCOLORS][PIXTIME + FIREBALLS + BOOMBALLS + 1]; TQPixmap* backgroundPix; TQPixmap* firePix[FIREPIX]; diff --git a/klines/field.cpp b/klines/field.cpp index d8da8ec7..22211b76 100644 --- a/klines/field.cpp +++ b/klines/field.cpp @@ -19,8 +19,8 @@ #include "cfg.h" #include "field.moc" -Field::Field(TQWidget* parent, const char* name) - : TQWidget( parent, name ) +Field::Field(TQWidget* tqparent, const char* name) + : TQWidget( tqparent, name ) { clearField(); } @@ -73,7 +73,7 @@ void Field::putBall(int x, int y, char color) if( checkBounds(x,y) ){ field[y][x].setColor(color); erase5Balls(); - repaint(FALSE); + tqrepaint(FALSE); } }*/ void Field::moveBall(int xa, int ya, int xb, int yb) @@ -184,10 +184,10 @@ int Field::calcPosScore(int x, int y, int whatIf) int score = -10; int color = field[y][x].getColor(); field[y][x].setColor(whatIf); - score = QMAX(score, calcRun(x, y-4, 0, 1)); - score = QMAX(score, calcRun(x-4, y-4, 1, 1)); - score = QMAX(score, calcRun(x-4, y, 1, 0)); - score = QMAX(score, calcRun(x-4, y+4, 1, -1)); + score = TQMAX(score, calcRun(x, y-4, 0, 1)); + score = TQMAX(score, calcRun(x-4, y-4, 1, 1)); + score = TQMAX(score, calcRun(x-4, y, 1, 0)); + score = TQMAX(score, calcRun(x-4, y+4, 1, -1)); field[y][x].setColor(color); return score; } diff --git a/klines/field.h b/klines/field.h index 6fb08932..c93bac4b 100644 --- a/klines/field.h +++ b/klines/field.h @@ -25,9 +25,10 @@ #define NUMCELLSW 9 #define NUMCELLSH 9 -class Field: public QWidget +class Field: public TQWidget { Q_OBJECT + TQ_OBJECT public: void clearField(); @@ -35,7 +36,7 @@ public: void saveUndo(); protected: - Field(TQWidget* parent, const char* name); + Field(TQWidget* tqparent, const char* name); ~Field(); void putBall(int x, int y, int color); diff --git a/klines/klines.cpp b/klines/klines.cpp index 50d96163..848f6ffa 100644 --- a/klines/klines.cpp +++ b/klines/klines.cpp @@ -64,10 +64,10 @@ KLines::KLines() setCentralWidget( mwidget ); lsb = mwidget->GetLsb(); - 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())); + connect(lsb, TQT_SIGNAL(endTurn()), TQT_TQOBJECT(this), TQT_SLOT(makeTurn())); + connect(lsb, TQT_SIGNAL(eraseLine(int)), TQT_TQOBJECT(this), TQT_SLOT(addScore(int))); + connect(lsb, TQT_SIGNAL(endGame()), TQT_TQOBJECT(this), TQT_SLOT(endGame())); + connect(lsb, TQT_SIGNAL(userTurn()), TQT_TQOBJECT(this), TQT_SLOT(userTurn())); lPrompt = mwidget->GetPrompt(); @@ -82,9 +82,9 @@ KLines::KLines() initKAction(); - connect(&demoTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotDemo())); + connect(&demoTimer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(slotDemo())); - setFocusPolicy(StrongFocus); + setFocusPolicy(TQ_StrongFocus); setFocus(); startGame(); @@ -104,18 +104,18 @@ KLines::~KLines() */ void KLines::initKAction() { - KStdGameAction::gameNew(this, TQT_SLOT(startGame()), actionCollection()); - act_demo = KStdGameAction::demo(this, TQT_SLOT(startDemo()), actionCollection()); + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(startGame()), actionCollection()); + act_demo = KStdGameAction::demo(TQT_TQOBJECT(this), TQT_SLOT(startDemo()), actionCollection()); act_demo->setText(i18n("Start &Tutorial")); - KStdGameAction::highscores(this, TQT_SLOT(viewHighScore()), actionCollection()); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); - endTurnAction = KStdGameAction::endTurn(this, TQT_SLOT(makeTurn()), actionCollection()); + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(viewHighScore()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + endTurnAction = KStdGameAction::endTurn(TQT_TQOBJECT(this), TQT_SLOT(makeTurn()), actionCollection()); showNextAction = new KToggleAction(i18n("&Show Next"), KShortcut(CTRL+Key_P), - this, TQT_SLOT(switchPrompt()), actionCollection(), "options_show_next"); + TQT_TQOBJECT(this), TQT_SLOT(switchPrompt()), actionCollection(), "options_show_next"); showNextAction->setCheckedState(i18n("Hide Next")); showNumberedAction = new KToggleAction(i18n("&Use Numbered Balls"), KShortcut(), - this, TQT_SLOT(switchNumbered()), actionCollection(), "options_show_numbered"); - undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); + TQT_TQOBJECT(this), TQT_SLOT(switchNumbered()), actionCollection(), "options_show_numbered"); + undoAction = KStdGameAction::undo(TQT_TQOBJECT(this), TQT_SLOT(undo()), actionCollection()); levelAction = KStdGameAction::chooseGameType(0, 0, actionCollection()); TQStringList 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, 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"); + (void)new KAction(i18n("Move Left"), Key_Left, TQT_TQOBJECT(lsb), TQT_SLOT(moveLeft()), actionCollection(), "left"); + (void)new KAction(i18n("Move Right"), Key_Right, TQT_TQOBJECT(lsb), TQT_SLOT(moveRight()), actionCollection(), "right"); + (void)new KAction(i18n("Move Up"), Key_Up, TQT_TQOBJECT(lsb), TQT_SLOT(moveUp()), actionCollection(), "up"); + (void)new KAction(i18n("Move Down"), Key_Down, TQT_TQOBJECT(lsb), TQT_SLOT(moveDown()), actionCollection(), "down"); + (void)new KAction(i18n("Move Ball"), Key_Space, TQT_TQOBJECT(lsb), TQT_SLOT(placePlayerBall()), actionCollection(), "place_ball"); setupGUI( KMainWindow::Save | Keys | StatusBar | Create ); } @@ -164,7 +164,7 @@ void KLines::startGame() void KLines::setLevel(int level) { levelStr = i18n(LEVEL[level+2]); - statusBar()->changeItem(i18n(" Level: %1").arg(levelStr), 0); + statusBar()->changeItem(i18n(" Level: %1").tqarg(levelStr), 0); } void KLines::startDemo() @@ -183,7 +183,7 @@ void KLines::startDemo() bFirst = true; levelStr = i18n("Tutorial"); - statusBar()->changeItem(i18n(" Level: %1").arg(levelStr), 0); + statusBar()->changeItem(i18n(" Level: %1").tqarg(levelStr), 0); lsb->startDemoMode(); lsb->setGameOver(false); @@ -202,7 +202,7 @@ void KLines::stopDemo() bDemo = false; lsb->hideDemoText(); demoTimer.stop(); - statusBar()->changeItem(i18n(" Level: %1").arg(i18n("Tutorial - Stopped")), 0); + statusBar()->changeItem(i18n(" Level: %1").tqarg(i18n("Tutorial - Stopped")), 0); act_demo->setText(i18n("Start &Tutorial")); } @@ -380,7 +380,7 @@ void KLines::slotDemo() if (!msg.isEmpty()) { lsb->showDemoText(msg); - demoTimer.start(3500 + msg.contains("\n")*1500, true); + demoTimer.start(3500 + msg.tqcontains("\n")*1500, true); return; } if (newBalls) @@ -419,7 +419,7 @@ void KLines::focusOutEvent(TQFocusEvent *ev) { lsb->hideDemoText(); demoTimer.stop(); - statusBar()->changeItem(i18n(" Level: %1").arg(i18n("Tutorial - Paused")), 0); + statusBar()->changeItem(i18n(" Level: %1").tqarg(i18n("Tutorial - Paused")), 0); } KMainWindow::focusOutEvent(ev); } @@ -428,7 +428,7 @@ void KLines::focusInEvent(TQFocusEvent *ev) { if (bDemo) { - statusBar()->changeItem(i18n(" Level: %1").arg(levelStr), 0); + statusBar()->changeItem(i18n(" Level: %1").tqarg(levelStr), 0); slotDemo(); } KMainWindow::focusInEvent(ev); @@ -528,7 +528,7 @@ void KLines::addScore(int ballsErased) void KLines::updateStat() { - statusBar()->changeItem(i18n(" Score: %1").arg(score), 1); + statusBar()->changeItem(i18n(" Score: %1").tqarg(score), 1); } void KLines::viewHighScore() @@ -540,7 +540,7 @@ void KLines::viewHighScore() void KLines::endGame() { lsb->setGameOver(true); - lsb->repaint(false); + lsb->tqrepaint(false); if (bDemo) return; @@ -575,7 +575,7 @@ void KLines::switchUndo(bool bu) void KLines::keyPressEvent(TQKeyEvent *e) { - if (lsb->gameOver() && (e->key() == Qt::Key_Space)) + if (lsb->gameOver() && (e->key() == TQt::Key_Space)) { e->accept(); startGame(); diff --git a/klines/klines.h b/klines/klines.h index 39352b33..ba78c7fe 100644 --- a/klines/klines.h +++ b/klines/klines.h @@ -29,6 +29,7 @@ class KToggleAction; class KLines : public KMainWindow { Q_OBJECT + TQ_OBJECT public: KLines(); ~KLines(); diff --git a/klines/linesboard.cpp b/klines/linesboard.cpp index aefa1a65..fe7faee1 100644 --- a/klines/linesboard.cpp +++ b/klines/linesboard.cpp @@ -34,8 +34,8 @@ Constructs a LinesBoard widget. */ -LinesBoard::LinesBoard( BallPainter * abPainter, TQWidget* parent, const char* name ) - : Field( parent, name ) +LinesBoard::LinesBoard( BallPainter * abPainter, TQWidget* tqparent, const char* name ) + : Field( tqparent, name ) { demoLabel = 0; bGameOver = false; @@ -51,7 +51,7 @@ LinesBoard::LinesBoard( BallPainter * abPainter, TQWidget* parent, const char* n bPainter = abPainter; - setFocusPolicy( NoFocus ); + setFocusPolicy( TQ_NoFocus ); setBackgroundColor( gray ); setMouseTracking( FALSE ); @@ -163,7 +163,7 @@ void LinesBoard::placeBall( ) /*id LinesBoard::doAfterBalls() { erase5Balls(); - repaint(FALSE); + tqrepaint(FALSE); } */ /* @@ -215,7 +215,7 @@ void LinesBoard::paintEvent( TQPaintEvent* ) { paint->end(); - KPixmapEffect::fade(*pixmap, 0.5, Qt::black); + KPixmapEffect::fade(*pixmap, 0.5, TQt::black); TQPainter p(this); p.drawPixmap(0,0, *pixmap); @@ -225,9 +225,9 @@ void LinesBoard::paintEvent( TQPaintEvent* ) gameover_font.setPointSize(48); gameover_font.setBold(true); p.setFont(gameover_font); - p.setPen(Qt::white); + p.setPen(TQt::white); TQString gameover_text = i18n("Game Over"); - p.drawText(0, 0, width(), height(), AlignCenter|Qt::WordBreak, gameover_text); + p.drawText(0, 0, width(), height(), AlignCenter|TQt::WordBreak, gameover_text); } else { @@ -239,7 +239,7 @@ void LinesBoard::paintEvent( TQPaintEvent* ) r.setY(focusY*CELLSIZE+2); r.setWidth(CELLSIZE-4); r.setHeight(CELLSIZE-4); - paint->setPen(TQPen(Qt::DotLine)); + paint->setPen(TQPen(TQt::DotLine)); paint->drawRect(r); } } @@ -306,7 +306,7 @@ void LinesBoard::moveFocus(int dx, int dy) focusX = (focusX + dx + NUMCELLSW) % NUMCELLSW; focusY = (focusY + dy + NUMCELLSH) % NUMCELLSH; } - repaint(FALSE); + tqrepaint(FALSE); } void LinesBoard::moveLeft() @@ -401,7 +401,7 @@ int LinesBoard::AnimEnd( ) else if ( oldanim == ANIM_BURN ) { emit eraseLine( deleteAnimatedBalls() ); - repaint(FALSE); + tqrepaint(FALSE); if ( nextBallToPlace < BALLSDROP ) { placeBall(); @@ -455,7 +455,7 @@ void LinesBoard::AnimNext() { if ( (direction > 0 && animstep == animmax) || ( direction < 0 && animstep == 0)) direction = -direction; animstep += direction; - repaint(FALSE); + tqrepaint(FALSE); } else { if ( animstep >= animmax ) AnimEnd(); @@ -466,7 +466,7 @@ void LinesBoard::AnimNext() { moveBall(way[animstep].x,way[animstep].y,way[animstep+1].x,way[animstep+1].y); animstep++; animdelaycount = animdelaystart; - repaint( FALSE ); + tqrepaint( FALSE ); } } } @@ -698,7 +698,7 @@ void LinesBoard::undo() AnimEnd(); restoreUndo(); restoreRandomState(); - repaint( FALSE ); + tqrepaint( FALSE ); } void LinesBoard::showDemoText(const TQString &text) @@ -711,13 +711,13 @@ void LinesBoard::showDemoText(const TQString &text) demoLabel->setAutoMask( FALSE ); demoLabel->setFrameStyle( TQFrame::Plain | TQFrame::Box ); demoLabel->setLineWidth( 1 ); - demoLabel->setAlignment( AlignHCenter | AlignTop ); + demoLabel->tqsetAlignment( AlignHCenter | AlignTop ); demoLabel->setPalette(TQToolTip::palette()); demoLabel->polish(); } demoLabel->setText(text); demoLabel->adjustSize(); - TQSize s = demoLabel->sizeHint(); + TQSize s = demoLabel->tqsizeHint(); TQPoint p = TQPoint(x() + (width()-s.width())/2, y() + (height()-s.height())/2); demoLabel->move(mapToGlobal(p)); demoLabel->show(); @@ -744,7 +744,7 @@ void LinesBoard::demoClick(int x, int y) kapp->enter_loop(); } TQCursor::setPos(dest); - TQMouseEvent ev(TQEvent::MouseButtonPress, lDest, dest, LeftButton, LeftButton); + TQMouseEvent ev(TQEvent::MouseButtonPress, lDest, dest, Qt::LeftButton, Qt::LeftButton); mousePressEvent(&ev); } diff --git a/klines/linesboard.h b/klines/linesboard.h index f5e3ac37..4a6b3979 100644 --- a/klines/linesboard.h +++ b/klines/linesboard.h @@ -32,8 +32,9 @@ class LinesBoard : public Field { Q_OBJECT + TQ_OBJECT public: - LinesBoard( BallPainter * abPainter, TQWidget* parent=0, const char* name=0 ); + LinesBoard( BallPainter * abPainter, TQWidget* tqparent=0, const char* name=0 ); ~LinesBoard(); int width(); diff --git a/klines/mwidget.cpp b/klines/mwidget.cpp index c883b9ba..9f66345d 100644 --- a/klines/mwidget.cpp +++ b/klines/mwidget.cpp @@ -24,8 +24,8 @@ #include "ballpainter.h" -MainWidget::MainWidget( TQWidget* parent, const char* name ) - : TQFrame( parent, name ) +MainWidget::MainWidget( TQWidget* tqparent, const char* name ) + : TQFrame( tqparent, name ) { TQBoxLayout *grid = new TQHBoxLayout( this, 5 ); //(rows,col) bPainter = new BallPainter(); @@ -36,17 +36,17 @@ MainWidget::MainWidget( TQWidget* parent, const char* name ) TQBoxLayout *right = new TQVBoxLayout(grid, 2); TQLabel *label = new TQLabel(i18n("Next balls:"), this); lPrompt = new LinesPrompt(bPainter, this); - connect(lPrompt, TQT_SIGNAL(PromptPressed()), parent, TQT_SLOT(switchPrompt())); + connect(lPrompt, TQT_SIGNAL(PromptPressed()), tqparent, TQT_SLOT(switchPrompt())); - right->addWidget( label, 0, Qt::AlignBottom | Qt::AlignHCenter ); - right->addWidget( lPrompt, 0, Qt::AlignTop | Qt::AlignHCenter ); + right->addWidget( label, 0, TQt::AlignBottom | TQt::AlignHCenter ); + right->addWidget( lPrompt, 0, TQt::AlignTop | TQt::AlignHCenter ); grid->activate(); grid->freeze(0,0); // warning("width: %i height: %i", width(), height() ); -// warning("wh: %i hh: %i", sizeHint().width(), sizeHint().height() ); +// warning("wh: %i hh: %i", tqsizeHint().width(), tqsizeHint().height() ); } diff --git a/klines/mwidget.h b/klines/mwidget.h index 18f48720..11133a2f 100644 --- a/klines/mwidget.h +++ b/klines/mwidget.h @@ -27,15 +27,16 @@ class BallPainter; -class MainWidget : public QFrame +class MainWidget : public TQFrame { Q_OBJECT + TQ_OBJECT LinesBoard * lsb; LinesPrompt * lPrompt; BallPainter *bPainter; public: - MainWidget( TQWidget* parent=0, const char* name=0 ); + MainWidget( TQWidget* tqparent=0, const char* name=0 ); ~MainWidget(); LinesBoard * GetLsb(); LinesPrompt * GetPrompt(); diff --git a/klines/povray/balls.sh b/klines/povray/balls.sh index 1897afaa..66b6ddc2 100755 --- a/klines/povray/balls.sh +++ b/klines/povray/balls.sh @@ -7,7 +7,7 @@ povray -w30 -h30 -V1 -P +A +KI5 +KF6 +KFF6 +SF2 +EF5 -Iball.pov +Ob$1.tga #### burning balls balls povray -w30 -h30 -V1 -P +A +KI0 +KF1 +KFF11 +SF1 +EF5 -Iball.pov +Oe$1.tga -montage -geometry 30x30 -tile 100x1 -page 570x30 a$1??.tga b$1?.tga e$1??.tga bl_$1.tga +montage -tqgeometry 30x30 -tile 100x1 -page 570x30 a$1??.tga b$1?.tga e$1??.tga bl_$1.tga mogrify -crop 570x30+0+0 bl_$1.tga diff --git a/klines/povray/fire.sh b/klines/povray/fire.sh index 2b6b5f9a..c3eaa319 100755 --- a/klines/povray/fire.sh +++ b/klines/povray/fire.sh @@ -3,7 +3,7 @@ echo "#declare BallColor = White" >clr.inc if (povray -w30 -h30 -V1 -P +A +KI0 +KF1 +KFF11 +SF6 +EF10 -Iball.pov \ +Ofire.tga) then # mogrify -raise 1x1 e$1??.tga - montage -geometry 30x30 -tile 100x1 -page 150x30 fire*.tga fire.tga + montage -tqgeometry 30x30 -tile 100x1 -page 150x30 fire*.tga fire.tga mogrify -crop 150x30+0+0 fire.tga # animate -delay 7 $1??.tga fi diff --git a/klines/povray/makeballs.sh b/klines/povray/makeballs.sh index 62769605..0d937415 100755 --- a/klines/povray/makeballs.sh +++ b/klines/povray/makeballs.sh @@ -17,7 +17,7 @@ balls.sh Brown "rgb<1/2,1/3,0>" #### montage balls ( 20x7 cells each 30x30) -montage -geometry 570x30 -tile 1x10 bl_*.tga balls.tga +montage -tqgeometry 570x30 -tile 1x10 bl_*.tga balls.tga mogrify -crop 570x210+0+0 balls.tga #### convert to jpeg diff --git a/klines/povray/povray.ini b/klines/povray/povray.ini index 22ddf8ec..6c01d50a 100644 --- a/klines/povray/povray.ini +++ b/klines/povray/povray.ini @@ -10,7 +10,7 @@ ; ; The general form of the options is "Variable=value". Everything ; between the equals sign and the end of the line is considered part -; of the value. The spacing and layout is free-form but only one option +; of the value. The spacing and tqlayout is free-form but only one option ; per line is allowed. Variables and values are not case-sensitive. ; ; Note: characters after a semi-colon are treated as a comment diff --git a/klines/prompt.cpp b/klines/prompt.cpp index 7a9ec36a..1233abf5 100644 --- a/klines/prompt.cpp +++ b/klines/prompt.cpp @@ -19,13 +19,13 @@ #include "prompt.h" #include "prompt.moc" -LinesPrompt::LinesPrompt( BallPainter * abPainter, TQWidget* parent, const char* name ) - : TQWidget( parent, name ) +LinesPrompt::LinesPrompt( BallPainter * abPainter, TQWidget* tqparent, const char* name ) + : TQWidget( tqparent, name ) { bPainter = abPainter; - setFocusPolicy( NoFocus ); + setFocusPolicy( TQ_NoFocus ); setBackgroundColor( gray ); setMouseTracking( FALSE ); diff --git a/klines/prompt.h b/klines/prompt.h index 3ddf6335..e1decfd5 100644 --- a/klines/prompt.h +++ b/klines/prompt.h @@ -21,9 +21,10 @@ #include #include "ballpainter.h" -class LinesPrompt : public QWidget +class LinesPrompt : public TQWidget { Q_OBJECT + TQ_OBJECT BallPainter* bPainter; bool PromptEnabled; @@ -33,7 +34,7 @@ class LinesPrompt : public QWidget void mousePressEvent( TQMouseEvent* ); public: - LinesPrompt( BallPainter * abPainter, TQWidget * parent=0, const char * name=0 ); + LinesPrompt( BallPainter * abPainter, TQWidget * tqparent=0, const char * name=0 ); ~LinesPrompt(); void setPrompt(bool enabled); diff --git a/kmahjongg/Background.cpp b/kmahjongg/Background.cpp index 432ae5fb..2cf7296f 100644 --- a/kmahjongg/Background.cpp +++ b/kmahjongg/Background.cpp @@ -78,8 +78,8 @@ void Background::sourceToBackground() { if (tile) { // copy new to background wrapping on w and height for (int y=0; yheight(); y++) { - QRgb *dest = (QRgb *) backgroundImage->scanLine(y); - QRgb *src = (QRgb *) sourceImage->scanLine(y % sourceImage->height()); + TQRgb *dest = (TQRgb *) backgroundImage->scanLine(y); + TQRgb *src = (TQRgb *) sourceImage->scanLine(y % sourceImage->height()); for (int x=0; x< backgroundImage->width(); x++) { *dest = *(src + (x % sourceImage->width())); dest++; @@ -99,8 +99,8 @@ void Background::sourceToBackground() { 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); + TQRgb *src = (TQRgb *) backgroundImage->scanLine(ys); + TQRgb *dst = (TQRgb *) tmp.scanLine(ys); for (int xs=0; xs < tmp.width(); xs++) { *dst=TQColor(*src).dark(133).rgb(); src++; diff --git a/kmahjongg/BoardLayout.cpp b/kmahjongg/BoardLayout.cpp index 8da404ae..c9fd188e 100644 --- a/kmahjongg/BoardLayout.cpp +++ b/kmahjongg/BoardLayout.cpp @@ -29,7 +29,7 @@ bool BoardLayout::saveBoardLayout(const TQString where) { return false; } - TQCString tmp = layoutMagic1_0.utf8(); + TQCString tmp = tqlayoutMagic1_0.utf8(); if (f.writeBlock(tmp, tmp.length()) == -1) { return(false); } @@ -71,7 +71,7 @@ bool BoardLayout::loadBoardLayout(const TQString from) t.setCodec(TQTextCodec::codecForName("UTF-8")); TQString s; s = t.readLine(); - if (s != layoutMagic1_0) { + if (s != tqlayoutMagic1_0) { f.close(); return(false); } diff --git a/kmahjongg/BoardLayout.h b/kmahjongg/BoardLayout.h index 468bf5bc..7bf58003 100644 --- a/kmahjongg/BoardLayout.h +++ b/kmahjongg/BoardLayout.h @@ -4,7 +4,7 @@ #include #include "KmTypes.h" -const TQString layoutMagic1_0 = "kmahjongg-layout-v1.0"; +const TQString tqlayoutMagic1_0 = "kmahjongg-tqlayout-v1.0"; class BoardLayout { diff --git a/kmahjongg/Editor.cpp b/kmahjongg/Editor.cpp index d11ff7b2..833718c3 100644 --- a/kmahjongg/Editor.cpp +++ b/kmahjongg/Editor.cpp @@ -35,17 +35,17 @@ // When we assign a tile to draw in a slot we do it in order from te following -// table, wrapping on the tile number. It makes the tile layout look more +// table, wrapping on the tile number. It makes the tile tqlayout look more // random. Editor::Editor ( - TQWidget* parent, + TQWidget* tqparent, const char* name ) : - TQDialog( parent, name, true, 0 ), tiles(false) + TQDialog( tqparent, name, true, 0 ), tiles(false) { clean= true; @@ -61,7 +61,7 @@ Editor::Editor drawFrame->setGeometry( 10, 40 ,sWidth ,sHeight); drawFrame->setMinimumSize( 0, 0 ); drawFrame->setMaximumSize( 32767, 32767 ); - drawFrame->setFocusPolicy( TQWidget::NoFocus ); + drawFrame->setFocusPolicy( TQ_NoFocus ); drawFrame->setBackgroundMode( TQWidget::PaletteBackground ); drawFrame->setFrameStyle( 49 ); drawFrame->setMouseTracking(true); @@ -69,10 +69,10 @@ Editor::Editor // setup the tool bar setupToolbar(); - TQVBoxLayout *layout = new TQVBoxLayout(this, 1); - layout->addWidget(topToolbar,0); - layout->addWidget(drawFrame,1); - layout->activate(); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, 1); + tqlayout->addWidget(topToolbar,0); + tqlayout->addWidget(drawFrame,1); + tqlayout->activate(); resize( sWidth+60, sHeight+60); setMinimumSize( sWidth+60, sHeight+60); @@ -170,7 +170,7 @@ void Editor::setupToolbar() // status in the toolbar for now (ick) theLabel = new TQLabel(statusText(), topToolbar); - int lWidth = theLabel->sizeHint().width(); + int lWidth = theLabel->tqsizeHint().width(); topToolbar->insertWidget(ID_TOOL_STATUS,lWidth, theLabel ); topToolbar->alignItemRight( ID_TOOL_STATUS, true ); @@ -209,19 +209,19 @@ void Editor::topToolbarOption(int option) { break; case ID_TOOL_LEFT: theBoard.shiftLeft(); - repaint(false); + tqrepaint(false); break; case ID_TOOL_RIGHT: theBoard.shiftRight(); - repaint(false); + tqrepaint(false); break; case ID_TOOL_UP: theBoard.shiftUp(); - repaint(false); + tqrepaint(false); break; case ID_TOOL_DOWN: theBoard.shiftDown(); - repaint(false); + tqrepaint(false); break; case ID_TOOL_DEL: mode=remove; @@ -260,7 +260,7 @@ TQString Editor::statusText() { if (x >=BoardLayout::width || x <0 || y >=BoardLayout::height || y <0) x = y = z = 0; - buf = i18n("Tiles: %1 Pos: %2,%3,%4").arg(numTiles).arg(x).arg(y).arg(z); + buf = i18n("Tiles: %1 Pos: %2,%3,%4").tqarg(numTiles).tqarg(x).tqarg(y).tqarg(z); return buf; } @@ -272,7 +272,7 @@ void Editor::loadBoard() { KURL url = KFileDialog::getOpenURL( NULL, - i18n("*.layout|Board Layout (*.layout)\n" + i18n("*.tqlayout|Board Layout (*.tqlayout)\n" "*|All Files"), this, i18n("Open Board Layout" )); @@ -283,7 +283,7 @@ void Editor::loadBoard() { theBoard.loadBoardLayout( url.path() ); - repaint(false); + tqrepaint(false); } @@ -302,14 +302,14 @@ void Editor::newBoard() { clean=true; numTiles=0; statusChanged(); - repaint(false); + tqrepaint(false); } bool Editor::saveBoard() { // get a save file name KURL url = KFileDialog::getSaveURL( NULL, - i18n("*.layout|Board Layout (*.layout)\n" + i18n("*.tqlayout|Board Layout (*.tqlayout)\n" "*|All Files"), this, i18n("Save Board Layout" )); @@ -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?"),TQString::null,KStdGuiItem::save(),KStdGuiItem::dontSave()); + "like to save the changes?"),TQString(),KStdGuiItem::save(),KStdGuiItem::dontSave()); if (res == KMessageBox::Yes) { // yes to save @@ -373,7 +373,7 @@ bool Editor::testSave() // The main paint event, draw in the grid and blit in -// the tiles as specified by the layout. +// the tiles as specified by the tqlayout. void Editor::paintEvent( TQPaintEvent* ) { @@ -386,7 +386,7 @@ void Editor::paintEvent( TQPaintEvent* ) { drawTiles(&buff); bitBlt(dest, 0,0,&buff, 0,0,buff.width(), buff.height(), CopyROP); - drawFrame->repaint(false); + drawFrame->tqrepaint(false); } void Editor::drawBackground(TQPixmap *pixmap) { @@ -564,7 +564,7 @@ void Editor::drawFrameMousePressEvent( TQMouseEvent* e ) numTiles--; statusChanged(); drawFrameMouseMovedEvent(e); - repaint(false); + tqrepaint(false); } break; case insert: { @@ -577,7 +577,7 @@ void Editor::drawFrameMousePressEvent( TQMouseEvent* e ) theBoard.insertTile(n); numTiles++; statusChanged(); - repaint(false); + tqrepaint(false); } } break; @@ -599,7 +599,7 @@ void Editor::drawCursor(POSITION &p, bool visible) if (p.e==100 || !visible) x = -1; drawFrame->setRect(x,y,w,h, tiles.shadowSize(), mode-remove); - drawFrame->repaint(false); + drawFrame->tqrepaint(false); diff --git a/kmahjongg/Editor.h b/kmahjongg/Editor.h index edc8f912..a42f237d 100644 --- a/kmahjongg/Editor.h +++ b/kmahjongg/Editor.h @@ -13,16 +13,17 @@ #include "Preview.h" -class Editor: public QDialog +class Editor: public TQDialog { Q_OBJECT + TQ_OBJECT public: Editor ( - TQWidget* parent = NULL, + TQWidget* tqparent = NULL, const char* name = NULL ); diff --git a/kmahjongg/GameTimer.cpp b/kmahjongg/GameTimer.cpp index f3ce4f52..d4fc4009 100644 --- a/kmahjongg/GameTimer.cpp +++ b/kmahjongg/GameTimer.cpp @@ -8,11 +8,11 @@ // -// Constructs a GameTimer widget with a parent and a name. +// Constructs a GameTimer widget with a tqparent and a name. // -GameTimer::GameTimer( TQWidget *parent, const char *name ) - : TQLCDNumber( parent, name ) +GameTimer::GameTimer( TQWidget *tqparent, const char *name ) + : TQLCDNumber( tqparent, name ) { showingColon = false; setNumDigits(7); diff --git a/kmahjongg/GameTimer.h b/kmahjongg/GameTimer.h index 10d97e13..cae1961e 100644 --- a/kmahjongg/GameTimer.h +++ b/kmahjongg/GameTimer.h @@ -8,7 +8,7 @@ ** ** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved. ** -** This file is part of an example program for Qt. This example +** This file is part of an example program for TQt. This example ** program may be used, distributed and modified without limitation. ** *****************************************************************************/ @@ -24,8 +24,9 @@ enum TimerMode {running = -53 , stopped= -54 , paused = -55}; class GameTimer: public TQLCDNumber { Q_OBJECT + TQ_OBJECT public: - GameTimer( TQWidget *parent=0, const char *name=0 ); + GameTimer( TQWidget *tqparent=0, const char *name=0 ); int toInt(); TQString toString() {return theTimer.toString();} @@ -45,7 +46,7 @@ private slots: // internal slots private: // internal data bool showingColon; - QTime theTimer; + TQTime theTimer; TimerMode timerMode; }; diff --git a/kmahjongg/HighScore.cpp b/kmahjongg/HighScore.cpp index f59e782b..856ed7fb 100644 --- a/kmahjongg/HighScore.cpp +++ b/kmahjongg/HighScore.cpp @@ -43,11 +43,11 @@ int defTimes[numScores] = {ages, ages-1, ages-2, ages-3, HighScore::HighScore ( - TQWidget* parent, + TQWidget* tqparent, const char* name ) : - TQDialog( parent, name, true, 0 ) + TQDialog( tqparent, name, true, 0 ) { // form the target name @@ -62,7 +62,7 @@ HighScore::HighScore qtarch_Label_3->setGeometry( 10, 45, 30, 30 ); qtarch_Label_3->setFrameStyle( 50 ); qtarch_Label_3->setText( i18n("Pos") ); - qtarch_Label_3->setAlignment( AlignCenter ); + qtarch_Label_3->tqsetAlignment( AlignCenter ); fnt = qtarch_Label_3->font(); fnt.setBold(true); qtarch_Label_3->setFont(fnt); @@ -112,7 +112,7 @@ HighScore::HighScore qtarch_PushButton_1->setGeometry( 110+35, 340+50, 100, 30 ); qtarch_PushButton_1->setMinimumSize( 0, 0 ); qtarch_PushButton_1->setMaximumSize( 32767, 32767 ); - qtarch_PushButton_1->setFocusPolicy( TQWidget::TabFocus ); + qtarch_PushButton_1->setFocusPolicy( TQ_TabFocus ); qtarch_PushButton_1->setAutoRepeat( false ); qtarch_PushButton_1->setAutoResize( false ); qtarch_PushButton_1->setDefault(true); @@ -122,7 +122,7 @@ HighScore::HighScore resetBtn->setGeometry( 10, 5, 25, 25); resetBtn->setMinimumSize( 0, 0 ); resetBtn->setMaximumSize( 32767, 32767 ); - resetBtn->setFocusPolicy( TQWidget::TabFocus ); + resetBtn->setFocusPolicy( TQ_TabFocus ); //resetBtn->setText(i18n( "Reset" )); resetBtn->setAutoRepeat( false ); resetBtn->setAutoResize( false ); @@ -138,7 +138,7 @@ HighScore::HighScore lineEdit = new TQLineEdit(this, ""); lineEdit->setGeometry( 50, 40+(20*30), 190, 30 ); - lineEdit->setFocusPolicy(TQWidget::StrongFocus); + lineEdit->setFocusPolicy(TQ_StrongFocus); lineEdit->setFrame(true); lineEdit->setEchoMode(TQLineEdit::Normal); lineEdit->setText(""); @@ -149,7 +149,7 @@ HighScore::HighScore combo->setGeometry( 65, 5, 220, 25 ); combo->setMinimumSize( 0, 0 ); combo->setMaximumSize( 32767, 32767 ); - combo->setFocusPolicy( TQWidget::StrongFocus ); + combo->setFocusPolicy( TQ_StrongFocus ); combo->setSizeLimit( 10 ); combo->setAutoResize( false ); connect( combo, TQT_SIGNAL(activated(int)), TQT_SLOT(selectionChanged(int)) ); @@ -341,7 +341,7 @@ void HighScore::addRow(int num) { numbersWidgets[num] = new TQLabel( this); numbersWidgets[num]->setGeometry( 10, 75+(num*30), 30, 30 ); numbersWidgets[num]->setFrameStyle( 50 ); - numbersWidgets[num]->setAlignment( AlignRight | AlignVCenter ); + numbersWidgets[num]->tqsetAlignment( AlignRight | AlignVCenter ); numbersWidgets[num]->setNum(num+1); @@ -349,13 +349,13 @@ void HighScore::addRow(int num) { namesWidgets[num] = new TQLabel( this); namesWidgets[num]->setGeometry( 40, 75+(num*30), 150, 30 ); namesWidgets[num]->setFrameStyle( 50 ); - namesWidgets[num]->setAlignment( 289 ); + namesWidgets[num]->tqsetAlignment( 289 ); // board boardWidgets[num] = new TQLabel( this); boardWidgets[num]->setGeometry( 190, 75+(num*30), 80, 30 ); boardWidgets[num]->setFrameStyle( 50 ); - boardWidgets[num]->setAlignment( 289 ); + boardWidgets[num]->tqsetAlignment( 289 ); // score scoresWidgets[num] = new TQLabel( this); @@ -396,11 +396,11 @@ void HighScore::copyTableToScreen(const TQString &name) { elapsedWidgets[p]->setText(buff); } - repaint(false); + tqrepaint(false); } -int HighScore::exec(TQString &layout) { - copyTableToScreen(layout); +int HighScore::exec(TQString &tqlayout) { + copyTableToScreen(tqlayout); return(TQDialog::exec()); } diff --git a/kmahjongg/HighScore.h b/kmahjongg/HighScore.h index d6935ab5..bd593c09 100644 --- a/kmahjongg/HighScore.h +++ b/kmahjongg/HighScore.h @@ -26,21 +26,22 @@ typedef struct TableInstance { }; -class HighScore : public QDialog +class HighScore : public TQDialog { Q_OBJECT + TQ_OBJECT public: HighScore ( - TQWidget* parent = NULL, + TQWidget* tqparent = NULL, const char* name = NULL ); virtual ~HighScore(); - int exec(TQString &layout); + int exec(TQString &tqlayout); void checkHighScore(int score, int elapsed, long game, TQString &board); @@ -58,7 +59,7 @@ private: void selectTable(const TQString &name); void setComboTo(const TQString &to); void copyTableToScreen(const TQString &name); - QString &highScoreFile(); + TQString &highScoreFile(); int selectedLine; TQLineEdit *lineEdit; diff --git a/kmahjongg/Preview.cpp b/kmahjongg/Preview.cpp index 11fbcdbd..5c5871bf 100644 --- a/kmahjongg/Preview.cpp +++ b/kmahjongg/Preview.cpp @@ -19,7 +19,7 @@ static const char * themeMagicV1_0= "kmahjongg-theme-v1.0"; -Preview::Preview(TQWidget* parent) : KDialogBase(parent), m_tiles(true) +Preview::Preview(TQWidget* tqparent) : KDialogBase(tqparent), m_tiles(true) { KPushButton *loadButton; TQGroupBox *group; @@ -41,7 +41,7 @@ Preview::Preview(TQWidget* parent) : KDialogBase(parent), m_tiles(true) m_changed = false; setMainWidget(page); - setFixedSize(sizeHint()); + setFixedSize(tqsizeHint()); } Preview::~Preview() @@ -52,7 +52,7 @@ void Preview::selectionChanged(int which) { m_selectedFile = m_fileList[which]; drawPreview(); - m_drawFrame->repaint(0,0,-1,-1,false); + m_drawFrame->tqrepaint(0,0,-1,-1,false); markChanged(); } @@ -76,7 +76,7 @@ void Preview::initialise(const PreviewType type) TQString extension; TQString tile = Prefs::tileSet(); TQString back = Prefs::background(); - TQString layout = Prefs::layout(); + TQString tqlayout = 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 @@ -98,10 +98,10 @@ void Preview::initialise(const PreviewType type) break; case board: - m_fileSelector = i18n("*.layout|Board Layout File (*.layout)\n"); + m_fileSelector = i18n("*.tqlayout|Board Layout File (*.tqlayout)\n"); setCaption(i18n("Change Board Layout")); - m_selectedFile = layout; - extension = "*.layout"; + m_selectedFile = tqlayout; + extension = "*.tqlayout"; break; case theme: @@ -158,16 +158,16 @@ void Preview::slotOk() { } void Preview::load() { - KURL url = KFileDialog::getOpenURL(TQString::null, m_fileSelector, this, i18n("Open Board Layout" )); + KURL url = KFileDialog::getOpenURL(TQString(), m_fileSelector, this, i18n("Open Board Layout" )); if ( !url.isEmpty() ) { m_selectedFile = url.path(); drawPreview(); - m_drawFrame->repaint(0,0,-1,-1,false); + m_drawFrame->tqrepaint(0,0,-1,-1,false); markChanged(); } } -// Top level preview drawing method. Background, tileset and layout +// Top level preview drawing method. Background, tileset and tqlayout // are initialised from the preferences. Depending on the type // of preview dialog we pick up the selected file for one of these // chaps. @@ -176,7 +176,7 @@ void Preview::drawPreview() { TQString tile = Prefs::tileSet(); TQString back = Prefs::background(); - TQString layout = Prefs::layout(); + TQString tqlayout = Prefs::layout(); switch (m_previewType) { @@ -189,15 +189,15 @@ void Preview::drawPreview() break; case board: - layout = m_selectedFile; + tqlayout = m_selectedFile; break; case theme: // a theme is quite a bit of work. We load the - // specified bits in (layout, background and tileset + // specified bits in (tqlayout, background and tileset if (!m_selectedFile.isEmpty()) { - TQString backRaw, layoutRaw, tilesetRaw, magic; + TQString backRaw, tqlayoutRaw, tilesetRaw, magic; TQFile in(m_selectedFile); if (in.open(IO_ReadOnly)) @@ -212,38 +212,38 @@ void Preview::drawPreview() } tilesetRaw = stream.readLine(); backRaw = stream.readLine(); - layoutRaw = stream.readLine(); + tqlayoutRaw = stream.readLine(); in.close(); tile = tilesetRaw; - tile.replace(":", "/kmahjongg/pics/"); + tile.tqreplace(":", "/kmahjongg/pics/"); if (!TQFile::exists(tile)) { tile = tilesetRaw; - tile = "pics/" + tile.right(tile.length() - tile.find(":") - 1 ); + tile = "pics/" + tile.right(tile.length() - tile.tqfind(":") - 1 ); tile = locate("appdata", tile); } back = backRaw; - back.replace(":", "/kmahjongg/pics/"); + back.tqreplace(":", "/kmahjongg/pics/"); if (!TQFile::exists(back)) { back = backRaw; - back = "pics/" + back.right(back.length() - back.find(":") - 1); + back = "pics/" + back.right(back.length() - back.tqfind(":") - 1); back = locate("appdata", back); } - layout = layoutRaw; - layout.replace(":", "/kmahjongg/pics/"); - if (!TQFile::exists(layout)) + tqlayout = tqlayoutRaw; + tqlayout.tqreplace(":", "/kmahjongg/pics/"); + if (!TQFile::exists(tqlayout)) { - layout = layoutRaw; - layout = "pics/" + layout.right(layout.length() - layout.find(":") - 1); - layout = locate("appdata", layout); + tqlayout = tqlayoutRaw; + tqlayout = "pics/" + tqlayout.right(tqlayout.length() - tqlayout.tqfind(":") - 1); + tqlayout = locate("appdata", tqlayout); } m_themeBack=back; - m_themeLayout=layout; + m_themeLayout=tqlayout; m_themeTileset=tile; } } @@ -251,16 +251,16 @@ void Preview::drawPreview() } renderBackground(back); - renderTiles(tile, layout); + renderTiles(tile, tqlayout); } void Preview::paintEvent( TQPaintEvent* ){ - m_drawFrame->repaint(false); + m_drawFrame->tqrepaint(false); } // the user selected ok, or apply. This method passes the changes // across to the game widget and if necessary forces a board redraw -// (unnecessary on layout changes since it only effects the next game) +// (unnecessary on tqlayout changes since it only effects the next game) void Preview::applyChange() { switch (m_previewType) @@ -287,8 +287,8 @@ void Preview::applyChange() break; } - // don't redraw for a layout change - if (m_previewType == board || m_previewType == theme) layoutChange(); + // don't redraw for a tqlayout change + if (m_previewType == board || m_previewType == theme) tqlayoutChange(); else boardRedraw(true); // either way we mark the current value as unchanged @@ -310,9 +310,9 @@ void Preview::renderBackground(const TQString &bg) { // This method draws a mini-tiled board with no tiles missing. -void Preview::renderTiles(const TQString &file, const TQString &layout) { +void Preview::renderTiles(const TQString &file, const TQString &tqlayout) { m_tiles.loadTileset(file, true); - m_boardLayout.loadBoardLayout(layout); + m_boardLayout.loadBoardLayout(tqlayout); TQPixmap *dest = m_drawFrame->getPreviewPixmap(); int xOffset = m_tiles.width()/2; @@ -366,23 +366,23 @@ void Preview::renderTiles(const TQString &file, const TQString &layout) { void Preview::saveTheme() { TQString tile = Prefs::tileSet(); TQString back = Prefs::background(); - TQString layout = Prefs::layout(); + TQString tqlayout = Prefs::layout(); TQString with = ":"; // we want to replace any path in the default store // with a + TQRegExp p(locate("data_dir", "/kmahjongg/pics/")); - back.replace(p,with); - tile.replace(p,with); - layout.replace(p,with); + back.tqreplace(p,with); + tile.tqreplace(p,with); + tqlayout.tqreplace(p,with); // Get the name of the file to save KURL url = KFileDialog::getSaveURL( NULL, "*.theme", - parentWidget(), + tqparentWidget(), i18n("Save Theme" )); if ( url.isEmpty() ) return; @@ -402,7 +402,7 @@ void Preview::saveTheme() { int res=KMessageBox::warningContinueCancel(this, i18n("A file with that name " "already exists. Do you " - "wish to overwrite it?"),TQString::null,i18n("Overwrite")); + "wish to overwrite it?"),TQString(),i18n("Overwrite")); if (res != KMessageBox::Continue) return ; } @@ -417,12 +417,12 @@ void Preview::saveTheme() { themeMagicV1_0, tile.utf8().data(), back.utf8().data(), - layout.utf8().data()); + tqlayout.utf8().data()); fclose(outFile); } -FrameImage::FrameImage (TQWidget *parent, const char *name) - : TQFrame(parent, name) +FrameImage::FrameImage (TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name) { rx = -1; thePixmap = new TQPixmap(); @@ -448,11 +448,11 @@ void FrameImage::paintEvent( TQPaintEvent* pa ) TQPen line; - line.setStyle(DotLine); + line.setStyle(Qt::DotLine); line.setWidth(2); line.setColor(yellow); p.setPen(line); - p.setBackgroundMode(OpaqueMode); + p.setBackgroundMode(Qt::OpaqueMode); p.setBackgroundColor(black); int x = pa->rect().left(); diff --git a/kmahjongg/Preview.h b/kmahjongg/Preview.h index 96aae3ef..0c4b37c2 100644 --- a/kmahjongg/Preview.h +++ b/kmahjongg/Preview.h @@ -12,11 +12,12 @@ class TQComboBox; class TQPixmap; -class FrameImage: public QFrame +class FrameImage: public TQFrame { Q_OBJECT + TQ_OBJECT public: - FrameImage(TQWidget *parent=NULL, const char *name = NULL); + FrameImage(TQWidget *tqparent=NULL, const char *name = NULL); ~FrameImage(); void setGeometry(int x, int y, int w, int h); TQPixmap *getPreviewPixmap() {return thePixmap;} @@ -43,11 +44,12 @@ private: class Preview: public KDialogBase { Q_OBJECT + TQ_OBJECT public: enum PreviewType {background, tileset, board, theme}; - Preview(TQWidget* parent); + Preview(TQWidget* tqparent); ~Preview(); void initialise(const PreviewType type); @@ -61,7 +63,7 @@ protected: virtual void drawPreview(); void applyChange() ; void renderBackground(const TQString &bg); - void renderTiles(const TQString &file, const TQString &layout); + void renderTiles(const TQString &file, const TQString &tqlayout); void paintEvent( TQPaintEvent* pa ); signals: @@ -69,7 +71,7 @@ signals: void loadTileset(const TQString &); void loadBackground(const TQString &, bool); void loadBoard(const TQString &); - void layoutChange(); + void tqlayoutChange(); public slots: void selectionChanged(int which); diff --git a/kmahjongg/Tileset.cpp b/kmahjongg/Tileset.cpp index b7e04f4e..fb4b1d05 100644 --- a/kmahjongg/Tileset.cpp +++ b/kmahjongg/Tileset.cpp @@ -16,9 +16,9 @@ static unsigned char mini_bits[] = { 0xff, 0xff, 0x0f, 0xff, 0xff, 0x0f, 0xff, 0xff, 0x07, 0xff, 0xff, 0x03, }; -#define mask_width 40 -#define mask_height 56 -static unsigned char mask_bits[] = { +#define tqmask_width 40 +#define tqmask_height 56 +static unsigned char tqmask_bits[] = { 0xf0, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -48,8 +48,8 @@ static unsigned char mask_bits[] = { // --------------------------------------------------------- Tileset::Tileset(bool scale): - maskBits(mask_width, mask_height, mask_bits, true), - maskBitsMini(mini_width, mini_height, mini_bits, true) + tqmaskBits(tqmask_width, tqmask_height, tqmask_bits, true), + tqmaskBitsMini(mini_width, mini_height, mini_bits, true) { isScaled = scale; divisor = (isScaled) ? 2 : 1; @@ -62,12 +62,12 @@ Tileset::Tileset(bool scale): s = w*h; // RGBA's required per tile // Allocate memory for the 9*5 tile arrays - tiles = new QRgb [9*5*s]; - selectedTiles = new QRgb [9*5*s]; + tiles = new TQRgb [9*5*s]; + selectedTiles = new TQRgb [9*5*s]; // allocate memory for single tile storage - selectedFace = new QRgb [s]; - unselectedFace = new QRgb [s]; + selectedFace = new TQRgb [s]; + unselectedFace = new TQRgb [s]; // quarter widths are used as an offset when // overlaying tiles in 3 dimensions. @@ -94,14 +94,14 @@ 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, TQImage &from) { - QRgb *dest = to; - QRgb *src; +TQRgb *Tileset::copyTileImage(short tileX, short tileY, TQRgb *to, TQImage &from) { + TQRgb *dest = to; + TQRgb *src; - src = (QRgb *) from.scanLine(tileY * h) + src = (TQRgb *) from.scanLine(tileY * h) +(tileX * w); for (short pos=0; pos < h; pos++) { - memcpy(dest, src, w*sizeof(QRgb)); + memcpy(dest, src, w*sizeof(TQRgb)); dest+=w; src += from.width(); } @@ -117,16 +117,16 @@ QRgb *Tileset::copyTileImage(short tileX, short tileY, QRgb *to, TQImage &from) // color). -QRgb *Tileset::createTile(short x, short y, - QRgb *det, TQImage &allTiles , QRgb *face) { - QRgb *image ; - QRgb *to = det; +TQRgb *Tileset::createTile(short x, short y, + TQRgb *det, TQImage &allTiles , TQRgb *face) { + TQRgb *image ; + TQRgb *to = det; // Alloc the space - image = new QRgb[s]; + image = new TQRgb[s]; // copy in the background - memcpy(to, face, s*sizeof(QRgb)); + memcpy(to, face, s*sizeof(TQRgb)); // get the tile gylph copyTileImage(x, y , image, allTiles); @@ -135,7 +135,7 @@ QRgb *Tileset::createTile(short x, short y, // top left colour as the transparency. We step over // the shadow and the boarder - QRgb* src = image+ // image + TQRgb* src = image+ // image ss+ // past the left shadow bs+ // then the tile border (bs * w); // then step past the top border @@ -144,7 +144,7 @@ QRgb *Tileset::createTile(short x, short y, to += (((ss+bs))+(bs*w)); - QRgb trans = *src; + TQRgb trans = *src; // start after the top border rows and go through all rows for( short YP=0; YP < h-ss - (2*bs); YP++) { @@ -173,17 +173,17 @@ 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, TQPixmap &dest, bool scale, bool shadow) +void Tileset::createPixmap(TQRgb *src, TQPixmap &dest, bool scale, bool shadow) { TQImage buff; - QRgb *line; + TQRgb *line; buff.create(w, h, 32); for (int y=0; yquit(); } @@ -55,17 +55,17 @@ BoardWidget::BoardWidget( TQWidget* parent, const char *name ) if( ! loadBackground(tFile, false ) ) { KMessageBox::error(this, - i18n("An error occurred when loading the background image\n%1").arg(tFile)+ + i18n("An error occurred when loading the background image\n%1").tqarg(tFile)+ i18n("KMahjongg will now terminate.")); kapp->quit(); } - getFileOrDefault(Prefs::layout(), "layout", tFile); + getFileOrDefault(Prefs::layout(), "tqlayout", tFile); if( ! loadBoardLayout(tFile) ) { KMessageBox::error(this, - i18n("An error occurred when loading the board layout %1\n" - "KMahjongg will now terminate.").arg(tFile)); + i18n("An error occurred when loading the board tqlayout %1\n" + "KMahjongg will now terminate.").tqarg(tFile)); kapp->quit(); } setDisplayedWidth(); @@ -92,7 +92,7 @@ void BoardWidget::saveSettings(){ //config->writePathEntry("Tileset_file", tileFile); //config->writePathEntry("Background_file", backgroundFile); - //config->writePathEntry("Layout_file", layout); + //config->writePathEntry("Layout_file", tqlayout); } void BoardWidget::getFileOrDefault(TQString filename, TQString type, TQString &res) @@ -111,7 +111,7 @@ void BoardWidget::getFileOrDefault(TQString filename, TQString type, TQString &r if (res.isEmpty()) { KMessageBox::error(this, i18n("KMahjongg could not locate the file: %1\n" "or the default file of type: %2\n" - "KMahjongg will now terminate").arg(filename).arg(type) ); + "KMahjongg will now terminate").tqarg(filename).tqarg(type) ); kapp->quit(); } } @@ -264,7 +264,7 @@ void BoardWidget::paintEvent( TQPaintEvent* pa ) return; } - // if the repaint is because of a window redraw after a move + // if the tqrepaint is because of a window redraw after a move // or a menu roll up, then just blit in the last rendered image if (!updateBackBuffer) { bitBlt(this, xx,pa->rect().top(), @@ -440,7 +440,7 @@ void BoardWidget::stackTiles(unsigned char t, unsigned short h, unsigned short x int ss = theTiles.shadowSize(); TQPainter p(&backBuffer); TQPen line; - p.setBackgroundMode(OpaqueMode); + p.setBackgroundMode(Qt::OpaqueMode); p.setBackgroundColor(black); @@ -766,7 +766,7 @@ void BoardWidget::calculateNewGame( int gNumber) } // --------------------------------------------------------- -// Generate the position data for the layout from contents of Game.Map. +// Generate the position data for the tqlayout from contents of Game.Map. void BoardWidget::generateTilePositions() { numTiles = 0; @@ -788,7 +788,7 @@ void BoardWidget::generateTilePositions() { } // --------------------------------------------------------- -// Generate the dependency data for the layout from the position data. +// Generate the dependency data for the tqlayout from the position data. // Note that the coordinates of each tile in tilePositions are those of // the upper left quarter of the tile. void BoardWidget::generatePositionDepends() { @@ -882,7 +882,7 @@ int BoardWidget::tileAt(int x, int y, int z) { bool BoardWidget::generateSolvableGame() { // Initially we want to mark positions on layer 0 so that we have only - // one free position per apparent horizontal line. + // one free position per aptqparent horizontal line. for (int i = 0; i < numTiles; i++) { // Pick a random tile on layer 0 @@ -894,7 +894,7 @@ bool BoardWidget::generateSolvableGame() { } } while (tilePositions[position].e != 0); - // If there are no other free positions on the same apparent + // If there are no other free positions on the same aptqparent // horizontal line, we can mark that position as free. if (onlyFreeInLine(position)) { positionDepends[position].free = true; @@ -965,7 +965,7 @@ bool BoardWidget::generateSolvableGame() { // --------------------------------------------------------- // Determines whether it is ok to mark this position as "free" because -// there are no other positions marked "free" in its apparent horizontal +// there are no other positions marked "free" in its aptqparent horizontal // line. bool BoardWidget::onlyFreeInLine(int position) { @@ -1104,7 +1104,7 @@ void BoardWidget::updateDepend(int position) { } } - // If position is first free on apparent horizontal, it is + // If position is first free on aptqparent horizontal, it is // now free to be filled. if (onlyFreeInLine(position)) { positionDepends[position].free = true; @@ -1393,7 +1393,7 @@ bool BoardWidget::findMove( POSITION& posA, POSITION& posB ) iPosCount = 0; // Hier Anzahl der gefunden Paare merken - // The new tile layout with non-contiguos horizantle spans + // The new tile tqlayout with non-contiguos horizantle spans // can lead to huge numbers of matching pairs being exposed. // we alter the loop to bail out when BoardLayout::maxTiles/2 pairs are found // (or less); @@ -1623,7 +1623,7 @@ void BoardWidget::mousePressEvent ( TQMouseEvent* event ) if (gamePaused) return; - if( event->button() == LeftButton ) + if( event->button() == Qt::LeftButton ) { if( TimerState == Demo ) { @@ -1804,7 +1804,7 @@ bool BoardWidget::loadBackground( if( ! theBackground.load( pszFileName, requiredWidth(), requiredHeight()) ) { if( bShowError ) - KMessageBox::sorry(this, i18n("Failed to load image:\n%1").arg(pszFileName) ); + KMessageBox::sorry(this, i18n("Failed to load image:\n%1").tqarg(pszFileName) ); return( false ); } Prefs::setBackground(pszFileName); @@ -2010,7 +2010,7 @@ void BoardWidget::shuffle() { // force a redraw updateBackBuffer=true; - repaint(false); + tqrepaint(false); // I consider this s very bad cheat so, I punish the user diff --git a/kmahjongg/boardwidget.h b/kmahjongg/boardwidget.h index 3fe7c3b7..749f5452 100644 --- a/kmahjongg/boardwidget.h +++ b/kmahjongg/boardwidget.h @@ -86,12 +86,13 @@ typedef struct gamedata { /** * @author Mathias Mueller */ -class BoardWidget : public QWidget +class BoardWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - BoardWidget( TQWidget* parent = 0, const char *name = 0 ); + BoardWidget( TQWidget* tqparent = 0, const char *name = 0 ); ~BoardWidget(); void calculateNewGame(int num = -1 ); @@ -204,7 +205,7 @@ class BoardWidget : public QWidget - bool updateBackBuffer; // does board need redrawing. Not if it is just a repaint + bool updateBackBuffer; // does board need redrawing. Not if it is just a tqrepaint bool gamePaused; diff --git a/kmahjongg/kmahjongg.cpp b/kmahjongg/kmahjongg.cpp index dd49fedd..d9f20522 100644 --- a/kmahjongg/kmahjongg.cpp +++ b/kmahjongg/kmahjongg.cpp @@ -4,7 +4,7 @@ kmahjongg, the classic mahjongg game for KDE project - Requires the Qt widget libraries, available at no cost at + Requires the TQt widget libraries, available at no cost at http://www.troll.no Copyright (C) 1997 Mathias Mueller @@ -57,8 +57,8 @@ int is_paused = 0; /** Constructor. */ -KMahjongg::KMahjongg( TQWidget* parent, const char *name) - : KMainWindow(parent, name) +KMahjongg::KMahjongg( TQWidget* tqparent, const char *name) + : KMainWindow(tqparent, name) { boardEditor = 0; @@ -100,7 +100,7 @@ KMahjongg::KMahjongg( TQWidget* parent, const char *name) connect( previewLoad, TQT_SIGNAL( boardRedraw(bool) ), bw, TQT_SLOT( drawBoard(bool) ) ); - connect( previewLoad, TQT_SIGNAL( layoutChange() ), + connect( previewLoad, TQT_SIGNAL( tqlayoutChange() ), this, TQT_SLOT( newGame() ) ); @@ -128,41 +128,41 @@ KMahjongg::~KMahjongg() void KMahjongg::setupKAction() { // game - 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"); + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection()); + KStdGameAction::load(TQT_TQOBJECT(this), TQT_SLOT(loadGame()), actionCollection()); + KStdGameAction::save(TQT_TQOBJECT(this), TQT_SLOT(saveGame()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + KStdGameAction::restart(TQT_TQOBJECT(this), TQT_SLOT(restartGame()), actionCollection()); + new KAction(i18n("New Numbered Game..."), "newnum", 0, TQT_TQOBJECT(this), TQT_SLOT(startNewNumeric()), actionCollection(), "game_new_numeric"); + new KAction(i18n("Open Th&eme..."), 0, TQT_TQOBJECT(this), TQT_SLOT(openTheme()), actionCollection(), "game_open_theme"); + new KAction(i18n("Open &Tileset..."), 0, TQT_TQOBJECT(this), TQT_SLOT(openTileset()), actionCollection(), "game_open_tileset"); + new KAction(i18n("Open &Background..."), 0, TQT_TQOBJECT(this), TQT_SLOT(openBackground()), actionCollection(), "game_open_background"); + new KAction(i18n("Open La&yout..."), 0, TQT_TQOBJECT(this), TQT_SLOT(openLayout()), actionCollection(), "game_open_layout"); + new KAction(i18n("Sa&ve Theme..."), 0, TQT_TQOBJECT(this), TQT_SLOT(saveTheme()), actionCollection(), "game_save_theme"); // originally "file" ends here - 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"); + KStdGameAction::hint(TQT_TQOBJECT(bw), TQT_SLOT(helpMove()), actionCollection()); + new KAction(i18n("Shu&ffle"), "reload", 0, TQT_TQOBJECT(bw), TQT_SLOT(shuffle()), actionCollection(), "move_shuffle"); + demoAction = KStdGameAction::demo(TQT_TQOBJECT(this), TQT_SLOT(demoMode()), actionCollection()); + showMatchingTilesAction = new KToggleAction(i18n("Show &Matching Tiles"), 0, TQT_TQOBJECT(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, TQT_SLOT(showHighscores()), actionCollection()); - pauseAction = KStdGameAction::pause(this, TQT_SLOT(pause()), actionCollection()); + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighscores()), actionCollection()); + pauseAction = KStdGameAction::pause(TQT_TQOBJECT(this), TQT_SLOT(pause()), actionCollection()); // TODO: store the background ; open on startup - // TODO: same about layout + // TODO: same about tqlayout // TODO: same about theme // move - undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); - redoAction = KStdGameAction::redo(this, TQT_SLOT(redo()), actionCollection()); + undoAction = KStdGameAction::undo(TQT_TQOBJECT(this), TQT_SLOT(undo()), actionCollection()); + redoAction = KStdGameAction::redo(TQT_TQOBJECT(this), TQT_SLOT(redo()), actionCollection()); // edit - new KAction(i18n("&Board Editor"), 0, this, TQT_SLOT(slotBoardEditor()), actionCollection(), "edit_board_editor"); + new KAction(i18n("&Board Editor"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotBoardEditor()), actionCollection(), "edit_board_editor"); // settings - KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(showSettings()), actionCollection()); setupGUI(); } @@ -179,19 +179,19 @@ void KMahjongg::setupStatusBar() tilesLeftLabel= new TQLabel("Removed: 0000/0000", statusBar()); tilesLeftLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - statusBar()->addWidget(tilesLeftLabel, tilesLeftLabel->sizeHint().width(), ID_STATUS_GAME); + statusBar()->addWidget(tilesLeftLabel, tilesLeftLabel->tqsizeHint().width(), ID_STATUS_GAME); gameNumLabel = new TQLabel("Game: 000000000000000000000", statusBar()); gameNumLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - statusBar()->addWidget(gameNumLabel, gameNumLabel->sizeHint().width(), ID_STATUS_TILENUMBER); + statusBar()->addWidget(gameNumLabel, gameNumLabel->tqsizeHint().width(), ID_STATUS_TILENUMBER); statusLabel= new TQLabel("Kmahjongg", statusBar()); statusLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - statusBar()->addWidget(statusLabel, statusLabel->sizeHint().width(), ID_STATUS_MESSAGE); + statusBar()->addWidget(statusLabel, statusLabel->tqsizeHint().width(), ID_STATUS_MESSAGE); - // pStatusBar->setAlignment( ID_STATUS_TILENUMBER, AlignCenter ); + // pStatusBar->tqsetAlignment( ID_STATUS_TILENUMBER, AlignCenter ); } void KMahjongg::setDisplayedWidth() @@ -239,7 +239,7 @@ 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, TQT_SIGNAL(settingsChanged()), bw, TQT_SLOT(loadSettings())); - connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(setDisplayedWidth())); + connect(dialog, TQT_SIGNAL(settingsChanged()), TQT_TQOBJECT(this), TQT_SLOT(setDisplayedWidth())); dialog->show(); } @@ -397,7 +397,7 @@ void KMahjongg::gameOver( void KMahjongg::showStatusText( const TQString &msg, long board ) { statusLabel->setText(msg); - TQString str = i18n("Game number: %1").arg(board); + TQString str = i18n("Game number: %1").tqarg(board); gameNumLabel->setText(str); } @@ -406,8 +406,8 @@ void KMahjongg::showStatusText( const TQString &msg, long board ) void KMahjongg::showTileNumber( int iMaximum, int iCurrent, int iLeft ) { // Hmm... seems iCurrent is the number of remaining tiles, not removed ... - //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); + //TQString szBuffer = i18n("Removed: %1/%2").tqarg(iCurrent).tqarg(iMaximum); + TQString szBuffer = i18n("Removed: %1/%2 Combinations left: %3").tqarg(iMaximum-iCurrent).tqarg(iMaximum).tqarg(iLeft); tilesLeftLabel->setText(szBuffer); // Update here since undo allow is effected by demo mode diff --git a/kmahjongg/kmahjongg.h b/kmahjongg/kmahjongg.h index a1e14efa..54c5ca92 100644 --- a/kmahjongg/kmahjongg.h +++ b/kmahjongg/kmahjongg.h @@ -4,7 +4,7 @@ kmahjongg, the classic mahjongg game for KDE project - Requires the Qt widget libraries, available at no cost at + Requires the TQt widget libraries, available at no cost at http://www.troll.no Copyright (C) 1997 Mathias Mueller @@ -51,9 +51,10 @@ class TQLabel; class KMahjongg : public KMainWindow { Q_OBJECT + TQ_OBJECT public: - KMahjongg( TQWidget* parent = 0, const char *name = 0); + KMahjongg( TQWidget* tqparent = 0, const char *name = 0); ~KMahjongg(); public slots: diff --git a/kmahjongg/pics/cross.layout b/kmahjongg/pics/cross.layout index 39c58f1e..de71a115 100644 --- a/kmahjongg/pics/cross.layout +++ b/kmahjongg/pics/cross.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 12....12121212121212121212....12 4312..43434343434343434343..1243 124312........1212........124312 diff --git a/kmahjongg/pics/default.layout b/kmahjongg/pics/default.layout index f72ed794..005254ed 100644 --- a/kmahjongg/pics/default.layout +++ b/kmahjongg/pics/default.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 # Level 0 ------------------------- ...121212121212121212121212..... ...434343434343434343434343..... diff --git a/kmahjongg/pics/default.theme b/kmahjongg/pics/default.theme index 9ba994bc..49502e04 100644 --- a/kmahjongg/pics/default.theme +++ b/kmahjongg/pics/default.theme @@ -1,4 +1,4 @@ kmahjongg-theme-v1.0 :default.tileset :default.bgnd -:default.layout +:default.tqlayout diff --git a/kmahjongg/pics/pirates.layout b/kmahjongg/pics/pirates.layout index c5bb895c..3cce44e3 100644 --- a/kmahjongg/pics/pirates.layout +++ b/kmahjongg/pics/pirates.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 .............121212.......12..12 .............434343.......43..43 .............12.............12.. diff --git a/kmahjongg/pics/pirates.theme b/kmahjongg/pics/pirates.theme index 748b3ffa..51b6ec88 100644 --- a/kmahjongg/pics/pirates.theme +++ b/kmahjongg/pics/pirates.theme @@ -1,5 +1,5 @@ kmahjongg-theme-v1.0 :pirates.tileset :pirates.bgnd -:pirates.layout +:pirates.tqlayout diff --git a/kmahjongg/pics/pyramid.layout b/kmahjongg/pics/pyramid.layout index edd634dc..0239212b 100644 --- a/kmahjongg/pics/pyramid.layout +++ b/kmahjongg/pics/pyramid.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 # Level 0 ------------------------- ....121212121212121212121212.... ....434343434343434343434343.... diff --git a/kmahjongg/pics/stax.layout b/kmahjongg/pics/stax.layout index f5595dca..abc7e969 100644 --- a/kmahjongg/pics/stax.layout +++ b/kmahjongg/pics/stax.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 ................................ 12121212..121212121212..12121212 43434343..434343434343..43434343 diff --git a/kmahjongg/pics/test.layout b/kmahjongg/pics/test.layout index d46a4e21..2c76ddec 100644 --- a/kmahjongg/pics/test.layout +++ b/kmahjongg/pics/test.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 .1212121212121212121212121212... .4343434343434343434343434343... .1212121212121212121212121212... diff --git a/kmahjongg/pics/test2.layout b/kmahjongg/pics/test2.layout index aedc6290..9ab29fdf 100644 --- a/kmahjongg/pics/test2.layout +++ b/kmahjongg/pics/test2.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 ................................ ................................ .121212121212121212............. diff --git a/kmahjongg/pics/tower.layout b/kmahjongg/pics/tower.layout index 76fe96a0..3ca7bfc6 100644 --- a/kmahjongg/pics/tower.layout +++ b/kmahjongg/pics/tower.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 # Level 0 ------------------------- ....121212121212121212121212.... ....434343434343434343434343.... diff --git a/kmahjongg/pics/triangle.layout b/kmahjongg/pics/triangle.layout index e1dd4891..e04c405a 100644 --- a/kmahjongg/pics/triangle.layout +++ b/kmahjongg/pics/triangle.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 # Level 0 ------------------------- .121212121212121212121212121212. .434343434343434343434343434343. diff --git a/kmahjongg/settings.ui b/kmahjongg/settings.ui index e53c6e37..81f40b8a 100644 --- a/kmahjongg/settings.ui +++ b/kmahjongg/settings.ui @@ -1,10 +1,10 @@ Settings - + Settings - + 0 0 @@ -22,7 +22,7 @@ 0 - + frame3 @@ -39,7 +39,7 @@ unnamed - + groupBox1 @@ -50,7 +50,7 @@ unnamed - + kcfg_ShowRemoved @@ -58,7 +58,7 @@ Show removed tiles - + kcfg_SolvableGames @@ -69,7 +69,7 @@ true - + kcfg_PlayAnimation @@ -92,14 +92,14 @@ Expanding - + 20 16 - + kcfg_TiledBackground @@ -110,7 +110,7 @@ unnamed - + Background_scale @@ -118,7 +118,7 @@ Scale - + Background_tiled @@ -131,7 +131,7 @@ - + groupBox2 @@ -142,7 +142,7 @@ unnamed - + kcfg_ShowShadows @@ -153,7 +153,7 @@ false - + kcfg_MiniTiles @@ -167,5 +167,5 @@ - + diff --git a/kmines/dialogs.cpp b/kmines/dialogs.cpp index ad956c30..a81c8d91 100644 --- a/kmines/dialogs.cpp +++ b/kmines/dialogs.cpp @@ -61,8 +61,8 @@ void Smiley::setMood(Mood mood) } //----------------------------------------------------------------------------- -DigitalClock::DigitalClock(TQWidget *parent) -: KGameLCDClock(parent, "digital_clock") +DigitalClock::DigitalClock(TQWidget *tqparent) +: KGameLCDClock(tqparent, "digital_clock") { setFrameStyle(Panel | Sunken); setDefaultBackgroundColor(black); @@ -165,7 +165,7 @@ void CustomConfig::updateNbMines() Level l(_width->value(), _height->value(), _mines->value()); _mines->setRange(1, Level::maxNbMines(l.width(), l.height())); _mines->setLabel(i18n("Mines (%1%):") - .arg( (100*l.nbMines()) / (l.width() * l.height()) )); + .tqarg( (100*l.nbMines()) / (l.width() * l.height()) )); _gameType->setCurrentItem(l.type()); _block = false; } @@ -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."), TQString::null, "magic_reveal_warning"); + KMessageBox::information(this, i18n("When the \"magic\" reveal is on, you lose the ability to enter the highscores."), TQString(), "magic_reveal_warning"); } //----------------------------------------------------------------------------- diff --git a/kmines/dialogs.h b/kmines/dialogs.h index 15321a49..f900f7e6 100644 --- a/kmines/dialogs.h +++ b/kmines/dialogs.h @@ -34,9 +34,10 @@ class KIntNumInput; class Smiley : public TQPushButton, public KMines { Q_OBJECT + TQ_OBJECT public: - Smiley(TQWidget *parent, const char *name = 0) - : TQPushButton(TQString::null, parent, name) {} + Smiley(TQWidget *tqparent, const char *name = 0) + : TQPushButton(TQString(), tqparent, name) {} public slots: void setMood(Mood); @@ -49,8 +50,9 @@ class Smiley : public TQPushButton, public KMines class DigitalClock : public KGameLCDClock { Q_OBJECT + TQ_OBJECT public: - DigitalClock(TQWidget *parent); + DigitalClock(TQWidget *tqparent); void reset(bool customGame); @@ -76,6 +78,7 @@ class DigitalClock : public KGameLCDClock class CustomConfig : public TQWidget, public KMines { Q_OBJECT + TQ_OBJECT public: CustomConfig(); @@ -100,6 +103,7 @@ class CustomConfig : public TQWidget, public KMines class GameConfig : public TQWidget, public KMines { Q_OBJECT + TQ_OBJECT public: GameConfig(); @@ -118,6 +122,7 @@ class GameConfig : public TQWidget, public KMines class AppearanceConfig : public TQWidget, public KMines { Q_OBJECT + TQ_OBJECT public: AppearanceConfig(); }; diff --git a/kmines/field.cpp b/kmines/field.cpp index ff3b4e46..582e6663 100644 --- a/kmines/field.cpp +++ b/kmines/field.cpp @@ -44,8 +44,8 @@ const Field::ActionData Field::ACTION_DATA[Nb_Actions] = { { "UnsetUncertain", "unset_uncertain", I18N_NOOP("Question mark unset") } }; -Field::Field(TQWidget *parent) - : FieldFrame(parent), _state(Init), _solvingState(Regular), _level(Level::Easy) +Field::Field(TQWidget *tqparent) + : FieldFrame(tqparent), _state(Init), _solvingState(Regular), _level(Level::Easy) {} void Field::readSettings() @@ -57,7 +57,7 @@ void Field::readSettings() if ( Settings::magicReveal() ) emit setCheating(); } -TQSize Field::sizeHint() const +TQSize Field::tqsizeHint() const { return TQSize(2*frameWidth() + _level.width()*Settings::caseSize(), 2*frameWidth() + _level.height()*Settings::caseSize()); @@ -117,7 +117,7 @@ void Field::changeCase(const Coord &p, CaseState newState) BaseField::changeCase(p, newState); TQPainter painter(this); drawCase(painter, p); - if ( isActive() ) emit updateStatus( hasMine(p) ); + if ( isActive() ) emit updatetqStatus( hasMine(p) ); } TQPoint Field::toPoint(const Coord &p) const diff --git a/kmines/field.h b/kmines/field.h index 7e079d65..4d17358f 100644 --- a/kmines/field.h +++ b/kmines/field.h @@ -27,6 +27,7 @@ class Field : public FieldFrame, public BaseField { Q_OBJECT + TQ_OBJECT public: enum ActionType { Reveal = 0, AutoReveal, SetFlag, UnsetFlag, SetUncertain, UnsetUncertain, Nb_Actions }; @@ -36,9 +37,9 @@ class Field : public FieldFrame, public BaseField static const ActionData ACTION_DATA[Nb_Actions]; public: - Field(TQWidget *parent); + Field(TQWidget *tqparent); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; void setLevel(const Level &level); void setReplayField(const TQString &field); @@ -67,7 +68,7 @@ class Field : public FieldFrame, public BaseField SolvingState solvingState() const { return _solvingState; } signals: - void updateStatus(bool); + void updatetqStatus(bool); void gameStateChanged(GameState); void setMood(Mood); void setCheating(); diff --git a/kmines/frame.cpp b/kmines/frame.cpp index 6c9446c2..7c712383 100644 --- a/kmines/frame.cpp +++ b/kmines/frame.cpp @@ -26,8 +26,8 @@ #include "settings.h" -FieldFrame::FieldFrame(TQWidget *parent) - : TQFrame(parent, "field"), _button(0) +FieldFrame::FieldFrame(TQWidget *tqparent) + : TQFrame(tqparent, "field"), _button(0) { setFrameStyle( TQFrame::Box | TQFrame::Raised ); setLineWidth(2); @@ -36,65 +36,67 @@ FieldFrame::FieldFrame(TQWidget *parent) void FieldFrame::adjustSize() { - setFixedSize(sizeHint()); + setFixedSize(tqsizeHint()); _button.resize(Settings::caseSize(), Settings::caseSize()); - TQBitmap mask; + TQBitmap tqmask; for (uint i=0; iconfig(), group); - TQString name = cg.config()->readEntry("Name", TQString::null); + TQString name = cg.config()->readEntry("Name", TQString()); if ( name.isNull() ) return; if ( name.isEmpty() ) name = i18n("anonymous"); uint minutes = cg.config()->readUnsignedNumEntry("Min", 0); diff --git a/kmines/kzoommainwindow.cpp b/kmines/kzoommainwindow.cpp index 4e1b85a5..1d0f5319 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, TQT_SLOT(zoomIn()), actionCollection()); + _zoomInAction = KStdAction::zoomIn(TQT_TQOBJECT(this), TQT_SLOT(zoomIn()), actionCollection()); _zoomOutAction = - KStdAction::zoomOut(this, TQT_SLOT(zoomOut()), actionCollection()); + KStdAction::zoomOut(TQT_TQOBJECT(this), TQT_SLOT(zoomOut()), actionCollection()); _menu = - KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); + KStdAction::showMenubar(TQT_TQOBJECT(this), TQT_SLOT(toggleMenubar()), actionCollection()); } void KZoomMainWindow::init(const char *popupName) @@ -58,7 +58,7 @@ void KZoomMainWindow::init(const char *popupName) void KZoomMainWindow::addWidget(TQWidget *widget) { widget->adjustSize(); - TQWidget *tlw = widget->topLevelWidget(); + TQWidget *tlw = widget->tqtopLevelWidget(); KZoomMainWindow *zm = static_cast(tlw->qt_cast("KZoomMainWindow")); Q_ASSERT(zm); @@ -74,7 +74,7 @@ void KZoomMainWindow::widgetDestroyed() bool KZoomMainWindow::eventFilter(TQObject *o, TQEvent *e) { if ( e->type()==TQEvent::LayoutHint ) - setFixedSize(minimumSize()); // because K/QMainWindow + setFixedSize(tqminimumSize()); // because K/TQMainWindow // does not manage fixed central widget // with hidden menubar... return KMainWindow::eventFilter(o, e); diff --git a/kmines/kzoommainwindow.h b/kmines/kzoommainwindow.h index d5c80bd4..e4353c2d 100644 --- a/kmines/kzoommainwindow.h +++ b/kmines/kzoommainwindow.h @@ -42,6 +42,7 @@ class KToggleAction; class KZoomMainWindow : public KMainWindow { Q_OBJECT + TQ_OBJECT public: /** Constructor. */ KZoomMainWindow(uint minZoom, uint maxZoom, uint zoomStep, @@ -49,7 +50,7 @@ public: /** Add a widget to be managed i.e. the adjustSize() method of the * widget is called whenever the zoom is changed. - * This function assumes that the topLevelWidget() is the KZoomMainWindow. + * This function assumes that the tqtopLevelWidget() is the KZoomMainWindow. */ static void addWidget(TQWidget *widget); diff --git a/kmines/main.cpp b/kmines/main.cpp index 6752e7a5..cead0eab 100644 --- a/kmines/main.cpp +++ b/kmines/main.cpp @@ -62,34 +62,34 @@ MainWidget::MainWidget() { KNotifyClient::startDaemon(); - _status = new Status(this); + _status = new tqStatus(this); 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, TQT_SLOT(restartGame()), actionCollection()); - _pause = KStdGameAction::pause(_status, TQT_SLOT(pauseGame()), + KStdGameAction::gameNew(TQT_TQOBJECT(_status), TQT_SLOT(restartGame()), actionCollection()); + _pause = KStdGameAction::pause(TQT_TQOBJECT(_status), TQT_SLOT(pauseGame()), actionCollection()); - KStdGameAction::highscores(this, TQT_SLOT(showHighscores()), + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighscores()), actionCollection()); - KStdGameAction::quit(qApp, TQT_SLOT(quit()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(tqApp), TQT_SLOT(quit()), actionCollection()); // keyboard _keybCollection = new KActionCollection(this); for (uint i=0; isetItems(list); - connect(_levels, TQT_SIGNAL(activated(int)), _status, TQT_SLOT(newGame(int))); + connect(_levels, TQT_SIGNAL(activated(int)), TQT_TQOBJECT(_status), TQT_SLOT(newGame(int))); // Adviser _advise = - 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()), + KStdGameAction::hint(TQT_TQOBJECT(_status), TQT_SLOT(advise()), actionCollection()); + _solve = KStdGameAction::solve(TQT_TQOBJECT(_status), TQT_SLOT(solve()), actionCollection()); + (void)new KAction(i18n("Solving Rate..."), 0, TQT_TQOBJECT(_status), TQT_SLOT(solveRate()), actionCollection(), "solve_rate"); // Log (void)new KAction(KGuiItem(i18n("View Log"), "viewmag"), 0, - _status, TQT_SLOT(viewLog()), + TQT_TQOBJECT(_status), TQT_SLOT(viewLog()), actionCollection(), "log_view"); (void)new KAction(KGuiItem(i18n("Replay Log"), "player_play"), - 0, _status, TQT_SLOT(replayLog()), + 0, TQT_TQOBJECT(_status), TQT_SLOT(replayLog()), actionCollection(), "log_replay"); (void)new KAction(KGuiItem(i18n("Save Log..."), "filesave"), 0, - _status, TQT_SLOT(saveLog()), + TQT_TQOBJECT(_status), TQT_SLOT(saveLog()), actionCollection(), "log_save"); (void)new KAction(KGuiItem(i18n("Load Log..."), "fileopen"), 0, - _status, TQT_SLOT(loadLog()), + TQT_TQOBJECT(_status), TQT_SLOT(loadLog()), actionCollection(), "log_load"); setupGUI( KMainWindow::Save | Create ); diff --git a/kmines/main.h b/kmines/main.h index 8cae018a..7fb10eda 100644 --- a/kmines/main.h +++ b/kmines/main.h @@ -26,11 +26,12 @@ class KAction; class KToggleAction; class KSelectAction; -class Status; +class tqStatus; class MainWidget : public KZoomMainWindow, public KMines { Q_OBJECT + TQ_OBJECT public: MainWidget(); @@ -49,7 +50,7 @@ class MainWidget : public KZoomMainWindow, public KMines virtual bool queryExit(); private: - Status *_status; + tqStatus *_status; KToggleAction *_pause; KSelectAction *_levels; KAction *_advise, *_solve; @@ -57,7 +58,7 @@ class MainWidget : public KZoomMainWindow, public KMines struct KeyData { const char *label, *name; - Qt::Key keycode; + TQt::Key keycode; const char *slot; }; enum Key { NB_KEYS = 11 }; diff --git a/kmines/solver/advFastRules.cpp b/kmines/solver/advFastRules.cpp index 79c42bba..56b97b72 100644 --- a/kmines/solver/advFastRules.cpp +++ b/kmines/solver/advFastRules.cpp @@ -159,9 +159,9 @@ void AdviseFast::RuleSet::addGeneral(Coord p){ int AdviseFast::Rule::leaks = 0; #endif -AdviseFast::Rule::Rule(RuleSet *parent) : - _parent(parent), - _facts(parent->facts) +AdviseFast::Rule::Rule(RuleSet *tqparent) : + _parent(tqparent), + _facts(tqparent->facts) { #if defined(DEBUG) && DEBUG >= 2 cout << "Rule::Rule, leaks = " << ++leaks << endl; @@ -177,8 +177,8 @@ AdviseFast::Rule::~Rule() AdviseFast::GeneralRule::GeneralRule( Coord fact, - RuleSet *parent) : - Rule(parent), + RuleSet *tqparent) : + Rule(tqparent), _fact(fact) {} @@ -242,8 +242,8 @@ bool AdviseFast::GeneralRule::apply(CoordSet *) AdviseFast::EmptyRule::EmptyRule( Coord fact, - RuleSet *parent) : - Rule(parent), + RuleSet *tqparent) : + Rule(tqparent), _fact(fact) {} @@ -285,8 +285,8 @@ bool AdviseFast::EmptyRule::apply( AdviseFast::FullRule::FullRule( Coord fact, - RuleSet *parent) : - Rule(parent), + RuleSet *tqparent) : + Rule(tqparent), _fact(fact) {} @@ -336,8 +336,8 @@ bool AdviseFast::FullRule::apply( AdviseFast::InclusionRule::InclusionRule( Coord bigger, Coord smaller, - RuleSet *parent) : - Rule(parent), + RuleSet *tqparent) : + Rule(tqparent), _bigger(bigger), _smaller(smaller) {} @@ -402,8 +402,8 @@ bool AdviseFast::InclusionRule::apply( AdviseFast::IntersectionRule::IntersectionRule( Coord bigger, Coord smaller, - RuleSet *parent) : - Rule(parent), + RuleSet *tqparent) : + Rule(tqparent), _bigger(bigger), _smaller(smaller) {} diff --git a/kmines/solver/headerP.h b/kmines/solver/headerP.h index 984e3113..6cecd458 100644 --- a/kmines/solver/headerP.h +++ b/kmines/solver/headerP.h @@ -107,7 +107,7 @@ namespace AdviseFast { */ class RuleSet; struct Rule { - Rule(RuleSet *parent); + Rule(RuleSet *tqparent); virtual ~Rule(); virtual bool apply(CoordSet *surePoints) = 0; diff --git a/kmines/solver/solver.cpp b/kmines/solver/solver.cpp index f8607b79..36519043 100644 --- a/kmines/solver/solver.cpp +++ b/kmines/solver/solver.cpp @@ -50,8 +50,8 @@ class SolverPrivate #endif }; -Solver::Solver(TQObject *parent) - : TQObject(parent) +Solver::Solver(TQObject *tqparent) + : TQObject(tqparent) { d = new SolverPrivate; @@ -186,9 +186,9 @@ bool Solver::solveOneStep(BaseField &field) //----------------------------------------------------------------------------- -SolvingRateDialog::SolvingRateDialog(const BaseField &field, TQWidget *parent) +SolvingRateDialog::SolvingRateDialog(const BaseField &field, TQWidget *tqparent) : KDialogBase(Plain, i18n("Compute Solving Rate"), Ok|Close, - Close, parent, "compute_solving_rate", true, true), + Close, tqparent, "compute_solving_rate", true, true), _refField(field) { connect(&_solver, TQT_SIGNAL(solvingDone(bool)), TQT_SLOT(solvingDone(bool))); @@ -198,13 +198,13 @@ SolvingRateDialog::SolvingRateDialog(const BaseField &field, TQWidget *parent) setButtonOK(item); TQVBoxLayout *top = new TQVBoxLayout(plainPage(), 0, spacingHint()); - TQLabel *label = new TQLabel(i18n("Width: %1").arg(field.width()), + TQLabel *label = new TQLabel(i18n("Width: %1").tqarg(field.width()), plainPage()); top->addWidget(label); - label = new TQLabel(i18n("Height: %1").arg(field.height()), plainPage()); + label = new TQLabel(i18n("Height: %1").tqarg(field.height()), plainPage()); top->addWidget(label); - label = new TQLabel(i18n("Mines: %1 (%2%)").arg(field.nbMines()) - .arg( field.nbMines() * 100.0 / field.size()), + label = new TQLabel(i18n("Mines: %1 (%2%)").tqarg(field.nbMines()) + .tqarg( field.nbMines() * 100.0 / field.size()), plainPage()); top->addWidget(label); @@ -243,7 +243,7 @@ void SolvingRateDialog::solvingDone(bool success) { if (success) _success++; _label->setText(i18n("Success rate: %1%") - .arg(_success * 100.0 / _i, 0, 'f', 3)); + .tqarg(_success * 100.0 / _i, 0, 'f', 3)); _progress->advance(1); TQTimer::singleShot(0, this, TQT_SLOT(step())); } diff --git a/kmines/solver/solver.h b/kmines/solver/solver.h index c90c56d1..07b8881a 100644 --- a/kmines/solver/solver.h +++ b/kmines/solver/solver.h @@ -29,11 +29,12 @@ class TQLabel; class KProgress; class SolverPrivate; -class Solver : public QObject +class Solver : public TQObject { Q_OBJECT + TQ_OBJECT public: - Solver(TQObject *parent = 0); + Solver(TQObject *tqparent = 0); ~Solver(); /** A method to advice a point placement */ @@ -62,8 +63,9 @@ class Solver : public QObject class SolvingRateDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - SolvingRateDialog(const BaseField &field, TQWidget *parent); + SolvingRateDialog(const BaseField &field, TQWidget *tqparent); private slots: void step(); diff --git a/kmines/status.cpp b/kmines/status.cpp index ec9dfc3e..6d20bf97 100644 --- a/kmines/status.cpp +++ b/kmines/status.cpp @@ -45,16 +45,16 @@ #include "version.h" -Status::Status(TQWidget *parent) - : TQWidget(parent, "status"), _oldLevel(Level::Easy) +tqStatus::tqStatus(TQWidget *tqparent) + : TQWidget(tqparent, "status"), _oldLevel(Level::Easy) { _timer = new TQTimer(this); connect(_timer, TQT_SIGNAL(timeout()), TQT_SLOT(replayStep())); - _solver = new Solver(this); + _solver = new Solver(TQT_TQOBJECT(this)); connect(_solver, TQT_SIGNAL(solvingDone(bool)), TQT_SLOT(solvingDone(bool))); -// top layout +// top tqlayout TQGridLayout *top = new TQGridLayout(this, 2, 5, 10, 10); top->setColStretch(1, 1); top->setColStretch(3, 1); @@ -74,7 +74,7 @@ Status::Status(TQWidget *parent) // smiley smiley = new Smiley(this); connect(smiley, TQT_SIGNAL(clicked()), TQT_SLOT(smileyClicked())); - smiley->setFocusPolicy(TQWidget::NoFocus); + smiley->setFocusPolicy(TQ_NoFocus); TQWhatsThis::add(smiley, i18n("Press to start a new game")); top->addWidget(smiley, 0, 2); @@ -93,7 +93,7 @@ Status::Status(TQWidget *parent) _field = new Field(_fieldContainer); _field->readSettings(); g->addWidget(_field, 0, 0, AlignCenter); - connect( _field, TQT_SIGNAL(updateStatus(bool)), TQT_SLOT(updateStatus(bool)) ); + connect( _field, TQT_SIGNAL(updatetqStatus(bool)), TQT_SLOT(updatetqStatus(bool)) ); connect(_field, TQT_SIGNAL(gameStateChanged(GameState)), TQT_SLOT(gameStateChangedSlot(GameState)) ); connect(_field, TQT_SIGNAL(setMood(Mood)), smiley, TQT_SLOT(setMood(Mood))); @@ -120,13 +120,13 @@ Status::Status(TQWidget *parent) top->addMultiCellWidget(_stack, 1, 1, 0, 4); } -void Status::smileyClicked() +void tqStatus::smileyClicked() { if ( _field->gameState()==Paused ) emit pause(); else restartGame(); } -void Status::newGame(int t) +void tqStatus::newGame(int t) { if ( _field->gameState()==Paused ) emit pause(); Level::Type type = (Level::Type)t; @@ -135,7 +135,7 @@ void Status::newGame(int t) else newGame( Settings::customLevel() ); } -void Status::newGame(const Level &level) +void tqStatus::newGame(const Level &level) { _timer->stop(); if ( level.type()!=Level::Custom ) @@ -143,14 +143,14 @@ void Status::newGame(const Level &level) _field->setLevel(level); } -bool Status::checkBlackMark() +bool tqStatus::checkBlackMark() { bool bm = ( _field->gameState()==Playing ); if (bm) KExtHighscore::submitScore(KExtHighscore::Lost, this); return bm; } -void Status::restartGame() +void tqStatus::restartGame() { if ( _field->gameState()==Paused ) emit pause(); else if ( _field->gameState()==Replaying ) { @@ -162,7 +162,7 @@ void Status::restartGame() } } -void Status::settingsChanged() +void tqStatus::settingsChanged() { _field->readSettings(); @@ -173,7 +173,7 @@ void Status::settingsChanged() newGame(l); } -void Status::updateStatus(bool mine) +void tqStatus::updatetqStatus(bool mine) { int r = _field->nbMines() - _field->nbMarked(); TQColor color = (r<0 && !_field->isSolved() ? red : white); @@ -184,7 +184,7 @@ void Status::updateStatus(bool mine) gameStateChanged(GameOver, true); // ends only for wins } -void Status::setGameOver(bool won) +void tqStatus::setGameOver(bool won) { if ( !won ) KNotifyClient::event(winId(), "explosion", i18n("Explosion!")); @@ -218,16 +218,16 @@ void Status::setGameOver(bool won) f.appendChild(data); } -void Status::setStopped() +void tqStatus::setStopped() { smiley->setMood(Normal); - updateStatus(false); + updatetqStatus(false); bool custom = ( _field->level().type()==Level::Custom ); dg->reset(custom); _field->setSolvingState(Regular); } -void Status::setPlaying() +void tqStatus::setPlaying() { smiley->setMood(Normal); dg->start(); @@ -238,7 +238,7 @@ void Status::setPlaying() _log = TQDomDocument("kmineslog"); _logRoot = _log.createElement("kmineslog"); _logRoot.setAttribute("version", SHORT_VERSION); - TQDateTime date = TQDateTime::currentDateTime(); + TQDateTime date = TQDateTime::tqcurrentDateTime(); _logRoot.setAttribute("date", date.toString(Qt::ISODate)); _logRoot.setAttribute("width", level.width()); _logRoot.setAttribute("height", level.height()); @@ -248,7 +248,7 @@ void Status::setPlaying() _logRoot.appendChild(_logList); } -void Status::gameStateChanged(GameState state, bool won) +void tqStatus::gameStateChanged(GameState state, bool won) { TQWidget *w = _fieldContainer; @@ -280,7 +280,7 @@ void Status::gameStateChanged(GameState state, bool won) emit gameStateChangedSignal(state); } -void Status::addAction(const KGrid2D::Coord &c, Field::ActionType type) +void tqStatus::addAction(const KGrid2D::Coord &c, Field::ActionType type) { TQDomElement action = _log.createElement("Action"); action.setAttribute("time", dg->pretty()); @@ -291,12 +291,12 @@ void Status::addAction(const KGrid2D::Coord &c, Field::ActionType type) dg->addAction(); } -void Status::advise() +void tqStatus::advise() { int res = KMessageBox::warningContinueCancel(this, i18n("When the solver gives " "you advice, your score will not be added to the highscores."), - TQString::null, TQString::null, "advice_warning"); + TQString(), TQString(), "advice_warning"); if ( res==KMessageBox::Cancel ) return; dg->setCheating(); float probability; @@ -304,25 +304,25 @@ void Status::advise() _field->setAdvised(c, probability); } -void Status::solve() +void tqStatus::solve() { dg->setCheating(); _solver->solve(*_field, false); _field->setSolvingState(Solved); } -void Status::solvingDone(bool success) +void tqStatus::solvingDone(bool success) { if ( !success ) gameStateChanged(GameOver, false); } -void Status::solveRate() +void tqStatus::solveRate() { SolvingRateDialog sd(*_field, this); sd.exec(); } -void Status::viewLog() +void tqStatus::viewLog() { KDialogBase d(this, "view_log", true, i18n("View Game Log"), KDialogBase::Close, KDialogBase::Close); @@ -335,9 +335,9 @@ void Status::viewLog() d.exec(); } -void Status::saveLog() +void tqStatus::saveLog() { - KURL url = KFileDialog::getSaveURL(TQString::null, TQString::null, this); + KURL url = KFileDialog::getSaveURL(TQString(), TQString(), this); if ( url.isEmpty() ) return; if ( KIO::NetAccess::exists(url, false, this) ) { KGuiItem gi = KStdGuiItem::save(); @@ -354,9 +354,9 @@ void Status::saveLog() tmp.unlink(); } -void Status::loadLog() +void tqStatus::loadLog() { - KURL url = KFileDialog::getOpenURL(TQString::null, TQString::null, this); + KURL url = KFileDialog::getOpenURL(TQString(), TQString(), this); if ( url.isEmpty() ) return; TQString tmpFile; bool success = false; @@ -368,7 +368,7 @@ void Status::loadLog() bool ok = doc.setContent(&file, 0, &errorLine); if ( !ok ) { KMessageBox::sorry(this, i18n("Cannot read XML file on line %1") - .arg(errorLine)); + .tqarg(errorLine)); return; } success = true; @@ -390,7 +390,7 @@ void Status::loadLog() } } -bool Status::checkLog(const TQDomDocument &doc) +bool tqStatus::checkLog(const TQDomDocument &doc) { // check root element if ( doc.doctype().name()!="kmineslog" ) return false; @@ -435,7 +435,7 @@ bool Status::checkLog(const TQDomDocument &doc) } -void Status::replayLog() +void tqStatus::replayLog() { uint w = _logRoot.attribute("width").toUInt(); uint h = _logRoot.attribute("height").toUInt(); @@ -454,7 +454,7 @@ void Status::replayLog() _timer->start(500); } -void Status::replayStep() +void tqStatus::replayStep() { if ( _index>=_actions.count() ) { _timer->stop(); diff --git a/kmines/status.h b/kmines/status.h index c7d44b36..3626473a 100644 --- a/kmines/status.h +++ b/kmines/status.h @@ -30,11 +30,12 @@ class Solver; class TQWidgetStack; class TQTimer; -class Status : public TQWidget, public KMines +class tqStatus : public TQWidget, public KMines { Q_OBJECT + TQ_OBJECT public : - Status(TQWidget *parent); + tqStatus(TQWidget *tqparent); const Level ¤tLevel() const { return _field->level(); } bool isPlaying() const { return _field->gameState()==Playing; } @@ -50,7 +51,7 @@ class Status : public TQWidget, public KMines public slots: void newGame(int type); void restartGame(); - void updateStatus(bool); + void updatetqStatus(bool); void pauseGame() { _field->pause(); } void moveUp() { _field->moveCursor(KGrid2D::SquareBase::Up); } diff --git a/knetwalk/src/cell.cpp b/knetwalk/src/cell.cpp index a08b0d78..7df96806 100644 --- a/knetwalk/src/cell.cpp +++ b/knetwalk/src/cell.cpp @@ -52,16 +52,16 @@ void Cell::initPixmaps() TQImage image = connectedpixmap[it.key()]->convertToImage(); for(int y = 0; y < image.height(); y++) { - QRgb* line = (QRgb*)image.scanLine(y); + TQRgb* line = (TQRgb*)image.scanLine(y); for(int x = 0; x < image.width(); x++) { - QRgb pix = line[x]; - if(qAlpha(pix) == 255) + TQRgb pix = line[x]; + if(tqAlpha(pix) == 255) { - int g = (255 + 4 * qGreen(pix)) / 5; - int b = (255 + 4 * qBlue(pix)) / 5; - int r = (255 + 4 * qRed(pix)) / 5; - line[x] = qRgb(r, g, b); + int g = (255 + 4 * tqGreen(pix)) / 5; + int b = (255 + 4 * tqBlue(pix)) / 5; + int r = (255 + 4 * tqRed(pix)) / 5; + line[x] = tqRgb(r, g, b); } } } @@ -69,7 +69,7 @@ void Cell::initPixmaps() } } -Cell::Cell(TQWidget* parent, int i) : TQWidget(parent, 0, WNoAutoErase) +Cell::Cell(TQWidget* tqparent, int i) : TQWidget(tqparent, 0, WNoAutoErase) { angle = 0; light = 0; @@ -203,11 +203,11 @@ void Cell::paintEvent(TQPaintEvent*) void Cell::mousePressEvent(TQMouseEvent* e) { - if(e->button() == LeftButton) + if(e->button() == Qt::LeftButton) emit lClicked(iindex); - else if(e->button() == RightButton) + else if(e->button() == Qt::RightButton) emit rClicked(iindex); - else if(e->button() == MidButton) + else if(e->button() == Qt::MidButton) emit mClicked(iindex); } diff --git a/knetwalk/src/cell.h b/knetwalk/src/cell.h index 8e51e349..f2423362 100644 --- a/knetwalk/src/cell.h +++ b/knetwalk/src/cell.h @@ -18,12 +18,13 @@ #include #include -class Cell : public QWidget +class Cell : public TQWidget { Q_OBJECT + TQ_OBJECT public: enum Dirs { Free = 0, U = 1, R = 2, D = 4, L = 8, None = 16 }; - Cell(TQWidget* parent, int i); + Cell(TQWidget* tqparent, int i); int index() const; void rotate(int a); void setDirs(Dirs d); diff --git a/knetwalk/src/highscores.cpp b/knetwalk/src/highscores.cpp index 4bcbf922..c0144002 100644 --- a/knetwalk/src/highscores.cpp +++ b/knetwalk/src/highscores.cpp @@ -34,7 +34,7 @@ namespace KExtHighscore TQMemArray s; s.duplicate(RANGE, 16); setScoreHistogram(s, ScoreNotBound); - //Item *item = new Item((uint)0, i18n("Clicks"), Qt::AlignRight); + //Item *item = new Item((uint)0, i18n("Clicks"), TQt::AlignRight); //addScoreItem("nb_actions", item); } @@ -47,7 +47,7 @@ namespace KExtHighscore case I18N: return i18n(level[gameType]); case WW: return data.wwLabel; } - return TQString::null;*/ + return TQString();*/ return i18n(levels[gameType]); } @@ -64,7 +64,7 @@ namespace KExtHighscore } KConfigGroupSaver cg(kapp->config(), group); - TQString name = cg.config()->readEntry("Name", TQString::null); + TQString name = cg.config()->readEntry("Name", TQString()); if ( name.isNull() ) return; if ( name.isEmpty() ) name = i18n("anonymous"); int score = cg.config()->readNumEntry("score", 0); diff --git a/knetwalk/src/mainwindow.cpp b/knetwalk/src/mainwindow.cpp index 17fa9b82..21de29c0 100644 --- a/knetwalk/src/mainwindow.cpp +++ b/knetwalk/src/mainwindow.cpp @@ -52,8 +52,8 @@ static TQMap contrdirs; -MainWindow::MainWindow(TQWidget *parent, const char* name, WFlags /*fl*/) : - KMainWindow(parent, name, WStyle_NoBorder) +MainWindow::MainWindow(TQWidget *tqparent, const char* name, WFlags /*fl*/) : + KMainWindow(tqparent, name, WStyle_NoBorder) { m_clickcount = 0; @@ -64,11 +64,11 @@ MainWindow::MainWindow(TQWidget *parent, const char* name, WFlags /*fl*/) : KNotifyClient::startDaemon(); - KStdGameAction::gameNew(this, TQT_SLOT(slotNewGame()), actionCollection()); + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(slotNewGame()), actionCollection()); - KStdGameAction::highscores(this, TQT_SLOT(showHighscores()), actionCollection()); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); - KStdGameAction::configureHighscores(this, TQT_SLOT(configureHighscores()), actionCollection()); + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighscores()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + KStdGameAction::configureHighscores(TQT_TQOBJECT(this), TQT_SLOT(configureHighscores()), actionCollection()); m_levels = KStdGameAction::chooseGameType(0, 0, actionCollection()); TQStringList lst; @@ -78,7 +78,7 @@ MainWindow::MainWindow(TQWidget *parent, const char* name, WFlags /*fl*/) : lst += i18n("Master"); m_levels->setItems(lst); - setFixedSize(minimumSizeHint()); + setFixedSize(tqminimumSizeHint()); statusBar()->insertItem("abcdefghijklmnopqrst: 0 ",1); setAutoSaveSettings(); @@ -149,7 +149,7 @@ void MainWindow::newGame(int sk) m_clickcount = 0; TQString clicks = i18n("Click: %1"); - statusBar()->changeItem(clicks.arg(TQString::number(m_clickcount)),1); + statusBar()->changeItem(clicks.tqarg(TQString::number(m_clickcount)),1); KNotifyClient::event(winId(), "startsound", i18n("New Game")); for(int i = 0; i < MasterBoardSize * MasterBoardSize; i++) @@ -370,7 +370,7 @@ void MainWindow::rotate(int index, bool toleft) m_clickcount++; TQString clicks = i18n("Click: %1"); - statusBar()->changeItem(clicks.arg(TQString::number(m_clickcount)),1); + statusBar()->changeItem(clicks.tqarg(TQString::number(m_clickcount)),1); if (isGameOver()) { diff --git a/knetwalk/src/mainwindow.h b/knetwalk/src/mainwindow.h index e88fab6a..40402930 100644 --- a/knetwalk/src/mainwindow.h +++ b/knetwalk/src/mainwindow.h @@ -27,8 +27,9 @@ class KSelectAction; class MainWindow : public KMainWindow { Q_OBJECT + TQ_OBJECT public: - MainWindow(TQWidget *parent=0, const char* name=0, WFlags fl=0); + MainWindow(TQWidget *tqparent=0, const char* name=0, WFlags fl=0); protected: virtual void closeEvent(TQCloseEvent*); private: diff --git a/kolf/ball.cpp b/kolf/ball.cpp index 9ac849bc..569a5ba2 100644 --- a/kolf/ball.cpp +++ b/kolf/ball.cpp @@ -33,7 +33,7 @@ Ball::Ball(TQCanvas *canvas) //font.setPixelSize(10); label = new TQCanvasText("", font, canvas); label->setColor(white); - label->setVisible(false); + label->tqsetVisible(false); // this sets z setState(Stopped); @@ -249,7 +249,7 @@ void Ball::collisionDetect(double oldx, double oldy) m_collisionLock = true; // move this ball to where it was barely touching double ballAngle = m_vector.direction(); - while (collisions(true).contains(item) > 0) + while (collisions(true).tqcontains(item) > 0) move(x() - cos(ballAngle) / 2.0, y() + sin(ballAngle) / 2.0); // make a 2 pixel separation @@ -308,10 +308,10 @@ void Ball::collisionDetect(double oldx, double oldy) for (iterpoint = points.first(); iterpoint; iterpoint = points.next()) { //kdDebug(12007) << "-----\n"; - const Wall *parentWall = iterpoint->parentWall(); - const TQPoint qp(iterpoint->x() + parentWall->x(), iterpoint->y() + parentWall->y()); + const Wall *tqparentWall = iterpoint->tqparentWall(); + const TQPoint qp(iterpoint->x() + tqparentWall->x(), iterpoint->y() + tqparentWall->y()); const Point p(qp.x(), qp.y()); - const TQPoint qother = TQPoint(parentWall->startPoint() == qp? parentWall->endPoint() : parentWall->startPoint()) + TQPoint(parentWall->x(), parentWall->y()); + const TQPoint qother = TQPoint(tqparentWall->startPoint() == qp? tqparentWall->endPoint() : tqparentWall->startPoint()) + TQPoint(tqparentWall->x(), tqparentWall->y()); const Point other(qother.x(), qother.y()); // vector of wall @@ -438,12 +438,12 @@ BallState Ball::currentState() void Ball::showInfo() { - label->setVisible(isVisible()); + label->tqsetVisible(isVisible()); } void Ball::hideInfo() { - label->setVisible(false); + label->tqsetVisible(false); } void Ball::setName(const TQString &name) @@ -459,8 +459,8 @@ void Ball::setCanvas(TQCanvas *c) void Ball::setVisible(bool yes) { - TQCanvasEllipse::setVisible(yes); + TQCanvasEllipse::tqsetVisible(yes); - label->setVisible(yes && game && game->isInfoShowing()); + label->tqsetVisible(yes && game && game->isInfoShowing()); } diff --git a/kolf/canvasitem.h b/kolf/canvasitem.h index ed897d27..277fb15d 100644 --- a/kolf/canvasitem.h +++ b/kolf/canvasitem.h @@ -113,7 +113,7 @@ public: */ virtual void clean() {}; /** - * scale factor changed (game->scaleFactor(), the world matrix is game->worldMatrix()) + * scale factor changed (game->scaleFactor(), the world matrix is game->tqworldMatrix()) * NOTE: not used in Kolf 1.1, which comes with KDE 3.1. */ virtual void scaleChanged() {}; @@ -125,7 +125,7 @@ public: * returns a Config that can be used to configure this item by the user. * The default implementation returns one that says 'No configuration options'. */ - virtual Config *config(TQWidget *parent) { return new DefaultConfig(parent); } + virtual Config *config(TQWidget *tqparent) { return new DefaultConfig(tqparent); } /** * returns other items that should be moveable (besides this one of course). */ diff --git a/kolf/config.cpp b/kolf/config.cpp index 7c333755..54618a45 100644 --- a/kolf/config.cpp +++ b/kolf/config.cpp @@ -6,8 +6,8 @@ #include "config.h" -Config::Config(TQWidget *parent, const char *name) - : TQFrame(parent, name) +Config::Config(TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name) { startedUp = false; } @@ -33,15 +33,15 @@ void Config::changed() emit modified(); } -MessageConfig::MessageConfig(TQString text, TQWidget *parent, const char *name) - : Config(parent, name) +MessageConfig::MessageConfig(TQString text, TQWidget *tqparent, const char *name) + : Config(tqparent, name) { - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); - layout->addWidget(new TQLabel(text, this)); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); + tqlayout->addWidget(new TQLabel(text, this)); } -DefaultConfig::DefaultConfig(TQWidget *parent, const char *name) - : MessageConfig(i18n("No configuration options"), parent, name) +DefaultConfig::DefaultConfig(TQWidget *tqparent, const char *name) + : MessageConfig(i18n("No configuration options"), tqparent, name) { } diff --git a/kolf/config.h b/kolf/config.h index 4e0f26a6..5ca9892f 100644 --- a/kolf/config.h +++ b/kolf/config.h @@ -3,12 +3,13 @@ #include -class Config : public QFrame +class Config : public TQFrame { Q_OBJECT + TQ_OBJECT public: - Config(TQWidget *parent, const char *name = 0); + Config(TQWidget *tqparent, const char *name = 0); void ctorDone(); signals: @@ -25,18 +26,20 @@ protected: class MessageConfig : public Config { Q_OBJECT + TQ_OBJECT public: - MessageConfig(TQString text, TQWidget *parent, const char *name = 0); + MessageConfig(TQString text, TQWidget *tqparent, const char *name = 0); }; // internal class DefaultConfig : public MessageConfig { Q_OBJECT + TQ_OBJECT public: - DefaultConfig(TQWidget *parent, const char *name = 0); + DefaultConfig(TQWidget *tqparent, const char *name = 0); }; #endif diff --git a/kolf/editor.cpp b/kolf/editor.cpp index ae9cde32..88e3c375 100644 --- a/kolf/editor.cpp +++ b/kolf/editor.cpp @@ -9,19 +9,19 @@ #include "editor.h" #include "game.h" -Editor::Editor(ObjectList *list, TQWidget *parent, const char *name) - : TQWidget(parent, name) +Editor::Editor(ObjectList *list, TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name) { this->list = list; config = 0; - hlayout = new TQHBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + htqlayout = new TQHBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - TQVBoxLayout *vlayout = new TQVBoxLayout(hlayout, KDialog::spacingHint()); - vlayout->addWidget(new TQLabel(i18n("Add object:"), this)); + TQVBoxLayout *vtqlayout = new TQVBoxLayout(htqlayout, KDialog::spacingHint()); + vtqlayout->addWidget(new TQLabel(i18n("Add object:"), this)); listbox = new KListBox(this, "Listbox"); - vlayout->addWidget(listbox); - hlayout->setStretchFactor(vlayout, 2); + vtqlayout->addWidget(listbox); + htqlayout->setStretchFactor(vtqlayout, 2); TQStringList items; Object *obj = 0; @@ -49,8 +49,8 @@ void Editor::setItem(CanvasItem *item) if (!config) return; config->ctorDone(); - hlayout->addWidget(config); - hlayout->setStretchFactor(config, 2); + htqlayout->addWidget(config); + htqlayout->setStretchFactor(config, 2); config->setFrameStyle(TQFrame::Box | TQFrame::Raised); config->setLineWidth(1); config->show(); diff --git a/kolf/editor.h b/kolf/editor.h index 1280772f..8ee1b93a 100644 --- a/kolf/editor.h +++ b/kolf/editor.h @@ -10,9 +10,10 @@ class TQHBoxLayout; class TQListBoxItem; class Config; -class Editor : public QWidget +class Editor : public TQWidget { Q_OBJECT + TQ_OBJECT public: Editor(ObjectList *list, TQWidget * = 0, const char * = 0); @@ -29,7 +30,7 @@ private slots: private: ObjectList *list; - TQHBoxLayout *hlayout; + TQHBoxLayout *htqlayout; KListBox *listbox; Config *config; }; diff --git a/kolf/floater.cpp b/kolf/floater.cpp index ff42398a..1d33a2ca 100644 --- a/kolf/floater.cpp +++ b/kolf/floater.cpp @@ -39,9 +39,9 @@ void FloaterGuide::setPoints(int xa, int ya, int xb, int yb) } } -Config *FloaterGuide::config(TQWidget *parent) +Config *FloaterGuide::config(TQWidget *tqparent) { - return floater->config(parent); + return floater->config(tqparent); } ///////////////////////// @@ -253,18 +253,18 @@ void Floater::firstMove(int x, int y) ///////////////////////// -FloaterConfig::FloaterConfig(Floater *floater, TQWidget *parent) - : BridgeConfig(floater, parent) +FloaterConfig::FloaterConfig(Floater *floater, TQWidget *tqparent) + : BridgeConfig(floater, tqparent) { this->floater = floater; - m_vlayout->addStretch(); + m_vtqlayout->addStretch(); - m_vlayout->addWidget(new TQLabel(i18n("Moving speed"), this)); - TQHBoxLayout *hlayout = new TQHBoxLayout(m_vlayout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Slow"), this)); + m_vtqlayout->addWidget(new TQLabel(i18n("Moving speed"), this)); + TQHBoxLayout *htqlayout = new TQHBoxLayout(m_vtqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Slow"), this)); TQSlider *slider = new TQSlider(0, 20, 2, floater->curSpeed(), Qt::Horizontal, this); - hlayout->addWidget(slider); - hlayout->addWidget(new TQLabel(i18n("Fast"), this)); + htqlayout->addWidget(slider); + htqlayout->addWidget(new TQLabel(i18n("Fast"), this)); connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(speedChanged(int))); } diff --git a/kolf/floater.h b/kolf/floater.h index c22a8084..fbbe10ec 100644 --- a/kolf/floater.h +++ b/kolf/floater.h @@ -7,9 +7,10 @@ class Floater; class FloaterConfig : public BridgeConfig { Q_OBJECT + TQ_OBJECT public: - FloaterConfig(Floater *floater, TQWidget *parent); + FloaterConfig(Floater *floater, TQWidget *tqparent); private slots: void speedChanged(int news); @@ -24,7 +25,7 @@ public: FloaterGuide(Floater *floater, TQCanvas *canvas) : Wall(canvas) { this->floater = floater; almostDead = false; } virtual void setPoints(int xa, int ya, int xb, int yb); virtual void moveBy(double dx, double dy); - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); virtual void aboutToDelete(); virtual void aboutToDie(); @@ -51,7 +52,7 @@ public: virtual void editModeChanged(bool changed); virtual bool moveable() const { return false; } virtual void moveBy(double dx, double dy); - virtual Config *config(TQWidget *parent) { return new FloaterConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new FloaterConfig(this, tqparent); } virtual TQPtrList moveableItems() const; virtual void advance(int phase); void setSpeed(int news); diff --git a/kolf/game.cpp b/kolf/game.cpp index d76ec2bc..1a7bfe4d 100644 --- a/kolf/game.cpp +++ b/kolf/game.cpp @@ -58,12 +58,12 @@ inline TQString makeGroup(int id, int hole, TQString name, int x, int y) { - return TQString("%1-%2@%3,%4|%5").arg(hole).arg(name).arg(x).arg(y).arg(id); + return TQString("%1-%2@%3,%4|%5").tqarg(hole).tqarg(name).tqarg(x).tqarg(y).tqarg(id); } inline TQString makeStateGroup(int id, const TQString &name) { - return TQString("%1|%2").arg(name).arg(id); + return TQString("%1|%2").tqarg(name).tqarg(id); } ///////////////////////// @@ -101,13 +101,13 @@ void RectPoint::moveBy(double dx, double dy) rect->newSize(nw, nh); } -Config *RectPoint::config(TQWidget *parent) +Config *RectPoint::config(TQWidget *tqparent) { CanvasItem *citem = dynamic_cast(rect); if (citem) - return citem->config(parent); + return citem->config(tqparent); else - return CanvasItem::config(parent); + return CanvasItem::config(tqparent); } ///////////////////////// @@ -144,9 +144,9 @@ void Arrow::setZ(double newz) void Arrow::setVisible(bool yes) { - TQCanvasLine::setVisible(yes); - line1->setVisible(yes); - line2->setVisible(yes); + TQCanvasLine::tqsetVisible(yes); + line1->tqsetVisible(yes); + line2->tqsetVisible(yes); } void Arrow::moveBy(double dx, double dy) @@ -192,28 +192,28 @@ void Arrow::updateSelf() ///////////////////////// -BridgeConfig::BridgeConfig(Bridge *bridge, TQWidget *parent) - : Config(parent) +BridgeConfig::BridgeConfig(Bridge *bridge, TQWidget *tqparent) + : Config(tqparent) { this->bridge = bridge; - m_vlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); - TQGridLayout *layout = new TQGridLayout(m_vlayout, 2, 3, spacingHint()); - layout->addWidget(new TQLabel(i18n("Walls on:"), this), 0, 0); + m_vtqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); + TQGridLayout *tqlayout = new TQGridLayout(m_vtqlayout, 2, 3, spacingHint()); + tqlayout->addWidget(new TQLabel(i18n("Walls on:"), this), 0, 0); top = new TQCheckBox(i18n("&Top"), this); - layout->addWidget(top, 0, 1); + tqlayout->addWidget(top, 0, 1); connect(top, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(topWallChanged(bool))); top->setChecked(bridge->topWallVisible()); bot = new TQCheckBox(i18n("&Bottom"), this); - layout->addWidget(bot, 1, 1); + tqlayout->addWidget(bot, 1, 1); connect(bot, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(botWallChanged(bool))); bot->setChecked(bridge->botWallVisible()); left = new TQCheckBox(i18n("&Left"), this); - layout->addWidget(left, 1, 0); + tqlayout->addWidget(left, 1, 0); connect(left, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(leftWallChanged(bool))); left->setChecked(bridge->leftWallVisible()); right = new TQCheckBox(i18n("&Right"), this); - layout->addWidget(right, 1, 2); + tqlayout->addWidget(right, 1, 2); connect(right, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(rightWallChanged(bool))); right->setChecked(bridge->rightWallVisible()); } @@ -249,7 +249,7 @@ Bridge::Bridge(TQRect rect, TQCanvas *canvas) { TQColor color("#92772D"); setBrush(TQBrush(color)); - setPen(NoPen); + setPen(Qt::NoPen); setZ(998); topWall = new Wall(canvas); @@ -264,10 +264,10 @@ Bridge::Bridge(TQRect rect, TQCanvas *canvas) setWallZ(z() + 0.01); setWallColor(color); - topWall->setVisible(false); - botWall->setVisible(false); - leftWall->setVisible(false); - rightWall->setVisible(false); + topWall->tqsetVisible(false); + botWall->tqsetVisible(false); + leftWall->tqsetVisible(false); + rightWall->tqsetVisible(false); point = new RectPoint(color, this, canvas); editModeChanged(false); @@ -321,7 +321,7 @@ void Bridge::aboutToDie() void Bridge::editModeChanged(bool changed) { - point->setVisible(changed); + point->tqsetVisible(changed); moveBy(0, 0); } @@ -401,22 +401,22 @@ void Bridge::setSize(int width, int height) ///////////////////////// -WindmillConfig::WindmillConfig(Windmill *windmill, TQWidget *parent) - : BridgeConfig(windmill, parent) +WindmillConfig::WindmillConfig(Windmill *windmill, TQWidget *tqparent) + : BridgeConfig(windmill, tqparent) { this->windmill = windmill; - m_vlayout->addStretch(); + m_vtqlayout->addStretch(); TQCheckBox *check = new TQCheckBox(i18n("Windmill on bottom"), this); check->setChecked(windmill->bottom()); connect(check, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(endChanged(bool))); - m_vlayout->addWidget(check); + m_vtqlayout->addWidget(check); - TQHBoxLayout *hlayout = new TQHBoxLayout(m_vlayout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Slow"), this)); + TQHBoxLayout *htqlayout = new TQHBoxLayout(m_vtqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Slow"), this)); TQSlider *slider = new TQSlider(1, 10, 1, windmill->curSpeed(), Qt::Horizontal, this); - hlayout->addWidget(slider); - hlayout->addWidget(new TQLabel(i18n("Fast"), this)); + htqlayout->addWidget(slider); + htqlayout->addWidget(new TQLabel(i18n("Fast"), this)); connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(speedChanged(int))); endChanged(check->isChecked()); @@ -454,7 +454,7 @@ Windmill::Windmill(TQRect rect, TQCanvas *canvas) { guard = new WindmillGuard(canvas); guard->setPen(TQPen(black, 5)); - guard->setVisible(true); + guard->tqsetVisible(true); guard->setAlwaysShow(true); setSpeed(5); guard->setZ(wallZ() + .1); @@ -467,8 +467,8 @@ Windmill::Windmill(TQRect rect, TQCanvas *canvas) right->setAlwaysShow(true); left->setZ(wallZ()); right->setZ(wallZ()); - left->setVisible(true); - right->setVisible(true); + left->tqsetVisible(true); + right->tqsetVisible(true); setTopWallVisible(false); setBotWallVisible(false); @@ -629,24 +629,24 @@ void Sign::draw(TQPainter &painter) TQSimpleRichText txt(m_text, kapp->font()); const int indent = wallPen().width() + 3; txt.setWidth(width() - 2*indent); - TQColorGroup colorGroup; - colorGroup.setColor(TQColorGroup::Foreground, black); - colorGroup.setColor(TQColorGroup::Text, black); - colorGroup.setColor(TQColorGroup::Background, black); - colorGroup.setColor(TQColorGroup::Base, black); - txt.draw(&painter, x() + indent, y(), TQRect(x() + indent, y(), width() - indent, height() - indent), colorGroup); + TQColorGroup tqcolorGroup; + tqcolorGroup.setColor(TQColorGroup::Foreground, black); + tqcolorGroup.setColor(TQColorGroup::Text, black); + tqcolorGroup.setColor(TQColorGroup::Background, black); + tqcolorGroup.setColor(TQColorGroup::Base, black); + txt.draw(&painter, x() + indent, y(), TQRect(x() + indent, y(), width() - indent, height() - indent), tqcolorGroup); } ///////////////////////// -SignConfig::SignConfig(Sign *sign, TQWidget *parent) - : BridgeConfig(sign, parent) +SignConfig::SignConfig(Sign *sign, TQWidget *tqparent) + : BridgeConfig(sign, tqparent) { this->sign = sign; - m_vlayout->addStretch(); - m_vlayout->addWidget(new TQLabel(i18n("Sign HTML:"), this)); + m_vtqlayout->addStretch(); + m_vtqlayout->addWidget(new TQLabel(i18n("Sign HTML:"), this)); KLineEdit *name = new KLineEdit(sign->text(), this); - m_vlayout->addWidget(name); + m_vtqlayout->addWidget(name); connect(name, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(textChanged(const TQString &))); } @@ -658,25 +658,25 @@ void SignConfig::textChanged(const TQString &text) ///////////////////////// -EllipseConfig::EllipseConfig(Ellipse *ellipse, TQWidget *parent) - : Config(parent), slow1(0), fast1(0), slow2(0), fast2(0), slider1(0), slider2(0) +EllipseConfig::EllipseConfig(Ellipse *ellipse, TQWidget *tqparent) + : Config(tqparent), slow1(0), fast1(0), slow2(0), fast2(0), slider1(0), slider2(0) { this->ellipse = ellipse; - m_vlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); + m_vtqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); TQCheckBox *check = new TQCheckBox(i18n("Enable show/hide"), this); - m_vlayout->addWidget(check); + m_vtqlayout->addWidget(check); connect(check, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(check1Changed(bool))); check->setChecked(ellipse->changeEnabled()); - TQHBoxLayout *hlayout = new TQHBoxLayout(m_vlayout, spacingHint()); + TQHBoxLayout *htqlayout = new TQHBoxLayout(m_vtqlayout, spacingHint()); slow1 = new TQLabel(i18n("Slow"), this); - hlayout->addWidget(slow1); + htqlayout->addWidget(slow1); slider1 = new TQSlider(1, 100, 5, 100 - ellipse->changeEvery(), Qt::Horizontal, this); - hlayout->addWidget(slider1); + htqlayout->addWidget(slider1); fast1 = new TQLabel(i18n("Fast"), this); - hlayout->addWidget(fast1); + htqlayout->addWidget(fast1); connect(slider1, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(value1Changed(int))); @@ -684,7 +684,7 @@ EllipseConfig::EllipseConfig(Ellipse *ellipse, TQWidget *parent) // TODO add slider2 and friends and make it possible for ellipses to grow and contract - m_vlayout->addStretch(); + m_vtqlayout->addStretch(); } void EllipseConfig::value1Changed(int news) @@ -733,7 +733,7 @@ Ellipse::Ellipse(TQCanvas *canvas) setChangeEnabled(false); setChangeEvery(50); count = 0; - setVisible(true); + tqsetVisible(true); point = new RectPoint(black, this, canvas); point->setSizeFactor(2.0); @@ -750,7 +750,7 @@ void Ellipse::setChangeEnabled(bool changeEnabled) setAnimated(m_changeEnabled); if (!m_changeEnabled) - setVisible(true); + tqsetVisible(true); } TQPtrList Ellipse::moveableItems() const @@ -775,7 +775,7 @@ void Ellipse::moveBy(double dx, double dy) void Ellipse::editModeChanged(bool changed) { - point->setVisible(changed); + point->tqsetVisible(changed); moveBy(0, 0); } @@ -788,7 +788,7 @@ void Ellipse::advance(int phase) if (count > (m_changeEvery + 10) * 1.8) count = 0; if (count == 0) - setVisible(!isVisible()); + tqsetVisible(!isVisible()); count++; } @@ -812,14 +812,14 @@ void Ellipse::save(KConfig *cfg) cfg->writeEntry("height", height()); } -Config *Ellipse::config(TQWidget *parent) +Config *Ellipse::config(TQWidget *tqparent) { - return new EllipseConfig(this, parent); + return new EllipseConfig(this, tqparent); } void Ellipse::aboutToSave() { - setVisible(true); + tqsetVisible(true); dontHide = true; } @@ -838,7 +838,7 @@ Puddle::Puddle(TQCanvas *canvas) TQBrush brush; TQPixmap pic; - if (!TQPixmapCache::find("puddle", pic)) + if (!TQPixmapCache::tqfind("puddle", pic)) { pic.load(locate("appdata", "pics/puddle.png")); TQPixmapCache::insert("puddle", pic); @@ -860,7 +860,7 @@ bool Puddle::collision(Ball *ball, long int /*id*/) if (ball->isVisible()) { TQCanvasRectangle i(TQRect(ball->x(), ball->y(), 1, 1), canvas()); - i.setVisible(true); + i.tqsetVisible(true); // is center of ball in? if (i.collidesWith(this)/* && ball->curVector().magnitude() < 4*/) @@ -868,7 +868,7 @@ bool Puddle::collision(Ball *ball, long int /*id*/) playSound("puddle"); ball->setAddStroke(ball->addStroke() + 1); ball->setPlaceOnGround(true); - ball->setVisible(false); + ball->tqsetVisible(false); ball->setState(Stopped); ball->setVelocity(0, 0); if (game && game->curBall() == ball) @@ -891,7 +891,7 @@ Sand::Sand(TQCanvas *canvas) TQBrush brush; TQPixmap pic; - if (!TQPixmapCache::find("sand", pic)) + if (!TQPixmapCache::tqfind("sand", pic)) { pic.load(locate("appdata", "pics/sand.png")); TQPixmapCache::insert("sand", pic); @@ -911,7 +911,7 @@ Sand::Sand(TQCanvas *canvas) bool Sand::collision(Ball *ball, long int /*id*/) { TQCanvasRectangle i(TQRect(ball->x(), ball->y(), 1, 1), canvas()); - i.setVisible(true); + i.tqsetVisible(true); // is center of ball in? if (i.collidesWith(this)/* && ball->curVector().magnitude() < 4*/) @@ -954,12 +954,12 @@ Putter::Putter(TQCanvas *canvas) void Putter::showInfo() { - guideLine->setVisible(isVisible()); + guideLine->tqsetVisible(isVisible()); } void Putter::hideInfo() { - guideLine->setVisible(m_showGuideLine? isVisible() : false); + guideLine->tqsetVisible(m_showGuideLine? isVisible() : false); } void Putter::moveBy(double dx, double dy) @@ -976,8 +976,8 @@ void Putter::setShowGuideLine(bool yes) void Putter::setVisible(bool yes) { - TQCanvasLine::setVisible(yes); - guideLine->setVisible(m_showGuideLine? yes : false); + TQCanvasLine::tqsetVisible(yes); + guideLine->tqsetVisible(m_showGuideLine? yes : false); } void Putter::setOrigin(int _x, int _y) @@ -990,7 +990,7 @@ void Putter::setOrigin(int _x, int _y) void Putter::setAngle(Ball *ball) { - angle = angleMap.contains(ball)? angleMap[ball] : 0; + angle = angleMap.tqcontains(ball)? angleMap[ball] : 0; finishMe(); } @@ -1002,11 +1002,11 @@ void Putter::go(Direction d, Amount amount) { case Forwards: len -= 1; - guideLine->setVisible(false); + guideLine->tqsetVisible(false); break; case Backwards: len += 1; - guideLine->setVisible(false); + guideLine->tqsetVisible(false); break; case D_Left: angle += addition; @@ -1085,7 +1085,7 @@ void Bumper::moveBy(double dx, double dy) void Bumper::editModeChanged(bool changed) { - inside->setVisible(!changed); + inside->tqsetVisible(!changed); } void Bumper::advance(int phase) @@ -1166,7 +1166,7 @@ HoleResult Hole::result(TQPoint p, double s, bool * /*wasCenter*/) return Result_Miss; TQCanvasRectangle i(TQRect(p, TQSize(1, 1)), canvas()); - i.setVisible(true); + i.tqsetVisible(true); // is center of ball in cup? if (i.collidesWith(this)) @@ -1182,7 +1182,7 @@ HoleResult Hole::result(TQPoint p, double s, bool * /*wasCenter*/) Cup::Cup(TQCanvas *canvas) : Hole(TQColor("#808080"), canvas) { - if (!TQPixmapCache::find("cup", pixmap)) + if (!TQPixmapCache::tqfind("cup", pixmap)) { pixmap.load(locate("appdata", "pics/cup.png")); TQPixmapCache::insert("cup", pixmap); @@ -1222,7 +1222,7 @@ BlackHole::BlackHole(TQCanvas *canvas) m_maxSpeed = 5.0; runs = 0; - const TQColor myColor((QRgb)(kapp->random() % 0x01000000)); + const TQColor myColor((TQRgb)(kapp->random() % 0x01000000)); outside = new TQCanvasEllipse(canvas); outside->setZ(z() - .001); @@ -1238,7 +1238,7 @@ BlackHole::BlackHole(TQCanvas *canvas) setSize(width(), width() / .8); const float factor = 1.3; outside->setSize(width() * factor, height() * factor); - outside->setVisible(true); + outside->tqsetVisible(true); moveBy(0, 0); @@ -1249,7 +1249,7 @@ void BlackHole::showInfo() { delete infoLine; infoLine = new TQCanvasLine(canvas()); - infoLine->setVisible(true); + infoLine->tqsetVisible(true); infoLine->setPen(TQPen(exitItem->pen().color(), 2)); infoLine->setZ(10000); infoLine->setPoints(x(), y(), exitItem->x(), exitItem->y()); @@ -1277,7 +1277,7 @@ void BlackHole::updateInfo() { if (infoLine) { - infoLine->setVisible(true); + infoLine->tqsetVisible(true); infoLine->setPoints(x(), y(), exitItem->x(), exitItem->y()); exitItem->showInfo(); } @@ -1338,7 +1338,7 @@ bool BlackHole::place(Ball *ball, bool /*wasCenter*/) ball->setVelocity(0, 0); ball->setState(Stopped); - ball->setVisible(false); + ball->tqsetVisible(false); ball->setForceStillGoing(true); double magnitude = Vector(TQPoint(x(), y()), TQPoint(exitItem->x(), exitItem->y())).magnitude(); @@ -1367,7 +1367,7 @@ void BlackHole::eject(Ball *ball, double speed) ball->setVector(v); ball->setForceStillGoing(false); - ball->setVisible(true); + ball->tqsetVisible(true); ball->setState(Rolling); runs++; @@ -1418,7 +1418,7 @@ void BlackHole::finishMe() } exitItem->setPoints(start.x(), start.y(), end.x(), end.y()); - exitItem->setVisible(true); + exitItem->tqsetVisible(true); } void BlackHole::save(KConfig *cfg) @@ -1439,7 +1439,7 @@ BlackHoleExit::BlackHoleExit(BlackHole *blackHole, TQCanvas *canvas) setZ(blackHole->z()); arrow->setZ(z() - .00001); updateArrowLength(); - arrow->setVisible(false); + arrow->tqsetVisible(false); } void BlackHoleExit::aboutToDie() @@ -1484,49 +1484,49 @@ void BlackHoleExit::editModeChanged(bool editing) void BlackHoleExit::showInfo() { - arrow->setVisible(true); + arrow->tqsetVisible(true); } void BlackHoleExit::hideInfo() { - arrow->setVisible(false); + arrow->tqsetVisible(false); } -Config *BlackHoleExit::config(TQWidget *parent) +Config *BlackHoleExit::config(TQWidget *tqparent) { - return blackHole->config(parent); + return blackHole->config(tqparent); } ///////////////////////// -BlackHoleConfig::BlackHoleConfig(BlackHole *blackHole, TQWidget *parent) - : Config(parent) +BlackHoleConfig::BlackHoleConfig(BlackHole *blackHole, TQWidget *tqparent) + : Config(tqparent) { this->blackHole = blackHole; - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); - layout->addWidget(new TQLabel(i18n("Exiting ball angle:"), this)); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); + tqlayout->addWidget(new TQLabel(i18n("Exiting ball angle:"), this)); TQSpinBox *deg = new TQSpinBox(0, 359, 10, this); deg->setSuffix(TQString(" ") + i18n("degrees")); deg->setValue(blackHole->curExitDeg()); deg->setWrapping(true); - layout->addWidget(deg); + tqlayout->addWidget(deg); connect(deg, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(degChanged(int))); - layout->addStretch(); + tqlayout->addStretch(); - TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Minimum exit speed:"), this)); + TQHBoxLayout *htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Minimum exit speed:"), this)); KDoubleNumInput *min = new KDoubleNumInput(this); min->setRange(0, 8, 1, true); - hlayout->addWidget(min); + htqlayout->addWidget(min); connect(min, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(minChanged(double))); min->setValue(blackHole->minSpeed()); - hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Maximum:"), this)); + htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Maximum:"), this)); KDoubleNumInput *max = new KDoubleNumInput(this); max->setRange(1, 10, 1, true); - hlayout->addWidget(max); + htqlayout->addWidget(max); connect(max, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(maxChanged(double))); max->setValue(blackHole->maxSpeed()); } @@ -1639,7 +1639,7 @@ void WallPoint::updateVisible() void WallPoint::editModeChanged(bool changed) { editing = changed; - setVisible(true); + tqsetVisible(true); if (!editing) updateVisible(); } @@ -1741,8 +1741,8 @@ Wall::Wall(TQCanvas *canvas) startItem = new WallPoint(true, this, canvas); endItem = new WallPoint(false, this, canvas); - startItem->setVisible(true); - endItem->setVisible(true); + startItem->tqsetVisible(true); + endItem->tqsetVisible(true); setPen(TQPen(darkRed, 3)); setPoints(-15, 10, 15, -5); @@ -1777,10 +1777,10 @@ void Wall::setAlwaysShow(bool yes) void Wall::setVisible(bool yes) { - TQCanvasLine::setVisible(yes); + TQCanvasLine::tqsetVisible(yes); - startItem->setVisible(yes); - endItem->setVisible(yes); + startItem->tqsetVisible(yes); + endItem->tqsetVisible(yes); startItem->updateVisible(); endItem->updateVisible(); } @@ -1859,7 +1859,7 @@ TQPointArray Wall::areaPoints() const // it's all squished because I don't want my // line counts to count code I didn't write! - TQPointArray p(4); const int xi = int(x()); const int yi = int(y()); const TQPoint start = startPoint(); const TQPoint end = endPoint(); const int x1 = start.x(); const int x2 = end.x(); const int y1 = start.y(); const int y2 = end.y(); const int dx = QABS(x1-x2); const int dy = QABS(y1-y2); if ( dx > dy ) { p[0] = TQPoint(x1+xi,y1+yi-1); p[1] = TQPoint(x2+xi,y2+yi-1); p[2] = TQPoint(x2+xi,y2+yi+1); p[3] = TQPoint(x1+xi,y1+yi+1); } else { p[0] = TQPoint(x1+xi-1,y1+yi); p[1] = TQPoint(x2+xi-1,y2+yi); p[2] = TQPoint(x2+xi+1,y2+yi); p[3] = TQPoint(x1+xi+1,y1+yi); } return p; + TQPointArray p(4); const int xi = int(x()); const int yi = int(y()); const TQPoint start = startPoint(); const TQPoint end = endPoint(); const int x1 = start.x(); const int x2 = end.x(); const int y1 = start.y(); const int y2 = end.y(); const int dx = TQABS(x1-x2); const int dy = TQABS(y1-y2); if ( dx > dy ) { p[0] = TQPoint(x1+xi,y1+yi-1); p[1] = TQPoint(x2+xi,y2+yi-1); p[2] = TQPoint(x2+xi,y2+yi+1); p[3] = TQPoint(x1+xi,y1+yi+1); } else { p[0] = TQPoint(x1+xi-1,y1+yi); p[1] = TQPoint(x2+xi-1,y2+yi); p[2] = TQPoint(x2+xi+1,y2+yi); p[3] = TQPoint(x1+xi+1,y1+yi); } return p; } void Wall::editModeChanged(bool changed) @@ -1954,47 +1954,47 @@ void Wall::save(KConfig *cfg) ///////////////////////// -HoleConfig::HoleConfig(HoleInfo *holeInfo, TQWidget *parent) - : Config(parent) +HoleConfig::HoleConfig(HoleInfo *holeInfo, TQWidget *tqparent) + : Config(tqparent) { this->holeInfo = holeInfo; - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); - TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Course name: "), this)); + TQHBoxLayout *htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Course name: "), this)); KLineEdit *nameEdit = new KLineEdit(holeInfo->untranslatedName(), this); - hlayout->addWidget(nameEdit); + htqlayout->addWidget(nameEdit); connect(nameEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(nameChanged(const TQString &))); - hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Course author: "), this)); + htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Course author: "), this)); KLineEdit *authorEdit = new KLineEdit(holeInfo->author(), this); - hlayout->addWidget(authorEdit); + htqlayout->addWidget(authorEdit); connect(authorEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(authorChanged(const TQString &))); - layout->addStretch(); + tqlayout->addStretch(); - hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Par:"), this)); + htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Par:"), this)); TQSpinBox *par = new TQSpinBox(1, 15, 1, this); par->setValue(holeInfo->par()); - hlayout->addWidget(par); + htqlayout->addWidget(par); connect(par, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(parChanged(int))); - hlayout->addStretch(); + htqlayout->addStretch(); - hlayout->addWidget(new TQLabel(i18n("Maximum:"), this)); + htqlayout->addWidget(new TQLabel(i18n("Maximum:"), this)); TQSpinBox *maxstrokes = new TQSpinBox(holeInfo->lowestMaxStrokes(), 30, 1, this); TQWhatsThis::add(maxstrokes, i18n("Maximum number of strokes player can take on this hole.")); TQToolTip::add(maxstrokes, i18n("Maximum number of strokes")); maxstrokes->setSpecialValueText(i18n("Unlimited")); maxstrokes->setValue(holeInfo->maxStrokes()); - hlayout->addWidget(maxstrokes); + htqlayout->addWidget(maxstrokes); connect(maxstrokes, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(maxStrokesChanged(int))); TQCheckBox *check = new TQCheckBox(i18n("Show border walls"), this); check->setChecked(holeInfo->borderWalls()); - layout->addWidget(check); + tqlayout->addWidget(check); connect(check, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(borderWallsChanged(bool))); } @@ -2122,7 +2122,7 @@ void StrokeCircle::draw(TQPainter &p) length = al; } - p.setBrush(TQBrush(black, Qt::NoBrush)); + p.setBrush(TQBrush(black, TQt::NoBrush)); p.setPen(TQPen(white, ithickness / 2)); p.drawEllipse(x() + ithickness / 2, y() + ithickness / 2, iwidth - ithickness, iheight - ithickness); p.setPen(TQPen(TQColor((int)(0xff * dvalue) / dmax, 0, 0xff - (int)(0xff * dvalue) / dmax), ithickness)); @@ -2139,8 +2139,8 @@ void StrokeCircle::draw(TQPainter &p) ///////////////////////////////////////// -KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWidget *parent, const char *name ) - : TQCanvasView(parent, name) +KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWidget *tqparent, const char *name ) + : TQCanvasView(tqparent, name) { // for mouse control setMouseTracking(true); @@ -2197,22 +2197,22 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWi margin = 10; - setFocusPolicy(TQWidget::StrongFocus); + setFocusPolicy(TQ_StrongFocus); setFixedSize(width + 2 * margin, height + 2 * margin); setMargins(margin, margin, margin, margin); - course = new TQCanvas(this); + course = new TQCanvas(TQT_TQOBJECT(this)); course->setBackgroundColor(white); course->resize(width, height); TQPixmap pic; - if (!TQPixmapCache::find("grass", pic)) + if (!TQPixmapCache::tqfind("grass", pic)) { pic.load(locate("appdata", "pics/grass.png")); TQPixmapCache::insert("grass", pic); } - course->setBackgroundPixmap(pic); + course->tqsetBackgroundPixmap(pic); setCanvas(course); move(0, 0); @@ -2225,7 +2225,7 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWi highlighter = new TQCanvasRectangle(course); highlighter->setPen(TQPen(yellow, 1)); highlighter->setBrush(TQBrush(NoBrush)); - highlighter->setVisible(false); + highlighter->tqsetVisible(false); highlighter->setZ(10000); // shows some info about hole @@ -2237,14 +2237,14 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWi infoText->move(15, width/2); infoText->setZ(10001); infoText->setFont(font); - infoText->setVisible(false); + infoText->tqsetVisible(false); // create the advanced putting indicator strokeCircle = new StrokeCircle(course); strokeCircle->move(width - 90, height - 90); strokeCircle->setSize(80, 80); strokeCircle->setThickness(8); - strokeCircle->setVisible(false); + strokeCircle->tqsetVisible(false); strokeCircle->setValue(0); strokeCircle->setMaxValue(360); @@ -2252,7 +2252,7 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWi whiteBall = new Ball(course); whiteBall->setGame(this); whiteBall->setColor(white); - whiteBall->setVisible(false); + whiteBall->tqsetVisible(false); whiteBall->setDoDetect(false); int highestLog = 0; @@ -2311,7 +2311,7 @@ void KolfGame::startFirstHole(int hole) { for (; scoreboardHoles < curHole; ++scoreboardHoles) { - cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(scoreboardHoles + 1)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").tqarg(scoreboardHoles + 1)); emit newHole(cfg->readNumEntry("par", 3)); } @@ -2382,7 +2382,7 @@ void KolfGame::addBorderWall(TQPoint start, TQPoint end) { Wall *wall = new Wall(course); wall->setPoints(start.x(), start.y(), end.x(), end.y()); - wall->setVisible(true); + wall->tqsetVisible(true); wall->setGame(this); wall->setZ(998.7); borderWalls.append(wall); @@ -2420,7 +2420,7 @@ void KolfGame::handleMousePressEvent(TQMouseEvent *e) list.pop_front(); moving = false; - highlighter->setVisible(false); + highlighter->tqsetVisible(false); selectedItem = 0; movingItem = 0; @@ -2430,7 +2430,7 @@ void KolfGame::handleMousePressEvent(TQMouseEvent *e) return; } // only items we keep track of - if ((!(items.containsRef(list.first()) || list.first() == whiteBall || extraMoveable.containsRef(list.first())))) + if ((!(items.tqcontainsRef(list.first()) || list.first() == whiteBall || extraMoveable.tqcontainsRef(list.first())))) { emit newSelectedItem(&holeInfo); return; @@ -2446,7 +2446,7 @@ void KolfGame::handleMousePressEvent(TQMouseEvent *e) switch (e->button()) { // select AND move now :) - case LeftButton: + case Qt::LeftButton: { selectedItem = list.first(); movingItem = selectedItem; @@ -2458,7 +2458,7 @@ void KolfGame::handleMousePressEvent(TQMouseEvent *e) setCursor(KCursor::sizeAllCursor()); emit newSelectedItem(citem); - highlighter->setVisible(true); + highlighter->tqsetVisible(true); TQRect rect = selectedItem->boundingRect(); highlighter->move(rect.x() + 1, rect.y() + 1); highlighter->setSize(rect.width(), rect.height()); @@ -2473,9 +2473,9 @@ void KolfGame::handleMousePressEvent(TQMouseEvent *e) { if (m_useMouse) { - if (!inPlay && e->button() == LeftButton) + if (!inPlay && e->button() == Qt::LeftButton) puttPress(); - else if (e->button() == RightButton) + else if (e->button() == Qt::RightButton) toggleShowInfo(); } } @@ -2553,7 +2553,7 @@ void KolfGame::handleMouseMoveEvent(TQMouseEvent *e) highlighter->moveBy(-(double)moveX, -(double)moveY); movingItem->moveBy(-(double)moveX, -(double)moveY); TQRect brect = movingItem->boundingRect(); - emit newStatusText(TQString("%1x%2").arg(brect.x()).arg(brect.y())); + emit newStatusText(TQString("%1x%2").tqarg(brect.x()).tqarg(brect.y())); storedMousePos = mouse; } @@ -2574,7 +2574,7 @@ void KolfGame::handleMouseReleaseEvent(TQMouseEvent *e) if (editing) { - emit newStatusText(TQString::null); + emit newStatusText(TQString()); moving = false; } @@ -2583,9 +2583,9 @@ void KolfGame::handleMouseReleaseEvent(TQMouseEvent *e) if (!editing && m_useMouse) { - if (!inPlay && e->button() == LeftButton) + if (!inPlay && e->button() == Qt::LeftButton) puttRelease(); - else if (e->button() == RightButton) + else if (e->button() == Qt::RightButton) toggleShowInfo(); } @@ -2608,7 +2608,7 @@ void KolfGame::keyPressEvent(TQKeyEvent *e) putting = false; stroking = false; finishStroking = false; - strokeCircle->setVisible(false); + strokeCircle->tqsetVisible(false); putterTimer->stop(); putter->setOrigin((*curPlayer).ball()->x(), (*curPlayer).ball()->y()); break; @@ -2701,7 +2701,7 @@ void KolfGame::puttPress() strokeCircle->move(px + pw / 2 + 10, py + 10); else strokeCircle->move(px + pw / 2 + 10, py - 10 - strokeCircle->height()); - strokeCircle->setVisible(true); + strokeCircle->tqsetVisible(true); } putterTimer->start(putterTimerMsec); } @@ -2741,7 +2741,7 @@ void KolfGame::keyReleaseEvent(TQKeyEvent *e) { lastDelId = citem->curId(); - highlighter->setVisible(false); + highlighter->tqsetVisible(false); items.removeRef(item); citem->hideInfo(); citem->aboutToDelete(); @@ -2785,7 +2785,7 @@ void KolfGame::timeout() // later undo the shot for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) { - if (!course->rect().contains(TQPoint((*it).ball()->x(), (*it).ball()->y()))) + if (!course->rect().tqcontains(TQPoint((*it).ball()->x(), (*it).ball()->y()))) { (*it).ball()->setState(Stopped); @@ -2907,7 +2907,7 @@ void KolfGame::putterTimeout() { // aborted putting = false; - strokeCircle->setVisible(false); + strokeCircle->tqsetVisible(false); } else if (strength > maxStrength || puttReverse) { @@ -2950,7 +2950,7 @@ void KolfGame::putterTimeout() putter->go(Forwards); else { - strokeCircle->setVisible(false); + strokeCircle->tqsetVisible(false); finishStroking = false; putterTimer->stop(); putting = false; @@ -3084,7 +3084,7 @@ void KolfGame::loadStateList() if ((*curPlayer).id() == info.id) ballMoved(); else - player.ball()->setVisible(!info.beginningOfHole); + player.ball()->tqsetVisible(!info.beginningOfHole); player.setScoreForHole(info.score, curHole); player.ball()->setState(info.state); emit scoreChanged(info.id, curHole, info.score); @@ -3136,7 +3136,7 @@ void KolfGame::shotDone() const TQString placeOutside = i18n("Drop Outside of Hazard"); const TQString rehit = i18n("Rehit From Last Location"); options << placeOutside << rehit; - const TQString choice = KComboBoxDialog::getItem(i18n("What would you like to do for your next shot?"), i18n("%1 is in a Hazard").arg((*it).name()), options, placeOutside, "hazardOptions"); + const TQString choice = KComboBoxDialog::getItem(i18n("What would you like to do for your next shot?"), i18n("%1 is in a Hazard").tqarg((*it).name()), options, placeOutside, "hazardOptions"); if (choice == placeOutside) { @@ -3186,7 +3186,7 @@ void KolfGame::shotDone() } } - ball->setVisible(true); + ball->tqsetVisible(true); ball->setState(Stopped); (*it).ball()->setDoDetect(true); @@ -3207,7 +3207,7 @@ void KolfGame::shotDone() if (curStrokes >= holeInfo.maxStrokes() && holeInfo.hasMaxStrokes()) { ball->setState(Holed); - ball->setVisible(false); + ball->tqsetVisible(false); // move to center in case he/she hit out ball->move(width / 2, height / 2); @@ -3236,7 +3236,7 @@ void KolfGame::shotDone() emit newPlayersTurn(&(*curPlayer)); - (*curPlayer).ball()->setVisible(true); + (*curPlayer).ball()->tqsetVisible(true); putter->setAngle((*curPlayer).ball()); putter->setOrigin((*curPlayer).ball()->x(), (*curPlayer).ball()->y()); @@ -3256,7 +3256,7 @@ void KolfGame::startBall(const Vector &vector) playSound("hit"); emit inPlayStart(); - putter->setVisible(false); + putter->tqsetVisible(false); (*curPlayer).ball()->setState(Rolling); (*curPlayer).ball()->setVector(vector); @@ -3303,14 +3303,14 @@ void KolfGame::sayWhosGoing() { if (players->count() >= 2) { - KMessageBox::information(this, i18n("%1 will start off.").arg((*curPlayer).name()), i18n("New Hole"), "newHole"); + KMessageBox::information(this, i18n("%1 will start off.").tqarg((*curPlayer).name()), i18n("New Hole"), "newHole"); } } void KolfGame::holeDone() { for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) - (*it).ball()->setVisible(false); + (*it).ball()->tqsetVisible(false); startNextHole(); sayWhosGoing(); } @@ -3407,7 +3407,7 @@ void KolfGame::startNextHole() if ((int)(*it).scores().count() < curHole) (*it).addHole(); (*it).ball()->setVelocity(0, 0); - (*it).ball()->setVisible(false); + (*it).ball()->tqsetVisible(false); } emit newPlayersTurn(&(*curPlayer)); @@ -3429,7 +3429,7 @@ void KolfGame::startNextHole() for (; scoreboardHoles < curHole; ++scoreboardHoles) { - cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(scoreboardHoles + 1)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").tqarg(scoreboardHoles + 1)); emit newHole(cfg->readNumEntry("par", 3)); } @@ -3437,7 +3437,7 @@ void KolfGame::startNextHole() updateShowInfo(); // this is from shotDone() - (*curPlayer).ball()->setVisible(true); + (*curPlayer).ball()->tqsetVisible(true); putter->setOrigin((*curPlayer).ball()->x(), (*curPlayer).ball()->y()); updateMouse(); @@ -3451,31 +3451,31 @@ void KolfGame::startNextHole() void KolfGame::showInfo() { - TQString text = i18n("Hole %1: par %2, maximum %3 strokes").arg(curHole).arg(holeInfo.par()).arg(holeInfo.maxStrokes()); + TQString text = i18n("Hole %1: par %2, maximum %3 strokes").tqarg(curHole).tqarg(holeInfo.par()).tqarg(holeInfo.maxStrokes()); infoText->move((width - TQFontMetrics(infoText->font()).width(text)) / 2, infoText->y()); infoText->setText(text); // I hate this text! Let's not show it - //infoText->setVisible(true); + //infoText->tqsetVisible(true); emit newStatusText(text); } void KolfGame::showInfoDlg(bool addDontShowAgain) { - KMessageBox::information(parentWidget(), - i18n("Course name: %1").arg(holeInfo.name()) + TQString("\n") - + i18n("Created by %1").arg(holeInfo.author()) + TQString("\n") - + i18n("%1 holes").arg(highestHole), + KMessageBox::information(tqparentWidget(), + i18n("Course name: %1").tqarg(holeInfo.name()) + TQString("\n") + + i18n("Created by %1").tqarg(holeInfo.author()) + TQString("\n") + + i18n("%1 holes").tqarg(highestHole), i18n("Course Information"), - addDontShowAgain? holeInfo.name() + TQString(" ") + holeInfo.author() : TQString::null); + addDontShowAgain? holeInfo.name() + TQString(" ") + holeInfo.author() : TQString()); } void KolfGame::hideInfo() { infoText->setText(""); - infoText->setVisible(false); + infoText->tqsetVisible(false); - emit newStatusText(TQString::null); + emit newStatusText(TQString()); } void KolfGame::openFile() @@ -3514,7 +3514,7 @@ void KolfGame::openFile() holeInfo.setUntranslatedName(cfg->readEntryUntranslated("Name", holeInfo.untranslatedName())); emit titleChanged(holeInfo.name()); - cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(curHole)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").tqarg(curHole)); curPar = cfg->readNumEntry("par", 3); holeInfo.setPar(curPar); holeInfo.borderWallsChanged(cfg->readBoolEntry("borderWalls", holeInfo.borderWalls())); @@ -3533,12 +3533,12 @@ void KolfGame::openFile() cfg->setGroup(*it); const int len = (*it).length(); - const int dashIndex = (*it).find("-"); + const int dashIndex = (*it).tqfind("-"); const int holeNum = (*it).left(dashIndex).toInt(); if (holeNum > _highestHole) _highestHole = holeNum; - const int atIndex = (*it).find("@"); + const int atIndex = (*it).tqfind("@"); const TQString name = (*it).mid(dashIndex + 1, atIndex - (dashIndex + 1)); if (holeNum != curHole) @@ -3552,8 +3552,8 @@ void KolfGame::openFile() numItems++; - const int commaIndex = (*it).find(","); - const int pipeIndex = (*it).find("|"); + const int commaIndex = (*it).tqfind(","); + const int pipeIndex = (*it).tqfind("|"); const int x = (*it).mid(atIndex + 1, commaIndex - (atIndex + 1)).toInt(); const int y = (*it).mid(commaIndex + 1, pipeIndex - (commaIndex + 1)).toInt(); @@ -3593,7 +3593,7 @@ void KolfGame::openFile() newItem->move(x, y); canvasItem->firstMove(x, y); - newItem->setVisible(true); + newItem->tqsetVisible(true); // make things actually show if (!hasFinalLoad) @@ -3610,13 +3610,13 @@ void KolfGame::openFile() break; } - if (!loaded && name != "hole" && missingPlugins.contains(name) <= 0) + if (!loaded && name != "hole" && missingPlugins.tqcontains(name) <= 0) missingPlugins.append(name); } if (!missingPlugins.empty()) { - KMessageBox::informationList(this, TQString("

<http://katzbrown.com/kolf/Plugins/>

") + i18n("This hole uses the following plugins, which you do not have installed:") + TQString("

"), missingPlugins, TQString::null, TQString("%1 warning").arg(holeInfo.untranslatedName() + TQString::number(curHole))); + KMessageBox::informationList(this, TQString("

<http://katzbrown.com/kolf/Plugins/>

") + i18n("This hole uses the following plugins, which you do not have installed:") + TQString("

"), missingPlugins, TQString(), TQString("%1 warning").tqarg(holeInfo.untranslatedName() + TQString::number(curHole))); } lastDelId = -1; @@ -3634,7 +3634,7 @@ void KolfGame::openFile() clearHole(); setModified(false); for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) - (*it).ball()->setVisible(false); + (*it).ball()->tqsetVisible(false); return; } @@ -3719,7 +3719,7 @@ void KolfGame::addNewObject(Object *newObj) { TQCanvasItem *newItem = newObj->newObject(course); items.append(newItem); - newItem->setVisible(true); + newItem->tqsetVisible(true); CanvasItem *canvasItem = dynamic_cast(newItem); if (!canvasItem) @@ -3826,11 +3826,11 @@ void KolfGame::addNewHole() // make sure even the current player isn't showing for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) - (*it).ball()->setVisible(false); + (*it).ball()->tqsetVisible(false); - whiteBall->setVisible(editing); - highlighter->setVisible(false); - putter->setVisible(!editing); + whiteBall->tqsetVisible(editing); + highlighter->tqsetVisible(false); + putter->tqsetVisible(!editing); inPlay = false; // add default objects @@ -3978,7 +3978,7 @@ void KolfGame::save() // wipe out all groups from this hole for (TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it) { - int holeNum = (*it).left((*it).find("-")).toInt(); + int holeNum = (*it).left((*it).tqfind("-")).toInt(); if (holeNum == curHole) cfg->deleteGroup(*it); } @@ -3995,7 +3995,7 @@ void KolfGame::save() } // save where ball starts (whiteBall tells all) - cfg->setGroup(TQString("%1-ball@%2,%3").arg(curHole).arg((int)whiteBall->x()).arg((int)whiteBall->y())); + cfg->setGroup(TQString("%1-ball@%2,%3").tqarg(curHole).tqarg((int)whiteBall->x()).tqarg((int)whiteBall->y())); cfg->writeEntry("dummykey", true); cfg->setGroup("0-course@-50,-50"); @@ -4003,7 +4003,7 @@ void KolfGame::save() cfg->writeEntry("Name", holeInfo.untranslatedName()); // save hole info - cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(curHole)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").tqarg(curHole)); cfg->writeEntry("par", holeInfo.par()); cfg->writeEntry("maxstrokes", holeInfo.maxStrokes()); cfg->writeEntry("borderWalls", holeInfo.borderWalls()); @@ -4066,16 +4066,16 @@ void KolfGame::toggleEditMode() { // curplayer shouldn't be hidden no matter what if ((*it).ball()->beginningOfHole() && it != curPlayer) - (*it).ball()->setVisible(false); + (*it).ball()->tqsetVisible(false); else - (*it).ball()->setVisible(!editing); + (*it).ball()->tqsetVisible(!editing); } - whiteBall->setVisible(editing); - highlighter->setVisible(false); + whiteBall->tqsetVisible(editing); + highlighter->tqsetVisible(false); // shouldn't see putter whilst editing - putter->setVisible(!editing); + putter->tqsetVisible(!editing); if (editing) autoSaveTimer->start(autoSaveMsec); @@ -4103,7 +4103,7 @@ void KolfGame::playSound(TQString file, double vol) } } - file = soundDir + file + TQString::fromLatin1(".wav"); + file = soundDir + file + TQString::tqfromLatin1(".wav"); // not needed when all of the files are in the distribution //if (!TQFile::exists(file)) @@ -4160,7 +4160,7 @@ void KolfGame::print(KPrinter &pr) if (pr.option("kde-kolf-title") == "true") { - TQString text = i18n("%1 - Hole %2; by %3").arg(holeInfo.name()).arg(curHole).arg(holeInfo.author()); + TQString text = i18n("%1 - Hole %2; by %3").tqarg(holeInfo.name()).tqarg(curHole).tqarg(holeInfo.author()); TQFont font(kapp->font()); font.setPointSize(18); TQRect rect = TQFontMetrics(font).boundingRect(text); @@ -4183,7 +4183,7 @@ void KolfGame::setBorderWalls(bool showing) { Wall *wall = 0; for (wall = borderWalls.first(); wall; wall = borderWalls.next()) - wall->setVisible(showing); + wall->tqsetVisible(showing); } void KolfGame::setUseAdvancedPutting(bool yes) @@ -4219,7 +4219,7 @@ void KolfGame::courseInfo(CourseInfo &info, const TQString& filename) unsigned int par= 0; while (1) { - TQString group = TQString("%1-hole@-50,-50|0").arg(hole); + TQString group = TQString("%1-hole@-50,-50|0").tqarg(hole); if (!cfg.hasGroup(group)) { hole--; @@ -4283,7 +4283,7 @@ void KolfGame::saveScores(KConfig *config) { config->setGroup(TQString::number((*it).id())); config->writeEntry("Name", (*it).name()); - config->writeEntry("Color", (*it).ball()->color().name()); + config->writeEntry("Color", TQString((*it).ball()->color().name())); TQStringList scores; TQValueList intscores = (*it).scores(); diff --git a/kolf/game.h b/kolf/game.h index f3dfea35..3bcaaaf5 100644 --- a/kolf/game.h +++ b/kolf/game.h @@ -104,7 +104,7 @@ private: }; typedef TQValueList PlayerList; -class Arrow : public QCanvasLine +class Arrow : public TQCanvasLine { public: Arrow(TQCanvas *canvas); @@ -142,7 +142,7 @@ public: RectPoint(TQColor color, RectItem *, TQCanvas *canvas); void dontMove() { dontmove = true; } virtual void moveBy(double dx, double dy); - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); virtual bool deleteable() const { return false; } virtual bool cornerResize() const { return true; } virtual CanvasItem *itemToDelete() { return dynamic_cast(rect); } @@ -181,7 +181,7 @@ public: virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); protected: RectPoint *point; @@ -195,6 +195,7 @@ private: class EllipseConfig : public Config { Q_OBJECT + TQ_OBJECT public: EllipseConfig(Ellipse *ellipse, TQWidget *); @@ -206,7 +207,7 @@ private slots: void check2Changed(bool on); protected: - TQVBoxLayout *m_vlayout; + TQVBoxLayout *m_vtqlayout; private: TQLabel *slow1; @@ -317,9 +318,10 @@ class BlackHole; class BlackHoleConfig : public Config { Q_OBJECT + TQ_OBJECT public: - BlackHoleConfig(BlackHole *blackHole, TQWidget *parent); + BlackHoleConfig(BlackHole *blackHole, TQWidget *tqparent); private slots: void degChanged(int); @@ -344,15 +346,16 @@ public: virtual void hideInfo(); void updateArrowAngle(); void updateArrowLength(); - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); BlackHole *blackHole; protected: Arrow *arrow; }; -class BlackHoleTimer : public QObject +class BlackHoleTimer : public TQObject { Q_OBJECT + TQ_OBJECT public: BlackHoleTimer(Ball *ball, double speed, int msec); @@ -372,6 +375,7 @@ protected: class BlackHole : public TQObject, public Hole { Q_OBJECT + TQ_OBJECT public: BlackHole(TQCanvas *canvas); @@ -382,7 +386,7 @@ public: virtual bool place(Ball *ball, bool wasCenter); virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); - virtual Config *config(TQWidget *parent) { return new BlackHoleConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new BlackHoleConfig(this, tqparent); } virtual TQPtrList moveableItems() const; double minSpeed() const { return m_minSpeed; } double maxSpeed() const { return m_maxSpeed; } @@ -475,11 +479,11 @@ public: virtual bool collision(Ball *ball, long int id); virtual CanvasItem *itemToDelete() { return wall; } virtual void clean(); - virtual Config *config(TQWidget *parent) { return wall->config(parent); } + virtual Config *config(TQWidget *tqparent) { return wall->config(tqparent); } void dontMove() { dontmove = true; }; void updateVisible(); - Wall *parentWall() { return wall; } + Wall *tqparentWall() { return wall; } protected: Wall *wall; @@ -541,6 +545,7 @@ class Bridge; class BridgeConfig : public Config { Q_OBJECT + TQ_OBJECT public: BridgeConfig(Bridge *bridge, TQWidget *); @@ -552,7 +557,7 @@ protected slots: void rightWallChanged(bool); protected: - TQVBoxLayout *m_vlayout; + TQVBoxLayout *m_vtqlayout; TQCheckBox *top; TQCheckBox *bot; TQCheckBox *left; @@ -576,7 +581,7 @@ public: void doSave(KConfig *cfg); virtual void newSize(int width, int height); virtual void setGame(KolfGame *game); - virtual Config *config(TQWidget *parent) { return new BridgeConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new BridgeConfig(this, tqparent); } void setSize(int width, int height); virtual TQPtrList moveableItems() const; @@ -613,9 +618,10 @@ class Sign; class SignConfig : public BridgeConfig { Q_OBJECT + TQ_OBJECT public: - SignConfig(Sign *sign, TQWidget *parent); + SignConfig(Sign *sign, TQWidget *tqparent); private slots: void textChanged(const TQString &); @@ -631,7 +637,7 @@ public: TQString text() const { return m_text; } virtual void draw(TQPainter &painter); virtual bool vStrut() const { return false; } - virtual Config *config(TQWidget *parent) { return new SignConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new SignConfig(this, tqparent); } virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); @@ -661,9 +667,10 @@ protected: class WindmillConfig : public BridgeConfig { Q_OBJECT + TQ_OBJECT public: - WindmillConfig(Windmill *windmill, TQWidget *parent); + WindmillConfig(Windmill *windmill, TQWidget *tqparent); private slots: void speedChanged(int news); @@ -681,7 +688,7 @@ public: virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); virtual void setGame(KolfGame *game); - virtual Config *config(TQWidget *parent) { return new WindmillConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new WindmillConfig(this, tqparent); } void setSize(int width, int height); virtual void moveBy(double dx, double dy); void setSpeed(int news); @@ -708,6 +715,7 @@ class HoleInfo; class HoleConfig : public Config { Q_OBJECT + TQ_OBJECT public: HoleConfig(HoleInfo *holeInfo, TQWidget *); @@ -741,7 +749,7 @@ public: TQString name() const { return m_name; } TQString untranslatedName() const { return m_untranslatedName; } - virtual Config *config(TQWidget *parent) { return new HoleConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new HoleConfig(this, tqparent); } void borderWallsChanged(bool yes); bool borderWalls() const { return m_borderWalls; } @@ -755,7 +763,7 @@ private: int m_lowestMaxStrokes; }; -class StrokeCircle : public QCanvasItem +class StrokeCircle : public TQCanvasItem { public: StrokeCircle(TQCanvas *canvas); @@ -790,12 +798,13 @@ struct KDE_EXPORT CourseInfo unsigned int par; }; -class KDE_EXPORT KolfGame : public QCanvasView +class KDE_EXPORT KolfGame : public TQCanvasView { Q_OBJECT + TQ_OBJECT public: - KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWidget *parent=0, const char *name=0 ); + KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWidget *tqparent=0, const char *name=0 ); ~KolfGame(); void setObjects(ObjectList *obj) { this->obj = obj; } void setFilename(const TQString &filename); diff --git a/kolf/kcomboboxdialog.cpp b/kolf/kcomboboxdialog.cpp index 1e18e0b2..133edb01 100644 --- a/kolf/kcomboboxdialog.cpp +++ b/kolf/kcomboboxdialog.cpp @@ -34,8 +34,8 @@ #include "kcomboboxdialog.h" -KComboBoxDialog::KComboBoxDialog( const TQString &_text, const TQStringList &_items, const TQString& _value, bool showDontAskAgain, TQWidget *parent ) - : KDialogBase( Plain, TQString::null, Ok, Ok, parent, 0L, true, true ) +KComboBoxDialog::KComboBoxDialog( const TQString &_text, const TQStringList &_items, const TQString& _value, bool showDontAskAgain, TQWidget *tqparent ) + : KDialogBase( Plain, TQString(), Ok, Ok, tqparent, 0L, true, true ) { TQVBoxLayout *topLayout = new TQVBoxLayout( plainPage(), marginHint(), spacingHint() ); TQLabel *label = new TQLabel(_text, plainPage() ); @@ -76,12 +76,12 @@ bool KComboBoxDialog::dontAskAgainChecked() return false; } -TQString KComboBoxDialog::getItem( const TQString &_text, const TQStringList &_items, const TQString& _value, const TQString &dontAskAgainName, TQWidget *parent ) +TQString KComboBoxDialog::getItem( const TQString &_text, const TQStringList &_items, const TQString& _value, const TQString &dontAskAgainName, TQWidget *tqparent ) { - return getItem( _text, TQString::null, _items, _value, dontAskAgainName, parent ); + return getItem( _text, TQString(), _items, _value, dontAskAgainName, tqparent ); } -TQString KComboBoxDialog::getItem( const TQString &_text, const TQString &_caption, const TQStringList &_items, const TQString& _value, const TQString &dontAskAgainName, TQWidget *parent ) +TQString KComboBoxDialog::getItem( const TQString &_text, const TQString &_caption, const TQStringList &_items, const TQString& _value, const TQString &dontAskAgainName, TQWidget *tqparent ) { TQString prevAnswer; if ( !dontAskAgainName.isEmpty() ) @@ -90,11 +90,11 @@ TQString KComboBoxDialog::getItem( const TQString &_text, const TQString &_capti config->setGroup( "Notification Messages" ); prevAnswer = config->readEntry( dontAskAgainName ); if ( !prevAnswer.isEmpty() ) - if ( _items.contains( prevAnswer ) > 0 ) + if ( _items.tqcontains( prevAnswer ) > 0 ) return prevAnswer; } - KComboBoxDialog dlg( _text, _items, _value, !dontAskAgainName.isNull(), parent ); + KComboBoxDialog dlg( _text, _items, _value, !dontAskAgainName.isNull(), tqparent ); if ( !_caption.isNull() ) dlg.setCaption( _caption ); @@ -115,17 +115,17 @@ TQString KComboBoxDialog::getItem( const TQString &_text, const TQString &_capti return text; } -TQString KComboBoxDialog::getText(const TQString &_caption, const TQString &_text, const TQString &_value, bool *ok, TQWidget *parent, const TQString &configName, KConfig *config) +TQString KComboBoxDialog::getText(const TQString &_caption, const TQString &_text, const TQString &_value, bool *ok, TQWidget *tqparent, const TQString &configName, KConfig *config) { - KComboBoxDialog dlg(_text, TQStringList(), _value, false, parent); + KComboBoxDialog dlg(_text, TQStringList(), _value, false, tqparent); if ( !_caption.isNull() ) dlg.setCaption( _caption ); KHistoryCombo * const box = dlg.comboBox(); box->setEditable(true); - const TQString historyItem = TQString("%1History").arg(configName); - const TQString completionItem = TQString("%1Completion").arg(configName); + const TQString historyItem = TQString("%1History").tqarg(configName); + const TQString completionItem = TQString("%1Completion").tqarg(configName); if(!configName.isNull()) { diff --git a/kolf/kcomboboxdialog.h b/kolf/kcomboboxdialog.h index 28f3721f..91097f16 100644 --- a/kolf/kcomboboxdialog.h +++ b/kolf/kcomboboxdialog.h @@ -40,6 +40,7 @@ class KHistoryCombo; class KComboBoxDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: /** @@ -51,7 +52,7 @@ public: * @param _text Text of the label * @param _value Initial value of the combobox */ - KComboBoxDialog( const TQString &_text, const TQStringList& _items, const TQString& _value = TQString::null, bool showDontAskAgain = false, TQWidget *parent = 0 ); + KComboBoxDialog( const TQString &_text, const TQStringList& _items, const TQString& _value = TQString(), bool showDontAskAgain = false, TQWidget *tqparent = 0 ); virtual ~KComboBoxDialog(); /** @@ -70,9 +71,9 @@ public: * @param _text Text of the label * @param _items Items in the combobox * @param _value Initial value of the inputline - * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use TQString::null to disable + * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use TQString() to disable */ - static TQString getItem( const TQString &_text, const TQStringList &_items, const TQString& _value = TQString::null, const TQString &dontAskAgainName = TQString::null, TQWidget *parent = 0 ); + static TQString getItem( const TQString &_text, const TQStringList &_items, const TQString& _value = TQString(), const TQString &dontAskAgainName = TQString(), TQWidget *tqparent = 0 ); /** * Static convenience function to get input from the user. @@ -82,9 +83,9 @@ public: * @param _text Text of the label * @param _items Items in the combobox * @param _value Initial value of the inputline - * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use TQString::null to disable + * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use TQString() to disable */ - static TQString getItem( const TQString &_text, const TQString &_caption, const TQStringList &_items, const TQString& _value = TQString::null, const TQString &dontAskAgainName = TQString::null, TQWidget *parent = 0 ); + static TQString getItem( const TQString &_text, const TQString &_caption, const TQStringList &_items, const TQString& _value = TQString(), const TQString &dontAskAgainName = TQString(), TQWidget *tqparent = 0 ); /** * Static convenience method. @@ -95,14 +96,14 @@ public: * @param _text Text of the label * @param _value Initial value of the inputline * @param ok Variable to store whether the user hit OK - * @param parent Parent widget for the dialog + * @param tqparent Parent widget for the dialog * @param configName Name of the dialog for saving the completion and history * @parma config KConfig for saving the completion and history */ static TQString getText(const TQString &_caption, const TQString &_text, - const TQString &_value = TQString::null, - bool *ok = 0, TQWidget *parent = 0, - const TQString &configName = TQString::null, + const TQString &_value = TQString(), + bool *ok = 0, TQWidget *tqparent = 0, + const TQString &configName = TQString(), KConfig *config = KGlobal::config()); protected: diff --git a/kolf/kolf.cpp b/kolf/kolf.cpp index 696ddc72..5ad194a6 100644 --- a/kolf/kolf.cpp +++ b/kolf/kolf.cpp @@ -62,10 +62,10 @@ Kolf::Kolf() obj = new ObjectList; initPlugins(); - filename = TQString::null; + filename = TQString(); dummy = new TQWidget(this); setCentralWidget(dummy); - layout = new TQGridLayout(dummy, 3, 1); + tqlayout = new TQGridLayout(dummy, 3, 1); resize(420, 480); } @@ -79,75 +79,75 @@ Kolf::~Kolf() void Kolf::initGUI() { - newAction = KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection()); + newAction = KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection()); newAction->setText(newAction->text() + TQString("...")); - endAction = KStdGameAction::end(this, TQT_SLOT(closeGame()), actionCollection()); - printAction = KStdGameAction::print(this, TQT_SLOT(print()), actionCollection()); + endAction = KStdGameAction::end(TQT_TQOBJECT(this), TQT_SLOT(closeGame()), actionCollection()); + printAction = KStdGameAction::print(TQT_TQOBJECT(this), TQT_SLOT(print()), actionCollection()); - (void) KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); - saveAction = KStdAction::save(this, TQT_SLOT(save()), actionCollection(), "game_save"); + (void) KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + saveAction = KStdAction::save(TQT_TQOBJECT(this), TQT_SLOT(save()), actionCollection(), "game_save"); saveAction->setText(i18n("Save &Course")); - saveAsAction = KStdAction::saveAs(this, TQT_SLOT(saveAs()), actionCollection(), "game_save_as"); + saveAsAction = KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(saveAs()), actionCollection(), "game_save_as"); saveAsAction->setText(i18n("Save &Course As...")); - saveGameAction = new KAction(i18n("&Save Game"), 0, this, TQT_SLOT(saveGame()), actionCollection(), "savegame"); - saveGameAsAction = new KAction(i18n("&Save Game As..."), 0, this, TQT_SLOT(saveGameAs()), actionCollection(), "savegameas"); + saveGameAction = new KAction(i18n("&Save Game"), 0, TQT_TQOBJECT(this), TQT_SLOT(saveGame()), actionCollection(), "savegame"); + saveGameAsAction = new KAction(i18n("&Save Game As..."), 0, TQT_TQOBJECT(this), TQT_SLOT(saveGameAs()), actionCollection(), "savegameas"); - loadGameAction = KStdGameAction::load(this, TQT_SLOT(loadGame()), actionCollection()); + loadGameAction = KStdGameAction::load(TQT_TQOBJECT(this), TQT_SLOT(loadGame()), actionCollection()); loadGameAction->setText(i18n("Load Saved Game...")); - highScoreAction = KStdGameAction::highscores(this, TQT_SLOT(showHighScores()), actionCollection()); + highScoreAction = KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighScores()), actionCollection()); - editingAction = new KToggleAction(i18n("&Edit"), "pencil", CTRL+Key_E, this, TQT_SLOT(emptySlot()), actionCollection(), "editing"); - newHoleAction = new KAction(i18n("&New"), "filenew", CTRL+SHIFT+Key_N, this, TQT_SLOT(emptySlot()), actionCollection(), "newhole"); - clearHoleAction = new KAction(KStdGuiItem::clear().text(), "locationbar_erase", CTRL+Key_Delete, this, TQT_SLOT(emptySlot()), actionCollection(), "clearhole"); - resetHoleAction = new KAction(i18n("&Reset"), CTRL+Key_R, this, TQT_SLOT(emptySlot()), actionCollection(), "resethole"); - undoShotAction = KStdAction::undo(this, TQT_SLOT(emptySlot()), actionCollection(), "undoshot"); + editingAction = new KToggleAction(i18n("&Edit"), "pencil", CTRL+Key_E, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "editing"); + newHoleAction = new KAction(i18n("&New"), "filenew", CTRL+SHIFT+Key_N, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "newhole"); + clearHoleAction = new KAction(KStdGuiItem::clear().text(), "locationbar_erase", CTRL+Key_Delete, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "clearhole"); + resetHoleAction = new KAction(i18n("&Reset"), CTRL+Key_R, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "resethole"); + undoShotAction = KStdAction::undo(TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "undoshot"); undoShotAction->setText(i18n("&Undo Shot")); - //replayShotAction = new KAction(i18n("&Replay Shot"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "replay"); + //replayShotAction = new KAction(i18n("&Replay Shot"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "replay"); - holeAction = new KListAction(i18n("Switch to Hole"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "switchhole"); - nextAction = new KAction(i18n("&Next Hole"), "forward", KStdAccel::shortcut(KStdAccel::Forward), this, TQT_SLOT(emptySlot()), actionCollection(), "nexthole"); - prevAction = new KAction(i18n("&Previous Hole"), "back", KStdAccel::shortcut(KStdAccel::Back), this, TQT_SLOT(emptySlot()), actionCollection(), "prevhole"); - firstAction = new KAction(i18n("&First Hole"), "gohome", KStdAccel::shortcut(KStdAccel::Home), this, TQT_SLOT(emptySlot()), actionCollection(), "firsthole"); - lastAction = new KAction(i18n("&Last Hole"), CTRL+SHIFT+Key_End, this, TQT_SLOT(emptySlot()), actionCollection(), "lasthole"); - randAction = new KAction(i18n("&Random Hole"), "goto", 0, this, TQT_SLOT(emptySlot()), actionCollection(), "randhole"); + holeAction = new KListAction(i18n("Switch to Hole"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "switchhole"); + nextAction = new KAction(i18n("&Next Hole"), "forward", KStdAccel::shortcut(KStdAccel::Forward), TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "nexthole"); + prevAction = new KAction(i18n("&Previous Hole"), "back", KStdAccel::shortcut(KStdAccel::Back), TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "prevhole"); + firstAction = new KAction(i18n("&First Hole"), "gohome", KStdAccel::shortcut(KStdAccel::Home), TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "firsthole"); + lastAction = new KAction(i18n("&Last Hole"), CTRL+SHIFT+Key_End, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "lasthole"); + randAction = new KAction(i18n("&Random Hole"), "goto", 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "randhole"); - useMouseAction = new KToggleAction(i18n("Enable &Mouse for Moving Putter"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "usemouse"); + useMouseAction = new KToggleAction(i18n("Enable &Mouse for Moving Putter"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "usemouse"); useMouseAction->setCheckedState(i18n("Disable &Mouse for Moving Putter")); - connect(useMouseAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(useMouseChanged(bool))); + connect(useMouseAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(useMouseChanged(bool))); KConfig *config = kapp->config(); config->setGroup("Settings"); useMouseAction->setChecked(config->readBoolEntry("useMouse", true)); - useAdvancedPuttingAction = new KToggleAction(i18n("Enable &Advanced Putting"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "useadvancedputting"); + useAdvancedPuttingAction = new KToggleAction(i18n("Enable &Advanced Putting"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "useadvancedputting"); useAdvancedPuttingAction->setCheckedState(i18n("Disable &Advanced Putting")); - connect(useAdvancedPuttingAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(useAdvancedPuttingChanged(bool))); + connect(useAdvancedPuttingAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(useAdvancedPuttingChanged(bool))); useAdvancedPuttingAction->setChecked(config->readBoolEntry("useAdvancedPutting", false)); - showInfoAction = new KToggleAction(i18n("Show &Info"), "info", CTRL+Key_I, this, TQT_SLOT(emptySlot()), actionCollection(), "showinfo"); + showInfoAction = new KToggleAction(i18n("Show &Info"), "info", CTRL+Key_I, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "showinfo"); showInfoAction->setCheckedState(i18n("Hide &Info")); - connect(showInfoAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showInfoChanged(bool))); + connect(showInfoAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(showInfoChanged(bool))); showInfoAction->setChecked(config->readBoolEntry("showInfo", false)); - showGuideLineAction = new KToggleAction(i18n("Show Putter &Guideline"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "showguideline"); + showGuideLineAction = new KToggleAction(i18n("Show Putter &Guideline"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "showguideline"); showGuideLineAction->setCheckedState(i18n("Hide Putter &Guideline")); - connect(showGuideLineAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showGuideLineChanged(bool))); + connect(showGuideLineAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(showGuideLineChanged(bool))); showGuideLineAction->setChecked(config->readBoolEntry("showGuideLine", true)); - KToggleAction *act=new KToggleAction(i18n("Enable All Dialog Boxes"), 0, this, TQT_SLOT(enableAllMessages()), actionCollection(), "enableAll"); + KToggleAction *act=new KToggleAction(i18n("Enable All Dialog Boxes"), 0, TQT_TQOBJECT(this), TQT_SLOT(enableAllMessages()), actionCollection(), "enableAll"); act->setCheckedState(i18n("Disable All Dialog Boxes")); - soundAction = new KToggleAction(i18n("Play &Sounds"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "sound"); - connect(soundAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(soundChanged(bool))); + soundAction = new KToggleAction(i18n("Play &Sounds"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "sound"); + connect(soundAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(soundChanged(bool))); soundAction->setChecked(config->readBoolEntry("sound", true)); - (void) new KAction(i18n("&Reload Plugins"), 0, this, TQT_SLOT(initPlugins()), actionCollection(), "reloadplugins"); - (void) new KAction(i18n("Show &Plugins"), 0, this, TQT_SLOT(showPlugins()), actionCollection(), "showplugins"); + (void) new KAction(i18n("&Reload Plugins"), 0, TQT_TQOBJECT(this), TQT_SLOT(initPlugins()), actionCollection(), "reloadplugins"); + (void) new KAction(i18n("Show &Plugins"), 0, TQT_TQOBJECT(this), TQT_SLOT(showPlugins()), actionCollection(), "showplugins"); - aboutAction = new KAction(i18n("&About Course"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "aboutcourse"); - tutorialAction = new KAction(i18n("&Tutorial"), 0, this, TQT_SLOT(tutorial()), actionCollection(), "tutorial"); + aboutAction = new KAction(i18n("&About Course"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "aboutcourse"); + tutorialAction = new KAction(i18n("&Tutorial"), 0, TQT_TQOBJECT(this), TQT_SLOT(tutorial()), actionCollection(), "tutorial"); statusBar(); setupGUI(); @@ -176,7 +176,7 @@ void Kolf::startNewGame() players.clear(); delete scoreboard; scoreboard = new ScoreBoard(dummy, "Score Board"); - layout->addWidget(scoreboard, 1, 0); + tqlayout->addWidget(scoreboard, 1, 0); scoreboard->show(); if (loadedGame.isNull()) @@ -202,7 +202,7 @@ void Kolf::startNewGame() if (isTutorial) filename = KGlobal::dirs()->findResource("appdata", "tutorial.kolf"); else - filename = config.readEntry("Course", TQString::null); + filename = config.readEntry("Course", TQString()); if (filename.isNull()) return; @@ -226,19 +226,19 @@ void Kolf::startNewGame() connect(game, TQT_SIGNAL(newHole(int)), scoreboard, TQT_SLOT(newHole(int))); connect(game, TQT_SIGNAL(scoreChanged(int, int, int)), scoreboard, TQT_SLOT(setScore(int, int, int))); connect(game, TQT_SIGNAL(parChanged(int, int)), scoreboard, TQT_SLOT(parChanged(int, int))); - connect(game, TQT_SIGNAL(modifiedChanged(bool)), this, TQT_SLOT(updateModified(bool))); - connect(game, TQT_SIGNAL(newPlayersTurn(Player *)), this, TQT_SLOT(newPlayersTurn(Player *))); - connect(game, TQT_SIGNAL(holesDone()), this, TQT_SLOT(gameOver())); - connect(game, TQT_SIGNAL(checkEditing()), this, TQT_SLOT(checkEditing())); - connect(game, TQT_SIGNAL(editingStarted()), this, TQT_SLOT(editingStarted())); - connect(game, TQT_SIGNAL(editingEnded()), this, TQT_SLOT(editingEnded())); - connect(game, TQT_SIGNAL(inPlayStart()), this, TQT_SLOT(inPlayStart())); - connect(game, TQT_SIGNAL(inPlayEnd()), this, TQT_SLOT(inPlayEnd())); - connect(game, TQT_SIGNAL(maxStrokesReached(const TQString &)), this, TQT_SLOT(maxStrokesReached(const TQString &))); - connect(game, TQT_SIGNAL(largestHole(int)), this, TQT_SLOT(updateHoleMenu(int))); - connect(game, TQT_SIGNAL(titleChanged(const TQString &)), this, TQT_SLOT(titleChanged(const TQString &))); - connect(game, TQT_SIGNAL(newStatusText(const TQString &)), this, TQT_SLOT(newStatusText(const TQString &))); - connect(game, TQT_SIGNAL(currentHole(int)), this, TQT_SLOT(setCurrentHole(int))); + connect(game, TQT_SIGNAL(modifiedChanged(bool)), TQT_TQOBJECT(this), TQT_SLOT(updateModified(bool))); + connect(game, TQT_SIGNAL(newPlayersTurn(Player *)), TQT_TQOBJECT(this), TQT_SLOT(newPlayersTurn(Player *))); + connect(game, TQT_SIGNAL(holesDone()), TQT_TQOBJECT(this), TQT_SLOT(gameOver())); + connect(game, TQT_SIGNAL(checkEditing()), TQT_TQOBJECT(this), TQT_SLOT(checkEditing())); + connect(game, TQT_SIGNAL(editingStarted()), TQT_TQOBJECT(this), TQT_SLOT(editingStarted())); + connect(game, TQT_SIGNAL(editingEnded()), TQT_TQOBJECT(this), TQT_SLOT(editingEnded())); + connect(game, TQT_SIGNAL(inPlayStart()), TQT_TQOBJECT(this), TQT_SLOT(inPlayStart())); + connect(game, TQT_SIGNAL(inPlayEnd()), TQT_TQOBJECT(this), TQT_SLOT(inPlayEnd())); + connect(game, TQT_SIGNAL(maxStrokesReached(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(maxStrokesReached(const TQString &))); + connect(game, TQT_SIGNAL(largestHole(int)), TQT_TQOBJECT(this), TQT_SLOT(updateHoleMenu(int))); + connect(game, TQT_SIGNAL(titleChanged(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(titleChanged(const TQString &))); + connect(game, TQT_SIGNAL(newStatusText(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(newStatusText(const TQString &))); + connect(game, TQT_SIGNAL(currentHole(int)), TQT_TQOBJECT(this), TQT_SLOT(setCurrentHole(int))); connect(holeAction, TQT_SIGNAL(activated(const TQString &)), game, TQT_SLOT(switchHole(const TQString &))); connect(nextAction, TQT_SIGNAL(activated()), game, TQT_SLOT(nextHole())); connect(prevAction, TQT_SIGNAL(activated()), game, TQT_SLOT(prevHole())); @@ -264,7 +264,7 @@ void Kolf::startNewGame() game->setShowGuideLine(showGuideLineAction->isChecked()); game->setSound(soundAction->isChecked()); - layout->addWidget(game, 0, 0, AlignCenter); + tqlayout->addWidget(game, 0, 0, AlignCenter); game->show(); game->setFocus(); @@ -299,7 +299,7 @@ void Kolf::startNewGame() void Kolf::newGame() { isTutorial = false; - filename = TQString::null; + filename = TQString(); startNewGame(); } @@ -309,13 +309,13 @@ void Kolf::tutorial() if (newfilename.isNull()) return; - filename = TQString::null; + filename = TQString(); loadedGame = newfilename; isTutorial = true; startNewGame(); - loadedGame = TQString::null; + loadedGame = TQString(); } void Kolf::closeGame() @@ -327,12 +327,12 @@ void Kolf::closeGame() game->pause(); } - filename = TQString::null; + filename = TQString(); editingEnded(); delete game; game = 0; - loadedGame = TQString::null; + loadedGame = TQString(); editingAction->setChecked(false); setEditingEnabled(false); @@ -353,10 +353,10 @@ void Kolf::closeGame() loadGameAction->setEnabled(true); tutorialAction->setEnabled(true); - titleChanged(TQString::null); + titleChanged(TQString()); updateModified(false); - TQTimer::singleShot(100, this, TQT_SLOT(createSpacer())); + TQTimer::singleShot(100, TQT_TQOBJECT(this), TQT_SLOT(createSpacer())); } void Kolf::createSpacer() @@ -372,7 +372,7 @@ void Kolf::createSpacer() spacer = new KolfGame(obj, &spacerPlayers, KGlobal::dirs()->findResource("appdata", "intro"), dummy); spacer->setSound(false); spacer->startFirstHole(1); - layout->addWidget(spacer, 0, 0, AlignCenter); + tqlayout->addWidget(spacer, 0, 0, AlignCenter); spacer->hidePutter(); spacer->ignoreEvents(true); @@ -431,10 +431,10 @@ void Kolf::gameOver() if (names.count() > 1) { TQString winners = names.join(i18n(" and ")); - KMessageBox::information(this, i18n("%1 tied").arg(winners)); + KMessageBox::information(this, i18n("%1 tied").tqarg(winners)); } else - KMessageBox::information(this, i18n("%1 won!").arg(names.first())); + KMessageBox::information(this, i18n("%1 won!").tqarg(names.first())); } if (competition) @@ -459,11 +459,11 @@ void Kolf::gameOver() scoreDialog->addScore((*it).score, info, false, true); } - scoreDialog->setComment(i18n("High Scores for %1").arg(courseInfo.name)); + scoreDialog->setComment(i18n("High Scores for %1").tqarg(courseInfo.name)); scoreDialog->show(); } - TQTimer::singleShot(700, this, TQT_SLOT(closeGame())); + TQTimer::singleShot(700, TQT_TQOBJECT(this), TQT_SLOT(closeGame())); } void Kolf::showHighScores() @@ -475,7 +475,7 @@ void Kolf::showHighScores() game->courseInfo(courseInfo, game->curFilename()); scoreDialog->setConfigGroup(courseInfo.untranslatedName + TQString(" Highscores")); - scoreDialog->setComment(i18n("High Scores for %1").arg(courseInfo.name)); + scoreDialog->setComment(i18n("High Scores for %1").tqarg(courseInfo.name)); scoreDialog->show(); } @@ -537,7 +537,7 @@ void Kolf::saveGame() void Kolf::loadGame() { - loadedGame = KFileDialog::getOpenFileName(":savedkolf", TQString::fromLatin1("application/x-kolf"), this, i18n("Pick Kolf Saved Game")); + loadedGame = KFileDialog::getOpenFileName(":savedkolf", TQString::tqfromLatin1("application/x-kolf"), this, i18n("Pick Kolf Saved Game")); if (loadedGame.isNull()) return; @@ -564,7 +564,7 @@ void Kolf::openURL(KURL url) return; } - TQTimer::singleShot(10, this, TQT_SLOT(startNewGame())); + TQTimer::singleShot(10, TQT_TQOBJECT(this), TQT_SLOT(startNewGame())); } else closeGame(); @@ -572,7 +572,7 @@ void Kolf::openURL(KURL url) void Kolf::newPlayersTurn(Player *player) { - tempStatusBarText = i18n("%1's turn").arg(player->name()); + tempStatusBarText = i18n("%1's turn").tqarg(player->name()); if (showInfoAction->isChecked()) statusBar()->message(tempStatusBarText, 5 * 1000); @@ -596,12 +596,12 @@ void Kolf::editingStarted() editor = new Editor(obj, dummy, "Editor"); connect(editor, TQT_SIGNAL(addNewItem(Object *)), game, TQT_SLOT(addNewObject(Object *))); connect(editor, TQT_SIGNAL(changed()), game, TQT_SLOT(setModified())); - connect(editor, TQT_SIGNAL(addNewItem(Object *)), this, TQT_SLOT(setHoleFocus())); + connect(editor, TQT_SIGNAL(addNewItem(Object *)), TQT_TQOBJECT(this), TQT_SLOT(setHoleFocus())); connect(game, TQT_SIGNAL(newSelectedItem(CanvasItem *)), editor, TQT_SLOT(setItem(CanvasItem *))); scoreboard->hide(); - layout->addWidget(editor, 1, 0); + tqlayout->addWidget(editor, 1, 0); editor->show(); clearHoleAction->setEnabled(true); @@ -643,7 +643,7 @@ void Kolf::inPlayEnd() void Kolf::maxStrokesReached(const TQString &name) { - KMessageBox::sorry(this, i18n("%1's score has reached the maximum for this hole.").arg(name)); + KMessageBox::sorry(this, i18n("%1's score has reached the maximum for this hole.").tqarg(name)); } void Kolf::updateHoleMenu(int largest) @@ -697,7 +697,7 @@ void Kolf::print() KPrinter pr; pr.addDialogPage(new PrintDialogPage()); - if (pr.setup(this, i18n("Print %1 - Hole %2").arg(game->courseName()).arg(game->currentHole()))) + if (pr.setup(this, i18n("Print %1 - Hole %2").tqarg(game->courseName()).tqarg(game->currentHole()))) { pr.newPage(); if (game) @@ -785,14 +785,14 @@ void Kolf::initPlugins() void Kolf::showPlugins() { - TQString text = TQString("

%1

    ").arg(i18n("Currently Loaded Plugins")); + TQString text = TQString("

    %1

      ").tqarg(i18n("Currently Loaded Plugins")); Object *object = 0; for (object = plugins.first(); object; object = plugins.next()) { text.append("
    1. "); text.append(object->name()); text.append(" - "); - text.append(i18n("by %1").arg(object->author())); + text.append(i18n("by %1").tqarg(object->author())); text.append("
    2. "); } text.append("
    "); diff --git a/kolf/kolf.h b/kolf/kolf.h index b57b2774..62892ea7 100644 --- a/kolf/kolf.h +++ b/kolf/kolf.h @@ -27,6 +27,7 @@ class Editor; class KDE_EXPORT Kolf : public KMainWindow { Q_OBJECT + TQ_OBJECT public: Kolf(); @@ -87,7 +88,7 @@ private: TQString filename; PlayerList players; PlayerList spacerPlayers; - TQGridLayout *layout; + TQGridLayout *tqlayout; ScoreBoard *scoreboard; KToggleAction *editingAction; KAction *newHoleAction; diff --git a/kolf/kvolumecontrol.cpp b/kolf/kvolumecontrol.cpp index e2aaa464..b2028b77 100644 --- a/kolf/kvolumecontrol.cpp +++ b/kolf/kvolumecontrol.cpp @@ -5,14 +5,14 @@ #include "kvolumecontrol.h" -KVolumeControl::KVolumeControl(Arts::SoundServerV2 server, KPlayObject *parent) - : TQObject(parent) +KVolumeControl::KVolumeControl(Arts::SoundServerV2 server, KPlayObject *tqparent) + : TQObject(tqparent) { init(server); } -KVolumeControl::KVolumeControl(double vol, Arts::SoundServerV2 server, KPlayObject *parent) - : TQObject(parent) +KVolumeControl::KVolumeControl(double vol, Arts::SoundServerV2 server, KPlayObject *tqparent) + : TQObject(tqparent) { init(server); setVolume(vol); @@ -42,8 +42,8 @@ void KVolumeControl::init(Arts::SoundServerV2 server) } volumeControl.start(); - Arts::connect((static_cast(parent()))->object(), "left", volumeControl, "inleft"); - Arts::connect((static_cast(parent()))->object(), "right", volumeControl, "inright"); + Arts::connect((static_cast(tqparent()))->object(), "left", volumeControl, "inleft"); + Arts::connect((static_cast(tqparent()))->object(), "right", volumeControl, "inright"); Arts::connect(volumeControl, manager); } diff --git a/kolf/kvolumecontrol.h b/kolf/kvolumecontrol.h index ab7632f4..190b3beb 100644 --- a/kolf/kvolumecontrol.h +++ b/kolf/kvolumecontrol.h @@ -6,13 +6,14 @@ #include #include -class KVolumeControl : public QObject +class KVolumeControl : public TQObject { Q_OBJECT + TQ_OBJECT public: - KVolumeControl(Arts::SoundServerV2 server, KPlayObject *parent); - KVolumeControl(double vol, Arts::SoundServerV2 server, KPlayObject *parent); + KVolumeControl(Arts::SoundServerV2 server, KPlayObject *tqparent); + KVolumeControl(double vol, Arts::SoundServerV2 server, KPlayObject *tqparent); ~KVolumeControl(); void setVolume(double); diff --git a/kolf/main.cpp b/kolf/main.cpp index e9e8498a..079178ee 100644 --- a/kolf/main.cpp +++ b/kolf/main.cpp @@ -57,16 +57,16 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) KolfGame::courseInfo(info, filename); cout << info.name.latin1() - << " - " << i18n("By %1").arg(info.author).latin1() - << " - " << i18n("%1 holes").arg(info.holes).latin1() - << " - " << i18n("par %1").arg(info.par).latin1() + << " - " << i18n("By %1").tqarg(info.author).latin1() + << " - " << i18n("%1 holes").tqarg(info.holes).latin1() + << " - " << i18n("par %1").tqarg(info.par).latin1() << endl; return 0; } else { - KCmdLineArgs::usage(i18n("Course %1 does not exist.").arg(filename.latin1())); + KCmdLineArgs::usage(i18n("Course %1 does not exist.").tqarg(filename.latin1())); } } diff --git a/kolf/newgame.cpp b/kolf/newgame.cpp index 22c6b785..2fd048c1 100644 --- a/kolf/newgame.cpp +++ b/kolf/newgame.cpp @@ -35,8 +35,8 @@ #include "newgame.h" #include "game.h" -NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_name) - : KDialogBase(KDialogBase::TreeList, i18n("New Game"), Ok | Cancel, Ok, parent, _name) +NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *tqparent, const char *_name) + : KDialogBase(KDialogBase::TreeList, i18n("New Game"), Ok | Cancel, Ok, tqparent, _name) { this->enableCourses = enableCourses; @@ -56,14 +56,14 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_ scroller = new TQScrollView(playerPage); bigLayout->addWidget(scroller); - layout = new TQVBox(scroller->viewport()); - if (!TQPixmapCache::find("grass", grass)) + tqlayout = new TQVBox(scroller->viewport()); + if (!TQPixmapCache::tqfind("grass", grass)) { grass.load(locate("appdata", "pics/grass.png")); TQPixmapCache::insert("grass", grass); } scroller->viewport()->setBackgroundPixmap(grass); - scroller->addChild(layout); + scroller->addChild(tqlayout); TQMap entries = config->entryMap("New Game Dialog"); unsigned int i = 0; @@ -95,7 +95,7 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_ connect(coursesLink, TQT_SIGNAL(leftClickedURL(const TQString &)), kapp, TQT_SLOT(invokeBrowser(const TQString &))); coursePageLayout->addWidget(coursesLink); - TQHBoxLayout *hlayout = new TQHBoxLayout(coursePageLayout, spacingHint()); + TQHBoxLayout *htqlayout = new TQHBoxLayout(coursePageLayout, spacingHint()); // following use this group config->setGroup("New Game Dialog Mode"); @@ -123,18 +123,18 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_ } const TQString newName(i18n("Create New")); - info[TQString::null] = CourseInfo(newName, newName, i18n("You"), 0, 0); - names.append(TQString::null); + info[TQString()] = CourseInfo(newName, newName, i18n("You"), 0, 0); + names.append(TQString()); nameList.append(newName); courseList = new KListBox(coursePage); - hlayout->addWidget(courseList); + htqlayout->addWidget(courseList); courseList->insertStringList(nameList); courseList->setCurrentItem(curItem); connect(courseList, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(courseSelected(int))); connect(courseList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(selectionChanged())); - TQVBoxLayout *detailLayout = new TQVBoxLayout(hlayout, spacingHint()); + TQVBoxLayout *detailLayout = new TQVBoxLayout(htqlayout, spacingHint()); name = new TQLabel(coursePage); detailLayout->addWidget(name); author = new TQLabel(coursePage); @@ -170,15 +170,15 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_ // options page optionsPage = addPage(i18n("Options"), i18n("Game Options")); - TQVBoxLayout *vlayout = new TQVBoxLayout(optionsPage, marginHint(), spacingHint()); + TQVBoxLayout *vtqlayout = new TQVBoxLayout(optionsPage, marginHint(), spacingHint()); mode = new TQCheckBox(i18n("&Strict mode"), optionsPage); - vlayout->addWidget(mode); + vtqlayout->addWidget(mode); mode->setChecked(config->readBoolEntry("competition", false)); TQLabel *desc = new TQLabel(i18n("In strict mode, undo, editing, and switching holes is not allowed. This is generally for competition. Only in strict mode are highscores kept."), optionsPage); desc->setTextFormat(RichText); - vlayout->addWidget(desc); + vtqlayout->addWidget(desc); } void NewGameDialog::slotOk() @@ -199,7 +199,7 @@ void NewGameDialog::slotOk() PlayerEditor *curEditor = 0; int i = 0; for (curEditor = editors.first(); curEditor; curEditor = editors.next(), ++i) - config->writeEntry(TQString::number(i) + curEditor->name(), curEditor->color().name()); + config->writeEntry(TQString::number(i) + curEditor->name(), TQString(curEditor->color().name())); config->sync(); @@ -212,11 +212,11 @@ void NewGameDialog::courseSelected(int index) CourseInfo &curinfo = info[currentCourse]; - name->setText(TQString("%1").arg(curinfo.name)); + name->setText(TQString("%1").tqarg(curinfo.name)); - author->setText(i18n("By %1").arg(curinfo.author)); - par->setText(i18n("Par %1").arg(curinfo.par)); - holes->setText(i18n("%1 Holes").arg(curinfo.holes)); + author->setText(i18n("By %1").tqarg(curinfo.author)); + par->setText(i18n("Par %1").tqarg(curinfo.par)); + holes->setText(i18n("%1 Holes").tqarg(curinfo.holes)); } void NewGameDialog::showHighscores() @@ -224,7 +224,7 @@ void NewGameDialog::showHighscores() KScoreDialog *scoreDialog = new KScoreDialog(KScoreDialog::Name | KScoreDialog::Custom1 | KScoreDialog::Score, this); scoreDialog->addField(KScoreDialog::Custom1, i18n("Par"), "Par"); scoreDialog->setConfigGroup(info[currentCourse].untranslatedName + TQString(" Highscores")); - scoreDialog->setComment(i18n("High Scores for %1").arg(info[currentCourse].name)); + scoreDialog->setComment(i18n("High Scores for %1").tqarg(info[currentCourse].name)); scoreDialog->show(); } @@ -235,7 +235,7 @@ void NewGameDialog::removeCourse() return; TQString file = *names.at(curItem); - if (externCourses.contains(file) < 1) + if (externCourses.tqcontains(file) < 1) return; names.remove(file); @@ -248,18 +248,18 @@ void NewGameDialog::removeCourse() void NewGameDialog::selectionChanged() { const int curItem = courseList->currentItem(); - remove->setEnabled(!(curItem < 0 || externCourses.contains(*names.at(curItem)) < 1)); + remove->setEnabled(!(curItem < 0 || externCourses.tqcontains(*names.at(curItem)) < 1)); } void NewGameDialog::addCourse() { - TQStringList files = KFileDialog::getOpenFileNames(":kourses", TQString::fromLatin1("application/x-kourse"), this, i18n("Pick Kolf Course")); + TQStringList files = KFileDialog::getOpenFileNames(":kourses", TQString::tqfromLatin1("application/x-kourse"), this, i18n("Pick Kolf Course")); bool hasDuplicates = false; for (TQStringList::Iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) { - if (names.contains(*fileIt) > 0) + if (names.tqcontains(*fileIt) > 0) { hasDuplicates = true; continue; @@ -287,7 +287,7 @@ void NewGameDialog::addPlayer() if (editors.count() >= startColors.count()) return; - editors.append(new PlayerEditor(i18n("Player %1").arg(editors.count() + 1), *startColors.at(editors.count()), layout)); + editors.append(new PlayerEditor(i18n("Player %1").tqarg(editors.count() + 1), *startColors.at(editors.count()), tqlayout)); editors.last()->show(); connect(editors.last(), TQT_SIGNAL(deleteEditor(PlayerEditor *)), this, TQT_SLOT(deleteEditor(PlayerEditor *))); @@ -311,12 +311,12 @@ void NewGameDialog::enableButtons() ///////////////////////// -PlayerEditor::PlayerEditor(TQString startName, TQColor startColor, TQWidget *parent, const char *_name) - : TQWidget(parent, _name) +PlayerEditor::PlayerEditor(TQString startName, TQColor startColor, TQWidget *tqparent, const char *_name) + : TQWidget(tqparent, _name) { - TQHBoxLayout *layout = new TQHBoxLayout(this, KDialogBase::spacingHint()); + TQHBoxLayout *tqlayout = new TQHBoxLayout(this, KDialogBase::spacingHint()); - if (!TQPixmapCache::find("grass", grass)) + if (!TQPixmapCache::tqfind("grass", grass)) { grass.load(locate("appdata", "pics/grass.png")); TQPixmapCache::insert("grass", grass); @@ -324,17 +324,17 @@ PlayerEditor::PlayerEditor(TQString startName, TQColor startColor, TQWidget *par setBackgroundPixmap(grass); editor = new KLineEdit(this); - layout->addWidget(editor); + tqlayout->addWidget(editor); editor->setFrame(false); editor->setText(startName); - layout->addStretch(); - layout->addWidget(colorButton = new KColorButton(startColor, this)); + tqlayout->addStretch(); + tqlayout->addWidget(colorButton = new KColorButton(startColor, this)); colorButton->setAutoMask(true); colorButton->setBackgroundPixmap(grass); KPushButton *remove = new KPushButton(i18n("Remove"), this); remove->setAutoMask(true); - layout->addWidget(remove); + tqlayout->addWidget(remove); remove->setBackgroundPixmap(grass); connect(remove, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeMe())); } diff --git a/kolf/newgame.h b/kolf/newgame.h index c4e228a4..ce5b8060 100644 --- a/kolf/newgame.h +++ b/kolf/newgame.h @@ -24,12 +24,13 @@ class TQPainter; class KListBox; class TQEvent; -class PlayerEditor : public QWidget +class PlayerEditor : public TQWidget { Q_OBJECT + TQ_OBJECT public: - PlayerEditor(TQString name = TQString::null, TQColor = red, TQWidget *parent = 0, const char *_name = 0); + PlayerEditor(TQString name = TQString(), TQColor = red, TQWidget *tqparent = 0, const char *_name = 0); TQColor color() { return colorButton->color(); } TQString name() { return editor->text(); } void setColor(TQColor col) { colorButton->setColor(col); } @@ -50,9 +51,10 @@ private: class NewGameDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - NewGameDialog(bool enableCourses, TQWidget *parent, const char *_name = 0); + NewGameDialog(bool enableCourses, TQWidget *tqparent, const char *_name = 0); TQPtrList *players() { return &editors; } bool competition() { return mode->isChecked(); } TQString course() { return currentCourse; } @@ -72,7 +74,7 @@ private slots: void showHighscores(); private: - TQVBox *layout; + TQVBox *tqlayout; KPushButton *addButton; TQFrame *playerPage; TQScrollView *scroller; diff --git a/kolf/object.h b/kolf/object.h index 1ef52c55..74464bb6 100644 --- a/kolf/object.h +++ b/kolf/object.h @@ -7,12 +7,13 @@ #include #include -class Object : public QObject +class Object : public TQObject { Q_OBJECT + TQ_OBJECT public: - Object(TQObject *parent = 0, const char *name = 0) : TQObject(parent, name) { m_addOnNewHole = false; } + Object(TQObject *tqparent = 0, const char *name = 0) : TQObject(tqparent, name) { m_addOnNewHole = false; } virtual TQCanvasItem *newObject(TQCanvas * /*canvas*/) { return 0; } TQString name() { return m_name; } TQString _name() { return m__name; } diff --git a/kolf/objects/poolball/poolball.cpp b/kolf/objects/poolball/poolball.cpp index c2fe0718..18d3ca5b 100644 --- a/kolf/objects/poolball/poolball.cpp +++ b/kolf/objects/poolball/poolball.cpp @@ -54,20 +54,20 @@ void PoolBall::draw(TQPainter &p) Ball::draw(p); } -PoolBallConfig::PoolBallConfig(PoolBall *poolBall, TQWidget *parent) - : Config(parent), m_poolBall(poolBall) +PoolBallConfig::PoolBallConfig(PoolBall *poolBall, TQWidget *tqparent) + : Config(tqparent), m_poolBall(poolBall) { - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); - layout->addStretch(); + tqlayout->addStretch(); TQLabel *num = new TQLabel(i18n("Number:"), this); - layout->addWidget(num); + tqlayout->addWidget(num); KIntNumInput *slider = new KIntNumInput(m_poolBall->number(), this); slider->setRange(1, 15); - layout->addWidget(slider); + tqlayout->addWidget(slider); - layout->addStretch(); + tqlayout->addStretch(); connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(numberChanged(int))); } @@ -78,9 +78,9 @@ void PoolBallConfig::numberChanged(int newNumber) changed(); } -Config *PoolBall::config(TQWidget *parent) +Config *PoolBall::config(TQWidget *tqparent) { - return new PoolBallConfig(this, parent); + return new PoolBallConfig(this, tqparent); } #include "poolball.moc" diff --git a/kolf/objects/poolball/poolball.h b/kolf/objects/poolball/poolball.h index 82b1dd68..312e1996 100644 --- a/kolf/objects/poolball/poolball.h +++ b/kolf/objects/poolball/poolball.h @@ -15,7 +15,7 @@ class StateDB; class KConfig; -class PoolBallFactory : KLibFactory { Q_OBJECT public: TQObject *createObject(TQObject *, const char *, const char *, const TQStringList & = TQStringList()); }; +class PoolBallFactory : KLibFactory { TQ_OBJECT public: TQObject *createObject(TQObject *, const char *, const char *, const TQStringList & = TQStringList()); }; class PoolBall : public Ball { @@ -24,7 +24,7 @@ public: virtual bool deleteable() const { return true; } - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); virtual void saveState(StateDB *); virtual void save(KConfig *cfg); virtual void loadState(StateDB *); @@ -42,9 +42,10 @@ private: class PoolBallConfig : public Config { Q_OBJECT + TQ_OBJECT public: - PoolBallConfig(PoolBall *poolBall, TQWidget *parent); + PoolBallConfig(PoolBall *poolBall, TQWidget *tqparent); private slots: void numberChanged(int); diff --git a/kolf/objects/test/test.cpp b/kolf/objects/test/test.cpp index d417f552..38a40f22 100644 --- a/kolf/objects/test/test.cpp +++ b/kolf/objects/test/test.cpp @@ -14,7 +14,7 @@ #include "test.h" K_EXPORT_COMPONENT_FACTORY(libkolftest, TestFactory) -TQObject *TestFactory::createObject (TQObject * /*parent*/, const char * /*name*/, const char * /*classname*/, const TQStringList & /*args*/) +TQObject *TestFactory::createObject (TQObject * /*tqparent*/, const char * /*name*/, const char * /*classname*/, const TQStringList & /*args*/) { return new TestObj; } Test::Test(TQCanvas *canvas) @@ -39,9 +39,9 @@ void Test::advance(int phase) if (count % m_switchEvery == 0) { // random color - const TQColor myColor((QRgb)(kapp->random() % 0x01000000)); + const TQColor myColor((TQRgb)(kapp->random() % 0x01000000)); - // set the brush, so our shape is drawn + // set the brush, so our tqshape is drawn // with the random color setBrush(TQBrush(myColor)); @@ -65,24 +65,24 @@ void Test::load(KConfig *cfg) setSwitchEvery(cfg->readNumEntry("switchEvery", 50)); } -TestConfig::TestConfig(Test *test, TQWidget *parent) - : Config(parent), m_test(test) +TestConfig::TestConfig(Test *test, TQWidget *tqparent) + : Config(tqparent), m_test(test) { - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); - layout->addStretch(); + tqlayout->addStretch(); - layout->addWidget(new TQLabel(i18n("Flash speed"), this)); + tqlayout->addWidget(new TQLabel(i18n("Flash speed"), this)); - TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); + TQHBoxLayout *htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); TQLabel *slow = new TQLabel(i18n("Slow"), this); - hlayout->addWidget(slow); + htqlayout->addWidget(slow); TQSlider *slider = new TQSlider(1, 100, 5, 101 - m_test->switchEvery(), Qt::Horizontal, this); - hlayout->addWidget(slider); + htqlayout->addWidget(slider); TQLabel *fast = new TQLabel(i18n("Fast"), this); - hlayout->addWidget(fast); + htqlayout->addWidget(fast); - layout->addStretch(); + tqlayout->addStretch(); connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(switchEveryChanged(int))); } @@ -96,9 +96,9 @@ void TestConfig::switchEveryChanged(int news) changed(); } -Config *Test::config(TQWidget *parent) +Config *Test::config(TQWidget *tqparent) { - return new TestConfig(this, parent); + return new TestConfig(this, tqparent); } #include "test.moc" diff --git a/kolf/objects/test/test.h b/kolf/objects/test/test.h index 06e9f30a..690a7e84 100644 --- a/kolf/objects/test/test.h +++ b/kolf/objects/test/test.h @@ -11,14 +11,14 @@ class KConfig; -class TestFactory : KLibFactory { Q_OBJECT public: TQObject *createObject(TQObject *, const char *, const char *, const TQStringList & = TQStringList()); }; +class TestFactory : KLibFactory { TQ_OBJECT public: TQObject *createObject(TQObject *, const char *, const char *, const TQStringList & = TQStringList()); }; class Test : public TQCanvasEllipse, public CanvasItem { public: Test(TQCanvas *canvas); - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); @@ -35,9 +35,10 @@ private: class TestConfig : public Config { Q_OBJECT + TQ_OBJECT public: - TestConfig(Test *test, TQWidget *parent); + TestConfig(Test *test, TQWidget *tqparent); private slots: void switchEveryChanged(int news); diff --git a/kolf/printdialogpage.cpp b/kolf/printdialogpage.cpp index e8733c81..dfec9c96 100644 --- a/kolf/printdialogpage.cpp +++ b/kolf/printdialogpage.cpp @@ -8,16 +8,16 @@ #include "printdialogpage.h" -PrintDialogPage::PrintDialogPage(TQWidget *parent, const char *name) - : KPrintDialogPage( parent, name ) +PrintDialogPage::PrintDialogPage(TQWidget *tqparent, const char *name) + : KPrintDialogPage( tqparent, name ) { setTitle(i18n("Kolf Options")); - TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); titleCheck = new TQCheckBox(i18n("Draw title text"), this); titleCheck->setChecked(true); - layout->addWidget(titleCheck); + tqlayout->addWidget(titleCheck); } void PrintDialogPage::getOptions(TQMap &opts, bool /*incldef*/) diff --git a/kolf/printdialogpage.h b/kolf/printdialogpage.h index 76b7c43a..4869ea53 100644 --- a/kolf/printdialogpage.h +++ b/kolf/printdialogpage.h @@ -11,9 +11,10 @@ class TQWidget; class PrintDialogPage : public KPrintDialogPage { Q_OBJECT + TQ_OBJECT public: - PrintDialogPage(TQWidget *parent = 0, const char *name = 0); + PrintDialogPage(TQWidget *tqparent = 0, const char *name = 0); //reimplement virtual functions void getOptions(TQMap &opts, bool incldef = false); diff --git a/kolf/scoreboard.cpp b/kolf/scoreboard.cpp index 61ff9926..cdd5759b 100644 --- a/kolf/scoreboard.cpp +++ b/kolf/scoreboard.cpp @@ -9,15 +9,15 @@ #include "scoreboard.h" -ScoreBoard::ScoreBoard(TQWidget *parent, const char *name) - : TQTable(1, 1, parent, name) +ScoreBoard::ScoreBoard(TQWidget *tqparent, const char *name) + : TQTable(1, 1, tqparent, name) { vh = verticalHeader(); hh = horizontalHeader(); vh->setLabel(numRows() - 1, i18n("Par")); hh->setLabel(numCols() - 1, i18n("Total")); - setFocusPolicy(TQWidget::NoFocus); + setFocusPolicy(TQ_NoFocus); setRowReadOnly(0, true); setRowReadOnly(1, true); } diff --git a/kolf/scoreboard.h b/kolf/scoreboard.h index b9caf652..f15a323a 100644 --- a/kolf/scoreboard.h +++ b/kolf/scoreboard.h @@ -6,12 +6,13 @@ class TQWidget; class TQHeader; -class ScoreBoard : public QTable +class ScoreBoard : public TQTable { Q_OBJECT + TQ_OBJECT public: - ScoreBoard(TQWidget *parent = 0, const char *name = 0); + ScoreBoard(TQWidget *tqparent = 0, const char *name = 0); int total(int id, TQString &name); public slots: diff --git a/kolf/slope.cpp b/kolf/slope.cpp index a6a1abf1..dd40cc49 100644 --- a/kolf/slope.cpp +++ b/kolf/slope.cpp @@ -34,7 +34,7 @@ Slope::Slope(TQRect rect, TQCanvas *canvas) setZ(-50); - if (!TQPixmapCache::find("grass", grass)) + if (!TQPixmapCache::tqfind("grass", grass)) { grass.load(locate("appdata", "pics/grass.png")); TQPixmapCache::insert("grass", grass); @@ -71,7 +71,7 @@ void Slope::showInfo() arrow->setZ(z() + .01); arrow->setVisible(true); } - text->setVisible(true); + text->tqsetVisible(true); } void Slope::hideInfo() @@ -80,7 +80,7 @@ void Slope::hideInfo() Arrow *arrow = 0; for (arrow = arrows.first(); arrow; arrow = arrows.next()) arrow->setVisible(false); - text->setVisible(false); + text->tqsetVisible(false); } void Slope::aboutToDie() @@ -179,7 +179,7 @@ void Slope::moveArrow() void Slope::editModeChanged(bool changed) { - point->setVisible(changed); + point->tqsetVisible(changed); moveBy(0, 0); } @@ -501,13 +501,13 @@ void Slope::updatePixmap() // shift all the points for (unsigned int i = 0; i < r.count(); ++i) { - TQPoint &p = r[i]; + QPoint &p = r[i]; p.setX(p.x() - x()); p.setY(p.y() - y()); } bpainter.drawPolygon(r); - // mask is drawn + // tqmask is drawn pixmap.setMask(bitmap); } @@ -517,11 +517,11 @@ void Slope::updatePixmap() ///////////////////////// -SlopeConfig::SlopeConfig(Slope *slope, TQWidget *parent) - : Config(parent) +SlopeConfig::SlopeConfig(Slope *slope, TQWidget *tqparent) + : Config(tqparent) { this->slope = slope; - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); KComboBox *gradient = new KComboBox(this); TQStringList items; TQString curText; @@ -533,28 +533,28 @@ SlopeConfig::SlopeConfig(Slope *slope, TQWidget *parent) } gradient->insertStringList(items); gradient->setCurrentText(curText); - layout->addWidget(gradient); + tqlayout->addWidget(gradient); connect(gradient, TQT_SIGNAL(activated(const TQString &)), this, TQT_SLOT(setGradient(const TQString &))); - layout->addStretch(); + tqlayout->addStretch(); TQCheckBox *reversed = new TQCheckBox(i18n("Reverse direction"), this); reversed->setChecked(slope->isReversed()); - layout->addWidget(reversed); + tqlayout->addWidget(reversed); connect(reversed, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setReversed(bool))); - TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Grade:"), this)); + TQHBoxLayout *htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Grade:"), this)); KDoubleNumInput *grade = new KDoubleNumInput(this); grade->setRange(0, 8, 1, true); grade->setValue(slope->curGrade()); - hlayout->addWidget(grade); + htqlayout->addWidget(grade); connect(grade, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(gradeChanged(double))); TQCheckBox *stuck = new TQCheckBox(i18n("Unmovable"), this); TQWhatsThis::add(stuck, i18n("Whether or not this slope can be moved by other objects, like floaters.")); stuck->setChecked(slope->isStuckOnGround()); - layout->addWidget(stuck); + tqlayout->addWidget(stuck); connect(stuck, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setStuckOnGround(bool))); } diff --git a/kolf/slope.h b/kolf/slope.h index 1bca5e5e..c829ad36 100644 --- a/kolf/slope.h +++ b/kolf/slope.h @@ -9,9 +9,10 @@ class Slope; class SlopeConfig : public Config { Q_OBJECT + TQ_OBJECT public: - SlopeConfig(Slope *slope, TQWidget *parent); + SlopeConfig(Slope *slope, TQWidget *tqparent); private slots: void setGradient(const TQString &text); @@ -35,7 +36,7 @@ public: virtual void editModeChanged(bool changed); virtual bool canBeMovedByOthers() const { return !stuckOnGround; } virtual TQPtrList moveableItems() const; - virtual Config *config(TQWidget *parent) { return new SlopeConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new SlopeConfig(this, tqparent); } void setSize(int, int); virtual void newSize(int width, int height); diff --git a/kolf/tutorial.kolf b/kolf/tutorial.kolf index cfc5f5af..eaddc8aa 100644 --- a/kolf/tutorial.kolf +++ b/kolf/tutorial.kolf @@ -188,7 +188,7 @@ Comment[pl]=Aby wycelować kij, wciÅ›nij klawisz z lewÄ… lub prawÄ… strzaÅ‚kÄ… ( Comment[pt]=Para apontar o taco, carregue nas teclas Esquerda (rodar no sentido contrário aos ponteiros do relógio) e Direita (rodar nos ponteiros do relógio) ou use o rato. Comment[pt_BR]=Para direcionar a mira, pressione a seta para Esquerda (rotação no sentido anti-horário) e Direita (sentido horário) ou use o mouse. Comment[ru]=Чтобы прицелитьÑÑ, нажмите Ñтрелку влево (поворот против чаÑовой Ñтрелки) или вправо (по чаÑовой) или иÑпользуйте мышь. -Comment[sk]=Smer urÄíte pomocou Å¡ipky vľavo (otoÄenie proti smeru hodinových ruÄiÄiek) a vpravo (otoÄenie po smere) alebo použite myÅ¡. +Comment[sk]=Smer urÄíte potqmocou Å¡ipky vľavo (otoÄenie proti smeru hodinových ruÄiÄiek) a vpravo (otoÄenie po smere) alebo použite myÅ¡. Comment[sl]=Da namerite palico, pritisnite puÅ¡Äici levo (zasuk v nasprotni smeri urinega kazalca) ali desno (zasuk v smeri urinega kazalca) ali uporabite miÅ¡ko. Comment[sr]=Да биÑте нациљали путер притиÑните леву Ñтрелицу (окреће Ñупротно Ñмеру казаљке на чаÑовнику) или деÑну (у Ñмеру казаљке на чаÑовнику), или кориÑтите миша. Comment[sr@Latn]=Da biste naciljali puter pritisnite levu strelicu (okreće suprotno smeru kazaljke na Äasovniku) ili desnu (u smeru kazaljke na Äasovniku), ili koristite miÅ¡a. diff --git a/konquest/fleetdlg.cc b/konquest/fleetdlg.cc index e933e895..e2194089 100644 --- a/konquest/fleetdlg.cc +++ b/konquest/fleetdlg.cc @@ -8,7 +8,7 @@ #include "fleetdlg.h" -FleetDlgListViewItem::FleetDlgListViewItem(TQListView *parent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5) : TQListViewItem(parent, s1, s2, s3, s4, s5) +FleetDlgListViewItem::FleetDlgListViewItem(TQListView *tqparent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5) : TQListViewItem(tqparent, s1, s2, s3, s4, s5) { } @@ -35,8 +35,8 @@ int FleetDlgListViewItem::compare(TQListViewItem *i, int col, bool) const } -FleetDlg::FleetDlg( TQWidget *parent, AttackFleetList *fleets ) - : TQDialog(parent, "FleetDlg", true ), fleetList(fleets) +FleetDlg::FleetDlg( TQWidget *tqparent, AttackFleetList *fleets ) + : TQDialog(tqparent, "FleetDlg", true ), fleetList(fleets) { setCaption( kapp->makeStdCaption(i18n("Fleet Overview")) ); @@ -46,21 +46,21 @@ FleetDlg::FleetDlg( TQWidget *parent, AttackFleetList *fleets ) fleetTable->addColumn(i18n("Ships")); fleetTable->addColumn(i18n("Kill Percentage")); fleetTable->addColumn(i18n("Arrival Turn")); - fleetTable->setMinimumSize( fleetTable->sizeHint() ); + fleetTable->setMinimumSize( fleetTable->tqsizeHint() ); KPushButton *okButton = new KPushButton( KStdGuiItem::ok(), this ); - okButton->setMinimumSize( okButton->sizeHint() ); + okButton->setMinimumSize( okButton->tqsizeHint() ); okButton->setDefault(true); - TQVBoxLayout *layout1 = new TQVBoxLayout( this ); - TQHBoxLayout *layout2 = new TQHBoxLayout; + TQVBoxLayout *tqlayout1 = new TQVBoxLayout( this ); + TQHBoxLayout *tqlayout2 = new TQHBoxLayout; - layout1->addWidget( fleetTable, 1 ); - layout1->addLayout( layout2 ); + tqlayout1->addWidget( fleetTable, 1 ); + tqlayout1->addLayout( tqlayout2 ); - layout2->addStretch( 2 ); - layout2->addWidget( okButton ); - layout2->addStretch( 2 ); + tqlayout2->addStretch( 2 ); + tqlayout2->addWidget( okButton ); + tqlayout2->addStretch( 2 ); connect( okButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()) ); @@ -79,10 +79,10 @@ FleetDlg::init() while( (curFleet = nextFleet())) { fleetNumber++; new FleetDlgListViewItem(fleetTable, - TQString("%1").arg(fleetNumber), + TQString("%1").tqarg(fleetNumber), curFleet->destination->getName(), - TQString("%1").arg(curFleet->getShipCount()), - TQString("%1").arg(KGlobal::locale()->formatNumber(curFleet->killPercentage, 3)), - TQString("%1").arg((int)ceil(curFleet->arrivalTurn))); + TQString("%1").tqarg(curFleet->getShipCount()), + TQString("%1").tqarg(KGlobal::locale()->formatNumber(curFleet->killPercentage, 3)), + TQString("%1").tqarg((int)ceil(curFleet->arrivalTurn))); } } diff --git a/konquest/fleetdlg.h b/konquest/fleetdlg.h index 7937f69e..a823cf0c 100644 --- a/konquest/fleetdlg.h +++ b/konquest/fleetdlg.h @@ -7,17 +7,17 @@ #include "gamecore.h" -class FleetDlgListViewItem : public QListViewItem +class FleetDlgListViewItem : public TQListViewItem { public: - FleetDlgListViewItem(TQListView *parent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5); + FleetDlgListViewItem(TQListView *tqparent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5); int compare(TQListViewItem *i, int col, bool) const; }; class FleetDlg : public TQDialog { public: - FleetDlg( TQWidget *parent, AttackFleetList *fleets ); + FleetDlg( TQWidget *tqparent, AttackFleetList *fleets ); private: void init(); diff --git a/konquest/gameboard.cc b/konquest/gameboard.cc index 17b40272..96433e02 100644 --- a/konquest/gameboard.cc +++ b/konquest/gameboard.cc @@ -33,8 +33,8 @@ /********************************************************************* Game Board *********************************************************************/ -GameBoard::GameBoard( TQWidget *parent ) - : TQWidget( parent ), gameInProgress( false ), gameState( NONE ) +GameBoard::GameBoard( TQWidget *tqparent ) + : TQWidget( tqparent ), gameInProgress( false ), gameState( NONE ) { TQColorGroup cg( white, black, green.light(), green.dark(), green, green.dark(75), green.dark() ); TQPalette palette( cg, cg, cg ); @@ -53,17 +53,17 @@ GameBoard::GameBoard( TQWidget *parent ) msgWidget->setTextFormat(LogText); msgWidget->setMinimumHeight(100); msgWidget->setHScrollBarMode(TQScrollView::AlwaysOff); - msgWidget->setPaper(TQBrush(Qt::black)); + msgWidget->setPaper(TQBrush(TQt::black)); planetInfo = new PlanetInfo( this, palette ); gameMessage = new TQLabel( this ); gameMessage->setPalette( palette ); turnCounter = new TQLabel( this ); turnCounter->setPalette( palette ); turnCounter->setText( "Turn" ); - turnCounter->setMaximumHeight( turnCounter->sizeHint().height() ); + turnCounter->setMaximumHeight( turnCounter->tqsizeHint().height() ); endTurn = new TQPushButton( i18n("End Turn"), this ); - endTurn->setFixedSize( endTurn->sizeHint() ); + endTurn->setFixedSize( endTurn->tqsizeHint() ); endTurn->setPalette( palette ); shipCountEdit = new TQLineEdit( this ); @@ -82,39 +82,39 @@ GameBoard::GameBoard( TQWidget *parent ) setMinimumSize( 600, 600 ); setMouseTracking( true ); - setFocusPolicy( StrongFocus ); + setFocusPolicy( TQ_StrongFocus ); setFocus(); //******************************************************************** // Layout the main window //******************************************************************** - TQHBoxLayout *layout1 = new TQHBoxLayout( this ); - TQVBoxLayout *layout2 = new TQVBoxLayout; - TQHBoxLayout *layout3 = new TQHBoxLayout; - TQVBoxLayout *layout4 = new TQVBoxLayout; + TQHBoxLayout *tqlayout1 = new TQHBoxLayout( this ); + TQVBoxLayout *tqlayout2 = new TQVBoxLayout; + TQHBoxLayout *tqlayout3 = new TQHBoxLayout; + TQVBoxLayout *tqlayout4 = new TQVBoxLayout; - layout1->addLayout( layout2 ); - layout2->addLayout( layout3 ); + tqlayout1->addLayout( tqlayout2 ); + tqlayout2->addLayout( tqlayout3 ); - layout3->addSpacing( 5 ); - layout3->addWidget( gameMessage, 10 ); - layout3->addWidget( shipCountEdit, 1 ); - layout3->addWidget( endTurn, 1 ); + tqlayout3->addSpacing( 5 ); + tqlayout3->addWidget( gameMessage, 10 ); + tqlayout3->addWidget( shipCountEdit, 1 ); + tqlayout3->addWidget( endTurn, 1 ); - layout2->addSpacing( 5 ); - layout2->addWidget( mapWidget, 0, AlignTop ); - layout2->addWidget( msgWidget ); - layout2->addStretch( 1 ); + tqlayout2->addSpacing( 5 ); + tqlayout2->addWidget( mapWidget, 0, AlignTop ); + tqlayout2->addWidget( msgWidget ); + tqlayout2->addStretch( 1 ); - layout1->addSpacing( 5 ); - layout1->addLayout( layout4, 10 ); + tqlayout1->addSpacing( 5 ); + tqlayout1->addLayout( tqlayout4, 10 ); - layout4->addWidget( planetInfo, 1 ); - layout4->addSpacing( 10 ); - layout4->addWidget( turnCounter, 1 ); - layout4->addStretch( 1 ); + tqlayout4->addWidget( planetInfo, 1 ); + tqlayout4->addSpacing( 10 ); + tqlayout4->addWidget( turnCounter, 1 ); + tqlayout4->addStretch( 1 ); - layout1->addStretch( 1 ); + tqlayout1->addStretch( 1 ); //********************************************************************** // Set up signal/slot connections @@ -137,7 +137,7 @@ GameBoard::~GameBoard() } #if 0 -TQSize GameBoard::sizeHint() const +TQSize GameBoard::tqsizeHint() const { return TQSize( 600, 550 ); } @@ -187,7 +187,7 @@ GameBoard::keyPressEvent( TQKeyEvent *e ) } -QString +TQString GameBoard::playerString(Player *player) { if (!player) @@ -315,10 +315,10 @@ GameBoard::turn() TQString msg; msg = i18n("The distance from Planet %1 to Planet %2 is %3 light years.\n" "A ship leaving this turn will arrive on turn %4") - .arg(sourcePlanet->getName()) - .arg(destPlanet->getName()) - .arg(KGlobal::locale()->formatNumber( dist, 2 )) - .arg(KGlobal::locale()->formatNumber( turnNumber + (int)dist, 0 )); + .tqarg(sourcePlanet->getName()) + .tqarg(destPlanet->getName()) + .tqarg(KGlobal::locale()->formatNumber( dist, 2 )) + .tqarg(KGlobal::locale()->formatNumber( turnNumber + (int)dist, 0 )); KMessageBox::information( this, msg, i18n("Distance")); gameState = NONE; @@ -431,7 +431,7 @@ GameBoard::turn() } TQString turnStr; - turnStr = i18n("Turn #: %1 of %2").arg(turnNumber).arg(lastTurn); + turnStr = i18n("Turn #: %1 of %2").tqarg(turnNumber).tqarg(lastTurn); turnCounter->setText( turnStr ); @@ -470,15 +470,15 @@ GameBoard::nextTurn() Player *winner = findWinner(); if (winner) { - mapWidget->repaint(true); + mapWidget->tqrepaint(true); KMessageBox::information(this, - i18n("The mighty %1 has conquered the galaxy!").arg(winner->getName()), + i18n("The mighty %1 has conquered the galaxy!").tqarg(winner->getName()), i18n("Game Over")); } if( (turnNumber == lastTurn) && !winner ) { - mapWidget->repaint(true); + mapWidget->tqrepaint(true); GameEndDlg *dlg = new GameEndDlg( this ); if( dlg->exec() == KDialogBase::Yes ) { @@ -492,7 +492,7 @@ GameBoard::nextTurn() { // Game over, man! Game over. - mapWidget->repaint(true); + mapWidget->tqrepaint(true); gameOver(); }; @@ -565,8 +565,8 @@ GameBoard::gameMsg(const TQString &msg, Player *player, Planet *planet, Player * { if (!player->isAiPlayer()) isHumanInvolved = true; - colorMsg = colorMsg.arg(playerString(player)); - plainMsg = plainMsg.arg(player->getName()); + colorMsg = colorMsg.tqarg(playerString(player)); + plainMsg = plainMsg.tqarg(player->getName()); } if (planet) @@ -577,15 +577,15 @@ GameBoard::gameMsg(const TQString &msg, Player *player, Planet *planet, Player * isHumanInvolved = true; TQString color = planetPlayer->getColor().name(); - colorMsg = colorMsg.arg(TQString("%2").arg(color, planet->getName())); - plainMsg = plainMsg.arg(planet->getName()); + colorMsg = colorMsg.tqarg(TQString("%2").tqarg(color, planet->getName())); + plainMsg = plainMsg.tqarg(planet->getName()); } - msgWidget->append(("Turn %1: ").arg(turnNumber)+colorMsg+""); + msgWidget->append(("Turn %1: ").tqarg(turnNumber)+colorMsg+""); msgWidget->scrollToBottom(); if (isHumanInvolved) { - mapWidget->repaint(true); + mapWidget->tqrepaint(true); KMessageBox::information(this, plainMsg); } } @@ -660,7 +660,7 @@ GameBoard::doFleetArrival( AttackFleet *arrivingFleet ) TQString msg; msg = i18n("Reinforcements (%1 ships) have arrived for planet %2.") - .arg(arrivingFleet->getShipCount()); + .tqarg(arrivingFleet->getShipCount()); gameMsg(msg, 0, arrivingFleet->destination); } } else { @@ -717,7 +717,7 @@ GameBoard::doFleetArrival( AttackFleet *arrivingFleet ) } } - mapWidget->repaint(true); + mapWidget->tqrepaint(true); } //************************************************************************ diff --git a/konquest/gameboard.h b/konquest/gameboard.h index ed165b21..7826d00f 100644 --- a/konquest/gameboard.h +++ b/konquest/gameboard.h @@ -21,17 +21,18 @@ enum GameState { NONE, SOURCE_PLANET, DEST_PLANET, SHIP_COUNT, RULER_SOURCE, RUL //************************************************************************ // GameBoard Widget //************************************************************************ -class GameBoard : public QWidget +class GameBoard : public TQWidget { Q_OBJECT + TQ_OBJECT public: - GameBoard( TQWidget *parent ); + GameBoard( TQWidget *tqparent ); virtual ~GameBoard(); bool isGameInProgress(void) const { return gameInProgress; } -// virtual TQSize sizeHint() const; +// virtual TQSize tqsizeHint() const; protected slots: void startNewGame(); diff --git a/konquest/gamecore.cc b/konquest/gamecore.cc index 3706cf68..df8ba86e 100644 --- a/konquest/gamecore.cc +++ b/konquest/gamecore.cc @@ -94,7 +94,7 @@ Map::populateMap( PlayerList &players, Player *neutral, Freeze(); int index = 0; - TQString names( "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*(),.<>;:[]{}/?-+\\|" ); + TQString names( "ABCDEFGHIJKLMNOPTQRSTUVWXYZ1234567890!@#$%^&*(),.<>;:[]{}/?-+\\|" ); // Create a planet for each player Player *plr; @@ -242,16 +242,16 @@ const int Map::getColumns() const //--------------------------------------------------------------------------- Sector::Sector() -: TQObject(0,0), planet( NULL ), parentMap(NULL ), x(0), y(0) +: TQObject(0,0), planet( NULL ), tqparentMap(NULL ), x(0), y(0) {} Sector::Sector( Map *newParentMap, int xPos, int yPos ) -: TQObject(0,0), planet(NULL), parentMap( newParentMap ), x(xPos), y(yPos) +: TQObject(0,0), planet(NULL), tqparentMap( newParentMap ), x(xPos), y(yPos) { } Sector::Sector( const Sector & other ) -: TQObject(0,0), planet(other.planet), parentMap(other.parentMap), x(other.x), y(other.y) +: TQObject(0,0), planet(other.planet), tqparentMap(other.tqparentMap), x(other.x), y(other.y) { } @@ -294,7 +294,7 @@ Sector::operator=( const Sector &other ) x = other.x; y = other.y; planet = other.planet; - parentMap = other.parentMap; + tqparentMap = other.tqparentMap; return *this; } @@ -302,7 +302,7 @@ Sector::operator=( const Sector &other ) void Sector::select() { - parentMap->setSelectedSector( x, y ); + tqparentMap->setSelectedSector( x, y ); emit selected(); } @@ -322,29 +322,29 @@ int Sector::getColumn() Planet::Planet( TQString planetName, Sector &newParentSector, Player *initialOwner, int newProd, double newKillP, double newMorale ) - : TQObject(0,0), name(planetName), owner(initialOwner), parentSector(newParentSector), + : TQObject(0,0), name(planetName), owner(initialOwner), tqparentSector(newParentSector), homeFleet( this, newProd ), killPercentage(newKillP), morale( newMorale ), productionRate(newProd) { - parentSector.setPlanet( this ); + tqparentSector.setPlanet( this ); } Planet::~Planet() {} Planet * -Planet::createPlayerPlanet( Sector &parentSector, Player *initialOwner, TQString planetName ) +Planet::createPlayerPlanet( Sector &tqparentSector, Player *initialOwner, TQString planetName ) { CoreLogic clogic; double morale = clogic.generateMorale(); - return new Planet( planetName, parentSector, initialOwner, + return new Planet( planetName, tqparentSector, initialOwner, 10, 0.400, morale ); } Planet * -Planet::createNeutralPlanet( Sector &parentSector, Player *initialOwner, TQString planetName ) +Planet::createNeutralPlanet( Sector &tqparentSector, Player *initialOwner, TQString planetName ) { CoreLogic clogic; double morale = clogic.generateMorale(); @@ -353,7 +353,7 @@ Planet::createNeutralPlanet( Sector &parentSector, Player *initialOwner, TQStrin int productionRate = (int)clogic.generatePlanetProduction(); - return new Planet( planetName, parentSector, + return new Planet( planetName, tqparentSector, initialOwner, productionRate, killP, morale ); } @@ -398,7 +398,7 @@ Planet::setProduction( int newProduction ) void Planet::select() { - parentSector.select(); + tqparentSector.select(); emit selected(); } @@ -423,7 +423,7 @@ Planet::getName() const Sector & Planet::getSector() const { - return parentSector; + return tqparentSector; } void @@ -479,10 +479,10 @@ Player::getName() return name; } -QString +TQString Player::getColoredName() { - return TQString("%2").arg(color.name(), name); + return TQString("%2").tqarg(color.name(), name); } Player *Player::createPlayer( TQString newName, TQColor color, int playerNum, bool isAi ) @@ -492,7 +492,7 @@ Player *Player::createPlayer( TQString newName, TQColor color, int playerNum, bo Player *Player::createNeutralPlayer() { - return new Player( TQString::null, gray, NEUTRAL_PLAYER_NUMBER, false ); + return new Player( TQString(), gray, NEUTRAL_PLAYER_NUMBER, false ); } TQColor &Player::getColor() diff --git a/konquest/gamecore.h b/konquest/gamecore.h index 03683a08..80dab502 100644 --- a/konquest/gamecore.h +++ b/konquest/gamecore.h @@ -56,7 +56,7 @@ private: // \--- class DefenseFleet //********************************************************** -class Fleet : public QObject +class Fleet : public TQObject { public: @@ -107,7 +107,7 @@ public: // class Player //************************************************************** -class Player : public QObject +class Player : public TQObject { public: @@ -171,9 +171,10 @@ public: // class Planet //************************************************************** -class Planet : public QObject +class Planet : public TQObject { Q_OBJECT + TQ_OBJECT private: @@ -184,9 +185,9 @@ private: public: virtual ~Planet(); - static Planet *createPlayerPlanet( Sector &parentSector, + static Planet *createPlayerPlanet( Sector &tqparentSector, Player *initialOwner, TQString planetName ); - static Planet *createNeutralPlanet( Sector &parentSector, + static Planet *createNeutralPlanet( Sector &tqparentSector, Player *initialOwner, TQString planetName ); Sector &getSector() const; @@ -213,7 +214,7 @@ signals: private: TQString name; Player *owner; - Sector &parentSector; + Sector &tqparentSector; DefenseFleet homeFleet; double killPercentage; @@ -225,15 +226,16 @@ private: // class Sector //*************************************************************** -class Sector : public QObject +class Sector : public TQObject { Q_OBJECT + TQ_OBJECT public: // constructors Sector(); - Sector( Map *parentMap, int xpos, int ypos ); + Sector( Map *tqparentMap, int xpos, int ypos ); Sector( const Sector & ); // assignment operator (makes initialization easy) @@ -259,7 +261,7 @@ protected slots: protected: Planet *planet; // a sector has 0 or 1 planets - Map *parentMap; + Map *tqparentMap; int x, y; }; @@ -268,9 +270,10 @@ protected: // class Map //***************************************************************** -class Map : public QObject +class Map : public TQObject { Q_OBJECT + TQ_OBJECT public: Map(); diff --git a/konquest/gameenddlg.cc b/konquest/gameenddlg.cc index 2295acd9..2c31869e 100644 --- a/konquest/gameenddlg.cc +++ b/konquest/gameenddlg.cc @@ -11,23 +11,23 @@ #include "gameenddlg.h" #include "gameenddlg.moc" -GameEndDlg::GameEndDlg( TQWidget *parent ) +GameEndDlg::GameEndDlg( TQWidget *tqparent ) : KDialogBase( i18n("Out of Turns"), KDialogBase::Yes|KDialogBase::No, KDialogBase::Yes, KDialogBase::No, - parent, "end_game_dialog", true, true ) + tqparent, "end_game_dialog", true, true ) { TQVBox *page = makeVBoxMainWidget(); // Create controls TQLabel *label1 = new TQLabel( i18n("This is the last turn.\nDo you wish to add extra turns?")+"\n\n", page ); - label1->setAlignment( AlignCenter ); + label1->tqsetAlignment( AlignCenter ); turnCountLbl = new TQLabel( page ); turnCount = new TQSlider( 1, 40, 1, 5, Qt::Horizontal, page ); - KGuiItem addTurns(i18n("&Add Turns"), TQString::null, TQString::null, + KGuiItem addTurns(i18n("&Add Turns"), TQString(), TQString(), i18n("Add the specified number of turns to the game and continue playing.")); - KGuiItem gameOver(i18n("&Game Over"), TQString::null, TQString::null, + KGuiItem gameOver(i18n("&Game Over"), TQString(), TQString(), i18n("Terminate the current game.")); setButtonGuiItem(KDialogBase::Yes, addTurns); @@ -71,6 +71,6 @@ GameEndDlg::extraTurns() void GameEndDlg::turnCountChange( int newTurnCount ) { - TQString newLbl = i18n("Extra turns: %1").arg( newTurnCount ); + TQString newLbl = i18n("Extra turns: %1").tqarg( newTurnCount ); turnCountLbl->setText( newLbl); } diff --git a/konquest/gameenddlg.h b/konquest/gameenddlg.h index 4ffab262..4836a795 100644 --- a/konquest/gameenddlg.h +++ b/konquest/gameenddlg.h @@ -9,9 +9,10 @@ class TQPushButton; class GameEndDlg : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - GameEndDlg( TQWidget *parent ); + GameEndDlg( TQWidget *tqparent ); virtual ~GameEndDlg(); int extraTurns(); diff --git a/konquest/int_validator.cc b/konquest/int_validator.cc index 12f707c6..06315b18 100644 --- a/konquest/int_validator.cc +++ b/konquest/int_validator.cc @@ -3,8 +3,8 @@ #include "int_validator.h" #include "int_validator.moc" -IntValidator::IntValidator( TQWidget *parent, const char *name ) : - TQValidator( parent, name ) +IntValidator::IntValidator( TQWidget *tqparent, const char *name ) : + TQValidator( TQT_TQOBJECT(tqparent), name ) { #ifdef INT_MIN v_bottom = INT_MIN; @@ -14,8 +14,8 @@ IntValidator::IntValidator( TQWidget *parent, const char *name ) : v_top = INT_MIN; } -IntValidator::IntValidator( int bottom, int top, TQWidget *parent, const char *name ) : -TQValidator( parent, name ) +IntValidator::IntValidator( int bottom, int top, TQWidget *tqparent, const char *name ) : +TQValidator( TQT_TQOBJECT(tqparent), name ) { v_bottom = bottom; v_top = top; diff --git a/konquest/int_validator.h b/konquest/int_validator.h index 6cb67bcb..4f995158 100644 --- a/konquest/int_validator.h +++ b/konquest/int_validator.h @@ -4,13 +4,14 @@ #include -class IntValidator : public QValidator +class IntValidator : public TQValidator { Q_OBJECT + TQ_OBJECT public: - IntValidator( TQWidget *parent, const char *name = 0 ); - IntValidator( int bottom, int top, TQWidget *parent, const char *name = 0 ); + IntValidator( TQWidget *tqparent, const char *name = 0 ); + IntValidator( int bottom, int top, TQWidget *tqparent, const char *name = 0 ); virtual ~IntValidator(); diff --git a/konquest/mainwin.cc b/konquest/mainwin.cc index 866cd936..a5306172 100644 --- a/konquest/mainwin.cc +++ b/konquest/mainwin.cc @@ -37,18 +37,18 @@ MainWindow::~MainWindow() void MainWindow::setupKAction() { - KStdGameAction::gameNew( gameBoard, TQT_SLOT( startNewGame() ), actionCollection() ); - KStdGameAction::quit( this, TQT_SLOT( close() ), actionCollection() ); - endAction = KStdGameAction::end( gameBoard, TQT_SLOT( shutdownGame() ), actionCollection() ); + KStdGameAction::gameNew( TQT_TQOBJECT(gameBoard), TQT_SLOT( startNewGame() ), actionCollection() ); + KStdGameAction::quit( TQT_TQOBJECT(this), TQT_SLOT( close() ), actionCollection() ); + endAction = KStdGameAction::end( TQT_TQOBJECT(gameBoard), TQT_SLOT( shutdownGame() ), actionCollection() ); endAction->setEnabled(false); //AB: there is no icon for disabled - KToolBar::insertButton shows the //different state - KAction not :-( - measureAction = new KAction( i18n("&Measure Distance"), "ruler", 0, gameBoard, TQT_SLOT( measureDistance() ), actionCollection(), "game_measure" ); + measureAction = new KAction( i18n("&Measure Distance"), "ruler", 0, TQT_TQOBJECT(gameBoard), TQT_SLOT( measureDistance() ), actionCollection(), "game_measure" ); measureAction->setEnabled(false); - standingAction = new KAction( i18n("&Show Standings"), "help", 0, gameBoard, TQT_SLOT( showScores() ), actionCollection(), "game_scores" ); + standingAction = new KAction( i18n("&Show Standings"), "help", 0, TQT_TQOBJECT(gameBoard), TQT_SLOT( showScores() ), actionCollection(), "game_scores" ); standingAction->setEnabled(false); - fleetAction = new KAction( i18n("&Fleet Overview"), "launch", 0, gameBoard, TQT_SLOT( showFleets() ), actionCollection(), "game_fleets" ); + fleetAction = new KAction( i18n("&Fleet Overview"), "launch", 0, TQT_TQOBJECT(gameBoard), TQT_SLOT( showFleets() ), actionCollection(), "game_fleets" ); fleetAction->setEnabled(false); toolBar()->setBarPos( KToolBar::Left ); toolBar()->setMovingEnabled( false ); @@ -60,7 +60,7 @@ MainWindow::setupGameBoard() gameBoard = new GameBoard( this ); setCentralWidget(gameBoard); - connect( gameBoard, TQT_SIGNAL( newGameState( GameState )), this, TQT_SLOT( gameStateChange( GameState ) ) ); + connect( gameBoard, TQT_SIGNAL( newGameState( GameState )), TQT_TQOBJECT(this), TQT_SLOT( gameStateChange( GameState ) ) ); } diff --git a/konquest/mainwin.h b/konquest/mainwin.h index 2954039c..50779e41 100644 --- a/konquest/mainwin.h +++ b/konquest/mainwin.h @@ -11,6 +11,7 @@ class PlanetStatusTable; class MainWindow : public KMainWindow { Q_OBJECT + TQ_OBJECT public: MainWindow(); diff --git a/konquest/map_widget.cc b/konquest/map_widget.cc index a8aa33de..e6d8512c 100644 --- a/konquest/map_widget.cc +++ b/konquest/map_widget.cc @@ -9,8 +9,8 @@ #include #include "map_widget.moc" -ConquestMap::ConquestMap( Map *newMap, TQWidget *parent ) - : TQGridView( parent ), +ConquestMap::ConquestMap( Map *newMap, TQWidget *tqparent ) + : TQGridView( tqparent ), SECTOR_HEIGHT( 28 ), SECTOR_WIDTH( 28 ), BOARD_HEIGHT( newMap->getRows() * SECTOR_HEIGHT ), BOARD_WIDTH( newMap->getColumns() * SECTOR_WIDTH ), @@ -149,7 +149,7 @@ ConquestMap::squareBlink() void ConquestMap::mapUpdate() { - viewport()->repaint(false); + viewport()->tqrepaint(false); } diff --git a/konquest/map_widget.h b/konquest/map_widget.h index ed8d98f3..e408b2dd 100644 --- a/konquest/map_widget.h +++ b/konquest/map_widget.h @@ -13,13 +13,14 @@ #include "gamecore.h" #include "images.h" -class ConquestMap : public QGridView +class ConquestMap : public TQGridView { Q_OBJECT + TQ_OBJECT // Constructors public: - ConquestMap( Map *newMap, TQWidget *parent = 0 ); + ConquestMap( Map *newMap, TQWidget *tqparent = 0 ); virtual ~ConquestMap(); // Interface diff --git a/konquest/minimap.cc b/konquest/minimap.cc index a287ab79..c08e7282 100644 --- a/konquest/minimap.cc +++ b/konquest/minimap.cc @@ -7,8 +7,8 @@ #include "minimap.h" #include "minimap.moc" -MiniMap::MiniMap( TQWidget *parent, const char *name ) - : TQGridView( parent, name ), +MiniMap::MiniMap( TQWidget *tqparent, const char *name ) + : TQGridView( tqparent, name ), SECTOR_HEIGHT( 12 ), SECTOR_WIDTH( 12 ), BOARD_HEIGHT( 10 * SECTOR_HEIGHT ), BOARD_WIDTH( 10 * SECTOR_WIDTH ), diff --git a/konquest/minimap.h b/konquest/minimap.h index 886e247c..33d90ef2 100644 --- a/konquest/minimap.h +++ b/konquest/minimap.h @@ -11,13 +11,14 @@ #include "images.h" -class MiniMap : public QGridView +class MiniMap : public TQGridView { Q_OBJECT + TQ_OBJECT // Constructors public: - MiniMap( TQWidget *parent = 0, const char* name = 0 ); + MiniMap( TQWidget *tqparent = 0, const char* name = 0 ); virtual ~MiniMap(); void setMap( Map *newMap ); diff --git a/konquest/newGameDlg_ui.ui b/konquest/newGameDlg_ui.ui index 2768e5f8..61188418 100644 --- a/konquest/newGameDlg_ui.ui +++ b/konquest/newGameDlg_ui.ui @@ -1,10 +1,10 @@ NewGameDlgUI - + NewGameDlgUI - + 0 0 @@ -16,23 +16,23 @@ unnamed - + - layout9 + tqlayout9 unnamed - + - layout4 + tqlayout4 unnamed - + labelPlayers @@ -43,7 +43,7 @@ sliderPlayers - + sliderPlayers @@ -57,7 +57,7 @@ Horizontal - + labelPlayerList @@ -68,7 +68,7 @@ listPlayers - + Name @@ -95,15 +95,15 @@ listPlayers - + - layout3 + tqlayout3 unnamed - + labelNewPlayer @@ -114,7 +114,7 @@ newPlayer - + newPlayer @@ -129,9 +129,9 @@ - + - layout2 + tqlayout2 @@ -147,14 +147,14 @@ Expanding - + 0 20 - + addPlayer @@ -172,7 +172,7 @@ Expanding - + 0 20 @@ -193,22 +193,22 @@ Fixed - + 20 20 - + - layout8 + tqlayout8 unnamed - + labelPlanets @@ -219,7 +219,7 @@ sliderPlanets - + sliderPlanets @@ -236,7 +236,7 @@ Horizontal - + labelMap @@ -244,9 +244,9 @@ Preview map: - + - layout7 + tqlayout7 @@ -262,7 +262,7 @@ Expanding - + 0 20 @@ -284,7 +284,7 @@ Expanding - + 0 20 @@ -303,16 +303,16 @@ Expanding - + 20 16 - + - layout5 + tqlayout5 @@ -328,14 +328,14 @@ Expanding - + 31 20 - + rejectMap @@ -353,7 +353,7 @@ Expanding - + 51 20 @@ -380,7 +380,7 @@ Horizontal - + labelTurns @@ -391,7 +391,7 @@ sliderTurns - + sliderTurns @@ -433,7 +433,7 @@ 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003b149444154789cad945f4c5b551cc73fe7dc4b7b4bcba0762d45c43114323599ee6192609c51d883892ce083f1718b3ebb185f8dc91e972cf39d2d2a2f1af664b6f1e0fe3863a0718969700eb0c52142da0242a1bd6d696f7bcff101585203ceb8fd9ece39f99dcff9fe7edf939f88c562ec465f5f9fe609442c161362173c3e3eae7b7a7ac8e7f36432196cdbfe4f907c3e4f2291201e8fe338cec3737357e9e8e828aded1e229d650e1f2d51754b082110124c13a4dc5ea341eb9dc284c0558a853f3ce8cb0677ef500fde7d39d2596679e326597b8e9abb85d7a770ab16ab6983ec5a05b487a70e36f0f4e10afe408d6a558310980108478dba4a1e8233990c5d474b64ed39aa3a8fe5f3317fbf81dbd70bccfeb205947632fd74f6589c1c6ea2f70d03a58ba0c1f2c9bdc1b66de3b8256a6e11cbe7e3ee1d181b590124fe2693aeee08d223c82c3a2c24b7b874bec8f26288774f7bd054504aef0dde6e99c0eb83f9fb266323cb80a27fb0958141836044605a2ee5523393371cc646fee2da37195aa35d0c0c5b4859ac03d7e91712dcaac5adab3650a3ff9d08ef7dd8404bb48869e5d958b5b87dadc4c9a1464e9f0d0326df7ebd86bd2e310cb1bf62d384d59441f2d70a070e1c60e09489929b988681bdd9cc97170bcc4c65595f71f8e0e3301337fc24a7732467831875a47f289652b0be5e4151e6d07316c1b0c0340d8ab92023e76d66a6b2840e36d2fb7a13fee632475e6edc367ea98a90fb98b7dd6310ca0328a44761582e1bab41befabcc0ec940d28bc5e93b68e064cab84e1d9beaeb48934eac1f53b01c1b000fca496aa54b61a99fcde61662a4b4b4b23d1680be9d426173e4df3602a48ea411989a4fd590f52a8fd156b05ed9d350e3defe3cfdf4b4c7ce770ea7d3fb9f520afbe1620daeee5c26735d20b9b9cfb6811a754a439e4e5c5639a4caa1e5caf586bfc0197b78702005cb9b4cae4cd3267ce8638fe964bd72b393e39d74928d242617303a756a37f284447770dcdbffc6384a05a85de1306e9a52057c7527c7131c3c42d3f475eb2303c82d4fc3276d6811db37efeb148723082d9b08f79f97c1e5729109a9a28307cc622d2d6cdf52b2b24efe548dedb00142009862cfa879ee1a71f6cec928353511472fbf4389148b0b0e0c108081412458dfe21c9f11351e67e7358595468246d1d1e5e38a6e9e851bc39d84ab502a669331dafec0d8ec7e3e8cb06e1a881d727d1ae40180a434a8c9db129a54126ad48a7358c2b4c5352c8c374bcccdab2bb37d8719cba79fab8211f9df218e0582c261e95f8bfc04f1a1e8bc5c4dfe0a19017a725d8c60000000049454e44ae426082 - + minimap.h diff --git a/konquest/newgamedlg.cc b/konquest/newgamedlg.cc index 232e6415..fffe17d4 100644 --- a/konquest/newgamedlg.cc +++ b/konquest/newgamedlg.cc @@ -25,9 +25,9 @@ New Game Dialog Members ************************************************************************/ -NewGameDlg::NewGameDlg( TQWidget *parent, Map *pmap, PlayerList *players, +NewGameDlg::NewGameDlg( TQWidget *tqparent, Map *pmap, PlayerList *players, Player *neutralPlayer, PlanetList *planets ) - : KDialogBase( parent, "new_game_dialog", true, i18n("Start New Game"), + : KDialogBase( tqparent, "new_game_dialog", true, i18n("Start New Game"), KDialogBase::Ok|KDialogBase::Default|KDialogBase::Cancel, KDialogBase::NoDefault, true ), plrList(players), plnetList(planets), neutral(neutralPlayer), map(pmap) @@ -96,7 +96,7 @@ NewGameDlg::init() for( TQListViewItem *item = w->listPlayers->firstChild(); item; item = item->nextSibling(), plrNum++ ) { - TQString key = TQString("Player_%1").arg(plrNum); + TQString key = TQString("Player_%1").tqarg(plrNum); TQString playerName = config->readEntry(key); if (playerName.isEmpty()) @@ -151,7 +151,7 @@ NewGameDlg::slotAddPlayer() item->setText(1, i18n("Human Player")); item->setText(0, playerName); - w->newPlayer->setText(TQString::null); + w->newPlayer->setText(TQString()); updateMiniMap(); updateLabels(); @@ -184,7 +184,7 @@ NewGameDlg::setPlayerCount(int playerCount) while(w->listPlayers->childCount() < playerCount) { - TQString playerName = i18n("Generated AI player name", "Comp%1").arg(i+1); + TQString playerName = i18n("Generated AI player name", "Comp%1").tqarg(i+1); TQPixmap pm(16,16); TQColor color(PlayerColors[i]); pm.fill(color); @@ -229,9 +229,9 @@ NewGameDlg::turns() void NewGameDlg::updateLabels() { - w->labelPlayers->setText(i18n("Number of &players: %1").arg(w->sliderPlayers->value())); - w->labelPlanets->setText(i18n("Number of neutral p&lanets: %1").arg(w->sliderPlanets->value())); - w->labelTurns->setText(i18n("Number of &turns: %1").arg(w->sliderTurns->value())); + w->labelPlayers->setText(i18n("Number of &players: %1").tqarg(w->sliderPlayers->value())); + w->labelPlanets->setText(i18n("Number of neutral p&lanets: %1").tqarg(w->sliderPlanets->value())); + w->labelTurns->setText(i18n("Number of &turns: %1").tqarg(w->sliderTurns->value())); } void @@ -269,7 +269,7 @@ NewGameDlg::save() for( TQListViewItem *item = w->listPlayers->firstChild(); item; item = item->nextSibling() ) { - TQString key = TQString("Player_%1").arg(plrNum); + TQString key = TQString("Player_%1").tqarg(plrNum); TQString playerName = item->text(0); bool ai = (item->text(2) == "A"); if (ai) diff --git a/konquest/newgamedlg.h b/konquest/newgamedlg.h index 6a8c81d4..b3c93b2c 100644 --- a/konquest/newgamedlg.h +++ b/konquest/newgamedlg.h @@ -15,9 +15,10 @@ class NewGameDlgUI; class NewGameDlg : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - NewGameDlg( TQWidget *parent, Map *map, PlayerList *playerList, + NewGameDlg( TQWidget *tqparent, Map *map, PlayerList *playerList, Player *neutralPlayer, PlanetList *planetList ); int turns( void ); diff --git a/konquest/planet_info.cc b/konquest/planet_info.cc index 1d178493..a9f03034 100644 --- a/konquest/planet_info.cc +++ b/konquest/planet_info.cc @@ -9,8 +9,8 @@ #include #include "planet_info.moc" -PlanetInfo::PlanetInfo( TQWidget *parent, TQPalette palette ) - : TQFrame( parent ) +PlanetInfo::PlanetInfo( TQWidget *tqparent, TQPalette palette ) + : TQFrame( tqparent ) { setPalette( palette ); @@ -27,19 +27,19 @@ PlanetInfo::PlanetInfo( TQWidget *parent, TQPalette palette ) clearDisplay(); - TQVBoxLayout *layout1 = new TQVBoxLayout( this ); + TQVBoxLayout *tqlayout1 = new TQVBoxLayout( this ); - layout1->addWidget( name ); - layout1->addWidget( owner ); - layout1->addWidget( ships ); - layout1->addWidget( production ); - layout1->addWidget( kill_percent ); - layout1->addStretch(1); + tqlayout1->addWidget( name ); + tqlayout1->addWidget( owner ); + tqlayout1->addWidget( ships ); + tqlayout1->addWidget( production ); + tqlayout1->addWidget( kill_percent ); + tqlayout1->addStretch(1); setMouseTracking( true ); - setMinimumSize( sizeHint() ); - setMaximumHeight( sizeHint().height() ); + setMinimumSize( tqsizeHint() ); + setMaximumHeight( tqsizeHint().height() ); } PlanetInfo::~PlanetInfo() @@ -47,15 +47,15 @@ PlanetInfo::~PlanetInfo() emptyPlanetInfoList(); } -TQSize PlanetInfo::sizeHint() const +TQSize PlanetInfo::tqsizeHint() const { int height; - height = name->sizeHint().height() + - owner->sizeHint().height() + - ships->sizeHint().height() + - production->sizeHint().height()+ - kill_percent->sizeHint().height(); + height = name->tqsizeHint().height() + + owner->tqsizeHint().height() + + ships->tqsizeHint().height() + + production->tqsizeHint().height()+ + kill_percent->tqsizeHint().height(); return TQSize( 100, height ); } @@ -126,7 +126,7 @@ void PlanetInfo::showPlanet( Planet *planet ) TQString temp; - temp = "" + i18n("Planet name: %1").arg(planet->getName()); + temp = "" + i18n("Planet name: %1").tqarg(planet->getName()); name->setText( temp ); return; } @@ -141,19 +141,19 @@ void PlanetInfo::showPlanet( Planet *planet ) TQString temp; - temp = "" + i18n("Planet name: %1").arg(p->planet->getName()); + temp = "" + i18n("Planet name: %1").tqarg(p->planet->getName()); name->setText( temp ); - temp = "" + i18n("Owner: %1").arg(p->planet->getPlayer()->getColoredName()); + temp = "" + i18n("Owner: %1").tqarg(p->planet->getPlayer()->getColoredName()); owner->setText( temp ); - temp = "" + i18n("Ships: %1").arg( KGlobal::locale()->formatNumber(p->ships, 0) ); + temp = "" + i18n("Ships: %1").tqarg( KGlobal::locale()->formatNumber(p->ships, 0) ); ships->setText( temp ); - temp = "" + i18n("Production: %1").arg( KGlobal::locale()->formatNumber(p->production, 0) ); + temp = "" + i18n("Production: %1").tqarg( KGlobal::locale()->formatNumber(p->production, 0) ); production->setText( temp ); - temp = "" + i18n("Kill percent: %1").arg( KGlobal::locale()->formatNumber(p->killRate, 3) ); + temp = "" + i18n("Kill percent: %1").tqarg( KGlobal::locale()->formatNumber(p->killRate, 3) ); kill_percent->setText( temp ); } } diff --git a/konquest/planet_info.h b/konquest/planet_info.h index e31882a9..c4386cee 100644 --- a/konquest/planet_info.h +++ b/konquest/planet_info.h @@ -20,17 +20,18 @@ struct planet_info_buffer { typedef TQPtrList PlanetInfoList; typedef TQPtrListIterator PlanetInfoListIterator; -class PlanetInfo : public QFrame +class PlanetInfo : public TQFrame { Q_OBJECT + TQ_OBJECT public: - PlanetInfo( TQWidget *parent, TQPalette palette ); + PlanetInfo( TQWidget *tqparent, TQPalette palette ); virtual ~PlanetInfo(); void setPlanetList( PlanetList &newPlanets ); void rescanPlanets(); - TQSize sizeHint() const; + TQSize tqsizeHint() const; public slots: void showPlanet( Planet * ); diff --git a/konquest/scoredlg.cc b/konquest/scoredlg.cc index fee4a404..3400032e 100644 --- a/konquest/scoredlg.cc +++ b/konquest/scoredlg.cc @@ -6,7 +6,7 @@ #include "scoredlg.h" -ScoreDlgListViewItem::ScoreDlgListViewItem(TQListView *parent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5, TQString s6) : TQListViewItem(parent, s1, s2, s3, s4, s5, s6) +ScoreDlgListViewItem::ScoreDlgListViewItem(TQListView *tqparent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5, TQString s6) : TQListViewItem(tqparent, s1, s2, s3, s4, s5, s6) { } @@ -27,8 +27,8 @@ int ScoreDlgListViewItem::compare(TQListViewItem *i, int col, bool) const } -ScoreDlg::ScoreDlg( TQWidget *parent, const TQString& title, PlayerList *players ) - : TQDialog(parent, "ScoreDlg", true ), plrList(players) +ScoreDlg::ScoreDlg( TQWidget *tqparent, const TQString& title, PlayerList *players ) + : TQDialog(tqparent, "ScoreDlg", true ), plrList(players) { setCaption( kapp->makeStdCaption(title) ); @@ -39,21 +39,21 @@ ScoreDlg::ScoreDlg( TQWidget *parent, const TQString& title, PlayerList *players scoreTable->addColumn(i18n("Fleets Launched")); scoreTable->addColumn(i18n("Fleets Destroyed")); scoreTable->addColumn(i18n("Ships Destroyed")); - scoreTable->setMinimumSize( scoreTable->sizeHint() ); + scoreTable->setMinimumSize( scoreTable->tqsizeHint() ); KPushButton *okButton = new KPushButton( KStdGuiItem::ok(), this ); - okButton->setMinimumSize( okButton->sizeHint() ); + okButton->setMinimumSize( okButton->tqsizeHint() ); okButton->setDefault(true); - TQVBoxLayout *layout1 = new TQVBoxLayout( this ); - TQHBoxLayout *layout2 = new TQHBoxLayout; + TQVBoxLayout *tqlayout1 = new TQVBoxLayout( this ); + TQHBoxLayout *tqlayout2 = new TQHBoxLayout; - layout1->addWidget( scoreTable, 1 ); - layout1->addLayout( layout2 ); + tqlayout1->addWidget( scoreTable, 1 ); + tqlayout1->addLayout( tqlayout2 ); - layout2->addStretch( 2 ); - layout2->addWidget( okButton ); - layout2->addStretch( 2 ); + tqlayout2->addStretch( 2 ); + tqlayout2->addWidget( okButton ); + tqlayout2->addStretch( 2 ); connect( okButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()) ); @@ -71,10 +71,10 @@ ScoreDlg::init() for( ;(curPlayer = itr()); ) new ScoreDlgListViewItem(scoreTable, curPlayer->getName(), - TQString("%1").arg(curPlayer->getShipsBuilt()), - TQString("%1").arg(curPlayer->getPlanetsConquered()), - TQString("%1").arg(curPlayer->getFleetsLaunched()), - TQString("%1").arg(curPlayer->getEnemyFleetsDestroyed()), - TQString("%1").arg(curPlayer->getEnemyShipsDestroyed())); + TQString("%1").tqarg(curPlayer->getShipsBuilt()), + TQString("%1").tqarg(curPlayer->getPlanetsConquered()), + TQString("%1").tqarg(curPlayer->getFleetsLaunched()), + TQString("%1").tqarg(curPlayer->getEnemyFleetsDestroyed()), + TQString("%1").tqarg(curPlayer->getEnemyShipsDestroyed())); } diff --git a/konquest/scoredlg.h b/konquest/scoredlg.h index 55eaa926..88b7911d 100644 --- a/konquest/scoredlg.h +++ b/konquest/scoredlg.h @@ -7,18 +7,18 @@ #include "gamecore.h" -class ScoreDlgListViewItem : public QListViewItem +class ScoreDlgListViewItem : public TQListViewItem { public: - ScoreDlgListViewItem(TQListView *parent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5, TQString s6); + ScoreDlgListViewItem(TQListView *tqparent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5, TQString s6); int compare(TQListViewItem *i, int col, bool) const; }; -class ScoreDlg : public QDialog +class ScoreDlg : public TQDialog { public: - ScoreDlg( TQWidget *parent, const TQString& title, PlayerList *players ); + ScoreDlg( TQWidget *tqparent, const TQString& title, PlayerList *players ); private: void init(); diff --git a/kpat/CHANGES b/kpat/CHANGES index 2480f12e..d6016123 100644 --- a/kpat/CHANGES +++ b/kpat/CHANGES @@ -132,7 +132,7 @@ since kpat-0.2 since kpat-0.1 - - changed shading colorGroup (Paul) + - changed shading tqcolorGroup (Paul) - fixed drawing of suit symbols (Paul) - renamed "very easy" to "cheating" :) (Paul) - fixed spurious core dump(Paul) diff --git a/kpat/card.cpp b/kpat/card.cpp index a6529bd1..30f5d81d 100644 --- a/kpat/card.cpp +++ b/kpat/card.cpp @@ -45,7 +45,7 @@ Card::Card( Rank r, Suit s, TQCanvas* _parent ) { // Set the name of the card // FIXME: i18n() - m_name = TQString("%1 %2").arg(suit_names[s-1]).arg(rank_names[r-1]).utf8(); + m_name = TQString("%1 %2").tqarg(suit_names[s-1]).tqarg(rank_names[r-1]).utf8(); // Default for the card is face up, standard size. m_faceup = true; @@ -186,7 +186,7 @@ bool Card::realFace() const /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** -** This file is part of Qt Palmtop Environment. +** This file is part of TQt Palmtop Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software diff --git a/kpat/card.h b/kpat/card.h index 8ec96bb9..88b4fec3 100644 --- a/kpat/card.h +++ b/kpat/card.h @@ -47,13 +47,14 @@ typedef TQValueList CardList; // class Card: public TQObject, public TQCanvasRectangle { Q_OBJECT + TQ_OBJECT public: enum Suit { Clubs = 1, Diamonds, Hearts, Spades }; enum Rank { None = 0, Ace = 1, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King }; - Card( Rank r, Suit s, TQCanvas *parent=0); + Card( Rank r, Suit s, TQCanvas *tqparent=0); virtual ~Card(); // Properties of the card. diff --git a/kpat/cardmaps.cpp b/kpat/cardmaps.cpp index 563f4bfe..a7461daa 100644 --- a/kpat/cardmaps.cpp +++ b/kpat/cardmaps.cpp @@ -95,7 +95,7 @@ bool cardMap::setCardDir( const TQString &dir) card_width = image.width(); card_height = image.height(); - const int diff_x_between_cards = QMAX(card_width / 9, 1); + const int diff_x_between_cards = TQMAX(card_width / 9, 1); TQString wait_message = i18n("please wait, loading cards..."); TQString greeting = i18n("KPatience - a Solitaire game"); @@ -103,23 +103,23 @@ bool cardMap::setCardDir( const TQString &dir) if( animate ) { t1 = TQTime::currentTime(); - w = new TQWidget( 0, "", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool ); + w = new TQWidget( 0, "", TQt::WStyle_Customize | TQt::WStyle_NoBorder | TQt::WStyle_Tool ); TQRect dg = KGlobalSettings::splashScreenDesktopGeometry(); - w->setBackgroundColor( Qt::darkGreen ); + w->setBackgroundColor( TQt::darkGreen ); w->setGeometry( dg.left() + ( dg.width() - greeting_width ) / 2, dg.top() + ( dg.height() - 180 ) / 2, greeting_width, 180); w->show(); - qApp->processEvents(); + tqApp->processEvents(); p.begin( w ); - p.drawText(0, 150, greeting_width, 20, Qt::AlignCenter, + p.drawText(0, 150, greeting_width, 20, TQt::AlignCenter, wait_message ); p.setFont(TQFont("Times", 24)); - p.drawText(0, 0, greeting_width, 40, Qt::AlignCenter, + p.drawText(0, 0, greeting_width, 40, TQt::AlignCenter, greeting); p.setPen(TQPen(TQColor(0, 0, 0), 4)); - p.setBrush(Qt::NoBrush); + p.setBrush(TQt::NoBrush); p.drawRect(0, 0, greeting_width, 180); p.flush(); } diff --git a/kpat/clock.cpp b/kpat/clock.cpp index 7fcb94b4..dec72cc0 100644 --- a/kpat/clock.cpp +++ b/kpat/clock.cpp @@ -4,8 +4,8 @@ #include #include "cardmaps.h" -Clock::Clock( KMainWindow* parent, const char *name ) - : Dealer( parent, name ) +Clock::Clock( KMainWindow* tqparent, const char *name ) + : Dealer( tqparent, name ) { const int dist_x = cardMap::CARDX() * 11 / 10 + 1; const int dist_y = cardMap::CARDY() * 11 / 10 + 1; @@ -85,7 +85,7 @@ static class LocalDealerInfo11 : public DealerInfo { public: LocalDealerInfo11() : DealerInfo(I18N_NOOP("G&randfather's Clock"), 11) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Clock(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Clock(tqparent); } } gfi11; #include "clock.moc" diff --git a/kpat/clock.h b/kpat/clock.h index 42521862..8aaead34 100644 --- a/kpat/clock.h +++ b/kpat/clock.h @@ -5,9 +5,10 @@ class Clock : public Dealer { Q_OBJECT + TQ_OBJECT public: - Clock( KMainWindow* parent=0, const char* name=0); + Clock( KMainWindow* tqparent=0, const char* name=0); virtual bool checkAdd ( int checkIndex, const Pile *c1, const CardList& c2) const; virtual bool startAutoDrop() { return false; } diff --git a/kpat/computation.cpp b/kpat/computation.cpp index 22f104aa..0da5f226 100644 --- a/kpat/computation.cpp +++ b/kpat/computation.cpp @@ -27,8 +27,8 @@ #include #include "cardmaps.h" -Computation::Computation( KMainWindow *parent, const char *name ) - :Dealer( parent, name) +Computation::Computation( KMainWindow *tqparent, const char *name ) + :Dealer( tqparent, name) { deck = Deck::new_deck(this); deck->hide(); @@ -114,7 +114,7 @@ static class LocalDealerInfo6 : public DealerInfo { public: LocalDealerInfo6() : DealerInfo(I18N_NOOP("&Calculation"), 6) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Computation(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Computation(tqparent); } } ldi6; #include "computation.moc" diff --git a/kpat/computation.h b/kpat/computation.h index 3b9b3fbc..ea988f2d 100644 --- a/kpat/computation.h +++ b/kpat/computation.h @@ -30,9 +30,10 @@ class Computation : public Dealer { Q_OBJECT + TQ_OBJECT public: - Computation( KMainWindow *parent = 0, const char *name=0 ); + Computation( KMainWindow *tqparent = 0, const char *name=0 ); virtual void restart(); diff --git a/kpat/dealer.cpp b/kpat/dealer.cpp index 365e7411..d53b7d3a 100644 --- a/kpat/dealer.cpp +++ b/kpat/dealer.cpp @@ -99,7 +99,7 @@ const Dealer *Dealer::instance() void Dealer::setBackgroundPixmap(const TQPixmap &background, const TQColor &midcolor) { _midcolor = midcolor; - canvas()->setBackgroundPixmap(background); + canvas()->tqsetBackgroundPixmap(background); for (PileList::Iterator it = piles.begin(); it != piles.end(); ++it) { (*it)->resetCache(); (*it)->initSizes(); @@ -114,30 +114,30 @@ void Dealer::setupActions() { if (actions() & Dealer::Hint) { - ahint = new KAction( i18n("&Hint"), TQString::fromLatin1("wizard"), Key_H, this, + ahint = new KAction( i18n("&Hint"), TQString::tqfromLatin1("wizard"), Key_H, TQT_TQOBJECT(this), TQT_SLOT(hint()), - parent()->actionCollection(), "game_hint"); + tqparent()->actionCollection(), "game_hint"); actionlist.append(ahint); } else ahint = 0; if (actions() & Dealer::Demo) { - ademo = new KToggleAction( i18n("&Demo"), TQString::fromLatin1("1rightarrow"), CTRL+Key_D, this, + ademo = new KToggleAction( i18n("&Demo"), TQString::tqfromLatin1("1rightarrow"), CTRL+Key_D, TQT_TQOBJECT(this), TQT_SLOT(toggleDemo()), - parent()->actionCollection(), "game_demo"); + tqparent()->actionCollection(), "game_demo"); actionlist.append(ademo); } else ademo = 0; if (actions() & Dealer::Redeal) { - aredeal = new KAction (i18n("&Redeal"), TQString::fromLatin1("queue"), 0, this, + aredeal = new KAction (i18n("&Redeal"), TQString::tqfromLatin1("queue"), 0, TQT_TQOBJECT(this), TQT_SLOT(redeal()), - parent()->actionCollection(), "game_redeal"); + tqparent()->actionCollection(), "game_redeal"); actionlist.append(aredeal); } else aredeal = 0; - parent()->guiFactory()->plugActionList( parent(), TQString::fromLatin1("game_actions"), actionlist); + tqparent()->guiFactory()->plugActionList( tqparent(), TQString::tqfromLatin1("game_actions"), actionlist); } Dealer::~Dealer() @@ -145,7 +145,7 @@ Dealer::~Dealer() if (!_won) countLoss(); clearHints(); - parent()->guiFactory()->unplugActionList( parent(), TQString::fromLatin1("game_actions")); + tqparent()->guiFactory()->unplugActionList( tqparent(), TQString::tqfromLatin1("game_actions")); while (!piles.isEmpty()) delete piles.first(); // removes itself @@ -154,9 +154,9 @@ Dealer::~Dealer() s_instance = 0; } -KMainWindow *Dealer::parent() const +KMainWindow *Dealer::tqparent() const { - return dynamic_cast(TQCanvasView::parent()); + return dynamic_cast(TQCanvasView::tqparent()); } @@ -249,7 +249,7 @@ void Dealer::newHint(MoveHint *mh) bool Dealer::isMoving(Card *c) const { - return movingCards.find(c) != movingCards.end(); + return movingCards.tqfind(c) != movingCards.end(); } void Dealer::contentsMouseMoveEvent(TQMouseEvent* e) @@ -277,13 +277,13 @@ void Dealer::contentsMouseMoveEvent(TQMouseEvent* e) continue; if (c->source() == movingCards.first()->source()) continue; - if (sources.findIndex(c->source()) != -1) + if (sources.tqfindIndex(c->source()) != -1) continue; sources.append(c->source()); } else { if ((*it)->rtti() == Pile::RTTI) { Pile *p = static_cast(*it); - if (p->isEmpty() && !sources.contains(p)) + if (p->isEmpty() && !sources.tqcontains(p)) sources.append(p); } else { kdDebug(11111) << "unknown object " << *it << " " << (*it)->rtti() << endl; @@ -314,7 +314,7 @@ void Dealer::contentsMouseMoveEvent(TQMouseEvent* e) void Dealer::mark(Card *c) { c->setSelected(true); - if (!marked.contains(c)) + if (!marked.tqcontains(c)) marked.append(c); } @@ -342,7 +342,7 @@ void Dealer::contentsMousePressEvent(TQMouseEvent* e) if (!list.count()) return; - if (e->button() == LeftButton) { + if (e->button() == Qt::LeftButton) { if (list.first()->rtti() == Card::RTTI) { Card *c = dynamic_cast(list.first()); assert(c); @@ -355,7 +355,7 @@ void Dealer::contentsMousePressEvent(TQMouseEvent* e) return; } - if (e->button() == RightButton) { + if (e->button() == Qt::RightButton) { if (list.first()->rtti() == Card::RTTI) { Card *preview = dynamic_cast(list.first()); assert(preview); @@ -535,8 +535,8 @@ void Dealer::resizeEvent(TQResizeEvent *e) { int x = width(); int y = height(); - int hs = horizontalScrollBar()->sizeHint().height(); - int vs = verticalScrollBar()->sizeHint().width(); + int hs = horizontalScrollBar()->tqsizeHint().height(); + int vs = verticalScrollBar()->tqsizeHint().width(); int mx = minsize.width(); int my = minsize.height(); @@ -735,7 +735,7 @@ State *Dealer::getState() s.it = c; s.source = c->source(); if (!s.source) { - kdDebug(11111) << c->name() << " has no parent\n"; + kdDebug(11111) << c->name() << " has no tqparent\n"; assert(false); } s.source_index = c->source()->indexOf(c); @@ -778,7 +778,7 @@ void Dealer::setState(State *st) CardState s = *it; bool target = c->takenDown(); // abused s.source->add(c, s.source_index); - c->setVisible(s.source->isVisible()); + c->tqsetVisible(s.source->isVisible()); c->setAnimated(false); c->setX(s.x); c->setY(s.y); @@ -827,13 +827,13 @@ void Dealer::takeState() ademo->setEnabled( false ); if ( aredeal ) aredeal->setEnabled( false ); - TQTimer::singleShot(400, this, TQT_SIGNAL(gameLost())); + TQTimer::singleShot(400, TQT_TQOBJECT(this), TQT_SIGNAL(gameLost())); toldAboutLostGame = true; return; } } if (!demoActive() && !waiting()) - TQTimer::singleShot(TIME_BETWEEN_MOVES, this, TQT_SLOT(startAutoDrop())); + TQTimer::singleShot(TIME_BETWEEN_MOVES, TQT_TQOBJECT(this), TQT_SLOT(startAutoDrop())); emit undoPossible(undoList.count() > 1 && !waiting()); } @@ -962,7 +962,7 @@ void Dealer::openGame(TQDomDocument &doc) (*it2)->setX(card.attribute("x").toInt()); (*it2)->setY(card.attribute("y").toInt()); (*it2)->setZ(card.attribute("z").toInt()); - (*it2)->setVisible(p->isVisible()); + (*it2)->tqsetVisible(p->isVisible()); cards.remove(it2); break; } @@ -1034,7 +1034,7 @@ void Dealer::setWaiting(bool w) void Dealer::setAutoDropEnabled(bool a) { _autodrop = a; - TQTimer::singleShot(TIME_BETWEEN_MOVES, this, TQT_SLOT(startAutoDrop())); + TQTimer::singleShot(TIME_BETWEEN_MOVES, TQT_TQOBJECT(this), TQT_SLOT(startAutoDrop())); } bool Dealer::startAutoDrop() @@ -1046,7 +1046,7 @@ bool Dealer::startAutoDrop() for (TQCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it) if ((*it)->animated()) { - TQTimer::singleShot(TIME_BETWEEN_MOVES, this, TQT_SLOT(startAutoDrop())); + TQTimer::singleShot(TIME_BETWEEN_MOVES, TQT_TQOBJECT(this), TQT_SLOT(startAutoDrop())); return true; } @@ -1160,14 +1160,14 @@ void Dealer::won() { // wrap in own scope to make KConfigGroupSave work KConfig *config = kapp->config(); KConfigGroupSaver kcs(config, scores_group); - unsigned int n = config->readUnsignedNumEntry(TQString("won%1").arg(_id),0) + 1; - config->writeEntry(TQString("won%1").arg(_id),n); - n = config->readUnsignedNumEntry(TQString("winstreak%1").arg(_id),0) + 1; - config->writeEntry(TQString("winstreak%1").arg(_id),n); - unsigned int m = config->readUnsignedNumEntry(TQString("maxwinstreak%1").arg(_id),0); + unsigned int n = config->readUnsignedNumEntry(TQString("won%1").tqarg(_id),0) + 1; + config->writeEntry(TQString("won%1").tqarg(_id),n); + n = config->readUnsignedNumEntry(TQString("winstreak%1").tqarg(_id),0) + 1; + config->writeEntry(TQString("winstreak%1").tqarg(_id),n); + unsigned int m = config->readUnsignedNumEntry(TQString("maxwinstreak%1").tqarg(_id),0); if (n>m) - config->writeEntry(TQString("maxwinstreak%1").arg(_id),n); - config->writeEntry(TQString("loosestreak%1").arg(_id),0); + config->writeEntry(TQString("maxwinstreak%1").tqarg(_id),n); + config->writeEntry(TQString("loosestreak%1").tqarg(_id),0); } // sort cards by increasing z @@ -1348,7 +1348,7 @@ void Dealer::drawPile(KPixmap &pixmap, Pile *pile, bool selected) TQRect bounding(int(pile->x()), int(pile->y()), cardMap::CARDX(), cardMap::CARDY()); pixmap.resize(bounding.width(), bounding.height()); - pixmap.fill(Qt::white); + pixmap.fill(TQt::white); if (!bg.isNull()) { for (int x=bounding.x()/bg.width(); @@ -1371,8 +1371,8 @@ void Dealer::drawPile(KPixmap &pixmap, Pile *pile, bool selected) sy = -dy; dy = 0; } - bitBlt(&pixmap, dx, dy, &bg, - sx, sy, w, h, Qt::CopyROP, true); + bitBlt(TQT_TQPAINTDEVICE(&pixmap), dx, dy, TQT_TQPAINTDEVICE(&bg), + sx, sy, w, h, TQt::CopyROP, true); } } } @@ -1381,7 +1381,7 @@ void Dealer::drawPile(KPixmap &pixmap, Pile *pile, bool selected) float s = -0.4; float n = -0.3; - int mid = QMAX( QMAX(midColor().red(), midColor().green()), midColor().blue()); + int mid = TQMAX( TQMAX(midColor().red(), midColor().green()), midColor().blue()); // if it's too dark - light instead of dark if (mid < 120) { @@ -1415,9 +1415,9 @@ void Dealer::wheelEvent( TQWheelEvent *e ) e->globalPos(), e->delta(), e->state()); viewportWheelEvent(&ce); if ( !ce.isAccepted() ) { - if ( e->orientation() == Horizontal && hScrollBarMode () == AlwaysOn ) + if ( e->orientation() ==Qt::Horizontal && hScrollBarMode () == AlwaysOn ) TQApplication::sendEvent( horizontalScrollBar(), e); - else if (e->orientation() == Vertical && vScrollBarMode () == AlwaysOn ) + else if (e->orientation() ==Qt::Vertical && vScrollBarMode () == AlwaysOn ) TQApplication::sendEvent( verticalScrollBar(), e); } else { e->accept(); @@ -1430,9 +1430,9 @@ void Dealer::countGame() kdDebug(11111) << "counting game as played." << endl; KConfig *config = kapp->config(); KConfigGroupSaver kcs(config, scores_group); - unsigned int Total = config->readUnsignedNumEntry(TQString("total%1").arg(_id),0); + unsigned int Total = config->readUnsignedNumEntry(TQString("total%1").tqarg(_id),0); ++Total; - config->writeEntry(TQString("total%1").arg(_id),Total); + config->writeEntry(TQString("total%1").tqarg(_id),Total); _gameRecorded = true; } } @@ -1443,12 +1443,12 @@ void Dealer::countLoss() // update score KConfig *config = kapp->config(); KConfigGroupSaver kcs(config, scores_group); - unsigned int n = config->readUnsignedNumEntry(TQString("loosestreak%1").arg(_id),0) + 1; - config->writeEntry(TQString("loosestreak%1").arg(_id),n); - unsigned int m = config->readUnsignedNumEntry(TQString("maxloosestreak%1").arg(_id),0); + unsigned int n = config->readUnsignedNumEntry(TQString("loosestreak%1").tqarg(_id),0) + 1; + config->writeEntry(TQString("loosestreak%1").tqarg(_id),n); + unsigned int m = config->readUnsignedNumEntry(TQString("maxloosestreak%1").tqarg(_id),0); if (n>m) - config->writeEntry(TQString("maxloosestreak%1").arg(_id),n); - config->writeEntry(TQString("winstreak%1").arg(_id),0); + config->writeEntry(TQString("maxloosestreak%1").tqarg(_id),n); + config->writeEntry(TQString("winstreak%1").tqarg(_id),0); } } diff --git a/kpat/dealer.h b/kpat/dealer.h index 42c07e9c..63b5bde9 100644 --- a/kpat/dealer.h +++ b/kpat/dealer.h @@ -35,7 +35,7 @@ public: } const char *name; uint gameindex; - virtual Dealer *createGame(KMainWindow *parent) = 0; + virtual Dealer *createGame(KMainWindow *tqparent) = 0; }; class CardState; @@ -54,13 +54,14 @@ struct State Dealer -- abstract base class of all varieties of patience ***************************************************************/ -class Dealer: public QCanvasView +class Dealer: public TQCanvasView { Q_OBJECT + TQ_OBJECT public: - Dealer( KMainWindow* parent = 0, const char* name = 0 ); + Dealer( KMainWindow* tqparent = 0, const char* name = 0 ); virtual ~Dealer(); static const Dealer *instance(); @@ -170,7 +171,7 @@ protected: // it's not const because it changes the random seed virtual MoveHint *chooseHint(); - KMainWindow *parent() const; + KMainWindow *tqparent() const; bool waiting() const { return _waiting != 0; } void setWaiting(bool w); @@ -182,7 +183,7 @@ protected: void setState(State *); // reimplement this to add game-specific information in the state structure - virtual TQString getGameState() const { return TQString::null; } + virtual TQString getGameState() const { return TQString(); } // reimplement this to use the game-specific information from the state structure virtual void setGameState( const TQString & ) {} @@ -210,7 +211,7 @@ protected: KRandomSequence randseq; TQColor _midcolor; - Q_UINT32 _id; + TQ_UINT32 _id; bool takeTargets; bool _won; int _waiting; diff --git a/kpat/deck.cpp b/kpat/deck.cpp index c2b6e0e5..860a88b7 100644 --- a/kpat/deck.cpp +++ b/kpat/deck.cpp @@ -10,8 +10,8 @@ const int NumberOfCards = 52; Deck *Deck::my_deck = 0; -Deck::Deck( Dealer* parent, int m, int s ) - : Pile( 0, parent ), mult( m ) +Deck::Deck( Dealer* tqparent, int m, int s ) + : Pile( 0, tqparent ), mult( m ) { _deck = new Card * [mult*NumberOfCards]; Q_CHECK_PTR (_deck); @@ -44,9 +44,9 @@ Deck::~Deck() // ---------------------------------------------------------------- -Deck *Deck::new_deck( Dealer *parent, int m, int s ) +Deck *Deck::new_deck( Dealer *tqparent, int m, int s ) { - my_deck = new Deck(parent, m, s); + my_deck = new Deck(tqparent, m, s); return my_deck; } diff --git a/kpat/deck.h b/kpat/deck.h index f5239fe0..eb13268c 100644 --- a/kpat/deck.h +++ b/kpat/deck.h @@ -13,11 +13,11 @@ class Deck: public Pile { private: - Deck( Dealer* parent = 0, int m = 1, int s = 4 ); + Deck( Dealer* tqparent = 0, int m = 1, int s = 4 ); virtual ~Deck(); public: - static Deck *new_deck( Dealer *parent = 0, int m = 1, int s = 4 ); + static Deck *new_deck( Dealer *tqparent = 0, int m = 1, int s = 4 ); static Deck *deck() { return my_deck; } static const long n; diff --git a/kpat/fortyeight.cpp b/kpat/fortyeight.cpp index 1747b647..e3e72385 100644 --- a/kpat/fortyeight.cpp +++ b/kpat/fortyeight.cpp @@ -5,8 +5,8 @@ #include #include "cardmaps.h" -HorLeftPile::HorLeftPile( int _index, Dealer* parent) - : Pile(_index, parent) +HorLeftPile::HorLeftPile( int _index, Dealer* tqparent) + : Pile(_index, tqparent) { // TODO: create a pile that moves the cards together when filling space setHSpread( cardMap::CARDX() / 11 + 1 ); @@ -27,8 +27,8 @@ void HorLeftPile::initSizes() } -Fortyeight::Fortyeight( KMainWindow* parent, const char* name) - : Dealer(parent,name) +Fortyeight::Fortyeight( KMainWindow* tqparent, const char* name) + : Dealer(tqparent,name) { deck = Deck::new_deck(this, 2); @@ -194,7 +194,7 @@ static class LocalDealerInfo8 : public DealerInfo { public: LocalDealerInfo8() : DealerInfo(I18N_NOOP("Forty && &Eight"), 8) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Fortyeight(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Fortyeight(tqparent); } } ldi9; //-------------------------------------------------------------------------// diff --git a/kpat/fortyeight.h b/kpat/fortyeight.h index 80303c0e..4489ffb1 100644 --- a/kpat/fortyeight.h +++ b/kpat/fortyeight.h @@ -6,9 +6,10 @@ class HorLeftPile : public Pile { Q_OBJECT + TQ_OBJECT public: - HorLeftPile( int _index, Dealer* parent = 0); + HorLeftPile( int _index, Dealer* tqparent = 0); virtual TQSize cardOffset( bool _spread, bool _facedown, const Card *before) const; virtual void initSizes(); }; @@ -16,9 +17,10 @@ public: class Fortyeight : public Dealer { Q_OBJECT + TQ_OBJECT public: - Fortyeight( KMainWindow* parent=0, const char* name=0); + Fortyeight( KMainWindow* tqparent=0, const char* name=0); virtual bool isGameLost() const; public slots: diff --git a/kpat/freecell-solver/USAGE b/kpat/freecell-solver/USAGE index f78295b2..583624ca 100644 --- a/kpat/freecell-solver/USAGE +++ b/kpat/freecell-solver/USAGE @@ -67,7 +67,7 @@ program with some effort on the programmer's part. This option will display the moves in standard notation in which every move consists of two characters and there are ten moves in a line. Naturally, -this option will only become apparent if the display moves is specified. +this option will only become aptqparent if the display moves is specified. (it does not implicitly specify it, though). For more information regarding standard notation refer to the following @@ -89,7 +89,7 @@ are needed to move from one to another. The standard notation option applies to it to. --pi --display-parent-iter +-pi --display-tqparent-iter This option (assuming the -s and -i options are specified) will also display the iteration index of the state from which the current state @@ -217,34 +217,34 @@ Freecell Tests: '2' - put freecell cards on top of stacks. '3' - put non-top stack cards in the foundations. '4' - move stack cards to different stacks. -'5' - move stack cards to a parent card on the same stack. +'5' - move stack cards to a tqparent card on the same stack. '6' - move sequences of cards onto free stacks. '7' - put freecell cards on empty stacks. -'8' - move cards to a different parent. +'8' - move cards to a different tqparent. '9' - empty an entire stack into the freecells. Atomic Freecell Tests: 'A' - move a stack card to an empty stack. -'B' - move a stack card to a parent on a different stack. +'B' - move a stack card to a tqparent on a different stack. 'C' - move a stack card to a freecell. -'D' - move a freecell card to a parent. +'D' - move a freecell card to a tqparent. 'E' - move a freecell card to an empty stack. Simple Simon Tests: 'a' - move a full sequence to the foundations. -'b' - move a sequence to a true parent of his. -'c' - move a whole stack sequence to a false parent (in order to clear +'b' - move a sequence to a true tqparent of his. +'c' - move a whole stack sequence to a false tqparent (in order to clear the stack) -'d' - move a sequence to a true parent that has some cards above it. -'e' - move a sequence with some cards above it to a true parent. -'f' - move a sequence with a junk sequence above it to a true parent that +'d' - move a sequence to a true tqparent that has some cards above it. +'e' - move a sequence with some cards above it to a true tqparent. +'f' - move a sequence with a junk sequence above it to a true tqparent that has some cards above it. -'g' - move a whole stack sequence to a false parent which has some +'g' - move a whole stack sequence to a false tqparent which has some cards above it. -'h' - move a sequence to a parent on the same stack. +'h' - move a sequence to a tqparent on the same stack. Manipulating the tests order can be very helpful to the quick solution of a given board. If you found that a certain board cannot be solved in @@ -259,7 +259,7 @@ Also note that Freecell tests are not suitable for solving Simple Simon games and Simple Simon tests are not suitable for solving anything except Simple Simon. -Tests can be grouped together into random groups using parenthesis +Tests can be grouped together into random groups using tqparenthesis (e.g: "(0123)") or square brackets ("[012][3456789]"). Such grouping is only relevant to the Random DFS scan (see below). @@ -332,7 +332,7 @@ used in all the normal scans. --reparent-states This option specifies that states that were encountered whose depth in the -states graph can be improved should be reparented to the new parent. This +states graph can be improved should be reparented to the new tqparent. This option can possibly make solutions shorter. @@ -502,7 +502,7 @@ If you are working on a UNIX or a similar system then you can set some run-time options in "fc-solve" by sending it some signal combinations. -If you send the signal USR1, without sending any other signals before +If you send the signal USR1, without sending any other Q_SIGNALS before that, then "fc-solve" will output the present number of iterations. This method is a good way to monitor an instance that takes a long time to solve. @@ -512,7 +512,7 @@ will print the iteration number and depth on every state that it checks. It is the equivalent of specifying (or unspecifying) the option -i/--iter-output. -If you send it two USR2 signals and then USR1, then "fc-solve" +If you send it two USR2 Q_SIGNALS and then USR1, then "fc-solve" will also print the board of every state. Again, this will only be done assuming the iteration output is turned on. diff --git a/kpat/freecell-solver/caas.c b/kpat/freecell-solver/caas.c index 82492f34..3654ab59 100644 --- a/kpat/freecell-solver/caas.c +++ b/kpat/freecell-solver/caas.c @@ -63,7 +63,7 @@ if (hash_value_int < 0) \ { \ /* \ - * This is a bit mask that nullifies the sign bit of the \ + * This is a bit tqmask that nullifies the sign bit of the \ * number so it will always be positive \ * */ \ hash_value_int &= (~(1<<((sizeof(hash_value_int)<<3)-1))); \ @@ -92,7 +92,7 @@ if (hash_value_int < 0) \ { \ /* \ - * This is a bit mask that nullifies the sign bit of the \ + * This is a bit tqmask that nullifies the sign bit of the \ * number so it will always be positive \ * */ \ hash_value_int &= (~(1<<((sizeof(hash_value_int)<<3)-1))); \ @@ -333,7 +333,7 @@ static GCC_INLINE void freecell_solver_cache_stacks( if (hash_value_int < 0) { /* - * This is a bit mask that nullifies the sign bit of the + * This is a bit tqmask that nullifies the sign bit of the * number so it will always be positive * */ hash_value_int &= (~(1<<((sizeof(hash_value_int)<<3)-1))); @@ -372,7 +372,7 @@ static GCC_INLINE void freecell_solver_cache_stacks( ); #if 0 ) /* In order to settle gvim and other editors that - are keen on parenthesis matching */ + are keen on tqparenthesis matching */ #endif replace_with_cached(cached_stack != NULL); @@ -437,7 +437,7 @@ void freecell_solver_cache_talon( if (hash_value_int < 0) { /* - * This is a bit mask that nullifies the sign bit of the + * This is a bit tqmask that nullifies the sign bit of the * number so it will always be positive * */ hash_value_int &= (~(1<<((sizeof(hash_value_int)<<3)-1))); @@ -529,9 +529,9 @@ GCC_INLINE int freecell_solver_check_and_add_state( if (check) { /* The new state was not found in the cache, and it was already inserted */ - if (new_state->parent) + if (new_state->tqparent) { - new_state->parent->num_active_children++; + new_state->tqparent->num_active_tqchildren++; } instance->num_states_in_collection++; diff --git a/kpat/freecell-solver/fcs.h b/kpat/freecell-solver/fcs.h index 43300310..6bca557f 100644 --- a/kpat/freecell-solver/fcs.h +++ b/kpat/freecell-solver/fcs.h @@ -170,7 +170,7 @@ typedef struct freecell_solver_instance * The debug_iter_output variables provide a programmer programmable way * to debug the algorithm while it is running. This works well for DFS * and Soft-DFS scans but at present support for A* and BFS is not - * too good, as its hard to tell which state came from which parent state. + * too good, as its hard to tell which state came from which tqparent state. * * debug_iter_output is a flag that indicates whether to use this feature * at all. @@ -190,7 +190,7 @@ typedef struct freecell_solver_instance int depth, void * instance, fcs_state_with_locations_t * state, - int parent_iter_num + int tqparent_iter_num ); void * debug_iter_output_context; @@ -582,7 +582,7 @@ struct freecell_solver_soft_thread_struct /* * The priority queue of the A* scan */ - PQUEUE * a_star_pqueue; + PTQUEUE * a_star_pqueue; double a_star_initial_cards_under_sequences; /* @@ -683,7 +683,7 @@ typedef struct freecell_solver_soft_thread_struct freecell_solver_soft_thread_t; #define FCS_A_STAR_WEIGHT_CARDS_OUT 0 #define FCS_A_STAR_WEIGHT_MAX_SEQUENCE_MOVE 1 #define FCS_A_STAR_WEIGHT_CARDS_UNDER_SEQUENCES 2 -#define FCS_A_STAR_WEIGHT_SEQS_OVER_RENEGADE_CARDS 3 +#define FCS_A_STAR_WEIGHT_SETQS_OVER_RENEGADE_CARDS 3 #define FCS_A_STAR_WEIGHT_DEPTH 4 freecell_solver_instance_t * freecell_solver_alloc_instance(void); diff --git a/kpat/freecell-solver/fcs_hash.c b/kpat/freecell-solver/fcs_hash.c index fde7a03f..2ae2d60b 100644 --- a/kpat/freecell-solver/fcs_hash.c +++ b/kpat/freecell-solver/fcs_hash.c @@ -53,7 +53,7 @@ SFO_hash_t * freecell_solver_hash_init( hash = (SFO_hash_t *)malloc(sizeof(SFO_hash_t)); hash->size = size; - hash->size_bitmask = size-1; + hash->size_bittqmask = size-1; hash->num_elems = 0; @@ -87,7 +87,7 @@ void * freecell_solver_hash_insert( SFO_hash_symlink_item_t * item, * last_item; /* Get the index of the appropriate chain in the hash table */ - place = hash_value & (hash->size_bitmask); + place = hash_value & (hash->size_bittqmask); list = &(hash->entries[place]); /* If first_item is non-existent */ @@ -220,7 +220,7 @@ static void SFO_hash_rehash( SFO_hash_t * hash ) { - int old_size, new_size, new_size_bitmask; + int old_size, new_size, new_size_bittqmask; int i; #if 0 SFO_hash_t * new_hash; @@ -242,7 +242,7 @@ static void SFO_hash_rehash( old_size = hash->size; new_size = old_size << 1; - new_size_bitmask = new_size - 1; + new_size_bittqmask = new_size - 1; new_entries = calloc(new_size, sizeof(SFO_hash_symlink_t)); @@ -254,7 +254,7 @@ static void SFO_hash_rehash( while(item != NULL) { /* The place in the new hash table */ - place = item->hash_value & new_size_bitmask; + place = item->hash_value & new_size_bittqmask; /* Store the next item in the linked list in a safe place, so we can retrieve it after the assignment */ @@ -280,7 +280,7 @@ static void SFO_hash_rehash( #endif hash->entries = new_entries; hash->size = new_size; - hash->size_bitmask = new_size_bitmask; + hash->size_bittqmask = new_size_bittqmask; } #else diff --git a/kpat/freecell-solver/fcs_hash.h b/kpat/freecell-solver/fcs_hash.h index fbe6c78c..77d746f0 100644 --- a/kpat/freecell-solver/fcs_hash.h +++ b/kpat/freecell-solver/fcs_hash.h @@ -53,8 +53,8 @@ struct SFO_hash_struct /* The size of the hash table */ int size; - /* A bit mask that extract the lowest bits out of the hash value */ - int size_bitmask; + /* A bit tqmask that extract the lowest bits out of the hash value */ + int size_bittqmask; /* The number of elements stored inside the hash */ int num_elems; /* A context to pass to the comparison function */ diff --git a/kpat/freecell-solver/fcs_user.h b/kpat/freecell-solver/fcs_user.h index 8ddbf6f2..0d9fe815 100644 --- a/kpat/freecell-solver/fcs_user.h +++ b/kpat/freecell-solver/fcs_user.h @@ -165,7 +165,7 @@ typedef void (*freecell_solver_user_iter_handler_t) int iter_num, int depth, void * ptr_state, - int parent_iter_num, + int tqparent_iter_num, void * context ); diff --git a/kpat/freecell-solver/freecell.c b/kpat/freecell-solver/freecell.c index 159772ff..fca09078 100644 --- a/kpat/freecell-solver/freecell.c +++ b/kpat/freecell-solver/freecell.c @@ -243,7 +243,7 @@ int freecell_solver_sfs_move_freecell_cards_on_top_of_stacks( { src_card = fcs_freecell_card(state, fc); - /* If the freecell is not empty and dest_card is its parent + /* If the freecell is not empty and dest_card is its tqparent * */ if ( (fcs_card_card_num(src_card) != 0) && fcs_is_parent_card(src_card,dest_card) ) @@ -533,7 +533,7 @@ int freecell_solver_sfs_move_stack_cards_to_a_parent_on_the_same_stack( sequences_are_built_by = instance->sequences_are_built_by; /* - * Now let's try to move a stack card to a parent card which is found + * Now let's try to move a stack card to a tqparent card which is found * on the same stack. * */ for (stack=0;stacka_star_pqueue = malloc(sizeof(PQUEUE)); + soft_thread->a_star_pqueue = malloc(sizeof(PTQUEUE)); freecell_solver_PQueueInitialise( soft_thread->a_star_pqueue, 1024 @@ -795,8 +795,8 @@ static void trace_solution( s1 = instance->final_state; - /* Retrace the step from the current state to its parents */ - while (s1->parent != NULL) + /* Retrace the step from the current state to its tqparents */ + while (s1->tqparent != NULL) { /* Mark the state as part of the non-optimized solution */ s1->visited |= FCS_VISITED_IN_SOLUTION_PATH; @@ -811,8 +811,8 @@ static void trace_solution( } /* Duplicate the state to a freshly malloced memory */ - /* Move to the parent state */ - s1 = s1->parent; + /* Move to the tqparent state */ + s1 = s1->tqparent; } /* There's one more state than there are move stacks */ s1->visited |= FCS_VISITED_IN_SOLUTION_PATH; @@ -915,7 +915,7 @@ int freecell_solver_solve_instance( state_copy_ptr->depth = 0; state_copy_ptr->moves_to_parent = NULL; state_copy_ptr->visited = 0; - state_copy_ptr->parent = NULL; + state_copy_ptr->tqparent = NULL; memset(&(state_copy_ptr->scan_visited), '\0', sizeof(state_copy_ptr->scan_visited)); instance->state_copy_ptr = state_copy_ptr; diff --git a/kpat/freecell-solver/lib.c b/kpat/freecell-solver/lib.c index 1839614b..e887fe00 100644 --- a/kpat/freecell-solver/lib.c +++ b/kpat/freecell-solver/lib.c @@ -892,7 +892,7 @@ static void freecell_solver_user_iter_handler_wrapper( int depth, void * lp_instance, fcs_state_with_locations_t * ptr_state_with_locations, - int parent_iter_num + int tqparent_iter_num ) { fcs_user_t * user; @@ -904,7 +904,7 @@ static void freecell_solver_user_iter_handler_wrapper( iter_num, depth, (void *)ptr_state_with_locations, - parent_iter_num, + tqparent_iter_num, user->iter_handler_context ); diff --git a/kpat/freecell-solver/lookup2.c b/kpat/freecell-solver/lookup2.c index 6ab9ae7e..c5886304 100644 --- a/kpat/freecell-solver/lookup2.c +++ b/kpat/freecell-solver/lookup2.c @@ -19,7 +19,7 @@ Note: #define hashsize(n) ((ub4)1<<(n)) -#define hashmask(n) (hashsize(n)-1) +#define hashtqmask(n) (hashsize(n)-1) /* -------------------------------------------------------------------- diff --git a/kpat/freecell-solver/main.c b/kpat/freecell-solver/main.c index d16468c4..f4949741 100644 --- a/kpat/freecell-solver/main.c +++ b/kpat/freecell-solver/main.c @@ -43,7 +43,7 @@ static void my_iter_handler( int iter_num, int depth, void * ptr_state, - int parent_iter_num, + int tqparent_iter_num, void * lp_context ) { @@ -57,7 +57,7 @@ static void my_iter_handler( ); if (context->display_parent_iter_num) { - fprintf(stdout, "Parent Iteration: %i\n", parent_iter_num); + fprintf(stdout, "Parent Iteration: %i\n", tqparent_iter_num); } fprintf(stdout, "\n"); @@ -169,8 +169,8 @@ help_screen_t help_screens[] = { "-snx --standard-notation-extended\n" " Display the moves in extended standard notation while specifying the\n" " number of cards moved if applicable\n" -"-pi --display-parent-iter \n" -" Display the index of the parent iteration of each state in the\n" +"-pi --display-tqparent-iter \n" +" Display the index of the tqparent iteration of each state in the\n" " run-time dump.\n" "\n" "--freecells-num [Freecells\' Number]\n" @@ -227,35 +227,35 @@ help_screen_t help_screens[] = { " '2' - put freecell cards on top of stacks.\n" " '3' - put non-top stack cards in the foundations.\n" " '4' - move stack cards to different stacks.\n" -" '5' - move stack cards to a parent card on the same stack.\n" +" '5' - move stack cards to a tqparent card on the same stack.\n" " '6' - move sequences of cards onto free stacks.\n" " '7' - put freecell cards on empty stacks.\n" -" '8' - move cards to a different parent.\n" +" '8' - move cards to a different tqparent.\n" " '9' - empty an entire stack into the freecells.\n" "\n" " Atomic Freecell Tests:\n" "\n" " 'A' - move a stack card to an empty stack.\n" -" 'B' - move a stack card to a parent on a different stack.\n" +" 'B' - move a stack card to a tqparent on a different stack.\n" " 'C' - move a stack card to a freecell.\n" -" 'D' - move a freecel card to a parent.\n" +" 'D' - move a freecel card to a tqparent.\n" " 'E' - move a freecel card to an empty stack.\n" "\n" " Simple Simon Tests:\n" "\n" " 'a' - move a full sequence to the foundations.\n" -" 'b' - move a sequence to a true parent of his.\n" -" 'c' - move a whole stack sequence to a false parent (in order to\n" +" 'b' - move a sequence to a true tqparent of his.\n" +" 'c' - move a whole stack sequence to a false tqparent (in order to\n" " clear the stack)\n" -" 'd' - move a sequence to a true parent that has some cards above it.\n" -" 'e' - move a sequence with some cards above it to a true parent.\n" -" 'f' - move a sequence with a junk sequence above it to a true parent\n" +" 'd' - move a sequence to a true tqparent that has some cards above it.\n" +" 'e' - move a sequence with some cards above it to a true tqparent.\n" +" 'f' - move a sequence with a junk sequence above it to a true tqparent\n" " that has some cards above it.\n" -" 'g' - move a whole stack sequence to a false parent which has some\n" +" 'g' - move a whole stack sequence to a false tqparent which has some\n" " cards above it.\n" -" 'h' - move a sequence to a parent on the same stack.\n" +" 'h' - move a sequence to a tqparent on the same stack.\n" "\n" -" Tests are grouped with parenthesis or square brackets. Each group\n" +" Tests are grouped with tqparenthesis or square brackets. Each group\n" " will be randomized as a whole by the random-dfs scan.\n" "\n" "\n" @@ -313,7 +313,7 @@ help_screen_t help_screens[] = { "\n" "\n" "--reparent-states\n" -" Reparent states that have a larger depth than that of the state\n" +" Retqparent states that have a larger depth than that of the state\n" " from which they were reached a posteriori.\n" "--calc-real-depth\n" " If --reparent-states is enabled, then explictly calculate the real\n" @@ -498,7 +498,7 @@ static int cmd_line_callback( dc->display_moves = 1; dc->display_states = 1; } - else if ((!strcmp(argv[arg], "-pi")) || (!strcmp(argv[arg], "--display-parent-iter"))) + else if ((!strcmp(argv[arg], "-pi")) || (!strcmp(argv[arg], "--display-tqparent-iter"))) { dc->display_parent_iter_num = 1; } @@ -588,7 +588,7 @@ static char * known_parameters[] = { "-sn", "--standard-notation", "-snx", "--standard-notation-extended", "-sam", "--display-states-and-moves", - "-pi", "--display-parent-iter", + "-pi", "--display-tqparent-iter", "--reset", NULL }; @@ -658,12 +658,12 @@ int main(int argc, char * argv[]) if ((arg == argc) || (!strcmp(argv[arg], "-"))) { file = stdin; - if (!getenv("FREECELL_SOLVER_QUIET")) + if (!getenv("FREECELL_SOLVER_TQUIET")) { fprintf(stderr, "%s", "Reading the board from the standard input.\n" "Type \"fc-solve --help\" for more usage information.\n" - "To cancel this message set the FREECELL_SOLVER_QUIET environment variable.\n" + "To cancel this message set the FREECELL_SOLVER_TQUIET environment variable.\n" ); } } diff --git a/kpat/freecell-solver/pqueue.c b/kpat/freecell-solver/pqueue.c index 086cce96..7cacf8ff 100644 --- a/kpat/freecell-solver/pqueue.c +++ b/kpat/freecell-solver/pqueue.c @@ -33,7 +33,7 @@ the list is sorted ascending or descending... */ void freecell_solver_PQueueInitialise( - PQUEUE *pq, + PTQUEUE *pq, int32 MaxElements ) { @@ -53,7 +53,7 @@ void freecell_solver_PQueueInitialise( returns TRUE if successful, FALSE if fails. (You fail by filling the pqueue.) PGetRating is a function which returns the rating of the item you're adding for sorting purposes */ -int freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t r) +int freecell_solver_PQueuePush( PTQUEUE *pq, void *item, pq_rating_t r) { uint32 i; pq_element_t * Elements = pq->Elements; @@ -73,7 +73,7 @@ int freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t r) i = (++CurrentSize); - /* while the parent of the space we're putting the new node into is worse than + /* while the tqparent of the space we're putting the new node into is worse than our new node, swap the space with the worse node. We keep doing that until we get to a worse node or until we get to the top @@ -82,17 +82,17 @@ int freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t r) { - while( ( i==PQ_FIRST_ENTRY ? - (PQUEUE_MaxRating) /* return biggest possible rating if first element */ + while( ( i==PTQ_FIRST_ENTRY ? + (PTQUEUE_MaxRating) /* return biggest possible rating if first element */ : - (PGetRating(Elements[ PQ_PARENT_INDEX(i) ]) ) + (PGetRating(Elements[ PTQ_PARENT_INDEX(i) ]) ) ) < r ) { - Elements[ i ] = Elements[ PQ_PARENT_INDEX(i) ]; + Elements[ i ] = Elements[ PTQ_PARENT_INDEX(i) ]; - i = PQ_PARENT_INDEX(i); + i = PTQ_PARENT_INDEX(i); } } @@ -110,14 +110,14 @@ int freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t r) #define PQueueIsEmpty(pq) ((pq)->CurrentSize == 0) /* free up memory for pqueue */ -void freecell_solver_PQueueFree( PQUEUE *pq ) +void freecell_solver_PQueueFree( PTQUEUE *pq ) { free( pq->Elements ); } /* remove the first node from the pqueue and provide a pointer to it */ -void *freecell_solver_PQueuePop( PQUEUE *pq) +void *freecell_solver_PQueuePop( PTQUEUE *pq) { int32 i; int32 child; @@ -132,7 +132,7 @@ void *freecell_solver_PQueuePop( PQUEUE *pq) return NULL; } - pMaxElement = Elements[PQ_FIRST_ENTRY]; + pMaxElement = Elements[PTQ_FIRST_ENTRY]; /* get pointer to last element in tree */ pLastElement = Elements[ CurrentSize-- ]; @@ -143,9 +143,9 @@ void *freecell_solver_PQueuePop( PQUEUE *pq) /* UNTESTED */ - for( i=PQ_FIRST_ENTRY; (child = PQ_LEFT_CHILD_INDEX(i)) <= CurrentSize; i=child ) + for( i=PTQ_FIRST_ENTRY; (child = PTQ_LEFT_CHILD_INDEX(i)) <= CurrentSize; i=child ) { - /* set child to the smaller of the two children... */ + /* set child to the smaller of the two tqchildren... */ if( (child != CurrentSize) && (PGetRating(Elements[child + 1]) > PGetRating(Elements[child])) ) diff --git a/kpat/freecell-solver/pqueue.h b/kpat/freecell-solver/pqueue.h index cf5f5372..d4cfd7a3 100644 --- a/kpat/freecell-solver/pqueue.h +++ b/kpat/freecell-solver/pqueue.h @@ -11,8 +11,8 @@ http://www.geocities.com/jheyesjones/astar.html */ -#ifndef FC_SOLVE__PQUEUE_H -#define FC_SOLVE__PQUEUE_H +#ifndef FC_SOLVE__PTQUEUE_H +#define FC_SOLVE__PTQUEUE_H #ifdef __cplusplus extern "C" { @@ -22,7 +22,7 @@ extern "C" { #include "jhjtypes.h" -#define PQUEUE_MaxRating INT_MAX +#define PTQUEUE_MaxRating INT_MAX typedef int32 pq_rating_t; @@ -32,35 +32,35 @@ typedef struct struct_pq_element_t pq_rating_t rating; } pq_element_t; -typedef struct _PQUEUE +typedef struct _PTQUEUE { int32 MaxSize; int32 CurrentSize; pq_element_t * Elements; /* pointer to void pointers */ pq_rating_t MaxRating; /* biggest element possible */ -} PQUEUE; +} PTQUEUE; /* given an index to any element in a binary tree stored in a linear array with the root at 1 and a "sentinel" value at 0 these macros are useful in making the code clearer */ -/* the parent is always given by index/2 */ -#define PQ_PARENT_INDEX(i) ((i)>>1) -#define PQ_FIRST_ENTRY (1) +/* the tqparent is always given by index/2 */ +#define PTQ_PARENT_INDEX(i) ((i)>>1) +#define PTQ_FIRST_ENTRY (1) -/* left and right children are index * 2 and (index * 2) +1 respectively */ -#define PQ_LEFT_CHILD_INDEX(i) ((i)<<1) -#define PQ_RIGHT_CHILD_INDEX(i) (((i)<<1)+1) +/* left and right tqchildren are index * 2 and (index * 2) +1 respectively */ +#define PTQ_LEFT_CHILD_INDEX(i) ((i)<<1) +#define PTQ_RIGHT_CHILD_INDEX(i) (((i)<<1)+1) void freecell_solver_PQueueInitialise( - PQUEUE *pq, + PTQUEUE *pq, int32 MaxElements ); -void freecell_solver_PQueueFree( PQUEUE *pq ); +void freecell_solver_PQueueFree( PTQUEUE *pq ); -int freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t); +int freecell_solver_PQueuePush( PTQUEUE *pq, void *item, pq_rating_t); -void *freecell_solver_PQueuePop( PQUEUE *pq); +void *freecell_solver_PQueuePop( PTQUEUE *pq); #define PGetRating(elem) ((elem).rating) @@ -68,4 +68,4 @@ void *freecell_solver_PQueuePop( PQUEUE *pq); } #endif -#endif /* #ifdef FC_SOLVE__PQUEUE_H */ +#endif /* #ifdef FC_SOLVE__PTQUEUE_H */ diff --git a/kpat/freecell-solver/preset.c b/kpat/freecell-solver/preset.c index 16a02f1d..9286fd83 100644 --- a/kpat/freecell-solver/preset.c +++ b/kpat/freecell-solver/preset.c @@ -457,7 +457,7 @@ int freecell_solver_apply_tests_order( } if (! is_group) { - *error_string = strdup("There's a renegade right parenthesis or bracket."); + *error_string = strdup("There's a renegade right tqparenthesis or bracket."); return 3; } is_group = 0; diff --git a/kpat/freecell-solver/scans.c b/kpat/freecell-solver/scans.c index 5c579739..31a5dd18 100644 --- a/kpat/freecell-solver/scans.c +++ b/kpat/freecell-solver/scans.c @@ -406,7 +406,7 @@ int freecell_solver_soft_dfs_or_random_dfs_do_solve_or_resume( freecell_solver_increase_dfs_max_depth(soft_thread); /* Initialize the initial state to indicate it is the first */ - ptr_state_with_locations_orig->parent = NULL; + ptr_state_with_locations_orig->tqparent = NULL; ptr_state_with_locations_orig->moves_to_parent = NULL; ptr_state_with_locations_orig->depth = 0; @@ -692,7 +692,7 @@ int freecell_solver_soft_dfs_or_random_dfs_do_solve_or_resume( ptr_recurse_into_state_with_locations->visited_iter = instance->num_times; #if 0 - ptr_recurse_into_state_with_locations->parent = ptr_state_with_locations; + ptr_recurse_into_state_with_locations->tqparent = ptr_state_with_locations; #endif /* @@ -727,7 +727,7 @@ int freecell_solver_soft_dfs_or_random_dfs_do_solve_or_resume( #undef myreturn #define FCS_A_STAR_CARDS_UNDER_SEQUENCES_EXPONENT 1.3 -#define FCS_A_STAR_SEQS_OVER_RENEGADE_CARDS_EXPONENT 1.3 +#define FCS_A_STAR_SETQS_OVER_RENEGADE_CARDS_EXPONENT 1.3 #define state (ptr_state_with_locations->s) @@ -827,7 +827,7 @@ static pq_rating_t freecell_solver_a_star_rate_state( seqs_over_renegade_cards += ((unlimited_sequence_move) ? 1 : - pow(cards_num-c-1, FCS_A_STAR_SEQS_OVER_RENEGADE_CARDS_EXPONENT) + pow(cards_num-c-1, FCS_A_STAR_SETQS_OVER_RENEGADE_CARDS_EXPONENT) ); } } @@ -836,8 +836,8 @@ static pq_rating_t freecell_solver_a_star_rate_state( / soft_thread->a_star_initial_cards_under_sequences) * a_star_weights[FCS_A_STAR_WEIGHT_CARDS_UNDER_SEQUENCES]; ret += (seqs_over_renegade_cards / - pow(decks_num*52, FCS_A_STAR_SEQS_OVER_RENEGADE_CARDS_EXPONENT) ) - * a_star_weights[FCS_A_STAR_WEIGHT_SEQS_OVER_RENEGADE_CARDS]; + pow(decks_num*52, FCS_A_STAR_SETQS_OVER_RENEGADE_CARDS_EXPONENT) ) + * a_star_weights[FCS_A_STAR_WEIGHT_SETQS_OVER_RENEGADE_CARDS]; num_cards_in_founds = 0; for(a=0;a<(decks_num<<2);a++) @@ -945,7 +945,7 @@ int freecell_solver_a_star_or_bfs_do_solve_or_resume( ); int scans_synergy = instance->scans_synergy; fcs_states_linked_list_item_t * bfs_queue = soft_thread->bfs_queue; - PQUEUE * a_star_pqueue = soft_thread->a_star_pqueue; + PTQUEUE * a_star_pqueue = soft_thread->a_star_pqueue; fcs_states_linked_list_item_t * bfs_queue_last_item = soft_thread->bfs_queue_last_item; derived.num_states = 0; @@ -958,7 +958,7 @@ int freecell_solver_a_star_or_bfs_do_solve_or_resume( if (!resume) { /* Initialize the first element to indicate it is the first */ - ptr_state_with_locations_orig->parent = NULL; + ptr_state_with_locations_orig->tqparent = NULL; ptr_state_with_locations_orig->moves_to_parent = NULL; ptr_state_with_locations_orig->depth = 0; } @@ -1027,9 +1027,9 @@ int freecell_solver_a_star_or_bfs_do_solve_or_resume( ptr_state_with_locations->depth, (void*)instance, ptr_state_with_locations, - ((ptr_state_with_locations->parent == NULL) ? + ((ptr_state_with_locations->tqparent == NULL) ? 0 : - ptr_state_with_locations->parent->visited_iter + ptr_state_with_locations->tqparent->visited_iter ) ); } diff --git a/kpat/freecell-solver/simpsim.c b/kpat/freecell-solver/simpsim.c index f603ba39..a51b0c50 100644 --- a/kpat/freecell-solver/simpsim.c +++ b/kpat/freecell-solver/simpsim.c @@ -19,16 +19,16 @@ #endif -#define fcs_is_ss_false_parent(parent, child) \ - (fcs_card_card_num(parent) == fcs_card_card_num(child)+1) +#define fcs_is_ss_false_parent(tqparent, child) \ + (fcs_card_card_num(tqparent) == fcs_card_card_num(child)+1) -#define fcs_suit_is_ss_true_parent(parent_suit, child_suit) \ - ((parent_suit) == (child_suit)) +#define fcs_suit_is_ss_true_parent(tqparent_suit, child_suit) \ + ((tqparent_suit) == (child_suit)) -#define fcs_is_ss_true_parent(parent, child) \ +#define fcs_is_ss_true_parent(tqparent, child) \ ( \ - fcs_is_ss_false_parent(parent,child) && \ - (fcs_suit_is_ss_true_parent(fcs_card_suit(parent),fcs_card_suit(child))) \ + fcs_is_ss_false_parent(tqparent,child) && \ + (fcs_suit_is_ss_true_parent(fcs_card_suit(tqparent),fcs_card_suit(child))) \ ) /* @@ -185,7 +185,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent( if (cards_num > 0) { /* Loop on the cards in the stack and try to look for a true - * parent on top one of the stacks */ + * tqparent on top one of the stacks */ card = fcs_stack_card(state,stack,cards_num-1); card_num = fcs_card_card_num(card); suit = fcs_card_suit(card); @@ -208,7 +208,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent( (fcs_card_card_num(dest_card) == (card_num+1)) ) { - /* This is a suitable parent - let's check if we + /* This is a suitable tqparent - let's check if we * have enough empty stacks to make the move feasible */ if (calc_max_sequence_move(0, num_freestacks) >= num_true_seqs) { @@ -334,7 +334,7 @@ int freecell_solver_sfs_simple_simon_move_whole_stack_sequence_to_false_parent( (fcs_is_ss_false_parent(dest_card, card)) ) { - /* This is a suitable parent - let's check if we + /* This is a suitable tqparent - let's check if we * have enough empty stacks to make the move feasible */ if (calc_max_sequence_move(0, num_freestacks) >= num_true_seqs) { @@ -387,7 +387,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent_with_some_card * dest_cards_num - the number of cards in "ds" * dc - the index of the current card in "ds". * num_separate_false_seqs - this variable tells how many distinct false - * sequences exist above the true parent + * sequences exist above the true tqparent * above_num_true_seqs[] - the number of true sequences in each false * sequence * seq_points[] - the separation points of the false sequences (i.e: where @@ -451,7 +451,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent_with_some_card (fcs_card_card_num(dest_card) == (card_num+1)) ) { - /* This is a suitable parent - let's check if there's a sequence above it. */ + /* This is a suitable tqparent - let's check if there's a sequence above it. */ /* * above_c - the height of the card that is to be checked. @@ -504,7 +504,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent_with_some_card int clear_junk_dest_stack = -1; - /* Let's try to find a suitable parent on top one of the stacks */ + /* Let's try to find a suitable tqparent on top one of the stacks */ for(clear_junk_dest_stack=0; clear_junk_dest_stack < state_stacks_num; clear_junk_dest_stack++ @@ -573,7 +573,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent_with_some_card /* * We can do it - so let's move everything. * Notice that we only put the child in a different stack - * then the parent and let it move to the parent in the + * then the tqparent and let it move to the tqparent in the * next iteration of the program * */ @@ -743,7 +743,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_with_some_cards_above_to_true (fcs_card_card_num(dest_card) == (card_num+1)) ) { - /* This is a suitable parent - let's check if we + /* This is a suitable tqparent - let's check if we * have enough empty stacks to make the move feasible */ for(a=0;a= num_true_seqs) { @@ -1450,7 +1450,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack( int check; int stack, cards_num, pc, cc; - fcs_card_t parent_card, child_card; + fcs_card_t tqparent_card, child_card; int a; int after_junk_num_freestacks; int false_seq_index; @@ -1468,13 +1468,13 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack( cards_num = fcs_stack_len(state, stack); if (cards_num > 2) { - /* Search for a parent card */ + /* Search for a tqparent card */ for(pc=0; pc < cards_num-1 ; pc++) { - parent_card = fcs_stack_card(state, stack, pc); + tqparent_card = fcs_stack_card(state, stack, pc); if ( fcs_is_ss_true_parent( - parent_card, + tqparent_card, fcs_stack_card(state, stack, pc+1) ) ) @@ -1487,12 +1487,12 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack( { child_card = fcs_stack_card(state, stack, cc); if (fcs_is_ss_true_parent( - parent_card, + tqparent_card, child_card ) ) { - /* We have a matching parent and child cards */ + /* We have a matching tqparent and child cards */ #if 0 printf("Stack %i, Parent %i, Child %i\n", stack, pc, cc); fflush(stdout); @@ -1559,7 +1559,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack( above_num_true_seqs[num_separate_false_seqs] = child_num_true_seqs; seq_points[num_separate_false_seqs++] = cc; - /* Add the cards between the parent and the child to the seq_points */ + /* Add the cards between the tqparent and the child to the seq_points */ above_card = fcs_stack_card(state, stack, cc-1); above_num_true_seqs[num_separate_false_seqs] = 1; @@ -1599,7 +1599,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack( int clear_junk_dest_stack = -1; - /* Let's try to find a suitable parent on top one of the stacks */ + /* Let's try to find a suitable tqparent on top one of the stacks */ for(clear_junk_dest_stack=0; clear_junk_dest_stack < state_stacks_num; clear_junk_dest_stack++ diff --git a/kpat/freecell-solver/state.h b/kpat/freecell-solver/state.h index e52b717c..7b312b42 100644 --- a/kpat/freecell-solver/state.h +++ b/kpat/freecell-solver/state.h @@ -72,12 +72,12 @@ struct fcs_struct_state_with_locations_t fcs_state_t s; int stack_locs[MAX_NUM_STACKS]; int fc_locs[MAX_NUM_FREECELLS]; - struct fcs_struct_state_with_locations_t * parent; + struct fcs_struct_state_with_locations_t * tqparent; fcs_move_stack_t * moves_to_parent; int depth; int visited; int visited_iter; - int num_active_children; + int num_active_tqchildren; int scan_visited[MAX_NUM_SCANS_BUCKETS]; }; @@ -232,12 +232,12 @@ struct fcs_struct_state_with_locations_t fcs_state_t s; char stack_locs[MAX_NUM_STACKS]; char fc_locs[MAX_NUM_FREECELLS]; - struct fcs_struct_state_with_locations_t * parent; + struct fcs_struct_state_with_locations_t * tqparent; fcs_move_stack_t * moves_to_parent; int depth; int visited; int visited_iter; - int num_active_children; + int num_active_tqchildren; int scan_visited[MAX_NUM_SCANS_BUCKETS]; }; @@ -484,7 +484,7 @@ struct fcs_struct_state_with_locations_t fcs_state_t s; fcs_locs_t stack_locs[MAX_NUM_STACKS]; fcs_locs_t fc_locs[MAX_NUM_FREECELLS]; - struct fcs_struct_state_with_locations_t * parent; + struct fcs_struct_state_with_locations_t * tqparent; fcs_move_stack_t * moves_to_parent; int depth; /* @@ -508,11 +508,11 @@ struct fcs_struct_state_with_locations_t * */ int visited_iter; /* - * This is the number of direct children of this state which were not + * This is the number of direct tqchildren of this state which were not * yet declared as dead ends. Once this counter reaches zero, this * state too is declared as a dead end. * */ - int num_active_children; + int num_active_tqchildren; /* * This is a vector of flags - one for each scan. Each indicates whether * its scan has already visited this state diff --git a/kpat/freecell-solver/test_arr.h b/kpat/freecell-solver/test_arr.h index cfc5cd12..821ccd98 100644 --- a/kpat/freecell-solver/test_arr.h +++ b/kpat/freecell-solver/test_arr.h @@ -26,19 +26,19 @@ typedef int (*freecell_solver_solve_for_state_test_t)( extern freecell_solver_solve_for_state_test_t freecell_solver_sfs_tests[FCS_TESTS_NUM]; /* - * This macro determines if child can be placed above parent. + * This macro determines if child can be placed above tqparent. * * The variable sequences_are_built_by has to be initialized to * the sequences_are_built_by member of the instance. * * */ -#define fcs_is_parent_card(child, parent) \ - ((fcs_card_card_num(child)+1 == fcs_card_card_num(parent)) && \ +#define fcs_is_parent_card(child, tqparent) \ + ((fcs_card_card_num(child)+1 == fcs_card_card_num(tqparent)) && \ ((sequences_are_built_by == FCS_SEQ_BUILT_BY_RANK) ? \ 1 : \ ((sequences_are_built_by == FCS_SEQ_BUILT_BY_SUIT) ? \ - (fcs_card_suit(child) == fcs_card_suit(parent)) : \ - ((fcs_card_suit(child) & 0x1) != (fcs_card_suit(parent)&0x1)) \ + (fcs_card_suit(child) == fcs_card_suit(tqparent)) : \ + ((fcs_card_suit(child) & 0x1) != (fcs_card_suit(tqparent)&0x1)) \ )) \ ) @@ -58,7 +58,7 @@ extern freecell_solver_solve_for_state_test_t freecell_solver_sfs_tests[FCS_TEST /* Count the number of states until the original state. */ \ while(ptr_state != NULL) \ { \ - ptr_state = ptr_state->parent; \ + ptr_state = ptr_state->tqparent; \ this_real_depth++; \ } \ this_real_depth--; \ @@ -68,14 +68,14 @@ extern freecell_solver_solve_for_state_test_t freecell_solver_sfs_tests[FCS_TEST { \ ptr_state->depth = this_real_depth; \ this_real_depth--; \ - ptr_state = ptr_state->parent; \ + ptr_state = ptr_state->tqparent; \ } \ } \ } \ /* * This macro marks a state as a dead end, and afterwards propogates - * this information to its parent and ancestor states. + * this information to its tqparent and ancestor states. * */ #define mark_as_dead_end(ptr_state_input) \ { \ @@ -84,23 +84,23 @@ extern freecell_solver_solve_for_state_test_t freecell_solver_sfs_tests[FCS_TEST fcs_state_with_locations_t * ptr_state = (ptr_state_input); \ /* Mark as a dead end */ \ ptr_state->visited |= FCS_VISITED_DEAD_END; \ - ptr_state = ptr_state->parent; \ + ptr_state = ptr_state->tqparent; \ if (ptr_state != NULL) \ { \ /* Decrease the refcount of the state */ \ - ptr_state->num_active_children--; \ - while((ptr_state->num_active_children == 0) && (ptr_state->visited & FCS_VISITED_ALL_TESTS_DONE)) \ + ptr_state->num_active_tqchildren--; \ + while((ptr_state->num_active_tqchildren == 0) && (ptr_state->visited & FCS_VISITED_ALL_TESTS_DONE)) \ { \ /* Mark as dead end */ \ ptr_state->visited |= FCS_VISITED_DEAD_END; \ - /* Go to its parent state */ \ - ptr_state = ptr_state->parent; \ + /* Go to its tqparent state */ \ + ptr_state = ptr_state->tqparent; \ if (ptr_state == NULL) \ { \ break; \ } \ /* Decrease the refcount */ \ - ptr_state->num_active_children--; \ + ptr_state->num_active_tqchildren--; \ } \ } \ } \ diff --git a/kpat/freecell-solver/tests.h b/kpat/freecell-solver/tests.h index ce0b35b5..fbf78262 100644 --- a/kpat/freecell-solver/tests.h +++ b/kpat/freecell-solver/tests.h @@ -58,7 +58,7 @@ extern "C" { /* Some A* and BFS parameters that need to be initialized in \ * the derived state. \ * */ \ - ptr_new_state_with_locations->parent = ptr_state_with_locations; \ + ptr_new_state_with_locations->tqparent = ptr_state_with_locations; \ ptr_new_state_with_locations->moves_to_parent = moves; \ /* Make sure depth is consistent with the game graph. \ * I.e: the depth of every newly discovered state is derived from \ @@ -66,8 +66,8 @@ extern "C" { ptr_new_state_with_locations->depth = ptr_state_with_locations->depth + 1; \ /* Mark this state as a state that was not yet visited */ \ ptr_new_state_with_locations->visited = 0; \ - /* It's a newly created state which does not have children yet. */ \ - ptr_new_state_with_locations->num_active_children = 0; \ + /* It's a newly created state which does not have tqchildren yet. */ \ + ptr_new_state_with_locations->num_active_tqchildren = 0; \ memset(ptr_new_state_with_locations->scan_visited, '\0', \ sizeof(ptr_new_state_with_locations->scan_visited) \ ); \ @@ -103,11 +103,11 @@ fcs_move_stack_push(moves, temp_move); \ { \ fcs_state_ia_release(hard_thread); \ calculate_real_depth(existing_state); \ - /* Re-parent the existing state to this one. \ + /* Re-tqparent the existing state to this one. \ * \ * What it means is that if the depth of the state if it \ * can be reached from this one is lower than what it \ - * already have, then re-assign its parent to this state. \ + * already have, then re-assign its tqparent to this state. \ * */ \ if (reparent && \ (existing_state->depth > ptr_state_with_locations->depth+1)) \ @@ -119,15 +119,15 @@ fcs_move_stack_push(moves, temp_move); \ ); \ if (!(existing_state->visited & FCS_VISITED_DEAD_END)) \ { \ - if ((--existing_state->parent->num_active_children) == 0) \ + if ((--existing_state->tqparent->num_active_tqchildren) == 0) \ { \ mark_as_dead_end( \ - existing_state->parent \ + existing_state->tqparent \ ); \ } \ - ptr_state_with_locations->num_active_children++; \ + ptr_state_with_locations->num_active_tqchildren++; \ } \ - existing_state->parent = ptr_state_with_locations; \ + existing_state->tqparent = ptr_state_with_locations; \ existing_state->depth = ptr_state_with_locations->depth + 1; \ } \ fcs_derived_states_list_add_state( \ diff --git a/kpat/freecell.cpp b/kpat/freecell.cpp index ff8a5b1a..9e67633a 100644 --- a/kpat/freecell.cpp +++ b/kpat/freecell.cpp @@ -49,8 +49,8 @@ void FreecellPile::moveCards(CardList &c, Pile *to) //-------------------------------------------------------------------------// FreecellBase::FreecellBase( int decks, int stores, int freecells, int fill, bool unlimit, - KMainWindow* parent, const char* name) - : Dealer(parent,name), + KMainWindow* tqparent, const char* name) + : Dealer(tqparent,name), solver_instance(0), es_filling(fill), solver_ret(FCS_STATE_NOT_BEGAN_YET), unlimited_move(unlimit) { @@ -113,7 +113,7 @@ TQString suitToString(Card::Suit s) { case Card::Spades: return "S"; } - return TQString::null; + return TQString(); } TQString rankToString(Card::Rank r) @@ -280,8 +280,8 @@ void FreecellBase::resumeSolution() return; emit gameInfo(i18n("%1 tries - depth %2") - .arg(freecell_solver_user_get_num_times(solver_instance)) - .arg(freecell_solver_user_get_current_depth(solver_instance))); + .tqarg(freecell_solver_user_get_num_times(solver_instance)) + .tqarg(freecell_solver_user_get_current_depth(solver_instance))); if (solver_ret == FCS_STATE_WAS_SOLVED) { @@ -296,7 +296,7 @@ void FreecellBase::resumeSolution() int moves = freecell_solver_user_get_num_times(solver_instance); freeSolution(); emit gameInfo(i18n("unsolved after %1 moves") - .arg(moves)); + .tqarg(moves)); stopDemo(); return; } @@ -379,7 +379,7 @@ TQString FreecellBase::solverFormat() const tmp += suitToString(target[i]->top()->suit()) + "-" + rankToString(target[i]->top()->rank()) + " "; } if (!tmp.isEmpty()) - output += TQString::fromLatin1("Foundations: %1\n").arg(tmp); + output += TQString::tqfromLatin1("Foundations: %1\n").tqarg(tmp); tmp.truncate(0); for (uint i = 0; i < freecell.count(); i++) { @@ -389,7 +389,7 @@ TQString FreecellBase::solverFormat() const tmp += rankToString(freecell[i]->top()->rank()) + suitToString(freecell[i]->top()->suit()) + " "; } if (!tmp.isEmpty()) - output += TQString::fromLatin1("Freecells: %1\n").arg(tmp); + output += TQString::tqfromLatin1("Freecells: %1\n").tqarg(tmp); for (uint i = 0; i < store.count(); i++) { @@ -544,7 +544,7 @@ MoveHint *FreecellBase::chooseHint() { if (solver_instance && freecell_solver_user_get_moves_left(solver_instance)) { - emit gameInfo(i18n("%1 moves before finish").arg(freecell_solver_user_get_moves_left(solver_instance))); + emit gameInfo(i18n("%1 moves before finish").tqarg(freecell_solver_user_get_moves_left(solver_instance))); fcs_move_t move; if (!freecell_solver_user_get_next_move(solver_instance, &move)) { @@ -665,7 +665,7 @@ void FreecellBase::movePileToPile(CardList &c, Pile *to, PileList fss, PileList if ((count > (fcs.count() + 1)) && (count <= 2 * (fcs.count() + 1))) moveaway = count - (fcs.count() + 1); } - uint moving = QMIN(count, QMIN(c.count() - start, fcs.count() + 1)); + uint moving = TQMIN(count, TQMIN(c.count() - start, fcs.count() + 1)); assert(moving); for (uint i = 0; i < moving - 1; i++) { @@ -813,12 +813,12 @@ bool FreecellBase::checkRemove(int checkIndex, const Pile *p, const Card *c) con class Freecell : public FreecellBase { public: - Freecell( KMainWindow* parent=0, const char* name=0); + Freecell( KMainWindow* tqparent=0, const char* name=0); virtual void deal(); }; -Freecell::Freecell( KMainWindow* parent, const char* name) - : FreecellBase(1, 8, 4, FCS_ES_FILLED_BY_ANY_CARD, false, parent, name) +Freecell::Freecell( KMainWindow* tqparent, const char* name) + : FreecellBase(1, 8, 4, FCS_ES_FILLED_BY_ANY_CARD, false, tqparent, name) { for (int i = 0; i < 8; i++) store[i]->move(8 + ( cardMap::CARDX() * 11 / 10 + 1 ) * i, 8 + cardMap::CARDY() * 11 / 10); @@ -846,7 +846,7 @@ static class LocalDealerInfo3 : public DealerInfo { public: LocalDealerInfo3() : DealerInfo(I18N_NOOP("&Freecell"), 3) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Freecell(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Freecell(tqparent); } } ldi8; //-------------------------------------------------------------------------// diff --git a/kpat/freecell.h b/kpat/freecell.h index b2b94dad..5d354eda 100644 --- a/kpat/freecell.h +++ b/kpat/freecell.h @@ -27,17 +27,18 @@ class FreecellPile : public Pile { public: - FreecellPile(int _index, Dealer* parent = 0) : Pile(_index, parent) {} + FreecellPile(int _index, Dealer* tqparent = 0) : Pile(_index, tqparent) {} virtual void moveCards(CardList &c, Pile *to); }; class FreecellBase : public Dealer { Q_OBJECT + TQ_OBJECT public: FreecellBase( int decks, int stores, int freecells, int es_filling, bool unlimited_move, - KMainWindow* parent=0, const char* name=0); + KMainWindow* tqparent=0, const char* name=0); void moveCards(CardList &c, FreecellPile *from, Pile *to); TQString solverFormat() const; virtual ~FreecellBase(); diff --git a/kpat/gamestats.ui b/kpat/gamestats.ui index 2d1e5443..76654317 100644 --- a/kpat/gamestats.ui +++ b/kpat/gamestats.ui @@ -1,10 +1,10 @@ GameStats - + GameStats - + 0 0 @@ -22,15 +22,15 @@ unnamed - + - layout3 + tqlayout3 unnamed - + textLabel1 @@ -46,7 +46,7 @@ Game: - + GameType @@ -61,34 +61,34 @@ - + - layout5 + tqlayout5 unnamed - + - layout2 + tqlayout2 unnamed - + Won %1 - + AlignVCenter|AlignRight - + WonPerc @@ -96,7 +96,7 @@ (%1%) - + textLabel7 @@ -104,7 +104,7 @@ Longest winning streak: - + textLabel2 @@ -112,18 +112,18 @@ Games played: - + LooseStreak %1 - + AlignVCenter|AlignRight - + textLabel8 @@ -131,18 +131,18 @@ Longest losing streak: - + WinStreak %1 - + AlignVCenter|AlignRight - + textLabel3 @@ -150,14 +150,14 @@ Games won: - + Played %1 - + AlignVCenter|AlignRight @@ -173,7 +173,7 @@ Expanding - + 250 20 @@ -192,14 +192,14 @@ Expanding - + 20 71 - + Layout1 @@ -223,14 +223,14 @@ Expanding - + 20 20 - + buttonOk @@ -265,8 +265,8 @@ setGameType(int) - + setGameType(int) - - + + diff --git a/kpat/gamestatsimpl.cpp b/kpat/gamestatsimpl.cpp index 11b95fee..59e37b79 100644 --- a/kpat/gamestatsimpl.cpp +++ b/kpat/gamestatsimpl.cpp @@ -24,7 +24,7 @@ GameStatsImpl::GameStatsImpl(TQWidget* aParent, const char* aname) if (list.count() <= i) list.append("unknown"); list[index] = i18n((*it)->name); - list[index].replace('&',""); + list[index].tqreplace('&',""); } GameType->insertStringList(list); showGameType(0); @@ -42,16 +42,16 @@ void GameStatsImpl::setGameType(int id) languageChange(); KConfig *config = kapp->config(); KConfigGroupSaver kcs(config, scores_group); - unsigned int t = config->readUnsignedNumEntry(TQString("total%1").arg(id),0); - Played->setText(Played->text().arg(t)); - unsigned int w = config->readUnsignedNumEntry(TQString("won%1").arg(id),0); - Won->setText(Won->text().arg(w)); + unsigned int t = config->readUnsignedNumEntry(TQString("total%1").tqarg(id),0); + Played->setText(Played->text().tqarg(t)); + unsigned int w = config->readUnsignedNumEntry(TQString("won%1").tqarg(id),0); + Won->setText(Won->text().tqarg(w)); if (t) - WonPerc->setText(WonPerc->text().arg(w*100/t)); + WonPerc->setText(WonPerc->text().tqarg(w*100/t)); else - WonPerc->setText(WonPerc->text().arg(0)); + WonPerc->setText(WonPerc->text().tqarg(0)); WinStreak->setText( - WinStreak->text().arg(config->readUnsignedNumEntry(TQString("maxwinstreak%1").arg(id),0))); + WinStreak->text().tqarg(config->readUnsignedNumEntry(TQString("maxwinstreak%1").tqarg(id),0))); LooseStreak->setText( - LooseStreak->text().arg(config->readUnsignedNumEntry(TQString("maxloosestreak%1").arg(id),0))); + LooseStreak->text().tqarg(config->readUnsignedNumEntry(TQString("maxloosestreak%1").tqarg(id),0))); } diff --git a/kpat/golf.cpp b/kpat/golf.cpp index 053525da..b06caf68 100644 --- a/kpat/golf.cpp +++ b/kpat/golf.cpp @@ -4,8 +4,8 @@ #include #include "cardmaps.h" -HorRightPile::HorRightPile( int _index, Dealer* parent) - : Pile(_index, parent) +HorRightPile::HorRightPile( int _index, Dealer* tqparent) + : Pile(_index, tqparent) { } @@ -19,8 +19,8 @@ TQSize HorRightPile::cardOffset( bool _spread, bool, const Card *) const //-------------------------------------------------------------------------// -Golf::Golf( KMainWindow* parent, const char* _name) - : Dealer( parent, _name ) +Golf::Golf( KMainWindow* tqparent, const char* _name) + : Dealer( tqparent, _name ) { const int dist_x = cardMap::CARDX() * 11 / 10 + 1; const int pile_dist = 10 + 3 * cardMap::CARDY(); @@ -158,7 +158,7 @@ static class LocalDealerInfo13 : public DealerInfo { public: LocalDealerInfo13() : DealerInfo(I18N_NOOP("Go&lf"), 12) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Golf(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Golf(tqparent); } } ldi13; //-------------------------------------------------------------------------// diff --git a/kpat/golf.h b/kpat/golf.h index 7729e8f4..275cd8b5 100644 --- a/kpat/golf.h +++ b/kpat/golf.h @@ -6,18 +6,20 @@ class HorRightPile : public Pile { Q_OBJECT + TQ_OBJECT public: - HorRightPile( int _index, Dealer* parent = 0); + HorRightPile( int _index, Dealer* tqparent = 0); virtual TQSize cardOffset( bool _spread, bool _facedown, const Card *before) const; }; class Golf : public Dealer { Q_OBJECT + TQ_OBJECT public: - Golf( KMainWindow* parent=0, const char* name=0); + Golf( KMainWindow* tqparent=0, const char* name=0); void deal(); virtual void restart(); virtual bool isGameLost() const; diff --git a/kpat/grandf.cpp b/kpat/grandf.cpp index c15c6103..5ada2ea6 100644 --- a/kpat/grandf.cpp +++ b/kpat/grandf.cpp @@ -25,8 +25,8 @@ #include #include "cardmaps.h" -Grandf::Grandf( KMainWindow* parent, const char *name ) - : Dealer( parent, name ) +Grandf::Grandf( KMainWindow* tqparent, const char *name ) + : Dealer( tqparent, name ) { deck = Deck::new_deck(this); deck->hide(); @@ -221,7 +221,7 @@ static class LocalDealerInfo1 : public DealerInfo { public: LocalDealerInfo1() : DealerInfo(I18N_NOOP("&Grandfather"), 1) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Grandf(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Grandf(tqparent); } } gfdi; #include "grandf.moc" diff --git a/kpat/grandf.h b/kpat/grandf.h index 4c07abc1..24e64c5c 100644 --- a/kpat/grandf.h +++ b/kpat/grandf.h @@ -36,9 +36,10 @@ class KMainWindow; class Grandf : public Dealer { Q_OBJECT + TQ_OBJECT public: - Grandf( KMainWindow* parent=0, const char* name=0); + Grandf( KMainWindow* tqparent=0, const char* name=0); public slots: void redeal(); diff --git a/kpat/gypsy.cpp b/kpat/gypsy.cpp index 5432336a..9c37b6b6 100644 --- a/kpat/gypsy.cpp +++ b/kpat/gypsy.cpp @@ -3,8 +3,8 @@ #include "deck.h" #include "cardmaps.h" -Gypsy::Gypsy( KMainWindow* parent, const char *name ) - : Dealer( parent, name ) +Gypsy::Gypsy( KMainWindow* tqparent, const char *name ) + : Dealer( tqparent, name ) { const int dist_x = cardMap::CARDX() * 11 / 10 + 1; const int dist_y = cardMap::CARDY() * 11 / 10 + 1; @@ -111,7 +111,7 @@ static class LocalDealerInfo7 : public DealerInfo { public: LocalDealerInfo7() : DealerInfo(I18N_NOOP("Gy&psy"), 7) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Gypsy(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Gypsy(tqparent); } } gyfdi; #include "gypsy.moc" diff --git a/kpat/gypsy.h b/kpat/gypsy.h index ea28b04e..5ead4175 100644 --- a/kpat/gypsy.h +++ b/kpat/gypsy.h @@ -11,9 +11,10 @@ class KMainWindow; class Gypsy : public Dealer { Q_OBJECT + TQ_OBJECT public: - Gypsy( KMainWindow* parent=0, const char* name=0); + Gypsy( KMainWindow* tqparent=0, const char* name=0); virtual bool isGameLost() const; public slots: diff --git a/kpat/idiot.cpp b/kpat/idiot.cpp index 3ac49ef5..e86e8059 100644 --- a/kpat/idiot.cpp +++ b/kpat/idiot.cpp @@ -25,8 +25,8 @@ #include "cardmaps.h" -Idiot::Idiot( KMainWindow* parent, const char* _name) - : Dealer( parent, _name ) +Idiot::Idiot( KMainWindow* tqparent, const char* _name) + : Dealer( tqparent, _name ) { // Create the deck to the left. m_deck = Deck::new_deck( this ); @@ -227,7 +227,7 @@ static class LocalDealerInfo2 : public DealerInfo { public: LocalDealerInfo2() : DealerInfo(I18N_NOOP("&Aces Up"), 2) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Idiot(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Idiot(tqparent); } } ldi4; diff --git a/kpat/idiot.h b/kpat/idiot.h index 101957c0..147e2fec 100644 --- a/kpat/idiot.h +++ b/kpat/idiot.h @@ -29,10 +29,11 @@ class Idiot: public Dealer { Q_OBJECT + TQ_OBJECT public: - Idiot( KMainWindow* parent = 0, const char* name = 0 ); + Idiot( KMainWindow* tqparent = 0, const char* name = 0 ); virtual bool isGameWon() const; diff --git a/kpat/kings.cpp b/kpat/kings.cpp index 7654a88f..22faf307 100644 --- a/kpat/kings.cpp +++ b/kpat/kings.cpp @@ -6,8 +6,8 @@ #include "freecell-solver/fcs_enums.h" #include "cardmaps.h" -Kings::Kings( KMainWindow* parent, const char *name ) - : FreecellBase( 2, 8, 8, FCS_ES_FILLED_BY_KINGS_ONLY, true, parent, name ) +Kings::Kings( KMainWindow* tqparent, const char *name ) + : FreecellBase( 2, 8, 8, FCS_ES_FILLED_BY_KINGS_ONLY, true, tqparent, name ) { const int dist_x = cardMap::CARDX() * 11 / 10 + 1; @@ -125,7 +125,7 @@ static class LocalDealerInfo12 : public DealerInfo { public: LocalDealerInfo12() : DealerInfo(I18N_NOOP("&The Kings"), 12) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Kings(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Kings(tqparent); } } gfdi12; #endif diff --git a/kpat/kings.h b/kpat/kings.h index e3a60475..dc49e8c3 100644 --- a/kpat/kings.h +++ b/kpat/kings.h @@ -9,9 +9,10 @@ class KMainWindow; class Kings : public FreecellBase { Q_OBJECT + TQ_OBJECT public: - Kings( KMainWindow* parent=0, const char* name=0); + Kings( KMainWindow* tqparent=0, const char* name=0); virtual bool isGameLost() const; public slots: diff --git a/kpat/klondike.cpp b/kpat/klondike.cpp index dcf4c1f8..1e0d0b79 100644 --- a/kpat/klondike.cpp +++ b/kpat/klondike.cpp @@ -32,8 +32,8 @@ class KlondikePile : public Pile { public: - KlondikePile( int _index, Dealer* parent) - : Pile(_index, parent) {} + KlondikePile( int _index, Dealer* tqparent) + : Pile(_index, tqparent) {} void clearSpread() { cardlist.clear(); } @@ -42,7 +42,7 @@ public: } virtual TQSize cardOffset( bool _spread, bool, const Card *c) const { kdDebug(11111) << "cardOffset " << _spread << " " << (c? c->name() : "(null)") << endl; - if (cardlist.contains(const_cast(c))) + if (cardlist.tqcontains(const_cast(c))) return TQSize(+dspread(), 0); return TQSize(0, 0); } @@ -50,8 +50,8 @@ private: CardList cardlist; }; -Klondike::Klondike( bool easy, KMainWindow* parent, const char* _name ) - : Dealer( parent, _name ) +Klondike::Klondike( bool easy, KMainWindow* tqparent, const char* _name ) + : Dealer( tqparent, _name ) { // The units of the follwoing constants are pixels const int margin = 10; // between card piles and board edge @@ -481,14 +481,14 @@ static class LocalDealerInfo0 : public DealerInfo { public: LocalDealerInfo0() : DealerInfo(I18N_NOOP("&Klondike"), 0) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Klondike(true, parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Klondike(true, tqparent); } } ldi0; static class LocalDealerInfo14 : public DealerInfo { public: LocalDealerInfo14() : DealerInfo(I18N_NOOP("Klondike (&draw 3)"), 13) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Klondike(false, parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Klondike(false, tqparent); } } ldi14; diff --git a/kpat/klondike.h b/kpat/klondike.h index b1b7e673..ad4fcdcd 100644 --- a/kpat/klondike.h +++ b/kpat/klondike.h @@ -33,9 +33,10 @@ class KlondikePile; class Klondike : public Dealer { Q_OBJECT + TQ_OBJECT public: - Klondike( bool easy, KMainWindow* parent=0, const char* name=0); + Klondike( bool easy, KMainWindow* tqparent=0, const char* name=0); public: virtual void restart(); diff --git a/kpat/mod3.cpp b/kpat/mod3.cpp index 45a8d026..9f92643f 100644 --- a/kpat/mod3.cpp +++ b/kpat/mod3.cpp @@ -26,8 +26,8 @@ //-------------------------------------------------------------------------// -Mod3::Mod3( KMainWindow* parent, const char* _name) - : Dealer( parent, _name ) +Mod3::Mod3( KMainWindow* tqparent, const char* _name) + : Dealer( tqparent, _name ) { const int dist_x = cardMap::CARDX() * 11 / 10 + 1; const int dist_y = cardMap::CARDY() * 11 / 10 + 1; @@ -301,7 +301,7 @@ static class LocalDealerInfo5 : public DealerInfo { public: LocalDealerInfo5() : DealerInfo(I18N_NOOP("M&od3"), 5) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Mod3(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Mod3(tqparent); } } ldi5; //-------------------------------------------------------------------------// diff --git a/kpat/mod3.h b/kpat/mod3.h index 17ff6aa2..cb6047ce 100644 --- a/kpat/mod3.h +++ b/kpat/mod3.h @@ -28,9 +28,10 @@ class Mod3 : public Dealer { Q_OBJECT + TQ_OBJECT public: - Mod3( KMainWindow* parent=0, const char* name=0); + Mod3( KMainWindow* tqparent=0, const char* name=0); void deal(); diff --git a/kpat/napoleon.cpp b/kpat/napoleon.cpp index 7f7c7f95..1429fbdb 100644 --- a/kpat/napoleon.cpp +++ b/kpat/napoleon.cpp @@ -22,8 +22,8 @@ #include "deck.h" #include "cardmaps.h" -Napoleon::Napoleon( KMainWindow* parent, const char* _name ) - : Dealer( parent, _name ) +Napoleon::Napoleon( KMainWindow* tqparent, const char* _name ) + : Dealer( tqparent, _name ) { deck = Deck::new_deck( this ); connect(deck, TQT_SIGNAL(clicked(Card *)), TQT_SLOT(deal1(Card*))); @@ -198,7 +198,7 @@ static class LocalDealerInfo4 : public DealerInfo { public: LocalDealerInfo4() : DealerInfo(I18N_NOOP("&Napoleon's Tomb"), 4) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Napoleon(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Napoleon(tqparent); } } ldi3; #include "napoleon.moc" diff --git a/kpat/napoleon.h b/kpat/napoleon.h index a89f68b9..d097d6ac 100644 --- a/kpat/napoleon.h +++ b/kpat/napoleon.h @@ -26,8 +26,9 @@ class Napoleon : public Dealer { Q_OBJECT + TQ_OBJECT public: - Napoleon (KMainWindow* parent=0, const char* name=0); + Napoleon (KMainWindow* tqparent=0, const char* name=0); virtual void restart(); virtual void getHints(); diff --git a/kpat/pile.cpp b/kpat/pile.cpp index 50a15bab..8d34325e 100644 --- a/kpat/pile.cpp +++ b/kpat/pile.cpp @@ -32,13 +32,13 @@ Pile::Pile( int _index, Dealer* _dealer) // Make the patience aware of this pile. dealer()->addPile(this); - TQCanvasRectangle::setVisible(true); // default + TQCanvasRectangle::tqsetVisible(true); // default _checkIndex = -1; m_addFlags = 0; m_removeFlags = 0; - setBrush(Qt::black); - setPen(TQPen(Qt::black)); + setBrush(TQt::black); + setPen(TQPen(TQt::black)); setZ(0); initSizes(); @@ -193,12 +193,12 @@ bool Pile::legalRemove(const Card *c) const void Pile::setVisible(bool vis) { - TQCanvasRectangle::setVisible(vis); + TQCanvasRectangle::tqsetVisible(vis); dealer()->enlargeCanvas(this); for (CardList::Iterator it = m_cards.begin(); it != m_cards.end(); ++it) { - (*it)->setVisible(vis); + (*it)->tqsetVisible(vis); dealer()->enlargeCanvas(*it); } } @@ -218,7 +218,7 @@ void Pile::moveBy(double dx, double dy) int Pile::indexOf(const Card *c) const { assert(c->source() == this); - return m_cards.findIndex(const_cast(c)); // the list is of non-const cards + return m_cards.tqfindIndex(const_cast(c)); // the list is of non-const cards } Card *Pile::at(int index) const @@ -338,7 +338,7 @@ void Pile::add( Card* _card, bool _facedown, bool _spread ) void Pile::remove(Card *c) { - assert(m_cards.contains(c)); + assert(m_cards.tqcontains(c)); m_cards.remove(c); } diff --git a/kpat/pile.h b/kpat/pile.h index 7dd14f3c..3580eefe 100644 --- a/kpat/pile.h +++ b/kpat/pile.h @@ -15,9 +15,10 @@ class Dealer; * */ -class Pile : public TQObject, public QCanvasRectangle +class Pile : public TQObject, public TQCanvasRectangle { Q_OBJECT + TQ_OBJECT public: @@ -40,7 +41,7 @@ public: static const int autoTurnTop; static const int wholeColumn; - Pile( int _index, Dealer* parent = 0); + Pile( int _index, Dealer* tqparent = 0); virtual ~Pile(); Dealer *dealer() const { return m_dealer; } diff --git a/kpat/pwidget.cpp b/kpat/pwidget.cpp index eb12a1c8..e8353dee 100644 --- a/kpat/pwidget.cpp +++ b/kpat/pwidget.cpp @@ -59,28 +59,28 @@ pWidget::pWidget() { current_pwidget = this; // KCrash::setEmergencySaveFunction(::saveGame); - KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection(), "game_exit"); + KStdAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(quit()), actionCollection(), "game_exit"); - undo = KStdAction::undo(this, TQT_SLOT(undoMove()), + undo = KStdAction::undo(TQT_TQOBJECT(this), TQT_SLOT(undoMove()), actionCollection(), "undo_move"); undo->setEnabled(false); - (void)KStdAction::openNew(this, TQT_SLOT(newGame()), + (void)KStdAction::openNew(TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection(), "new_game"); - (void)KStdAction::open(this, TQT_SLOT(openGame()), + (void)KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(openGame()), actionCollection(), "open"); - recent = KStdAction::openRecent(this, TQT_SLOT(openGame(const KURL&)), + recent = KStdAction::openRecent(TQT_TQOBJECT(this), TQT_SLOT(openGame(const KURL&)), actionCollection(), "open_recent"); recent->loadEntries(KGlobal::config()); - (void)KStdAction::saveAs(this, TQT_SLOT(saveGame()), + (void)KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(saveGame()), actionCollection(), "save"); - (void)new KAction(i18n("&Choose Game..."), 0, this, TQT_SLOT(chooseGame()), + (void)new KAction(i18n("&Choose Game..."), 0, TQT_TQOBJECT(this), TQT_SLOT(chooseGame()), actionCollection(), "choose_game"); - (void)new KAction(i18n("Restart &Game"), TQString::fromLatin1("reload"), 0, - this, TQT_SLOT(restart()), + (void)new KAction(i18n("Restart &Game"), TQString::tqfromLatin1("reload"), 0, + TQT_TQOBJECT(this), TQT_SLOT(restart()), actionCollection(), "restart_game"); - (void)KStdAction::help(this, TQT_SLOT(helpGame()), actionCollection(), "help_game"); + (void)KStdAction::help(TQT_TQOBJECT(this), TQT_SLOT(helpGame()), actionCollection(), "help_game"); - games = new KSelectAction(i18n("&Game Type"), 0, this, + games = new KSelectAction(i18n("&Game Type"), 0, TQT_TQOBJECT(this), TQT_SLOT(newGameType()), actionCollection(), "game_type"); TQStringList list; @@ -104,17 +104,17 @@ pWidget::pWidget() KGlobal::dirs()->addResourceType("wallpaper", KStandardDirs::kde_default("data") + "kpat/backgrounds/"); KGlobal::dirs()->addResourceType("wallpaper", KStandardDirs::kde_default("data") + "ksnake/backgrounds/"); - wallpapers = new KSelectAction(i18n("&Change Background"), 0, this, + wallpapers = new KSelectAction(i18n("&Change Background"), 0, TQT_TQOBJECT(this), TQT_SLOT(changeWallpaper()), actionCollection(), "wallpaper"); list.clear(); wallpaperlist.clear(); - TQStringList wallpaperlist2 = KGlobal::dirs()->findAllResources("wallpaper", TQString::null, + TQStringList wallpaperlist2 = KGlobal::dirs()->findAllResources("wallpaper", TQString(), false, true, list); TQStringList list2; for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { TQString file = *it; - int rindex = file.findRev('.'); + int rindex = file.tqfindRev('.'); if (rindex != -1) { TQString ext = file.mid(rindex + 1).lower(); if (ext == "jpeg" || ext == "png" || ext == "jpg") { @@ -125,23 +125,23 @@ pWidget::pWidget() } wallpapers->setItems(list2); - wallpapers->setCurrentItem(list2.findIndex("No-Ones-Laughing-3")); + wallpapers->setCurrentItem(list2.tqfindIndex("No-Ones-Laughing-3")); changeWallpaper(); (void)new cardMap(midcolor); - backs = new KAction(i18n("&Switch Cards..."), 0, this, + backs = new KAction(i18n("&Switch Cards..."), 0, TQT_TQOBJECT(this), TQT_SLOT(changeBackside()), actionCollection(), "backside"); - stats = new KAction(i18n("&Statistics"), 0, this, TQT_SLOT(showStats()), + stats = new KAction(i18n("&Statistics"), 0, TQT_TQOBJECT(this), TQT_SLOT(showStats()), actionCollection(),"game_stats"); animation = new KToggleAction(i18n( "&Animation on Startup" ), - 0, this, TQT_SLOT(animationChanged()), + 0, TQT_TQOBJECT(this), TQT_SLOT(animationChanged()), actionCollection(), "animation"); dropaction = new KToggleAction(i18n("&Enable Autodrop"), - 0, this, TQT_SLOT(enableAutoDrop()), + 0, TQT_TQOBJECT(this), TQT_SLOT(enableAutoDrop()), actionCollection(), "enable_autodrop"); dropaction->setCheckedState(i18n("Disable Autodrop")); @@ -167,7 +167,7 @@ pWidget::pWidget() statusBar()->insertItem( "", 1, 0, true ); - createGUI(TQString::null, false); + createGUI(TQString(), false); KAcceleratorManager::manage(menuBar()); newGameType(); @@ -239,7 +239,7 @@ void pWidget::changeWallpaper() return; background = TQPixmap(bgpath); if (background.isNull()) { - KMessageBox::sorry(this, i18n("Couldn't load wallpaper
    %1
    ").arg(bgpath)); + KMessageBox::sorry(this, i18n("Couldn't load wallpaper
    %1
    ").tqarg(bgpath)); return; } @@ -251,10 +251,10 @@ void pWidget::changeWallpaper() long b = 0; for (int i = 0; i < bg.numColors(); ++i) { - QRgb rgb = bg.color(i); - r += qRed(rgb); - g += qGreen(rgb); - b += qBlue(rgb); + TQRgb rgb = bg.color(i); + r += tqRed(rgb); + g += tqGreen(rgb); + b += tqBlue(rgb); } r /= bg.numColors(); b /= bg.numColors(); @@ -344,8 +344,8 @@ void pWidget::newGameType() if ((*it)->gameindex == id) { dill = (*it)->createGame(this); TQString name = (*it)->name; - name = name.replace(TQRegExp("[&']"), ""); - name = name.replace(TQRegExp("[ ]"), "_").lower(); + name = name.tqreplace(TQRegExp("[&']"), ""); + name = name.tqreplace(TQRegExp("[ ]"), "_").lower(); dill->setAnchorName("game_" + name); connect(dill, TQT_SIGNAL(saveGame()), TQT_SLOT(saveGame())); connect(dill, TQT_SIGNAL(gameInfo(const TQString&)), @@ -455,7 +455,7 @@ void pWidget::gameWon(bool withhelp) #if TEST_SOLVER == 0 KMessageBox::information(this, congrats, i18n("Congratulations!")); #endif - TQTimer::singleShot(0, this, TQT_SLOT(newGame())); + TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(newGame())); #if TEST_SOLVER == 1 dill->demo(); #endif @@ -468,11 +468,11 @@ void pWidget::gameLost() // The following code is taken out of kmessagebox.cpp in kdeui. // Is there a better way? KConfig *config = 0; - TQString grpNotifMsgs = TQString::fromLatin1("Notification Messages"); + TQString grpNotifMsgs = TQString::tqfromLatin1("Notification Messages"); config = KGlobal::config(); KConfigGroupSaver saver(config, - TQString::fromLatin1("Notification Messages")); + TQString::tqfromLatin1("Notification Messages")); TQString dontAsk = config->readEntry(dontAskAgainName).lower(); // If we are ordered never to ask again and to continue the game, @@ -482,7 +482,7 @@ void pWidget::gameLost() // If it says yes, we ask anyway. Just starting a new game would // be incredibly annoying. if (dontAsk == "yes") - dontAskAgainName = TQString::null; + dontAskAgainName = TQString(); if (KMessageBox::questionYesNo(this, i18n("You could not win this game, " "but there is always a second try.\nStart a new game?"), @@ -491,7 +491,7 @@ void pWidget::gameLost() KStdGuiItem::cont(), dontAskAgainName) == KMessageBox::Yes) { - TQTimer::singleShot(0, this, TQT_SLOT(newGame())); + TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(newGame())); } } @@ -511,7 +511,7 @@ void pWidget::openGame(const KURL &url) } uint id = doc.documentElement().attribute("id").toUInt(); - if (id != (Q_UINT32)games->currentItem()) { + if (id != (TQ_UINT32)games->currentItem()) { games->setCurrentItem(id); newGameType(); if (!dill) { diff --git a/kpat/pwidget.h b/kpat/pwidget.h index ab2b4972..1ff0367c 100644 --- a/kpat/pwidget.h +++ b/kpat/pwidget.h @@ -35,6 +35,7 @@ class TQLabel; class pWidget: public KMainWindow { Q_OBJECT + TQ_OBJECT public: pWidget(); diff --git a/kpat/simon.cpp b/kpat/simon.cpp index 287ecd00..fd3c3604 100644 --- a/kpat/simon.cpp +++ b/kpat/simon.cpp @@ -5,8 +5,8 @@ #include #include "cardmaps.h" -Simon::Simon( KMainWindow* parent, const char *name ) - : Dealer( parent, name ) +Simon::Simon( KMainWindow* tqparent, const char *name ) + : Dealer( tqparent, name ) { deck = Deck::new_deck(this); deck->move(10, 10); @@ -150,7 +150,7 @@ static class LocalDealerInfo9 : public DealerInfo { public: LocalDealerInfo9() : DealerInfo(I18N_NOOP("&Simple Simon"), 9) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Simon(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Simon(tqparent); } } gfi9; #include "simon.moc" diff --git a/kpat/simon.h b/kpat/simon.h index 91a50a1b..b20bfde8 100644 --- a/kpat/simon.h +++ b/kpat/simon.h @@ -5,9 +5,10 @@ class Simon : public Dealer { Q_OBJECT + TQ_OBJECT public: - Simon( KMainWindow* parent=0, const char* name=0); + Simon( KMainWindow* tqparent=0, const char* name=0); public slots: void deal(); diff --git a/kpat/spider.cpp b/kpat/spider.cpp index c8e6abc5..5c367c04 100644 --- a/kpat/spider.cpp +++ b/kpat/spider.cpp @@ -48,8 +48,8 @@ void SpiderPile::moveCards(CardList &c, Pile *to) //-------------------------------------------------------------------------// -Spider::Spider(int suits, KMainWindow* parent, const char* _name) - : Dealer(parent, _name) +Spider::Spider(int suits, KMainWindow* tqparent, const char* _name) + : Dealer(tqparent, _name) { const int dist_x = cardMap::CARDX() * 11 / 10 + 1; const int dist_y = cardMap::CARDY() * 11 / 10 + 1; @@ -459,21 +459,21 @@ static class LocalDealerInfo15 : public DealerInfo { public: LocalDealerInfo15() : DealerInfo(I18N_NOOP("S&pider (Easy)"), 14) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Spider(1, parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Spider(1, tqparent); } } ldi15; static class LocalDealerInfo16 : public DealerInfo { public: LocalDealerInfo16() : DealerInfo(I18N_NOOP("Spider (&Medium)"), 15) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Spider(2, parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Spider(2, tqparent); } } ldi16; static class LocalDealerInfo17 : public DealerInfo { public: LocalDealerInfo17() : DealerInfo(I18N_NOOP("Spider (&Hard)"), 16) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Spider(4, parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Spider(4, tqparent); } } ldi17; //-------------------------------------------------------------------------// diff --git a/kpat/spider.h b/kpat/spider.h index 055502ff..81bf84b2 100644 --- a/kpat/spider.h +++ b/kpat/spider.h @@ -26,7 +26,7 @@ class SpiderPile : public Pile { public: - SpiderPile(int _index, Dealer* parent = 0) : Pile(_index, parent) {} + SpiderPile(int _index, Dealer* tqparent = 0) : Pile(_index, tqparent) {} virtual void moveCards(CardList &c, Pile *to); CardList getRun(); }; @@ -34,9 +34,10 @@ public: class Spider : public Dealer { Q_OBJECT + TQ_OBJECT public: - Spider(int suits, KMainWindow *parent=0, const char *name=0); + Spider(int suits, KMainWindow *tqparent=0, const char *name=0); void deal(); void dealRow(); void checkPileDeck(Pile *to); diff --git a/kpat/yukon.cpp b/kpat/yukon.cpp index 859b3746..1d3a6157 100644 --- a/kpat/yukon.cpp +++ b/kpat/yukon.cpp @@ -5,8 +5,8 @@ #include #include "cardmaps.h" -Yukon::Yukon( KMainWindow* parent, const char *name ) - : Dealer( parent, name ) +Yukon::Yukon( KMainWindow* tqparent, const char *name ) + : Dealer( tqparent, name ) { const int dist_x = cardMap::CARDX() * 11 / 10 + 1; const int dist_y = cardMap::CARDY() * 11 / 10 + 1; @@ -124,7 +124,7 @@ static class LocalDealerInfo10 : public DealerInfo { public: LocalDealerInfo10() : DealerInfo(I18N_NOOP("&Yukon"), 10) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Yukon(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Yukon(tqparent); } } gfi10; #include "yukon.moc" diff --git a/kpat/yukon.h b/kpat/yukon.h index 9b407ac3..c9b4e5c9 100644 --- a/kpat/yukon.h +++ b/kpat/yukon.h @@ -5,9 +5,10 @@ class Yukon : public Dealer { Q_OBJECT + TQ_OBJECT public: - Yukon( KMainWindow* parent=0, const char* name=0); + Yukon( KMainWindow* tqparent=0, const char* name=0); virtual bool isGameLost() const; public slots: diff --git a/kpoker/betbox.cpp b/kpoker/betbox.cpp index 91fcab8b..304c4543 100644 --- a/kpoker/betbox.cpp +++ b/kpoker/betbox.cpp @@ -24,8 +24,8 @@ #include "betbox.h" -BetBox::BetBox(TQWidget* parent, const char* name) - : TQGroupBox(parent, name) +BetBox::BetBox(TQWidget* tqparent, const char* name) + : TQGroupBox(tqparent, name) { TQVBoxLayout* topLayout = new TQVBoxLayout(this, 1, 1); TQGridLayout* g = new TQGridLayout(topLayout, 2, 2, 1); @@ -46,10 +46,10 @@ BetBox::BetBox(TQWidget* parent, const char* name) foldButton = new TQPushButton(this); l->addWidget(foldButton, 0); - bet5Up->setText(TQString("+%1").arg(KGlobal::locale()->formatMoney(5))); - bet10Up->setText(TQString("+%1").arg(KGlobal::locale()->formatMoney(10))); - bet5Down->setText(TQString("-%1").arg(KGlobal::locale()->formatMoney(5))); - bet10Down->setText(TQString("-%1").arg(KGlobal::locale()->formatMoney(10))); + bet5Up->setText(TQString("+%1").tqarg(KGlobal::locale()->formatMoney(5))); + bet10Up->setText(TQString("+%1").tqarg(KGlobal::locale()->formatMoney(10))); + bet5Down->setText(TQString("-%1").tqarg(KGlobal::locale()->formatMoney(5))); + bet10Down->setText(TQString("-%1").tqarg(KGlobal::locale()->formatMoney(10))); adjustBet->setText(i18n("Adjust Bet")); foldButton->setText(i18n("Fold")); diff --git a/kpoker/betbox.h b/kpoker/betbox.h index 69fd741d..e3c52ce9 100644 --- a/kpoker/betbox.h +++ b/kpoker/betbox.h @@ -30,12 +30,13 @@ class TQPushButton; * the adjustBet and out buttons depend on the computers bet * @short This is a box with several buttons used to bet / raise **/ -class BetBox : public QGroupBox +class BetBox : public TQGroupBox { Q_OBJECT + TQ_OBJECT public: - BetBox(TQWidget* parent = 0, const char* name = 0); + BetBox(TQWidget* tqparent = 0, const char* name = 0); ~BetBox(); diff --git a/kpoker/defines.h b/kpoker/defines.h index 3da071f6..d4b827de 100644 --- a/kpoker/defines.h +++ b/kpoker/defines.h @@ -21,7 +21,7 @@ // ---------------------------------------------------------------- -// Graphical layout +// Graphical tqlayout #define cardHeight 96 diff --git a/kpoker/kpaint.cpp b/kpoker/kpaint.cpp index 5ba74f40..15ce5935 100644 --- a/kpoker/kpaint.cpp +++ b/kpoker/kpaint.cpp @@ -38,14 +38,14 @@ TQPixmap *CardImages::m_cardPixmaps; TQPixmap *CardImages::m_deck; -CardImages::CardImages(TQWidget* parent, const char* name) - : TQWidget(parent, name) +CardImages::CardImages(TQWidget* tqparent, const char* name) + : TQWidget(tqparent, name) { - m_cardPixmaps = new QPixmap[numCards]; + m_cardPixmaps = new TQPixmap[numCards]; m_deck = new TQPixmap; // Hide the window. - // FIXME: Why is this a QWidget? + // FIXME: Why is this a TQWidget? hide(); // loadCards(); } @@ -109,8 +109,8 @@ CardImages::loadDeck(TQString path) extern CardImages *cardImages; -CardWidget::CardWidget( TQWidget *parent, const char *name ) - : TQPushButton( parent, name ) +CardWidget::CardWidget( TQWidget *tqparent, const char *name ) + : TQPushButton( tqparent, name ) { m_held = false; @@ -168,13 +168,13 @@ void CardWidget::paintCard(int cardType) } -void CardWidget::repaintDeck() +void CardWidget::tqrepaintDeck() { setPixmap(*m_pm); setFixedSize(cardImages->getWidth(), cardImages->getHeight()); - ((TQWidget*) parent())->layout()->invalidate(); - ((TQWidget*) parent())->setFixedSize( ((TQWidget*) parent())->sizeHint()); + ((TQWidget*) tqparent())->tqlayout()->tqinvalidate(); + ((TQWidget*) tqparent())->setFixedSize( ((TQWidget*) tqparent())->tqsizeHint()); } diff --git a/kpoker/kpaint.h b/kpoker/kpaint.h index 2300e8b1..8c480fd5 100644 --- a/kpoker/kpaint.h +++ b/kpoker/kpaint.h @@ -33,12 +33,13 @@ class TQLabel; * @short A help class for loading the pictures **/ -class CardImages : public QWidget +class CardImages : public TQWidget { Q_OBJECT + TQ_OBJECT public: - CardImages( TQWidget *parent = 0, const char *name = 0 ); + CardImages( TQWidget *tqparent = 0, const char *name = 0 ); ~CardImages(); // FIXME: Use CardValue instead of int when the cards are in their @@ -63,12 +64,13 @@ class CardImages : public QWidget * * @short The cards **/ -class CardWidget : public QPushButton +class CardWidget : public TQPushButton { Q_OBJECT + TQ_OBJECT public: - CardWidget( TQWidget *parent=0, const char *name=0 ); + CardWidget( TQWidget *tqparent=0, const char *name=0 ); /** * Paints the deck if cardType = 0 or the card specified in cardType @@ -93,7 +95,7 @@ class CardWidget : public QPushButton bool toggleHeld(); /* returns the new value of held*/ - void repaintDeck(); + void tqrepaintDeck(); signals: /** diff --git a/kpoker/kpoker.cpp b/kpoker/kpoker.cpp index 0a293118..0c826c14 100644 --- a/kpoker/kpoker.cpp +++ b/kpoker/kpoker.cpp @@ -88,7 +88,7 @@ PokerGame::dealCards(PokerPlayer *player, bool skip[]) void PokerGame::activatePlayer(PokerPlayer *player) { - if (!m_activePlayers.contains(player)) { + if (!m_activePlayers.tqcontains(player)) { m_activePlayers.append(player); m_removedPlayers.remove(player); } @@ -98,7 +98,7 @@ PokerGame::activatePlayer(PokerPlayer *player) void PokerGame::inactivatePlayer(PokerPlayer *player) { - if (m_activePlayers.contains(player)) { + if (m_activePlayers.tqcontains(player)) { m_activePlayers.remove(player); m_removedPlayers.append(player); } @@ -159,8 +159,8 @@ CardImages *cardImages; // Class kpok -kpok::kpok(TQWidget *parent, const char *name) - : TQWidget(parent, name), +kpok::kpok(TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name), m_game(&m_random) { TQString version; @@ -178,7 +178,7 @@ kpok::kpok(TQWidget *parent, const char *name) // ...and the rest to computer players. for (int unsigned i = 1; i < m_numPlayers; i++) - m_players[i].setName(TQString("Computer %1").arg(i-1)); + m_players[i].setName(TQString("Computer %1").tqarg(i-1)); lastHandText = ""; @@ -269,13 +269,13 @@ void kpok::initWindow() mWonWidget = new TQWidget(this); inputLayout->addWidget(mWonWidget, 2); mWonWidget->setMinimumHeight(50); //FIXME hardcoded value for the wave - mWonWidget->setMinimumWidth(tmp.width(i18n("You won %1").arg(KGlobal::locale()->formatMoney(100))) + 20); // workaround for width problem in wave + mWonWidget->setMinimumWidth(tmp.width(i18n("You won %1").tqarg(KGlobal::locale()->formatMoney(100))) + 20); // workaround for width problem in wave TQHBoxLayout* wonLayout = new TQHBoxLayout(mWonWidget); wonLayout->setAutoAdd(true); wonLabel = new TQLabel(mWonWidget); wonLabel->setFont(wonFont); - wonLabel->setAlignment(AlignCenter); + wonLabel->tqsetAlignment(AlignCenter); wonLabel->hide(); inputLayout->addStretch(1); @@ -554,7 +554,7 @@ void kpok::bet() // Check if player 1 is out -> for players > 2 - // TODO: maybe if (!m_activePlayers.contains(humanPlayer)) + // TODO: maybe if (!m_activePlayers.tqcontains(humanPlayer)) // {exchangeCards(); bet(); displayerWinner_computer();return;} @@ -674,7 +674,7 @@ void kpok::initPoker(unsigned int numPlayers) m_game.clearPot(); drawAllDecks(); for (unsigned int i = 0; i < m_numPlayers; i++) { - playerBox[i]->repaintCard(); + playerBox[i]->tqrepaintCard(); } paintCash(); playerBox[0]->setHeldEnabled(false); @@ -686,7 +686,7 @@ void kpok::paintCash() for (unsigned int i = 0; i < m_numPlayers; i++) { playerBox[i]->showCash(); } - potLabel->setText(i18n("Pot: %1").arg(KGlobal::locale()->formatMoney(m_game.getPot()))); + potLabel->setText(i18n("Pot: %1").tqarg(KGlobal::locale()->formatMoney(m_game.getPot()))); } @@ -805,9 +805,9 @@ void kpok::displayWinner_Computer(PokerPlayer* winner, bool othersPassed) // Generate a string with winner info and show it. TQString label; if (winner->getHuman()) - label = i18n("You won %1").arg(KGlobal::locale()->formatMoney(m_game.getPot())); + label = i18n("You won %1").tqarg(KGlobal::locale()->formatMoney(m_game.getPot())); else - label = i18n("%1 won %2").arg(winner->getName()).arg(KGlobal::locale()->formatMoney(m_game.getPot())); + label = i18n("%1 won %2").tqarg(winner->getName()).tqarg(KGlobal::locale()->formatMoney(m_game.getPot())); wonLabel->setText(label); // Start the waving motion of the text. @@ -1028,7 +1028,7 @@ void kpok::stopWave() { waveTimer->stop(); fCount = -1; /* clear image */ - repaint ( FALSE ); + tqrepaint ( FALSE ); waveActive = false; } @@ -1042,7 +1042,7 @@ void kpok::stopDrawing() void kpok::waveTimerEvent() { fCount = (fCount + 1) & 15; - repaint( FALSE ); + tqrepaint( FALSE ); } @@ -1072,7 +1072,7 @@ void kpok::displayWin(const TQString& hand, int cashWon) if (cashWon) { playSound("win.wav"); - buf = i18n("You won %1!").arg(KGlobal::locale()->formatMoney(cashWon)); + buf = i18n("You won %1!").tqarg(KGlobal::locale()->formatMoney(cashWon)); } else { playSound("lose.wav"); buf = i18n("Game Over"); // locale @@ -1093,7 +1093,7 @@ void kpok::displayWin(const TQString& hand, int cashWon) void kpok::paintEvent( TQPaintEvent *) { /* NOTE: This was shamelessy stolen from the "hello world" example - * coming with Qt Thanks to the Qt-Guys for doing such a cool + * coming with TQt Thanks to the TQt-Guys for doing such a cool * example 8-) */ @@ -1307,9 +1307,9 @@ void kpok::saveGame(KConfig* conf) conf->writeEntry("lastHandText", lastHandText); for (int i = 0; i < players; i++) { - conf->writeEntry(TQString("Name_%1").arg(i), m_players[i].getName()); - conf->writeEntry(TQString("Human_%1").arg(i), m_players[i].getHuman()); - conf->writeEntry(TQString("Cash_%1").arg(i), m_players[i].getCash()); + conf->writeEntry(TQString("Name_%1").tqarg(i), m_players[i].getName()); + conf->writeEntry(TQString("Human_%1").tqarg(i), m_players[i].getHuman()); + conf->writeEntry(TQString("Cash_%1").tqarg(i), m_players[i].getCash()); } m_game.clearDirty(); @@ -1407,14 +1407,14 @@ bool kpok::loadGame(KConfig* conf) if (nu