21#include <tdemessagebox.h>
27#include "kgameerrordialog.h"
29class KGameErrorDialogPrivate
32 KGameErrorDialogPrivate()
40KGameErrorDialog::KGameErrorDialog(TQWidget* parent) : TQObject(parent)
42 d =
new KGameErrorDialogPrivate;
45KGameErrorDialog::~KGameErrorDialog()
55 connect(d->mGame, TQ_SIGNAL(destroyed()),
this, TQ_SLOT(
slotUnsetKGame()));
58 connect(d->mGame, TQ_SIGNAL(signalNetworkErrorMessage(
int, TQString)),
59 this, TQ_SLOT(slotError(
int, TQString)));
60 connect(d->mGame, TQ_SIGNAL(signalConnectionBroken()),
62 connect(d->mGame, TQ_SIGNAL(signalClientDisconnected(TQ_UINT32,
bool)),
69 disconnect(d->mGame, 0,
this, 0);
74void KGameErrorDialog::error(
const TQString& errorText, TQWidget* parent)
75{ KMessageBox::error(parent, errorText); }
80 TQString message = i18n(
"Connection to the server has been lost!");
81 error(message, (TQWidget*)parent());
93 message = i18n(
"Connection to client has been lost!");
94 error(message, (TQWidget*)parent());
97void KGameErrorDialog::slotError(
int errorNo, TQString text)
99 TQString message = i18n(
"Received a network error!\nError number: %1\nError message: %2").arg(errorNo).arg(text);
100 error(message, (TQWidget*)parent());
107 message = i18n(
"No connection could be created.");
109 message = i18n(
"No connection could be created.\nThe error message was:\n%1").arg(s);
111 error(message, (TQWidget*)parent());
118KGameErrorMessageDialog::KGameErrorMessageDialog(TQWidget* parent)
119 : KDialogBase(Plain, i18n(
"Error"), Ok, Ok, parent, 0, true, true)
123KGameErrorMessageDialog::~KGameErrorMessageDialog()
129#include "kgameerrordialog.moc"
void slotClientConnectionLost(TQ_UINT32 clientID, bool broken)
The connection to a client has been lost by accident.
void slotServerConnectionLost()
The connection to the KMessageServer has been lost.
void connectionError(TQString s=TQString())
KGame couldn't establish a connection.
void slotUnsetKGame()
Unsets a KGame which has been set using setKGame before.
void setKGame(const KGame *g)
Automatically connects the KGame object to all error dependant slots.
The main KDE game object.