summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_profile.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-09-02 19:26:26 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-09-02 19:26:26 +0000
commit56918868664203496199593189f67455dd4f8c38 (patch)
tree27d2a699ddcbe0edfc256b129d801734f7af1781 /protocols/Tox/src/tox_profile.cpp
parent22c79dbeea18dc46951445476976d8c634dd3c60 (diff)
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
Diffstat (limited to 'protocols/Tox/src/tox_profile.cpp')
-rw-r--r--protocols/Tox/src/tox_profile.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp
index 89f40d75e7..aea5492686 100644
--- a/protocols/Tox/src/tox_profile.cpp
+++ b/protocols/Tox/src/tox_profile.cpp
@@ -32,6 +32,7 @@ bool CToxProto::LoadToxProfile(Tox_Options *options)
FILE *profile = _tfopen(profilePath.c_str(), _T("rb"));
if (profile == NULL)
{
+ ShowNotification(TranslateT("Unable to open tox profile"), MB_ICONERROR);
debugLogA(__FUNCTION__": failed to open tox profile");
return false;
}
@@ -49,6 +50,7 @@ bool CToxProto::LoadToxProfile(Tox_Options *options)
if (fread((char*)data, sizeof(char), size, profile) != size)
{
fclose(profile);
+ ShowNotification(TranslateT("Unable to read tox profile"), MB_ICONERROR);
debugLogA(__FUNCTION__": failed to read tox profile");
mir_free(data);
return false;
@@ -71,7 +73,8 @@ bool CToxProto::LoadToxProfile(Tox_Options *options)
TOX_ERR_DECRYPTION coreDecryptError;
if (!tox_pass_decrypt(data, size, (uint8_t*)password, mir_strlen(password), encryptedData, &coreDecryptError))
{
- debugLogA(__FUNCTION__": failed to load tox profile (%d)", coreDecryptError);
+ ShowNotification(TranslateT("Unable to decrypt tox profile"), MB_ICONERROR);
+ debugLogA(__FUNCTION__": failed to decrypt tox profile (%d)", coreDecryptError);
mir_free(data);
return false;
}
@@ -92,6 +95,7 @@ bool CToxProto::LoadToxProfile(Tox_Options *options)
if (initError != TOX_ERR_NEW_OK)
{
debugLogA(__FUNCTION__": failed to load tox profile (%d)", initError);
+ ShowNotification(ToxErrorToString(initError), TranslateT("Unable to load tox profile"), MB_ICONERROR);
mir_free(data);
return false;
}