diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-04-23 08:16:58 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-04-23 08:16:58 +0000 |
commit | 36ac355b3009665069258c76f9ce8b7f7229ece9 (patch) | |
tree | 0d7f059ab35c0901b29bcdfb8a9417dc73a89192 /plugins/SimpleAR/src/Options.cpp | |
parent | 5b5cdb2ff09867ac166b8bc451432608859e68d5 (diff) |
fixed #322
git-svn-id: http://svn.miranda-ng.org/main/trunk@4510 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SimpleAR/src/Options.cpp')
-rw-r--r-- | plugins/SimpleAR/src/Options.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
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;
|