From 56918868664203496199593189f67455dd4f8c38 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Wed, 2 Sep 2015 19:26:26 +0000 Subject: Tox: - show error if profile loading failed - code cleaning - menus uid git-svn-id: http://svn.miranda-ng.org/main/trunk@15158 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_utils.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'protocols/Tox/src/tox_utils.cpp') diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp index b0f2b46b18..223d3b1b70 100644 --- a/protocols/Tox/src/tox_utils.cpp +++ b/protocols/Tox/src/tox_utils.cpp @@ -33,6 +33,33 @@ int CToxProto::ToxToMirandaStatus(TOX_USER_STATUS userstatus) return status; } +TCHAR* CToxProto::ToxErrorToString(TOX_ERR_NEW error) +{ + switch (error) + { + case TOX_ERR_NEW_NULL: + return TranslateT("One of the arguments is not valid or "); + case TOX_ERR_NEW_MALLOC: + return TranslateT("Unable to allocate enough memory"); + case TOX_ERR_NEW_PORT_ALLOC: + return TranslateT("Unable to bind to a port"); + case TOX_ERR_NEW_PROXY_BAD_TYPE: + return TranslateT("The proxy type is not valid"); + case TOX_ERR_NEW_PROXY_BAD_HOST: + return TranslateT("The proxy host is not valid"); + case TOX_ERR_NEW_PROXY_BAD_PORT: + return TranslateT("The proxy port is not valid"); + case TOX_ERR_NEW_PROXY_NOT_FOUND: + return TranslateT("The proxy address could not be resolved"); + case TOX_ERR_NEW_LOAD_ENCRYPTED: + return TranslateT("The profile is encrypted"); + case TOX_ERR_NEW_LOAD_BAD_FORMAT: + return TranslateT("The data format is not valid"); + default: + return TranslateT("Unknown error"); + } +} + void CToxProto::ShowNotification(const TCHAR *caption, const TCHAR *message, int flags, MCONTACT hContact) { if (Miranda_Terminated()) -- cgit v1.2.3