KGameDebugDialog Class Reference

#include <kgamedebugdialog.h>

Collaboration diagram for KGameDebugDialog:

Collaboration graph
[legend]
List of all members.

Public Slots

void slotUnsetKGame ()
 Unsets a KGame which has been set using setKGame before.
void slotUpdateGameData ()
 Update the data of the KGame object.
void slotUpdatePlayerData ()
 Update the properties of the currently selected player.
void slotUpdatePlayerList ()
 Updates the list of players and calls clearPlayerData.
void slotClearMessages ()

Signals

void signalRequestIdName (int messageid, bool userid, QString &name)
 This signal is emitted when the "debug messages" page couldn't find the name of a message id.

Public Member Functions

 KGameDebugDialog (KGame *g, QWidget *parent, bool modal=false)
 ~KGameDebugDialog ()
void setKGame (const KGame *g)
 Automatically connects the KGame object to all error dependant slots.

Protected Slots

void slotUpdatePlayerData (QListBoxItem *item)
 Update the data of the player specified in item.
void slotShowId ()
void slotHideId ()
void slotMessageUpdate (int msgid, Q_UINT32 receiver, Q_UINT32 sender)
 A message has been received - see KGame::signalMessageUpdate.

Protected Member Functions

void clearPages ()
void clearPlayerData ()
 Clear the data of the player view.
void clearGameData ()
 Clear the data view of the KGame object.
void addPlayer (KPlayer *p)
 Add a new player to the player list.
void removePlayer (QListBoxItem *item)
 Remove a player from the list.
bool showId (int msgid)

Detailed Description

Definition at line 34 of file kgamedebugdialog.h.


Constructor & Destructor Documentation

KGameDebugDialog::KGameDebugDialog KGame g,
QWidget *  parent,
bool  modal = false
 

Definition at line 123 of file kgamedebugdialog.cpp.

References setKGame().

Here is the call graph for this function:

KGameDebugDialog::~KGameDebugDialog  ) 
 

Definition at line 136 of file kgamedebugdialog.cpp.


Member Function Documentation

void KGameDebugDialog::addPlayer KPlayer p  )  [protected]
 

Add a new player to the player list.

Definition at line 457 of file kgamedebugdialog.cpp.

References KPlayer::id(), and KGameDebugDialogPrivate::mPlayerList.

Referenced by setKGame().

Here is the call graph for this function:

void KGameDebugDialog::clearGameData  )  [protected]
 

Clear the data view of the KGame object.

Definition at line 269 of file kgamedebugdialog.cpp.

References KGameDebugDialogPrivate::mGameAddress, KGameDebugDialogPrivate::mGameAdmin, KGameDebugDialogPrivate::mGameCookie, KGameDebugDialogPrivate::mGameId, KGameDebugDialogPrivate::mGameMaster, KGameDebugDialogPrivate::mGameMaxPlayers, KGameDebugDialogPrivate::mGameMinPlayers, KGameDebugDialogPrivate::mGameOffering, KGameDebugDialogPrivate::mGameProperties, KGameDebugDialogPrivate::mGameRunning, and KGameDebugDialogPrivate::mGameStatus.

Referenced by clearPages(), and slotUpdateGameData().

void KGameDebugDialog::clearPages  )  [protected]
 

Definition at line 420 of file kgamedebugdialog.cpp.

References clearGameData(), clearPlayerData(), KGameDebugDialogPrivate::mPlayerList, and slotClearMessages().

Referenced by slotUnsetKGame().

Here is the call graph for this function:

void KGameDebugDialog::clearPlayerData  )  [protected]
 

Clear the data of the player view.

Note that the player list is NOT cleared.

Definition at line 251 of file kgamedebugdialog.cpp.

