libkdegames Library API Documentation

KGameDebugDialog Class Reference

List of all members.

Public Slots

void slotUnsetKGame ()
void slotUpdateGameData ()
void slotUpdatePlayerData ()
void slotUpdatePlayerList ()
void slotClearMessages ()

Signals

void signalRequestIdName (int messageid, bool userid, QString &name)

Public Member Functions

 KGameDebugDialog (KGame *g, QWidget *parent, bool modal=false)
 ~KGameDebugDialog ()
void setKGame (const KGame *g)

Protected Slots

void slotUpdatePlayerData (QListBoxItem *item)
void slotShowId ()
void slotHideId ()
void slotMessageUpdate (int msgid, Q_UINT32 receiver, Q_UINT32 sender)

Protected Member Functions

void clearPages ()
void clearPlayerData ()
void clearGameData ()
void addPlayer (KPlayer *p)
void removePlayer (QListBoxItem *item)
bool showId (int msgid)

Detailed Description

Definition at line 34 of file kgamedebugdialog.h.


Member Function Documentation

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(), slotMessageUpdate(), slotUnsetKGame(), and slotUpdateGameData().

Referenced by KGameDebugDialog().

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().

Referenced by setKGame().

void KGameDebugDialog::slotUpdateGameData  )  [slot]
 

Update the data of the KGame object.

Definition at line 306 of file kgamedebugdialog.cpp.

References clearGameData(), KGamePropertyHandler::dict(), KGamePropertyHandler::propertyName(), and KGamePropertyHandler::propertyValue().

Referenced by setKGame().

void KGameDebugDialog::slotUpdatePlayerData  )  [slot]
 

Update the properties of the currently selected player.

Definition at line 285 of file kgamedebugdialog.cpp.

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 addPlayer(), and removePlayer().

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::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.

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

void KGameDebugDialog::clearGameData  )  [protected]
 

Clear the data view of the KGame object.

Definition at line 269 of file kgamedebugdialog.cpp.

Referenced by clearPages(), and slotUpdateGameData().

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().

Referenced by setKGame(), and slotUpdatePlayerList().

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

Remove a player from the list.

Definition at line 468 of file kgamedebugdialog.cpp.

References clearPlayerData().

Referenced by slotUpdatePlayerList().

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.

Referenced by slotHideId(), and slotMessageUpdate().

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(), KPlayer::game(), KPlayer::group(), KPlayer::id(), KPlayer::isActive(), KPlayer::isVirtual(), KPlayer::myTurn(), KPlayer::name(), KPlayer::networkPriority(), KGamePropertyHandler::propertyName(), KGamePropertyHandler::propertyValue(), KPlayer::rtti(), and KPlayer::userId().

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::messageId2Text(), showId(), and signalRequestIdName().

Referenced by setKGame().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for libkdegames Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Sep 12 05:17:53 2005 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003