summaryrefslogtreecommitdiffstats
path: root/kbattleship/kbattleship/kbattleship.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kbattleship/kbattleship/kbattleship.cpp')
-rw-r--r--kbattleship/kbattleship/kbattleship.cpp218
1 files changed, 109 insertions, 109 deletions
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;
}
}