summaryrefslogtreecommitdiff
path: root/plugins/Dropbox/src/dropbox_events.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-11 16:39:06 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-11 16:39:06 +0000
commit6f7054d8f6c14e032a45a42555d4ab097fc82863 (patch)
tree1cc7d5ae2c4b77743982fa55578612ce27ce150e /plugins/Dropbox/src/dropbox_events.cpp
parentac73a9c3d9b5f72f4ee7c0d635daf47db3ef1d50 (diff)
- STL removed;
- code optimization and restructuring; - warning fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@13549 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/dropbox_events.cpp')
-rw-r--r--plugins/Dropbox/src/dropbox_events.cpp33
1 files changed, 15 insertions, 18 deletions
diff --git a/plugins/Dropbox/src/dropbox_events.cpp b/plugins/Dropbox/src/dropbox_events.cpp
index 1d2c2f53e9..a73844469b 100644
--- a/plugins/Dropbox/src/dropbox_events.cpp
+++ b/plugins/Dropbox/src/dropbox_events.cpp
@@ -118,22 +118,23 @@ int CDropbox::OnTabSrmmButtonPressed(void *obj, WPARAM, LPARAM lParam)
if (!strcmp(cbc->pszModule, MODULE) && cbc->dwButtonId == BBB_ID_FILE_SEND && cbc->hContact)
{
instance->hTransferContact = cbc->hContact;
+ instance->hTransferWindow = (HWND)CallService(MS_FILE_SENDFILE, instance->GetDefaultContact(), 0);
- HWND hwnd = (HWND)CallService(MS_FILE_SENDFILE, instance->GetDefaultContact(), 0);
-
- instance->dcftp[hwnd] = cbc->hContact;
-
- BBButton bbd = { sizeof(bbd) };
- bbd.pszModuleName = MODULE;
- bbd.dwButtonID = BBB_ID_FILE_SEND;
- bbd.bbbFlags = BBSF_DISABLED;
-
- CallService(MS_BB_SETBUTTONSTATE, cbc->hContact, (LPARAM)&bbd);
+ DisableSrmmButton(cbc->hContact);
}
return 0;
}
+void CDropbox::DisableSrmmButton(MCONTACT hContact)
+{
+ BBButton bbd = { sizeof(bbd) };
+ bbd.pszModuleName = MODULE;
+ bbd.dwButtonID = BBB_ID_FILE_SEND;
+ bbd.bbbFlags = BBSF_DISABLED;
+ CallService(MS_BB_SETBUTTONSTATE, hContact, (LPARAM)&bbd);
+}
+
void __stdcall EnableTabSrmmButtonAsync(void *arg)
{
BBButton bbd = { sizeof(bbd) };
@@ -141,7 +142,6 @@ void __stdcall EnableTabSrmmButtonAsync(void *arg)
bbd.dwButtonID = BBB_ID_FILE_SEND;
bbd.bbbFlags = BBSF_RELEASED;
MCONTACT hContact = (MCONTACT)arg;
-
CallService(MS_BB_SETBUTTONSTATE, hContact, (LPARAM)&bbd);
}
@@ -150,12 +150,10 @@ int CDropbox::OnFileDialogCancelled(void *obj, WPARAM, LPARAM lParam)
CDropbox *instance = (CDropbox*)obj;
HWND hwnd = (HWND)lParam;
- if (instance->hTransferContact == instance->dcftp[hwnd])
+ if (instance->hTransferWindow == hwnd)
{
CallFunctionAsync(EnableTabSrmmButtonAsync, (void*)instance->hTransferContact);
-
- instance->dcftp.erase((HWND)lParam);
- instance->hTransferContact = 0;
+ instance->hTransferWindow = 0;
}
return 0;
@@ -166,11 +164,10 @@ int CDropbox::OnFileDialogSuccessed(void *obj, WPARAM, LPARAM lParam)
CDropbox *instance = (CDropbox*)obj;
HWND hwnd = (HWND)lParam;
- if (instance->hTransferContact == instance->dcftp[hwnd])
+ if (instance->hTransferWindow == hwnd)
{
- instance->dcftp.erase((HWND)lParam);
-
CallFunctionAsync(EnableTabSrmmButtonAsync, (void*)instance->hTransferContact);
+ instance->hTransferWindow = 0;
}
return 0;