diff options
author | George Hazan <george.hazan@gmail.com> | 2016-02-19 12:05:55 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-02-19 12:05:55 +0000 |
commit | 5b796cb19202cbd63634ff68bda89520a5efc0c3 (patch) | |
tree | d06195813c1c422bea0c673e6e58f098b2d739eb /plugins/YAMN/src/browser/badconnect.cpp | |
parent | a886e1caf3d3d563b43aaa230144b3e8f40a3d4e (diff) |
YAMN:
- incorrect Unicode processing fixed;
- critical sections removed;
- translation fix;
- code cleaning;
git-svn-id: http://svn.miranda-ng.org/main/trunk@16308 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/YAMN/src/browser/badconnect.cpp')
-rw-r--r-- | plugins/YAMN/src/browser/badconnect.cpp | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/plugins/YAMN/src/browser/badconnect.cpp b/plugins/YAMN/src/browser/badconnect.cpp index 1285571205..69274be795 100644 --- a/plugins/YAMN/src/browser/badconnect.cpp +++ b/plugins/YAMN/src/browser/badconnect.cpp @@ -216,10 +216,6 @@ void __cdecl BadConnection(void *Param) MSG msg;
HWND hBadConnect;
HACCOUNT ActualAccount;
- NOTIFYICONDATA nid;
- char *NotIconText = Translate(" - connection error"), *src;
- TCHAR *dest;
- int i;
struct BadConnectionParam MyParam = *(struct BadConnectionParam *)Param;
ActualAccount = MyParam.account;
@@ -237,19 +233,10 @@ void __cdecl BadConnection(void *Param) SendMessage(hBadConnect, WM_SETICON, ICON_BIG, (LPARAM)g_LoadIconEx(3));
SendMessage(hBadConnect, WM_SETICON, ICON_SMALL, (LPARAM)g_LoadIconEx(3));
- memset(&nid, 0, sizeof(nid));
- nid.cbSize = sizeof(NOTIFYICONDATA);
- nid.hWnd = hBadConnect;
- nid.hIcon = g_LoadIconEx(3);
- nid.uID = 0;
- nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
- nid.uCallbackMessage = WM_YAMN_NOTIFYICON;
-
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"BadConnect:ActualAccountSO-read wait\n");
#endif
- if (WAIT_OBJECT_0 != WaitToReadFcn(ActualAccount->AccountAccessSO))
- {
+ if (WAIT_OBJECT_0 != WaitToReadFcn(ActualAccount->AccountAccessSO)) {
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"BadConnect:ActualAccountSO-read wait failed\n");
#endif
@@ -258,16 +245,23 @@ void __cdecl BadConnection(void *Param) #ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"BadConnect:ActualAccountSO-read enter\n");
#endif
- for (src = ActualAccount->Name, dest = nid.szTip, i = 0; (*src != (TCHAR)0) && (i + 1 < sizeof(nid.szTip)); *dest++ = *src++);
- for (src = NotIconText; (*src != (TCHAR)0) && (i + 1 < sizeof(nid.szTip)); *dest++ = *src++);
- *dest = (TCHAR)0;
-
if (ActualAccount->BadConnectN.Flags & YAMN_ACC_SND)
CallService(MS_SKIN_PLAYSOUND, 0, (LPARAM)YAMN_CONNECTFAILSOUND);
+
if (ActualAccount->BadConnectN.Flags & YAMN_ACC_MSG)
ShowWindow(hBadConnect, SW_SHOWNORMAL);
- if (ActualAccount->BadConnectN.Flags & YAMN_ACC_ICO)
+
+ if (ActualAccount->BadConnectN.Flags & YAMN_ACC_ICO) {
+ NOTIFYICONDATA nid = {};
+ nid.cbSize = sizeof(nid);
+ nid.hWnd = hBadConnect;
+ nid.hIcon = g_LoadIconEx(3);
+ nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
+ nid.uCallbackMessage = WM_YAMN_NOTIFYICON;
+ mir_sntprintf(nid.szTip, _T("%S%s"), ActualAccount->Name, TranslateT(" - connection error")); Shell_NotifyIcon(NIM_ADD, &nid);
+ }
+
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"BadConnect:ActualAccountSO-read done\n");
#endif
|