diff options
author | George Hazan <george.hazan@gmail.com> | 2014-08-29 18:56:24 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-08-29 18:56:24 +0000 |
commit | d49df717ef089662383a271b45937aafda6399d8 (patch) | |
tree | cd8b8a9909209de93d6fc2bc8bc4ebd5bdef1f24 /src/core | |
parent | 38200b7236c5c290d75a36cb431c78beeb98dbbd (diff) |
PF4_SINGLEFILEONLY - protocol can require sending files only one by one
git-svn-id: http://svn.miranda-ng.org/main/trunk@10337 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/stdfile/filesenddlg.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/core/stdfile/filesenddlg.cpp b/src/core/stdfile/filesenddlg.cpp index 7a9fc85a4c..2772e9503c 100644 --- a/src/core/stdfile/filesenddlg.cpp +++ b/src/core/stdfile/filesenddlg.cpp @@ -138,26 +138,34 @@ static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf) void __cdecl ChooseFilesThread(void* param)
{
HWND hwndDlg = (HWND)param;
- TCHAR filter[128], *pfilter;
- TCHAR *buf = (TCHAR*)mir_alloc(sizeof(TCHAR)* 32767);
+ FileDlgData *dat = (FileDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+
+ TCHAR *buf = (TCHAR*)mir_alloc(sizeof(TCHAR) * 32767);
if (buf == NULL) {
PostMessage(hwndDlg, M_FILECHOOSEDONE, 0, (LPARAM)(TCHAR*)NULL);
return;
}
- OPENFILENAME ofn = { 0 };
- ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- ofn.hwndOwner = hwndDlg;
+ TCHAR filter[128];
lstrcpy(filter, TranslateT("All files"));
lstrcat(filter, _T(" (*)"));
- pfilter = filter + lstrlen(filter) + 1;
+ TCHAR *pfilter = filter + lstrlen(filter) + 1;
lstrcpy(pfilter, _T("*"));
pfilter = filter + lstrlen(filter) + 1;
pfilter[0] = '\0';
+
+ OPENFILENAME ofn = { 0 };
+ ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
+ ofn.hwndOwner = hwndDlg;
ofn.lpstrFilter = filter;
ofn.lpstrFile = buf; *buf = 0;
ofn.nMaxFile = 32767;
- ofn.Flags = OFN_NOCHANGEDIR | OFN_FILEMUSTEXIST | OFN_ALLOWMULTISELECT | OFN_EXPLORER | OFN_HIDEREADONLY | OFN_DONTADDTORECENT;
+ ofn.Flags = OFN_NOCHANGEDIR | OFN_FILEMUSTEXIST | OFN_EXPLORER | OFN_HIDEREADONLY | OFN_DONTADDTORECENT;
+
+ char *szProto = GetContactProto(dat->hContact);
+ if (!(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_SINGLEFILEONLY))
+ ofn.Flags |= OFN_ALLOWMULTISELECT;
+
if (GetOpenFileName(&ofn))
PostMessage(hwndDlg, M_FILECHOOSEDONE, 0, (LPARAM)buf);
else {
|