diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
commit | 007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (patch) | |
tree | b1ee30b70c6e36d1a06aed6885cb80dc560a68ca /plugins/SmileyAdd | |
parent | f4a1bbc6ba4b8137cb868639ac146aa97e97e9df (diff) |
- 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
Diffstat (limited to 'plugins/SmileyAdd')
-rw-r--r-- | plugins/SmileyAdd/src/general.h | 3 | ||||
-rw-r--r-- | plugins/SmileyAdd/src/main.cpp | 3 | ||||
-rw-r--r-- | plugins/SmileyAdd/src/options.cpp | 10 | ||||
-rw-r--r-- | plugins/SmileyAdd/src/services.cpp | 14 |
4 files changed, 14 insertions, 16 deletions
diff --git a/plugins/SmileyAdd/src/general.h b/plugins/SmileyAdd/src/general.h index 182d2007c3..cb268cdfc7 100644 --- a/plugins/SmileyAdd/src/general.h +++ b/plugins/SmileyAdd/src/general.h @@ -90,7 +90,8 @@ typedef WCMatcher _TMatcher; extern HINSTANCE g_hInst;
extern char* metaProtoName;
extern HANDLE hNetlibUser;
-extern HANDLE hEvent1, hContactMenuItem;
+extern HANDLE hEvent1;
+extern HGENMENU hContactMenuItem;
extern SmileyCategoryListType g_SmileyCategories;
extern SmileyPackListType g_SmileyPacks;
extern LIST<void> menuHandleArray;
diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp index b578227c0d..795760164f 100644 --- a/plugins/SmileyAdd/src/main.cpp +++ b/plugins/SmileyAdd/src/main.cpp @@ -21,7 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //globals
HINSTANCE g_hInst;
-HANDLE hEvent1, hContactMenuItem;
+HANDLE hEvent1;
+HGENMENU hContactMenuItem;
char* metaProtoName;
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index e6915189e6..191bb92c58 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -644,7 +644,7 @@ void OptionsType::ReadPackFileName(bkstring& filename, const bkstring& name, con void OptionsType::WritePackFileName(const bkstring& filename, const bkstring& name)
{
bkstring settingKey = name + _T("-filename");
- DBWriteContactSettingTString(NULL, "SmileyAdd", T2A_SM(settingKey.c_str()),
+ db_set_ts(NULL, "SmileyAdd", T2A_SM(settingKey.c_str()),
filename.c_str());
}
@@ -665,9 +665,9 @@ void OptionsType::ReadCustomCategories(bkstring& cats) void OptionsType::WriteCustomCategories(const bkstring& cats)
{
if (cats.empty())
- DBDeleteContactSetting(NULL, "SmileyAdd", "CustomCategories");
+ db_unset(NULL, "SmileyAdd", "CustomCategories");
else
- DBWriteContactSettingTString(NULL, "SmileyAdd", "CustomCategories", cats.c_str());
+ db_set_ts(NULL, "SmileyAdd", "CustomCategories", cats.c_str());
}
@@ -687,7 +687,7 @@ void OptionsType::ReadContactCategory(HANDLE hContact, bkstring& cats) void OptionsType::WriteContactCategory(HANDLE hContact, const bkstring& cats)
{
if (cats.empty())
- DBDeleteContactSetting(hContact, "SmileyAdd", "CustomCategory");
+ db_unset(hContact, "SmileyAdd", "CustomCategory");
else
- DBWriteContactSettingTString(hContact, "SmileyAdd", "CustomCategory", cats.c_str());
+ db_set_ts(hContact, "SmileyAdd", "CustomCategory", cats.c_str());
}
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index 64b8c71d06..30717b81c1 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -392,9 +392,6 @@ INT_PTR CustomCatMenu(WPARAM wParam, LPARAM lParam) int RebuildContactMenu(WPARAM wParam, LPARAM)
{
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS | CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB;
-
SmileyCategoryListType::SmileyCategoryVectorType& smc = *g_SmileyCategories.GetSmileyCategoryList();
char* protnam = GetContactProto((HANDLE)wParam);
@@ -406,9 +403,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) haveMenu = cnt != 0;
}
- if (!haveMenu) mi.flags |= CMIF_HIDDEN;
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenuItem, (LPARAM)&mi);
+ Menu_ShowItem(hContactMenuItem, haveMenu);
for (int i=0; i < menuHandleArray.getCount(); i++)
CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)menuHandleArray[i], 0);
@@ -418,9 +413,10 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) bkstring cat;
opt.ReadContactCategory((HANDLE)wParam, cat);
- mi.pszPopupName = (char*)hContactMenuItem;
- mi.flags = CMIF_CHILDPOPUP | CMIM_FLAGS | CMIF_TCHAR;
- mi.pszService = MS_SMILEYADD_CUSTOMCATMENU;
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.hParentMenu = hContactMenuItem;
+ mi.flags = CMIF_CHILDPOPUP | CMIM_FLAGS | CMIF_TCHAR;
+ mi.pszService = MS_SMILEYADD_CUSTOMCATMENU;
bool nonecheck = true;
HGENMENU hMenu;
|