References KGameDebugDialogPrivate::mPlayerActive, KGameDebugDialogPrivate::mPlayerAddress, KGameDebugDialogPrivate::mPlayerAsyncInput, KGameDebugDialogPrivate::mPlayerGroup, KGameDebugDialogPrivate::mPlayerId, KGameDebugDialogPrivate::mPlayerKGameAddress, KGameDebugDialogPrivate::mPlayerMyTurn, KGameDebugDialogPrivate::mPlayerName, KGameDebugDialogPrivate::mPlayerNetworkPriority, KGameDebugDialogPrivate::mPlayerProperties, KGameDebugDialogPrivate::mPlayerRtti, KGameDebugDialogPrivate::mPlayerUserId, and KGameDebugDialogPrivate::mPlayerVirtual.

Referenced by clearPages(), removePlayer(), and slotUpdatePlayerData().

void KGameDebugDialog::removePlayer QListBoxItem *  item  )  [protected]
 

Remove a player from the list.

Definition at line 468 of file kgamedebugdialog.cpp.

References clearPlayerData(), KGame::findPlayer(), and KGameDebugDialogPrivate::mGame.

Referenced by slotUpdatePlayerList().

Here is the call graph for this function:

void KGameDebugDialog::setKGame const KGame g  ) 
 

Automatically connects the KGame object to all error dependant slots.

Create a KGameErrorDialog object, call this function and forget everything.

Parameters:
g The KGame which will emit the erorrs (or not ;-) )

Definition at line 428 of file kgamedebugdialog.cpp.

References addPlayer(), KGameDebugDialogPrivate::mGame, KGame::playerList(), slotMessageUpdate(), slotUnsetKGame(), and slotUpdateGameData().

Referenced by KGameDebugDialog().

Here is the call graph for this function:

bool KGameDebugDialog::showId int  msgid  )  [protected]
 

Returns:
Whether messages with this msgid shall be displayed or not

Definition at line 536 of file kgamedebugdialog.cpp.

References KGameDebugDialogPrivate::mHideIdList.

Referenced by slotMessageUpdate().

void KGameDebugDialog::signalRequestIdName int  messageid,
bool  userid,
QString &  name
[signal]
 

This signal is emitted when the "debug messages" page couldn't find the name of a message id.

This is usually the case for user-defined messages. KGameDebugDialog asks you to give the msgid a name.

Parameters:
messageid The ID of the message. As given to KGame::sendMessage
userid User defined msgIds are internally increased by KGameMessage::IdUser. You don't have to care about this but if this signal is emitted with userid=false (shouldn't happen) then the name of an internal message as defined in KGameMessage::GameMessageIds couldn't be found.
name The name of the msgid. You have to fill this!

Referenced by slotMessageUpdate().

void KGameDebugDialog::slotClearMessages  )  [slot]
 

Definition at line 505 of file kgamedebugdialog.cpp.

References KGameDebugDialogPrivate::mMessageList.

Referenced by clearPages().

void KGameDebugDialog::slotHideId  )  [protected, slot]
 

Definition at line 524 of file kgamedebugdialog.cpp.

References KGameDebugDialogPrivate::mMessageList.

void KGameDebugDialog::slotMessageUpdate int  msgid,
Q_UINT32  receiver,
Q_UINT32  sender
[protected, slot]
 

A message has been received - see KGame::signalMessageUpdate.

Definition at line 484 of file kgamedebugdialog.cpp.

References KGameMessage::IdUser, KGameMessage::messageId2Text(), showId(), and signalRequestIdName().

Referenced by setKGame().

void KGameDebugDialog::slotShowId  )  [protected, slot]
 

Definition at line 510 of file kgamedebugdialog.cpp.

References KGameDebugDialogPrivate::mHideIdList.

void KGameDebugDialog::slotUnsetKGame  )  [slot]
 

Unsets a KGame which has been set using setKGame before.

This is called automatically when the KGame object is destroyed and you normally don't have to call this yourself.

Note that setKGame also unsets an already existing KGame object if exising.

Definition at line 448 of file kgamedebugdialog.cpp.

References clearPages(), and KGameDebugDialogPrivate::mGame.

