diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-09-05 07:29:15 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-09-05 07:29:15 +0000 |
commit | be1bd05cee00200ae16000abfb5c690261ea3420 (patch) | |
tree | 051d32ea0cd0a14e794c2c625013b78394f0b1f0 /plugins/YAMN/src | |
parent | 8527a46feb7089912c124a9d797be14fcc429545 (diff) |
YAMN:
- Fixed: "No Mail" popups were using "Mail" popup colors after r15160
- minor cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@15247 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/YAMN/src')
-rw-r--r-- | plugins/YAMN/src/browser/badconnect.cpp | 7 | ||||
-rw-r--r-- | plugins/YAMN/src/browser/mailbrowser.cpp | 49 | ||||
-rw-r--r-- | plugins/YAMN/src/main.cpp | 4 | ||||
-rw-r--r-- | plugins/YAMN/src/yamn.cpp | 19 |
4 files changed, 36 insertions, 43 deletions
diff --git a/plugins/YAMN/src/browser/badconnect.cpp b/plugins/YAMN/src/browser/badconnect.cpp index d4d0c8948b..1285571205 100644 --- a/plugins/YAMN/src/browser/badconnect.cpp +++ b/plugins/YAMN/src/browser/badconnect.cpp @@ -56,7 +56,7 @@ LRESULT CALLBACK BadConnectPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM else
DebugLog(SynchroFile,"PopupProc:LEFTCLICK:ActualAccountSO-read enter failed\n");
#endif
- SendMessage(hWnd, UM_DESTROYPOPUP, 0, 0);
+ PUDeletePopup(hWnd);
}
break;
@@ -68,7 +68,7 @@ LRESULT CALLBACK BadConnectPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM //This is the equivalent to WM_INITDIALOG you'd get if you were the maker of dialog popups.
break;
case WM_CONTEXTMENU:
- SendMessage(hWnd, UM_DESTROYPOPUP, 0, 0);
+ PUDeletePopup(hWnd);
break;
}
return DefWindowProc(hWnd, msg, wParam, lParam);
@@ -216,13 +216,12 @@ void __cdecl BadConnection(void *Param) MSG msg;
HWND hBadConnect;
HACCOUNT ActualAccount;
- struct BadConnectionParam MyParam;
NOTIFYICONDATA nid;
char *NotIconText = Translate(" - connection error"), *src;
TCHAR *dest;
int i;
- MyParam = *(struct BadConnectionParam *)Param;
+ struct BadConnectionParam MyParam = *(struct BadConnectionParam *)Param;
ActualAccount = MyParam.account;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"BadConnect:Incrementing \"using threads\" %x (account %x)\n",ActualAccount->UsingThreads,ActualAccount);
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index 0ca78c18eb..ea390d7cd8 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -765,8 +765,8 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D NoNewMailPopup.lchContact = (ActualAccount->hContact != NULL) ? ActualAccount->hContact : (UINT_PTR)ActualAccount; NoNewMailPopup.lchIcon = g_LoadIconEx(1); if (nflags & YAMN_ACC_POPC) { - NoNewMailPopup.colorBack = ActualAccount->NewMailN.PopupB; - NoNewMailPopup.colorText = ActualAccount->NewMailN.PopupT; + NoNewMailPopup.colorBack = ActualAccount->NoNewMailN.PopupB; + NoNewMailPopup.colorText = ActualAccount->NoNewMailN.PopupT; } else { NoNewMailPopup.colorBack = GetSysColor(COLOR_BTNFACE); @@ -872,7 +872,7 @@ LRESULT CALLBACK NewMailPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa } // fall through case WM_CONTEXTMENU: - SendMessage(hWnd, UM_DESTROYPOPUP, 0, 0); + PUDeletePopup(hWnd); break; case UM_FREEPLUGINDATA: { @@ -961,12 +961,12 @@ LRESULT CALLBACK NoNewMailPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l else DebugLog(SynchroFile, "PopupProc:LEFTCLICK:ActualAccountSO-read enter failed\n"); #endif - SendMessage(hWnd, UM_DESTROYPOPUP, 0, 0); + PUDeletePopup(hWnd); } break; case WM_CONTEXTMENU: - SendMessage(hWnd, UM_DESTROYPOPUP, 0, 0); + PUDeletePopup(hWnd); break; case UM_FREEPLUGINDATA: @@ -1299,8 +1299,8 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR iValueW = new WCHAR[StrLen + 1]; MultiByteToWideChar(CP_ACP, MB_USEGLYPHCHARS, Translate("Value"), -1, iValueW, StrLen); - LVCOLUMNW lvc0 = { LVCF_FMT | LVCF_TEXT | LVCF_WIDTH, LVCFMT_LEFT, 130, iHeaderW, 0, 0 }; - LVCOLUMNW lvc1 = { LVCF_FMT | LVCF_TEXT | LVCF_WIDTH, LVCFMT_LEFT, 400, iValueW, 0, 0 }; + LVCOLUMN lvc0 = { LVCF_FMT | LVCF_TEXT | LVCF_WIDTH, LVCFMT_LEFT, 130, iHeaderW, 0, 0 }; + LVCOLUMN lvc1 = { LVCF_FMT | LVCF_TEXT | LVCF_WIDTH, LVCFMT_LEFT, 400, iValueW, 0, 0 }; SendMessage(hListView, LVM_INSERTCOLUMN, 0, (LPARAM)&lvc0); SendMessage(hListView, LVM_INSERTCOLUMN, 1, (LPARAM)&lvc1); if (NULL != iHeaderW) @@ -1439,8 +1439,8 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR else { if (MailParam->mail->Flags & YAMN_MSG_UNSEEN) { MailParam->mail->Flags &= ~YAMN_MSG_UNSEEN; //mark the message as seen - HWND hMailBrowser; - if (hMailBrowser = WindowList_Find(YAMNVar.NewMailAccountWnd, (UINT_PTR)MailParam->account)) { + HWND hMailBrowser = WindowList_Find(YAMNVar.NewMailAccountWnd, (UINT_PTR)MailParam->account); + if (hMailBrowser) { struct CChangeContent Params = { MailParam->account->NewMailN.Flags | YAMN_ACC_MSGP, MailParam->account->NoNewMailN.Flags | YAMN_ACC_MSGP }; SendMessage(hMailBrowser, WM_YAMN_CHANGECONTENT, (WPARAM)MailParam->account, (LPARAM)&Params); } @@ -1684,10 +1684,10 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR SetDlgItemText(hDlg, IDC_BTNCHECKALL, TranslateT("Select All")); SetDlgItemText(hDlg, IDC_BTNOK, TranslateT("OK")); - LVCOLUMNW lvc0 = { LVCF_FMT | LVCF_TEXT | LVCF_WIDTH, LVCFMT_LEFT, FromWidth, TranslateT("From"), 0, 0 }; - LVCOLUMNW lvc1 = { LVCF_FMT | LVCF_TEXT | LVCF_WIDTH, LVCFMT_LEFT, SubjectWidth, TranslateT("Subject"), 0, 0 }; - LVCOLUMNW lvc2 = { LVCF_FMT | LVCF_TEXT | LVCF_WIDTH, LVCFMT_LEFT, SizeWidth, TranslateT("Size"), 0, 0 }; - LVCOLUMNW lvc3 = { LVCF_FMT | LVCF_TEXT | LVCF_WIDTH, LVCFMT_LEFT, SizeDate, TranslateT("Date"), 0, 0 }; + LVCOLUMN lvc0 = { LVCF_FMT | LVCF_TEXT | LVCF_WIDTH, LVCFMT_LEFT, FromWidth, TranslateT("From"), 0, 0 }; + LVCOLUMN lvc1 = { LVCF_FMT | LVCF_TEXT | LVCF_WIDTH, LVCFMT_LEFT, SubjectWidth, TranslateT("Subject"), 0, 0 }; + LVCOLUMN lvc2 = { LVCF_FMT | LVCF_TEXT | LVCF_WIDTH, LVCFMT_LEFT, SizeWidth, TranslateT("Size"), 0, 0 }; + LVCOLUMN lvc3 = { LVCF_FMT | LVCF_TEXT | LVCF_WIDTH, LVCFMT_LEFT, SizeDate, TranslateT("Date"), 0, 0 }; SendDlgItemMessage(hDlg, IDC_LISTMAILS, LVM_INSERTCOLUMN, 0, (LPARAM)&lvc0); SendDlgItemMessage(hDlg, IDC_LISTMAILS, LVM_INSERTCOLUMN, 1, (LPARAM)&lvc1); SendDlgItemMessage(hDlg, IDC_LISTMAILS, LVM_INSERTCOLUMN, (WPARAM)2, (LPARAM)&lvc2); @@ -1720,7 +1720,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR case WM_DESTROY: { RECT coord; - LVCOLUMNW ColInfo; + LVCOLUMN ColInfo; HYAMNMAIL Parser; struct CMailWinUserInfo *mwui = (struct CMailWinUserInfo *)GetWindowLongPtr(hDlg, DWLP_USER); @@ -2292,8 +2292,8 @@ LRESULT CALLBACK ListViewSubclassProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM switch (msg) { case WM_GETDLGCODE: { - LPMSG lpmsg; - if ((lpmsg = (LPMSG)lParam) != NULL) { + LPMSG lpmsg = (LPMSG)lParam; + if (lpmsg != NULL) { if (lpmsg->message == WM_KEYDOWN && lpmsg->wParam == VK_RETURN) return DLGC_WANTALLKEYS; @@ -2331,11 +2331,9 @@ void __cdecl MailBrowser(void *Param) HWND hMailBrowser; BOOL WndFound = FALSE; - HACCOUNT ActualAccount; - struct MailBrowserWinParam MyParam; - MyParam = *(struct MailBrowserWinParam *)Param; - ActualAccount = MyParam.account; + struct MailBrowserWinParam MyParam = *(struct MailBrowserWinParam *)Param; + HACCOUNT ActualAccount = MyParam.account; SCIncFcn(ActualAccount->UsingThreads); // we will not use params in stack anymore @@ -2391,18 +2389,17 @@ void __cdecl MailBrowser(void *Param) INT_PTR RunMailBrowserSvc(WPARAM wParam, LPARAM lParam) { - //an event for successfull copy parameters to which point a pointer in stack for new thread - HANDLE ThreadRunningEV; PYAMN_MAILBROWSERPARAM Param = (PYAMN_MAILBROWSERPARAM)wParam; if ((DWORD)lParam != YAMN_MAILBROWSERVERSION) return 0; - if (NULL != (ThreadRunningEV = CreateEvent(NULL, FALSE, FALSE, NULL))) { - HANDLE NewThread; - + //an event for successfull copy parameters to which point a pointer in stack for new thread + HANDLE ThreadRunningEV = CreateEvent(NULL, FALSE, FALSE, NULL); + if (ThreadRunningEV != NULL) { Param->ThreadRunningEV = ThreadRunningEV; - if (NULL != (NewThread = mir_forkthread(MailBrowser, (void*)Param))) { + HANDLE NewThread = mir_forkthread(MailBrowser, Param); + if (NewThread != NULL) { WaitForSingleObject(ThreadRunningEV, INFINITE); CloseHandle(NewThread); } diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index bfca36fa74..56534ed10c 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -237,13 +237,13 @@ static void LoadPlugins() continue; } - if (!(*LoadFilter)(GetFcnPtrSvc)) { + if (!LoadFilter(GetFcnPtrSvc)) { FreeLibrary(hDll); hDll = NULL; } if (hDll != NULL) { - hDllPlugins = (HINSTANCE *)realloc((void *)hDllPlugins, (iDllPlugins+1)*sizeof(HINSTANCE)); + hDllPlugins = (HINSTANCE *)realloc(hDllPlugins, (iDllPlugins+1)*sizeof(HINSTANCE)); hDllPlugins[iDllPlugins++] = hDll; } } diff --git a/plugins/YAMN/src/yamn.cpp b/plugins/YAMN/src/yamn.cpp index f68e4068ae..006c15643c 100644 --- a/plugins/YAMN/src/yamn.cpp +++ b/plugins/YAMN/src/yamn.cpp @@ -96,13 +96,12 @@ INT_PTR GetVariablesSvc(WPARAM wParam, LPARAM) void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
{
- PYAMN_PROTOPLUGINQUEUE ActualPlugin;
HACCOUNT ActualAccount;
- HANDLE ThreadRunningEV;
DWORD Status, tid;
// we use event to signal, that running thread has all needed stack parameters copied
- if (NULL==(ThreadRunningEV=CreateEvent(NULL, FALSE, FALSE, NULL)))
+ HANDLE ThreadRunningEV = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (ThreadRunningEV == NULL)
return;
// if we want to close miranda, we get event and do not run checking anymore
if (WAIT_OBJECT_0==WaitForSingleObject(ExitEV, 0))
@@ -111,7 +110,7 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) Status=CallService(MS_CLIST_GETSTATUSMODE, 0, 0);
EnterCriticalSection(&PluginRegCS);
- for (ActualPlugin=FirstProtoPlugin;ActualPlugin != NULL;ActualPlugin=ActualPlugin->Next)
+ for (PYAMN_PROTOPLUGINQUEUE ActualPlugin=FirstProtoPlugin;ActualPlugin != NULL;ActualPlugin=ActualPlugin->Next)
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "TimerProc:AccountBrowserSO-read wait\n");
@@ -210,10 +209,10 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) if (!ActualAccount->TimeLeft)
{
struct CheckParam ParamToPlugin={YAMN_CHECKVERSION, ThreadRunningEV, ActualAccount, YAMN_NORMALCHECK, (void *)0, NULL};
- HANDLE NewThread;
ActualAccount->TimeLeft=ActualAccount->Interval;
- if (NULL==(NewThread=CreateThread(NULL, 0, (YAMN_STANDARDFCN)ActualAccount->Plugin->Fcn->TimeoutFcnPtr, &ParamToPlugin, 0, &tid)))
+ HANDLE NewThread = CreateThread(NULL, 0, (YAMN_STANDARDFCN)ActualAccount->Plugin->Fcn->TimeoutFcnPtr, &ParamToPlugin, 0, &tid);
+ if (NewThread == NULL)
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read done\n");
@@ -252,24 +251,22 @@ ChangeIsCountingStatusLabel: }
LeaveCriticalSection(&PluginRegCS);
CloseHandle(ThreadRunningEV);
- return;
}
INT_PTR ForceCheckSvc(WPARAM, LPARAM)
{
- PYAMN_PROTOPLUGINQUEUE ActualPlugin;
HACCOUNT ActualAccount;
- HANDLE ThreadRunningEV;
DWORD tid;
//we use event to signal, that running thread has all needed stack parameters copied
- if (NULL==(ThreadRunningEV=CreateEvent(NULL, FALSE, FALSE, NULL)))
+ HANDLE ThreadRunningEV = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (ThreadRunningEV == NULL)
return 0;
//if we want to close miranda, we get event and do not run pop3 checking anymore
if (WAIT_OBJECT_0==WaitForSingleObject(ExitEV, 0))
return 0;
EnterCriticalSection(&PluginRegCS);
- for (ActualPlugin=FirstProtoPlugin;ActualPlugin != NULL;ActualPlugin=ActualPlugin->Next)
+ for (PYAMN_PROTOPLUGINQUEUE ActualPlugin = FirstProtoPlugin; ActualPlugin != NULL; ActualPlugin=ActualPlugin->Next)
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "ForceCheck:AccountBrowserSO-read wait\n");
|