diff options
Diffstat (limited to 'src/sq_errorstring.cpp')
| -rw-r--r-- | src/sq_errorstring.cpp | 58 | 
1 files changed, 58 insertions, 0 deletions
| diff --git a/src/sq_errorstring.cpp b/src/sq_errorstring.cpp new file mode 100644 index 0000000..f762ee3 --- /dev/null +++ b/src/sq_errorstring.cpp @@ -0,0 +1,58 @@ +/*************************************************************************** +                          sq_errorstring.cpp  -  description +                             ------------------- +    begin                : ??? ??? 26 2005 +    copyright            : (C) 2005 by Baryshev Dmitry +    email                : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + *                                                                         * + *   This program is free software; you can redistribute it and/or modify  * + *   it under the terms of the GNU General Public License as published by  * + *   the Free Software Foundation; either version 2 of the License, or     * + *   (at your option) any later version.                                   * + *                                                                         * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sq_errorstring.h" + +#include <ksquirrel-libs/error.h> + +SQ_ErrorString * SQ_ErrorString::m_instance = 0; + +SQ_ErrorString::SQ_ErrorString(TQObject *parent) : TQObject(parent) +{ +    m_instance = this; + +    // fill map with translated messages +    messages.insert(SQE_OK,             TQString::fromLatin1("OK")); +    messages.insert(SQE_R_NOFILE,       i18n("cannot open file for reading")); +    messages.insert(SQE_R_BADFILE,      i18n("file corrupted")); +    messages.insert(SQE_R_NOMEMORY,     i18n("no memory")); +    messages.insert(SQE_R_NOTSUPPORTED, i18n("file type not supported")); +    messages.insert(SQE_R_WRONGDIM,     i18n("wrong image dimensions")); +    messages.insert(SQE_W_NOFILE,       i18n("cannot open file for writing")); +    messages.insert(SQE_W_NOTSUPPORTED, i18n("write feature is not supported")); +    messages.insert(SQE_W_ERROR,        i18n("write error (check free space)")); +    messages.insert(SQE_W_WRONGPARAMS,  i18n("wrong parameters")); +    messages.insert(SQE_NOTFINISHED,    i18n("Editing process is not finished yet")); +} + +SQ_ErrorString::~SQ_ErrorString() +{} + +// Get string by error code. +TQString SQ_ErrorString::string(const int code) +{ +    return messages[code]; +} + +TQString SQ_ErrorString::stringSN(const int code) +{ +    return messages[code] + '\n'; +} | 
