From 36ac355b3009665069258c76f9ce8b7f7229ece9 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Tue, 23 Apr 2013 08:16:58 +0000 Subject: fixed #322 git-svn-id: http://svn.miranda-ng.org/main/trunk@4510 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SimpleAR/src/Options.cpp | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'plugins/SimpleAR/src/Options.cpp') diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp index 41a0a5f1f0..59aa4587df 100644 --- a/plugins/SimpleAR/src/Options.cpp +++ b/plugins/SimpleAR/src/Options.cpp @@ -87,18 +87,21 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara { case PSN_APPLY: { - INT size; TCHAR ptszText[1024]; - char szStatus[6]={0}; BOOL translated; - fEnabled=IsDlgButtonChecked(hwndDlg,IDC_ENABLEREPLIER)==1; - db_set_b(NULL,protocolname,KEY_ENABLED,(BYTE)fEnabled); + BOOL fEnabled = IsDlgButtonChecked(hwndDlg, IDC_ENABLEREPLIER) == 1; + db_set_b(NULL, protocolname, KEY_ENABLED, (BYTE)fEnabled); + CLISTMENUITEM mi = { sizeof(mi) }; + mi.flags = CMIM_NAME | CMIM_ICON | CMIF_TCHAR; + mi.ptszName = fEnabled ? LPGENT("Disable Auto&reply") : LPGENT("Enable Auto&reply"); + mi.hIcon = fEnabled ? LoadIcon(hinstance, MAKEINTRESOURCE(IDI_ON)) : LoadIcon(hinstance, MAKEINTRESOURCE(IDI_OFF)); + Menu_ModifyItem(hEnableMenu, &mi); - GetDlgItemText(hwndDlg,IDC_HEADING,ptszText,SIZEOF(ptszText)); - db_set_ts(NULL,protocolname,KEY_HEADING,ptszText); + GetDlgItemText(hwndDlg, IDC_HEADING, ptszText, SIZEOF(ptszText)); + db_set_ts(NULL, protocolname, KEY_HEADING, ptszText); - size=GetDlgItemInt(hwndDlg,IDC_INTERVAL,&translated,FALSE); + INT size = GetDlgItemInt(hwndDlg, IDC_INTERVAL, &translated, FALSE); if (translated) interval=size*60; db_set_w(NULL,protocolname,KEY_REPEATINTERVAL,interval); @@ -112,14 +115,15 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara continue; else { - mir_snprintf(szStatus,SIZEOF(szStatus),"%d",c); - - if (c<40077 && ptszMessage[c-ID_STATUS_ONLINE-1]) - db_set_ts(NULL,protocolname,szStatus,ptszMessage[c-ID_STATUS_ONLINE-1]); - else if (c>40078 && ptszMessage[c-ID_STATUS_ONLINE-3]) - db_set_ts(NULL,protocolname,szStatus,ptszMessage[c-ID_STATUS_ONLINE-3]); - else - db_unset(NULL,protocolname,szStatus); + char szStatus[6] = {0}; + mir_snprintf(szStatus, SIZEOF(szStatus), "%d", c); + + if (c<40077 && ptszMessage[c-ID_STATUS_ONLINE-1]) + db_set_ts(NULL,protocolname,szStatus,ptszMessage[c-ID_STATUS_ONLINE-1]); + else if (c>40078 && ptszMessage[c-ID_STATUS_ONLINE-3]) + db_set_ts(NULL,protocolname,szStatus,ptszMessage[c-ID_STATUS_ONLINE-3]); + else + db_unset(NULL,protocolname,szStatus); } } return TRUE; -- cgit v1.2.3