diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-22 20:38:56 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-22 20:38:56 +0000 |
commit | 88790eed4ffd9ca555c8f9b73cb014a93b57a34f (patch) | |
tree | b3e5bfe096005a9cac4bc14fdfbe5f6f5acad98a /plugins/New_GPG/src/utilities.cpp | |
parent | 9ecc2aa50e2183e2c4a11861ca6dede7d2151139 (diff) |
Menu_ModifyItem unbound from CLISTMENUITEM structure
git-svn-id: http://svn.miranda-ng.org/main/trunk@14334 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG/src/utilities.cpp')
-rwxr-xr-x | plugins/New_GPG/src/utilities.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 4c49c3eb4a..c28eff9c32 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -226,11 +226,8 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM l) void setClistIcon(MCONTACT hContact); setSrmmIcon(hContact); setClistIcon(hContact); - enc = enc?0:1; - CLISTMENUITEM mi = { 0 }; - mi.flags = CMIM_NAME; - enc?mi.pszName="Turn off GPG encryption":mi.pszName="Turn on GPG encryption"; - Menu_ModifyItem(hToggleEncryption, &mi); + + Menu_ModifyItem(hToggleEncryption, enc ? LPGENT("Turn off GPG encryption") : LPGENT("Turn on GPG encryption")); return 0; } @@ -259,22 +256,21 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM l) TCHAR buf[128] = {0}; mir_sntprintf(buf, _T("%s: %s"), TranslateT("Send public key"), toUTF16(keyid).c_str()); mir_free(keyid); - mi2.ptszName = buf; - mi2.flags = CMIM_NAME | CMIF_TCHAR; - Menu_ModifyItem(hSendKey, &mi2); + Menu_ModifyItem(hSendKey, buf); } - CLISTMENUITEM mi = { 0 }; - mi.flags = CMIM_NAME; + + int flags; TCHAR *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T("")); if(!tmp[0]) { db_unset(hContact, szGPGModuleName, "GPGEncryption"); - mi.flags += CMIM_FLAGS | CMIF_GRAYED; + flags = CMIF_GRAYED; } - else - mi.flags = CMIM_NAME | CMIM_FLAGS; - mi.pszName = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0)?"Turn off GPG encryption":"Turn on GPG encryption"; - Menu_ModifyItem(hToggleEncryption, &mi); + else flags = 0; + + Menu_ModifyItem(hToggleEncryption, + db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0) ? _T("Turn off GPG encryption") : _T("Turn on GPG encryption"), + INVALID_HANDLE_VALUE, flags); mir_free(tmp); return 0; } |