Referenced by setKGame().

void KGameDebugDialog::slotUpdateGameData  )  [slot]
 

Update the data of the KGame object.

Definition at line 306 of file kgamedebugdialog.cpp.

References clearGameData(), KGameNetwork::cookie(), KGame::dataHandler(), KGamePropertyHandler::dict(), KGameNetwork::gameId(), KGame::gameStatus(), KGameNetwork::isAdmin(), KGameNetwork::isMaster(), KGameNetwork::isOfferingConnections(), KGame::isRunning(), KGame::maxPlayers(), KGameDebugDialogPrivate::mGame, KGameDebugDialogPrivate::mGameAddress, KGameDebugDialogPrivate::mGameAdmin, KGameDebugDialogPrivate::mGameCookie, KGameDebugDialogPrivate::mGameId, KGameDebugDialogPrivate::mGameMaster, KGameDebugDialogPrivate::mGameMaxPlayers, KGameDebugDialogPrivate::mGameMinPlayers, KGameDebugDialogPrivate::mGameOffering, KGameDebugDialogPrivate::mGamePlayerCount, KGameDebugDialogPrivate::mGameRunning, KGameDebugDialogPrivate::mGameStatus, KGame::minPlayers(), KGame::playerCount(), KGamePropertyBase::PolicyClean, KGamePropertyBase::PolicyDirty, KGamePropertyBase::PolicyLocal, and KGamePropertyBase::PolicyUndefined.

Referenced by setKGame().

void KGameDebugDialog::slotUpdatePlayerData QListBoxItem *  item  )  [protected, slot]
 

Update the data of the player specified in item.

Parameters:
item The QListBoxItem of the player to be updated. Note that the text of this item MUST be the ID of the player

Definition at line 359 of file kgamedebugdialog.cpp.

References KPlayer::asyncInput(), clearPlayerData(), KPlayer::dataHandler(), KGamePropertyHandler::dict(), KGame::findPlayer(), KPlayer::game(), KPlayer::group(), KPlayer::id(), KPlayer::isActive(), KPlayer::isVirtual(), KGameDebugDialogPrivate::mGame, KGameDebugDialogPrivate::mPlayerActive, KGameDebugDialogPrivate::mPlayerAddress, KGameDebugDialogPrivate::mPlayerAsyncInput, KGameDebugDialogPrivate::mPlayerGroup, KGameDebugDialogPrivate::mPlayerId, KGameDebugDialogPrivate::mPlayerKGameAddress, KGameDebugDialogPrivate::mPlayerMyTurn, KGameDebugDialogPrivate::mPlayerName, KGameDebugDialogPrivate::mPlayerNetworkPriority, KGameDebugDialogPrivate::mPlayerRtti, KGameDebugDialogPrivate::mPlayerUserId, KGameDebugDialogPrivate::mPlayerVirtual, KPlayer::myTurn(), KPlayer::name(), KPlayer::networkPriority(), KGamePropertyBase::PolicyClean, KGamePropertyBase::PolicyDirty, KGamePropertyBase::PolicyLocal, KGamePropertyBase::PolicyUndefined, KPlayer::rtti(), and KPlayer::userId().

void KGameDebugDialog::slotUpdatePlayerData  )  [slot]
 

Update the properties of the currently selected player.

Definition at line 285 of file kgamedebugdialog.cpp.

References KGameDebugDialogPrivate::mGame, and KGameDebugDialogPrivate::mPlayerList.

void KGameDebugDialog::slotUpdatePlayerList  )  [slot]
 

Updates the list of players and calls clearPlayerData.

Note that after this call NO player is selected anymore.

Definition at line 293 of file kgamedebugdialog.cpp.

References KGameDebugDialogPrivate::mPlayerList, and removePlayer().


The documentation for this class was generated from the following files:
Generated on Wed Aug 23 18:05:08 2006 for libkdegames by  doxygen 1.4.6