From 928158d25b533037df6ba4a1b1daedeefb05bbbb Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 4 Oct 2014 01:14:11 +0000 Subject: Tox: - tox id is key again - reworked tox profile logic git-svn-id: http://svn.miranda-ng.org/main/trunk@10679 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_accounts.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'protocols/Tox/src/tox_accounts.cpp') diff --git a/protocols/Tox/src/tox_accounts.cpp b/protocols/Tox/src/tox_accounts.cpp index 97b6f9b345..091923ccdf 100644 --- a/protocols/Tox/src/tox_accounts.cpp +++ b/protocols/Tox/src/tox_accounts.cpp @@ -9,6 +9,17 @@ int CToxProto::CompareAccounts(const CToxProto *p1, const CToxProto *p2) CToxProto* CToxProto::InitAccount(const char* protoName, const wchar_t* userName) { + ptrA address(db_get_sa(NULL, protoName, TOX_SETTINGS_ID)); + if (address == NULL) + { + DialogBoxParam( + g_hInstance, + MAKEINTRESOURCE(IDD_PROFILE_IMPORT), + GetActiveWindow(), + CToxProto::ToxProfileImportProc, + (LPARAM)userName); + } + CToxProto *ppro = new CToxProto(protoName, userName); accounts.insert(ppro); @@ -31,17 +42,6 @@ int CToxProto::OnAccountListChanged(WPARAM wParam, LPARAM lParam) { switch (wParam) { - case PRAC_ADDED: - DialogBoxParam( - g_hInstance, - MAKEINTRESOURCE(IDD_PROFILE_IMPORT), - account->hwndAccMgrUI, - CToxProto::ToxProfileManagerProc, - (LPARAM)this); - InitToxCore(); - SaveToxProfile(); - break; - case PRAC_CHANGED: std::tstring newPath = GetToxProfilePath(); TCHAR oldPath[MAX_PATH]; -- cgit v1.2.3