summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_options.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-08-17 17:26:18 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-08-17 17:26:18 +0000
commitbf23720e7c1d7de70d7d99167a42783f08ef8b17 (patch)
treeaa89f34bb46da1f7f66062d6f25a4ac2a103cb9b /protocols/Tox/src/tox_options.cpp
parenta9276f9db53affa2acbd8bc3f435285c1b838f87 (diff)
Tox:
- fixed tox id convertation - fixed tox profile load in first start - fixed polling thread git-svn-id: http://svn.miranda-ng.org/main/trunk@10215 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_options.cpp')
-rw-r--r--protocols/Tox/src/tox_options.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp
index 975a59a241..719d30cbc5 100644
--- a/protocols/Tox/src/tox_options.cpp
+++ b/protocols/Tox/src/tox_options.cpp
@@ -15,14 +15,8 @@ INT_PTR CALLBACK CToxProto::MainOptionsProc(HWND hwnd, UINT uMsg, WPARAM wParam,
ptrA username(proto->getStringA("Username"));
SetDlgItemTextA(hwnd, IDC_USERNAME, username);
- ptrA dataPath(proto->getStringA("DataPath"));
- if (!dataPath)
- {
- char defaultPath[MAX_PATH];
- mir_snprintf(defaultPath, MAX_PATH, "%s\\%s.tox", VARS("%miranda_userdata%"), _T2A(proto->m_tszUserName));
- dataPath = mir_strdup(defaultPath);
- }
- SetDlgItemTextA(hwnd, IDC_DATAPATH, dataPath);
+ std::string toxProfilePath = proto->GetToxProfilePath();
+ SetDlgItemTextA(hwnd, IDC_DATAPATH, toxProfilePath.c_str());
ptrW groupName(proto->getTStringA(TOX_SETTINGS_GROUP));
SetDlgItemText(hwnd, IDC_GROUP, groupName);
@@ -80,7 +74,7 @@ INT_PTR CALLBACK CToxProto::MainOptionsProc(HWND hwnd, UINT uMsg, WPARAM wParam,
ofn.hwndOwner = 0;
ofn.lpstrFilter = filter;
ofn.nFilterIndex = 1;
- ofn.lpstrFile = dataPath;
+ ofn.lpstrFile = strrchr(dataPath, '\\') + 1;
ofn.lpstrTitle = Translate("Select data file");
ofn.nMaxFile = SIZEOF(dataPath);
ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_EXPLORER | OFN_NOCHANGEDIR;