You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdegames/libksirtet/lib/defines.cpp

25 lines
631 B

#include "defines.h"
#include <klocale.h>
void errorBox(const TQString &msg1, const TQString &msg2, TQWidget *tqparent)
{
TQString str;
if ( msg2.isNull() ) str = msg1;
else str = i18n("%1:\n%2").tqarg(msg1).tqarg(msg2);
KMessageBox::error(tqparent, str);
}
TQString socketError(const KExtendedSocket *socket)
{
return KExtendedSocket::strError(socket->status(), socket->systemError());
}
bool checkSocket(int res, const KExtendedSocket *socket,
const TQString &msg, TQWidget *tqparent)
{
if ( res==0 ) return false;
errorBox(msg, socketError(socket), tqparent);
return true;
}