KGameDialog Class Reference
TODO: rewrite entire documentation. Main configuration dialog for KGame. More...
#include <kgamedialog.h>
Public Types | |
enum | ConfigOptions { NoConfig = 0, ChatConfig = 1, GameConfig = 2, NetworkConfig = 4, MsgServerConfig = 8, BanPlayerConfig = 16, AllConfig = 0xffff } |
Public Member Functions | |
KGameDialog (KGame *g, KPlayer *owner, const QString &title, QWidget *parent, bool modal=false) | |
KGameDialog (KGame *g, KPlayer *owner, const QString &title, QWidget *parent, long initConfigs=AllConfig, int chatMsgId=15432, bool modal=false) | |
void | setOwner (KPlayer *owner) |
void | setKGame (KGame *g) |
virtual void | submitToKGame () |
void | addChatWidget (KGameDialogChatConfig *chat, QVBox *parent=0) |
void | addConnectionList (KGameDialogConnectionConfig *c, QVBox *parent=0) |
QVBox * | addConfigPage (KGameDialogConfig *widget, const QString &title) |
QVBox * | configPage (ConfigOptions which) |
KGameDialogNetworkConfig * | networkConfig () const |
KGameDialogGeneralConfig * | gameConfig () const |
void | addConfigWidget (KGameDialogConfig *widget, QWidget *parent) |
void | addNetworkConfig (KGameDialogNetworkConfig *netConf) |
void | addGameConfig (KGameDialogGeneralConfig *conf) |
void | addMsgServerConfig (KGameDialogMsgServerConfig *conf) |
Protected Slots | |
virtual void | slotOk () |
virtual void | slotApply () |
virtual void | slotDefault () |
void | slotUnsetKGame () |
void | setAdmin (bool isAdmin) |
void | slotRemoveConfigWidget (QObject *configWidget) |
Protected Member Functions | |
void | initDefaultDialog (ConfigOptions initConfigs, int chatMsgId=15432) |
void | configureConfigWidgets () |
Detailed Description
TODO: rewrite entire documentation. Main configuration dialog for KGame.Nearly nothing is valid anymore. The main configuration dialog for KGame. Here all players meat each other, every player can see how many players connected (and their names) and the ADMIN can even "kick" players out. You can talk to each other (using KGameChat and the ADMIN can define the maxPlayers/minPlayers as well as the number of computer players.
AB: setDefaultXYZ is obsolete!! You will usually create an instance of KGameDialog or any derived class and call setDefaultXYZ methods. Example (maybe obsoleted parameters - docu is currently changing very fast):
KGameDialog dlg(kgame, i18n("New Game"), localPlayer, this, true, ID_CHAT); dlg.setDefaultNetworkInfo(port, host); // AB: obsolete! dlg.exec();
- Author:
- Andreas Beckermann <b_mann@gmx.de>
Definition at line 74 of file kgamedialog.h.
Constructor & Destructor Documentation
|
Create an empty KGameDialog. You can add widgets using addConfigPage.
Definition at line 66 of file kgamedialog.cpp. |
|
Create a KGameDialog with the standard configuration widgets. This creates the following widgets:
If you want to add further configuration widget you can simply use addConfigPage
Definition at line 74 of file kgamedialog.cpp. References initDefaultDialog(). |
Member Function Documentation
|
Change the owner of the dialog. This will be used as the fromPlayer in KGameChat and will receive the entered player name.
Definition at line 284 of file kgamedialog.cpp. References KGameDialogGeneralConfig::setOwner(). Referenced by slotDefault(). |
|
Change the KGame object this dialog is used for. Calls the KGameDialogConfig::setKGame implementation of all widgets that have been added by addConfigWidget
Definition at line 298 of file kgamedialog.cpp. References setAdmin(), KGameDialogGeneralConfig::setKGame(), and slotUnsetKGame(). Referenced by slotDefault(), and slotUnsetKGame(). |
|
This will submit all configuration data to the KGame object. Automatically called by slotApply and slotOk There is no need to replace this unless you want to add widgets which are not derived from those classes Definition at line 325 of file kgamedialog.cpp. References KGameDialogGeneralConfig::submitToKGame(). Referenced by slotApply(). |
|
Adds a KGameChat to the dialog. If no parent is specified the game page will be used.
Definition at line 168 of file kgamedialog.cpp. References addConfigWidget(). Referenced by initDefaultDialog(). |
|
Add a connection list to the dialog. The list consists of a KLisBox containing all players in the current game (see KGame::playerList). The admin can "ban" players, ie kick them out of the game. This is another not-really-config-config-widget. It just displays the connections and lets you ban players.
Definition at line 183 of file kgamedialog.cpp. References addConfigWidget(). Referenced by initDefaultDialog(). |
|
Add a new page to the dialog. The page will contain you new config widget and will have your provided title. The widget will be reparented to this dialog. This also calls KGameDialogConfig::setKGame and KGameDialogConfig::setOwner.
Definition at line 218 of file kgamedialog.cpp. References addConfigWidget(). Referenced by addGameConfig(), addMsgServerConfig(), addNetworkConfig(), and initDefaultDialog(). |
|
Definition at line 198 of file kgamedialog.cpp. |
|
Definition at line 259 of file kgamedialog.cpp. |
|
Definition at line 257 of file kgamedialog.cpp. |
|
Add a config widget to the specified parent. Usually you call addConfigPage for one widget and addConfigWidget for another to add it to the same page. Just use the returned page of addConfigPage. Definition at line 229 of file kgamedialog.cpp. References slotRemoveConfigWidget(). Referenced by addChatWidget(), addConfigPage(), and addConnectionList(). |
|
Used to add the main network config widget in a new page. Use this to make networkConfig return something useful. Definition at line 151 of file kgamedialog.cpp. References addConfigPage(). Referenced by initDefaultDialog(). |
|
Add the main game config widget in a new page. Use this to make gameConfig return something useful. Definition at line 142 of file kgamedialog.cpp. References addConfigPage(). Referenced by initDefaultDialog(). |
|
Used to add the message server config widget in a new page.
Definition at line 160 of file kgamedialog.cpp. References addConfigPage(). Referenced by initDefaultDialog(). |
|
This is used to create a dialog containing all the default widgets. You may want to use this if you just want to use your own configuration widgets which inherit the standard ones. Note that if one of the widgets is NULL the default implementation will be used! (except the chat widget - you need to create it yourself as you have to provide a message id)
Definition at line 101 of file kgamedialog.cpp. References addChatWidget(), addConfigPage(), addConnectionList(), addGameConfig(), addMsgServerConfig(), and addNetworkConfig(). Referenced by KGameDialog(). |
|
Go through all config widgets and call their KGameDialogConfig::setKGame and KGameDialogConfig::setOwner implementation. This function could be private and probably will be very soon. Don't use it yourself |
|
Called when the user clicks on Ok. Calls slotApply and QDialog::accept() Definition at line 278 of file kgamedialog.cpp. References slotApply(). |
|
Just calls submitToKGame().
Definition at line 262 of file kgamedialog.cpp. References submitToKGame(). Referenced by slotOk(). |
|
Sets the default values for the configuration widgets. Set these values by (e.g.) setDefaultMaxPlayers()
Definition at line 267 of file kgamedialog.cpp. References setKGame(), and setOwner(). |
|
Called when the KGame object is destroyed. Calls setKGame(0) so that all widgets can disconnect their slots and so on. Definition at line 322 of file kgamedialog.cpp. References setKGame(). Referenced by setKGame(). |
|
Called when the ADMIN status of this KGame client changes. See KGameNetwork::signalAdminStatusChanged
Definition at line 315 of file kgamedialog.cpp. References KGameDialogGeneralConfig::setAdmin(). Referenced by setKGame(). |
|
Remove a config widget from the widget list.
Definition at line 343 of file kgamedialog.cpp. Referenced by addConfigWidget(). |
The documentation for this class was generated from the following files: