diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2013-01-18 17:53:47 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2013-01-18 17:53:47 +0000 |
commit | a95d0313e639fa16ee6e371d7a82d7d16e203d25 (patch) | |
tree | 3aecbbc71ba8d27f09716e2d8c5146deb56af0d5 /plugins/Boltun/src/boltun.cpp | |
parent | 4a34c6a6c70e52ff67d43f75ebdc68395bcc8e25 (diff) |
- Boltun: code cleanup (patch from person)
git-svn-id: http://svn.miranda-ng.org/main/trunk@3156 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Boltun/src/boltun.cpp')
-rw-r--r-- | plugins/Boltun/src/boltun.cpp | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index 42149db57a..59077852d3 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -213,7 +213,7 @@ static bool LoadMind(const TCHAR* filename, int &line) static bool BoltunAutoChat(HANDLE hContact)
{
- if (DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT
+ if (db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT
, FALSE) == TRUE)
return false;
@@ -232,11 +232,11 @@ static bool BoltunAutoChat(HANDLE hContact) return true;
}
- if ((DBGetContactSettingByte(hContact,"CList","NotOnList",0) == 1) &&
+ if ((db_get_b(hContact,"CList","NotOnList",0) == 1) &&
Config.TalkWithNotInList)
return true;
- if (DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT,
+ if (db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT,
FALSE) == TRUE)
return true;
@@ -366,7 +366,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR if(bTranslated)
Config.WarnText = c;
else
- Config.WarnText = TranslateTS(DEFAULT_WARN_TEXT);
+ Config.WarnText = DEFAULT_WARN_TEXT;
}
return TRUE;
}
@@ -424,8 +424,8 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = GetParent(hwndDlg);
- TCHAR* mind = TranslateTS(MIND_FILE_DESC);
- TCHAR* anyfile = TranslateTS(ALL_FILES_DESC);
+ TCHAR* mind = MIND_FILE_DESC;
+ TCHAR* anyfile = ALL_FILES_DESC;
size_t l = _tcslen(MIND_DIALOG_FILTER)
+ _tcslen(mind) + _tcslen(anyfile);
TCHAR *filt = new TCHAR[l];
@@ -471,7 +471,7 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP {
TCHAR* message = new TCHAR[5000];
wsprintf(message, TranslateTS(FAILED_TO_LOAD_BASE), line, c);
- MessageBox(NULL, message, TranslateTS(BOLTUN_ERROR), MB_ICONERROR|MB_TASKMODAL|MB_OK);
+ MessageBox(NULL, message, BOLTUN_ERROR, MB_ICONERROR|MB_TASKMODAL|MB_OK);
delete[] message;
}
break;
@@ -522,7 +522,7 @@ static int MessageOptInit(WPARAM wParam, LPARAM lParam) odp.position = 910000000;
odp.hInstance = hInst;
odp.pszGroup = BOLTUN_GROUP;
- odp.pszTitle = BOLTUN_NAME;
+ odp.pszTitle = Translate(BOLTUN_NAME);
odp.pfnDlgProc = MainDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_MAIN);
odp.pszTab = TAB_GENERAL;
@@ -538,8 +538,8 @@ static int ContactClick(WPARAM wParam, LPARAM lParam, BOOL clickNotToChat) {
HANDLE hContact = (HANDLE)wParam;
- BOOL boltunautochat = DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE);
- BOOL boltunnottochat = DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE);
+ BOOL boltunautochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE);
+ BOOL boltunnottochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE);
if (clickNotToChat)
{
@@ -558,12 +558,12 @@ static int ContactClick(WPARAM wParam, LPARAM lParam, BOOL clickNotToChat) }
else
{
- DBWriteContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_WARNED, FALSE);
+ db_set_b(hContact, BOLTUN_KEY, DB_CONTACT_WARNED, FALSE);
}
}
- DBWriteContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, (BYTE)boltunautochat);
- DBWriteContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, (BYTE)boltunnottochat);
+ db_set_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, (BYTE)boltunautochat);
+ db_set_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, (BYTE)boltunnottochat);
return 0;
}
@@ -590,7 +590,7 @@ static int MessagePrebuild(WPARAM wParam, LPARAM lParam) CLISTMENUITEM clmi = { sizeof(clmi) };
HANDLE hContact = (HANDLE)wParam;
- if (!blInit || (DBGetContactSettingByte(hContact,"CList","NotOnList",0) == 1))
+ if (!blInit || (db_get_b(hContact,"CList","NotOnList",0) == 1))
{
clmi.flags = CMIM_FLAGS | CMIF_GRAYED;
@@ -599,8 +599,8 @@ static int MessagePrebuild(WPARAM wParam, LPARAM lParam) }
else
{
- BOOL boltunautochat = DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE);
- BOOL boltunnottochat = DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE);
+ BOOL boltunautochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE);
+ BOOL boltunnottochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE);
clmi.flags = CMIM_FLAGS | CMIM_ICON | (boltunautochat ? CMIF_CHECKED : 0);
clmi.hIcon = LoadIcon( GetModuleHandle(NULL), MAKEINTRESOURCE((boltunautochat ? IDI_TICK : IDI_NOTICK)));
@@ -671,11 +671,10 @@ extern "C" int __declspec(dllexport) Load(void) if (!blInit)
{
TCHAR path[2000];
- wsprintf(path, TranslateTS(FAILED_TO_LOAD_BASE), line, (const TCHAR*)Config.MindFileName);
- MessageBox(NULL, path, TranslateTS(BOLTUN_ERROR), MB_ICONERROR|MB_TASKMODAL|MB_OK);
+ wsprintf(path, FAILED_TO_LOAD_BASE, line, (const TCHAR*)Config.MindFileName);
+ MessageBox(NULL, path, BOLTUN_ERROR, MB_ICONERROR|MB_TASKMODAL|MB_OK);
}
- /*record for Uninstall plugin*/
- DBWriteContactSettingString(NULL, "Uninstall", BOLTUN_NAME, BOLTUN_KEY);
+
return 0;
}
@@ -693,8 +692,8 @@ extern "C" int __declspec(dllexport) Unload(void) //So in case of saving error we will remain silent
#if 0
TCHAR path[MAX_PATH];
- wsprintf(path, TranslateTS(FAILED_TO_SAVE_BASE), (const TCHAR*)Config.MindFileName);
- TCHAR* err = TranslateTS(BOLTUN_ERROR);
+ wsprintf(path, FAILED_TO_SAVE_BASE, (const TCHAR*)Config.MindFileName);
+ TCHAR* err = BOLTUN_ERROR;
MessageBox(NULL, path, err, MB_ICONERROR|MB_TASKMODAL|MB_OK);*/
#endif
}
|