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/PasteIt/src | |
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/PasteIt/src')
-rw-r--r-- | plugins/PasteIt/src/Options.cpp | 56 | ||||
-rw-r--r-- | plugins/PasteIt/src/PasteIt.cpp | 19 |
2 files changed, 33 insertions, 42 deletions
diff --git a/plugins/PasteIt/src/Options.cpp b/plugins/PasteIt/src/Options.cpp index 6fc6439e40..a5c4fb5359 100644 --- a/plugins/PasteIt/src/Options.cpp +++ b/plugins/PasteIt/src/Options.cpp @@ -708,7 +708,7 @@ unsigned int Options::GetCodepageCB(HWND hwndCB, bool errorReport, unsigned int void Options::SetDefWeb(int web)
{
defWeb = web;
- DBWriteContactSettingWString(0, MODULE, "defWeb", pasteToWebs[web]->GetName());
+ db_set_ws(0, MODULE, "defWeb", pasteToWebs[web]->GetName());
DefWebPageChanged();
}
@@ -785,11 +785,11 @@ int Options::InitOptions(WPARAM wParam, LPARAM lParam) void Options::Save()
{
- DBWriteContactSettingWString(0, MODULE, "defWeb", pasteToWebs[defWeb]->GetName());
- DBWriteContactSettingDword(0, MODULE, "codepage", codepage);
- DBWriteContactSettingByte(0, MODULE, "autoUTF", autoUTF ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "confDlg", confDlg ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "autoSend", autoSend ? 1 : 0);
+ db_set_ws(0, MODULE, "defWeb", pasteToWebs[defWeb]->GetName());
+ db_set_dw(0, MODULE, "codepage", codepage);
+ db_set_b(0, MODULE, "autoUTF", autoUTF ? 1 : 0);
+ db_set_b(0, MODULE, "confDlg", confDlg ? 1 : 0);
+ db_set_b(0, MODULE, "autoSend", autoSend ? 1 : 0);
for(int i = 0 ; i < PasteToWeb::pages; ++i)
{
char buf[256];
@@ -809,33 +809,33 @@ void Options::Save() forms += it->id + L'=' + it->name + L';';
}
- DBWriteContactSettingWString(0, MODULE, buf, forms.c_str());
+ db_set_ws(0, MODULE, buf, forms.c_str());
strcpy_s(buf + j, 256 - j, "defFormatId");
- DBWriteContactSettingWString(0, MODULE, buf, webOptions[i]->defFormatId.c_str());
+ db_set_ws(0, MODULE, buf, webOptions[i]->defFormatId.c_str());
if(webOptions[i]->isSendFileName)
{
strcpy_s(buf + j, 256 - j, "sendFileName");
- DBWriteContactSettingByte(0, MODULE, buf, webOptions[i]->sendFileName ? 1 : 0);
+ db_set_b(0, MODULE, buf, webOptions[i]->sendFileName ? 1 : 0);
}
if(webOptions[i]->isPublicPaste)
{
strcpy_s(buf + j, 256 - j, "publicPaste");
- DBWriteContactSettingByte(0, MODULE, buf, webOptions[i]->publicPaste ? 1 : 0);
+ db_set_b(0, MODULE, buf, webOptions[i]->publicPaste ? 1 : 0);
}
if(webOptions[i]->isCombo1)
{
strcpy_s(buf + j, 256 - j, "combo1");
- DBWriteContactSettingWString(0, MODULE, buf, webOptions[i]->combo1.c_str());
+ db_set_ws(0, MODULE, buf, webOptions[i]->combo1.c_str());
}
if(webOptions[i]->isPastebin)
{
strcpy_s(buf + j, 256 - j, "pastebinUserKey");
- DBWriteContactSettingWString(0, MODULE, buf, webOptions[i]->pastebinUserKey.c_str());
+ db_set_ws(0, MODULE, buf, webOptions[i]->pastebinUserKey.c_str());
}
}
}
@@ -843,7 +843,7 @@ void Options::Save() void Options::Load()
{
DBVARIANT defWebV;
- if(!DBGetContactSettingWString(0, MODULE, "defWeb", &defWebV))
+ if(!db_get_ws(0, MODULE, "defWeb", &defWebV))
{
for(int i = 0; i < PasteToWeb::pages; ++i)
{
@@ -853,12 +853,12 @@ void Options::Load() break;
}
}
- DBFreeVariant(&defWebV);
+ db_free(&defWebV);
}
- codepage = DBGetContactSettingDword(0, MODULE, "codepage", CP_ACP);
- autoUTF = DBGetContactSettingByte(0, MODULE, "autoUTF", 1) ? true : false;
- confDlg = DBGetContactSettingByte(0, MODULE, "confDlg", 1) ? true : false;
- autoSend = DBGetContactSettingByte(0, MODULE, "autoSend", 0) ? true : false;
+ codepage = db_get_dw(0, MODULE, "codepage", CP_ACP);
+ autoUTF = db_get_b(0, MODULE, "autoUTF", 1) ? true : false;
+ confDlg = db_get_b(0, MODULE, "confDlg", 1) ? true : false;
+ autoSend = db_get_b(0, MODULE, "autoSend", 0) ? true : false;
for(int i = 0 ; i < PasteToWeb::pages; ++i)
{
char buf[256];
@@ -873,7 +873,7 @@ void Options::Load() strcpy_s(buf + j, 256 - j, "formats");
DBVARIANT forms;
- if(!DBGetContactSettingWString(0, MODULE, buf, &forms))
+ if(!db_get_ws(0, MODULE, buf, &forms))
{
webOptions[i]->formats.clear();
int k = 0;
@@ -899,37 +899,37 @@ void Options::Load() ++k;
}
- DBFreeVariant(&forms);
+ db_free(&forms);
}
strcpy_s(buf + j, 256 - j, "defFormatId");
DBVARIANT defForm;
- if(!DBGetContactSettingWString(0, MODULE, buf, &defForm))
+ if(!db_get_ws(0, MODULE, buf, &defForm))
{
webOptions[i]->defFormatId = defForm.pwszVal;
- DBFreeVariant(&defForm);
+ db_free(&defForm);
}
if(webOptions[i]->isSendFileName)
{
strcpy_s(buf + j, 256 - j, "sendFileName");
- webOptions[i]->sendFileName = DBGetContactSettingByte(0, MODULE, buf, 1) ? true : false;
+ webOptions[i]->sendFileName = db_get_b(0, MODULE, buf, 1) ? true : false;
}
if(webOptions[i]->isPublicPaste)
{
strcpy_s(buf + j, 256 - j, "publicPaste");
- webOptions[i]->publicPaste = DBGetContactSettingByte(0, MODULE, buf, 0) ? true : false;
+ webOptions[i]->publicPaste = db_get_b(0, MODULE, buf, 0) ? true : false;
}
if(webOptions[i]->isCombo1)
{
strcpy_s(buf + j, 256 - j, "combo1");
DBVARIANT combo1;
- if(!DBGetContactSettingWString(0, MODULE, buf, &combo1))
+ if(!db_get_ws(0, MODULE, buf, &combo1))
{
webOptions[i]->combo1 = combo1.pwszVal;
- DBFreeVariant(&combo1);
+ db_free(&combo1);
}
}
@@ -937,10 +937,10 @@ void Options::Load() {
strcpy_s(buf + j, 256 - j, "pastebinUserKey");
DBVARIANT pastebinUserKey;
- if(!DBGetContactSettingWString(0, MODULE, buf, &pastebinUserKey))
+ if(!db_get_ws(0, MODULE, buf, &pastebinUserKey))
{
webOptions[i]->pastebinUserKey = pastebinUserKey.pwszVal;
- DBFreeVariant(&pastebinUserKey);
+ db_free(&pastebinUserKey);
}
}
}
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index 7600d2a4bb..b2a5196a94 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -124,7 +124,7 @@ void PasteIt(HANDLE hContact, int mode) char *szProto = GetContactProto(hContact);
if (szProto && (INT_PTR)szProto != CALLSERVICE_NOTFOUND)
{
- BOOL isChat = DBGetContactSettingByte(hContact, szProto, "ChatRoom", 0);
+ BOOL isChat = db_get_b(hContact, szProto, "ChatRoom", 0);
if(Options::instance->autoSend)
{
if(!isChat)
@@ -328,26 +328,17 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) char *szProto = GetContactProto((HANDLE)wParam);
if (szProto && (INT_PTR)szProto != CALLSERVICE_NOTFOUND)
- bIsContact = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM) ? true : false;
-
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS;
-
- if (!bIsContact) mi.flags |= CMIF_HIDDEN;
- else mi.flags &= ~CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenu, (LPARAM)&mi);
+ bIsContact = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM) != 0;
+ Menu_ShowItem(hContactMenu, bIsContact);
return 0;
}
INT_PTR ContactMenuService(WPARAM wParam, LPARAM lParam)
{
if(lParam >= DEF_PAGES_START)
- {
Options::instance->SetDefWeb(lParam - DEF_PAGES_START);
- }
- else
- {
+ else {
HANDLE hContact = (HANDLE)wParam;
PasteIt(hContact, lParam);
}
@@ -437,7 +428,7 @@ int WindowEvent(WPARAM wParam, MessageWindowEventData* lParam) char *szProto = GetContactProto(lParam->hContact);
if (szProto && (INT_PTR)szProto != CALLSERVICE_NOTFOUND)
{
- if(DBGetContactSettingByte(lParam->hContact, szProto, "ChatRoom", 0))
+ if(db_get_b(lParam->hContact, szProto, "ChatRoom", 0))
{
(*contactWindows)[lParam->hContact] = lParam->hwndInput;
}
|