@ -92,16 +92,16 @@ void KBattleshipWindow::initStatusBar()
void KBattleshipWindow : : initActions ( )
void KBattleshipWindow : : initActions ( )
{
{
KStdAction : : configureNotifications ( this , TQ T _SLOT( slotConfigureNotifications ( ) ) , actionCollection ( ) ) ;
KStdAction : : configureNotifications ( this , TQ _SLOT( slotConfigureNotifications ( ) ) , actionCollection ( ) ) ;
m_gameServerConnect = new TDEAction ( i18n ( " &Connect to Server... " ) , " connect_no " , Key_F2 , this , TQ T _SLOT( slotServerConnect ( ) ) , actionCollection ( ) , " game_serverconnect " ) ;
m_gameServerConnect = new TDEAction ( i18n ( " &Connect to Server... " ) , " connect_no " , Key_F2 , this , TQ _SLOT( slotServerConnect ( ) ) , actionCollection ( ) , " game_serverconnect " ) ;
m_gameNewServer = new TDEAction ( i18n ( " &Start Server... " ) , " network " , Key_F3 , this , TQ T _SLOT( slotNewServer ( ) ) , actionCollection ( ) , " game_newserver " ) ;
m_gameNewServer = new TDEAction ( i18n ( " &Start Server... " ) , " network " , Key_F3 , this , TQ _SLOT( slotNewServer ( ) ) , actionCollection ( ) , " game_newserver " ) ;
m_gameSingle = new TDEAction ( i18n ( " S&ingle Player... " ) , " gear " , Key_F4 , this , TQ T _SLOT( slotSinglePlayer ( ) ) , actionCollection ( ) , " game_singleplayer " ) ;
m_gameSingle = new TDEAction ( i18n ( " S&ingle Player... " ) , " gear " , Key_F4 , this , TQ _SLOT( slotSinglePlayer ( ) ) , actionCollection ( ) , " game_singleplayer " ) ;
m_gameQuit = KStdGameAction : : quit ( this , TQ T _SLOT( close ( ) ) , actionCollection ( ) ) ;
m_gameQuit = KStdGameAction : : quit ( this , TQ _SLOT( close ( ) ) , actionCollection ( ) ) ;
KStdGameAction : : highscores ( this , TQ T _SLOT( slotHighscore ( ) ) , actionCollection ( ) ) ;
KStdGameAction : : highscores ( this , TQ _SLOT( slotHighscore ( ) ) , actionCollection ( ) ) ;
m_gameEnemyInfo = new TDEAction ( i18n ( " &Enemy Info " ) , " view_text " , Key_F11 , this , TQ T _SLOT( slotEnemyClientInfo ( ) ) , actionCollection ( ) , " game_enemyinfo " ) ;
m_gameEnemyInfo = new TDEAction ( i18n ( " &Enemy Info " ) , " view_text " , Key_F11 , this , TQ _SLOT( slotEnemyClientInfo ( ) ) , actionCollection ( ) , " game_enemyinfo " ) ;
m_configSound = new TDEToggleAction ( i18n ( " &Play Sounds " ) , 0 , actionCollection ( ) , " options_configure_sound " ) ;
m_configSound = new TDEToggleAction ( i18n ( " &Play Sounds " ) , 0 , actionCollection ( ) , " options_configure_sound " ) ;
m_configGrid = new TDEToggleAction ( i18n ( " &Show Grid " ) , 0 , this , TQ T _SLOT( slotShowGrid ( ) ) , actionCollection ( ) , " options_show_grid " ) ;
m_configGrid = new TDEToggleAction ( i18n ( " &Show Grid " ) , 0 , this , TQ _SLOT( slotShowGrid ( ) ) , actionCollection ( ) , " options_show_grid " ) ;
m_configGrid - > setCheckedState ( i18n ( " Hide Grid " ) ) ;
m_configGrid - > setCheckedState ( i18n ( " Hide Grid " ) ) ;
m_gameEnemyInfo - > setEnabled ( false ) ;
m_gameEnemyInfo - > setEnabled ( false ) ;
@ -111,9 +111,9 @@ void KBattleshipWindow::initActions()
void KBattleshipWindow : : initChat ( )
void KBattleshipWindow : : initChat ( )
{
{
connect ( m_chat , TQ T _SIGNAL( sigSendMessage ( const TQString & ) ) , this , TQ T _SLOT( slotSendChatMessage ( const TQString & ) ) ) ;
connect ( m_chat , TQ _SIGNAL( sigSendMessage ( const TQString & ) ) , this , TQ _SLOT( slotSendChatMessage ( const TQString & ) ) ) ;
connect ( m_chat , TQ T _SIGNAL( sigChangeEnemyNickname ( const TQString & ) ) , this , TQ T _SLOT( slotChangeEnemyPlayer ( const TQString & ) ) ) ;
connect ( m_chat , TQ _SIGNAL( sigChangeEnemyNickname ( const TQString & ) ) , this , TQ _SLOT( slotChangeEnemyPlayer ( const TQString & ) ) ) ;
connect ( m_chat , TQ T _SIGNAL( sigChangeOwnNickname ( const TQString & ) ) , this , TQ T _SLOT( slotChangedNickCommand ( const TQString & ) ) ) ;
connect ( m_chat , TQ _SIGNAL( sigChangeOwnNickname ( const TQString & ) ) , this , TQ _SLOT( slotChangedNickCommand ( const TQString & ) ) ) ;
}
}
void KBattleshipWindow : : changeShipPlacementDirection ( ) {
void KBattleshipWindow : : changeShipPlacementDirection ( ) {
@ -122,8 +122,8 @@ void KBattleshipWindow::changeShipPlacementDirection(){
void KBattleshipWindow : : initShipPlacing ( )
void KBattleshipWindow : : initShipPlacing ( )
{
{
connect ( m_ownshiplist , TQ T _SIGNAL( sigOwnFieldDataChanged ( int , int , int ) ) , this , TQ T _SLOT( slotChangeOwnFieldData ( int , int , int ) ) ) ;
connect ( m_ownshiplist , TQ _SIGNAL( sigOwnFieldDataChanged ( int , int , int ) ) , this , TQ _SLOT( slotChangeOwnFieldData ( int , int , int ) ) ) ;
connect ( m_ownshiplist , TQ T _SIGNAL( sigLastShipAdded ( ) ) , this , TQ T _SLOT( slotShipsReady ( ) ) ) ;
connect ( m_ownshiplist , TQ _SIGNAL( sigLastShipAdded ( ) ) , this , TQ _SLOT( slotShipsReady ( ) ) ) ;
}
}
void KBattleshipWindow : : initView ( )
void KBattleshipWindow : : initView ( )
@ -148,10 +148,10 @@ void KBattleshipWindow::initView()
m_view - > startDrawing ( ) ;
m_view - > startDrawing ( ) ;
setFocusProxy ( m_view ) ;
setFocusProxy ( m_view ) ;
connect ( m_view , TQ T _SIGNAL( sigEnemyFieldClicked ( int , int ) ) , this , TQ T _SLOT( slotEnemyFieldClick ( int , int ) ) ) ;
connect ( m_view , TQ _SIGNAL( sigEnemyFieldClicked ( int , int ) ) , this , TQ _SLOT( slotEnemyFieldClick ( int , int ) ) ) ;
connect ( m_view , TQ T _SIGNAL( sigOwnFieldClicked ( int , int ) ) , this , TQ T _SLOT( slotPlaceShip ( int , int ) ) ) ;
connect ( m_view , TQ _SIGNAL( sigOwnFieldClicked ( int , int ) ) , this , TQ _SLOT( slotPlaceShip ( int , int ) ) ) ;
connect ( m_view , TQ T _SIGNAL( sigMouseOverField ( int , int ) ) , this , TQ T _SLOT( slotPlaceShipPreview ( int , int ) ) ) ;
connect ( m_view , TQ _SIGNAL( sigMouseOverField ( int , int ) ) , this , TQ _SLOT( slotPlaceShipPreview ( int , int ) ) ) ;
connect ( m_view , TQ T _SIGNAL( changeShipPlacementDirection ( ) ) , this , TQ T _SLOT( changeShipPlacementDirection ( ) ) ) ;
connect ( m_view , TQ _SIGNAL( changeShipPlacementDirection ( ) ) , this , TQ _SLOT( changeShipPlacementDirection ( ) ) ) ;
}
}
void KBattleshipWindow : : slotDeleteAI ( )
void KBattleshipWindow : : slotDeleteAI ( )
@ -317,11 +317,11 @@ void KBattleshipWindow::slotEnemyFieldClick(int fieldx, int fieldy)
switch ( KMessageBox : : questionYesNo ( this , i18n ( " Do you want to restart the game? " ) , TQString ( ) , 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 :
case KMessageBox : : Yes :
TQTimer : : singleShot ( 0 , this , TQ T _SLOT( slotRestartAI ( ) ) ) ;
TQTimer : : singleShot ( 0 , this , TQ _SLOT( slotRestartAI ( ) ) ) ;
break ;
break ;
case KMessageBox : : No :
case KMessageBox : : No :
TQTimer : : singleShot ( 0 , this , TQ T _SLOT( slotDeleteAI ( ) ) ) ;
TQTimer : : singleShot ( 0 , this , TQ _SLOT( slotDeleteAI ( ) ) ) ;
break ;
break ;
}
}
return ;
return ;
@ -697,8 +697,8 @@ void KBattleshipWindow::slotServerConnect()
slotStatusMsg ( i18n ( " Loading Connect-Server dialog... " ) ) ;
slotStatusMsg ( i18n ( " Loading Connect-Server dialog... " ) ) ;
m_client = new KClientDialog ( this ) ;
m_client = new KClientDialog ( this ) ;
connect ( m_client , TQ T _SIGNAL( sigConnectServer ( ) ) , this , TQ T _SLOT( slotConnectToBattleshipServer ( ) ) ) ;
connect ( m_client , TQ _SIGNAL( sigConnectServer ( ) ) , this , TQ _SLOT( slotConnectToBattleshipServer ( ) ) ) ;
connect ( m_client , TQ T _SIGNAL( sigCancelConnect ( ) ) , this , TQ T _SLOT( slotDeleteConnectDialog ( ) ) ) ;
connect ( m_client , TQ _SIGNAL( sigCancelConnect ( ) ) , this , TQ _SLOT( slotDeleteConnectDialog ( ) ) ) ;
m_client - > show ( ) ;
m_client - > show ( ) ;
slotStatusMsg ( i18n ( " Ready " ) ) ;
slotStatusMsg ( i18n ( " Ready " ) ) ;
@ -806,8 +806,8 @@ void KBattleshipWindow::slotNewServer()
slotStatusMsg ( i18n ( " Loading Start-Server dialog... " ) ) ;
slotStatusMsg ( i18n ( " Loading Start-Server dialog... " ) ) ;
m_server = new TDEServerDialog ( this ) ;
m_server = new TDEServerDialog ( this ) ;
connect ( m_server , TQ T _SIGNAL( okClicked ( ) ) , this , TQ T _SLOT( slotStartBattleshipServer ( ) ) ) ;
connect ( m_server , TQ _SIGNAL( okClicked ( ) ) , this , TQ _SLOT( slotStartBattleshipServer ( ) ) ) ;
connect ( m_server , TQ T _SIGNAL( cancelClicked ( ) ) , this , TQ T _SLOT( slotDeleteServerDialog ( ) ) ) ;
connect ( m_server , TQ _SIGNAL( cancelClicked ( ) ) , this , TQ _SLOT( slotDeleteServerDialog ( ) ) ) ;
m_server - > show ( ) ;
m_server - > show ( ) ;
slotStatusMsg ( i18n ( " Ready " ) ) ;
slotStatusMsg ( i18n ( " Ready " ) ) ;
@ -828,7 +828,7 @@ void KBattleshipWindow::slotSendVersion()
msg - > versionMessage ( ) ;
msg - > versionMessage ( ) ;
slotSendMessage ( msg ) ;
slotSendMessage ( msg ) ;
TQTimer : : singleShot ( 150 , this , TQ T _SLOT( slotSendGreet ( ) ) ) ;
TQTimer : : singleShot ( 150 , this , TQ _SLOT( slotSendGreet ( ) ) ) ;
}
}
void KBattleshipWindow : : slotSendGreet ( )
void KBattleshipWindow : : slotSendGreet ( )
@ -862,49 +862,49 @@ void KBattleshipWindow::slotStartBattleshipServer()
if ( m_connection = = 0 )
if ( m_connection = = 0 )
{
{
m_connection = new KonnectionHandling ( this , m_kbserver ) ;
m_connection = new KonnectionHandling ( this , m_kbserver ) ;
connect ( m_connection , TQ T _SIGNAL( sigStatusBar ( const TQString & ) ) , this , TQ T _SLOT( slotStatusMsg ( const TQString & ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigStatusBar ( const TQString & ) ) , this , TQ _SLOT( slotStatusMsg ( const TQString & ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigEnemyNickname ( const TQString & ) ) , this , TQ T _SLOT( slotChangeEnemyPlayer ( const TQString & ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigEnemyNickname ( const TQString & ) ) , this , TQ _SLOT( slotChangeEnemyPlayer ( const TQString & ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigSendNickname ( ) ) , this , TQ T _SLOT( slotSendGreet ( ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigSendNickname ( ) ) , this , TQ _SLOT( slotSendGreet ( ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigPlaceShips ( bool ) ) , this , TQ T _SLOT( slotSetPlaceable ( bool ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigPlaceShips ( bool ) ) , this , TQ _SLOT( slotSetPlaceable ( bool ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigShootable ( bool ) ) , this , TQ T _SLOT( slotSetShootable ( bool ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigShootable ( bool ) ) , this , TQ _SLOT( slotSetShootable ( bool ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigSendFieldState ( int , int ) ) , this , TQ T _SLOT( slotSendEnemyFieldState ( int , int ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigSendFieldState ( int , int ) ) , this , TQ _SLOT( slotSendEnemyFieldState ( int , int ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) , this , TQ T _SLOT( slotReceivedEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) , this , TQ _SLOT( slotReceivedEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigClientLost ( ) ) , this , TQ T _SLOT( slotClientLost ( ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigClientLost ( ) ) , this , TQ _SLOT( slotClientLost ( ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigAbortNetworkGame ( ) ) , this , TQ T _SLOT( slotAbortNetworkGame ( ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigAbortNetworkGame ( ) ) , this , TQ _SLOT( slotAbortNetworkGame ( ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigReplay ( ) ) , this , TQ T _SLOT( slotReplayRequest ( ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigReplay ( ) ) , this , TQ _SLOT( slotReplayRequest ( ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigChatMessage ( const TQString & , const TQString & , bool ) ) , m_chat , TQ T _SLOT( slotReceivedMessage ( const TQString & , const TQString & , bool ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigChatMessage ( const TQString & , const TQString & , bool ) ) , m_chat , TQ _SLOT( slotReceivedMessage ( const TQString & , const TQString & , bool ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigClientInformation ( const TQString & , const TQString & , const TQString & , const TQString & ) ) , this , TQ T _SLOT( slotReceivedClientInformation ( const TQString & , const TQString & , const TQString & , const TQString & ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigClientInformation ( const TQString & , const TQString & , const TQString & , const TQString & ) ) , this , TQ _SLOT( slotReceivedClientInformation ( const TQString & , const TQString & , const TQString & , const TQString & ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigLost ( KMessage * ) ) , this , TQ T _SLOT( slotLost ( KMessage * ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigLost ( KMessage * ) ) , this , TQ _SLOT( slotLost ( KMessage * ) ) ) ;
}
}
else
else
{
{
if ( m_connection - > type ( ) = = KonnectionHandling : : CLIENT )
if ( m_connection - > type ( ) = = KonnectionHandling : : CLIENT )
{
{
disconnect ( m_kbclient , TQ T _SIGNAL( sigConnected ( ) ) , this , TQ T _SLOT( slotSendVersion ( ) ) ) ;
disconnect ( m_kbclient , TQ _SIGNAL( sigConnected ( ) ) , this , TQ _SLOT( slotSendVersion ( ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigAbortNetworkGame ( ) ) , this , TQ T _SLOT( slotAbortNetworkGame ( ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigAbortNetworkGame ( ) ) , this , TQ _SLOT( slotAbortNetworkGame ( ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigStatusBar ( const TQString & ) ) , this , TQ T _SLOT( slotStatusMsg ( const TQString & ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigStatusBar ( const TQString & ) ) , this , TQ _SLOT( slotStatusMsg ( const TQString & ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigEnemyNickname ( const TQString & ) ) , this , TQ T _SLOT( slotChangeEnemyPlayer ( const TQString & ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigEnemyNickname ( const TQString & ) ) , this , TQ _SLOT( slotChangeEnemyPlayer ( const TQString & ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigSendFieldState ( int , int ) ) , this , TQ T _SLOT( slotSendEnemyFieldState ( int , int ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigSendFieldState ( int , int ) ) , this , TQ _SLOT( slotSendEnemyFieldState ( int , int ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) , this , TQ T _SLOT( slotReceivedEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) , this , TQ _SLOT( slotReceivedEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigShootable ( bool ) ) , this , TQ T _SLOT( slotSetShootable ( bool ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigShootable ( bool ) ) , this , TQ _SLOT( slotSetShootable ( bool ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigPlaceShips ( bool ) ) , this , TQ T _SLOT( slotSetPlaceable ( bool ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigPlaceShips ( bool ) ) , this , TQ _SLOT( slotSetPlaceable ( bool ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigServerLost ( ) ) , this , TQ T _SLOT( slotServerLost ( ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigServerLost ( ) ) , this , TQ _SLOT( slotServerLost ( ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigReplay ( ) ) , this , TQ T _SLOT( slotReplay ( ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigReplay ( ) ) , this , TQ _SLOT( slotReplay ( ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigChatMessage ( const TQString & , const TQString & , bool ) ) , m_chat , TQ T _SLOT( slotReceivedMessage ( const TQString & , const TQString & , bool ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigChatMessage ( const TQString & , const TQString & , bool ) ) , m_chat , TQ _SLOT( slotReceivedMessage ( const TQString & , const TQString & , bool ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigLost ( KMessage * ) ) , this , TQ T _SLOT( slotLost ( KMessage * ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigLost ( KMessage * ) ) , this , TQ _SLOT( slotLost ( KMessage * ) ) ) ;
m_connection - > updateInternal ( m_kbserver ) ;
m_connection - > updateInternal ( m_kbserver ) ;
connect ( m_connection , TQ T _SIGNAL( sigStatusBar ( const TQString & ) ) , this , TQ T _SLOT( slotStatusMsg ( const TQString & ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigStatusBar ( const TQString & ) ) , this , TQ _SLOT( slotStatusMsg ( const TQString & ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigEnemyNickname ( const TQString & ) ) , this , TQ T _SLOT( slotChangeEnemyPlayer ( const TQString & ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigEnemyNickname ( const TQString & ) ) , this , TQ _SLOT( slotChangeEnemyPlayer ( const TQString & ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigSendNickname ( ) ) , this , TQ T _SLOT( slotSendGreet ( ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigSendNickname ( ) ) , this , TQ _SLOT( slotSendGreet ( ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigPlaceShips ( bool ) ) , this , TQ T _SLOT( slotSetPlaceable ( bool ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigPlaceShips ( bool ) ) , this , TQ _SLOT( slotSetPlaceable ( bool ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigShootable ( bool ) ) , this , TQ T _SLOT( slotSetShootable ( bool ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigShootable ( bool ) ) , this , TQ _SLOT( slotSetShootable ( bool ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigSendFieldState ( int , int ) ) , this , TQ T _SLOT( slotSendEnemyFieldState ( int , int ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigSendFieldState ( int , int ) ) , this , TQ _SLOT( slotSendEnemyFieldState ( int , int ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) , this , TQ T _SLOT( slotReceivedEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) , this , TQ _SLOT( slotReceivedEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigClientLost ( ) ) , this , TQ T _SLOT( slotClientLost ( ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigClientLost ( ) ) , this , TQ _SLOT( slotClientLost ( ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigAbortNetworkGame ( ) ) , this , TQ T _SLOT( slotAbortNetworkGame ( ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigAbortNetworkGame ( ) ) , this , TQ _SLOT( slotAbortNetworkGame ( ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigReplay ( ) ) , this , TQ T _SLOT( slotReplayRequest ( ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigReplay ( ) ) , this , TQ _SLOT( slotReplayRequest ( ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigChatMessage ( const TQString & , const TQString & , bool ) ) , m_chat , TQ T _SLOT( slotReceivedMessage ( const TQString & , const TQString & , bool ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigChatMessage ( const TQString & , const TQString & , bool ) ) , m_chat , TQ _SLOT( slotReceivedMessage ( const TQString & , const TQString & , bool ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigLost ( KMessage * ) ) , this , TQ T _SLOT( slotLost ( KMessage * ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigLost ( KMessage * ) ) , this , TQ _SLOT( slotLost ( KMessage * ) ) ) ;
}
}
else
else
m_connection - > updateInternal ( m_kbserver ) ;
m_connection - > updateInternal ( m_kbserver ) ;
@ -1119,51 +1119,51 @@ void KBattleshipWindow::slotConnectToBattleshipServer(const TQString &host, int
if ( m_connection = = 0 )
if ( m_connection = = 0 )
{
{
m_connection = new KonnectionHandling ( this , m_kbclient ) ;
m_connection = new KonnectionHandling ( this , m_kbclient ) ;
connect ( m_kbclient , TQ T _SIGNAL( sigConnected ( ) ) , this , TQ T _SLOT( slotSendVersion ( ) ) ) ;
connect ( m_kbclient , TQ _SIGNAL( sigConnected ( ) ) , this , TQ _SLOT( slotSendVersion ( ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigAbortNetworkGame ( ) ) , this , TQ T _SLOT( slotAbortNetworkGame ( ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigAbortNetworkGame ( ) ) , this , TQ _SLOT( slotAbortNetworkGame ( ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigStatusBar ( const TQString & ) ) , this , TQ T _SLOT( slotStatusMsg ( const TQString & ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigStatusBar ( const TQString & ) ) , this , TQ _SLOT( slotStatusMsg ( const TQString & ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigEnemyNickname ( const TQString & ) ) , this , TQ T _SLOT( slotChangeEnemyPlayer ( const TQString & ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigEnemyNickname ( const TQString & ) ) , this , TQ _SLOT( slotChangeEnemyPlayer ( const TQString & ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigSendFieldState ( int , int ) ) , this , TQ T _SLOT( slotSendEnemyFieldState ( int , int ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigSendFieldState ( int , int ) ) , this , TQ _SLOT( slotSendEnemyFieldState ( int , int ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) , this , TQ T _SLOT( slotReceivedEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) , this , TQ _SLOT( slotReceivedEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigShootable ( bool ) ) , this , TQ T _SLOT( slotSetShootable ( bool ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigShootable ( bool ) ) , this , TQ _SLOT( slotSetShootable ( bool ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigPlaceShips ( bool ) ) , this , TQ T _SLOT( slotSetPlaceable ( bool ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigPlaceShips ( bool ) ) , this , TQ _SLOT( slotSetPlaceable ( bool ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigServerLost ( ) ) , this , TQ T _SLOT( slotServerLost ( ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigServerLost ( ) ) , this , TQ _SLOT( slotServerLost ( ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigReplay ( ) ) , this , TQ T _SLOT( slotReplay ( ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigReplay ( ) ) , this , TQ _SLOT( slotReplay ( ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigChatMessage ( const TQString & , const TQString & , bool ) ) , m_chat , TQ T _SLOT( slotReceivedMessage ( const TQString & , const TQString & , bool ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigChatMessage ( const TQString & , const TQString & , bool ) ) , m_chat , TQ _SLOT( slotReceivedMessage ( const TQString & , const TQString & , bool ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigClientInformation ( const TQString & , const TQString & , const TQString & , const TQString & ) ) , this , TQ T _SLOT( slotReceivedClientInformation ( const TQString & , const TQString & , const TQString & , const TQString & ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigClientInformation ( const TQString & , const TQString & , const TQString & , const TQString & ) ) , this , TQ _SLOT( slotReceivedClientInformation ( const TQString & , const TQString & , const TQString & , const TQString & ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigLost ( KMessage * ) ) , this , TQ T _SLOT( slotLost ( KMessage * ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigLost ( KMessage * ) ) , this , TQ _SLOT( slotLost ( KMessage * ) ) ) ;
}
}
else
else
{
{
if ( m_connection - > type ( ) = = KonnectionHandling : : SERVER )
if ( m_connection - > type ( ) = = KonnectionHandling : : SERVER )
{
{
disconnect ( m_connection , TQ T _SIGNAL( sigStatusBar ( const TQString & ) ) , this , TQ T _SLOT( slotStatusMsg ( const TQString & ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigStatusBar ( const TQString & ) ) , this , TQ _SLOT( slotStatusMsg ( const TQString & ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigEnemyNickname ( const TQString & ) ) , this , TQ T _SLOT( slotChangeEnemyPlayer ( const TQString & ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigEnemyNickname ( const TQString & ) ) , this , TQ _SLOT( slotChangeEnemyPlayer ( const TQString & ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigSendNickname ( ) ) , this , TQ T _SLOT( slotSendGreet ( ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigSendNickname ( ) ) , this , TQ _SLOT( slotSendGreet ( ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigPlaceShips ( bool ) ) , this , TQ T _SLOT( slotSetPlaceable ( bool ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigPlaceShips ( bool ) ) , this , TQ _SLOT( slotSetPlaceable ( bool ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigShootable ( bool ) ) , this , TQ T _SLOT( slotSetShootable ( bool ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigShootable ( bool ) ) , this , TQ _SLOT( slotSetShootable ( bool ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigSendFieldState ( int , int ) ) , this , TQ T _SLOT( slotSendEnemyFieldState ( int , int ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigSendFieldState ( int , int ) ) , this , TQ _SLOT( slotSendEnemyFieldState ( int , int ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) , this , TQ T _SLOT( slotReceivedEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) , this , TQ _SLOT( slotReceivedEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigClientLost ( ) ) , this , TQ T _SLOT( slotClientLost ( ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigClientLost ( ) ) , this , TQ _SLOT( slotClientLost ( ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigAbortNetworkGame ( ) ) , this , TQ T _SLOT( slotAbortNetworkGame ( ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigAbortNetworkGame ( ) ) , this , TQ _SLOT( slotAbortNetworkGame ( ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigReplay ( ) ) , this , TQ T _SLOT( slotReplayRequest ( ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigReplay ( ) ) , this , TQ _SLOT( slotReplayRequest ( ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigChatMessage ( const TQString & , const TQString & , bool ) ) , m_chat , TQ T _SLOT( slotReceivedMessage ( const TQString & , const TQString & , bool ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigChatMessage ( const TQString & , const TQString & , bool ) ) , m_chat , TQ _SLOT( slotReceivedMessage ( const TQString & , const TQString & , bool ) ) ) ;
disconnect ( m_connection , TQ T _SIGNAL( sigLost ( KMessage * ) ) , this , TQ T _SLOT( slotLost ( KMessage * ) ) ) ;
disconnect ( m_connection , TQ _SIGNAL( sigLost ( KMessage * ) ) , this , TQ _SLOT( slotLost ( KMessage * ) ) ) ;
m_connection - > updateInternal ( m_kbclient ) ;
m_connection - > updateInternal ( m_kbclient ) ;
connect ( m_kbclient , TQ T _SIGNAL( sigConnected ( ) ) , this , TQ T _SLOT( slotSendVersion ( ) ) ) ;
connect ( m_kbclient , TQ _SIGNAL( sigConnected ( ) ) , this , TQ _SLOT( slotSendVersion ( ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigAbortNetworkGame ( ) ) , this , TQ T _SLOT( slotAbortNetworkGame ( ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigAbortNetworkGame ( ) ) , this , TQ _SLOT( slotAbortNetworkGame ( ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigStatusBar ( const TQString & ) ) , this , TQ T _SLOT( slotStatusMsg ( const TQString & ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigStatusBar ( const TQString & ) ) , this , TQ _SLOT( slotStatusMsg ( const TQString & ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigEnemyNickname ( const TQString & ) ) , this , TQ T _SLOT( slotChangeEnemyPlayer ( const TQString & ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigEnemyNickname ( const TQString & ) ) , this , TQ _SLOT( slotChangeEnemyPlayer ( const TQString & ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigSendFieldState ( int , int ) ) , this , TQ T _SLOT( slotSendEnemyFieldState ( int , int ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigSendFieldState ( int , int ) ) , this , TQ _SLOT( slotSendEnemyFieldState ( int , int ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) , this , TQ T _SLOT( slotReceivedEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) , this , TQ _SLOT( slotReceivedEnemyFieldData ( int , int , int , int , int , int , int , bool ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigShootable ( bool ) ) , this , TQ T _SLOT( slotSetShootable ( bool ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigShootable ( bool ) ) , this , TQ _SLOT( slotSetShootable ( bool ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigPlaceShips ( bool ) ) , this , TQ T _SLOT( slotSetPlaceable ( bool ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigPlaceShips ( bool ) ) , this , TQ _SLOT( slotSetPlaceable ( bool ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigServerLost ( ) ) , this , TQ T _SLOT( slotServerLost ( ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigServerLost ( ) ) , this , TQ _SLOT( slotServerLost ( ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigReplay ( ) ) , this , TQ T _SLOT( slotReplay ( ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigReplay ( ) ) , this , TQ _SLOT( slotReplay ( ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigChatMessage ( const TQString & , const TQString & , bool ) ) , m_chat , TQ T _SLOT( slotReceivedMessage ( const TQString & , const TQString & , bool ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigChatMessage ( const TQString & , const TQString & , bool ) ) , m_chat , TQ _SLOT( slotReceivedMessage ( const TQString & , const TQString & , bool ) ) ) ;
m_kbclient - > init ( ) ;
m_kbclient - > init ( ) ;
connect ( m_connection , TQ T _SIGNAL( sigClientInformation ( const TQString & , const TQString & , const TQString & , const TQString & ) ) , this , TQ T _SLOT( slotReceivedClientInformation ( const TQString & , const TQString & , const TQString & , const TQString & ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigClientInformation ( const TQString & , const TQString & , const TQString & , const TQString & ) ) , this , TQ _SLOT( slotReceivedClientInformation ( const TQString & , const TQString & , const TQString & , const TQString & ) ) ) ;
connect ( m_connection , TQ T _SIGNAL( sigLost ( KMessage * ) ) , this , TQ T _SLOT( slotLost ( KMessage * ) ) ) ;
connect ( m_connection , TQ _SIGNAL( sigLost ( KMessage * ) ) , this , TQ _SLOT( slotLost ( KMessage * ) ) ) ;
}
}
else
else
m_connection - > updateInternal ( m_kbclient ) ;
m_connection - > updateInternal ( m_kbclient ) ;
@ -1234,7 +1234,7 @@ void KBattleshipWindow::slotSinglePlayer()
slotStatusMsg ( i18n ( " Ready " ) ) ;
slotStatusMsg ( i18n ( " Ready " ) ) ;
m_stat - > clear ( ) ;
m_stat - > clear ( ) ;
m_chat - > clear ( ) ;
m_chat - > clear ( ) ;
TQTimer : : singleShot ( 0 , this , TQ T _SLOT( slotDeleteAI ( ) ) ) ;
TQTimer : : singleShot ( 0 , this , TQ _SLOT( slotDeleteAI ( ) ) ) ;
cleanup ( false ) ;
cleanup ( false ) ;
}
}
}
}
@ -1269,8 +1269,8 @@ void KBattleshipWindow::slotStartBattleshipGame(bool clearstat)
{
{
m_aiPlayer = new KBAIPlayer ( ) ;
m_aiPlayer = new KBAIPlayer ( ) ;
m_aiPlayer - > init ( m_view - > field ( ) , m_enemyshiplist ) ;
m_aiPlayer - > init ( m_view - > field ( ) , m_enemyshiplist ) ;
connect ( m_aiPlayer , TQ T _SIGNAL( sigReady ( ) ) , this , TQ T _SLOT( slotAIReady ( ) ) ) ;
connect ( m_aiPlayer , TQ _SIGNAL( sigReady ( ) ) , this , TQ _SLOT( slotAIReady ( ) ) ) ;
connect ( m_aiPlayer , TQ T _SIGNAL( sigShootAt ( const TQPoint ) ) , this , TQ T _SLOT( slotAIShootsAt ( const TQPoint ) ) ) ;
connect ( m_aiPlayer , TQ _SIGNAL( sigShootAt ( const TQPoint ) ) , this , TQ _SLOT( slotAIShootsAt ( const TQPoint ) ) ) ;
}
}
m_aiPlayer - > slotRestart ( ) ;
m_aiPlayer - > slotRestart ( ) ;
}
}
@ -1320,11 +1320,11 @@ void KBattleshipWindow::slotAIShootsAt(const TQPoint pos)
switch ( KMessageBox : : questionYesNo ( this , i18n ( " Do you want to restart the game? " ) , TQString ( ) , 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 :
case KMessageBox : : Yes :
TQTimer : : singleShot ( 0 , this , TQ T _SLOT( slotRestartAI ( ) ) ) ;
TQTimer : : singleShot ( 0 , this , TQ _SLOT( slotRestartAI ( ) ) ) ;
break ;
break ;
case KMessageBox : : No :
case KMessageBox : : No :
TQTimer : : singleShot ( 0 , this , TQ T _SLOT( slotDeleteAI ( ) ) ) ;
TQTimer : : singleShot ( 0 , this , TQ _SLOT( slotDeleteAI ( ) ) ) ;
break ;
break ;
}
}
}
}