From 007b4c7301f0d26a72f89f74e9929f42e24eb3e6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 5 Apr 2013 22:27:16 +0000 Subject: - rest of menus cleared; - old database macroses wiped out from all plugins (left in m_database.h for compatibility) git-svn-id: http://svn.miranda-ng.org/main/trunk@4324 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/UserInfoEx/src/Flags/svc_flags.cpp | 4 ++-- plugins/UserInfoEx/src/svc_avatar.cpp | 2 +- plugins/UserInfoEx/src/svc_email.cpp | 13 +++---------- plugins/UserInfoEx/src/svc_homepage.cpp | 18 ++++-------------- 4 files changed, 10 insertions(+), 27 deletions(-) (limited to 'plugins/UserInfoEx') diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp index 7f068b1e00..ced26a1b07 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp @@ -207,8 +207,8 @@ static INT_PTR ServiceDetectContactOriginCountry(WPARAM wParam,LPARAM lParam) else if (countryNumber = (int)DB::Setting::GetWord((HANDLE)wParam,pszProto,"CompanyCountry",0)) return (INT_PTR)countryNumber; /* fallback ip detect - else if(countryNumber==0xFFFF && DBGetContactSettingByte(NULL,"Flags","UseIpToCountry",SETTING_USEIPTOCOUNTRY_DEFAULT)) { - countryNumber=ServiceIpToCountry(DBGetContactSettingDword((HANDLE)wParam,pszProto,"RealIP",0),0); + else if(countryNumber==0xFFFF && db_get_b(NULL,"Flags","UseIpToCountry",SETTING_USEIPTOCOUNTRY_DEFAULT)) { + countryNumber=ServiceIpToCountry(db_get_dw((HANDLE)wParam,pszProto,"RealIP",0),0); }*/ return (INT_PTR)0xFFFF; diff --git a/plugins/UserInfoEx/src/svc_avatar.cpp b/plugins/UserInfoEx/src/svc_avatar.cpp index c82965f96c..cdf94288cc 100644 --- a/plugins/UserInfoEx/src/svc_avatar.cpp +++ b/plugins/UserInfoEx/src/svc_avatar.cpp @@ -186,7 +186,7 @@ namespace NServices } // the absolute file is valid - if (bInvalidAvatar && !DBGetContactSetting(hContact, "ContactPhoto", "File", &dbv)) + if (bInvalidAvatar && !db_get(hContact, "ContactPhoto", "File", &dbv)) { FILE *f = fopen(dbv.pszVal, "rb"); if (f) { diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp index b0d5b382ec..105d7f2c68 100644 --- a/plugins/UserInfoEx/src/svc_email.cpp +++ b/plugins/UserInfoEx/src/svc_email.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h" -static HANDLE ghMenuItem = NULL; +static HGENMENU ghMenuItem = NULL; static HANDLE ghExtraIconDef = INVALID_HANDLE_VALUE; static HANDLE ghExtraIconSvc = INVALID_HANDLE_VALUE; @@ -172,16 +172,9 @@ static int OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw **/ static int OnPreBuildMenu(WPARAM wParam, LPARAM lParam) { - CLISTMENUITEM mi = { sizeof(mi) }; - mi.flags = CMIM_FLAGS; - LPSTR val = Get((HANDLE)wParam); - if (val) - mir_free(val); - else - mi.flags = CMIM_FLAGS | CMIF_HIDDEN; - - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)ghMenuItem, (LPARAM)&mi); + Menu_ShowItem(ghMenuItem, val != NULL); + mir_free(val); return 0; } diff --git a/plugins/UserInfoEx/src/svc_homepage.cpp b/plugins/UserInfoEx/src/svc_homepage.cpp index 5e8aeddc73..9ed2639af1 100644 --- a/plugins/UserInfoEx/src/svc_homepage.cpp +++ b/plugins/UserInfoEx/src/svc_homepage.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h" -static HANDLE ghMenuItem = NULL; +static HGENMENU ghMenuItem = NULL; static HANDLE ghExtraIconDef = INVALID_HANDLE_VALUE; static HANDLE ghExtraIconSvc = INVALID_HANDLE_VALUE; @@ -134,19 +134,9 @@ static int OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw **/ static int OnPreBuildMenu(WPARAM wParam, LPARAM lParam) { - LPSTR val; - - CLISTMENUITEM mi = { sizeof(mi) }; - mi.flags = CMIM_FLAGS; - - val = Get((HANDLE)wParam); - if (val) - { - MIR_FREE(val); - } - else mi.flags = CMIM_FLAGS | CMIF_HIDDEN; - - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)ghMenuItem, (LPARAM)&mi); + LPSTR val = Get((HANDLE)wParam); + Menu_ShowItem(ghMenuItem, val != 0); + mir_free(val); return 0; } -- cgit v1.2.3